SorobanAddressCredentials
in package
Address-based credentials for Soroban authorization
This class represents address-based credentials used in Soroban authorization entries. It contains the address being authorized, a nonce for replay protection, a signature expiration ledger for time-based security, and the signature data itself.
Tags
Table of Contents
Properties
- $address : Address
- $nonce : int
- $signature : XdrSCVal
- $signatureExpirationLedger : int
Methods
- __construct() : mixed
- Creates new address-based credentials for Soroban authorization.
- fromXdr() : SorobanAddressCredentials
- Creates SorobanAddressCredentials from its XDR representation.
- getAddress() : Address
- Returns the address being authorized.
- getNonce() : int
- Returns the nonce for replay protection.
- getSignature() : XdrSCVal
- Returns the signature data.
- getSignatureExpirationLedger() : int
- Returns the ledger number after which the signature expires.
- setAddress() : void
- Sets the address being authorized.
- setNonce() : void
- Sets the nonce for replay protection.
- setSignature() : void
- Sets the signature data.
- setSignatureExpirationLedger() : void
- Sets the ledger number after which the signature expires.
- toXdr() : XdrSorobanAddressCredentials
- Converts this object to its XDR representation.
Properties
$address
public
Address
$address
the address being authorized (account or contract address)
$nonce
public
int
$nonce
nonce for replay protection, must be unique per authorization
$signature
public
XdrSCVal
$signature
signature data containing one or more signatures authorizing the invocation
$signatureExpirationLedger
public
int
$signatureExpirationLedger
ledger sequence number after which this signature expires
Methods
__construct()
Creates new address-based credentials for Soroban authorization.
public
__construct(Address $address, int $nonce, int $signatureExpirationLedger, XdrSCVal $signature) : mixed
Parameters
fromXdr()
Creates SorobanAddressCredentials from its XDR representation.
public
static fromXdr(XdrSorobanAddressCredentials $xdr) : SorobanAddressCredentials
Parameters
- $xdr : XdrSorobanAddressCredentials
-
the XDR object to decode
Return values
SorobanAddressCredentials —the decoded credentials object
getAddress()
Returns the address being authorized.
public
getAddress() : Address
Return values
Address —the authorized address
getNonce()
Returns the nonce for replay protection.
public
getNonce() : int
Return values
int —the nonce value
getSignature()
Returns the signature data.
public
getSignature() : XdrSCVal
Return values
XdrSCVal —the signature (typically a vector of signatures)
getSignatureExpirationLedger()
Returns the ledger number after which the signature expires.
public
getSignatureExpirationLedger() : int
Return values
int —the expiration ledger sequence number
setAddress()
Sets the address being authorized.
public
setAddress(Address $address) : void
Parameters
- $address : Address
-
the address to authorize
setNonce()
Sets the nonce for replay protection.
public
setNonce(int $nonce) : void
Parameters
- $nonce : int
-
the nonce value
setSignature()
Sets the signature data.
public
setSignature(XdrSCVal $signature) : void
Parameters
- $signature : XdrSCVal
-
the signature data (typically a vector of signatures)
setSignatureExpirationLedger()
Sets the ledger number after which the signature expires.
public
setSignatureExpirationLedger(int $signatureExpirationLedger) : void
Parameters
- $signatureExpirationLedger : int
-
the expiration ledger sequence number
toXdr()
Converts this object to its XDR representation.
public
toXdr() : XdrSorobanAddressCredentials
Return values
XdrSorobanAddressCredentials —the XDR encoded credentials