Skip to content

Commit 2fc6f8d

Browse files
authored
Merge pull request #1606 from blocknative/release/2.21.0
Release 2.21.0
2 parents 109e46c + 5ce8927 commit 2fc6f8d

File tree

103 files changed

+3817
-1733
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+3817
-1733
lines changed

docs/package.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -54,33 +54,33 @@
5454
},
5555
"type": "module",
5656
"dependencies": {
57-
"bnc-sdk": "^4.6.6",
58-
"@web3-onboard/coinbase": "^2.1.4",
59-
"@web3-onboard/core": "^2.15.5",
60-
"@web3-onboard/dcent": "^2.2.3",
61-
"@web3-onboard/enkrypt": "^2.0.0",
62-
"@web3-onboard/fortmatic": "^2.0.14",
63-
"@web3-onboard/gas": "^2.1.4",
64-
"@web3-onboard/gnosis": "^2.1.6",
65-
"@web3-onboard/infinity-wallet": "^2.0.0",
66-
"@web3-onboard/injected-wallets": "^2.8.1",
67-
"@web3-onboard/keepkey": "^2.3.3",
68-
"@web3-onboard/keystone": "^2.3.3",
69-
"@web3-onboard/ledger": "^2.4.2",
70-
"@web3-onboard/magic": "^2.1.3",
71-
"@web3-onboard/mew-wallet": "^2.0.0",
72-
"@web3-onboard/portis": "^2.1.3",
73-
"@web3-onboard/sequence": "^2.0.4",
74-
"@web3-onboard/taho": "^2.0.0",
75-
"@web3-onboard/torus": "^2.2.0",
76-
"@web3-onboard/transaction-preview": "^2.0.4",
77-
"@web3-onboard/trezor": "^2.3.3",
78-
"@web3-onboard/trust": "^2.0.0",
79-
"@web3-onboard/uauth": "^2.0.1",
80-
"@web3-onboard/walletconnect": "^2.3.2",
81-
"@web3-onboard/web3auth": "^2.1.4",
82-
"@web3-onboard/xdefi": "^2.0.0",
57+
"@web3-onboard/coinbase": "^2.2.1",
58+
"@web3-onboard/core": "^2.16.0",
59+
"@web3-onboard/dcent": "^2.2.4",
60+
"@web3-onboard/enkrypt": "^2.0.1",
61+
"@web3-onboard/fortmatic": "^2.0.16",
62+
"@web3-onboard/gas": "^2.1.5",
63+
"@web3-onboard/gnosis": "^2.1.7",
64+
"@web3-onboard/infinity-wallet": "^2.0.1",
65+
"@web3-onboard/injected-wallets": "^2.8.3",
66+
"@web3-onboard/keepkey": "^2.3.4",
67+
"@web3-onboard/keystone": "^2.3.4",
68+
"@web3-onboard/ledger": "^2.4.3",
69+
"@web3-onboard/magic": "^2.1.4",
70+
"@web3-onboard/mew-wallet": "^2.0.1",
71+
"@web3-onboard/portis": "^2.1.4",
72+
"@web3-onboard/sequence": "^2.0.5",
73+
"@web3-onboard/taho": "^2.0.1",
74+
"@web3-onboard/torus": "^2.2.2",
75+
"@web3-onboard/transaction-preview": "^2.0.5",
76+
"@web3-onboard/trezor": "^2.3.4",
77+
"@web3-onboard/trust": "^2.0.1",
78+
"@web3-onboard/uauth": "^2.0.2",
79+
"@web3-onboard/walletconnect": "^2.3.3",
80+
"@web3-onboard/web3auth": "^2.2.0",
81+
"@web3-onboard/xdefi": "^2.0.1",
8382
"animejs": "^3.2.1",
83+
"bnc-sdk": "^4.6.6",
8484
"ethers": "^5.7.0"
8585
}
8686
}

docs/src/lib/components/ThemeCustomizer.svelte

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,31 +81,35 @@
8181
'--w3o-text-color': 'unset',
8282
'--w3o-border-color': 'unset',
8383
'--w3o-action-color': 'unset',
84-
'--w3o-border-radius': 'unset'
84+
'--w3o-border-radius': 'unset',
85+
'--w3o-font-family': 'unset'
8586
},
8687
custom: {
8788
'--w3o-background-color': 'unset',
8889
'--w3o-foreground-color': 'unset',
8990
'--w3o-text-color': 'unset',
9091
'--w3o-border-color': 'unset',
9192
'--w3o-action-color': 'unset',
92-
'--w3o-border-radius': 'unset'
93+
'--w3o-border-radius': 'unset',
94+
'--w3o-font-family': 'unset'
9395
},
9496
light: {
9597
'--w3o-background-color': '#ffffff',
9698
'--w3o-foreground-color': '#EFF1FC',
9799
'--w3o-text-color': '#1a1d26',
98100
'--w3o-border-color': '#d0d4f7',
99101
'--w3o-action-color': '#6370E5',
100-
'--w3o-border-radius': '16px'
102+
'--w3o-border-radius': '16px',
103+
'--w3o-font-family': 'unset'
101104
},
102105
dark: {
103106
'--w3o-background-color': '#1A1D26',
104107
'--w3o-foreground-color': '#242835',
105108
'--w3o-text-color': '#EFF1FC',
106109
'--w3o-border-color': '#33394B',
107110
'--w3o-action-color': '#929bed',
108-
'--w3o-border-radius': '16px'
111+
'--w3o-border-radius': '16px',
112+
'--w3o-font-family': 'unset'
109113
}
110114
}
111115

docs/src/lib/services/onboard.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const intiOnboard = async (theme) => {
3232
const { default: trezorModule } = await import('@web3-onboard/trezor')
3333
const { default: ledgerModule } = await import('@web3-onboard/ledger')
3434
const { default: walletConnectModule } = await import('@web3-onboard/walletconnect')
35-
// const { default: infinityWalletModule } = await import('@web3-onboard/infinity-wallet')
35+
const { default: infinityWalletModule } = await import('@web3-onboard/infinity-wallet')
3636
const { default: coinbaseModule } = await import('@web3-onboard/coinbase')
3737
const { default: dcentModule } = await import('@web3-onboard/dcent')
3838
const { default: portisModule } = await import('@web3-onboard/portis')
@@ -53,7 +53,7 @@ const intiOnboard = async (theme) => {
5353
const INFURA_ID = '8b60d52405694345a99bcb82e722e0af'
5454

5555
const injected = injectedModule()
56-
// const infinityWallet = infinityWalletModule()
56+
const infinityWallet = infinityWalletModule()
5757
const coinbase = coinbaseModule()
5858
const dcent = dcentModule()
5959
const walletConnect = walletConnectModule({
@@ -121,7 +121,7 @@ const intiOnboard = async (theme) => {
121121
torus,
122122
sequence,
123123
web3auth,
124-
// infinityWallet,
124+
infinityWallet,
125125
dcent,
126126
enkrypt,
127127
mewWallet,
@@ -144,6 +144,12 @@ const intiOnboard = async (theme) => {
144144
label: 'Goerli',
145145
rpcUrl: `https://goerli.infura.io/v3/${INFURA_ID}`
146146
},
147+
{
148+
id: 11155111,
149+
token: 'ETH',
150+
label: 'Sepolia',
151+
rpcUrl: 'https://rpc.sepolia.org/'
152+
},
147153
{
148154
id: '0x13881',
149155
token: 'MATIC',

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ Web3-Onboard is the quickest and easiest way to add multi-wallet and multi-chain
3535

3636
web3-onboard supports all EVM networks. Supporting a new network is simply a matter of adding its details in the Chains section upon initialization. For more information see [initialization options](https://onboard.blocknative.com/docs/modules/core#options).
3737

38+
- Ethereum
3839
- Arbitrum
40+
- Optimism
3941
- Avalanche
4042
- BNB Chain
4143
- Celo
@@ -44,8 +46,10 @@ web3-onboard supports all EVM networks. Supporting a new network is simply a mat
4446
- Gnosis Chain
4547
- Harmony One
4648
- Moonriver
47-
- Optimism
4849
- Polygon
50+
- Goerli
51+
- Sepolia
52+
- Core Goerli
4953
- Any other EVM network
5054

5155
### [Optional] Use an API key to fetch real time transaction data, balances & gas

docs/src/routes/docs/[...2]getting-started/[...3]custom-styling.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ The Onboard styles can customized via [CSS custom properties](https://developer.
127127
--onboard-action-required-modal-background
128128

129129
/* FONTS */
130-
--onboard-font-family-normal: Sofia Pro;
131-
--onboard-font-family-semibold: Sofia Pro Semibold;
132-
--onboard-font-family-light: Sofia Pro Light;
130+
--onboard-font-family-normal: Inter, sans-serif;
133131

134132
--onboard-font-size-1: 3rem;
135133
--onboard-font-size-2: 2.25rem;
@@ -197,8 +195,7 @@ The Onboard styles can customized via [CSS custom properties](https://developer.
197195
--account-select-modal-danger-500: #ff4f4f;
198196

199197
/* FONTS */
200-
--account-select-modal-font-family-normal: Sofia Pro;
201-
--account-select-modal-font-family-light: Sofia Pro Light;
198+
--account-select-modal-font-family-normal: Inter, sans-serif;
202199
--account-select-modal-font-size-5: 1rem;
203200
--account-select-modal-font-size-7: .75rem;
204201
--account-select-modal-font-line-height-1: 24px;

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

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

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

3334
<Tabs values={['yarn', 'npm']}>
@@ -89,19 +90,28 @@ type InitOptions {
8990
* Object mapping for W3O components with the key being the component and the value the DOM element to mount the component to. This element must be available at time of package script execution.
9091
*/
9192
containerElements?: Partial<ContainerElements>
92-
/**
93+
/**
9394
* Custom or predefined theme for Web3Onboard i.e. default, dark, Custom, etc.
9495
*/
9596
theme?: Theme
97+
/**
98+
* Defaults to False
99+
* If set to true the Inter font will not be imported and
100+
* instead the default 'sans-serif' font will be used
101+
* To define the font used see `--w3o-font-family` prop within
102+
* the Theme initialization object or set as css variable
103+
*/
104+
disableFontDownload?: boolean
96105
}
97106

98107
```
108+
99109
---
100110

101111
#### wallets
102112

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`.
113+
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.
114+
These modules are separate @web3-onboard packages such as `@web3-onboard/injected-wallets` or `@web3-onboard/ledger`.
105115
For a full list click [here](#all-wallet-modules).
106116

107117
---
@@ -114,9 +124,11 @@ An array of Chains that your app supports:
114124
type Chain = {
115125
id: ChainId // hex encoded string, eg '0x1' for Ethereum Mainnet
116126
namespace?: 'evm' // string indicating chain namespace. Defaults to 'evm' but will allow other chain namespaces in the future
117-
rpcUrl: string // used for network requests
118-
label: string // used for display, eg Ethereum Mainnet
119-
token: TokenSymbol // the native token symbol, eg ETH, BNB, MATIC
127+
// PLEASE NOTE: Some wallets require an rpcUrl, label, and token for actions such as adding a new chain.
128+
// It is recommended to include rpcUrl, label, and token for full functionality.
129+
rpcUrl?: string // Recommended to include. Used for network requests.
130+
label?: string // Recommended to include. Used for display, eg Ethereum Mainnet.
131+
token?: TokenSymbol // Recommended to include. The native token symbol, eg ETH, BNB, MATIC.
120132
color?: string // the color used to represent the chain and will be used as a background for the icon
121133
icon?: string // the icon to represent the chain
122134
publicRpcUrl?: string // an optional public RPC used when adding a new chain config to the wallet
@@ -171,26 +183,36 @@ type RecommendedInjectedWallets = {
171183
172184
---
173185
174-
#### connectModal
186+
#### connect
175187
176188
An object that allows for customizing the connect modal layout and behavior
177189
178190
<img src="{walletModal}" alt="Web3-Onboard connect wallet modal"/>
179191
180192
```typescript copy
181193
type ConnectModalOptions = {
194+
/**
195+
* Display the connect modal sidebar - only applies to desktop views
196+
*/
182197
showSidebar?: boolean
183198
/**
184199
* Disabled close of the connect modal with background click and
185200
* hides the close button forcing an action from the connect modal
186201
* Defaults to false
187202
*/
188203
disableClose?: boolean
189-
/**If set to true, the last connected wallet will store in local storage.
190-
* Then on init, onboard will try to reconnect to that wallet with
191-
* no modals displayed
204+
/**
205+
* If set to true, the most recently connected wallet will store in
206+
* local storage. Then on init, onboard will try to reconnect to
207+
* that wallet with no modals displayed
208+
*/
209+
autoConnectLastWallet?: boolean
210+
/**
211+
* If set to true, all previously connected wallets will store in
212+
* local storage. Then on init, onboard will try to reconnect to
213+
* each wallet with no modals displayed
192214
*/
193-
autoConnectLastWallet?: boolean // defaults to false
215+
autoConnectAllPreviousWallet?: boolean
194216
/**
195217
* Customize the link for the `I don't have a wallet` flow shown on the
196218
* select wallet modal.
@@ -250,6 +272,7 @@ export type BuiltInThemes = 'default' | 'dark' | 'light'
250272

251273
export type ThemingMap = {
252274
'--w3o-background-color'?: string
275+
'--w3o-font-family'?: string
253276
'--w3o-foreground-color'?: string
254277
'--w3o-text-color'?: string
255278
'--w3o-border-color'?: string
@@ -268,6 +291,17 @@ It will allow you to customize the look and feel of web3-onboard, try different
268291
269292
---
270293
294+
#### disableFontDownload
295+
296+
If set to `true` the default `Inter` font will not be imported and instead the web based `sans-serif` font will be used if a font is not defined through the `Theme` or exposed css variable.
297+
To define the font use `--w3o-font-family` prop within the `Theme` initialization object or set as a css variable.
298+
299+
```typescript
300+
type disableFontDownload = boolean // defaults to false
301+
```
302+
303+
---
304+
271305
#### accountCenter
272306
273307
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.
@@ -437,6 +471,12 @@ const onboard = Onboard({
437471
label: 'Goerli',
438472
rpcUrl: `https://goerli.infura.io/v3/${INFURA_ID}`
439473
},
474+
{
475+
id: 11155111,
476+
token: 'ETH',
477+
label: 'Sepolia',
478+
rpcUrl: 'https://rpc.sepolia.org/'
479+
},
440480
{
441481
id: '0x38',
442482
token: 'BNB',
@@ -967,12 +1007,15 @@ type SetChainOptions = {
9671007
chainId: string // hex encoded string
9681008
chainNamespace?: 'evm' // defaults to 'evm' (currently the only valid value, but will add more in future updates)
9691009
wallet?: string // the wallet.label of the wallet to set chain
1010+
rpcUrl?: string // if chain was instantiated without rpcUrl, include here. Used for network requests
1011+
token?: string // if chain was instantiated without token, include here. Used for display, eg Ethereum Mainnet
1012+
label?: string // if chain was instantiated without label, include here. The native token symbol, eg ETH, BNB, MATIC
9701013
}
9711014

9721015
const success = await onboard.setChain({ chainId: '0x89' })
9731016
```
9741017

975-
The `setChain` methods takes an options object with a `chainId` property hex encoded string for the chain id to switch to. The chain id must be one of the chains that Onboard was initialized with. If the wallet supports programatically adding and switching the chain, then the user will be prompted to do so, if not, then a modal will be displayed indicating to the user that they need to switch chains to continue. The `setChain` method returns a promise that resolves when either the user has confirmed the chain switch, or has dismissed the modal and resolves with a boolean indicating if the switch network was successful or not. The `setChain` method will by default switch the first wallet (the most recently connected) in the `wallets` array. A specific wallet can be targeted by passing in the `wallet.label` in the options object as the `wallet` parameter.
1018+
The `setChain` methods takes an options object with a `chainId` property hex encoded string for the chain id to switch to. The chain id must be one of the chains that Onboard was initialized with. If the wallet supports programatically adding and switching the chain, then the user will be prompted to do so, if not, then a modal will be displayed indicating to the user that they need to switch chains to continue. The `setChain` method returns a promise that resolves when either the user has confirmed the chain switch, or has dismissed the modal and resolves with a boolean indicating if the switch network was successful or not. The `setChain` method will by default switch the first wallet (the most recently connected) in the `wallets` array. A specific wallet can be targeted by passing in the `wallet.label` in the options object as the `wallet` parameter. If a chain was instantiated without an rpcUrl, token, or label, add these options for wallets that require this information for adding a new chain.
9761019

9771020
## Custom Styling
9781021

@@ -1079,9 +1122,7 @@ The Onboard styles can be customized via [CSS variables](https://developer.mozil
10791122
--onboard-action-required-modal-background
10801123

10811124
/* FONTS */
1082-
--onboard-font-family-normal: Sofia Pro;
1083-
--onboard-font-family-semibold: Sofia Pro Semibold;
1084-
--onboard-font-family-light: Sofia Pro Light;
1125+
--onboard-font-family-normal: Inter, sans-serif;
10851126

10861127
--onboard-font-size-1: 3rem;
10871128
--onboard-font-size-2: 2.25rem;
@@ -1149,8 +1190,7 @@ The Onboard styles can be customized via [CSS variables](https://developer.mozil
11491190
--account-select-modal-danger-500: #ff4f4f;
11501191

11511192
/* FONTS */
1152-
--account-select-modal-font-family-normal: Sofia Pro;
1153-
--account-select-modal-font-family-light: Sofia Pro Light;
1193+
--account-select-modal-font-family-normal: Inter, sans-serif;
11541194
--account-select-modal-font-size-5: 1rem;
11551195
--account-select-modal-font-size-7: .75rem;
11561196
--account-select-modal-font-line-height-1: 24px;

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ setPrimaryWallet(wallets[1], wallets[1].accounts[2].address)
177177

178178
## `useSetChain`
179179

180-
This hook allows you to set the chain of a user's connected wallet, keep track of the current chain the user is connected to and the status of setting the chain. Passing in a wallet label will operate on that connected wallet, otherwise it will default to the last connected wallet.
180+
This hook allows you to set the chain of a user's connected wallet, keep track of the current chain the user is connected to and the status of setting the chain. Passing in a wallet label will operate on that connected wallet, otherwise it will default to the last connected wallet. If a chain was instantiated without an rpcUrl, token, or label, add these options for wallets that require this information for adding a new chain.
181181

182182
```typescript
183183
import { useSetChain } from '@web3-onboard/react'
@@ -196,7 +196,13 @@ type UseSetChain = (
196196
type SetChainOptions = {
197197
chainId: string
198198
chainNamespace?: string
199-
wallet?: WalletState['label']
199+
wallet?: WalletState['label'],
200+
// if chain was instantiated without rpcUrl, include here. Used for network requests
201+
rpcUrl?: string,
202+
// if chain was instantiated without token, include here. Used for display, eg Ethereum Mainnet
203+
label?: string,
204+
// if chain was instantiated without label, include here. The native token symbol, eg ETH, BNB, MATIC
205+
token?: string,
200206
}
201207

202208
const [

docs/src/routes/docs/[...4]wallets/magic.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ The Magic Wallet Login styles can customized via [CSS variables](https://develop
102102
--login-modal-danger-500: #ff4f4f;
103103

104104
/* FONTS */
105-
--login-modal-font-family-normal: Sofia Pro;
106-
--login-modal-font-family-light: Sofia Pro Light;
105+
--login-modal-font-family-normal: Inter, sans-serif;
107106
--login-modal-font-size-5: 1rem;
108107
--login-modal-font-line-height-1: 24px;
109108

0 commit comments

Comments
 (0)