ManageBuyOfferOperation
extends AbstractOperation
in package
Represents <a href="https://developers.stellar.org" target="_blank">Stellar developer docs</a> operation.
Creates, updates, or deletes an offer to buy one asset for another with a specified buy amount.
Tags
Table of Contents
Methods
- __construct() : mixed
- Creates a new ManageBuyOfferOperation.
- fromXdr() : AbstractOperation
- Creates an operation from its XDR representation.
- fromXdrAmount() : string
- Converts an XDR amount (stroops) to a decimal string.
- fromXdrOperation() : ManageBuyOfferOperation
- Creates a ManageBuyOfferOperation from its XDR representation.
- getAmount() : string
- Gets the amount to be bought.
- getBuying() : Asset
- Gets the asset being bought.
- getOfferId() : int
- Gets the offer ID.
- getPrice() : Price
- Gets the offer price.
- getSelling() : Asset
- Gets the asset being sold.
- getSourceAccount() : MuxedAccount|null
- Gets the source account for this operation.
- setSourceAccount() : void
- Sets the source account for this operation.
- toOperationBody() : XdrOperationBody
- Converts this 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()
Creates a new ManageBuyOfferOperation.
public
__construct(Asset $selling, Asset $buying, string $amount, Price $price, int $offerId) : mixed
Parameters
- $selling : Asset
-
The asset being sold
- $buying : Asset
-
The asset being bought
- $amount : string
-
The amount of buying asset to purchase (as a decimal string, set to "0" to delete)
- $price : Price
-
The price of 1 unit of buying in terms of selling
- $offerId : int
-
The offer ID (0 for new offers, or existing offer ID to update/delete)
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 ManageBuyOfferOperation from its XDR representation.
public
static fromXdrOperation(XdrManageBuyOfferOperation $xdrOp) : ManageBuyOfferOperation
Parameters
- $xdrOp : XdrManageBuyOfferOperation
-
The XDR manage buy offer operation to convert
Return values
ManageBuyOfferOperation —The resulting ManageBuyOfferOperation instance
getAmount()
Gets the amount to be bought.
public
getAmount() : string
Return values
string —The amount as a decimal string
getBuying()
Gets the asset being bought.
public
getBuying() : Asset
Return values
Asset —The buying asset
getOfferId()
Gets the offer ID.
public
getOfferId() : int
Return values
int —The offer ID
getPrice()
Gets the offer price.
public
getPrice() : Price
Return values
Price —The price
getSelling()
Gets the asset being sold.
public
getSelling() : Asset
Return values
Asset —The selling 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 this 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)