Stellar PHP SDK API Documentation

SorobanAuthorizationEntry

Soroban authorization entry for smart contract invocations

This class represents an authorization entry that grants permission to execute a specific contract invocation. Each authorization entry contains credentials (either source account or address-based) and a tree of authorized invocations representing the call hierarchy.

Authorization entries are typically signed by the authorizing party before submission.

Tags
see
SorobanCredentials
see
SorobanAuthorizedInvocation
see
https://developers.stellar.org/docs/learn/smart-contract-internals/authorization

Soroban Authorization

since
1.0.0

Table of Contents

Properties

$credentials  : SorobanCredentials
$rootInvocation  : SorobanAuthorizedInvocation

Methods

__construct()  : mixed
Creates a new Soroban authorization entry.
fromBase64Xdr()  : SorobanAuthorizationEntry
Creates SorobanAuthorizationEntry from base64-encoded XDR.
fromXdr()  : SorobanAuthorizationEntry
Creates SorobanAuthorizationEntry from its XDR representation.
getCredentials()  : SorobanCredentials
Returns the credentials for this authorization entry.
getRootInvocation()  : SorobanAuthorizedInvocation
Returns the root authorized invocation.
setCredentials()  : void
Sets the credentials for this authorization entry.
setRootInvocation()  : void
Sets the root authorized invocation.
sign()  : void
Signs the authorization entry with the given keypair.
toBase64Xdr()  : string
Encodes this authorization entry as base64 XDR.
toXdr()  : XdrSorobanAuthorizationEntry
Converts this object to its XDR representation.

Properties

Methods

sign()

Signs the authorization entry with the given keypair.

public sign(KeyPair $signer, Network $network) : void

The signature will be added to the signatures vector of the address credentials. This method creates an Ed25519 signature over the authorization payload including the network passphrase, nonce, signature expiration, and root invocation.

Parameters
$signer : KeyPair

the keypair to sign with (must match the authorized address)

$network : Network

the network this authorization is for (determines network passphrase)

Tags
throws
RuntimeException

if no address credentials are found in this entry

toBase64Xdr()

Encodes this authorization entry as base64 XDR.

public toBase64Xdr() : string
Return values
string

the base64-encoded XDR representation


        
On this page

Search results