Class: Solace::SquadsSmartAccounts::SettingsTransaction
- Inherits:
-
Data
- Object
- Data
- Solace::SquadsSmartAccounts::SettingsTransaction
- Defined in:
- lib/solace/squads_smart_accounts/types/settings_transaction.rb
Overview
Immutable value object for a deserialized SettingsTransaction account — a pending batch of SettingsActions stored by ‘createSettingsTransaction` and applied by `executeSettingsTransaction` once its proposal is approved.
Layout (state/settings_transaction.rs): settings(32), creator(32), rent_collector(32), index(u64), bump(u8), actions(Vec<SettingsAction>). Only the fixed header is decoded — enough to resolve the rent collector for ‘closeSettingsTransaction` and verify identity; the trailing actions Vec is not read (the program reads the actions on-chain).
Instance Attribute Summary collapse
-
#bump ⇒ Object
readonly
Returns the value of attribute bump.
-
#creator ⇒ Object
readonly
Returns the value of attribute creator.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#rent_collector ⇒ Object
readonly
Returns the value of attribute rent_collector.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Class Method Summary collapse
-
.deserialize(io) ⇒ SettingsTransaction
Deserializes a SettingsTransaction account from a stream of Borsh-encoded account data.
Instance Attribute Details
#bump ⇒ Object (readonly)
Returns the value of attribute bump
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/settings_transaction.rb', line 14 def bump @bump end |
#creator ⇒ Object (readonly)
Returns the value of attribute creator
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/settings_transaction.rb', line 14 def creator @creator end |
#index ⇒ Object (readonly)
Returns the value of attribute index
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/settings_transaction.rb', line 14 def index @index end |
#rent_collector ⇒ Object (readonly)
Returns the value of attribute rent_collector
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/settings_transaction.rb', line 14 def rent_collector @rent_collector end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/settings_transaction.rb', line 14 def settings @settings end |
Class Method Details
.deserialize(io) ⇒ SettingsTransaction
Deserializes a SettingsTransaction account from a stream of Borsh-encoded account data.
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/solace/squads_smart_accounts/types/settings_transaction.rb', line 26 def self.deserialize(io) io.read(8) # skip 8-byte Anchor discriminator new( settings: Solace::Utils::Codecs.decode_pubkey(io), creator: Solace::Utils::Codecs.decode_pubkey(io), rent_collector: Solace::Utils::Codecs.decode_pubkey(io), index: Solace::Utils::Codecs.decode_le_u64(io), bump: Solace::Utils::Codecs.decode_u8(io) # Trailing actions Vec<SettingsAction> is not read. ) end |