Class: Solace::SquadsSmartAccounts::Instructions::CloseTransactionInstruction
- Inherits:
-
Object
- Object
- Solace::SquadsSmartAccounts::Instructions::CloseTransactionInstruction
- Defined in:
- lib/solace/squads_smart_accounts/instructions/close_transaction_instruction.rb
Overview
Encodes the ‘closeTransaction` instruction for the Squads Smart Account program.
Closes a vault Transaction and its associated Proposal, refunding their rent. Closeable once the proposal is in a terminal state (Executed, Rejected, or Cancelled) or is stale and NOT Approved — an Approved vault proposal can never be closed because it can still execute (this is the key difference from closeSettingsTransaction). Takes no arguments and requires no smart-account signer — only the fee payer signs.
Accounts (in order):
0. settings — readonly, non-signer (the consensus account)
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_transaction”)
[97, 46, 152, 170, 42, 215, 192, 218].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 closeTransaction.
-
.data ⇒ Array<Integer>
Encodes the instruction data — the discriminator only; closeTransaction 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 closeTransaction.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/solace/squads_smart_accounts/instructions/close_transaction_instruction.rb', line 37 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; closeTransaction takes no arguments.
66 67 68 |
# File 'lib/solace/squads_smart_accounts/instructions/close_transaction_instruction.rb', line 66 def self.data DISCRIMINATOR end |