authorizeInvocation

suspend fun authorizeInvocation(signer: KeyPair, validUntilLedgerSeq: Long, invocation: SorobanAuthorizedInvocationXdr, network: Network, authV2: Boolean = true): SorobanAuthorizationEntryXdr

Builds and signs a new authorization entry from scratch using a KeyPair.

Return

Signed authorization entry

Parameters

signer

KeyPair to sign with

validUntilLedgerSeq

Exclusive future ledger sequence until which this is valid

invocation

Invocation tree being authorized (typically from simulation)

network

Network for replay protection

authV2

When true (the default), creates ADDRESS_V2 credentials. Pass false for the legacy ADDRESS arm, required on networks below Protocol 27, where ADDRESS_V2 entries invalidate the transaction.


suspend fun authorizeInvocation(signer: Auth.Signer, publicKey: String, validUntilLedgerSeq: Long, invocation: SorobanAuthorizedInvocationXdr, network: Network, authV2: Boolean = true): SorobanAuthorizationEntryXdr

Builds and signs a new authorization entry from scratch using a custom Signer.

Return

Signed authorization entry

Parameters

signer

Custom signer

publicKey

Public identity of the signer (G... address)

validUntilLedgerSeq

Exclusive future ledger sequence until which this is valid

invocation

Invocation tree being authorized (typically from simulation)

network

Network for replay protection

authV2

When true (the default), creates ADDRESS_V2 credentials. Pass false for the legacy ADDRESS arm, required on networks below Protocol 27, where ADDRESS_V2 entries invalidate the transaction.

Throws

if publicKey is a muxed account (M...) or muxed contract (W...) address