Exemplo n.º 1
0
        private static void WithdrawCurrency()
        {
            var walletClient = new WalletClient(Config.AccessKey, Config.SecretKey);

            _logger.Start();
            var request = new WithdrawRequest
            {
                address = ""
            };
            var result = walletClient.WithdrawCurrencyAsync(request).Result;

            _logger.StopAndLog();

            if (result != null)
            {
                switch (result.status)
                {
                case "ok":
                {
                    AppLogger.Info($"Withdraw successfully, transfer id: {result.data}");
                    break;
                }

                case "error":
                {
                    AppLogger.Info($"Withdraw fail, error code: {result.errorCode}, error message: {result.errorMessage}");
                    break;
                }
                }
            }
        }
Exemplo n.º 2
0
        public void WithdrawCurrencyTest(string address, string amount, string currency, string fee)
        {
            WithdrawRequest request = new WithdrawRequest()
            {
                address  = address,
                amount   = amount,
                currency = currency,
                fee      = fee
            };

            WithdrawCurrencyResponse result = client.WithdrawCurrencyAsync(request).Result;
            string strret = JsonConvert.SerializeObject(result, Formatting.Indented);

            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);
        }