Ejemplo n.º 1
0
        public async Task <ActionResult <BookDto> > OrderBook([FromBody] OrderBookCommand command)
        {
            await _mediator.Send(command);

            return(NoContent());
        }
Ejemplo n.º 2
0
        private CommandFactory()
        {
            Build();

            var param = new List <ExchangeParameter>
            {
                new ExchangeParameter(ParameterMethod.Url, "base", StandardParameter.Base),
                new ExchangeParameter(ParameterMethod.Url, "counter", StandardParameter.Counter)
            };

            Tick = new TickCommand(
                Method.GET,
                new Uri("products/{base}-{counter}/ticker", UriKind.Relative),
                false,
                typeof(TickModel),
                param);

            param = new List <ExchangeParameter>
            {
                new ExchangeParameter(ParameterMethod.Url, "base", StandardParameter.Base),
                new ExchangeParameter(ParameterMethod.Url, "counter", StandardParameter.Counter)
            };


            param = new List <ExchangeParameter>
            {
                new ExchangeParameter(ParameterMethod.Url, "base", StandardParameter.Base),
                new ExchangeParameter(ParameterMethod.Url, "counter", StandardParameter.Counter)
            };

            OrderBook = new OrderBookCommand(
                Method.GET,
                new Uri("products/{base}-{counter}/book?level=2", UriKind.Relative),
                false,
                typeof(OrderBookModel),
                param);

            // /products/<product-id>/trades

            param = new List <ExchangeParameter>
            {
                new ExchangeParameter(ParameterMethod.Url, "base", StandardParameter.Base),
                new ExchangeParameter(ParameterMethod.Url, "counter", StandardParameter.Counter)
            };

            Transactions = new TransactionsCommand(
                Method.GET,
                new Uri("products/{base}-{counter}/trades", UriKind.Relative),
                false,
                typeof(List <TransactionModel>),
                param);

            AccountBalance = new AccountBalanceCommand(
                Method.GET,
                new Uri("accounts", UriKind.Relative),
                true,
                typeof(List <AccountBalanceModel>));

            OpenOrders = new OpenOrdersCommand(
                Method.GET,
                new Uri("orders", UriKind.Relative),
                true,
                typeof(List <OpenOrderModel>));

            UserTransactions = new UserTransactionsCommand(
                Method.GET,
                new Uri("fills", UriKind.Relative),
                true,
                typeof(List <UserTransactionModel>));
        }