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

            op.Selling = Selling.ToXdr();
            op.Buying  = Buying.ToXdr();
            var amount = new sdkxdr.Int64();

            amount.InnerValue = ToXdrAmount(Amount);
            op.Amount         = amount;
            var price = stellar_dotnet_sdk.Price.FromString(Price);

            op.Price = price.ToXdr();
            var offerId = new sdkxdr.Uint64();

            offerId.InnerValue = OfferId;
            op.OfferID         = offerId;

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

            body.Discriminant  = sdkxdr.OperationType.Create(sdkxdr.OperationType.OperationTypeEnum.MANAGE_OFFER);
            body.ManageOfferOp = op;

            return(body);
        }
Esempio n. 2
0
        public override sdkxdr.Operation.OperationBody ToOperationBody()
        {
            sdkxdr.CreatePassiveOfferOp op = new sdkxdr.CreatePassiveOfferOp();
            op.Selling = Selling.ToXdr();
            op.Buying  = Buying.ToXdr();
            sdkxdr.Int64 amount = new sdkxdr.Int64();
            amount.InnerValue = ToXdrAmount(Amount);
            op.Amount         = amount;
            Price price = Sdk.Price.FromString(Price);

            op.Price = price.ToXdr();

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

            body.Discriminant =
                sdkxdr.OperationType.Create(sdkxdr.OperationType.OperationTypeEnum.CREATE_PASSIVE_OFFER);
            body.CreatePassiveOfferOp = op;

            return(body);
        }
Esempio n. 3
0
        public override sdkxdr.Operation.OperationBody ToOperationBody()
        {
            var op = new sdkxdr.CreatePassiveSellOfferOp();

            op.Selling = Selling.ToXdr();
            op.Buying  = Buying.ToXdr();
            var amount = new sdkxdr.Int64();

            amount.InnerValue = ToXdrAmount(Amount);
            op.Amount         = amount;
            var price = stellar_dotnet_sdk.Price.FromString(Price);

            op.Price = price.ToXdr();

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

            body.Discriminant             = sdkxdr.OperationType.Create(sdkxdr.OperationType.OperationTypeEnum.CREATE_PASSIVE_SELL_OFFER);
            body.CreatePassiveSellOfferOp = op;

            return(body);
        }