Skip to content

Commit 197599e

Browse files
authored
FEAT - Support Degen chain (#2138)
* Bump versions for release and Remove console.log * Add degen support, update docs, add degen to examples * Update injected imports
1 parent 21c07de commit 197599e

File tree

29 files changed

+169
-25
lines changed

29 files changed

+169
-25
lines changed

.github/ISSUE_TEMPLATE/BUG.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ body:
4646
- '@web3-onboard/decent'
4747
- '@web3-onboard/formatic'
4848
- '@web3-onboard/gnosis'
49-
- '@web3-onboard/injected'
49+
- '@web3-onboard/injected-wallets'
5050
- '@web3-onboard/keepkey'
5151
- '@web3-onboard/keystone'
5252
- '@web3-onboard/ledger'

docs/src/lib/services/onboard.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,12 @@ const intiOnboard = async (theme) => {
247247
token: 'OETH',
248248
label: 'Optimism',
249249
rpcUrl: 'https://mainnet.optimism.io'
250+
},
251+
{
252+
id: 666666666,
253+
token: 'DEGEN',
254+
label: 'Degen',
255+
rpcUrl: 'https://rpc.degen.tips'
250256
}
251257
],
252258
appMetadata: {

docs/src/routes/+page.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
<TabPanel value="npm">
1414

1515
```sh copy
16-
npm i @web3-onboard/core @web3-onboard/injected @web3-onboard/transaction-preview
16+
npm i @web3-onboard/core @web3-onboard/injected-wallets @web3-onboard/transaction-preview
1717
```
1818

1919
</TabPanel>
2020
<TabPanel value="yarn">
2121

2222
```sh copy
23-
yarn add @web3-onboard/core @web3-onboard/injected @web3-onboard/transaction-preview
23+
yarn add @web3-onboard/core @web3-onboard/injected-wallets @web3-onboard/transaction-preview
2424
```
2525

2626
</TabPanel>
@@ -32,14 +32,14 @@ yarn add @web3-onboard/core @web3-onboard/injected @web3-onboard/transaction-pre
3232
<TabPanel value="npm">
3333

3434
```sh copy
35-
npm i @web3-onboard/core @web3-onboard/injected @web3-onboard/transaction-preview
35+
npm i @web3-onboard/core @web3-onboard/injected-wallets @web3-onboard/transaction-preview
3636
```
3737

3838
</TabPanel>
3939
<TabPanel value="yarn">
4040

4141
```sh copy
42-
yarn add @web3-onboard/core @web3-onboard/injected @web3-onboard/transaction-preview
42+
yarn add @web3-onboard/core @web3-onboard/injected-wallets @web3-onboard/transaction-preview
4343
```
4444

4545
</TabPanel>
@@ -48,14 +48,14 @@ yarn add @web3-onboard/core @web3-onboard/injected @web3-onboard/transaction-pre
4848
<TabPanel value="npm">
4949

5050
```sh copy
51-
npm i @web3-onboard/core @web3-onboard/injected @web3-onboard/transaction-preview
51+
npm i @web3-onboard/core @web3-onboard/injected-wallets @web3-onboard/transaction-preview
5252
```
5353

5454
</TabPanel>
5555
<TabPanel value="yarn">
5656

5757
```sh copy
58-
yarn add @web3-onboard/core @web3-onboard/injected @web3-onboard/transaction-preview
58+
yarn add @web3-onboard/core @web3-onboard/injected-wallets @web3-onboard/transaction-preview
5959
```
6060

6161
</TabPanel>

docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ web3-onboard supports ALL EVM networks. Supporting a new network is simply a mat
4545
- Avalanche
4646
- BNB Chain
4747
- Celo
48+
- Degen
4849
- Fantom
4950
- Gnosis Chain
5051
- Harmony One
@@ -132,6 +133,12 @@ const onboard = Onboard({
132133
token: 'ETH',
133134
label: 'Celo',
134135
rpcUrl: 'https://1rpc.io/celo'
136+
},
137+
{
138+
id: 666666666,
139+
token: 'DEGEN',
140+
label: 'Degen',
141+
rpcUrl: 'https://rpc.degen.tips'
135142
}
136143
]
137144
})

docs/src/routes/docs/[...3]modules/[...1]core/+page.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,12 @@ const onboard = Onboard({
677677
token: 'ETH',
678678
label: 'Celo',
679679
rpcUrl: 'https://1rpc.io/celo'
680+
},
681+
{
682+
id: 666666666,
683+
token: 'DEGEN',
684+
label: 'Degen',
685+
rpcUrl: 'https://rpc.degen.tips'
680686
}
681687
],
682688
appMetadata: {

docs/src/routes/docs/[...3]modules/[...5]transaction-preview/+page.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ Full Simulation Platform API documentation can be found [here](https://docs.bloc
2727
<TabPanel value="yarn">
2828

2929
```sh copy
30-
yarn add @web3-onboard/core @web3-onboard/injected @web3-onboard/transaction-preview
30+
yarn add @web3-onboard/core @web3-onboard/injected-wallets @web3-onboard/transaction-preview
3131
```
3232

3333
</TabPanel>
3434
<TabPanel value="npm">
3535

3636
```sh copy
37-
npm i @web3-onboard/core @web3-onboard/injected @web3-onboard/transaction-preview
37+
npm i @web3-onboard/core @web3-onboard/injected-wallets @web3-onboard/transaction-preview
3838
```
3939

4040
</TabPanel>
@@ -48,7 +48,7 @@ To use the Transaction Preview package with web3-onboard all a developer needs t
4848

4949
```typescript copy
5050
import Onboard from '@web3-onboard/core'
51-
import injectedModule from '@web3-onboard/injected'
51+
import injectedModule from '@web3-onboard/injected-wallets'
5252
import transactionPreviewModule from '@web3-onboard/transaction-preview'
5353

5454
const injected = injectedModule()

docs/src/routes/examples/[...1]connect-wallet/+page.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ const chains = [
161161
token: 'ETH',
162162
label: 'Celo',
163163
rpcUrl: 'https://1rpc.io/celo'
164+
},
165+
{
166+
id: 666666666,
167+
token: 'DEGEN',
168+
label: 'Degen',
169+
rpcUrl: 'https://rpc.degen.tips'
164170
}
165171
]
166172

@@ -423,6 +429,12 @@ const chains = [
423429
token: 'ETH',
424430
label: 'Celo',
425431
rpcUrl: 'https://1rpc.io/celo'
432+
},
433+
{
434+
id: 666666666,
435+
token: 'DEGEN',
436+
label: 'Degen',
437+
rpcUrl: 'https://rpc.degen.tips'
426438
}
427439
]
428440

@@ -511,4 +523,4 @@ Now that we have our wallet connected, let's display some basic information, suc
511523
512524
## Interacting with the providers - Transfer, Send, Sign using ethers.js
513525
514-
For examples of interacting with the wallet providers please see our demo project [here](https://github.com/blocknative/web3-onboard/blob/9b871a1b3117e92a7c87285677fa5b35c544a8e0/packages/demo/src/App.svelte#L447)
526+
For examples of interacting with the wallet providers please see our demo project [here](https://github.com/blocknative/web3-onboard/blob/9b871a1b3117e92a7c87285677fa5b35c544a8e0/packages/demo/src/App.svelte#L447)

docs/src/routes/examples/[...2]uniswap-widget/+page.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ const polygonMainnet = {
5959
rpcUrl: 'https://matic-mainnet.chainstacklabs.com'
6060
}
6161

62+
const degenChain = {
63+
id: 666666666,
64+
token: 'DEGEN',
65+
label: 'Degen',
66+
rpcUrl: 'https://rpc.degen.tips'
67+
}
68+
6269
const chains = [ethereumRopsten, polygonMainnet]
6370

6471
const wallets = [injectedModule()]

examples/with-ledger/pages/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ init({
6464
token: 'FTM',
6565
label: 'Fantom',
6666
rpcUrl: 'https://rpc.ftm.tools/'
67+
},
68+
{
69+
id: 666666666,
70+
token: 'DEGEN',
71+
label: 'Degen',
72+
rpcUrl: 'https://rpc.degen.tips'
6773
}
6874
],
6975
appMetadata: {

examples/with-nextjs-13/web3-onboard.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ export default init({
129129
token: 'ETH',
130130
label: 'Celo',
131131
rpcUrl: 'https://1rpc.io/celo'
132+
},
133+
{
134+
id: 666666666,
135+
token: 'DEGEN',
136+
label: 'Degen',
137+
rpcUrl: 'https://rpc.degen.tips'
132138
}
133139
],
134140
appMetadata: {

examples/with-nextjs/pages/_app.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ const celoMainnet = {
2828
token: 'ETH',
2929
label: 'Celo',
3030
rpcUrl: 'https://1rpc.io/celo'
31+
},
32+
{
33+
id: 666666666,
34+
token: 'DEGEN',
35+
label: 'Degen',
36+
rpcUrl: 'https://rpc.degen.tips'
3137
}
3238

3339
const chains = [ethereumRopsten, polygonMainnet, baseMainnet,celoMainnet]

examples/with-solidjs/src/providers/onboard-provider/options.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ export const chains = [
3434
token: 'ETH',
3535
label: 'Celo',
3636
rpcUrl: 'https://1rpc.io/celo'
37+
},
38+
{
39+
id: 666666666,
40+
token: 'DEGEN',
41+
label: 'Degen',
42+
rpcUrl: 'https://rpc.degen.tips'
3743
}
3844
];
3945

examples/with-sveltekit/src/lib/web3-onboard.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ const chains = [
3939
token: 'ETH',
4040
label: 'Celo',
4141
rpcUrl: 'https://1rpc.io/celo'
42+
},
43+
{
44+
id: 666666666,
45+
token: 'DEGEN',
46+
label: 'Degen',
47+
rpcUrl: 'https://rpc.degen.tips'
4248
}
4349
]
4450

examples/with-vanilla-js/src/onboard.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ const chains = [
3535
token: 'ETH',
3636
label: 'Celo',
3737
rpcUrl: 'https://1rpc.io/celo'
38+
},
39+
{
40+
id: 666666666,
41+
token: 'DEGEN',
42+
label: 'Degen',
43+
rpcUrl: 'https://rpc.degen.tips'
3844
}
3945
]
4046

examples/with-vite-react/src/web3-onboard.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ export default init({
141141
token: 'ETH',
142142
label: 'Celo',
143143
rpcUrl: 'https://1rpc.io/celo'
144+
},
145+
{
146+
id: 666666666,
147+
token: 'DEGEN',
148+
label: 'Degen',
149+
rpcUrl: 'https://rpc.degen.tips'
144150
}
145151
],
146152
appMetadata: {

examples/with-vuejs-v2/src/components/HelloWorld.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ const web3Onboard = init({
6666
token: 'ETH',
6767
label: 'Celo',
6868
rpcUrl: 'https://1rpc.io/celo'
69+
},
70+
{
71+
id: 666666666,
72+
token: 'DEGEN',
73+
label: 'Degen',
74+
rpcUrl: 'https://rpc.degen.tips'
6975
}
7076
]
7177
})

examples/with-vuejs/src/App.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ init({
3434
token: 'ETH',
3535
label: 'Celo',
3636
rpcUrl: 'https://1rpc.io/celo'
37+
},
38+
{
39+
id: 666666666,
40+
token: 'DEGEN',
41+
label: 'Degen',
42+
rpcUrl: 'https://rpc.degen.tips'
3743
}
3844
]
3945
})

packages/core/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,12 @@ const onboard = Onboard({
635635
token: 'FTM',
636636
label: 'Fantom Mainnet',
637637
rpcUrl: 'https://rpc.ftm.tools/'
638+
},
639+
{
640+
id: 666666666,
641+
token: 'DEGEN',
642+
label: 'Degen',
643+
rpcUrl: 'https://rpc.degen.tips'
638644
}
639645
],
640646
appMetadata: {

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.21.4",
3+
"version": "2.21.5-alpha.1",
44
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",

packages/core/src/icons/degen.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default `
2+
<?xml version="1.0" encoding="UTF-8"?>
3+
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 477 477">
4+
<defs>
5+
<style>.cls-1{fill:#a36dfe;}.cls-2{fill:#4b2895;}</style>
6+
</defs>
7+
<circle class="cls-1" cx="238.5" cy="238.5" r="238.5"/>
8+
<g>
9+
<path class="cls-2" d="M237.85,113.99c29.25,1.32,54.97,2.45,80.69,3.69,3.95,.19,7.92,.72,11.82,1.43,9.23,1.69,15.34,8.72,14.78,18.2-1.33,22.33-3.22,44.63-4.79,66.95-.81,11.47-1.49,22.96-2.12,34.44-.29,5.24-2.03,8.14-7.74,10.18-37.84,13.52-76.98,15.46-116.47,13.42-23.24-1.2-45.99-5.86-68.06-13.68-4.71-1.67-6.72-3.91-7.03-8.72-1.31-20.46-2.83-40.9-4.25-61.35-.94-13.55-2.1-27.1-2.7-40.66-.49-11.15,6.17-18.37,17.2-19.01,30.7-1.78,61.4-3.39,88.69-4.88Z"/><path class="cls-2" d="M238.34,363.01c-31.19-1.24-61.52-5.51-90.12-18.31-20.8-9.31-38.13-23.01-48.65-43.63-3.63-7.1-5.68-15.3-6.91-23.24-1.17-7.59,1.95-14.47,8.76-18.93,6.74-4.42,13.4-3.5,20.12,.38,14.24,8.24,14.6,8.18,14.39,24.44-.09,7.1,3.71,11.23,8.41,15.24,12.51,10.67,26.94,17.78,42.7,21.94,38.88,10.26,77.66,10.06,115.42-4.42,11.31-4.33,21.33-12.17,31.67-18.82,5.27-3.39,7.7-8.7,6.88-15.19-1.34-10.7,2.19-17.99,12.86-22.48,7.8-3.29,14.95-6.25,22.38-.72,7.42,5.53,9.4,13.33,7.88,22.37-4.05,24.14-19.06,40.5-38.25,53.68-18.5,12.7-39.59,19.06-61.42,22.61-15.24,2.48-30.72,3.44-46.1,5.09Z"/>
10+
</g>
11+
</svg>
12+
`

packages/core/src/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ export { default as caretIcon } from './caret.js'
2323
export { default as warningIcon } from './warning.js'
2424
export { default as successIcon } from './success.js'
2525
export { default as pendingIcon } from './pending.js'
26+
export { default as degenIcon } from './degen.js'

packages/core/src/utils.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ import {
2828
avalancheIcon,
2929
harmonyOneIcon,
3030
arbitrumIcon,
31-
baseIcon
31+
baseIcon,
32+
degenIcon
3233
} from './icons/index.js'
3334

3435
import type {
@@ -137,7 +138,8 @@ export const chainIdToLabel: Record<string, string> = {
137138
'0x64': 'Gnosis',
138139
'0x63564C40': 'Harmony One',
139140
'0xa4b1': 'Arbitrum One',
140-
'0xa4ba': 'Arbitrum Nova'
141+
'0xa4ba': 'Arbitrum Nova',
142+
'0x27bc86aa': 'Degen'
141143
}
142144

143145
export const networkToChainId: Record<string, ChainId> = {
@@ -150,7 +152,9 @@ export const networkToChainId: Record<string, ChainId> = {
150152
'bsc-main': '0x38',
151153
'matic-main': '0x89',
152154
'fantom-main': '0xfa',
153-
'matic-mumbai': '0x80001'
155+
'matic-mumbai': '0x80001',
156+
'degen': '0x27bc86aa'
157+
154158
}
155159

156160
export const chainStyles: Record<string, ChainStyle> = {
@@ -233,6 +237,10 @@ export const chainStyles: Record<string, ChainStyle> = {
233237
'0x80001': {
234238
icon: polygonIcon,
235239
color: '#8247E5'
240+
},
241+
'0x27bc86aa': {
242+
icon: degenIcon,
243+
color: '#a36dfe'
236244
}
237245
}
238246

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@web3-onboard/blocto": "^2.0.1",
3333
"@web3-onboard/capsule": "2.0.1",
3434
"@web3-onboard/cede-store": "^2.2.0",
35-
"@web3-onboard/core": "^2.21.4",
35+
"@web3-onboard/core": "^2.21.5-alpha.1",
3636
"@web3-onboard/coinbase": "^2.2.7",
3737
"@web3-onboard/dcent": "^2.2.7",
3838
"@web3-onboard/enkrypt": "^2.0.3",

0 commit comments

Comments
 (0)