Class: Solace::Instructions::Token2022::InitializeAccountInstruction
- Inherits:
-
Object
- Object
- Solace::Instructions::Token2022::InitializeAccountInstruction
- Defined in:
- lib/solace/instructions/token_2022/initialize_account_instruction.rb
Overview
Instruction for initializing a new Token-2022 token account.
Used in conjunction with the SystemProgram::CreateAccount instruction to create and initialize a new token account. For the common case of an associated token account, prefer AssociatedTokenAccount::CreateAccountInstruction.
Constant Summary collapse
- INSTRUCTION_INDEX =
[1].freeze
Instance Attribute Summary collapse
-
#INSTRUCTION_INDEX ⇒ Object
readonly
Instruction index for Token-2022’s InitializeAccount instruction.
Class Method Summary collapse
-
.build(account_index:, mint_index:, owner_index:, rent_sysvar_index:, program_index:) ⇒ Solace::Instruction
Builds a Token2022::InitializeAccount instruction.
-
.data ⇒ Array
Builds the data for a Token2022::InitializeAccount instruction.
Instance Attribute Details
#INSTRUCTION_INDEX ⇒ Object (readonly)
Instruction index for Token-2022’s InitializeAccount instruction.
26 |
# File 'lib/solace/instructions/token_2022/initialize_account_instruction.rb', line 26 INSTRUCTION_INDEX = [1].freeze |
Class Method Details
.build(account_index:, mint_index:, owner_index:, rent_sysvar_index:, program_index:) ⇒ Solace::Instruction
Builds a Token2022::InitializeAccount instruction.
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/solace/instructions/token_2022/initialize_account_instruction.rb', line 36 def self.build( account_index:, mint_index:, owner_index:, rent_sysvar_index:, program_index: ) Solace::Instruction.new.tap do |ix| ix.program_index = program_index ix.accounts = [account_index, mint_index, owner_index, rent_sysvar_index] ix.data = data end end |
.data ⇒ Array
Builds the data for a Token2022::InitializeAccount instruction.
The BufferLayout is:
- [Instruction Index (1 byte)]
56 57 58 |
# File 'lib/solace/instructions/token_2022/initialize_account_instruction.rb', line 56 def self.data INSTRUCTION_INDEX end |