❗ Legacy Wallet Client Setup
Quickly setup a few thing to get you up and running in 15 minutes
We have removed the Wallet Client API in v1.3.0, but have kept these docs for legacy support. For newer versions, please skip this doc. If you're migrating from a previous version, read more here.
Elements requires a few wallet methods to work. We have created an interface so that you can bring your own wallet (BYOW) and elements will always work!
For this purpose, elements needs you to pass in a wallet client.
WalletClient
This is an object that has the following methods that the elements components use:
enable
: function that enables chain(s) on the wallet.getAccount
: function that returns the account for a given chain idgetSigner
: function that returns a signer for a given chain idnetwork
: network settings for the SDK (this is optional and by default set tomainnet
)We export a
NETWORK
enum from elements which you can use to set this property
Here's the interface:
Setup
You can do a custom implementation of wallet client. We have created examples of wallet clients with the most common wallet adapters in cosmos.
Cosmos Kit
WalletConfig
This is an object that has methods and properties that the Elements components use:
userAddress
string | undefined
Description - user's address for the primary connected chain. If undefined is passed, it is inferred as the wallet no connected state.
walletClient
WalletClient
Description - wallet client described above to sign transactions
connectWallet
(chainId?: string) => Promise<void>
Description - let's Elements trigger your dApps' wallet connection flow, accepts an optional chain ID parameter to specify which chain to connect with.
CosmosKit Setup Contd.
Last updated