Skip to content

Commit

Permalink
chore: use fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
luizakp committed Mar 11, 2024
1 parent f44d96c commit 079a76d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/lib/cowApi/fetchCowOrder.ts
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 079a76d

Please sign in to comment.