Stellar PHP SDK API Documentation

PathPaymentStrictReceiveOperation extends AbstractOperation
in package

Represents Path Payment Strict Receive operation.

Sends a payment from one account to another through a path, where you specify the exact amount the destination receives. This operation finds the cheapest path for the payment using the orderbooks.

Tags
see

Stellar developer docs

see
PathPaymentStrictReceiveOperationBuilder

For building this operation

since
1.0.0

Table of Contents

Methods

__construct()  : mixed
Constructs a new PathPaymentStrictReceiveOperation object.
fromXdr()  : AbstractOperation
Creates an operation from its XDR representation.
fromXdrAmount()  : string
Converts an XDR amount (stroops) to a decimal string.
fromXdrOperation()  : PathPaymentStrictReceiveOperation
Creates a PathPaymentStrictReceiveOperation from XDR operation object.
getDestAmount()  : string
Returns the exact amount of destination asset the destination receives.
getDestAsset()  : Asset
Returns the asset the destination account receives.
getDestination()  : MuxedAccount
Returns the account that receives the payment.
getPath()  : array<string|int, Asset>|null
Returns the intermediate assets in the payment path.
getSendAsset()  : Asset
Returns the asset deducted from the sender's account.
getSendMax()  : string
Returns the maximum amount of send asset to deduct (excluding fees).
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 PathPaymentStrictReceiveOperation object.

public __construct(Asset $sendAsset, string $sendMax, MuxedAccount $destination, Asset $destAsset, string $destAmount[, array<string|int, Asset>|null $path = null ]) : mixed
Parameters
$sendAsset : Asset

The asset to be deducted from the sender's account

$sendMax : string

The maximum 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

$destAmount : string

The exact amount of the destination asset that the destination receives (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].

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

getDestAmount()

Returns the exact amount of destination asset the destination receives.

public getDestAmount() : string
Return values
string

The 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.

getSendMax()

Returns the maximum amount of send asset to deduct (excluding fees).

public getSendMax() : string
Return values
string

The maximum send amount.

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

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)


        
On this page

Search results