Skip to content

Commit 81fde22

Browse files
committed
Merge in dev
2 parents 96e6d38 + 0618bcf commit 81fde22

File tree

8 files changed

+98
-26
lines changed

8 files changed

+98
-26
lines changed

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"dependencies": {
5757
"bnc-sdk": "^4.6.6",
5858
"@web3-onboard/coinbase": "^2.1.4",
59-
"@web3-onboard/core": "^2.15.4",
59+
"@web3-onboard/core": "^2.15.5",
6060
"@web3-onboard/dcent": "^2.2.3",
6161
"@web3-onboard/enkrypt": "^2.0.0",
6262
"@web3-onboard/fortmatic": "^2.0.14",

docs/src/lib/services/onboard.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ const intiOnboard = async (theme) => {
179179
token: 'ARB-ETH',
180180
label: 'Arbitrum',
181181
rpcUrl: 'https://rpc.ankr.com/arbitrum'
182+
},
183+
{
184+
id: 84531,
185+
token: 'ETH',
186+
label: 'Base Goerli',
187+
rpcUrl: 'https://goerli.base.org'
182188
}
183189
],
184190
appMetadata: {

docs/src/routes/docs/[...3]modules/core.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ npm install @web3-onboard/core
2727
</TabPanel>
2828
</Tabs>
2929

30+
#### All Wallet Modules
3031
If you would like to support all wallets, then you can install all of the wallet modules:
3132

3233
<Tabs values={['yarn', 'npm']}>
@@ -95,16 +96,17 @@ type InitOptions {
9596
}
9697

9798
```
99+
---
98100

99-
### Options
100-
101-
#### **wallets**
101+
#### wallets
102102

103-
An array of wallet modules that you would like to be presented to the user to select from when connecting a wallet. A wallet module is an abstraction that allows for easy interaction without needing to know the specifics of how that wallet works and are separate packages that can be included.
103+
An array of wallet modules that you would like to be presented to the user to select from when connecting a wallet. A wallet module is an abstraction that allows for easy interaction without needing to know the specifics of how that wallet works and are separate packages that can be included.
104+
These modules are separate @web3-onboard packages such as `@web3-onboard/injected-wallets` or `@web3-onboard/ledger`.
105+
For a full list click [here](#all-wallet-modules).
104106

105107
---
106108

107-
#### **chains**
109+
#### chains
108110

109111
An array of Chains that your app supports:
110112

@@ -124,7 +126,7 @@ type Chain = {
124126
125127
---
126128
127-
#### **appMetadata**
129+
#### appMetadata
128130
129131
An object that defines your app:
130132
@@ -169,7 +171,7 @@ type RecommendedInjectedWallets = {
169171
170172
---
171173
172-
#### **connectModal**
174+
#### connectModal
173175
174176
An object that allows for customizing the connect modal layout and behavior
175177
@@ -208,7 +210,7 @@ type ConnectModalOptions = {
208210
209211
---
210212
211-
#### **i18n**
213+
#### i18n
212214
213215
An object that defines the display text for different locales. Can also be used to override the default text. To override the default text, pass in an object for the `en` locale.
214216
@@ -222,7 +224,7 @@ Onboard is using the [ICU syntax](https://formatjs.io/docs/core-concepts/icu-syn
222224
223225
---
224226
225-
#### **theme**
227+
#### theme
226228
227229
A string or an object that defines the color theme web3-onboard will render the components.
228230
@@ -266,7 +268,7 @@ It will allow you to customize the look and feel of web3-onboard, try different
266268
267269
---
268270
269-
#### **accountCenter**
271+
#### accountCenter
270272
271273
An object that defines whether the account center UI (default and minimal) is enabled and its position on the screen. Currently the account center is enabled for both desktop and mobile devices.
272274
@@ -294,7 +296,7 @@ type AccountCenterPosition = 'topRight' | 'bottomRight' | 'bottomLeft' | 'topLef
294296
295297
---
296298
297-
#### **containerElements**
299+
#### containerElements
298300
299301
An object mapping for W3O components with the key being the DOM element to mount the specified component to.
300302
This defines the DOM container element for svelte to attach the component.
@@ -321,7 +323,7 @@ type ContainerElements = {
321323
322324
---
323325
324-
#### **`notify`**
326+
#### notify
325327
326328
Notify provides by default transaction notifications for all connected wallets on the current blockchain. When switching chains the previous chain listeners remain active for 60 seconds to allow capture and report of remaining transactions that may be in flight.
327329
By default transaction notifications are captured if a DAppID is provided in the Onboard config along with the Account Center being enabled.
@@ -458,6 +460,12 @@ const onboard = Onboard({
458460
token: 'ARB-ETH',
459461
label: 'Arbitrum',
460462
rpcUrl: 'https://rpc.ankr.com/arbitrum'
463+
},
464+
{
465+
id: 84531,
466+
token: 'ETH',
467+
label: 'Base Goerli',
468+
rpcUrl: 'https://goerli.base.org'
461469
}
462470
],
463471
appMetadata: {
@@ -1478,21 +1486,23 @@ export default config
14781486

14791487
If an error presents around `window` being undefined remove the `define.global` block.
14801488
Add this to your `app.html`
1489+
14811490
```html
14821491
<script>
1483-
var global = global || window
1492+
var global = global || window
14841493
</script>
14851494
```
14861495

14871496
##### Buffer polyfill
1497+
14881498
It seems some component or dependency requires Node's Buffer. To polyfill this, the simplest way I could find was to install the buffer package and include the following in web3-onboard.ts:
14891499

14901500
```javascript
14911501
import { Buffer } from 'buffer'
14921502
globalThis.Buffer = Buffer
14931503
```
1494-
See [this github issue](https://github.com/blocknative/web3-onboard/issues/1568#issuecomment-1463963462) for further troubleshooting
14951504

1505+
See [this github issue](https://github.com/blocknative/web3-onboard/issues/1568#issuecomment-1463963462) for further troubleshooting
14961506

14971507
### Vite
14981508

@@ -1575,20 +1585,19 @@ Checkout a boilerplate example for NextJS v13 (here)[https://github.com/blocknat
15751585

15761586
Checkout a boilerplate example for NextJS (here)[https://github.com/blocknative/web3-onboard/tree/develop/examples/with-nextjs]
15771587

1578-
15791588
:::admonition type=note
15801589

15811590
If you are seeing an error during builds when dynamically importing Web3Onboard in a NextJS v13 project, try upgrading to to the Canary beta release of NextJS where this issue is fixed.
15821591

15831592
:::
15841593

1585-
15861594
## Package Managers
15871595

15881596
### npm and yarn
15891597

15901598
Web3-Onboard will work out of the box with `npm` and `yarn` support.
15911599

15921600
### pnpm
1601+
15931602
We have had issues reported when using `pnpm` as the package manager when working with web3-onboard.
1594-
As we work to understand this new manager more and the issues around it we recommend using `npm` or `yarn` for now.
1603+
As we work to understand this new manager more and the issues around it we recommend using `npm` or `yarn` for now.

packages/core/src/icons/base.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export default `
2+
<svg height="100%" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
3+
<g clip-path="url(#clip0_1607_202)">
4+
<mask id="mask0_1607_202" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="32" height="32">
5+
<path d="M32 0H0V32H32V0Z" fill="white"/>
6+
</mask>
7+
<g mask="url(#mask0_1607_202)">
8+
<path d="M16 32C19.1645 32 22.258 31.0616 24.8892 29.3036C27.5204 27.5454 29.571 25.0466 30.782 22.123C31.993 19.1993 32.31 15.9823 31.6926 12.8786C31.0752 9.77486 29.5514 6.92394 27.3138 4.6863C25.076 2.44866 22.2252 0.924806 19.1214 0.307442C16.0177 -0.30992 12.8007 0.0069325 9.87706 1.21793C6.95344 2.42894 4.45458 4.4797 2.69648 7.11088C0.938384 9.74206 0 12.8355 0 16C0 20.2434 1.68571 24.3132 4.6863 27.3138C7.68688 30.3142 11.7565 32 16 32Z" fill="#0052FF"/>
9+
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.9624 27.2676C22.1852 27.2676 27.23 22.223 27.23 16C27.23 9.7771 22.1852 4.73242 15.9624 4.73242C10.0588 4.73242 5.21566 9.2726 4.7341 15.0518H21.4546V16.928H4.73242C5.20432 22.7168 10.0519 27.2676 15.9624 27.2676Z" fill="white"/>
10+
</g>
11+
</g>
12+
<defs>
13+
<clipPath id="clip0_1607_202">
14+
<rect width="32" height="32" fill="white"/>
15+
</clipPath>
16+
</defs>
17+
</svg>
18+
`

packages/core/src/icons/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// bn branding
22
export { default as defaultBnIcon } from './blocknative-icon.js'
33
export { default as poweredByBlocknative } from './poweredByBlocknative.js'
4-
// other
5-
export { default as hourglass } from './hourglass.js'
6-
export { default as questionIcon } from './question.js'
4+
// chain icons
75
export { default as ethereumIcon } from './ethereum.js'
86
export { default as polygonIcon } from './polygon.js'
97
export { default as binanceIcon } from './binance.js'
@@ -14,6 +12,10 @@ export { default as celoIcon } from './celo.js'
1412
export { default as gnosisIcon } from './gnosis.js'
1513
export { default as harmonyOneIcon } from './harmony-one.js'
1614
export { default as arbitrumIcon } from './arbitrum.js'
15+
export { default as baseIcon } from './base.js'
16+
// other
17+
export { default as hourglass } from './hourglass.js'
18+
export { default as questionIcon } from './question.js'
1719
export { default as checkmark } from './checkmark.js'
1820
export { default as errorIcon } from './error.js'
1921
export { default as infoIcon } from './info.js'

packages/core/src/utils.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ import {
2727
celoIcon,
2828
avalancheIcon,
2929
harmonyOneIcon,
30-
arbitrumIcon
30+
arbitrumIcon,
31+
baseIcon
3132
} from './icons/index.js'
3233

3334
import type {
@@ -123,6 +124,7 @@ export const chainIdToLabel: Record<string, string> = {
123124
'0x45': 'Optimism Kovan',
124125
'0xa86a': 'Avalanche',
125126
'0xa4ec': 'Celo',
127+
'0x14a33': 'Base Goerli',
126128
'0x64': 'Gnosis',
127129
'0x63564C40': 'Harmony One',
128130
'0xa4b1': 'Arbitrum'
@@ -201,7 +203,12 @@ export const chainStyles: Record<string, ChainStyle> = {
201203
'0xa4b1': {
202204
icon: arbitrumIcon,
203205
color: '#33394B'
204-
}
206+
},
207+
'0x14a33': {
208+
icon: baseIcon,
209+
color: '#0259F9'
210+
},
211+
205212
}
206213

207214
export const unrecognizedChainStyle = { icon: questionIcon, color: '#33394B' }

packages/demo/src/App.svelte

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import phantomModule from '@web3-onboard/phantom'
2828
import trustModule from '@web3-onboard/trust'
2929
import frontierModule from '@web3-onboard/frontier'
30+
import blocknativeIcon from './blocknative-icon.js'
3031
import {
3132
recoverAddress,
3233
arrayify,
@@ -240,6 +241,12 @@
240241
token: 'ARB-ETH',
241242
label: 'Arbitrum',
242243
rpcUrl: 'https://rpc.ankr.com/arbitrum'
244+
},
245+
{
246+
id: 84531,
247+
token: 'ETH',
248+
label: 'Base Goerli',
249+
rpcUrl: 'https://goerli.base.org'
243250
}
244251
],
245252
connect: {
@@ -249,7 +256,7 @@
249256
},
250257
appMetadata: {
251258
name: 'Blocknative',
252-
// icon: blocknativeIcon,
259+
icon: blocknativeIcon,
253260
// logo: blocknativeLogo,
254261
description: 'Demo app for Onboard V2',
255262
recommendedInjectedWallets: [
Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1-
export default `
2-
<svg id="Layer_1" height="100%" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 380.94 434.03"><defs><style>.cls-1{fill:#262a3d;}.cls-2{fill:url(#linear-gradient);}.cls-3{fill:url(#linear-gradient-2);}</style><linearGradient id="linear-gradient" x1="2.19" y1="163.03" x2="188.9" y2="163.03" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#55ccfe"/><stop offset="1" stop-color="#5e93ef"/></linearGradient><linearGradient id="linear-gradient-2" x1="2.19" y1="324.73" x2="375.61" y2="324.73" xlink:href="#linear-gradient"/></defs><polygon class="cls-1" points="64.42 324.73 2.19 216.93 126.66 216.93 126.66 216.93 188.9 324.73 64.42 324.73"/><polygon class="cls-2" points="126.66 216.93 2.19 216.93 64.42 109.13 188.9 109.13 126.66 216.93"/><polygon class="cls-1" points="251.14 216.93 188.9 109.13 64.42 109.13 2.19 1.33 251.14 1.33 375.61 216.93 251.14 216.93"/><polygon class="cls-3" points="251.14 432.53 2.19 432.53 64.42 324.73 188.9 324.73 251.14 216.93 375.61 216.93 251.14 432.53"/></svg>
1+
export default `<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
2+
<rect width="56" height="56" rx="8" fill="#262A3D"/>
3+
<g clip-path="url(#clip0_15747_103507)">
4+
<path d="M20.6176 35.9801L16.0142 27.9949H25.2218L29.826 35.9801H20.6176Z" fill="#262A3D"/>
5+
<path d="M20.6176 35.9801L16.0142 27.9949H25.2218L29.826 35.9801H20.6176Z" fill="white"/>
6+
<path d="M25.2218 27.9947H16.0142L20.6176 20.0095H29.826L25.2218 27.9947Z" fill="url(#paint0_linear_15747_103507)"/>
7+
<path d="M34.4302 27.9948L29.826 20.0096H20.6176L16.0142 12.0244H34.4302L43.6379 27.9948H34.4302Z" fill="#262A3D"/>
8+
<path d="M34.4302 27.9948L29.826 20.0096H20.6176L16.0142 12.0244H34.4302L43.6379 27.9948H34.4302Z" fill="white"/>
9+
<path d="M34.4302 43.9652H16.0142L20.6176 35.9801H29.826L34.4302 27.9949H43.6379L34.4302 43.9652Z" fill="url(#paint1_linear_15747_103507)"/>
10+
</g>
11+
<defs>
12+
<linearGradient id="paint0_linear_15747_103507" x1="16.0142" y1="24.0021" x2="29.826" y2="24.0021" gradientUnits="userSpaceOnUse">
13+
<stop stop-color="#55CCFE"/>
14+
<stop offset="1" stop-color="#5E93EF"/>
15+
</linearGradient>
16+
<linearGradient id="paint1_linear_15747_103507" x1="76.5102" y1="5214.05" x2="10391.8" y2="5214.05" gradientUnits="userSpaceOnUse">
17+
<stop stop-color="#55CCFE"/>
18+
<stop offset="1" stop-color="#5E93EF"/>
19+
</linearGradient>
20+
<clipPath id="clip0_15747_103507">
21+
<rect width="27.6667" height="32" fill="white" transform="translate(16 12)"/>
22+
</clipPath>
23+
</defs>
24+
</svg>
25+
326
`

0 commit comments

Comments
 (0)