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

Commit 31ea4aa

Browse files
authored
Merge pull request #390 from blocto/fix/getting-wrong-chainId-in-in-app-browser
Fix/getting wrong chain id in in app browser
2 parents b03da36 + 7f68b54 commit 31ea4aa

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@blocto/wagmi-connector': patch
3+
---
4+
5+
fix(wagmi): obtain chainId through request

adapters/wagmi-connector/src/connector.ts

Lines changed: 1 addition & 3 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 } = {}) {

0 commit comments

Comments
 (0)