There are two aspects of the wallet object that are useful to know about:
The wallet is akin to a single account on your Wallet provider. For example, in Metamask, you can have multiple accounts, each with their own public address.
You can also have multiple chains associated with a single account in your wallet provider, for example in Magic Eden, you can have “Account 1”, which has a public address for Solana, another for Bitcoin, etc. Each of these chain addresses are mapped to a different wallet object in Dynamic.
You’ll find props and methods for a wallet object are specific to interacting with a single account/sub-account (i.e. for a single chain) on your wallet provider.
For example, getBalance, or signMessage interact with a single account/subaccount.
Below we outline the generic props and methods for a wallet object no matter what chain the account belongs to.
In each chain specific section, we also outline the props and methods for a wallet object for that chain.
Wallet props
Field | Description |
---|---|
additionalAddresses: WalletAdditionalAddress[] | Additional addresses associated to the wallet (e.g. ordinals and payment addresses for bitcoin wallets) |
address: string | Public address of the connected wallet |
chain: string | Current BlockChain name (e.g: ‘ETH’, ‘SOL’, ‘BTC’, etc) |
connector: WalletConnector | The wallet connector object |
id: string | The wallet’s unique id (matches thw wallet verified credential on connect-anf-sign) |
isAuthenticated: boolean | True if the user is authenticated, otherwise it’s false |
key: string | The wallet key (e.g. metamask, phantom, etc) |
Wallet methods
Method | Description |
---|---|
getBalance(): Promise<string | undefined> | Retrieves the balance of the wallet. |
getNameService(): Promise<NameServiceData | undefined> | Retrieves the name service data associated with the wallet. |
getNetwork(): Promise<string | number | undefined> | Retrieves the network value. (e.g: 1, 137, ‘mainnet’) |
isConnected(): Promise<boolean> | If the wallet is connected. |
proveOwnership(messageToSign: string): Promise<string\ | undefined> | Proves ownership of the wallet by signing a message. |
signMessage(messageToSign: string): Promise<string\ | undefined> | Signs a message using the wallet. |
switchNetwork(networkChainId: number | string): Promise<void> | Switches the network that the wallet is connected to. |
sync(): Promise<void> | Prompts the user to reconnect the wallet if not connected and only resolves when the wallet is connected and active. |
The connector is akin to the wallet provider itself i.e. Metamask, Phantom, etc. It is abstracted away from any single account. Therefore you’ll find methods and props that are relevant to the wallet provider itself like isInstalledOnBrowser, or getDeepLink.
Below we outline the props and methods for a wallet connector object no matter what chain the account belongs to. In each chain specific section, we also outline the props and methods for a wallet connector object for that chain.
Connector Interface
Field | Description |
---|---|
canConnectViaCustodialService: boolean | If the wallet needs to be connected via a custodial service such as Blocto, this will be true. |
canConnectViaQrCode: boolean | If the wallet is not installed, and can be connected via a QR code, this will be true. |
canConnectViaSocial: boolean | Whether this connector can be connected via social login. |
chainRpcProviders: typeof ChainRpcProviders | undefined | The RPC providers for the chain the wallet is connected to |
connectedChain: Chain | The chain this wallet is connected to |
endSession(): Promise<void> | Close the wallet connection |
getAddress(opts?: GetAddressOpts): Promise<string | undefined> | Get the public address of the wallet |
getAdditionalAddresses(mainAddress?: string): Promise<WalletAdditionalAddress[]> | Get the additional addresses of the wallet, given the main address |
getConnectedAccounts(): Promise<string[]> | Get the address silently |
getDeepLink(): string | undefined | Get the deep link of the wallet |
getMobileOrInstalledWallet(): WalletConnector | Whether the wallet connector should fall back to a different wallet connector |
getNetwork(): Promise<string | | number | undefined> | Get the current network of the wallet |
getSession(): unknown | Promise<T> | Get the session for the wallet |
isAvailable: boolean | If the wallet provider is available (i.e. Metamask is not installed) |
isEmbeddedWallet: boolean | If the wallet generated by a valid embedded wallet provider |
isInitialized: boolean | Whether the connector has been initialized |
isInstalledOnBrowser(): boolean | Check if the wallet is installed on the browser |
isWalletConnect: boolean | Flag if it is wallet Connect |
key: string | Override key or the normalized wallet name if needed |
proveOwnership(messageToSign: string): Promise<string | undefined> | In most cases this is an alias for signMessage |
providerResources: string[] | undefined | Additional resources to add to the message to be signed |
supportsNetworkSwitching():boolean | Whether the wallet supports network switching |
switchNetworkOnlyFromWallet: boolean | undefined | Requires switching network in the wallet itself |
There are two aspects of the wallet object that are useful to know about:
The wallet is akin to a single account on your Wallet provider. For example, in Metamask, you can have multiple accounts, each with their own public address.
You can also have multiple chains associated with a single account in your wallet provider, for example in Magic Eden, you can have “Account 1”, which has a public address for Solana, another for Bitcoin, etc. Each of these chain addresses are mapped to a different wallet object in Dynamic.
You’ll find props and methods for a wallet object are specific to interacting with a single account/sub-account (i.e. for a single chain) on your wallet provider.
For example, getBalance, or signMessage interact with a single account/subaccount.
Below we outline the generic props and methods for a wallet object no matter what chain the account belongs to.
In each chain specific section, we also outline the props and methods for a wallet object for that chain.
Wallet props
Field | Description |
---|---|
additionalAddresses: WalletAdditionalAddress[] | Additional addresses associated to the wallet (e.g. ordinals and payment addresses for bitcoin wallets) |
address: string | Public address of the connected wallet |
chain: string | Current BlockChain name (e.g: ‘ETH’, ‘SOL’, ‘BTC’, etc) |
connector: WalletConnector | The wallet connector object |
id: string | The wallet’s unique id (matches thw wallet verified credential on connect-anf-sign) |
isAuthenticated: boolean | True if the user is authenticated, otherwise it’s false |
key: string | The wallet key (e.g. metamask, phantom, etc) |
Wallet methods
Method | Description |
---|---|
getBalance(): Promise<string | undefined> | Retrieves the balance of the wallet. |
getNameService(): Promise<NameServiceData | undefined> | Retrieves the name service data associated with the wallet. |
getNetwork(): Promise<string | number | undefined> | Retrieves the network value. (e.g: 1, 137, ‘mainnet’) |
isConnected(): Promise<boolean> | If the wallet is connected. |
proveOwnership(messageToSign: string): Promise<string\ | undefined> | Proves ownership of the wallet by signing a message. |
signMessage(messageToSign: string): Promise<string\ | undefined> | Signs a message using the wallet. |
switchNetwork(networkChainId: number | string): Promise<void> | Switches the network that the wallet is connected to. |
sync(): Promise<void> | Prompts the user to reconnect the wallet if not connected and only resolves when the wallet is connected and active. |
The connector is akin to the wallet provider itself i.e. Metamask, Phantom, etc. It is abstracted away from any single account. Therefore you’ll find methods and props that are relevant to the wallet provider itself like isInstalledOnBrowser, or getDeepLink.
Below we outline the props and methods for a wallet connector object no matter what chain the account belongs to. In each chain specific section, we also outline the props and methods for a wallet connector object for that chain.
Connector Interface
Field | Description |
---|---|
canConnectViaCustodialService: boolean | If the wallet needs to be connected via a custodial service such as Blocto, this will be true. |
canConnectViaQrCode: boolean | If the wallet is not installed, and can be connected via a QR code, this will be true. |
canConnectViaSocial: boolean | Whether this connector can be connected via social login. |
chainRpcProviders: typeof ChainRpcProviders | undefined | The RPC providers for the chain the wallet is connected to |
connectedChain: Chain | The chain this wallet is connected to |
endSession(): Promise<void> | Close the wallet connection |
getAddress(opts?: GetAddressOpts): Promise<string | undefined> | Get the public address of the wallet |
getAdditionalAddresses(mainAddress?: string): Promise<WalletAdditionalAddress[]> | Get the additional addresses of the wallet, given the main address |
getConnectedAccounts(): Promise<string[]> | Get the address silently |
getDeepLink(): string | undefined | Get the deep link of the wallet |
getMobileOrInstalledWallet(): WalletConnector | Whether the wallet connector should fall back to a different wallet connector |
getNetwork(): Promise<string | | number | undefined> | Get the current network of the wallet |
getSession(): unknown | Promise<T> | Get the session for the wallet |
isAvailable: boolean | If the wallet provider is available (i.e. Metamask is not installed) |
isEmbeddedWallet: boolean | If the wallet generated by a valid embedded wallet provider |
isInitialized: boolean | Whether the connector has been initialized |
isInstalledOnBrowser(): boolean | Check if the wallet is installed on the browser |
isWalletConnect: boolean | Flag if it is wallet Connect |
key: string | Override key or the normalized wallet name if needed |
proveOwnership(messageToSign: string): Promise<string | undefined> | In most cases this is an alias for signMessage |
providerResources: string[] | undefined | Additional resources to add to the message to be signed |
supportsNetworkSwitching():boolean | Whether the wallet supports network switching |
switchNetworkOnlyFromWallet: boolean | undefined | Requires switching network in the wallet itself |