Skip to content

Commit

Permalink
Fix NBO default pool project in the API (#2225)
Browse files Browse the repository at this point in the history
* Update NBO pool project

* Update api version

* Log fetch errors
  • Loading branch information
biwano authored Feb 1, 2024
1 parent 4f08b67 commit 7d6a669
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion carbonmark-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@klimadao/carbonmark-api",
"version": "6.0.0",
"version": "6.0.1",
"description": "An API for exploring Carbonmark project data, prices and activity.",
"main": "app.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion carbonmark-api/src/routes/projects/get.constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const DEFAULT_POOL_PROJECT_TOKENS = {
nbo: "0xb6ea7a53fc048d6d3b80b968d696e39482b7e578",
nbo: "0xd28dfeba8fb9e44b715156162c8b6076d7a95ad1",
ubo: "0xd6ed6fae5b6535cae8d92f40f5ff653db807a4ea",
bct: "0xb139c4cc9d20a3618e9a2268d73eff18c496b991",
nct: "0x6362364a37f34d39a1f4993fb595dab4116daf0d",
Expand Down
23 changes: 15 additions & 8 deletions carbonmark/lib/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,21 @@ export const fetchClient = async <
): Promise<ResponseConfig<TData>> => {
const params = request.params as ParamsObject;
const url = `${urls.api.base}${request.url}${serializeParams(params)}`;
const response = await fetch(url, {
method: request.method,
body: JSON.stringify(request.data),
headers: {
"Content-Type": "application/json",
...request.headers,
},
});
let response;
try {
response = await fetch(url, {
method: request.method,
body: JSON.stringify(request.data),
headers: {
"Content-Type": "application/json",
...request.headers,
},
});
} catch (e) {
console.error(`Fetch error: ${url}`);
throw e;
}

if (!response.ok) {
const errorData = await response.json();
throw {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7d6a669

Please sign in to comment.