toOperationBody method
- @override
override
Generates OperationBody XDR object.
Implementation
@override
XdrOperationBody toOperationBody() {
XdrManageBuyOfferOp op = new XdrManageBuyOfferOp();
op.selling = selling.toXdr();
op.buying = buying.toXdr();
XdrInt64 amount = new XdrInt64();
amount.int64 = Operation.toXdrAmount(this.amount);
op.amount = amount;
Price price = Price.fromString(this.price);
op.price = price.toXdr();
XdrUint64 offerId = new XdrUint64();
offerId.uint64 = int.parse(this.offerId);
op.offerID = offerId;
XdrOperationBody body = new XdrOperationBody();
body.discriminant = XdrOperationType.MANAGE_BUY_OFFER;
body.manageBuyOfferOp = op;
return body;
}