Last updated
Last updated
With the Embedded Wallet SDK, you can supercharge your dApp’s UX. It is super easy to integrate and completely customisable to meet your dApp’s styles. It also helps solve the current Snaps limitations and integrating this will allow users to view their balances, manage their assets, and more.
Here is the type definition of Config
:
To fetch user balances, you can use useRichBalance
hook.
Parameters -
address
- the wallet address your querying the balance for
chainId
- self explanatory
restUrl
(optional) - custom rest url for the node
To fetch balances across multiple chains, you can use
Parameters -
aggregatedChainData
- chain records which you provide account modal to fetch balances
key
- optional, key for SWR configuration
Parameters -
address
- the wallet address your querying the balance for
chainId
- self explanatory
restUrl
(optional) - custom rest url for the node
Return Value -
The activityQuery.data.pages
field will be a list of objects with the following fields -
Usage Example -
Using the activity data
Triggering the next (data) page load using the last element on the list
In case you want to create your own UI in react, we have exposed the react hooks that we use internally. If you are not using react, then you can check out the .
For making queries, we primarily use , so a lot of return values from hooks will have the same return type (except for the data).
swrConfiguration
(optional) - configure your swr query, click for more information
To fetch user activity, you can use useActivity
hook. The return type of a @tanstack/react-query
hook.
theme
"light" | "dark"
Theme of the modal
chainRecords
Record<string, { address: string; restUrl?: string, coinType?: string }> | null
. Key is chainId
Record of addresses and REST URLs corresponding to given chain ID.
isOpen
boolean
Whether the modal is open
onClose
() => void
Callback function when the modal is closed
config
Config
Config of the modal
height
string
Height of the component
width
string
Width of the component
enableWalletConnect
boolean
When true, wallet connection can be controlled via embedded wallet
restrictChains
boolean
Defaults to false, shows balances of all discoverable chains. Passing this as true restricts to only fetching balances for specified chains.