HTTP transport for RPC calls.
Account public key to fetch.
Function that decodes raw bytes into type T.
RPC options (commitment, call overrides).
Decoded result, or null if the account doesn't exist.
import { getDecodedAccount } from '@oobe-protocol-labs/synapse-client-sdk/accounts';
import { decodeTokenAccount } from '@oobe-protocol-labs/synapse-client-sdk/decoders';
const result = await getDecodedAccount(transport, pubkey, decodeTokenAccount);
if (result) console.log(`Amount: ${result.decoded.amount}`);
Fetch a raw account and decode its data using the provided decoder.
This is the core building block for all typed account fetchers. It handles the RPC call, base64 decoding, and applies the decoder.