PaymentOperation
extends AbstractOperation
in package
Represents a Payment operation.
Sends a specified amount of an asset to a destination account. This is the most basic operation for transferring assets between accounts on the Stellar network.
Tags
Table of Contents
Methods
- __construct() : mixed
- Constructs a new PaymentOperation object.
- fromXdr() : AbstractOperation
- Creates an operation from its XDR representation.
- fromXdrAmount() : string
- Converts an XDR amount (stroops) to a decimal string.
- fromXdrOperation() : PaymentOperation
- Creates a PaymentOperation from XDR operation object.
- getAmount() : string
- Returns the amount of the asset to send.
- getAsset() : Asset
- Returns the asset to send to the destination account.
- getDestination() : MuxedAccount
- Returns the account that receives the payment.
- getSourceAccount() : MuxedAccount|null
- Gets the source account for this operation.
- setSourceAccount() : void
- Sets the source account for this operation.
- toOperationBody() : XdrOperationBody
- Converts the 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).
Methods
__construct()
Constructs a new PaymentOperation object.
public
__construct(MuxedAccount $destination, Asset $asset, string $amount) : mixed
Parameters
- $destination : MuxedAccount
-
The account that receives the payment.
- $asset : Asset
-
The asset to send to the destination account.
- $amount : string
-
The amount of the asset to send.
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 a PaymentOperation from XDR operation object.
public
static fromXdrOperation(XdrPaymentOperation $xdrOp) : PaymentOperation
Parameters
- $xdrOp : XdrPaymentOperation
-
The XDR operation object to convert.
Return values
PaymentOperation —The created operation instance.
getAmount()
Returns the amount of the asset to send.
public
getAmount() : string
Return values
string —The payment amount.
getAsset()
Returns the asset to send to the destination account.
public
getAsset() : Asset
Return values
Asset —The payment asset.
getDestination()
Returns the account that receives the payment.
public
getDestination() : MuxedAccount
Return values
MuxedAccount —The destination account.
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
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 the 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)