Class: Solace::SquadsSmartAccounts::Instructions::ExecuteSettingsTransactionInstruction
- Inherits:
-
Object
- Object
- Solace::SquadsSmartAccounts::Instructions::ExecuteSettingsTransactionInstruction
- Defined in:
- lib/solace/squads_smart_accounts/instructions/execute_settings_transaction_instruction.rb
Overview
Encodes the ‘executeSettingsTransaction` instruction for the Squads Smart Account program.
Applies the stored SettingsActions of an Approved proposal’s SettingsTransaction to the settings account. Takes no arguments — the actions are read from the stored transaction on-chain.
Accounts (in order):
0. settings — writable, non-signer
1. signer — readonly, signer (must have the Execute permission)
2. proposal — writable, non-signer
3. transaction — readonly, non-signer (the SettingsTransaction)
4. rentPayer — writable, signer (funds any settings realloc)
5. systemProgram — readonly, non-signer (needed for realloc)
6. program — readonly, non-signer (the Squads program itself)
Remaining accounts: SpendingLimit PDAs initialized/closed by
AddSpendingLimit / RemoveSpendingLimit actions, in action order.
rentPayer and systemProgram are optional in the program, but this builder always includes them so a realloc-triggering action never fails.
Constant Summary collapse
- DISCRIMINATOR =
8-byte Anchor discriminator: SHA256(“global:execute_settings_transaction”)
[131, 210, 27, 88, 27, 204, 143, 189].freeze
Class Method Summary collapse
-
.build(settings_index:, signer_index:, proposal_index:, transaction_index:, rent_payer_index:, system_program_index:, program_index:, spending_limit_indices: []) ⇒ Solace::Instruction
Builds a Instruction for executeSettingsTransaction.
-
.data ⇒ Array<Integer>
Encodes the instruction data — the discriminator only; executeSettingsTransaction takes no arguments.
Class Method Details
.build(settings_index:, signer_index:, proposal_index:, transaction_index:, rent_payer_index:, system_program_index:, program_index:, spending_limit_indices: []) ⇒ Solace::Instruction
Builds a Instruction for executeSettingsTransaction.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/solace/squads_smart_accounts/instructions/execute_settings_transaction_instruction.rb', line 42 def self.build( settings_index:, signer_index:, proposal_index:, transaction_index:, rent_payer_index:, system_program_index:, program_index:, spending_limit_indices: [] ) Solace::Instruction.new.tap do |ix| ix.program_index = program_index ix.accounts = [ settings_index, signer_index, proposal_index, transaction_index, rent_payer_index, system_program_index, program_index, *spending_limit_indices ] ix.data = data end end |
.data ⇒ Array<Integer>
Encodes the instruction data — the discriminator only; executeSettingsTransaction takes no arguments.
73 74 75 |
# File 'lib/solace/squads_smart_accounts/instructions/execute_settings_transaction_instruction.rb', line 73 def self.data DISCRIMINATOR end |