Class: Solace::ZarTrustlessEscrow::Instructions::TokenAccountInitInstruction
- Inherits:
-
Object
- Object
- Solace::ZarTrustlessEscrow::Instructions::TokenAccountInitInstruction
- Defined in:
- lib/solace/zar_trustless_escrow/instructions/token_account_init_instruction.rb
Overview
Encoder for the ‘token_account_init` instruction: initializes the per-mint program vault token account if it does not already exist.
Constant Summary collapse
- DISCRIMINATOR =
8-byte Anchor discriminator: SHA256(“global:token_account_init”).
[124, 4, 173, 7, 212, 208, 18, 239].freeze
Class Method Summary collapse
-
.build(mint_index:, program_token_account_index:, fee_payer_index:, system_program_index:, token_program_index:, program_index:) ⇒ Solace::Instruction
Builds a Solace::Instruction for ‘token_account_init`.
-
.data ⇒ Array<Integer>
Encodes the ‘token_account_init` instruction data (discriminator only — no args).
Class Method Details
.build(mint_index:, program_token_account_index:, fee_payer_index:, system_program_index:, token_program_index:, program_index:) ⇒ Solace::Instruction
Builds a Solace::Instruction for ‘token_account_init`.
Account indices are in the on-chain order:
mint, program_token_account, fee_payer, system_program, token_program.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/solace/zar_trustless_escrow/instructions/token_account_init_instruction.rb', line 18 def self.build( mint_index:, program_token_account_index:, fee_payer_index:, system_program_index:, token_program_index:, program_index: ) Solace::Instruction.new.tap do |ix| ix.program_index = program_index ix.accounts = [ mint_index, program_token_account_index, fee_payer_index, system_program_index, token_program_index ] ix.data = data end end |
.data ⇒ Array<Integer>
Encodes the ‘token_account_init` instruction data (discriminator only — no args).
42 43 44 |
# File 'lib/solace/zar_trustless_escrow/instructions/token_account_init_instruction.rb', line 42 def self.data DISCRIMINATOR.dup end |