Beispiel #1
0
        public async Task <PagedResults <Fill, Int32?> > GetFills(String orderId = null, String productId = null, PagingOptions <Int32?> paging = null)
        {
            var request = new GdaxRequestBuilder("/fills")
                          .AddParameterIfNotNull("order_id", orderId)
                          .AddParameterIfNotNull("product_id", productId)
                          .AddPagingOptions(paging, CursorEncoders.Int32)
                          .Build();

            var response = await this.GetResponse <IList <Fill> >(request).ConfigureAwait(false);

            return(new PagedResults <Fill, Int32?>(response, CursorEncoders.Int32, paging));
        }
Beispiel #2
0
        public async Task <PagedResults <Ledger, Int32?> > GetAccountHistory(Guid accountId, PagingOptions <Int32?> paging = null)
        {
            Check.NotEmpty(accountId, nameof(accountId));

            var request = new GdaxRequestBuilder($"/accounts/{accountId}/ledger")
                          .AddPagingOptions(paging, CursorEncoders.Int32)
                          .Build();

            var response = await this.GetResponse <IList <Ledger> >(request).ConfigureAwait(false);

            return(new PagedResults <Ledger, Int32?>(response, CursorEncoders.Int32, paging));
        }
Beispiel #3
0
 public PagedResults(GdaxResponse <IList <T> > response, ICursorEncoder <TCursor> encoder, PagingOptions <TCursor> paging = null)
 {
     this.response = response;
     this.encoder  = encoder;
     this.paging   = paging;
 }
Beispiel #4
0
        public async Task <PagedResults <Transfer, DateTimeOffset?> > GetTransfers(Guid accountId, PagingOptions <DateTimeOffset?> paging = null)
        {
            Check.NotEmpty(accountId, nameof(accountId));

            var request = new GdaxRequestBuilder($"/accounts/{accountId}/transfers")
                          .AddPagingOptions(paging, CursorEncoders.DateTimeOffset)
                          .Build();

            var response = await this.GetResponse <IList <Transfer> >(request).ConfigureAwait(false);

            return(new PagedResults <Transfer, DateTimeOffset?>(response, CursorEncoders.DateTimeOffset, paging));
        }
        public async Task <PagedResults <Order, DateTime?> > GetOrders(String productId = null, OrderStates?states = null, PagingOptions <DateTime?> paging = null)
        {
            var request = new GdaxRequestBuilder("/orders")
                          .AddEnumParameterIfNotNull("status", states)
                          .AddParameterIfNotNull("product_id", productId)
                          .AddPagingOptions(paging, CursorEncoders.DateTime)
                          .Build();

            var response = await this.GetResponse <IList <Order> >(request).ConfigureAwait(false);

            return(new PagedResults <Order, DateTime?>(response, CursorEncoders.DateTime, paging));
        }