Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.21.0 #1606

Merged
merged 26 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5dcf0c9
Merge pull request #1582 from blocknative/release/2.20.5
Adamj1232 Mar 14, 2023
1a7d7be
Yarn the docs
Adamj1232 Mar 14, 2023
1af47d4
Merge pull request #1584 from blocknative/release/2.20.5
Adamj1232 Mar 15, 2023
70cb1d9
Bump @sideway/formula from 3.0.0 to 3.0.1 in /examples/with-ledger (#…
dependabot[bot] Mar 15, 2023
ccbd68b
Bump @sideway/formula from 3.0.0 to 3.0.1 in /examples/with-vuejs (#1…
dependabot[bot] Mar 15, 2023
3bf1c02
Bump @sideway/formula from 3.0.0 to 3.0.1 in /examples/with-sveltekit…
dependabot[bot] Mar 15, 2023
21eb35d
Bump @sideway/formula from 3.0.0 to 3.0.1 in /docs (#1577)
dependabot[bot] Mar 15, 2023
705624b
Bump @sideway/formula from 3.0.0 to 3.0.1 in /examples/with-vite-reac…
dependabot[bot] Mar 15, 2023
932ff65
Bump @sideway/formula from 3.0.0 to 3.0.1 in /packages/demo (#1579)
dependabot[bot] Mar 15, 2023
f1d4a57
Bump webpack from 5.69.1 to 5.76.0 (#1588)
dependabot[bot] Mar 15, 2023
6c0adae
Fix doc prop name for connect property
Adamj1232 Mar 15, 2023
b372933
Fix issue
Adamj1232 Mar 15, 2023
9e9696f
Bump webpack from 5.75.0 to 5.76.0 in /packages/demo (#1591)
dependabot[bot] Mar 15, 2023
3ef0fa8
stop calling selectAccounts when switching already connected wallet a…
leightkt Mar 16, 2023
0600dd8
fix: typo, missing inject fn (#1596)
gokhantaskan Mar 17, 2023
7d14b34
[common, core] Update: allow instantiation with only chain id (#1589)
leightkt Mar 20, 2023
2008934
Bump @sideway/formula from 3.0.0 to 3.0.1 (#1592)
dependabot[bot] Mar 22, 2023
55fdde1
[web3Auth]: Update - Latest dep versions and options (#1599)
Adamj1232 Mar 22, 2023
ef3970c
[core, react, vue]: Enhancement - Add Sepolia testnet (#1604)
Adamj1232 Mar 23, 2023
494dd26
[core, react, vue]: Feature - Connect all previously connected wallet…
Adamj1232 Mar 24, 2023
e760d2b
Feature - New Font Usage (Inter) and Dynamic Font Handling (#1597)
Adamj1232 Mar 24, 2023
adaab38
Remove alpha flags and bump version
Adamj1232 Mar 24, 2023
29d3fd3
Bump docs packages for release
Adamj1232 Mar 24, 2023
fc64dc5
Merge branch 'main' into release/2.21.0
Adamj1232 Mar 24, 2023
edd0720
Fix Infinity Wallet Bug on Docs Build (#1601)
leightkt Mar 28, 2023
5ce8927
Merge branch 'develop' into release/2.21.0
Adamj1232 Mar 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,33 @@
},
"type": "module",
"dependencies": {
"bnc-sdk": "^4.6.6",
"@web3-onboard/coinbase": "^2.1.4",
"@web3-onboard/core": "^2.15.5",
"@web3-onboard/dcent": "^2.2.3",
"@web3-onboard/enkrypt": "^2.0.0",
"@web3-onboard/fortmatic": "^2.0.14",
"@web3-onboard/gas": "^2.1.4",
"@web3-onboard/gnosis": "^2.1.6",
"@web3-onboard/infinity-wallet": "^2.0.0",
"@web3-onboard/injected-wallets": "^2.8.1",
"@web3-onboard/keepkey": "^2.3.3",
"@web3-onboard/keystone": "^2.3.3",
"@web3-onboard/ledger": "^2.4.2",
"@web3-onboard/magic": "^2.1.3",
"@web3-onboard/mew-wallet": "^2.0.0",
"@web3-onboard/portis": "^2.1.3",
"@web3-onboard/sequence": "^2.0.4",
"@web3-onboard/taho": "^2.0.0",
"@web3-onboard/torus": "^2.2.0",
"@web3-onboard/transaction-preview": "^2.0.4",
"@web3-onboard/trezor": "^2.3.3",
"@web3-onboard/trust": "^2.0.0",
"@web3-onboard/uauth": "^2.0.1",
"@web3-onboard/walletconnect": "^2.3.2",
"@web3-onboard/web3auth": "^2.1.4",
"@web3-onboard/xdefi": "^2.0.0",
"@web3-onboard/coinbase": "^2.2.1",
"@web3-onboard/core": "^2.16.0",
"@web3-onboard/dcent": "^2.2.4",
"@web3-onboard/enkrypt": "^2.0.1",
"@web3-onboard/fortmatic": "^2.0.16",
"@web3-onboard/gas": "^2.1.5",
"@web3-onboard/gnosis": "^2.1.7",
"@web3-onboard/infinity-wallet": "^2.0.1",
"@web3-onboard/injected-wallets": "^2.8.3",
"@web3-onboard/keepkey": "^2.3.4",
"@web3-onboard/keystone": "^2.3.4",
"@web3-onboard/ledger": "^2.4.3",
"@web3-onboard/magic": "^2.1.4",
"@web3-onboard/mew-wallet": "^2.0.1",
"@web3-onboard/portis": "^2.1.4",
"@web3-onboard/sequence": "^2.0.5",
"@web3-onboard/taho": "^2.0.1",
"@web3-onboard/torus": "^2.2.2",
"@web3-onboard/transaction-preview": "^2.0.5",
"@web3-onboard/trezor": "^2.3.4",
"@web3-onboard/trust": "^2.0.1",
"@web3-onboard/uauth": "^2.0.2",
"@web3-onboard/walletconnect": "^2.3.3",
"@web3-onboard/web3auth": "^2.2.0",
"@web3-onboard/xdefi": "^2.0.1",
"animejs": "^3.2.1",
"bnc-sdk": "^4.6.6",
"ethers": "^5.7.0"
}
}
12 changes: 8 additions & 4 deletions docs/src/lib/components/ThemeCustomizer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -81,31 +81,35 @@
'--w3o-text-color': 'unset',
'--w3o-border-color': 'unset',
'--w3o-action-color': 'unset',
'--w3o-border-radius': 'unset'
'--w3o-border-radius': 'unset',
'--w3o-font-family': 'unset'
},
custom: {
'--w3o-background-color': 'unset',
'--w3o-foreground-color': 'unset',
'--w3o-text-color': 'unset',
'--w3o-border-color': 'unset',
'--w3o-action-color': 'unset',
'--w3o-border-radius': 'unset'
'--w3o-border-radius': 'unset',
'--w3o-font-family': 'unset'
},
light: {
'--w3o-background-color': '#ffffff',
'--w3o-foreground-color': '#EFF1FC',
'--w3o-text-color': '#1a1d26',
'--w3o-border-color': '#d0d4f7',
'--w3o-action-color': '#6370E5',
'--w3o-border-radius': '16px'
'--w3o-border-radius': '16px',
'--w3o-font-family': 'unset'
},
dark: {
'--w3o-background-color': '#1A1D26',
'--w3o-foreground-color': '#242835',
'--w3o-text-color': '#EFF1FC',
'--w3o-border-color': '#33394B',
'--w3o-action-color': '#929bed',
'--w3o-border-radius': '16px'
'--w3o-border-radius': '16px',
'--w3o-font-family': 'unset'
}
}

Expand Down
6 changes: 6 additions & 0 deletions docs/src/lib/services/onboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ const intiOnboard = async (theme) => {
label: 'Goerli',
rpcUrl: `https://goerli.infura.io/v3/${INFURA_ID}`
},
{
id: 11155111,
token: 'ETH',
label: 'Sepolia',
rpcUrl: 'https://rpc.sepolia.org/'
},
{
id: '0x13881',
token: 'MATIC',
Expand Down
6 changes: 5 additions & 1 deletion docs/src/routes/docs/[...1]overview/[...1]introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ Web3-Onboard is the quickest and easiest way to add multi-wallet and multi-chain

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).

- Ethereum
- Arbitrum
- Optimism
- Avalanche
- BNB Chain
- Celo
Expand All @@ -44,8 +46,10 @@ web3-onboard supports all EVM networks. Supporting a new network is simply a mat
- Gnosis Chain
- Harmony One
- Moonriver
- Optimism
- Polygon
- Goerli
- Sepolia
- Core Goerli
- Any other EVM network

### [Optional] Use an API key to fetch real time transaction data, balances & gas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ The Onboard styles can customized via [CSS custom properties](https://developer.
--onboard-action-required-modal-background

/* FONTS */
--onboard-font-family-normal: Sofia Pro;
--onboard-font-family-semibold: Sofia Pro Semibold;
--onboard-font-family-light: Sofia Pro Light;
--onboard-font-family-normal: Inter, sans-serif;

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

/* FONTS */
--account-select-modal-font-family-normal: Sofia Pro;
--account-select-modal-font-family-light: Sofia Pro Light;
--account-select-modal-font-family-normal: Inter, sans-serif;
--account-select-modal-font-size-5: 1rem;
--account-select-modal-font-size-7: .75rem;
--account-select-modal-font-line-height-1: 24px;
Expand Down
74 changes: 57 additions & 17 deletions docs/src/routes/docs/[...3]modules/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ npm install @web3-onboard/core
</Tabs>

#### All Wallet Modules

If you would like to support all wallets, then you can install all of the wallet modules:

<Tabs values={['yarn', 'npm']}>
Expand Down Expand Up @@ -89,19 +90,28 @@ type InitOptions {
* 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.
*/
containerElements?: Partial<ContainerElements>
/**
/**
* Custom or predefined theme for Web3Onboard i.e. default, dark, Custom, etc.
*/
theme?: Theme
/**
* Defaults to False
* If set to true the Inter font will not be imported and
* instead the default 'sans-serif' font will be used
* To define the font used see `--w3o-font-family` prop within
* the Theme initialization object or set as css variable
*/
disableFontDownload?: boolean
}

```

---

#### wallets

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

---
Expand All @@ -114,9 +124,11 @@ An array of Chains that your app supports:
type Chain = {
id: ChainId // hex encoded string, eg '0x1' for Ethereum Mainnet
namespace?: 'evm' // string indicating chain namespace. Defaults to 'evm' but will allow other chain namespaces in the future
rpcUrl: string // used for network requests
label: string // used for display, eg Ethereum Mainnet
token: TokenSymbol // the native token symbol, eg ETH, BNB, MATIC
// PLEASE NOTE: Some wallets require an rpcUrl, label, and token for actions such as adding a new chain.
// It is recommended to include rpcUrl, label, and token for full functionality.
rpcUrl?: string // Recommended to include. Used for network requests.
label?: string // Recommended to include. Used for display, eg Ethereum Mainnet.
token?: TokenSymbol // Recommended to include. The native token symbol, eg ETH, BNB, MATIC.
color?: string // the color used to represent the chain and will be used as a background for the icon
icon?: string // the icon to represent the chain
publicRpcUrl?: string // an optional public RPC used when adding a new chain config to the wallet
Expand Down Expand Up @@ -171,26 +183,36 @@ type RecommendedInjectedWallets = {

---

#### connectModal
#### connect

An object that allows for customizing the connect modal layout and behavior

<img src="{walletModal}" alt="Web3-Onboard connect wallet modal"/>

```typescript copy
type ConnectModalOptions = {
/**
* Display the connect modal sidebar - only applies to desktop views
*/
showSidebar?: boolean
/**
* Disabled close of the connect modal with background click and
* hides the close button forcing an action from the connect modal
* Defaults to false
*/
disableClose?: boolean
/**If set to true, the last connected wallet will store in local storage.
* Then on init, onboard will try to reconnect to that wallet with
* no modals displayed
/**
* If set to true, the most recently connected wallet will store in
* local storage. Then on init, onboard will try to reconnect to
* that wallet with no modals displayed
*/
autoConnectLastWallet?: boolean
/**
* If set to true, all previously connected wallets will store in
* local storage. Then on init, onboard will try to reconnect to
* each wallet with no modals displayed
*/
autoConnectLastWallet?: boolean // defaults to false
autoConnectAllPreviousWallet?: boolean
/**
* Customize the link for the `I don't have a wallet` flow shown on the
* select wallet modal.
Expand Down Expand Up @@ -250,6 +272,7 @@ export type BuiltInThemes = 'default' | 'dark' | 'light'

export type ThemingMap = {
'--w3o-background-color'?: string
'--w3o-font-family'?: string
'--w3o-foreground-color'?: string
'--w3o-text-color'?: string
'--w3o-border-color'?: string
Expand All @@ -268,6 +291,17 @@ It will allow you to customize the look and feel of web3-onboard, try different

---

#### disableFontDownload

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.
To define the font use `--w3o-font-family` prop within the `Theme` initialization object or set as a css variable.

```typescript
type disableFontDownload = boolean // defaults to false
```

---

#### accountCenter

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.
Expand Down Expand Up @@ -437,6 +471,12 @@ const onboard = Onboard({
label: 'Goerli',
rpcUrl: `https://goerli.infura.io/v3/${INFURA_ID}`
},
{
id: 11155111,
token: 'ETH',
label: 'Sepolia',
rpcUrl: 'https://rpc.sepolia.org/'
},
{
id: '0x38',
token: 'BNB',
Expand Down Expand Up @@ -967,12 +1007,15 @@ type SetChainOptions = {
chainId: string // hex encoded string
chainNamespace?: 'evm' // defaults to 'evm' (currently the only valid value, but will add more in future updates)
wallet?: string // the wallet.label of the wallet to set chain
rpcUrl?: string // if chain was instantiated without rpcUrl, include here. Used for network requests
token?: string // if chain was instantiated without token, include here. Used for display, eg Ethereum Mainnet
label?: string // if chain was instantiated without label, include here. The native token symbol, eg ETH, BNB, MATIC
}

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

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.
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.

## Custom Styling

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

/* FONTS */
--onboard-font-family-normal: Sofia Pro;
--onboard-font-family-semibold: Sofia Pro Semibold;
--onboard-font-family-light: Sofia Pro Light;
--onboard-font-family-normal: Inter, sans-serif;

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

/* FONTS */
--account-select-modal-font-family-normal: Sofia Pro;
--account-select-modal-font-family-light: Sofia Pro Light;
--account-select-modal-font-family-normal: Inter, sans-serif;
--account-select-modal-font-size-5: 1rem;
--account-select-modal-font-size-7: .75rem;
--account-select-modal-font-line-height-1: 24px;
Expand Down
10 changes: 8 additions & 2 deletions docs/src/routes/docs/[...3]modules/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ setPrimaryWallet(wallets[1], wallets[1].accounts[2].address)

## `useSetChain`

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.
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.

```typescript
import { useSetChain } from '@web3-onboard/react'
Expand All @@ -196,7 +196,13 @@ type UseSetChain = (
type SetChainOptions = {
chainId: string
chainNamespace?: string
wallet?: WalletState['label']
wallet?: WalletState['label'],
// if chain was instantiated without rpcUrl, include here. Used for network requests
rpcUrl?: string,
// if chain was instantiated without token, include here. Used for display, eg Ethereum Mainnet
label?: string,
// if chain was instantiated without label, include here. The native token symbol, eg ETH, BNB, MATIC
token?: string,
}

const [
Expand Down
3 changes: 1 addition & 2 deletions docs/src/routes/docs/[...4]wallets/magic.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ The Magic Wallet Login styles can customized via [CSS variables](https://develop
--login-modal-danger-500: #ff4f4f;

/* FONTS */
--login-modal-font-family-normal: Sofia Pro;
--login-modal-font-family-light: Sofia Pro Light;
--login-modal-font-family-normal: Inter, sans-serif;
--login-modal-font-size-5: 1rem;
--login-modal-font-line-height-1: 24px;

Expand Down
Loading