Class: Solace::Instructions::AssociatedTokenAccount::CreateIdempotentAccountInstruction

Inherits:
CreateAccountInstruction show all
Defined in:
lib/solace/instructions/associated_token_account/create_idempotent_account_instruction.rb

Overview

Instruction for creating an Associated Token Account idempotently.

This instruction behaves like ‘CreateAccountInstruction`, but will not fail if the account already exists. This is useful for scenarios where the existence of the account is uncertain, and you want to ensure it exists without causing an error.

Examples:

Build a CreateIdempotentAccount instruction

instruction = Solace::Instructions::AssociatedTokenAccount::CreateIdempotentAccountInstruction.build(
  funder_index: 0,
  associated_token_account_index: 1,
  owner_index: 2,
  mint_index: 3,
  system_program_index: 4,
  token_program_index: 5,
  program_index: 6
)

See Also:

Since:

  • 0.1.3

Constant Summary collapse

INSTRUCTION_INDEX =

!@const INSTRUCTION_INDEX

Instruction index for CreateIdempotentAccount

Returns:

  • (Array<Integer>)

Since:

  • 0.1.3

[1].freeze

Class Method Summary collapse

Methods inherited from CreateAccountInstruction

build

Class Method Details

.dataArray

Data for a CreateAccount instruction

The BufferLayout is:

- [Instruction Index (1 byte)]

Returns:

  • (Array)

    1-byte instruction index

Since:

  • 0.1.3



46
47
48
# File 'lib/solace/instructions/associated_token_account/create_idempotent_account_instruction.rb', line 46

def self.data
  INSTRUCTION_INDEX
end