executeAndSubmit

suspend fun executeAndSubmit(target: String, targetFn: String, targetArgs: List<SCValXdr> = emptyList(), forceMethod: SubmissionMethod? = null, resolveContextRuleIds: ResolveContextRuleIds? = null): TransactionResult

Executes an arbitrary contract function call through the smart account's execute entry point.

Builds an invocation of the smart account contract's execute(target, target_fn, target_args) function, which calls the target contract on behalf of the smart account. The smart account's authorization rules (context rules, signers, policies) apply to this call.

This is the single-signer equivalent of arbitrary contract execution. For multi-signer operations, use OZMultiSignerManager.

Return

TransactionResult indicating success or failure

Parameters

target

The target contract address (C-address) to call

targetFn

The function name to invoke on the target contract

targetArgs

The arguments to pass to the target function as SCVal list

forceMethod

Optional override to force relayer or RPC submission

resolveContextRuleIds

Optional callback to resolve context rule IDs per auth entry. When null, rule IDs are resolved automatically from the connected signer and available context rules. Provide a callback when automatic resolution fails due to ambiguity or to bypass auto-resolution.

Throws

if submission fails