Example #1
0
        private Dictionary <string, object> CreatePoloniexBody(PoloniexBodyType bodyType)
        {
            var body = new Dictionary <string, object> {
                { "nonce", BaseAuthenticator.GetLongNonce() }
            };

            switch (bodyType)
            {
            case PoloniexBodyType.ReturnBalances:
                body.Add("command", "returnBalances");
                break;

            case PoloniexBodyType.ReturnCompleteBalances:
                body.Add("command", "returnCompleteBalances");
                break;

            case PoloniexBodyType.ReturnDepositAddresses:
                body.Add("command", "returnDepositAddresses");
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(bodyType), bodyType, null);
            }

            return(body);
        }
Example #2
0
        private Dictionary <string, object> CreateKrakenBody()
        {
            var body  = new Dictionary <string, object>();
            var nonce = BaseAuthenticator.GetLongNonce();

            body.Add("nonce", nonce);

            return(body);
        }
Example #3
0
        private Dictionary <string, object> CreatePoloniexBody(PoloniexBodyType bodyType)
        {
            var body = new Dictionary <string, object> {
                { "nonce", BaseAuthenticator.GetLongNonce() }
            };

            switch (bodyType)
            {
            case PoloniexBodyType.ReturnBalances:
                body.Add("command", "returnBalances");
                break;

            case PoloniexBodyType.ReturnCompleteBalances:
                body.Add("command", "returnCompleteBalances");
                break;

            case PoloniexBodyType.ReturnDepositAddresses:
                body.Add("command", "returnDepositAddresses");
                break;

            case PoloniexBodyType.LimitOrderBuy:
                body.Add("command", "buy");
                break;

            case PoloniexBodyType.LimitOrderSell:
                body.Add("command", "sell");
                break;

            case PoloniexBodyType.ReturnOrderStatus:
                body.Add("command", "returnOrderTrades");
                break;

            case PoloniexBodyType.ReturnOpenOrders:
                body.Add("command", "returnOpenOrders");
                break;

            case PoloniexBodyType.ReturnTradeHistory:
                body.Add("command", "returnTradeHistory");
                break;

            case PoloniexBodyType.CancelOrder:
                body.Add("command", "cancelOrder");
                break;

            case PoloniexBodyType.Withdraw:
                body.Add("command", "withdraw");
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(bodyType), bodyType, null);
            }

            return(body);
        }