PathPaymentStrictSendOperation
extends AbstractOperation
in package
Represents a Path Payment Strict Send operation.
Sends a payment from one account to another through a path, where you specify the exact amount to send. This operation finds the best path for the payment that delivers the most destination asset.
Tags
Table of Contents
Methods
- __construct() : mixed
- Constructs a new PathPaymentStrictSendOperation object.
- fromXdr() : AbstractOperation
- Creates an operation from its XDR representation.
- fromXdrAmount() : string
- Converts an XDR amount (stroops) to a decimal string.
- fromXdrOperation() : PathPaymentStrictSendOperation
- Creates a PathPaymentStrictSendOperation from XDR operation object.
- getDestAsset() : Asset
- Returns the asset the destination account receives.
- getDestination() : MuxedAccount
- Returns the account that receives the payment.
- getDestMin() : string
- Returns the minimum amount of destination asset that must be received.
- getPath() : array<string|int, Asset>|null
- Returns the intermediate assets in the payment path.
- getSendAmount() : string
- Returns the exact amount of send asset to deduct (excluding fees).
- getSendAsset() : Asset
- Returns the asset deducted from the sender's account.
- 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 PathPaymentStrictSendOperation object.
public
__construct(Asset $sendAsset, string $sendAmount, MuxedAccount $destination, Asset $destAsset, string $destMin[, array<string|int, Asset>|null $path = null ]) : mixed
Parameters
- $sendAsset : Asset
-
The asset to be deducted from the sender's account
- $sendAmount : string
-
The exact amount of the send asset to deduct (as a decimal string, excluding fees)
- $destination : MuxedAccount
-
The account that receives the payment
- $destAsset : Asset
-
The asset that the destination account receives
- $destMin : string
-
The minimum amount of the destination asset that must be received (as a decimal string)
- $path : array<string|int, Asset>|null = null
-
The intermediate assets in the payment path. For example, if the path is USD to EUR through XLM and BTC, the path would be USD -> XLM -> BTC -> EUR and this parameter would contain [XLM, BTC].
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 PathPaymentStrictSendOperation from XDR operation object.
public
static fromXdrOperation(XdrPathPaymentStrictSendOperation $xdrOp) : PathPaymentStrictSendOperation
Parameters
- $xdrOp : XdrPathPaymentStrictSendOperation
-
The XDR operation object to convert.
Return values
PathPaymentStrictSendOperation —The created operation instance.
getDestAsset()
Returns the asset the destination account receives.
public
getDestAsset() : Asset
Return values
Asset —The destination asset.
getDestination()
Returns the account that receives the payment.
public
getDestination() : MuxedAccount
Return values
MuxedAccount —The destination account.
getDestMin()
Returns the minimum amount of destination asset that must be received.
public
getDestMin() : string
Return values
string —The minimum destination amount.
getPath()
Returns the intermediate assets in the payment path.
public
getPath() : array<string|int, Asset>|null
For example, if the path is USD to EUR through XLM and BTC, the path would be USD -> XLM -> BTC -> EUR and this returns [XLM, BTC].
Return values
array<string|int, Asset>|null —The payment path, or null if direct payment.
getSendAmount()
Returns the exact amount of send asset to deduct (excluding fees).
public
getSendAmount() : string
Return values
string —The send amount.
getSendAsset()
Returns the asset deducted from the sender's account.
public
getSendAsset() : Asset
Return values
Asset —The sending asset.
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)