initializeAccount3 static method
Like InitializeAccount2, but does not require the Rent sysvar to be provided.
Keys:
[w]
account
- The account to initialize.[]
mint
- The mint this account will be associated with.
Data:
owner
- The new account's owner/multisignature.
Implementation
static TransactionInstruction initializeAccount3({
// Keys
required final Pubkey account,
required final Pubkey mint,
// Data
required final Pubkey owner,
}) {
// 0. `[writable]` The account to initialize.
// 1. `[]` The mint this account will be associated with.
final List<AccountMeta> keys = [
AccountMeta.writable(account),
AccountMeta(mint),
];
final List<Iterable<u8>> data = [
borsh.pubkey.encode(owner.toBase58()),
];
return _instance.createTransactionIntruction(
TokenInstruction.initializeAccount3,
keys: keys,
data: data,
);
}