Exemplo n.º 1
0
        public async Task <TransactionCreatedReply> SetPhasingOnlyControl(VotingModel controlVotingModel, long controlQuorum,
                                                                          CreateTransactionParameters parameters, long?controlMinBalance = null,
                                                                          VotingModel?controlMinBalanceModel = null, ulong?controlHolding = null, IEnumerable <string> controlWhitelisted = null,
                                                                          Amount controlMaxFees = null, int?controlMinDuration            = null, int?controlMaxDuration = null)
        {
            var queryParameters = new Dictionary <string, List <string> >
            {
                { Parameters.ControlVotingModel, new List <string> {
                      ((int)controlVotingModel).ToString()
                  } },
                { Parameters.ControlQuorum, new List <string> {
                      controlQuorum.ToString()
                  } }
            };

            parameters.AppendToQueryParameters(queryParameters);
            queryParameters.AddIfHasValue(Parameters.ControlMinBalance, controlMinBalance);
            queryParameters.AddIfHasValue(Parameters.ControlMinBalanceModel,
                                          controlMinBalanceModel != null ? (int)controlMinBalanceModel : (int?)null);

            if (controlWhitelisted != null)
            {
                queryParameters.Add(Parameters.ControlWhitelisted, controlWhitelisted.ToList());
            }
            queryParameters.AddIfHasValue(Parameters.ControlMaxFees, controlMaxFees?.Nqt.ToString());
            queryParameters.AddIfHasValue(Parameters.ControlMinDuration, controlMinDuration);
            queryParameters.AddIfHasValue(Parameters.ControlMaxDuration, controlMaxDuration);
            return(await Post <TransactionCreatedReply>("setPhasingOnlyControl", queryParameters));
        }
Exemplo n.º 2
0
        public async Task <TransactionCreatedReply> CreatePoll(CreatePollParameters createPollParameters,
                                                               CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.Name, createPollParameters.Name },
                { Parameters.Description, createPollParameters.Description },
                { Parameters.FinishHeight, createPollParameters.FinishHeight.ToString() },
                { Parameters.VotingModel, ((int)createPollParameters.VotingModel).ToString() },
                { Parameters.MinNumberOfOptions, createPollParameters.MinNumberOfOptions.ToString() },
                { Parameters.MaxNumberOfOptions, createPollParameters.MaxNumberOfOptions.ToString() },
                { Parameters.MinRangeValue, createPollParameters.MinRangeValue.ToString() },
                { Parameters.MaxRangeValue, createPollParameters.MaxRangeValue.ToString() }
            };

            for (var i = 0; i < createPollParameters.Options.Count; i++)
            {
                queryParameters.Add(Parameters.Option + i.ToString().PadLeft(2, '0'), createPollParameters.Options[i]);
            }
            queryParameters.AddIfHasValue(Parameters.MinBalance, createPollParameters.MinBalance);
            queryParameters.AddIfHasValue(Parameters.MinBalanceModel, createPollParameters.MinBalanceModel);
            queryParameters.AddIfHasValue(Parameters.Holding, createPollParameters.HoldingId);
            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("createPoll", queryParameters));
        }
Exemplo n.º 3
0
        public async Task <TransactionCreatedReply> CreatePoll(string name, string description, int finishHeight,
                                                               VotingModel votingModel, int minNumberOfOptions, int maxNumberOfOptions, int minRangeValue,
                                                               int maxRangeValue, List <string> options, CreateTransactionParameters parameters, long?minBalance = null,
                                                               MinBalanceModel?minBalanceModel = null, ulong?holdingId = null)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.Name, name },
                { Parameters.Description, description },
                { Parameters.FinishHeight, finishHeight.ToString() },
                { Parameters.VotingModel, ((int)votingModel).ToString() },
                { Parameters.MinNumberOfOptions, minNumberOfOptions.ToString() },
                { Parameters.MaxNumberOfOptions, maxNumberOfOptions.ToString() },
                { Parameters.MinRangeValue, minRangeValue.ToString() },
                { Parameters.MaxRangeValue, maxRangeValue.ToString() }
            };

            for (var i = 0; i < options.Count; i++)
            {
                queryParameters.Add(Parameters.Option + i.ToString().PadLeft(2, '0'), options[i]);
            }
            queryParameters.AddIfHasValue(Parameters.MinBalance, minBalance);
            queryParameters.AddIfHasValue(Parameters.MinBalanceModel, minBalanceModel);
            queryParameters.AddIfHasValue(Parameters.Holding, holdingId);
            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("createPoll", queryParameters));
        }
Exemplo n.º 4
0
        public async Task <TransactionCreatedReply> DeleteAlias(AliasLocator query,
                                                                CreateTransactionParameters parameters)
        {
            var queryParameters = query.QueryParameters;

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("deleteAlias", queryParameters));
        }
Exemplo n.º 5
0
        public async Task <TransactionCreatedReply> BuyAlias(AliasLocator query, Amount amount,
                                                             CreateTransactionParameters parameters)
        {
            var queryParameters = query.QueryParameters;

            parameters.AppendToQueryParameters(queryParameters);
            queryParameters.Add(Parameters.AmountNqt, amount.Nqt.ToString());
            return(await Post <TransactionCreatedReply>("buyAlias", queryParameters));
        }
Exemplo n.º 6
0
        public async Task <TransactionCreatedReply> PublishExchangeOffer(
            PublishExchangeOfferParameters exchangeOfferParameters, CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>();

            parameters.AppendToQueryParameters(queryParameters);
            exchangeOfferParameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("publishExchangeOffer", queryParameters));
        }
Exemplo n.º 7
0
        public async Task <TransactionCreatedReply> Delisting(ulong goodsId, CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string> {
                { Parameters.Goods, goodsId.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("dgsDelisting", queryParameters));
        }
Exemplo n.º 8
0
        public async Task <TransactionCreatedReply> SendMessage(CreateTransactionParameters parameters,
                                                                Account recipient = null)
        {
            var queryParameters = new Dictionary <string, string>();

            queryParameters.AddIfHasValue(Parameters.Recipient, recipient);
            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("sendMessage", queryParameters));
        }
Exemplo n.º 9
0
        public async Task <TransactionCreatedReply> IssueCurrency(IssueCurrencyParameters issueCurrencyParameters,
                                                                  CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>();

            parameters.AppendToQueryParameters(queryParameters);
            issueCurrencyParameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("issueCurrency", queryParameters));
        }
Exemplo n.º 10
0
        public async Task <TransactionCreatedReply> Feedback(ulong purchaseId, CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string> {
                { Parameters.Purchase, purchaseId.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("dgsFeedback", queryParameters));
        }
Exemplo n.º 11
0
        public async Task <TransactionCreatedReply> CancelBidOrder(ulong orderId, CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string> {
                { Parameters.Order, orderId.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("cancelBidOrder", queryParameters));
        }
Exemplo n.º 12
0
        public async Task <TransactionCreatedReply> ShufflingRegister(BinaryHexString shufflingFullHash, CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.ShufflingFullHash, shufflingFullHash.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("shufflingRegister", queryParameters));
        }
Exemplo n.º 13
0
        public async Task <TransactionCreatedReply> DeleteCurrency(ulong currencyId,
                                                                   CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string> {
                { Parameters.Currency, currencyId.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("deleteCurrency", queryParameters));
        }
Exemplo n.º 14
0
        public async Task <TransactionCreatedReply> SetAccountInfo(CreateTransactionParameters parameters, string name,
                                                                   string description)
        {
            var queryParameters = new Dictionary <string, string>();

            parameters.AppendToQueryParameters(queryParameters);
            queryParameters.Add(Parameters.Name, name);
            queryParameters.Add(Parameters.Description, description);
            return(await Post <TransactionCreatedReply>("setAccountInfo", queryParameters));
        }
Exemplo n.º 15
0
        public async Task <TransactionCreatedReply> SendMoney(CreateTransactionParameters parameters, Account recipient,
                                                              Amount amount)
        {
            var queryParameters = new Dictionary <string, string>();

            parameters.AppendToQueryParameters(queryParameters);
            queryParameters.Add(Parameters.Recipient, recipient.AccountId.ToString());
            queryParameters.Add(Parameters.AmountNqt, amount.Nqt.ToString());
            return(await Post <TransactionCreatedReply>("sendMoney", queryParameters));
        }
Exemplo n.º 16
0
        public async Task <TransactionCreatedReply> SellAlias(AliasLocator query, Amount price,
                                                              CreateTransactionParameters parameters, Account recipient = null)
        {
            var queryParameters = query.QueryParameters;

            parameters.AppendToQueryParameters(queryParameters);
            queryParameters.Add(Parameters.PriceNqt, price.Nqt.ToString());
            queryParameters.AddIfHasValue(Parameters.Recipient, recipient);
            return(await Post <TransactionCreatedReply>("sellAlias", queryParameters));
        }
Exemplo n.º 17
0
        public async Task <TransactionCreatedReply> UploadTaggedData(string name, string data,
                                                                     CreateTransactionParameters parameters, string file = null, string description = null, string tags = null,
                                                                     string channel = null, string type = null, bool?isText = null, string filename = null)
        {
            var queryParameters = GetQueryParametersForTaggedData(name, data, file, description, tags, channel, type,
                                                                  isText, filename);

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("uploadTaggedData", queryParameters));
        }
Exemplo n.º 18
0
        public async Task <TransactionCreatedReply> SetAccountProperty(CreateTransactionParameters parameters, string property, string value = null, Account recipient = null)
        {
            var queryParameters = new Dictionary <string, string> {
                { Parameters.Property, property }
            };

            parameters.AppendToQueryParameters(queryParameters);
            queryParameters.AddIfHasValue(Parameters.Recipient, recipient);
            queryParameters.AddIfHasValue(Parameters.Value, value);
            return(await Post <TransactionCreatedReply>("setAccountProperty", queryParameters));
        }
Exemplo n.º 19
0
        public async Task <TransactionCreatedReply> ShufflingVerify(ulong shuffling, BinaryHexString shufflingStateHash, CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.Shuffling, shuffling.ToString() },
                { Parameters.ShufflingStateHash, shufflingStateHash.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("shufflingVerify", queryParameters));
        }
Exemplo n.º 20
0
        public async Task <TransactionCreatedReply> LeaseBalance(int period, Account recipient,
                                                                 CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.Period, period.ToString() },
                { Parameters.Recipient, recipient.AccountId.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("leaseBalance", queryParameters));
        }
Exemplo n.º 21
0
        public async Task <TransactionCreatedReply> Refund(ulong purchaseId, Amount refund,
                                                           CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.Purchase, purchaseId.ToString() },
                { Parameters.RefundNqt, refund.Nqt.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("dgsRefund", queryParameters));
        }
Exemplo n.º 22
0
        public async Task <TransactionCreatedReply> QuantityChange(ulong goodsId, int deltaQuantity,
                                                                   CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.Goods, goodsId.ToString() },
                { Parameters.DeltaQuantity, deltaQuantity.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("dgsQuantityChange", queryParameters));
        }
Exemplo n.º 23
0
        public async Task <TransactionCreatedReply> PriceChange(ulong goodsId, Amount price,
                                                                CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.Goods, goodsId.ToString() },
                { Parameters.PriceNqt, price.Nqt.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("dgsPriceChange", queryParameters));
        }
Exemplo n.º 24
0
        public async Task <TransactionCreatedReply> CurrencyReserveClaim(ulong currencyId, long units,
                                                                         CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.Currency, currencyId.ToString() },
                { Parameters.Units, units.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("currencyReserveClaim", queryParameters));
        }
Exemplo n.º 25
0
        public async Task <TransactionCreatedReply> CurrencyReserveIncrease(ulong currencyId, Amount amountPerUnitNqt,
                                                                            CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.Currency, currencyId.ToString() },
                { Parameters.AmountPerUnitNqt, amountPerUnitNqt.Nqt.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("currencyReserveIncrease", queryParameters));
        }
Exemplo n.º 26
0
        public async Task <TransactionCreatedReply> DeleteAssetShares(ulong assetId, long quantityQnt,
                                                                      CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.Asset, assetId.ToString() },
                { Parameters.QuantityQnt, quantityQnt.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("deleteAssetShares", queryParameters));
        }
Exemplo n.º 27
0
        public async Task <TransactionCreatedReply> SetAlias(string aliasName, string aliasUri,
                                                             CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.AliasName, aliasName },
                { Parameters.AliasUri, aliasUri }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("setAlias", queryParameters));
        }
Exemplo n.º 28
0
        public async Task <TransactionCreatedReply> PlaceBidOrder(ulong assetId, long quantityQnt, Amount price,
                                                                  CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.Asset, assetId.ToString() },
                { Parameters.QuantityQnt, quantityQnt.ToString() },
                { Parameters.PriceNqt, price.Nqt.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("placeBidOrder", queryParameters));
        }
Exemplo n.º 29
0
        public async Task <TransactionCreatedReply> DividendPayment(ulong assetId, int height, Amount amountPerQnt,
                                                                    CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.Asset, assetId.ToString() },
                { Parameters.Height, height.ToString() },
                { Parameters.AmountNqtPerQnt, amountPerQnt.Nqt.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("dividendPayment", queryParameters));
        }
Exemplo n.º 30
0
        public async Task <TransactionCreatedReply> TransferAsset(Account recipient, ulong assetId, long quantityQnt,
                                                                  CreateTransactionParameters parameters)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { Parameters.Asset, assetId.ToString() },
                { Parameters.QuantityQnt, quantityQnt.ToString() },
                { Parameters.Recipient, recipient.AccountId.ToString() }
            };

            parameters.AppendToQueryParameters(queryParameters);
            return(await Post <TransactionCreatedReply>("transferAsset", queryParameters));
        }