Skip to content

Commit

Permalink
fix: station wallet connect bug when connecting multiple chains
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronCQL committed Mar 8, 2024
1 parent 3cb5ad3 commit 40038fb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Changelog

## `v0.0.58`

### Fixes

- Fix Station mobile wallet connect issue when connecting more than 1 chain

## `v0.0.57`

### Fixes

- Allow Terra testnet to work correctly with Station extenion
- Allow Terra testnet to work correctly with Station extension

## `v0.0.56`

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.57",
"version": "0.0.58",
"private": false,
"packageManager": "[email protected]",
"sideEffects": false,
Expand Down
8 changes: 5 additions & 3 deletions src/wallet/wallets/station/StationController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,20 @@ export class StationController extends WalletController {
chains: ChainInfo<T>[]
) {
for (const { chainId } of chains) {
// Station's WallectConnect only supports these chains
// TODO: update when Station supports more chains
// Station mobile's WallectConnect only supports these chains
// TODO: update when Station mobile supports more chains
if (TERRA_CHAINS.includes(chainId)) {
continue;
}
throw new Error(`${chainId} not supported`);
}
const wallets = new Map<T, ConnectedWallet>();
const wc = await this.wc.connect();
// Station mobile only returns 1 address for now
// TODO: update when Station mobile supports more chains
const address = wc.accounts[0];
for (let i = 0; i < chains.length; i++) {
const { chainId, rpc, gasPrice } = chains[i];
const address = wc.accounts[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);
Expand Down

0 comments on commit 40038fb

Please sign in to comment.