ManageSellOfferOperation
extends AbstractOperation
in package
Represents a Manage Sell Offer operation.
Creates, updates, or deletes an offer to sell one asset for another, setting the amount of asset to sell. This operation creates a sell offer on the Stellar decentralized exchange (DEX).
Tags
Table of Contents
Methods
- __construct() : mixed
- Constructs a new ManageSellOfferOperation object.
- fromXdr() : AbstractOperation
- Creates an operation from its XDR representation.
- fromXdrAmount() : string
- Converts an XDR amount (stroops) to a decimal string.
- fromXdrOperation() : ManageSellOfferOperation
- Creates a ManageSellOfferOperation from XDR operation object.
- getAmount() : string
- Returns the amount of selling asset being sold.
- getBuying() : Asset
- Returns the asset being bought in this offer.
- getOfferId() : int
- Returns the ID of the offer.
- getPrice() : Price
- Returns the price of 1 unit of selling in terms of buying.
- getSelling() : Asset
- Returns the asset being sold in this offer.
- 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 ManageSellOfferOperation object.
public
__construct(Asset $selling, Asset $buying, string $amount, Price $price, int $offerId) : mixed
Creates, updates, or deletes an offer to sell one asset for another on the DEX.
Parameters
- $selling : Asset
-
The asset being sold
- $buying : Asset
-
The asset being bought
- $amount : string
-
The amount of the selling asset to sell (as a decimal string, set to "0" to delete)
- $price : Price
-
The price of 1 unit of selling in terms of buying
- $offerId : int
-
The offer ID (0 for new offers, or existing offer ID to update/delete)
Tags
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 ManageSellOfferOperation from XDR operation object.
public
static fromXdrOperation(XdrManageSellOfferOperation $xdrOp) : ManageSellOfferOperation
Parameters
- $xdrOp : XdrManageSellOfferOperation
-
The XDR operation object to convert.
Return values
ManageSellOfferOperation —The created operation instance.
getAmount()
Returns the amount of selling asset being sold.
public
getAmount() : string
Return values
string —The amount of the selling asset.
getBuying()
Returns the asset being bought in this offer.
public
getBuying() : Asset
Return values
Asset —The buying asset.
getOfferId()
Returns the ID of the offer.
public
getOfferId() : int
Return values
int —The offer ID (0 for new offers).
getPrice()
Returns the price of 1 unit of selling in terms of buying.
public
getPrice() : Price
Return values
Price —The offer price.
getSelling()
Returns the asset being sold in this offer.
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 the 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)