Skip to content

Commit

Permalink
fix: no near balance in account error
Browse files Browse the repository at this point in the history
  • Loading branch information
naturexie committed Dec 2, 2024
1 parent a50e87b commit 56956cd
Show file tree
Hide file tree
Showing 2 changed files with 14,269 additions and 8,110 deletions.
5 changes: 4 additions & 1 deletion api/get-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ const getAccount = async () => {
const assets = await getAssetsDetailed();
const tokenIds = assets.map((asset) => asset.token_id);
const shadowRecords = await getShadowRecords();
const accountBalance = (await account.getAccountBalance()).available;
let accountBalance = "0";
try {
accountBalance = (await account.getAccountBalance()).available;
} catch (error) {}
const balances = await Promise.all(
tokenIds.map((id) => getBalance(id, accountId, shadowRecords)),
);
Expand Down
Loading

0 comments on commit 56956cd

Please sign in to comment.