• Fetch parsed account data for a given public key.

    Type Parameters

    • D = string

      The expected shape of the parsed account data

    Parameters

    • t: HttpTransport

      HTTP transport instance

    • pubkey: never

      Base-58 encoded public key to query

    • opts: GetAccountInfoOpts = {}

      Encoding, data-slice, commitment, and other call options

    Returns Promise<RpcContext<AccountInfo<D> | null>>

    Context-wrapped account info, or null if the account does not exist

    const { context, value } = await getAccountInfo(transport, pubkey);
    if (value) console.log(`Owner: ${value.owner}`);

    1.0.0