Class: Solace::SquadsSmartAccounts::Instructions::ExecuteTransactionInstruction
- Inherits:
-
Object
- Object
- Solace::SquadsSmartAccounts::Instructions::ExecuteTransactionInstruction
- Defined in:
- lib/solace/squads_smart_accounts/instructions/execute_transaction_instruction.rb
Overview
Encodes the ‘executeTransaction` instruction for the Squads Smart Account program.
Executes the inner instructions of an Approved proposal’s stored Transaction. The vault (smart account) PDA signs the inner instructions via CPI — the program patches its signer bit at runtime — so it is passed among the remaining accounts as a non-signer.
Fixed accounts (in order):
0. settings — writable, non-signer (consensus account)
1. proposal — writable, non-signer
2. transaction — readonly, non-signer
3. signer — readonly, signer (must have the Execute permission)
4. program — readonly, non-signer (the Squads program itself)
Followed by the remaining accounts: the stored message’s account_keys in order, each writable per the message header and all as non-signers (the lone message signer is the vault PDA, which the program signs via CPI).
executeTransaction takes no arguments — its data is the discriminator only.
Constant Summary collapse
- DISCRIMINATOR =
8-byte Anchor discriminator: SHA256(“global:execute_transaction”)
[231, 173, 49, 91, 235, 24, 68, 19].freeze
Class Method Summary collapse
-
.build(settings_index:, proposal_index:, transaction_index:, signer_index:, program_index:, remaining_account_indices:) ⇒ Solace::Instruction
Builds a Instruction for executeTransaction.
-
.data ⇒ Array<Integer>
Encodes the instruction data — the discriminator only; executeTransaction takes no arguments.
Class Method Details
.build(settings_index:, proposal_index:, transaction_index:, signer_index:, program_index:, remaining_account_indices:) ⇒ Solace::Instruction
Builds a Instruction for executeTransaction.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/solace/squads_smart_accounts/instructions/execute_transaction_instruction.rb', line 39 def self.build( settings_index:, proposal_index:, transaction_index:, signer_index:, program_index:, remaining_account_indices: ) Solace::Instruction.new.tap do |ix| ix.program_index = program_index ix.accounts = [ settings_index, proposal_index, transaction_index, signer_index, program_index ] + remaining_account_indices ix.data = data end end |
.data ⇒ Array<Integer>
Encodes the instruction data — the discriminator only; executeTransaction takes no arguments.
65 66 67 |
# File 'lib/solace/squads_smart_accounts/instructions/execute_transaction_instruction.rb', line 65 def self.data DISCRIMINATOR end |