Class: Solace::Composers::AssociatedTokenAccountProgramCreateIdempotentAccountComposer
- Inherits:
-
AssociatedTokenAccountProgramCreateAccountComposer
- Object
- Base
- AssociatedTokenAccountProgramCreateAccountComposer
- Solace::Composers::AssociatedTokenAccountProgramCreateIdempotentAccountComposer
- Defined in:
- lib/solace/composers/associated_token_account_program_create_idempotent_account_composer.rb
Overview
Composer for creating an associated token account program create account instruction with idempotency
This composer resolves and orders the required accounts for a
CreateIdempotentAssociatedTokenAccount instruction,
sets up their access permissions, and delegates construction to the appropriate
instruction builder (Instructions::AssociatedTokenAccount::CreateIdempotentAssociatedTokenAccountInstruction).
Required accounts:
- Funder: the account that will pay for fees and rent.
- Owner: the account that will own the new ATA.
- ATA: the address of the new ATA.
- Mint: the mint address of the token.
- System Program: the system program id.
- Token Program: the token program id.
- Associated Token Account Program: the associated token account program id.
rubocop:disable Layout
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#build_instruction(account_context) ⇒ Solace::Instruction
Builds the instruction for the associated token account program create account instruction.
Methods inherited from AssociatedTokenAccountProgramCreateAccountComposer
#associated_token_account_program_id, #ata_address, #funder, #mint, #owner, #setup_accounts, #system_program_id, #token_program_id
Methods inherited from Base
Constructor Details
This class inherits a constructor from Solace::Composers::Base
Instance Method Details
#build_instruction(account_context) ⇒ Solace::Instruction
Builds the instruction for the associated token account program create account instruction
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/solace/composers/associated_token_account_program_create_idempotent_account_composer.rb', line 38 def build_instruction(account_context) Instructions::AssociatedTokenAccount::CreateIdempotentAccountInstruction.build( funder_index: account_context.index_of(funder), owner_index: account_context.index_of(owner), mint_index: account_context.index_of(mint), associated_token_account_index: account_context.index_of(ata_address), system_program_index: account_context.index_of(system_program_id), token_program_index: account_context.index_of(token_program_id), program_index: account_context.index_of(associated_token_account_program_id) ) end |