Skip to content

Commit

Permalink
fix: support async base asset id
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurgeron committed Jan 16, 2025
1 parent 779ac99 commit ad3aebb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/NewPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function NewPlayer({
const getBalance = useCallback(async () => {
const thisWallet = wallet ?? contract?.account;
console.log(wallet, "wallet");
const baseAssetId = thisWallet?.provider.getBaseAssetId();
const baseAssetId = await thisWallet?.provider.getBaseAssetId();
const balance = await thisWallet!.getBalance(baseAssetId);
const balanceNum = balance?.toNumber();

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/useWalletFunds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function useWalletFunds(contract: FarmContract | null) {

async function getBalance() {
const thisWallet = wallet ?? contract?.account;
const baseAssetId = thisWallet?.provider.getBaseAssetId();
const baseAssetId = await thisWallet?.provider.getBaseAssetId();
const balance = await thisWallet!.getBalance(baseAssetId);
const balanceNum = balance?.toNumber();

Expand Down

0 comments on commit ad3aebb

Please sign in to comment.