ManageSellOfferOperation

public class ManageSellOfferOperation : ManageOfferOperation, @unchecked Sendable

Represents a Stellar manage sell offer operation creating or modifying offers with fixed sell amounts.

  • Creates a new ManageOfferOperation object.

    Declaration

    Swift

    public override init(sourceAccountId: String?, selling: Asset, buying: Asset, amount: Decimal, price: Price, offerId: Int64)

    Parameters

    sourceAccountId

    (optional) source account Id, must be valid, otherwise it will be ignored.

    selling

    Asset the offer creator is selling.

    buying

    Asset the offer creator is buying.

    amount

    Amount of selling being sold. Set to 0 if you want to delete an existing offer.

    price

    Price of 1 unit of selling in terms of buying. For example, if you wanted to sell 30 XLM and buy 5 BTC, the price would be {numerator, denominator} = {5,30}.

    offerId

    The ID of the offer. 0 for new offer. Set to existing offer ID to update or delete. If you want to update an existing offer set Offer ID to existing offer ID. If you want to delete an existing offer set Offer ID to existing offer ID and set Amount to 0.

  • Creates a new ManageSellOfferOperation object from the given ManageOfferOperationXDR object.

    Declaration

    Swift

    public override init(fromXDR: ManageOfferOperationXDR, sourceAccountId: String?)

    Parameters

    fromXDR

    the ManageOfferOperationXDR object to be used to create a new ManageSellOfferOperation object.

    sourceAccountId

    (optional) source account Id, must be valid, otherwise it will be ignored.