Stellar PHP SDK API Documentation

PaymentOperationBuilder
in package

Builder for creating Payment operations.

This builder implements the builder pattern to construct PaymentOperation instances with a fluent interface. Payment operations send a specified amount of an asset from the source account to a destination account.

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

Stellar developer docs

since
1.0.0
example

$operation = (new PaymentOperationBuilder($destinationId, $asset, '100.00')) ->setSourceAccount($sourceId) ->build();

Table of Contents

Methods

__construct()  : mixed
Creates a new Payment operation builder.
build()  : PaymentOperation
Builds the Payment operation.
forMuxedDestinationAccount()  : PaymentOperationBuilder
Creates a new Payment operation builder for a muxed destination account.
setMuxedSourceAccount()  : $this
Sets the muxed source account for this operation.
setSourceAccount()  : $this
Sets the source account for this operation.

Methods

__construct()

Creates a new Payment operation builder.

public __construct(string $destinationAccountId, Asset $asset, string $amount) : mixed
Parameters
$destinationAccountId : string

The destination account ID

$asset : Asset

The asset to be sent

$amount : string

The amount of asset to send

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

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