toOperationBody method
Generates OperationBody XDR object.
Implementation
@override
XdrOperationBody toOperationBody() {
XdrManageSellOfferOp op = new XdrManageSellOfferOp();
op.selling = selling.toXdr();
op.buying = buying.toXdr();
XdrInt64 amount = new XdrInt64(Operation.toXdrAmount(this.amount));
op.amount = amount;
Price price = Price.fromString(this.price);
op.price = price.toXdr();
XdrUint64 offerId = new XdrUint64(int.parse(this.offerId));
op.offerID = offerId;
XdrOperationBody body =
new XdrOperationBody(XdrOperationType.MANAGE_SELL_OFFER);
body.manageSellOfferOp = op;
return body;
}