RpcClient class
Low-level Solana JSON-RPC client.
Wraps common RPC methods with automatic retries (up to 3 attempts) and exponential back-off on HTTP 429 or transient network failures.
Properties
Methods
-
getAccountData(
String address) → Future< Uint8List?> -
Returns the raw account data bytes for
address, or null if the account does not exist. Used for on-chain SNS record parsing. -
getAccountInfo(
String address) → Future< Map< String, dynamic> ?> -
Returns the parsed account info for
address, ornullif the account does not exist or the request fails. -
getAssetsByOwner(
String address, {int limit = 1000, bool showFungible = false}) → Future< List> -
Helius DAS: returns all digital assets (including Token-2022 NFTs/tokens)
owned by
address. Params sent as a JSON object (DAS API convention). -
getBalance(
String address) → Future< BigInt> -
Returns the SOL balance of
addressin lamports (confirmed commitment). -
getLatestBlockhash(
) → Future< String> - Fetches the latest blockhash string from the cluster.
-
getSignaturesForAddress(
String address, {int limit = 20}) → Future< List< TxSignature> > -
Returns the most recent transaction signatures involving
address, up tolimitentries (default 20). -
getSignatureStatuses(
List< String> sigs) → Future<List< TxStatus> > -
Returns confirmation statuses for each signature in
sigs. -
getToken22BalanceByMint(
String address, String mint) → Future< BigInt> -
Returns the token balance for
mintheld byaddressunder the Token-2022 program (TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb). -
getTokenAccountAddressesByOwner(
String address, String mint) → Future< List< String> > -
Returns the public keys of all SPL token accounts owned by
addressfor the givenmint. -
getTokenAccountsByOwner(
String address, String mint) → Future< BigInt> -
Returns the token balance (in base units) for the first SPL token account
owned by
addressfor the givenmint, or BigInt.zero if none exist. -
getTransaction(
String signature) → Future< Map< String, dynamic> ?> -
Fetches the full transaction detail for
signature. -
getTransactions(
List< String> signatures) → Future<List> -
Fetches transaction details for multiple
signaturesin a single batch RPC request. Returns an empty list on failure. -
hasToken22InGroup(
String address, {required String groupAddress, required String mintAuthority}) → Future< bool> -
Returns
truewhenaddressholds at least one Token-2022 NFT (decimals = 0, amount = 1) whose mint account indicates membership ingroupAddressor whose mint authority equalsmintAuthority. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendTransaction(
Uint8List signedBytes) → Future< String> - Submits a signed, base64-encoded transaction and returns its signature.
-
simulateTransaction(
Uint8List txBytes) → Future< SimulationResult> -
Simulates
txBytes(base64-encoded) and returns the simulation outcome. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited