public override sdkxdr.Operation.OperationBody ToOperationBody()
        {
            var op = new sdkxdr.PathPaymentStrictReceiveOp();

            // sendAsset
            op.SendAsset = SendAsset.ToXdr();
            // sendMax
            var sendMax = new sdkxdr.Int64();

            sendMax.InnerValue = ToXdrAmount(SendMax);
            op.SendMax         = sendMax;
            // destination
            op.Destination = Destination.MuxedAccount;
            // destAsset
            op.DestAsset = DestAsset.ToXdr();
            // destAmount
            var destAmount = new sdkxdr.Int64();

            destAmount.InnerValue = ToXdrAmount(DestAmount);
            op.DestAmount         = destAmount;
            // path
            var path = new sdkxdr.Asset[Path.Length];

            for (var i = 0; i < Path.Length; i++)
            {
                path[i] = Path[i].ToXdr();
            }
            op.Path = path;

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

            body.Discriminant = sdkxdr.OperationType.Create(sdkxdr.OperationType.OperationTypeEnum.PATH_PAYMENT_STRICT_RECEIVE);
            body.PathPaymentStrictReceiveOp = op;
            return(body);
        }
        public override sdkxdr.Operation.OperationBody ToOperationBody()
        {
            sdkxdr.PathPaymentOp op = new sdkxdr.PathPaymentOp();

            // sendAsset
            op.SendAsset = SendAsset.ToXdr();
            // sendMax
            sdkxdr.Int64 sendMax = new sdkxdr.Int64();
            sendMax.InnerValue = ToXdrAmount(SendMax);
            op.SendMax         = sendMax;
            // destination
            sdkxdr.AccountID destination = new sdkxdr.AccountID();
            destination.InnerValue = Destination.XdrPublicKey;
            op.Destination         = destination;
            // destAsset
            op.DestAsset = DestAsset.ToXdr();
            // destAmount
            sdkxdr.Int64 destAmount = new sdkxdr.Int64();
            destAmount.InnerValue = ToXdrAmount(DestAmount);
            op.DestAmount         = destAmount;
            // path
            sdkxdr.Asset[] path = new sdkxdr.Asset[Path.Length];

            for (int i = 0; i < Path.Length; i++)
            {
                path[i] = Path[i].ToXdr();
            }

            op.Path = path;

            sdkxdr.Operation.OperationBody body = new sdkxdr.Operation.OperationBody();
            body.Discriminant  = sdkxdr.OperationType.Create(sdkxdr.OperationType.OperationTypeEnum.PATH_PAYMENT);
            body.PathPaymentOp = op;
            return(body);
        }
예제 #3
0
        public override sdkxdr.Operation.OperationBody ToOperationBody()
        {
            var op = new sdkxdr.PathPaymentStrictSendOp();

            // sendAsset
            op.SendAsset = SendAsset.ToXdr();
            // sendAmount
            var sendAmount = new sdkxdr.Int64();

            sendAmount.InnerValue = ToXdrAmount(SendAmount);
            op.SendAmount         = sendAmount;
            // destination
            var destination = new sdkxdr.AccountID();

            destination.InnerValue = Destination.XdrPublicKey;
            op.Destination         = destination;
            // destAsset
            op.DestAsset = DestAsset.ToXdr();
            // destMin
            var destMin = new sdkxdr.Int64();

            destMin.InnerValue = ToXdrAmount(DestMin);
            op.DestMin         = destMin;
            // path
            var path = new sdkxdr.Asset[Path.Length];

            for (var i = 0; i < Path.Length; i++)
            {
                path[i] = Path[i].ToXdr();
            }
            op.Path = path;

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

            body.Discriminant            = sdkxdr.OperationType.Create(sdkxdr.OperationType.OperationTypeEnum.PATH_PAYMENT_STRICT_SEND);
            body.PathPaymentStrictSendOp = op;
            return(body);
        }