Skip to content

Commit

Permalink
fix: prevent illegal constructor error
Browse files Browse the repository at this point in the history
  • Loading branch information
alter-eggo committed Aug 19, 2024
1 parent 3b6a5d8 commit a774b66
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/store/software-keys/software-key.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,18 @@ function setWalletEncryptionPassword(args: {
await checkForLegacyGaiaConfigWithKnownGeneratedAccountIndex(secretKey);

async function doesStacksAddressHaveBalance(address: string) {
const resp = await stxClient.getAccountBalance(address, new AbortSignal());
const controller = new AbortController();
const resp = await stxClient.getAccountBalance(address, controller.signal);
return Number(resp.stx.balance) > 0;
}

async function doesStacksAddressHaveBnsName(address: string) {
const controller = new AbortController();
const resp = await fetchNamesForAddress({
client: stxClient,
address,
isTestnet: false,
signal: new AbortSignal(),
signal: controller.signal,
});
queryClient.setQueryData([StacksQueryPrefixes.GetBnsNamesByAddress, address], resp);
return resp.names.length > 0;
Expand Down

0 comments on commit a774b66

Please sign in to comment.