Class: Solace::SquadsSmartAccounts::CreateSmartAccountEvent
- Inherits:
-
Data
- Object
- Data
- Solace::SquadsSmartAccounts::CreateSmartAccountEvent
- Defined in:
- lib/solace/squads_smart_accounts/types/create_smart_account_event.rb
Overview
Immutable value object representing the ‘CreateSmartAccountEvent` the program emits when a smart account is created. It is the `CreateSmartAccountEvent` variant of the Borsh `SmartAccountEvent` enum carried inside LogEventArgs#event, so deserialization reads the 1-byte enum variant tag before the event fields.
On windowed creation the program picks one candidate settings PDA from the offered window; this event is the only way to learn which one was chosen (see Solace::Programs::SquadsSmartAccount#created_smart_account_settings).
The on-chain event also carries ‘new_settings_content: Settings`, but only `new_settings_pubkey` is decoded here — it is all the caller needs to derive the vault, and the trailing Settings can be fetched on demand.
Instance Attribute Summary collapse
-
#new_settings_pubkey ⇒ Object
readonly
Returns the value of attribute new_settings_pubkey.
Class Method Summary collapse
-
.deserialize(io) ⇒ CreateSmartAccountEvent
Deserializes a CreateSmartAccountEvent from a stream of Borsh-encoded SmartAccountEvent bytes (positioned at the enum variant tag).
Instance Attribute Details
#new_settings_pubkey ⇒ Object (readonly)
Returns the value of attribute new_settings_pubkey
22 23 24 |
# File 'lib/solace/squads_smart_accounts/types/create_smart_account_event.rb', line 22 def new_settings_pubkey @new_settings_pubkey end |
Class Method Details
.deserialize(io) ⇒ CreateSmartAccountEvent
Deserializes a CreateSmartAccountEvent from a stream of Borsh-encoded SmartAccountEvent bytes (positioned at the enum variant tag).
30 31 32 33 34 35 36 |
# File 'lib/solace/squads_smart_accounts/types/create_smart_account_event.rb', line 30 def self.deserialize(io) Solace::Utils::Codecs.decode_u8(io) # SmartAccountEvent enum variant tag new( new_settings_pubkey: Solace::Utils::Codecs.decode_pubkey(io) ) end |