CreatePassiveOfferOperation

public class CreatePassiveOfferOperation : Operation, @unchecked Sendable

Represents a create passive offer operation. A passive offer is an offer that does not act on and take a reverse offer of equal price. Instead, they only take offers of lesser price. See Stellar developer docs

  • The asset being sold.

    Declaration

    Swift

    public let selling: Asset
  • The asset being bought.

    Declaration

    Swift

    public let buying: Asset
  • The amount of the selling asset being offered.

    Declaration

    Swift

    public let amount: Decimal
  • The price of 1 unit of selling in terms of buying.

    Declaration

    Swift

    public let price: Price
  • Creates a new CreatePassiveOfferOperation object.

    Declaration

    Swift

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

    Parameters

    sourceAccountId

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

    selling

    The asset you would like to sell.

    buying

    The asset you would like to buy.

    amount

    Amount of selling being sold..

    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}.

  • Creates a new CreatePassiveSellOfferOperation object from the given CreatePassiveOfferOperationXDR object.

    Declaration

    Swift

    public init(fromXDR: CreatePassiveOfferOperationXDR, sourceAccountId: String?)

    Parameters

    fromXDR

    the CreatePassiveOfferOperationXDR object to be used to create a new CreatePassiveSellOfferOperation object.

    sourceAccountId

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