Skip to content

Commit

Permalink
fix: supress querying pub key errs for station mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronCQL committed Mar 8, 2024
1 parent 40038fb commit 5933f63
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## `v0.0.59`

### Fixes

- Fix Station mobile wallet to not throw errors if pub keys do not exist

## `v0.0.58`

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cosmes",
"version": "0.0.58",
"version": "0.0.59",
"private": false,
"packageManager": "[email protected]",
"sideEffects": false,
Expand Down
20 changes: 13 additions & 7 deletions src/wallet/wallets/station/StationController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,19 @@ export class StationController extends WalletController {
const address = wc.accounts[0];
for (let i = 0; i < chains.length; i++) {
const { chainId, rpc, gasPrice } = chains[i];
// Since Station's WalletConnect doesn't support getting pub keys,
// we need to query the account to get it.
const key = await this.getPubKey(chainId, rpc, address);
wallets.set(
chainId,
new StationWalletConnectV1(wc, chainId, key, address, rpc, gasPrice)
);
try {
// Since Station's WalletConnect doesn't support getting pub keys, we
// need to query the account to get it. However, if the wallet does
// not contain funds, the RPC will throw errors.
const key = await this.getPubKey(chainId, rpc, address);
wallets.set(
chainId,
new StationWalletConnectV1(wc, chainId, key, address, rpc, gasPrice)
);
} catch (err) {
// We simply log and ignore the error for now
console.warn(err);
}
}
this.wc.cacheSession(wc);
return { wallets, wc: this.wc };
Expand Down

0 comments on commit 5933f63

Please sign in to comment.