Skip to content

Commit 1578945

Browse files
committed
Fix chain bug
1 parent f709fd5 commit 1578945

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/core",
3-
"version": "2.0.0-alpha.5",
3+
"version": "2.0.0-alpha.6",
44
"scripts": {
55
"build": "rollup -c",
66
"dev": "rollup -c -w",

packages/core/src/provider.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ export async function getBalance(
266266
address: string,
267267
chain: Chain
268268
): Promise<Balances | null> {
269+
// chain we don't recognize
270+
if (!chain) return null
271+
269272
if (!ethersProviders[chain.rpcUrl]) {
270273
ethersProviders[chain.rpcUrl] = new providers.StaticJsonRpcProvider(
271274
chain.rpcUrl

0 commit comments

Comments
 (0)