Skip to content

Set the Time Lock ​

Sets the cooling-off period (in seconds) between a proposal's approval and when it may execute, on a controlled smart account, authorized by the settings authority.

Controlled accounts only. An autonomous account uses the SetTimeLocksettings transaction action. See The Async Transaction Lifecycle for how the time lock gates execution.

Program method — set_time_lock_as_authority ​

Signs with payer + settings_authority + rent_payer, then sends.

ParameterTypeRequiredDefaultDescription
payerKeypairyes—Pays the fee; co-signs.
settings#to_syes—The settings account address.
settings_authority#to_s · Keypairyes—The account's settings authority; must sign.
rent_payer#to_s · Keypairyes—Funds any settings-account reallocation; must sign.
time_lockIntegeryes—Seconds between approval and execution (0 to disable).
memoStringnonilOptional indexing memo.

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

ruby
program.set_time_lock_as_authority(
  payer:              authority,
  settings:           identity.settings_address,
  settings_authority: authority,
  rent_payer:         authority,
  time_lock:          3600 # one hour
)

Composer — SquadsSmartAccountsSetTimeLockAsAuthorityComposer ​

ParameterTypeRequiredDefaultDescription
settings#to_syes—The settings account address.
settings_authority#to_s · Keypairyes—The settings authority; must sign.
rent_payer#to_s · Keypairyes—Funds reallocation; must sign.
time_lockIntegeryes—Seconds between approval and execution.
memoStringnonilIndexing memo.
ruby
composer = Solace::Composers::SquadsSmartAccountsSetTimeLockAsAuthorityComposer.new(
  settings:           identity.settings_address,
  settings_authority: authority.address,
  rent_payer:         authority.address,
  time_lock:          3600
)

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

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

Low-level instruction (advanced) ​

  • Discriminator: [2, 234, 93, 93, 40, 92, 31, 234]
  • Encodes (data): le_u32(time_lock) + option_string(memo)
ParameterTypeRequiredDefaultDescription
time_lockIntegeryes—Seconds between approval and execution.
memoString, nilyes—Indexing memo, or nil.
settings_indexIntegeryes—Index of the settings account.
settings_authority_indexIntegeryes—Index of the settings authority.
rent_payer_indexIntegeryes—Index of the rent payer.
system_program_indexIntegeryes—Index of the System program.
program_indexIntegeryes—Index of the Squads program.
ruby
ix = Solace::SquadsSmartAccounts::Instructions::SetTimeLockAsAuthorityInstruction.build(
  time_lock:                3600,
  memo:                     nil,
  settings_index:           context.index_of(settings),
  settings_authority_index: context.index_of(settings_authority),
  rent_payer_index:         context.index_of(rent_payer),
  system_program_index:     context.index_of(Solace::Constants::SYSTEM_PROGRAM_ID),
  program_index:            context.index_of(Solace::SquadsSmartAccounts::PROGRAM_ID)
)

Built on Solace