Stellar PHP SDK API Documentation

XdrHostFunction extends XdrHostFunctionBase
in package

Table of Contents

Properties

$createContract  : XdrCreateContractArgs|null
$createContractV2  : XdrCreateContractArgsV2|null
$invokeContract  : XdrInvokeContractArgs|null
$type  : XdrHostFunctionType
$wasm  : XdrDataValueMandatory|null

Methods

__construct()  : mixed
decode()  : static
encode()  : string
forCreatingContract()  : XdrHostFunction
forCreatingContractV2()  : XdrHostFunction
forCreatingContractV2WithArgs()  : XdrHostFunction
forCreatingContractV2WithExternalRef()  : XdrHostFunction
Builds a create contract v2 host function whose executable is a CAP-85 external reference, passing constructor arguments to the created instance.
forCreatingContractWithArgs()  : XdrHostFunction
forCreatingContractWithExternalRef()  : XdrHostFunction
Builds a create contract host function whose executable is a CAP-85 external reference: the instance runs the wasm named by the owner contract's persistent entry under the given tag.
forDeploySACWithAsset()  : XdrHostFunction
forInvokingContractWithArgs()  : XdrHostFunction
forUploadContractWasm()  : XdrHostFunction
fromBase64Xdr()  : static
fromJson()  : static
fromJsonValue()  : static
fromTxRep()  : static
Override fromTxRep so the wasm field is parsed from a hex string into an XdrDataValueMandatory wrapper (the base assigns a raw string to the typed field).
getCreateContract()  : XdrCreateContractArgs|null
getCreateContractV2()  : XdrCreateContractArgsV2|null
getInvokeContract()  : XdrInvokeContractArgs|null
getType()  : XdrHostFunctionType
getWasm()  : XdrDataValueMandatory|null
setCreateContract()  : void
setCreateContractV2()  : void
setInvokeContract()  : void
setType()  : void
setWasm()  : void
toBase64Xdr()  : string
toJson()  : string
toJsonValue()  : mixed
toTxRep()  : void
Override toTxRep so the wasm field is serialized as a hex string from the XdrDataValueMandatory wrapper (the base passes the object directly to bytesToHex).

Properties

Methods

forCreatingContractV2WithExternalRef()

Builds a create contract v2 host function whose executable is a CAP-85 external reference, passing constructor arguments to the created instance.

public static forCreatingContractV2WithExternalRef(XdrSCAddress $address, XdrSCAddress $executableOwner, string $tag, string $salt, array<string|int, XdrSCVal$constructorArgs) : XdrHostFunction
Parameters
$address : XdrSCAddress

the deployer address

$executableOwner : XdrSCAddress

the contract holding the executable tag entry

$tag : string

the tag of the executable entry on the owner

$salt : string

32 byte salt for contract id generation

$constructorArgs : array<string|int, XdrSCVal>

arguments passed to the contract constructor

Return values
XdrHostFunction

forCreatingContractWithExternalRef()

Builds a create contract host function whose executable is a CAP-85 external reference: the instance runs the wasm named by the owner contract's persistent entry under the given tag.

public static forCreatingContractWithExternalRef(XdrSCAddress $address, XdrSCAddress $executableOwner, string $tag, string $salt) : XdrHostFunction
Parameters
$address : XdrSCAddress

the deployer address

$executableOwner : XdrSCAddress

the contract holding the executable tag entry

$tag : string

the tag of the executable entry on the owner

$salt : string

32 byte salt for contract id generation

Return values
XdrHostFunction

fromBase64Xdr()

public static fromBase64Xdr(string $xdr) : static
Parameters
$xdr : string
Return values
static

fromJson()

public static fromJson(string $json) : static
Parameters
$json : string
Tags
throws
JsonException

If $json is not syntactically valid JSON.

InvalidArgumentException

If an object in $json repeats a key, or if the JSON shape does not match this type.

Return values
static

fromJsonValue()

public static fromJsonValue(mixed $value) : static
Parameters
$value : mixed
Return values
static

fromTxRep()

Override fromTxRep so the wasm field is parsed from a hex string into an XdrDataValueMandatory wrapper (the base assigns a raw string to the typed field).

public static fromTxRep(array<string, string> $map, string $prefix) : static
Parameters
$map : array<string, string>
$prefix : string
Return values
static

toJson()

public toJson() : string
Tags
throws
JsonException

If the value contains structures that cannot be encoded as JSON.

Return values
string

toTxRep()

Override toTxRep so the wasm field is serialized as a hex string from the XdrDataValueMandatory wrapper (the base passes the object directly to bytesToHex).

public toTxRep(string $prefix, array<string, string> &$lines) : void
Parameters
$prefix : string
$lines : array<string, string>
On this page

Search results