Documentation Index
Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
Most of the wallet-related functions require you to pass a wallet account object.
If you want to get a wallet account object from an address, you can use the getWalletAccountFromAddress function.
The WalletAccount object will be successfully returned, as long as there is a wallet account associated to the address in the wallet accounts list.
Usage
import { getWalletAccountFromAddress } from '@dynamic-labs-sdk/client';
const findWalletAccount = async () => {
// Replace with the address and chain you want to find
const walletAccount = await getWalletAccountFromAddress({ address: '0x1234567890abcdef1234567890abcdef12345678', chain: 'eip155' });
console.log(walletAccount);
}
import { getWalletAccountFromAddress } from '@dynamic-labs-sdk/client';
import { useEffect, useState } from 'react';
function useWalletAccountFromAddress(address: string, chain: string) {
const [walletAccount, setWalletAccount] = useState(null);
useEffect(() => {
if (!address) return;
getWalletAccountFromAddress({ address, chain }).then(setWalletAccount);
}, [address, chain]);
return walletAccount;
}