Skip to content

Commit e6d7894

Browse files
authored
[core - v2.2.12-alpha.2] : bug - Add lowercase coercion to chain ids, add Optimism test net mapped to Optimism Icon (#1062)
* Add lowercase coercion to chain ids * Add Optimism Kovan to chainIdToLabel
1 parent 56e3fe3 commit e6d7894

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
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.2.12-alpha.1",
3+
"version": "2.2.12-alpha.2",
44
"scripts": {
55
"build": "rollup -c",
66
"dev": "rollup -c -w",

packages/core/src/store/actions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ export function addChains(chains: Chain[]): void {
4444
// chains are validated on init
4545
const action = {
4646
type: ADD_CHAINS,
47-
payload: chains.map(({ namespace = 'evm', ...rest }) => ({
47+
payload: chains.map(({ namespace = 'evm', id, ...rest }) => ({
4848
...rest,
49-
namespace
49+
namespace,
50+
id : id.toLowerCase()
5051
}))
5152
}
5253

packages/core/src/utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export const chainIdToLabel: Record<string, string> = {
8181
'0x89': 'Polygon',
8282
'0xfa': 'Fantom',
8383
'0xa': 'Optimism',
84+
'0x45': 'Optimism Kovan',
8485
'0xa86a': 'Avalanche',
8586
'0xa4ec': 'Celo',
8687
'0x64': 'Gnosis',
@@ -125,6 +126,10 @@ export const chainStyles: Record<string, ChainStyle> = {
125126
icon: optimismIcon,
126127
color: '#FF0420'
127128
},
129+
'0x45': {
130+
icon: optimismIcon,
131+
color: '#FF0420'
132+
},
128133
'0xa86a': {
129134
icon: avalancheIcon,
130135
color: '#E84142'

packages/demo/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"dependencies": {
2525
"@web3-onboard/coinbase": "^2.0.3",
26-
"@web3-onboard/core": "^2.2.11",
26+
"@web3-onboard/core": "^2.2.12-alpha.1",
2727
"@web3-onboard/dcent": "^2.0.0",
2828
"@web3-onboard/fortmatic": "^2.0.2",
2929
"@web3-onboard/gnosis": "^2.0.1",
@@ -36,6 +36,7 @@
3636
"@web3-onboard/torus": "^2.0.1",
3737
"@web3-onboard/trezor": "^2.1.0",
3838
"@web3-onboard/walletconnect": "^2.0.1",
39+
"@web3-onboard/web3auth": "^2.0.0",
3940
"vconsole": "^3.9.5"
4041
},
4142
"license": "MIT",

0 commit comments

Comments
 (0)