Migration

New SDK Version

npm install @leapwallet/embedded-wallet-sdk-react@latest

From v0 to v1

  1. Aggregated View: This view allows dApp to choose multiple chains for which they can show aggregated balances.

  2. Addresses View: Address page allows user to view and copy addresses of chains for which balances are being showed.

  3. Action Button Customization: Providing more flexible action button usage by allowing to optionally hide them and change their ordering.

  4. Scan for more discoverable chains: When using chains which share coin-types with others chains which you might not have passed a record for, they will automatically be discovered and will be used in fetching balances. You can disable this by enabling restrictChains as false.

Now you can pass addresses and REST URLs of chains as follows:

<AccountModal
  theme="dark"
  chainRecords={chainData}
  isOpen={isModalOpen}
  onClose={closeModal}
/>

where chainData is a record of address and REST URL, having chain-id as their keys.

From v1 to v2

  1. Wallet Connection: Allows dApp to pass their wallet connection management hooks in order to control wallet connection from embedded wallet.

  2. Fetching balances from connected account: Instead of passing chain records, balances can be fetched using the connected chains via wallet connection itself. dApp can optionally pass a list of chain-ids to restrict balance fetching to only those chains.

All exported components like AccountModal and AccountView need to be enclosed by EmbeddedWalletProvider.

Last updated