Class: Solace::SquadsSmartAccounts::TransactionMessage
- Inherits:
-
Data
- Object
- Data
- Solace::SquadsSmartAccounts::TransactionMessage
- Defined in:
- lib/solace/squads_smart_accounts/types/transaction_message.rb
Overview
Immutable value object for the program’s TransactionMessage — a compiled inner transaction stored by ‘createTransaction` and replayed by `executeTransaction`. It mirrors a Solana v0 message: account keys ordered [writable signers, readonly signers, writable non-signers, readonly non-signers] with the three header counts, plus compiled instructions.
Address-table lookups are not supported yet and are always serialized as an empty SmallVec.
Instance Attribute Summary collapse
-
#account_keys ⇒ Object
readonly
Returns the value of attribute account_keys.
-
#instructions ⇒ Object
readonly
Returns the value of attribute instructions.
-
#num_signers ⇒ Object
readonly
Returns the value of attribute num_signers.
-
#num_writable_non_signers ⇒ Object
readonly
Returns the value of attribute num_writable_non_signers.
-
#num_writable_signers ⇒ Object
readonly
Returns the value of attribute num_writable_signers.
Instance Method Summary collapse
-
#serialize ⇒ Array<Integer>
Serializes the message in the Squads SmallVec format.
Instance Attribute Details
#account_keys ⇒ Object (readonly)
Returns the value of attribute account_keys
23 24 25 |
# File 'lib/solace/squads_smart_accounts/types/transaction_message.rb', line 23 def account_keys @account_keys end |
#instructions ⇒ Object (readonly)
Returns the value of attribute instructions
23 24 25 |
# File 'lib/solace/squads_smart_accounts/types/transaction_message.rb', line 23 def instructions @instructions end |
#num_signers ⇒ Object (readonly)
Returns the value of attribute num_signers
23 24 25 |
# File 'lib/solace/squads_smart_accounts/types/transaction_message.rb', line 23 def num_signers @num_signers end |
#num_writable_non_signers ⇒ Object (readonly)
Returns the value of attribute num_writable_non_signers
23 24 25 |
# File 'lib/solace/squads_smart_accounts/types/transaction_message.rb', line 23 def num_writable_non_signers @num_writable_non_signers end |
#num_writable_signers ⇒ Object (readonly)
Returns the value of attribute num_writable_signers
23 24 25 |
# File 'lib/solace/squads_smart_accounts/types/transaction_message.rb', line 23 def num_writable_signers @num_writable_signers end |
Instance Method Details
#serialize ⇒ Array<Integer>
Serializes the message in the Squads SmallVec format.
33 34 35 36 37 38 |
# File 'lib/solace/squads_smart_accounts/types/transaction_message.rb', line 33 def serialize [num_signers, num_writable_signers, num_writable_non_signers] + Solace::Utils::Codecs.encode_smallvec_u8_pubkeys(account_keys) + Solace::Utils::Codecs.encode_compiled_instructions(instructions) + [0] # address_table_lookups: empty SmallVec<u8, _> end |