Class: Solace::SquadsSmartAccounts::Instructions::CloseSettingsTransactionInstruction
- Inherits:
-
Object
- Object
- Solace::SquadsSmartAccounts::Instructions::CloseSettingsTransactionInstruction
- Defined in:
- lib/solace/squads_smart_accounts/instructions/close_settings_transaction_instruction.rb
Overview
Encodes the ‘closeSettingsTransaction` instruction for the Squads Smart Account program.
Closes a SettingsTransaction and its associated Proposal, refunding their rent. Closeable once the proposal is in a terminal state (Executed, Rejected, or Cancelled) or is stale. Takes no arguments and requires no smart-account signer — only the fee payer signs.
Accounts (in order):
0. settings — readonly, non-signer
1. proposal — writable, non-signer (closed; rent → proposalRentCollector)
2. transaction — writable, non-signer (closed; rent → transactionRentCollector)
3. proposalRentCollector — writable, non-signer (receives the proposal rent)
4. transactionRentCollector — writable, non-signer (must equal transaction.rent_collector)
5. systemProgram — readonly, non-signer
6. program — readonly, non-signer (the Squads program itself)
Constant Summary collapse
- DISCRIMINATOR =
8-byte Anchor discriminator: SHA256(“global:close_settings_transaction”)
[251, 112, 34, 108, 214, 13, 41, 116].freeze
Class Method Summary collapse
-
.build(settings_index:, proposal_index:, transaction_index:, proposal_rent_collector_index:, transaction_rent_collector_index:, system_program_index:, program_index:) ⇒ Solace::Instruction
Builds a Instruction for closeSettingsTransaction.
-
.data ⇒ Array<Integer>
Encodes the instruction data — the discriminator only; closeSettingsTransaction takes no arguments.
Class Method Details
.build(settings_index:, proposal_index:, transaction_index:, proposal_rent_collector_index:, transaction_rent_collector_index:, system_program_index:, program_index:) ⇒ Solace::Instruction
Builds a Instruction for closeSettingsTransaction.
36 37 38 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/close_settings_transaction_instruction.rb', line 36 def self.build( settings_index:, proposal_index:, transaction_index:, proposal_rent_collector_index:, transaction_rent_collector_index:, system_program_index:, program_index: ) Solace::Instruction.new.tap do |ix| ix.program_index = program_index ix.accounts = [ settings_index, proposal_index, transaction_index, proposal_rent_collector_index, transaction_rent_collector_index, system_program_index, program_index ] ix.data = data end end |
.data ⇒ Array<Integer>
Encodes the instruction data — the discriminator only; closeSettingsTransaction takes no arguments.
65 66 67 |
# File 'lib/solace/squads_smart_accounts/instructions/close_settings_transaction_instruction.rb', line 65 def self.data DISCRIMINATOR end |