Stellar PHP SDK API Documentation

PathPaymentStrictReceiveOperationBuilder
in package

Builder for creating PathPaymentStrictReceive operations.

This builder implements the builder pattern to construct PathPaymentStrictReceiveOperation instances with a fluent interface. PathPaymentStrictReceive operations send assets through a path of offers on the Stellar decentralized exchange, guaranteeing the exact amount received by the destination account.

Tags
see
PathPaymentStrictReceiveOperation
see
https://developers.stellar.org

Stellar developer docs

since
1.0.0
example

$operation = (new PathPaymentStrictReceiveOperationBuilder($sendAsset, '100.00', $destId, $destAsset, '95.00')) ->setPath([$intermediateAsset1, $intermediateAsset2]) ->setSourceAccount($sourceId) ->build();

Table of Contents

Methods

__construct()  : mixed
Creates a new PathPaymentStrictReceive operation builder.
build()  : PathPaymentStrictReceiveOperation
Builds the PathPaymentStrictReceive operation.
forMuxedDestinationAccount()  : PathPaymentStrictReceiveOperationBuilder
Creates a new PathPaymentStrictReceive operation builder for a muxed destination account.
setMuxedSourceAccount()  : $this
Sets the muxed source account for this operation.
setPath()  : $this
Sets the payment path through intermediate assets.
setSourceAccount()  : $this
Sets the source account for this operation.

Methods

__construct()

Creates a new PathPaymentStrictReceive operation builder.

public __construct(Asset $sendAsset, string $sendMax, string $destinationAccountId, Asset $destAsset, string $destAmount) : mixed
Parameters
$sendAsset : Asset

The asset to be sent (deducted from sender's account)

$sendMax : string

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

$destinationAccountId : string

The destination account ID

$destAsset : Asset

The asset to be received by the destination account

$destAmount : string

The exact amount of destination asset to be received

forMuxedDestinationAccount()

Creates a new PathPaymentStrictReceive operation builder for a muxed destination account.

public static forMuxedDestinationAccount(Asset $sendAsset, string $sendMax, MuxedAccount $destination, Asset $destAsset, string $destAmount) : PathPaymentStrictReceiveOperationBuilder
Parameters
$sendAsset : Asset

The asset deducted from the sender's account

$sendMax : string

The maximum amount of send asset to deduct

$destination : MuxedAccount

The muxed destination account

$destAsset : Asset

The asset the destination account receives

$destAmount : string

The amount of destination asset the destination account receives

Return values
PathPaymentStrictReceiveOperationBuilder

The new builder instance

setMuxedSourceAccount()

Sets the muxed source account for this operation.

public setMuxedSourceAccount(MuxedAccount $sourceAccount) : $this
Parameters
$sourceAccount : MuxedAccount

The muxed account to use as source

Return values
$this

Returns the builder instance for method chaining

setPath()

Sets the payment path through intermediate assets.

public setPath(array<string|int, Asset$path) : $this

The assets (other than send asset and destination asset) involved in the offers the path takes. For example, if you can only find a path from USD to EUR through XLM and BTC, the path would be USD -> XLM -> BTC -> EUR and the path field would contain XLM and BTC.

Parameters
$path : array<string|int, Asset>

Array of intermediate assets in the payment path

Return values
$this

Returns the builder instance for method chaining

setSourceAccount()

Sets the source account for this operation.

public setSourceAccount(string $accountId) : $this
Parameters
$accountId : string

The Stellar account ID (G...)

Return values
$this

Returns the builder instance for method chaining


        
On this page

Search results