getContextRule

suspend fun getContextRule(id: UInt): SCValXdr

Retrieves a specific context rule by its ID.

Queries the smart account contract for a context rule with the specified ID. The raw SCVal response is returned, containing the rule details in encoded form.

This is a query operation (read-only, no authorization required). It uses simulation to extract the return value without submitting a transaction.

For parsed context rules, use listContextRules which returns ParsedContextRule objects.

Return

The raw SCVal response containing the context rule details

Parameters

id

The context rule ID to retrieve

Throws

if simulation fails or the rule doesn't exist

Example:

val ruleScVal = contextMgr.getContextRule(id = 1u)
// Parse ruleScVal to extract rule details