signAuthEntry

suspend fun signAuthEntry(entry: SorobanAuthorizationEntryXdr, signer: SmartAccountSigner, signature: SmartAccountSignature, expirationLedger: UInt, contextRuleIds: List<UInt> = emptyList()): SorobanAuthorizationEntryXdr

Signs a single Soroban authorization entry with the provided signature.

Encoding of the signature bytes is delegated to SmartAccountSignature.toAuthPayloadBytes; see that contract for variant-specific wire shape.

The input entry is never mutated; a deep clone is produced via XDR round-trip before any modification. Multiple calls on the same entry accumulate signatures in the credentials map, enabling multi-signer flows.

Return

The signed authorization entry with the signature inserted into the signer slot.

Parameters

entry

The authorization entry to sign.

signer

The Smart Account signer whose slot receives the signature (delegated or external).

signature

The SmartAccountSignature to attach (variant determines wire encoding).

expirationLedger

The ledger at which this signature expires. Must match the value passed to buildAuthPayloadHash when the signature was computed.

contextRuleIds

The context rule IDs the signature satisfies. Defaults to empty.

Throws

on XDR encoding/decoding failure or when credentials are not of type Address.