SolanaClient class

Available extensions

Constructors

SolanaClient({required Uri rpcUrl, required Uri websocketUrl, Duration timeout = const Duration(seconds: 30)})

Properties

hashCode int
The hash code for this object.
no setterinherited
rpcClient RpcClient
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createAssociatedTokenAccount({Ed25519HDPublicKey? owner, required Ed25519HDPublicKey mint, required Wallet funder, SignatureCallback? onSigned, Commitment commitment = Commitment.finalized}) Future<ProgramAccount>

Available on SolanaClient, provided by the SolanaClientAssociatedTokenAccontProgram extension

Create the account associated to the SPL token mint for this wallet.
createSubscriptionClient({Duration? pingInterval, Duration? connectTimeout}) SubscriptionClient
createTokenAccount({required Ed25519HDPublicKey mint, required Wallet account, required Wallet creator, SignatureCallback? onSigned, Commitment commitment = Commitment.finalized}) Future<Account>

Available on SolanaClient, provided by the SolanaClientAssociatedTokenAccontProgram extension

Create an account for account.
getAssociatedTokenAccount({required Ed25519HDPublicKey owner, required Ed25519HDPublicKey mint, Commitment commitment = Commitment.finalized}) Future<ProgramAccount?>

Available on SolanaClient, provided by the SolanaClientAssociatedTokenAccontProgram extension

getMinimumBalanceForMintRentExemption({Commitment? commitment}) Future<int>

Available on SolanaClient, provided by the SolanaClientTokenProgram extension

Get the minimum lamport balance for a rent-exempt mint.
getMint({required Ed25519HDPublicKey address, Commitment commitment = Commitment.finalized}) Future<Mint>

Available on SolanaClient, provided by the SolanaClientTokenProgram extension

Gets information about mint with address public key.
getTokenBalance({required Ed25519HDPublicKey owner, required Ed25519HDPublicKey mint, Commitment commitment = Commitment.finalized}) Future<TokenAmount>

Available on SolanaClient, provided by the SolanaClientAssociatedTokenAccontProgram extension

Get token mint balance for this wallet's account.
hasAssociatedTokenAccount({required Ed25519HDPublicKey owner, required Ed25519HDPublicKey mint, Commitment commitment = Commitment.finalized}) Future<bool>

Available on SolanaClient, provided by the SolanaClientAssociatedTokenAccontProgram extension

Whether this wallet has an associated token account for the SPL token mint.
initializeMint({required Ed25519HDKeyPair mintAuthority, required int decimals, Ed25519HDPublicKey? freezeAuthority, SignatureCallback? onSigned, Commitment commitment = Commitment.finalized}) Future<Mint>

Available on SolanaClient, provided by the SolanaClientTokenProgram extension

Create a new token owned by mintAuthority with number of decimals.
mintTo({required Ed25519HDPublicKey mint, required Ed25519HDPublicKey destination, required int amount, required Ed25519HDKeyPair authority, SignatureCallback? onSigned, Commitment commitment = Commitment.finalized}) Future<TransactionId>

Available on SolanaClient, provided by the SolanaClientTokenProgram extension

Mint destination with amount tokens.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestAirdrop({required Ed25519HDPublicKey address, required int lamports, Commitment commitment = Commitment.finalized}) Future<String>

Available on SolanaClient, provided by the SolanaClientSystemProgram extension

Request airdrop for lamports amount to this wallet's account.
sendAndConfirmTransaction({required Message message, required List<Ed25519HDKeyPair> signers, SignatureCallback onSigned = ignoreOnSigned, required Commitment commitment}) Future<TransactionId>
Signs, sends and confirms a transaction.
toString() String
A string representation of this object.
inherited
transferLamports({required Ed25519HDKeyPair source, required Ed25519HDPublicKey destination, required int lamports, String? memo, SignatureCallback? onSigned, Commitment commitment = Commitment.finalized}) Future<TransactionId>

Available on SolanaClient, provided by the SolanaClientSystemProgram extension

Creates a solana transfer message to send lamports SOL tokens from source to destination.
transferSplToken({required Ed25519HDPublicKey mint, required Ed25519HDPublicKey destination, required int amount, required Wallet owner, String? memo, SignatureCallback? onSigned, Commitment commitment = Commitment.finalized}) Future<TransactionId>

Available on SolanaClient, provided by the SolanaClientTokenProgram extension

Transfers amount SPL token with mint from this wallet to the destination address with an optional memo.
waitForSignatureStatus(String signature, {required ConfirmationStatus status, Duration? timeout, Duration? pingInterval}) Future<void>
Waits for transation with signature to reach status. Throws exception if transaction failed.

Operators

operator ==(Object other) bool
The equality operator.
inherited