Skip to content

Commit ad98ea9

Browse files
1. add metamask icon
2. add setSignOptions for keplr wallet
1 parent 2bebc0a commit ad98ea9

File tree

4 files changed

+572
-1986
lines changed

4 files changed

+572
-1986
lines changed
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
11

2-
import { ExtensionWallet } from '@interchain-kit/core'
3-
4-
export class KeplrWallet extends ExtensionWallet {
5-
// async init() {
6-
// this.client = await Keplr.getKeplr()
7-
// return this.client
8-
// }
9-
}

wallets/keplr-extension/src/index.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CosmosWallet, EthereumWallet, ExtensionWallet, PlatformWallet, WCMobileWebWallet } from "@interchain-kit/core";
1+
import { CosmosWallet, EthereumWallet, ExtensionWallet, PlatformWallet, SignOptions, WCMobileWebWallet } from "@interchain-kit/core";
22
import { keplrExtensionInfo } from "./registry";
33

44
export * from './registry'
@@ -7,7 +7,18 @@ const web = new ExtensionWallet(keplrExtensionInfo)
77
web.setNetworkWallet('cosmos', new CosmosWallet(keplrExtensionInfo))
88
web.setNetworkWallet('eip155', new EthereumWallet(keplrExtensionInfo))
99

10-
const keplrWallet = new PlatformWallet(keplrExtensionInfo)
10+
class KeplrPlatformWallet extends PlatformWallet {
11+
setSignOptions(options: SignOptions) {
12+
const keplrWalletInWeb = keplrWallet.platformWalletMap.get("web") as ExtensionWallet;
13+
14+
const keplrCosmosWalletInWeb = keplrWalletInWeb.getWalletByChainType("cosmos") as CosmosWallet;
15+
16+
keplrCosmosWalletInWeb.setSignOptions(options);
17+
}
18+
}
19+
20+
const keplrWallet = new KeplrPlatformWallet(keplrExtensionInfo)
21+
1122
keplrWallet.setPlatformWallet('web', web)
1223
keplrWallet.setPlatformWallet('mobile-web', new WCMobileWebWallet(keplrExtensionInfo))
1324

wallets/metamask-extension/src/constant.ts

Lines changed: 2 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)