From 19bd5ba40eb185ad7ebaed9b6cea216fd324fafc Mon Sep 17 00:00:00 2001 From: Aaron Choo Date: Thu, 24 Aug 2023 15:11:44 +0800 Subject: [PATCH] fix: cosmostation walletconnect api changes --- src/wallet/wallets/cosmostation/CosmostationController.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wallet/wallets/cosmostation/CosmostationController.ts b/src/wallet/wallets/cosmostation/CosmostationController.ts index 13f93bf1..f214306d 100644 --- a/src/wallet/wallets/cosmostation/CosmostationController.ts +++ b/src/wallet/wallets/cosmostation/CosmostationController.ts @@ -1,5 +1,5 @@ import { Secp256k1PubKey } from "cosmes/client"; -import { fromHexToUint8Array } from "cosmes/codec"; +import { fromBase64ToUint8Array } from "cosmes/codec"; import { WalletName } from "../../constants/WalletName"; import { WalletType } from "../../constants/WalletType"; @@ -36,9 +36,9 @@ export class CosmostationController extends WalletController { await this.wc.connect(chains.map(({ chainId }) => chainId)); for (let i = 0; i < chains.length; i++) { const { chainId, rpc, gasPrice } = chains[i]; - const { pubkey, algo } = await this.wc.getAccount(chainId); + const { pubkey, address } = await this.wc.getAccount(chainId); const key = new Secp256k1PubKey({ - key: fromHexToUint8Array(pubkey), + key: fromBase64ToUint8Array(pubkey), }); wallets.set( chainId, @@ -46,7 +46,7 @@ export class CosmostationController extends WalletController { this.wc, chainId, key, - algo, // ! cosmostatation mixed up the `algo` and `address` keys... + address, rpc, gasPrice )