Class: Solace::SquadsSmartAccounts::SpendingLimit
- Inherits:
-
Data
- Object
- Data
- Solace::SquadsSmartAccounts::SpendingLimit
- Defined in:
- lib/solace/squads_smart_accounts/types/spending_limit.rb
Overview
Immutable value object representing a deserialized SpendingLimit account —a pre-authorized allowance letting designated signers move funds from a vault without consensus. Fetching from the chain is the Program layer’s responsibility — see Solace::Programs::SquadsSmartAccount#get_spending_limit.
Instance Attribute Summary collapse
-
#account_index ⇒ Object
readonly
Returns the value of attribute account_index.
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#bump ⇒ Object
readonly
Returns the value of attribute bump.
-
#destinations ⇒ Object
readonly
Returns the value of attribute destinations.
-
#expiration ⇒ Object
readonly
Returns the value of attribute expiration.
-
#last_reset ⇒ Object
readonly
Returns the value of attribute last_reset.
-
#mint ⇒ Object
readonly
Returns the value of attribute mint.
-
#period ⇒ Object
readonly
Returns the value of attribute period.
-
#remaining_amount ⇒ Object
readonly
Returns the value of attribute remaining_amount.
-
#seed ⇒ Object
readonly
Returns the value of attribute seed.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
-
#signers ⇒ Object
readonly
Returns the value of attribute signers.
Class Method Summary collapse
-
.deserialize(io) ⇒ SpendingLimit
Deserializes a SpendingLimit from a stream of Borsh-encoded account data.
Instance Attribute Details
#account_index ⇒ Object (readonly)
Returns the value of attribute account_index
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/spending_limit.rb', line 14 def account_index @account_index end |
#amount ⇒ Object (readonly)
Returns the value of attribute amount
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/spending_limit.rb', line 14 def amount @amount end |
#bump ⇒ Object (readonly)
Returns the value of attribute bump
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/spending_limit.rb', line 14 def bump @bump end |
#destinations ⇒ Object (readonly)
Returns the value of attribute destinations
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/spending_limit.rb', line 14 def destinations @destinations end |
#expiration ⇒ Object (readonly)
Returns the value of attribute expiration
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/spending_limit.rb', line 14 def expiration @expiration end |
#last_reset ⇒ Object (readonly)
Returns the value of attribute last_reset
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/spending_limit.rb', line 14 def last_reset @last_reset end |
#mint ⇒ Object (readonly)
Returns the value of attribute mint
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/spending_limit.rb', line 14 def mint @mint end |
#period ⇒ Object (readonly)
Returns the value of attribute period
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/spending_limit.rb', line 14 def period @period end |
#remaining_amount ⇒ Object (readonly)
Returns the value of attribute remaining_amount
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/spending_limit.rb', line 14 def remaining_amount @remaining_amount end |
#seed ⇒ Object (readonly)
Returns the value of attribute seed
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/spending_limit.rb', line 14 def seed @seed end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/spending_limit.rb', line 14 def settings @settings end |
#signers ⇒ Object (readonly)
Returns the value of attribute signers
14 15 16 |
# File 'lib/solace/squads_smart_accounts/types/spending_limit.rb', line 14 def signers @signers end |
Class Method Details
.deserialize(io) ⇒ SpendingLimit
Deserializes a SpendingLimit from a stream of Borsh-encoded account data.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/solace/squads_smart_accounts/types/spending_limit.rb', line 32 def self.deserialize(io) io.read(8) # skip 8-byte Anchor discriminator new( settings: Solace::Utils::Codecs.decode_pubkey(io), seed: Solace::Utils::Codecs.decode_pubkey(io), account_index: Solace::Utils::Codecs.decode_u8(io), mint: Solace::Utils::Codecs.decode_pubkey(io), amount: Solace::Utils::Codecs.decode_le_u64(io), period: Solace::Utils::Codecs.decode_u8(io), remaining_amount: Solace::Utils::Codecs.decode_le_u64(io), last_reset: Solace::Utils::Codecs.decode_le_i64(io), bump: Solace::Utils::Codecs.decode_u8(io), signers: Solace::Utils::Codecs.decode_vec_pubkeys(io), destinations: Solace::Utils::Codecs.decode_vec_pubkeys(io), expiration: Solace::Utils::Codecs.decode_le_i64(io) ) end |