removeContextRule

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

Removes a context rule from the smart account.

Deletes the context rule with the specified ID from the smart account. Once removed, the rule will no longer apply to future transactions.

Flow:

  1. Validates that a wallet is connected

  2. Builds contract invocation for remove_context_rule

  3. Simulates to get auth entries

  4. Signs auth entries (requires user interaction)

  5. Submits transaction

  6. 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 remove

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 rule doesn't exist or transaction submission fails

Example:

val result = contextMgr.removeContextRule(id = 3u)
if (result.success) {
println("Context rule removed. Hash: ${result.hash ?: ""}")
}