Class: Solace::Instruction
- Inherits:
-
Object
- Object
- Solace::Instruction
- Includes:
- Concerns::BinarySerializable
- Defined in:
- lib/solace/instruction.rb
Overview
Class representing a Solana instruction.
Handles serialization and deserialization of instruction fields. Instructions are used to encode the data that is sent to a program on the Solana blockchain. Instructions are part of transaction messages. All instruction builders and instruction composers return an instance of this class.
The BufferLayout is:
- [Program index (1 byte)]
- [Number of accounts (compact u16)]
- [Accounts (variable length)]
- [Data length (compact u16)]
- [Data (variable length)]
Constant Summary collapse
- SERIALIZER =
Solace::Serializers::InstructionSerializer
- DESERIALIZER =
Solace::Serializers::InstructionDeserializer
Instance Attribute Summary collapse
-
#accounts ⇒ Array<Integer>
The accounts of the instruction.
-
#data ⇒ Array<Integer>
The instruction data.
-
#DESERIALIZER ⇒ Solace::Serializers::InstructionDeserializer
The deserializer for the instruction.
-
#program_index ⇒ Integer
The program index of the instruction.
-
#SERIALIZER ⇒ Solace::Serializers::InstructionSerializer
The serializer for the instruction.
Method Summary
Methods included from Concerns::BinarySerializable
included, #serialize, #to_binary, #to_bytes, #to_io
Instance Attribute Details
#accounts ⇒ Array<Integer>
Returns The accounts of the instruction.
43 44 45 |
# File 'lib/solace/instruction.rb', line 43 def accounts @accounts end |
#data ⇒ Array<Integer>
Returns The instruction data.
47 48 49 |
# File 'lib/solace/instruction.rb', line 47 def data @data end |
#DESERIALIZER ⇒ Solace::Serializers::InstructionDeserializer
Returns The deserializer for the instruction.
35 |
# File 'lib/solace/instruction.rb', line 35 DESERIALIZER = Solace::Serializers::InstructionDeserializer |
#program_index ⇒ Integer
Returns The program index of the instruction.
39 40 41 |
# File 'lib/solace/instruction.rb', line 39 def program_index @program_index end |
#SERIALIZER ⇒ Solace::Serializers::InstructionSerializer
Returns The serializer for the instruction.
31 |
# File 'lib/solace/instruction.rb', line 31 SERIALIZER = Solace::Serializers::InstructionSerializer |