There are two aspects of the wallet object that are useful to know about:
  1. The wallet object itself
  2. The connector object

Wallet Interface

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.
FieldDescription
additionalAddresses: WalletAdditionalAddress[]Additional addresses associated to the wallet (e.g. ordinals and payment addresses for bitcoin wallets)
address: stringPublic address of the connected wallet
chain: stringCurrent BlockChain name (e.g: ‘ETH’, ‘SOL’, ‘BTC’, etc)
connector: WalletConnectorThe wallet connector object
id: stringThe wallet’s unique id (matches thw wallet verified credential on connect-anf-sign)
isAuthenticated: booleanTrue if the user is authenticated, otherwise it’s false
key: stringThe wallet key (e.g. metamask, phantom, etc)
MethodDescription
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.

WalletConnector Interface

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.
FieldDescription
canConnectViaCustodialService: booleanIf the wallet needs to be connected via a custodial service such as Blocto, this will be true.
canConnectViaQrCode: booleanIf the wallet is not installed, and can be connected via a QR code, this will be true.
canConnectViaSocial: booleanWhether this connector can be connected via social login.
chainRpcProviders: typeof ChainRpcProviders | undefinedThe RPC providers for the chain the wallet is connected to
connectedChain: ChainThe 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 | undefinedGet the deep link of the wallet
getMobileOrInstalledWallet(): WalletConnectorWhether 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: booleanIf the wallet provider is available (i.e. Metamask is not installed)
isEmbeddedWallet: booleanIf the wallet generated by a valid embedded wallet provider
isInitialized: booleanWhether the connector has been initialized
isInstalledOnBrowser(): booleanCheck if the wallet is installed on the browser
isWalletConnect: booleanFlag if it is wallet Connect
key: stringOverride 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[] | undefinedAdditional resources to add to the message to be signed
supportsNetworkSwitching():booleanWhether the wallet supports network switching
switchNetworkOnlyFromWallet: boolean | undefinedRequires switching network in the wallet itself

Chain specific interfaces