From 079a76df29c0c6f5c45bab5a2b89cb1de178167b Mon Sep 17 00:00:00 2001 From: luizakp Date: Mon, 11 Mar 2024 14:23:39 -0300 Subject: [PATCH] chore: use fetcher --- src/lib/cowApi/fetchCowOrder.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lib/cowApi/fetchCowOrder.ts b/src/lib/cowApi/fetchCowOrder.ts index bfb5937..88a00d9 100644 --- a/src/lib/cowApi/fetchCowOrder.ts +++ b/src/lib/cowApi/fetchCowOrder.ts @@ -1,17 +1,14 @@ import { Address } from "viem"; import { ChainId } from "../publicClients"; import { COW_API_URL_BY_CHAIN_ID } from "./api"; +import { fetcher } from "#/utils/fetcher"; export async function getCowOrders( userAddress: Address, chainId: ChainId, ) { - const url = COW_API_URL_BY_CHAIN_ID[chainId]; - - return fetch(`${url}/api/v1/account/${userAddress}/orders`, { - headers: { - Accept: "application/json", - }, - }).then((response) => response.json()); + const baseUrl = COW_API_URL_BY_CHAIN_ID[chainId]; + const url = `${baseUrl}/api/v1/account/${userAddress}/orders`; + return await fetcher(url) } \ No newline at end of file