![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@xlabs-libs/wallet-aggregator-react
Advanced tools
A library to help integrate the sdk to a react project.
A library to help integrate the sdk to a react project.
The library supplies a WaletContextProvider
which will hold information related to the available wallets and selected wallets, as well as the hooks needed to access and configure. While the context holds a "main" or "default" wallet which belongs to a single chain, it allows to keep track of wallets from multiple chains at the same time.
Wrap the application in the WalletContextProvider
component. The provider expects a prop wallets
which is either a map of Wallet
arrays indexed by chain id or a function which builds such map.
Using a map:
import {
CHAIN_ID_ALGORAND,
CHAIN_ID_ETH,
CHAIN_ID_SOME_CHAIN,
} from "@xlabs/wallet-aggregator-core";
import { MyAlgoWallet } from "@xlabs/wallet-aggregator-algorand";
import {
MetamaskWallet,
WalletConnectWallet,
} from "@xlabs/wallet-aggregator-algorand";
import { SomeWallet } from "@xlabs/wallet-aggregator-some-chain";
import { WalletContextProvider } from "@xlabs/wallet-aggregator-react";
type AvailableWalletsMap = Partial<Record<ChainId, Wallet[]>>;
const Main = () => {
const wallets: AvailableWalletsMap = {
[CHAIN_ID_ALGORAND]: [new MyAlgoWallet()],
[CHAIN_ID_ETH]: [new MetamaskWallet(), new WalletConnectWallet()],
};
return (
<WalletContextProvider wallets={wallets}>
<App />
</WalletContextProvider>
);
};
Using a function:
import {
CHAIN_ID_ALGORAND,
CHAIN_ID_ETH,
CHAIN_ID_SOME_CHAIN,
} from "@xlabs/wallet-aggregator-core";
import { MyAlgoWallet } from "@xlabs/wallet-aggregator-algorand";
import {
MetamaskWallet,
WalletConnectWallet,
} from "@xlabs/wallet-aggregator-algorand";
import { SomeWallet } from "@xlabs/wallet-aggregator-some-chain";
import { WalletContextProvider } from "@xlabs/wallet-aggregator-react";
type AvailableWalletsMap = Partial<Record<ChainId, Wallet[]>>;
const Main = () => {
const walletsBuilder = (): Promise<AvailableWalletsMap> => {
const someChainParams = await fetchSomeChainParams();
return {
[CHAIN_ID_ALGORAND]: [new MyAlgoWallet()],
[CHAIN_ID_ETH]: [new MetamaskWallet(), new WalletConnectWallet()],
[CHAIN_ID_SOME_CHAIN]: [new SomeWallet(someChainParams)],
};
};
return (
<WalletContextProvider wallets={walletsBuilder}>
<App />
</WalletContextProvider>
);
};
A set of react hooks are supplied. These are:
// Retrieve the current wallet, returns undefined if not set
const wallet: Wallet | undefined = useWallet();
// Retrieve the wallet from a given chain, returns undefined if not set
const walletFromChain: Wallet | undefined = useWalletFromChain(chainId);
// Retrieve all available wallets for a given chain
const walletsForChain = useWalletsForChain(chainId);
// Retrieve all available Wallets
const allWallets: AvailableWalletsMap = useAvailableWallets();
// Retrieve all available chains
const chains: ChainId[] = useAvailableChains();
// Returns a function used to set the current wallet
const changeWallet = useChangeWallet();
const wallet: Wallet = new MyWallet();
changeWallet(wallet);
// Returns a function used to unset the wallet from a given chain
// If the removed wallet is the "default" or "current" wallet, it
// selects the next available wallet to be the new default
const unsetWalletFromChain = useUnsetWalletFromChain();
unsetWalletFromChain(chainId);
FAQs
A library to help integrate the sdk to a react project.
The npm package @xlabs-libs/wallet-aggregator-react receives a total of 15 weekly downloads. As such, @xlabs-libs/wallet-aggregator-react popularity was classified as not popular.
We found that @xlabs-libs/wallet-aggregator-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.