Stellar PHP SDK API Documentation

ManageBuyOfferOperationBuilder
in package

Builder for creating ManageBuyOffer operations.

This builder implements the builder pattern to construct ManageBuyOfferOperation instances with a fluent interface. ManageBuyOffer operations create, update, or delete offers on the Stellar decentralized exchange, specifying the amount to buy rather than the amount to sell.

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

Stellar developer docs

since
1.0.0
example

$operation = (new ManageBuyOfferOperationBuilder($selling, $buying, '100.00', '0.85')) ->setOfferId(12345) ->setSourceAccount($sourceId) ->build();

Table of Contents

Methods

__construct()  : mixed
Creates a new ManageBuyOffer operation builder.
build()  : ManageBuyOfferOperation
Builds the ManageBuyOffer operation.
setMuxedSourceAccount()  : $this
Sets the muxed source account for this operation.
setOfferId()  : $this
Sets the offer ID for this operation.
setSourceAccount()  : $this
Sets the source account for this operation.

Methods

__construct()

Creates a new ManageBuyOffer operation builder.

public __construct(Asset $selling, Asset $buying, string $amount, string $price) : mixed
Parameters
$selling : Asset

The asset being sold in this operation

$buying : Asset

The asset being bought in this operation

$amount : string

The amount of asset to be bought

$price : string

The price of the asset being bought in terms of the asset being sold

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

setOfferId()

Sets the offer ID for this operation.

public setOfferId(int $offerId) : $this

Use 0 to create a new offer, or an existing offer ID to modify it.

Parameters
$offerId : int

The offer ID (must be non-negative)

Tags
throws
InvalidArgumentException

If the offer ID is negative

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