Skip to content

Commit 7cac4c4

Browse files
committed
Fix: type errors
1 parent b7e07ad commit 7cac4c4

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

packages/core/src/hooks/useOrderHistory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export const useOrderHistory = (
4444
queryFn: async ({ pageParam = null }) => {
4545
return await appsyncOrderbookService.query.getOrderHistory({
4646
address,
47-
from: dateFrom?.toISOString(),
48-
to: dateTo?.toISOString(),
47+
from: dateFrom.getTime().toString(),
48+
to: dateTo.getTime().toString(),
4949
limit: 25,
5050
pageParams: pageParam,
5151
batchLimit: rowsPerPage,

packages/core/src/hooks/useTradeHistory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ export function useTradeHistory(
4343
queryFn: async ({ pageParam = null }) => {
4444
return await appsyncOrderbookService.query.getTradeHistory({
4545
address,
46-
from: dateFrom,
47-
to: dateTo,
46+
from: dateFrom?.toISOString(),
47+
to: dateTo?.toISOString(),
4848
pageParams: pageParam,
4949
limit: TRADE_HISTORY_PER_PAGE_LIMIT,
5050
batchLimit: rowsPerPage,

packages/core/src/hooks/useTransactions.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ export function useTransactions() {
3232
queryKey: QUERY_KEYS.transactions(mainAddress, DEPOSIT),
3333
queryFn: async () => {
3434
const fromDate = subtractMonthsFromDateOrNow(3);
35+
const toDate = new Date();
3536
return await appsyncOrderbookService.query.getTransactions({
3637
address: mainAddress,
3738
limit: 100000,
38-
from: fromDate,
39-
to: new Date(),
39+
from: fromDate.getTime().toString(),
40+
to: toDate.getTime().toString(),
4041
pageParams: null,
4142
transaction_type: DEPOSIT,
4243
});
@@ -50,11 +51,12 @@ export function useTransactions() {
5051
queryKey: QUERY_KEYS.transactions(mainAddress, WITHDRAW),
5152
queryFn: async () => {
5253
const fromDate = subtractMonthsFromDateOrNow(3);
54+
const toDate = new Date();
5355
return await appsyncOrderbookService.query.getTransactions({
5456
address: mainAddress,
5557
limit: 100000,
56-
from: fromDate,
57-
to: new Date(),
58+
from: fromDate.getTime().toString(),
59+
to: toDate.getTime().toString(),
5860
pageParams: null,
5961
transaction_type: WITHDRAW,
6062
});

0 commit comments

Comments
 (0)