SorobanAuthorizationEntry
in package
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
Table of Contents
Properties
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
$credentials
public
SorobanCredentials
$credentials
credentials authorizing the invocation (source account or address-based)
$rootInvocation
public
SorobanAuthorizedInvocation
$rootInvocation
root of the authorized invocation tree
Methods
__construct()
Creates a new Soroban authorization entry.
public
__construct(SorobanCredentials $credentials, SorobanAuthorizedInvocation $rootInvocation) : mixed
Parameters
- $credentials : SorobanCredentials
-
the credentials authorizing the invocation
- $rootInvocation : SorobanAuthorizedInvocation
-
the root invocation being authorized
fromBase64Xdr()
Creates SorobanAuthorizationEntry from base64-encoded XDR.
public
static fromBase64Xdr(string $base64Xdr) : SorobanAuthorizationEntry
Parameters
- $base64Xdr : string
-
the base64-encoded XDR string
Tags
Return values
SorobanAuthorizationEntry —the decoded authorization entry
fromXdr()
Creates SorobanAuthorizationEntry from its XDR representation.
public
static fromXdr(XdrSorobanAuthorizationEntry $xdr) : SorobanAuthorizationEntry
Parameters
- $xdr : XdrSorobanAuthorizationEntry
-
the XDR object to decode
Return values
SorobanAuthorizationEntry —the decoded authorization entry
getCredentials()
Returns the credentials for this authorization entry.
public
getCredentials() : SorobanCredentials
Return values
SorobanCredentials —the authorization credentials
getRootInvocation()
Returns the root authorized invocation.
public
getRootInvocation() : SorobanAuthorizedInvocation
Return values
SorobanAuthorizedInvocation —the root of the invocation tree
setCredentials()
Sets the credentials for this authorization entry.
public
setCredentials(SorobanCredentials $credentials) : void
Parameters
- $credentials : SorobanCredentials
-
the authorization credentials
setRootInvocation()
Sets the root authorized invocation.
public
setRootInvocation(SorobanAuthorizedInvocation $rootInvocation) : void
Parameters
- $rootInvocation : SorobanAuthorizedInvocation
-
the root of the invocation tree
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
toBase64Xdr()
Encodes this authorization entry as base64 XDR.
public
toBase64Xdr() : string
Return values
string —the base64-encoded XDR representation
toXdr()
Converts this object to its XDR representation.
public
toXdr() : XdrSorobanAuthorizationEntry
Return values
XdrSorobanAuthorizationEntry —the XDR encoded authorization entry