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
payerKeypairyes—Pays the fee; co-signs.
settings#to_syes—The settings account address.
signer#to_s · Keypairyes—An Execute-holding member; must sign.
transaction_indexIntegeryes—Index of the settings transaction to apply.
rent_payer#to_s · Keypairyes—Funds 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_syes—The settings account address.
signer#to_s · Keypairyes—An Execute-holding member; must sign.
proposal#to_syes—The Proposal PDA (must be Approved).
transaction#to_syes—The SettingsTransaction PDA to apply.
rent_payer#to_s · Keypairyes—Funds 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_indexIntegeryes—Index of the settings account.
signer_indexIntegeryes—Index of the executing signer.
proposal_indexIntegeryes—Index of the Proposal PDA.
transaction_indexIntegeryes—Index of the SettingsTransaction PDA.
rent_payer_indexIntegeryes—Index of the rent payer.
system_program_indexIntegeryes—Index of the System program.
program_indexIntegeryes—Index of the Squads program.
spending_limit_indicesArray<Integer>no[]Indices of SpendingLimit PDAs, in action order.

Built on Solace