/// <summary>
        /// Returns the Account Merge XDR Operation Body
        /// </summary>
        /// <returns></returns>
        public override xdr.Operation.OperationBody ToOperationBody()
        {
            var body        = new xdr.Operation.OperationBody();
            var destination = new AccountID {
                InnerValue = Destination.XdrPublicKey
            };

            body.Destination  = destination;
            body.Discriminant = OperationType.Create(OperationType.OperationTypeEnum.ACCOUNT_MERGE);
            return(body);
        }
        public override xdr.Operation.OperationBody ToOperationBody()
        {
            var op          = new CreateAccountOp();
            var destination = new AccountID();

            destination.InnerValue = Destination.XdrPublicKey;
            op.Destination         = destination;
            var startingBalance = new Int64();

            startingBalance.InnerValue = ToXdrAmount(StartingBalance);
            op.StartingBalance         = startingBalance;

            var body = new xdr.Operation.OperationBody();

            body.Discriminant    = OperationType.Create(OperationType.OperationTypeEnum.CREATE_ACCOUNT);
            body.CreateAccountOp = op;
            return(body);
        }
Ejemplo n.º 3
0
        public override xdr.Operation.OperationBody ToOperationBody()
        {
            var op = new PaymentOp();

            // destination
            var destination = new AccountID();

            destination.InnerValue = Destination.XdrPublicKey;
            op.Destination         = destination;
            // asset
            op.Asset = Asset.ToXdr();
            // amount
            var amount = new Int64();

            amount.InnerValue = ToXdrAmount(Amount);
            op.Amount         = amount;

            var body = new xdr.Operation.OperationBody();

            body.Discriminant = OperationType.Create(OperationType.OperationTypeEnum.PAYMENT);
            body.PaymentOp    = op;
            return(body);
        }
 /// <summary>
 /// Builder to build the AccountMerge Operation given an XDR OperationBody
 /// </summary>
 /// <param name="op"></param>
 public Builder(xdr.Operation.OperationBody op)
 {
     _destination = KeyPair.FromXdrPublicKey(op.Destination.InnerValue);
 }