Skip to content

Close a Settings Transaction

Closes a SettingsTransaction and its Proposal, refunding their rent. Clean-up after a settings transaction reaches a terminal state.

Closeable once the proposal is Executed, Rejected, or Cancelled, or is stale. (Unlike vault transactions, an Approved-but-stale settings proposal can be closed — it can no longer execute.) No member signature is required; only the fee payer signs.

Program method — close_settings_transaction

Signs with payer only, then sends. The rent collectors default to the on-chain stored values when omitted.

ParameterTypeRequiredDefaultDescription
payerKeypairyesPays the fee; the only signer.
settings#to_syesThe settings account address.
transaction_indexIntegeryesIndex of the settings transaction to close.
proposal_rent_collector#to_snostored valueReceives the proposal rent (defaults to the proposal's stored collector).
transaction_rent_collector#to_snostored valueReceives the transaction rent (defaults to the transaction's stored collector).

Plus the shared sign: / execute: controls and Solace::Transaction return — see Conventions.

ruby
program.close_settings_transaction(
  payer:             creator,
  settings:          identity.settings_address,
  transaction_index: 1
)

Composer — SquadsSmartAccountsCloseSettingsTransactionComposer

ParameterTypeRequiredDefaultDescription
settings#to_syesThe settings account address.
proposal#to_syesThe Proposal PDA to close.
transaction#to_syesThe SettingsTransaction PDA to close.
proposal_rent_collector#to_syesReceives the proposal rent.
transaction_rent_collector#to_syesReceives the transaction rent (must equal transaction.rent_collector).
ruby
proposal,    = program.get_proposal_address(settings_address: identity.settings_address, transaction_index: 1)
transaction, = program.get_transaction_address(settings_address: identity.settings_address, transaction_index: 1)

composer = Solace::Composers::SquadsSmartAccountsCloseSettingsTransactionComposer.new(
  settings:                   identity.settings_address,
  proposal:,
  transaction:,
  proposal_rent_collector:    creator.address,
  transaction_rent_collector: creator.address
)

tx = Solace::TransactionComposer.new(connection:)
                                .add_instruction(composer)
                                .set_fee_payer(creator)
                                .compose_transaction

tx.sign(creator)
connection.send_transaction(tx.serialize)

Low-level instruction (advanced)

  • Discriminator: [251, 112, 34, 108, 214, 13, 41, 116]
  • Encodes (data): the discriminator only — closeSettingsTransaction takes no arguments.
ParameterTypeRequiredDefaultDescription
settings_indexIntegeryesIndex of the settings account.
proposal_indexIntegeryesIndex of the Proposal PDA.
transaction_indexIntegeryesIndex of the SettingsTransaction PDA.
proposal_rent_collector_indexIntegeryesIndex of the proposal rent collector.
transaction_rent_collector_indexIntegeryesIndex of the transaction rent collector.
system_program_indexIntegeryesIndex of the System program.
program_indexIntegeryesIndex of the Squads program.

Built on Solace