This repository was archived by the owner on Apr 18, 2025. It is now read-only.
File tree 3 files changed +21
-5
lines changed
3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 1
1
# @blocto/wagmi-connector
2
2
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
+
3
17
## 2.0.0
4
18
5
19
### Major Changes
Original file line number Diff line number Diff line change 2
2
"name" : " @blocto/wagmi-connector" ,
3
3
"description" : " Blocto wallet connector extend from wagmi Connector" ,
4
4
"author" : " Calvin Chang" ,
5
- "version" : " 2.0.0 " ,
5
+ "version" : " 2.0.1 " ,
6
6
"type" : " module" ,
7
7
"main" : " ./dist/index.umd.cjs" ,
8
8
"module" : " ./dist/index.js" ,
Original file line number Diff line number Diff line change @@ -74,9 +74,7 @@ export function blocto({ appId }: BloctoParameters = {}) {
74
74
} ,
75
75
async getChainId ( ) {
76
76
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' } ) ;
80
78
return normalizeChainId ( chainId ) ;
81
79
} ,
82
80
async getProvider ( { chainId } = { } ) {
@@ -124,7 +122,11 @@ export function blocto({ appId }: BloctoParameters = {}) {
124
122
) ;
125
123
const isBloctoSupportChain = evmSupportMap [ `${ chainId } ` ] ;
126
124
127
- if ( ! chain || ! isBloctoSupportChain ) {
125
+ if ( ! chain ) {
126
+ throw new SwitchChainError ( new Error ( `Chain not in config: ${ id } ` ) ) ;
127
+ }
128
+
129
+ if ( ! isBloctoSupportChain ) {
128
130
throw new SwitchChainError (
129
131
new Error ( `Blocto unsupported chain: ${ id } ` )
130
132
) ;
You can’t perform that action at this time.
0 commit comments