Class: Solace::Instructions::AddressLookupTableProgram::CreateLookupTableInstruction
- Inherits:
-
Object
- Object
- Solace::Instructions::AddressLookupTableProgram::CreateLookupTableInstruction
- Defined in:
- lib/solace/instructions/address_lookup_table_program/create_lookup_table_instruction.rb
Overview
Instruction for creating a new (uninitialized) address lookup table.
The table's address is a program-derived address of [authority, recent_slot];
the caller supplies the derived address and its bump seed.
Constant Summary collapse
- INSTRUCTION_ID =
Instruction discriminator for CreateLookupTable (u32 LE)
[0, 0, 0, 0].freeze
Class Method Summary collapse
-
.build(recent_slot:, bump:, program_index:, table_index:, authority_index:, payer_index:, system_program_index:) ⇒ Solace::Instruction
Builds a Solace::Instruction for creating a lookup table.
-
.data(recent_slot, bump) ⇒ Array<Integer>
Instruction data for a create lookup table instruction.
Class Method Details
.build(recent_slot:, bump:, program_index:, table_index:, authority_index:, payer_index:, system_program_index:) ⇒ Solace::Instruction
Builds a Solace::Instruction for creating a lookup table
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/solace/instructions/address_lookup_table_program/create_lookup_table_instruction.rb', line 46 def self.build( recent_slot:, bump:, program_index:, table_index:, authority_index:, payer_index:, system_program_index: ) Instruction.new.tap do |ix| ix.program_index = program_index ix.accounts = [table_index, , payer_index, system_program_index] ix.data = data(recent_slot, bump) end end |
.data(recent_slot, bump) ⇒ Array<Integer>
Instruction data for a create lookup table instruction
The BufferLayout is:
- [Instruction discriminator (4 bytes, u32 LE)]
- [Recent slot (8 bytes, u64 LE)]
- [Bump seed (1 byte)]
72 73 74 75 76 |
# File 'lib/solace/instructions/address_lookup_table_program/create_lookup_table_instruction.rb', line 72 def self.data(recent_slot, bump) INSTRUCTION_ID + Utils::Codecs.encode_le_u64(recent_slot).bytes + [bump] end |