aboutsummaryrefslogtreecommitdiffstats
path: root/packages/connect
diff options
context:
space:
mode:
Diffstat (limited to 'packages/connect')
-rw-r--r--packages/connect/src/http_client.ts8
-rw-r--r--packages/connect/test/http_client_test.ts6
2 files changed, 7 insertions, 7 deletions
diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts
index 815d42e67..9e5f0f448 100644
--- a/packages/connect/src/http_client.ts
+++ b/packages/connect/src/http_client.ts
@@ -23,7 +23,7 @@ import { relayerResponseJsonParsers } from './utils/relayer_response_json_parser
const TRAILING_SLASHES_REGEX = /\/+$/;
const DEFAULT_PAGED_REQUEST_OPTS: PagedRequestOpts = {
- page: 0,
+ page: 1,
perPage: 100,
};
/**
@@ -66,7 +66,7 @@ export class HttpClient implements Client {
}
/**
* Retrieve token pair info from the API
- * @param requestOpts Options specifying token information to retrieve and page information, defaults to { page: 0, perPage: 100 }
+ * @param requestOpts Options specifying token information to retrieve and page information, defaults to { page: 1, perPage: 100 }
* @return The resulting TokenPairsItems that match the request
*/
public async getTokenPairsAsync(requestOpts?: TokenPairsRequestOpts & PagedRequestOpts): Promise<TokenPairsItem[]> {
@@ -83,7 +83,7 @@ export class HttpClient implements Client {
}
/**
* Retrieve orders from the API
- * @param requestOpts Options specifying orders to retrieve and page information, defaults to { page: 0, perPage: 100 }
+ * @param requestOpts Options specifying orders to retrieve and page information, defaults to { page: 1, perPage: 100 }
* @return The resulting SignedOrders that match the request
*/
public async getOrdersAsync(requestOpts?: OrdersRequestOpts & PagedRequestOpts): Promise<SignedOrder[]> {
@@ -112,7 +112,7 @@ export class HttpClient implements Client {
/**
* Retrieve an orderbook from the API
* @param request An OrderbookRequest instance describing the specific orderbook to retrieve
- * @param requestOpts Options specifying page information, defaults to { page: 0, perPage: 100 }
+ * @param requestOpts Options specifying page information, defaults to { page: 1, perPage: 100 }
* @return The resulting OrderbookResponse that matches the request
*/
public async getOrderbookAsync(
diff --git a/packages/connect/test/http_client_test.ts b/packages/connect/test/http_client_test.ts
index 93b252ace..311dc96e6 100644
--- a/packages/connect/test/http_client_test.ts
+++ b/packages/connect/test/http_client_test.ts
@@ -41,7 +41,7 @@ describe('HttpClient', () => {
describe('#getTokenPairsAsync', () => {
const url = `${relayUrl}/token_pairs`;
it('gets token pairs with default options when none are provided', async () => {
- const urlWithQuery = `${url}?page=0&per_page=100`;
+ const urlWithQuery = `${url}?page=1&per_page=100`;
fetchMock.get(urlWithQuery, tokenPairsResponseJSON);
const tokenPairs = await relayerClient.getTokenPairsAsync();
expect(tokenPairs).to.be.deep.equal(tokenPairsResponse);
@@ -66,7 +66,7 @@ describe('HttpClient', () => {
describe('#getOrdersAsync', () => {
const url = `${relayUrl}/orders`;
it('gets orders with default options when none are provided', async () => {
- const urlWithQuery = `${url}?page=0&per_page=100`;
+ const urlWithQuery = `${url}?page=1&per_page=100`;
fetchMock.get(urlWithQuery, ordersResponseJSON);
const orders = await relayerClient.getOrdersAsync();
expect(orders).to.be.deep.equal(ordersResponse);
@@ -110,7 +110,7 @@ describe('HttpClient', () => {
it('gets orderbook with default page options when none are provided', async () => {
const urlWithQuery = `${url}?baseTokenAddress=${
request.baseTokenAddress
- }&page=0&per_page=100&quoteTokenAddress=${request.quoteTokenAddress}`;
+ }&page=1&per_page=100&quoteTokenAddress=${request.quoteTokenAddress}`;
fetchMock.get(urlWithQuery, orderbookJSON);
const orderbook = await relayerClient.getOrderbookAsync(request);
expect(orderbook).to.be.deep.equal(orderbookResponse);