toOperationBody method

  1. @override
XdrOperationBody toOperationBody ()
override

Generates OperationBody XDR object.

Implementation

@override
XdrOperationBody toOperationBody() {
  XdrCreateClaimableBalanceOp op = XdrCreateClaimableBalanceOp();

  List<XdrClaimant> xdrClaimants = List<XdrClaimant>(this.claimants.length);
  for (int i = 0; i < this.claimants.length; i++) {
    xdrClaimants[i] = this.claimants[i].toXdr();
  }
  op.claimants = xdrClaimants;

  op.asset = this.asset.toXdr();

  XdrInt64 amount = XdrInt64();
  amount.int64 = Operation.toXdrAmount(this.amount);
  op.amount = amount;

  XdrOperationBody body = XdrOperationBody();
  body.discriminant = XdrOperationType.CREATE_CLAIMABLE_BALANCE;
  body.createClaimableBalanceOp = op;
  return body;
}