Stellar PHP SDK API Documentation

SorobanCredentials

Credentials for Soroban authorization

This class represents credentials used in Soroban authorization entries. There are two types: source account credentials (no addressCredentials) or address-based credentials (with addressCredentials). Source account credentials use the transaction source account for authorization.

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

Soroban Authorization

since
1.0.0

Table of Contents

Properties

$addressCredentials  : SorobanAddressCredentials|null

Methods

__construct()  : mixed
Creates new Soroban credentials.
forAddress()  : SorobanCredentials
Creates address-based credentials.
forAddressCredentials()  : SorobanCredentials
Creates credentials from existing address credentials.
forSourceAccount()  : SorobanCredentials
Creates source account credentials.
fromXdr()  : SorobanCredentials
Creates SorobanCredentials from its XDR representation.
getAddressCredentials()  : SorobanAddressCredentials|null
Returns the address credentials if using address-based authorization.
setAddressCredentials()  : void
Sets the address credentials.
toXdr()  : XdrSorobanCredentials
Converts this object to its XDR representation.

Properties

Methods

forAddress()

Creates address-based credentials.

public static forAddress(Address $address, int $nonce, int $signatureExpirationLedger, XdrSCVal $signature) : SorobanCredentials
Parameters
$address : Address

the address to authorize

$nonce : int

unique nonce for replay protection

$signatureExpirationLedger : int

ledger after which signatures expire

$signature : XdrSCVal

the signature data

Return values
SorobanCredentials

credentials using address-based authorization

forSourceAccount()

Creates source account credentials.

public static forSourceAccount() : SorobanCredentials

Source account credentials use the transaction source account for authorization without requiring additional signatures.

Return values
SorobanCredentials

credentials using the source account


        
On this page

Search results