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. |
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 |