Class: Solace::SquadsSmartAccounts::Settings
- Inherits:
-
Data
- Object
- Data
- Solace::SquadsSmartAccounts::Settings
- Defined in:
- lib/solace/squads_smart_accounts/types/settings.rb
Overview
Immutable value object representing the deserialized Settings account of a smart account. The settings account is the root state account created by ‘createSmartAccount` and holds the signer set, threshold, and time lock.
Instance Attribute Summary collapse
-
#account_utilization ⇒ Object
readonly
Returns the value of attribute account_utilization.
-
#archivable_after ⇒ Object
readonly
Returns the value of attribute archivable_after.
-
#archival_authority ⇒ Object
readonly
Returns the value of attribute archival_authority.
-
#bump ⇒ Object
readonly
Returns the value of attribute bump.
-
#seed ⇒ Object
readonly
Returns the value of attribute seed.
-
#settings_authority ⇒ Object
readonly
Returns the value of attribute settings_authority.
-
#signers ⇒ Object
readonly
Returns the value of attribute signers.
-
#stale_transaction_index ⇒ Object
readonly
Returns the value of attribute stale_transaction_index.
-
#threshold ⇒ Object
readonly
Returns the value of attribute threshold.
-
#time_lock ⇒ Object
readonly
Returns the value of attribute time_lock.
-
#transaction_index ⇒ Object
readonly
Returns the value of attribute transaction_index.
Class Method Summary collapse
-
.deserialize(io) ⇒ Settings
Deserializes a Settings account from a stream of Borsh-encoded account data.
Instance Attribute Details
#account_utilization ⇒ Object (readonly)
Returns the value of attribute account_utilization
13 14 15 |
# File 'lib/solace/squads_smart_accounts/types/settings.rb', line 13 def account_utilization @account_utilization end |
#archivable_after ⇒ Object (readonly)
Returns the value of attribute archivable_after
13 14 15 |
# File 'lib/solace/squads_smart_accounts/types/settings.rb', line 13 def archivable_after @archivable_after end |
#archival_authority ⇒ Object (readonly)
Returns the value of attribute archival_authority
13 14 15 |
# File 'lib/solace/squads_smart_accounts/types/settings.rb', line 13 def @archival_authority end |
#bump ⇒ Object (readonly)
Returns the value of attribute bump
13 14 15 |
# File 'lib/solace/squads_smart_accounts/types/settings.rb', line 13 def bump @bump end |
#seed ⇒ Object (readonly)
Returns the value of attribute seed
13 14 15 |
# File 'lib/solace/squads_smart_accounts/types/settings.rb', line 13 def seed @seed end |
#settings_authority ⇒ Object (readonly)
Returns the value of attribute settings_authority
13 14 15 |
# File 'lib/solace/squads_smart_accounts/types/settings.rb', line 13 def @settings_authority end |
#signers ⇒ Object (readonly)
Returns the value of attribute signers
13 14 15 |
# File 'lib/solace/squads_smart_accounts/types/settings.rb', line 13 def signers @signers end |
#stale_transaction_index ⇒ Object (readonly)
Returns the value of attribute stale_transaction_index
13 14 15 |
# File 'lib/solace/squads_smart_accounts/types/settings.rb', line 13 def stale_transaction_index @stale_transaction_index end |
#threshold ⇒ Object (readonly)
Returns the value of attribute threshold
13 14 15 |
# File 'lib/solace/squads_smart_accounts/types/settings.rb', line 13 def threshold @threshold end |
#time_lock ⇒ Object (readonly)
Returns the value of attribute time_lock
13 14 15 |
# File 'lib/solace/squads_smart_accounts/types/settings.rb', line 13 def time_lock @time_lock end |
#transaction_index ⇒ Object (readonly)
Returns the value of attribute transaction_index
13 14 15 |
# File 'lib/solace/squads_smart_accounts/types/settings.rb', line 13 def transaction_index @transaction_index end |
Class Method Details
.deserialize(io) ⇒ Settings
Deserializes a Settings account from a stream of Borsh-encoded account data.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/solace/squads_smart_accounts/types/settings.rb', line 30 def self.deserialize(io) io.read(8) # skip 8-byte Anchor discriminator new( seed: Solace::Utils::Codecs.decode_le_u128(io), settings_authority: Solace::Utils::Codecs.decode_pubkey(io), threshold: Solace::Utils::Codecs.decode_le_u16(io), time_lock: Solace::Utils::Codecs.decode_le_u32(io), transaction_index: Solace::Utils::Codecs.decode_le_u64(io), stale_transaction_index: Solace::Utils::Codecs.decode_le_u64(io), archival_authority: Solace::Utils::Codecs.decode_option_pubkey(io), archivable_after: Solace::Utils::Codecs.decode_le_u64(io), bump: Solace::Utils::Codecs.decode_u8(io), signers: Solace::Utils::Codecs.decode_smart_account_signers(io), account_utilization: Solace::Utils::Codecs.decode_u8(io) # Trailing reserved1/reserved2 bytes are not read. ) end |