Skip to content

Commit

Permalink
feat: update migrate wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
harisato committed Apr 5, 2024
1 parent 76ca254 commit 15f7bfe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/modules/user/user.graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ export class UserGraphql {
variables
);

if (!result.data[network].account) return {} as ICustodialWalletAsset;
// if (result.data[network].account.length === 0) return {
// balance: undefined,
// cw721Tokens: []
// } as ICustodialWalletAsset;

const nativeDenom = this.configSvc.get<string>('network.denom');
const balance = result.data[network].account[0].balances.filter((balance) => balance.denom === nativeDenom)[0] as IAccountBalance;
const balance = result.data[network].account.length === 0 ? undefined : result.data[network].account[0].balances.filter((balance) => balance.denom === nativeDenom)[0] as IAccountBalance;
const cw721Tokens: ICw721Token[] = result.data[network].cw721_token.map((token) => {
return {
tokenId: token.token_id,
Expand Down

0 comments on commit 15f7bfe

Please sign in to comment.