SystemInstruction.withdrawNonceAccount constructor
SystemInstruction.withdrawNonceAccount({
- required Ed25519HDPublicKey nonce,
- required Ed25519HDPublicKey nonceAuthority,
- required Ed25519HDPublicKey recipient,
- required int lamports,
Withdraw funds from a nonce
account.
Implementation
factory SystemInstruction.withdrawNonceAccount({
required Ed25519HDPublicKey nonce,
required Ed25519HDPublicKey nonceAuthority,
required Ed25519HDPublicKey recipient,
required int lamports,
}) =>
SystemInstruction._(
accounts: [
AccountMeta.writeable(pubKey: nonce, isSigner: false),
AccountMeta.writeable(pubKey: recipient, isSigner: false),
AccountMeta.readonly(
pubKey: Ed25519HDPublicKey.fromBase58(Sysvar.recentBlockHashes),
isSigner: false,
),
AccountMeta.readonly(
pubKey: Ed25519HDPublicKey.fromBase58(Sysvar.rent),
isSigner: false,
),
AccountMeta.readonly(pubKey: nonceAuthority, isSigner: true),
],
data: ByteArray.merge([
SystemProgram.withdrawNonceAccountInstructionIndex,
ByteArray.u64(lamports),
]),
);