Skip to content

Create a Settings Transaction

Stores a batch of SettingsActions as a pending settings transaction — the autonomous-account equivalent of a vault transaction, but the thing being executed reconfigures the account itself (add/remove signers, change threshold, set time lock, manage spending limits). It awaits a proposal and approvals before applying.

Autonomous accounts only (no settings authority). Controlled accounts reconfigure through the *AsAuthority instructions. The creator must hold the Initiate permission; the transaction is stored at transaction_index + 1 (derived for you).

Program method — create_settings_transaction

Signs with payer + creator + rent_payer, then sends.

ParameterTypeRequiredDefaultDescription
payerKeypairyesPays the fee; co-signs.
settings#to_syesThe settings account address.
creator#to_s · KeypairyesAn Initiate-holding member; must sign.
rent_payer#to_s · KeypairyesFunds the SettingsTransaction account's rent; must sign.
actionsArray<SettingsAction>yesThe configuration changes to store.
memoStringnonilOptional indexing memo.

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

ruby
program.create_settings_transaction(
  payer:      creator,
  settings:   identity.settings_address,
  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 — SquadsSmartAccountsCreateSettingsTransactionComposer

ParameterTypeRequiredDefaultDescription
settings#to_syesThe settings account address.
transaction#to_syesThe SettingsTransaction PDA to create (from get_transaction_address).
creator#to_s · KeypairyesAn Initiate-holding member; must sign.
rent_payer#to_s · KeypairyesFunds the account's rent; must sign.
actionsArray<SettingsAction>yesThe configuration changes to store.
memoStringnonilIndexing memo.
ruby
transaction, = program.get_transaction_address(
  settings_address:  identity.settings_address,
  transaction_index: 1
)

composer = Solace::Composers::SquadsSmartAccountsCreateSettingsTransactionComposer.new(
  settings:     identity.settings_address,
  transaction:,
  creator:      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: [101, 168, 254, 203, 222, 102, 95, 192]
  • Encodes (data): settings_actions(actions) + option_string(memo)
ParameterTypeRequiredDefaultDescription
actionsArray<SettingsAction>yesThe configuration changes to store.
memoString, nilyesIndexing memo, or nil.
settings_indexIntegeryesIndex of the settings account.
transaction_indexIntegeryesIndex of the SettingsTransaction PDA.
creator_indexIntegeryesIndex of the creator.
rent_payer_indexIntegeryesIndex of the rent payer.
system_program_indexIntegeryesIndex of the System program.
program_indexIntegeryesIndex of the Squads program.

Built on Solace