getAccount
A builder function that returns the interaction to get an account by address.
Consider using the pre-built interaction 'fcl.account(address)' if you do not need to pair with any other builders.
Account address is a unique account identifier. Be mindful about the '0x' prefix, you should use the prefix as a default representation but be careful and safely handle user inputs without the prefix.
Import
You can import the entire package and access the function:
_10import * as sdk from "@onflow/sdk"_10_10sdk.getAccount(addr)
Or import directly the specific function:
_10import { getAccount } from "@onflow/sdk"_10_10getAccount(addr)
Usage
_10import * as fcl from "@onflow/fcl";_10_10// somewhere in an async function_10// fcl.account is the same as this function_10const getAccount = async (address) => {_10 const account = await fcl.send([fcl.getAccount(address)]).then(fcl.decode);_10 return account;_10};
Parameters
addr
- Type:
string
Returns
InteractionBuilderFn
_10export type InteractionBuilderFn = (_10 ix: Interaction_10) => Interaction | Promise<Interaction>