Skip to content

Execute a Settings Transaction

Applies the stored SettingsActions of an Approved settings-transaction proposal to the account — the actions are read from the stored transaction on-chain, so this call takes no action arguments.

The signer must hold the Execute permission and the proposal must be Approved (and past any time lock). A rent_payer is supplied because some actions (adding a signer, adding a spending limit) grow the settings account. Actions that add/remove a spending limit also need that limit's PDA in spending_limit_accounts, in action order.

Program method — execute_settings_transaction

Signs with payer + signer + rent_payer, then sends.

ParameterTypeRequiredDefaultDescription
payerKeypairyesPays the fee; co-signs.
settings#to_syesThe settings account address.
signer#to_s · KeypairyesAn Execute-holding member; must sign.
transaction_indexIntegeryesIndex of the settings transaction to apply.
rent_payer#to_s · KeypairyesFunds any settings reallocation; must sign.
spending_limit_accountsArray<#to_s>no[]SpendingLimit PDAs touched by the actions, in action order.

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

ruby
program.execute_settings_transaction(
  payer:             creator,
  settings:          identity.settings_address,
  signer:            creator,
  transaction_index: 1,
  rent_payer:        creator
)

Composer — SquadsSmartAccountsExecuteSettingsTransactionComposer

ParameterTypeRequiredDefaultDescription
settings#to_syesThe settings account address.
signer#to_s · KeypairyesAn Execute-holding member; must sign.
proposal#to_syesThe Proposal PDA (must be Approved).
transaction#to_syesThe SettingsTransaction PDA to apply.
rent_payer#to_s · KeypairyesFunds any settings realloc; must sign.
spending_limit_accountsArray<#to_s>no[]SpendingLimit PDAs touched by the actions, in action order.
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::SquadsSmartAccountsExecuteSettingsTransactionComposer.new(
  settings:    identity.settings_address,
  signer:      creator.address,
  proposal:,
  transaction:,
  rent_payer:  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: [131, 210, 27, 88, 27, 204, 143, 189]
  • Encodes (data): the discriminator only — executeSettingsTransaction takes no arguments.
ParameterTypeRequiredDefaultDescription
settings_indexIntegeryesIndex of the settings account.
signer_indexIntegeryesIndex of the executing signer.
proposal_indexIntegeryesIndex of the Proposal PDA.
transaction_indexIntegeryesIndex of the SettingsTransaction PDA.
rent_payer_indexIntegeryesIndex of the rent payer.
system_program_indexIntegeryesIndex of the System program.
program_indexIntegeryesIndex of the Squads program.
spending_limit_indicesArray<Integer>no[]Indices of SpendingLimit PDAs, in action order.

Built on Solace