• Fetch and decode a single SPL Token account.

    Automatically detects Token vs Token-2022 from the on-chain owner and applies the appropriate decoder (including extensions for 2022).

    Parameters

    Returns Promise<FetchedTokenAccount | null>

    Decoded token account, or null if not found.

    const acct = await fetchTokenAccount(transport, tokenAccountPubkey);
    if (acct) console.log(`Balance: ${acct.decoded.amount}, Mint: ${acct.decoded.mint}`);

    1.1.0