authorizeInvocation

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

Builds and authorizes a new entry from scratch using a KeyPair.

This builds an entry from scratch, allowing you to express authorization as a function of:

  • a particular identity (signing KeyPair)

  • approving the execution of an invocation tree

  • on a particular network

  • until a particular ledger sequence is reached

Return

A signed Soroban authorization entry

Parameters

signer

The KeyPair to sign with

validUntilLedgerSeq

The exclusive future ledger sequence until which this is valid

invocation

The invocation tree being authorized (typically from simulation)

network

The network (incorporated into the signature for replay protection)

Throws

if authorization fails


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

Builds and authorizes a new entry from scratch using a custom Signer.

This builds an entry from scratch, allowing you to express authorization as a function of:

  • a particular identity (custom Signer)

  • approving the execution of an invocation tree

  • on a particular network

  • until a particular ledger sequence is reached

Return

A signed Soroban authorization entry

Parameters

signer

A function that signs the hash of a HashIDPreimage

publicKey

The public identity of the signer (G... address)

validUntilLedgerSeq

The exclusive future ledger sequence until which this is valid

invocation

The invocation tree being authorized (typically from simulation)

network

The network (incorporated into the signature for replay protection)

Throws

if authorization fails