Overview
The Embedded Wallet Kit provides a straightforward way to create and manage embedded wallets in your React application. EWK offers function abstractions to easily create embedded wallets, derive accounts, import and export wallets and more. Before we start, ensure you’re familiar with the concepts of Wallets and Wallet Accounts.Creating an embedded wallet
After your user has authenticated, you can create an embedded wallet using thecreateWallet function from the useTurnkey hook. This will create a new wallet within the end-user’s sub-organization with one Ethereum and one Solana wallet account.
wallets array in the useTurnkey hook, which contains all embedded wallets associated with the sub-organization and all linked external wallets. This array is updated automatically when wallets are created, updated or removed.
refreshWallets function from the useTurnkey hook.
Creating wallet accounts
You can specify which accounts to create in the wallet by passing an array of account formats or account objects to theaccounts parameter.
Using address formats
You can use predefined account formats to create accounts in the wallet. The wallet account will be automatically created with the correct path and path index based on the existing wallet the sub-organization has.Using account objects
You can also create accounts by passing an array of account objects. This allows you to specify thecurve, pathFormat, path, and addressFormat.
After wallet creation
You can use thecreateWalletAccount function to add more accounts to an existing wallet.
Importing and exporting wallets
You can also import and export wallets using thehandleImportWallet and handleExportWallet functions. These functions open up UI modals that allows users to export or import wallets through a secure iframe.
You can learn more about importing using an iframe and exporting using an iframe before continuing.

