updateValidUntil

suspend fun updateValidUntil(id: UInt, validUntil: UInt?, selectedSigners: List<SelectedSigner> = emptyList(), forceMethod: SubmissionMethod? = null): TransactionResult

Updates the expiration ledger of an existing context rule.

Changes the ledger number at which the context rule expires. After expiration, the rule will no longer apply to transactions. Pass null to remove the expiration.

Flow:

  1. Builds contract invocation for update_context_rule_valid_until

  2. Simulates to get auth entries

  3. Signs auth entries (requires user interaction)

  4. Submits transaction

  5. Polls for confirmation

IMPORTANT: This is a state-changing operation requiring smart account authorization. The user will be prompted for biometric authentication.

Return

TransactionResult indicating success or failure

Parameters

id

The ID of the context rule to update

validUntil

The new expiration ledger number, or null for no expiration

selectedSigners

Optional list of signers for multi-signer authorization. When empty (default), uses single-signer auth with the connected passkey. When non-empty, coordinates signatures from all listed signers.

forceMethod

Optional submission method override. When null (default), uses the configured submission method (relayer if available, RPC otherwise).

Throws

if the wallet is not connected

if transaction submission fails

Example:

// Set expiration to ledger 12345678
val result = contextMgr.updateValidUntil(
id = 2u,
validUntil = 12345678u
)

// Remove expiration (rule never expires)
val result2 = contextMgr.updateValidUntil(
id = 2u,
validUntil = null
)