updateName

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

Updates the name of an existing context rule.

Changes the human-readable name of the context rule with the specified ID. The name is used for identification and has no effect on rule matching or enforcement.

Flow:

  1. Validates inputs (name not empty)

  2. Builds contract invocation for update_context_rule_name

  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 update

name

The new name for the context rule

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 validation fails

if transaction submission fails

Example:

val result = contextMgr.updateName(
id = 2u,
name = "UpdatedTokenOps"
)
if (result.success) {
println("Context rule name updated. Hash: ${result.hash ?: ""}")
}