Class ManageBuyOfferOperation.Builder

java.lang.Object
org.stellar.sdk.ManageBuyOfferOperation.Builder
Enclosing class:
ManageBuyOfferOperation

public static class ManageBuyOfferOperation.Builder extends Object
Builds ManageBuyOffer operation. If you want to update existing offer use setOfferId(long).
See Also:
  • Constructor Details

    • Builder

      public Builder(@NonNull @NonNull Asset selling, @NonNull @NonNull Asset buying, @NonNull @NonNull String amount, @NonNull @NonNull Price price)
      Creates a new ManageBuyOffer builder. If you want to update existing offer use setOfferId(long).
      Parameters:
      selling - The asset being sold in this operation
      buying - The asset being bought in this operation
      amount - Amount of asset to be bought.
      price - Price of thing being bought in terms of what you are selling.
      Throws:
      ArithmeticException - when amount has more than 7 decimal places.
    • Builder

      public Builder(@NonNull @NonNull Asset selling, @NonNull @NonNull Asset buying, @NonNull @NonNull String amount, @NonNull @NonNull String price)
  • Method Details

    • setOfferId

      public ManageBuyOfferOperation.Builder setOfferId(long offerId)
      Sets offer ID. 0 creates a new offer. Set to existing offer ID to change it.
      Parameters:
      offerId -
    • setSourceAccount

      public ManageBuyOfferOperation.Builder setSourceAccount(@NonNull @NonNull String sourceAccount)
      Sets the source account for this operation.
      Parameters:
      sourceAccount - The operation's source account.
      Returns:
      Builder object so you can chain methods.
    • build

      public ManageBuyOfferOperation build()
      Builds an operation