This repository was archived by the owner on Apr 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 11# @blocto/wagmi-connector
22
3+ ## 2.0.1
4+
5+ ### Patch Changes
6+
7+ - 7f68b54: fix(wagmi): obtain chainId through request
8+ - 073daf0: Show not in config error message when attempt to switch dapp unsupport chain
9+
10+ ## 2.0.1-beta.0
11+
12+ ### Patch Changes
13+
14+ - 7f68b54: fix(wagmi): obtain chainId through request
15+ - 073daf0: Show not in config error message when attempt to switch dapp unsupport chain
16+
317## 2.0.0
418
519### Major Changes
Original file line number Diff line number Diff line change 22 "name" : " @blocto/wagmi-connector" ,
33 "description" : " Blocto wallet connector extend from wagmi Connector" ,
44 "author" : " Calvin Chang" ,
5- "version" : " 2.0.0 " ,
5+ "version" : " 2.0.1 " ,
66 "type" : " module" ,
77 "main" : " ./dist/index.umd.cjs" ,
88 "module" : " ./dist/index.js" ,
Original file line number Diff line number Diff line change @@ -74,9 +74,7 @@ export function blocto({ appId }: BloctoParameters = {}) {
7474 } ,
7575 async getChainId ( ) {
7676 const provider = await this . getProvider ( ) ;
77- const chainId =
78- provider . chainId ??
79- ( await provider ?. request ( { method : 'eth_chainId' } ) ) ;
77+ const chainId = await provider ?. request ( { method : 'eth_chainId' } ) ;
8078 return normalizeChainId ( chainId ) ;
8179 } ,
8280 async getProvider ( { chainId } = { } ) {
@@ -124,7 +122,11 @@ export function blocto({ appId }: BloctoParameters = {}) {
124122 ) ;
125123 const isBloctoSupportChain = evmSupportMap [ `${ chainId } ` ] ;
126124
127- if ( ! chain || ! isBloctoSupportChain ) {
125+ if ( ! chain ) {
126+ throw new SwitchChainError ( new Error ( `Chain not in config: ${ id } ` ) ) ;
127+ }
128+
129+ if ( ! isBloctoSupportChain ) {
128130 throw new SwitchChainError (
129131 new Error ( `Blocto unsupported chain: ${ id } ` )
130132 ) ;
You can’t perform that action at this time.
0 commit comments