Skip to content

Commit d7eafe8

Browse files
committed
wip
1 parent d48e0c3 commit d7eafe8

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

apps/api/src/api/wallet/api.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ const Account = {
2121
id: encodeURIComponent(id),
2222
});
2323

24+
if (accountResponse.status === 404) {
25+
return null;
26+
}
27+
2428
if (!accountResponse.ok) {
2529
throw new Error("Failed to fetch account");
2630
}
@@ -51,6 +55,16 @@ export const getWalletAccount = createApiHandler({
5155
...WellKnownWallets.workspace(workspace),
5256
);
5357
const data = await Account.fetch(wallet, workspaceWalletId);
58+
59+
if (!data) {
60+
return {
61+
balance: MicroDollar.ZERO.display(),
62+
balanceExact: MicroDollar.ZERO.display({
63+
showAllDecimals: true,
64+
}),
65+
};
66+
}
67+
5468
return Account.format(data);
5569
},
5670
});

packages/sdk/src/wallets/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ export interface WalletAPI {
273273
}
274274

275275
// for local dev
276-
// const WALLET_API_URL = "http://localhost:8001";
277-
const WALLET_API_URL = "https://wallet.webdraw.com";
276+
const WALLET_API_URL = "http://localhost:8001";
277+
// const WALLET_API_URL = "https://wallet.webdraw.com";
278278

279279
export function createWalletClient(
280280
apiKey: string,

0 commit comments

Comments
 (0)