InvokeHostFunctionOperation
extends AbstractOperation
in package
Represents an invoke host function operation.
Invokes a Soroban smart contract function, uploads WASM code, or deploys a contract.
Tags
Table of Contents
Properties
- $auth : array<string|int, SorobanAuthorizationEntry>
- $function : HostFunction
Methods
- __construct() : mixed
- Creates a new InvokeHostFunctionOperation.
- fromXdr() : AbstractOperation
- Creates an operation from its XDR representation.
- fromXdrAmount() : string
- Converts an XDR amount (stroops) to a decimal string.
- fromXdrOperation() : InvokeHostFunctionOperation
- Creates an InvokeHostFunctionOperation from its XDR representation.
- getAuth() : array<string|int, SorobanAuthorizationEntry>
- Gets the authorization entries.
- getFunction() : HostFunction
- Gets the host function.
- getSourceAccount() : MuxedAccount|null
- Gets the source account for this operation.
- setAuth() : void
- Sets the authorization entries.
- setFunction() : void
- Sets the host function.
- setSourceAccount() : void
- Sets the source account for this operation.
- toOperationBody() : XdrOperationBody
- Converts this operation to its XDR operation body representation.
- toXdr() : XdrOperation
- Converts this operation to its XDR representation.
- toXdrAmount() : BigInteger
- Converts a decimal amount string to XDR amount format (stroops).
Properties
$auth
public
array<string|int, SorobanAuthorizationEntry>
$auth
= array()
Authorization entries for the invocation
$function
public
HostFunction
$function
The host function to invoke
Methods
__construct()
Creates a new InvokeHostFunctionOperation.
public
__construct(HostFunction $function[, array<string|int, SorobanAuthorizationEntry> $auth = array() ][, MuxedAccount|null $sourceAccount = null ]) : mixed
Parameters
- $function : HostFunction
-
The host function to invoke
- $auth : array<string|int, SorobanAuthorizationEntry> = array()
-
Authorization entries for the invocation
- $sourceAccount : MuxedAccount|null = null
-
Optional source account
fromXdr()
Creates an operation from its XDR representation.
public
static fromXdr(XdrOperation $xdrOp) : AbstractOperation
Parameters
- $xdrOp : XdrOperation
-
The XDR operation to convert
Return values
AbstractOperation —The resulting operation instance
fromXdrAmount()
Converts an XDR amount (stroops) to a decimal string.
public
static fromXdrAmount(BigInteger $stroops) : string
Parameters
- $stroops : BigInteger
-
The amount in stroops (1 stroop = 0.0000001)
Return values
string —The amount as a decimal string
fromXdrOperation()
Creates an InvokeHostFunctionOperation from its XDR representation.
public
static fromXdrOperation(XdrInvokeHostFunctionOp $xdrOp) : InvokeHostFunctionOperation
Parameters
- $xdrOp : XdrInvokeHostFunctionOp
-
The XDR invoke host function operation to convert
Tags
Return values
InvokeHostFunctionOperation —The resulting InvokeHostFunctionOperation instance
getAuth()
Gets the authorization entries.
public
getAuth() : array<string|int, SorobanAuthorizationEntry>
Return values
array<string|int, SorobanAuthorizationEntry> —The authorization entries
getFunction()
Gets the host function.
public
getFunction() : HostFunction
Return values
HostFunction —The host function
getSourceAccount()
Gets the source account for this operation.
public
getSourceAccount() : MuxedAccount|null
Return values
MuxedAccount|null —The source account, or null if using the transaction's source account
setAuth()
Sets the authorization entries.
public
setAuth(array<string|int, SorobanAuthorizationEntry> $auth) : void
Parameters
- $auth : array<string|int, SorobanAuthorizationEntry>
-
The authorization entries
setFunction()
Sets the host function.
public
setFunction(HostFunction $function) : void
Parameters
- $function : HostFunction
-
The host function
setSourceAccount()
Sets the source account for this operation.
public
setSourceAccount(MuxedAccount|null $sourceAccount) : void
Parameters
- $sourceAccount : MuxedAccount|null
-
The source account, or null to use the transaction's source account
toOperationBody()
Converts this operation to its XDR operation body representation.
public
toOperationBody() : XdrOperationBody
Return values
XdrOperationBody —The XDR operation body
toXdr()
Converts this operation to its XDR representation.
public
toXdr() : XdrOperation
Return values
XdrOperation —The XDR operation
toXdrAmount()
Converts a decimal amount string to XDR amount format (stroops).
public
static toXdrAmount(string $strAmount) : BigInteger
Parameters
- $strAmount : string
-
The amount as a decimal string
Return values
BigInteger —The amount in stroops (1 stroop = 0.0000001)