Skip to content

Execute a Settings Transaction Synchronously

Applies a batch of SettingsActions to an autonomous account in a single transaction — no stored transaction, proposal, or voting lifecycle. The outer transaction must simply carry enough co-signatures to reach the threshold.

Autonomous accounts only — controlled accounts are rejected (use the *AsAuthority instructions). Pass exactly enough signers to meet the threshold; each must be a Keypair so it can sign.

Program method — execute_settings_transaction_sync

Signs with payer + each of signers + rent_payer, then sends.

ParameterTypeRequiredDefaultDescription
payerKeypairyesPays the fee; co-signs.
settings#to_syesThe settings account address.
signersArray<#to_s · Keypair>yesCo-signers proving threshold consensus; must sign.
actionsArray<SettingsAction>yesActions applied atomically.
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.
memoStringnonilOptional indexing memo.

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

ruby
program.execute_settings_transaction_sync(
  payer:      creator,
  settings:   identity.settings_address,
  signers:    [creator],
  rent_payer: creator,
  actions:    [
    Solace::SquadsSmartAccounts::SettingsAction.add_signer(
      pubkey:     new_member.address,
      permission: Solace::SquadsSmartAccounts::Permissions::ALL
    ),
    Solace::SquadsSmartAccounts::SettingsAction.change_threshold(2)
  ]
)

Composer — SquadsSmartAccountsExecuteSettingsTransactionSyncComposer

ParameterTypeRequiredDefaultDescription
settings#to_syesThe settings account address.
signersArray<#to_s · Keypair>yesCo-signers proving threshold consensus.
actionsArray<SettingsAction>yesActions applied atomically.
rent_payer#to_s · KeypairyesFunds reallocation; must sign.
spending_limit_accountsArray<#to_s>no[]SpendingLimit PDAs touched by the actions, in action order.
memoStringnonilIndexing memo.
ruby
composer = Solace::Composers::SquadsSmartAccountsExecuteSettingsTransactionSyncComposer.new(
  settings:   identity.settings_address,
  signers:    [creator.address],
  rent_payer: creator.address,
  actions:    [Solace::SquadsSmartAccounts::SettingsAction.change_threshold(2)]
)

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: [138, 209, 64, 163, 79, 67, 233, 76]
  • Encodes (data): num_signers + settings_actions(actions) + option_string(memo)
ParameterTypeRequiredDefaultDescription
num_signersIntegeryesNumber of co-signers proving threshold consensus.
actionsArray<SettingsAction>yesActions applied atomically.
memoString, nilyesIndexing memo, or nil.
settings_indexIntegeryesIndex of the settings account.
rent_payer_indexIntegeryesIndex of the rent payer.
system_program_indexIntegeryesIndex of the System program.
program_indexIntegeryesIndex of the Squads program.
signer_indicesArray<Integer>yesIndices of the co-signers (the leading remaining accounts).
spending_limit_indicesArray<Integer>no[]Indices of SpendingLimit PDAs, in action order.

Built on Solace