@@ -26,7 +26,7 @@ export const CosmosWalletRegistry: CosmosRegistryWallet[] = [
26
26
import ( "~/integrations/keplr-walletconnect" ) . then (
27
27
( m ) => m . KeplrMobileWallet
28
28
) ,
29
- supportsChain : async ( chainId ) => {
29
+ supportsChain : async ( chainId : string ) => {
30
30
const keplrMobileAvailableChains : MainnetChainIds [ ] = [
31
31
"cosmoshub-4" ,
32
32
"osmosis-1" ,
@@ -54,9 +54,9 @@ export const CosmosWalletRegistry: CosmosRegistryWallet[] = [
54
54
"gitopia" ,
55
55
"likecoin-mainnet-2" ,
56
56
"akashnet-2" ,
57
- ] ;
57
+ ]
58
58
59
- return keplrMobileAvailableChains . includes ( chainId as MainnetChainIds ) ;
59
+ return keplrMobileAvailableChains . includes ( chainId as MainnetChainIds )
60
60
} ,
61
61
stakeUrl : "https://wallet.keplr.app/chains/osmosis?tab=staking" ,
62
62
governanceUrl : "https://wallet.keplr.app/chains/osmosis?tab=governance" ,
@@ -78,7 +78,7 @@ export const CosmosWalletRegistry: CosmosRegistryWallet[] = [
78
78
logo : "/wallets/leap.svg" ,
79
79
lazyInstall : ( ) =>
80
80
import ( "@cosmos-kit/leap-mobile" ) . then ( ( m ) => m . LeapMobileWallet ) ,
81
- supportsChain : async ( chainId ) => {
81
+ supportsChain : async ( chainId : string ) => {
82
82
const leapMobileAvailableChains : MainnetChainIds [ ] = [
83
83
"agoric-3" ,
84
84
"akashnet-2" ,
@@ -146,8 +146,8 @@ export const CosmosWalletRegistry: CosmosRegistryWallet[] = [
146
146
"phoenix-1" ,
147
147
"umee-1" ,
148
148
"dimension_37-1" ,
149
- ] ;
150
- return leapMobileAvailableChains . includes ( chainId as MainnetChainIds ) ;
149
+ ]
150
+ return leapMobileAvailableChains . includes ( chainId as MainnetChainIds )
151
151
} ,
152
152
153
153
stakeUrl : "https://cosmos.leapwallet.io/transact/stake/plain?chain=osmosis" ,
@@ -162,27 +162,27 @@ export const CosmosWalletRegistry: CosmosRegistryWallet[] = [
162
162
( m ) => m . OkxwalletExtensionWallet
163
163
) ,
164
164
windowPropertyName : "okxwallet" ,
165
- async supportsChain ( chainId , retryCount = 0 ) {
166
- if ( typeof window === "undefined" ) return true ;
165
+ async supportsChain ( chainId : string , retryCount = 0 ) {
166
+ if ( typeof window === "undefined" ) return true
167
167
168
168
const okxWallet = ( window as any ) ?. okxwallet ?. keplr as {
169
- getKey : ( chainId : string ) => Promise < boolean > ;
170
- } ;
169
+ getKey : ( chainId : string ) => Promise < boolean >
170
+ }
171
171
172
- if ( ! okxWallet ) return true ;
172
+ if ( ! okxWallet ) return true
173
173
174
174
try {
175
- await okxWallet . getKey ( chainId ) ;
176
- return true ;
175
+ await okxWallet . getKey ( chainId )
176
+ return true
177
177
} catch ( e ) {
178
- const error = e as { code : number ; message : string } ;
178
+ const error = e as { code : number ; message : string }
179
179
180
180
// Check for chain not supported error
181
181
if (
182
182
error . code === - 32603 &&
183
183
error . message . includes ( "There is no chain info" )
184
184
) {
185
- return false ;
185
+ return false
186
186
}
187
187
188
188
// Retry if the wallet is already processing
@@ -199,26 +199,26 @@ export const CosmosWalletRegistry: CosmosRegistryWallet[] = [
199
199
*/
200
200
await new Promise ( ( resolve ) =>
201
201
setTimeout ( resolve , Math . pow ( 2 , retryCount ) * 100 )
202
- ) ;
202
+ )
203
203
// @ts -ignore
204
- return this . supportsChain ( chainId , retryCount + 1 ) ;
204
+ return this . supportsChain ( chainId , retryCount + 1 )
205
205
}
206
206
207
- return false ;
207
+ return false
208
208
}
209
209
} ,
210
210
matchError : ( error ) => {
211
- if ( typeof error !== "string" ) return error ;
211
+ if ( typeof error !== "string" ) return error
212
212
213
213
if (
214
214
error . includes (
215
215
"Already processing wallet_requestIdentities. Please wait."
216
216
)
217
217
) {
218
- return new WalletConnectionInProgressError ( ) ;
218
+ return new WalletConnectionInProgressError ( )
219
219
}
220
220
221
- return error ;
221
+ return error
222
222
} ,
223
223
signOptions : {
224
224
preferNoSetFee : true ,
@@ -262,13 +262,13 @@ export const CosmosWalletRegistry: CosmosRegistryWallet[] = [
262
262
( m ) => m . CdcwalletExtensionWallet
263
263
) ,
264
264
mobileDisabled : false ,
265
- async supportsChain ( chainId ) {
265
+ async supportsChain ( chainId : string ) {
266
266
const cdcAvailableChains : MainnetChainIds [ ] = [
267
267
"cosmoshub-4" ,
268
268
"osmosis-1" ,
269
269
"crypto-org-chain-mainnet-1" ,
270
- ] ;
271
- return cdcAvailableChains . includes ( chainId as MainnetChainIds ) ;
270
+ ]
271
+ return cdcAvailableChains . includes ( chainId as MainnetChainIds )
272
272
} ,
273
273
windowPropertyName : "cdc_wallet" ,
274
274
stakeUrl : "https://crypto.com/staking" ,
@@ -281,19 +281,19 @@ export const CosmosWalletRegistry: CosmosRegistryWallet[] = [
281
281
lazyInstall : ( ) =>
282
282
import ( "@cosmos-kit/xdefi-extension" ) . then ( ( m ) => m . XDEFIExtensionWallet ) ,
283
283
windowPropertyName : "xfi" ,
284
- async supportsChain ( chainId ) {
285
- if ( typeof window === "undefined" ) return true ;
284
+ async supportsChain ( chainId : string ) {
285
+ if ( typeof window === "undefined" ) return true
286
286
287
287
const xfiWallet = ( window as any ) ?. xfi ?. keplr as {
288
- getKey : ( chainId : string ) => Promise < boolean > ;
289
- } ;
288
+ getKey : ( chainId : string ) => Promise < boolean >
289
+ }
290
290
291
- if ( ! xfiWallet ) return true ;
291
+ if ( ! xfiWallet ) return true
292
292
293
293
return xfiWallet
294
294
. getKey ( chainId )
295
295
. then ( ( ) => true )
296
- . catch ( ( ) => false ) ;
296
+ . catch ( ( ) => false )
297
297
} ,
298
298
features : [ ] ,
299
299
} ,
@@ -318,21 +318,34 @@ export const CosmosWalletRegistry: CosmosRegistryWallet[] = [
318
318
( m ) => m . StationExtensionWallet
319
319
) ,
320
320
windowPropertyName : "station" ,
321
- supportsChain : async ( chainId ) => {
322
- if ( typeof window === "undefined" ) return true ;
321
+ supportsChain : async ( chainId : string ) => {
322
+ if ( typeof window === "undefined" ) return true
323
323
324
324
const stationWallet = ( window as any ) ?. station ?. keplr as {
325
- getChainInfosWithoutEndpoints : ( ) => Promise < { chainId : string } [ ] > ;
326
- } ;
325
+ getChainInfosWithoutEndpoints : ( ) => Promise < { chainId : string } [ ] >
326
+ }
327
327
328
- if ( ! stationWallet ) return true ;
328
+ if ( ! stationWallet ) return true
329
329
330
- const chainInfos = await stationWallet . getChainInfosWithoutEndpoints ( ) ;
331
- return chainInfos . some ( ( info ) => info . chainId === chainId ) ;
330
+ const chainInfos = await stationWallet . getChainInfosWithoutEndpoints ( )
331
+ return chainInfos . some ( ( info ) => info . chainId === chainId )
332
332
} ,
333
333
signOptions : {
334
334
preferNoSetFee : true ,
335
335
} ,
336
336
features : [ ] ,
337
337
} ,
338
- ] ;
338
+ {
339
+ ...CosmosKitWalletList [ "imtoken-extension" ] ,
340
+ logo : "/wallets/imtoken.svg" ,
341
+ mobileDisabled : false ,
342
+ windowPropertyName : "cosmos" ,
343
+ features : [ ] ,
344
+ lazyInstall : ( ) =>
345
+ import ( "@cosmos-kit/imtoken-extension" ) . then ( ( m ) => m . IMTokenWallet ) ,
346
+ async supportsChain ( chainId : string ) {
347
+ const cdcAvailableChains : MainnetChainIds [ ] = [ "cosmoshub-4" , "osmosis-1" ]
348
+ return cdcAvailableChains . includes ( chainId as MainnetChainIds )
349
+ } ,
350
+ } ,
351
+ ]
0 commit comments