SolanaClient class

Available extensions

Constructors

SolanaClient.new({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, TokenProgramType tokenProgramType = TokenProgramType.tokenProgram, 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.
createSolanaPayMessage({required Ed25519HDKeyPair payer, required Ed25519HDPublicKey recipient, required Decimal amount, Ed25519HDPublicKey? splToken, Iterable<Ed25519HDPublicKey>? reference, String? memo, Commitment commitment = Commitment.finalized}) Future<Message>

Available on SolanaClient, provided by the SolanaClientSolanaPay extension

Creates Solana Pay transaction from payer to recipient.
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.
findSolanaPayTransaction({required Ed25519HDPublicKey reference, Commitment commitment = Commitment.finalized}) Future<TransactionId?>

Available on SolanaClient, provided by the SolanaClientSolanaPay extension

Finds the oldest transaction signature referencing a given public key.
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, TokenProgramType tokenProgramType = TokenProgramType.tokenProgram, 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, TokenProgramType tokenProgramType = TokenProgramType.tokenProgram, 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
processSolanaPayTransactionRequest({required String transaction, required Ed25519HDPublicKey signer, Commitment commitment = Commitment.finalized, bool ignoreSignerVerification = false}) Future<SignedTx>

Available on SolanaClient, provided by the SolanaClientSolanaPay extension

Processes the transaction from a Solana Pay transaction request link.
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.
sendSolanaPay({required Ed25519HDKeyPair payer, required Ed25519HDPublicKey recipient, required Decimal amount, Ed25519HDPublicKey? splToken, Iterable<Ed25519HDPublicKey>? reference, String? memo, SignatureCallback? onSigned, Commitment commitment = Commitment.finalized}) Future<TransactionId>

Available on SolanaClient, provided by the SolanaClientSolanaPay extension

Creates, signs and sends Solana Pay transaction from payer to recipient.
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, TokenProgramType tokenProgram = TokenProgramType.tokenProgram}) 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.
validateSolanaPayTransaction({required TransactionId signature, required Ed25519HDPublicKey recipient, required Decimal amount, Ed25519HDPublicKey? splToken, Iterable<Ed25519HDPublicKey>? reference, TokenProgramType tokenProgramType = TokenProgramType.tokenProgram, Commitment commitment = Commitment.finalized}) Future<TransactionDetails>

Available on SolanaClient, provided by the SolanaClientSolanaPay extension

Validates that a given transaction signature corresponds with a transaction containing a valid Solana Pay transfer.
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