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.

Constructors

RpcClient({required String rpcUrl})

Properties

hashCode int
The hash code for this object.
no setterinherited
rpcUrl String
The RPC endpoint URL used for all requests.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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, or null if 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 address in 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 to limit entries (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 mint held by address under the Token-2022 program (TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb).
getTokenAccountAddressesByOwner(String address, String mint) Future<List<String>>
Returns the public keys of all SPL token accounts owned by address for the given mint.
getTokenAccountsByOwner(String address, String mint) Future<BigInt>
Returns the token balance (in base units) for the first SPL token account owned by address for the given mint, 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 signatures in a single batch RPC request. Returns an empty list on failure.
hasToken22InGroup(String address, {required String groupAddress, required String mintAuthority}) Future<bool>
Returns true when address holds at least one Token-2022 NFT (decimals = 0, amount = 1) whose mint account indicates membership in groupAddress or whose mint authority equals mintAuthority.
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