toOperationBody method
Generates OperationBody XDR object.
Implementation
@override
XdrOperationBody toOperationBody() {
List<XdrClaimant> xdrClaimants = List<XdrClaimant>.empty(growable: true);
for (int i = 0; i < this.claimants.length; i++) {
xdrClaimants.add(this.claimants[i].toXdr());
}
XdrInt64 amount = XdrInt64(Operation.toXdrAmount(this.amount));
XdrCreateClaimableBalanceOp op =
XdrCreateClaimableBalanceOp(this.asset.toXdr(), amount, xdrClaimants);
XdrOperationBody body =
XdrOperationBody(XdrOperationType.CREATE_CLAIMABLE_BALANCE);
body.createClaimableBalanceOp = op;
return body;
}