multi Signer Execute And Submit
Executes an arbitrary contract function through the smart account's execute entry point with multi-signer authorization.
This method is the multi-signer counterpart to OZTransactionOperations.executeAndSubmit. Use it when a contract call must be authorized by more than one signer — for example, a governance vote, a multisig swap, or any operation gated by a multi-signer context rule.
The method routes the call through the smart account contract's execute(target, target_fn, target_args) entry point and collects signatures from all selectedSigners before submission.
This method takes target, targetFn, and targetArgs directly rather than accepting an AssembledTransaction. The KMP SDK constructs transactions from raw XDR without an AssembledTransaction wrapper; targetArgs must therefore be pre-encoded using Scv helpers.
Return
TransactionResult indicating success or failure with the transaction hash.
Parameters
The target contract address (C-address) to invoke via execute.
The function name to call on the target contract.
Pre-encoded arguments for the target function. Use Scv helpers (e.g., Scv.toUint32, Scv.toBoolean, Scv.toAddress) to encode each argument. Defaults to an empty list for functions that take no arguments.
All signers that must sign, in collection order.
SelectedSigner.Passkey triggers one OS WebAuthn authentication prompt per entry.
SelectedSigner.Wallet requests a delegated auth entry from the external wallet adapter. The list must not be empty.
Optional override for the submission method. When null (default), the SDK auto-detects whether to use the relayer or direct submission.
Optional callback to resolve context rule IDs per auth entry. When null (default), the SDK resolves the rule IDs automatically from the selected signers and available context rules.
Throws
if validation fails, signing fails, or submission fails.
Example — multi-signer governance vote:
val result = multiSigner.multiSignerExecuteAndSubmit(
target = "CDAO_CONTRACT_ADDRESS_HERE...",
targetFn = "vote",
targetArgs = listOf(
Scv.toUint32(proposalId),
Scv.toBoolean(true)
),
selectedSigners = listOf(
SelectedSigner.Passkey(
credentialId = credIdStr,
credentialIdBytes = credIdBytes,
keyData = signer.keyData
),
SelectedSigner.Wallet("GA7Q...")
)
)
if (result.success) {
println("Vote submitted: ${result.hash ?: ""}")
}