Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit 56c377f

Browse files
authored
Merge pull request #392 from blocto/release/0131
Release: Merge to publish new version to npm
2 parents d7cdcd5 + 7262e29 commit 56c377f

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

adapters/wagmi-connector/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
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

adapters/wagmi-connector/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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",

adapters/wagmi-connector/src/connector.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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
);

0 commit comments

Comments
 (0)