useFirstAddress
@coinbase/waas-sdk-web-react • API
Function: useFirstAddress()
useFirstAddress<
TProtocol>(wallet,protocolFamily):undefined|Address<TProtocol>
Provides the first address on the given protocol family for this wallet.
Type parameters
• TProtocol extends string
Parameters
• wallet: undefined | Wallet
The wallet, as returned from useWalletContext
• protocolFamily: TProtocol
The protocol family the address should be usable on. See ProtocolFamily
Returns
undefined | Address<TProtocol>
Returns an Address when it is ready (undefined while deriving...)
Example
const {wallet} = useWalletContext();
const address = useFirstAddress(wallet, ProtocolFamily.EVM);