Include the appropriate connectors inside your provider settings:
Copy
Ask AI
import { EthereumWalletConnectors } from '@dynamic-labs/ethereum';import { SolanaWalletConnectors } from '@dynamic-labs/solana';import { SuiWalletConnectors } from '@dynamic-labs/sui';const connectors: [ EthereumWalletConnectors, SolanaWalletConnectors, SuiWalletConnectors, ],return ( <DynamicContextProvider settings={{ walletConnectors: connectors, }} > {/* Your app components */} </DynamicContextProvider>);
Now, once logged in, users will have an embedded wallet for each chain you have enabled. For more detailed options around wallet creation, see the Creating Wallets guide.
4
Use the Wallet Just Like Any Other
You can find plenty of examples in Using Wallets. Here’s a simple example of fetching the public and wallet client on Ethereum.
Access Functionality Through the Connector Directly
For certain functionality, you will need to access the connector directly and type it as a DynamicWaasEVMConnector, DynamicWaasSVMConnector or DynamicWaasSuiConnector.
Here’s an example for Ethereum.
Copy
Ask AI
import { isDynamicWaasConnector } from '@dynamic-labs/wallet-connector-core';if(!primaryWallet || !isDynamicWaasConnector(primaryWallet.connector)) { return;}const waasConnector = primaryWallet.connector;const walletAccount = await waasConnector.createWalletAccount();// get a wallet client for the wallet account by addressawait waasConnector.getWalletClientByAddress({ accountAddress: walletAccount.accountAddress,}); // Export the client keyshares, a txt file will be downloaded on the clientawait waasConnector.exportClientKeyshares({ accountAddress: walletAccount.accountAddress,});// Export the private key (requires a display container for security)await waasConnector.exportPrivateKey({ accountAddress: walletAccount.accountAddress, displayContainer: document.createElement('iframe'), // Replace with your secure container});// Import a private key to create a new walletconst importedWallet = await waasConnector.importPrivateKey({ privateKey: 'your-private-key-here', // Replace with actual private key});