Class: Solace::AddressLookupTable
- Inherits:
-
Object
- Object
- Solace::AddressLookupTable
- Includes:
- Concerns::BinarySerializable
- Defined in:
- lib/solace/address_lookup_table.rb
Overview
Represents a Solana Address Lookup Table account.
This class models the internal structure of a deserialized address lookup table and provides access to the account key, writable indexes, and readonly indexes.
It includes serialization and deserialization logic for encoding and decoding the table according to Solana???s buffer layout.
Buffer Layout (in bytes):
[account (32 bytes)][num_writable (compact-u16)][writable indexes][num_readonly (compact-u16)][readonly indexes]
Includes BinarySerializable, enabling methods like #to_binary, #to_io, and #to_bytes.
Instance Attribute Summary collapse
-
#account ⇒ String
The account key of the address lookup table.
-
#readonly_indexes ⇒ Array<Integer>
The readonly indexes in the address lookup table.
-
#writable_indexes ⇒ Array<Integer>
The writable indexes in the address lookup table.
Class Method Summary collapse
-
.deserialize(io) ⇒ Solace::AddressLookupTable
Deserializes an address lookup table from io stream.
Instance Method Summary collapse
-
#serialize ⇒ String
Serializes the address lookup table.
Methods included from Concerns::BinarySerializable
included, #to_binary, #to_bytes, #to_io
Instance Attribute Details
#account ⇒ String
Returns The account key of the address lookup table.
39 40 41 |
# File 'lib/solace/address_lookup_table.rb', line 39 def account @account end |
#readonly_indexes ⇒ Array<Integer>
Returns The readonly indexes in the address lookup table.
47 48 49 |
# File 'lib/solace/address_lookup_table.rb', line 47 def readonly_indexes @readonly_indexes end |
#writable_indexes ⇒ Array<Integer>
Returns The writable indexes in the address lookup table.
43 44 45 |
# File 'lib/solace/address_lookup_table.rb', line 43 def writable_indexes @writable_indexes end |
Class Method Details
.deserialize(io) ⇒ Solace::AddressLookupTable
Deserializes an address lookup table from io stream
54 55 56 |
# File 'lib/solace/address_lookup_table.rb', line 54 def deserialize(io) Solace::Serializers::AddressLookupTableDeserializer.new(io).call end |
Instance Method Details
#serialize ⇒ String
Serializes the address lookup table
62 63 64 |
# File 'lib/solace/address_lookup_table.rb', line 62 def serialize Solace::Serializers::AddressLookupTableSerializer.new(self).call end |