Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9d3e748
Merge pull request #1635 from blocknative/release/2.21.2
Adamj1232 Apr 7, 2023
fee57d5
Bump docs packages
Adamj1232 Apr 7, 2023
1912931
Merge pull request #1637 from blocknative/release/2.21.2
Adamj1232 Apr 7, 2023
02a5171
feat: add safeheron
Apr 13, 2023
039edf1
Merge pull request #1639 from beilunyang/feat/safeheron
Adamj1232 Apr 14, 2023
119e105
Enhancement: Vanilla js example (#1643)
leightkt Apr 17, 2023
804a0e8
Fix: WalletConnect v1 Switch Accounts and bump V2 package support (#1…
Adamj1232 Apr 18, 2023
6190df2
update dev dependency install instructions for vite (#1646)
leightkt Apr 18, 2023
cf6f9e7
Fix: WC build (#1647)
Adamj1232 Apr 18, 2023
8fe8450
Fix: Pin WC dep versions (#1648)
Adamj1232 Apr 18, 2023
c3e10b0
Enhancement: Remove built in UnstoppableDomain resolution, create `un…
Adamj1232 Apr 18, 2023
b95b53c
Update to the latest Trezor package deps (#1653)
Adamj1232 Apr 20, 2023
1ecdb81
Update package versions for release
Adamj1232 Apr 20, 2023
a6b90fd
Merge branch 'main' into release/2.21.3
Adamj1232 Apr 20, 2023
2cab2f5
Update examples and docs versions
Adamj1232 Apr 20, 2023
c6dec15
Remove optional chain in trezor
Adamj1232 Apr 20, 2023
36a0522
fix getServerSnapshot call (#1655)
leightkt Apr 20, 2023
6aec2c1
merge develop
leightkt Apr 20, 2023
749d980
add safeheron to injected package readme
leightkt Apr 20, 2023
0cf6946
add wallet as value to translate function in more areas of connect
leightkt Apr 21, 2023
45815fa
package updates
leightkt Apr 21, 2023
f6904cf
add images
leightkt Apr 21, 2023
c9c62b4
text update
leightkt Apr 21, 2023
5f077c7
Update packages/react/package.json
leightkt Apr 21, 2023
ee7b664
Update packages/vue/package.json
leightkt Apr 21, 2023
30cafe9
add screenshots to top level assets folder
leightkt Apr 21, 2023
45c4a98
update react pkg
leightkt Apr 21, 2023
76f00c1
Enhancement: Pass Wallet to More Translate Functions in Connect Inter…
leightkt Apr 21, 2023
94ee6b6
fix merge conflicts with update-connection-language-with-wallet
leightkt Apr 21, 2023
c885546
merge develop
leightkt Apr 21, 2023
0be5169
fix merge conflict in react pkg
leightkt Apr 21, 2023
c82af09
fix vue pkg
leightkt Apr 21, 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
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/taho
steps:
- node-build-steps
build-unstoppable-resolution:
docker:
- image: cimg/node:16.13.1
working_directory: ~/web3-onboard-monorepo/packages/unstoppable-resolution
steps:
- node-build-steps

# Build staging/Alpha releases
build-staging-core:
Expand Down Expand Up @@ -587,6 +593,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/taho
steps:
- node-staging-build-steps
build-staging-unstoppable-resolution:
docker:
- image: cimg/node:16.13.1
working_directory: ~/web3-onboard-monorepo/packages/unstoppable-resolution
steps:
- node-staging-build-steps

workflows:
version: 2
Expand Down Expand Up @@ -801,3 +813,9 @@ workflows:
<<: *deploy_production_filters
- build-staging-taho:
<<: *deploy_staging_filters
unstoppable-resolution:
jobs:
- build-unstoppable-resolution:
<<: *deploy_production_filters
- build-staging-unstoppable-resolution:
<<: *deploy_staging_filters
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/BUG.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Bug Report
description: File a bug report
title: '[Bug]: '
labels: [bug]
assignees:
- taylorjdawson
Expand Down
Binary file added assets/custom-connect-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/custom-connect-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/custom-connect-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 27 additions & 26 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check --plugin-search-dir=. . && eslint .",
"format": "prettier --write --plugin-search-dir=. .",
"update-w3o-to-prod": "yarn add '@web3-onboard/coinbase@next' '@web3-onboard/core@next' '@web3-onboard/dcent@next' '@web3-onboard/enkrypt@next' '@web3-onboard/fortmatic@next' '@web3-onboard/gas@next' '@web3-onboard/gnosis@next' '@web3-onboard/infinity-wallet@next' '@web3-onboard/injected-wallets@next' '@web3-onboard/keepkey@next' '@web3-onboard/keystone@next' '@web3-onboard/ledger@next' '@web3-onboard/magic@next' '@web3-onboard/mew-wallet@next' '@web3-onboard/portis@next' '@web3-onboard/sequence@next' '@web3-onboard/taho@next' '@web3-onboard/torus@next' '@web3-onboard/transaction-preview@next' '@web3-onboard/trezor@next' '@web3-onboard/trust@next' '@web3-onboard/uauth@next' '@web3-onboard/walletconnect@next' '@web3-onboard/web3auth@next' '@web3-onboard/xdefi@next'"
"w3o-latest-prod": "yarn add '@web3-onboard/coinbase' '@web3-onboard/core' '@web3-onboard/dcent' '@web3-onboard/enkrypt' '@web3-onboard/fortmatic' '@web3-onboard/gas' '@web3-onboard/gnosis' '@web3-onboard/infinity-wallet' '@web3-onboard/injected-wallets' '@web3-onboard/keepkey' '@web3-onboard/keystone' '@web3-onboard/ledger' '@web3-onboard/magic' '@web3-onboard/mew-wallet' '@web3-onboard/portis' '@web3-onboard/sequence' '@web3-onboard/taho' '@web3-onboard/torus' '@web3-onboard/transaction-preview' '@web3-onboard/trezor' '@web3-onboard/trust' '@web3-onboard/uauth' '@web3-onboard/walletconnect' '@web3-onboard/web3auth' '@web3-onboard/xdefi'",
"w3o-latest-alpha": "yarn add '@web3-onboard/coinbase@next' '@web3-onboard/core@next' '@web3-onboard/dcent@next' '@web3-onboard/enkrypt@next' '@web3-onboard/fortmatic@next' '@web3-onboard/gas@next' '@web3-onboard/gnosis@next' '@web3-onboard/infinity-wallet@next' '@web3-onboard/injected-wallets@next' '@web3-onboard/keepkey@next' '@web3-onboard/keystone@next' '@web3-onboard/ledger@next' '@web3-onboard/magic@next' '@web3-onboard/mew-wallet@next' '@web3-onboard/portis@next' '@web3-onboard/sequence@next' '@web3-onboard/taho@next' '@web3-onboard/torus@next' '@web3-onboard/transaction-preview@next' '@web3-onboard/trezor@next' '@web3-onboard/trust@next' '@web3-onboard/uauth@next' '@web3-onboard/walletconnect@next' '@web3-onboard/web3auth@next' '@web3-onboard/xdefi@next'"
},
"devDependencies": {
"@algolia/client-search": "^4.14.2",
Expand Down Expand Up @@ -55,31 +56,31 @@
},
"type": "module",
"dependencies": {
"@web3-onboard/coinbase": "^2.2.2-alpha.1",
"@web3-onboard/core": "^2.16.2-alpha.2",
"@web3-onboard/dcent": "^2.2.5-alpha.1",
"@web3-onboard/enkrypt": "^2.0.2-alpha.1",
"@web3-onboard/fortmatic": "^2.0.17-alpha.1",
"@web3-onboard/gas": "^2.1.6-alpha.1",
"@web3-onboard/gnosis": "^2.1.8-alpha.1",
"@web3-onboard/infinity-wallet": "^2.0.2-alpha.1",
"@web3-onboard/injected-wallets": "^2.8.4-alpha.1",
"@web3-onboard/keepkey": "^2.3.5-alpha.1",
"@web3-onboard/keystone": "^2.3.5-alpha.1",
"@web3-onboard/ledger": "^2.4.4-alpha.1",
"@web3-onboard/magic": "^2.1.5-alpha.1",
"@web3-onboard/mew-wallet": "^2.0.2-alpha.1",
"@web3-onboard/portis": "^2.1.5-alpha.1",
"@web3-onboard/sequence": "^2.0.6-alpha.1",
"@web3-onboard/taho": "^2.0.2-alpha.1",
"@web3-onboard/torus": "^2.2.3-alpha.1",
"@web3-onboard/transaction-preview": "^2.0.6-alpha.1",
"@web3-onboard/trezor": "^2.3.5-alpha.1",
"@web3-onboard/trust": "^2.0.2-alpha.1",
"@web3-onboard/uauth": "^2.0.3-alpha.1",
"@web3-onboard/walletconnect": "^2.3.5-alpha.1",
"@web3-onboard/web3auth": "^2.2.1-alpha.1",
"@web3-onboard/xdefi": "^2.0.2-alpha.1",
"@web3-onboard/coinbase": "^2.2.2",
"@web3-onboard/core": "^2.17.0-alpha.1",
"@web3-onboard/dcent": "^2.2.5",
"@web3-onboard/enkrypt": "^2.0.2",
"@web3-onboard/fortmatic": "^2.0.17",
"@web3-onboard/gas": "^2.1.6",
"@web3-onboard/gnosis": "^2.1.8",
"@web3-onboard/infinity-wallet": "^2.0.2",
"@web3-onboard/injected-wallets": "^2.8.5-alpha.1",
"@web3-onboard/keepkey": "^2.3.5",
"@web3-onboard/keystone": "^2.3.5",
"@web3-onboard/ledger": "^2.4.4",
"@web3-onboard/magic": "^2.1.5",
"@web3-onboard/mew-wallet": "^2.0.2",
"@web3-onboard/portis": "^2.1.5",
"@web3-onboard/sequence": "^2.0.6",
"@web3-onboard/taho": "^2.0.2",
"@web3-onboard/torus": "^2.2.3",
"@web3-onboard/transaction-preview": "^2.0.6",
"@web3-onboard/trezor": "^2.4.0-alpha.1",
"@web3-onboard/trust": "^2.0.2",
"@web3-onboard/uauth": "^2.0.3",
"@web3-onboard/walletconnect": "^2.3.6-alpha.1",
"@web3-onboard/web3auth": "^2.2.1",
"@web3-onboard/xdefi": "^2.0.2",
"animejs": "^3.2.1",
"bnc-sdk": "^4.6.6",
"ethers": "^5.7.0"
Expand Down
Binary file added docs/src/lib/assets/custom-connect-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/lib/assets/custom-connect-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/lib/assets/custom-connect-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 42 additions & 14 deletions docs/src/routes/docs/[...3]modules/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import notifyCustomImg from '$lib/assets/notify-custom-example.png'
import notifyImg from '$lib/assets/notify-example.png'
import notifyPreflightImg from '$lib/assets/notify-preflight-example.png'
import customConnect1 from '$lib/assets/custom-connect-1.png'
import customConnect2 from '$lib/assets/custom-connect-2.png'
import customConnectDefault from '$lib/assets/custom-connect-default.png'
</script>

# Core
Expand Down Expand Up @@ -229,11 +232,10 @@ type ConnectModalOptions = {
*/
wheresMyWalletLink?: string
/**
* Define support for Unstoppable Domains resolutions
* after a user connects. Similar to ens, uns can be used for users who
* have minted an Unstoppable Domain and associated it with their wallet.
* ENS resolution takes precedent over UNS
* Defaults to false
* @deprecated Has no effect unless `@web3-onboard/unstoppable-resolution`
* package has been added and passed into the web3-onboard initialization
* In this case remove the `@web3-onboard/unstoppable-resolution` package
* to remove unstoppableDomain resolution support
*/
disableUDResolution?: boolean
}
Expand All @@ -253,6 +255,29 @@ type i18nOptions = Record<Locale, i18n>
To see a list of all of the text values that can be internationalized or replaced, check out the [default en file](https://github.com/blocknative/web3-onboard/blob/develop/packages/core/src/i18n/en.json).
Onboard is using the [ICU syntax](https://formatjs.io/docs/core-concepts/icu-syntax/) for formatting under the hood.

For example, to update the connect interface language for Metamask, while giving a different message for other wallets, you can include the following:

```typescript
i18n: {
en: {
connect: {
connectingWallet: {
paragraph: "{wallet, select, MetaMask {{wallet} can only present one account, so connect just the one account you want.} other {Please connect to all of your accounts in {wallet}.}}"
}
}
}
}
```

MetaMask message:
<img src="{customConnect2}" alt="Web3-Onboard connect wallet modal with custom message"/>

All other wallets:
<img src="{customConnect1}" alt="Web3-Onboard connect wallet modal with custom message"/>

Default Message- with no i18n override:
<img src="{customConnectDefault}" alt="Web3-Onboard connect wallet modal with default message"/>

---

#### theme
Expand Down Expand Up @@ -429,7 +454,8 @@ unsubscribe()
```

##### **Notifications as Toast Messages**
The Notifications messages can also be used to send fully customized Dapp toast messages and updated. Check out the [customNotifications API docs for examples and code snippets](#customnotification)

The Notifications messages can also be used to send fully customized Dapp toast messages and updated. Check out the [customNotifications API docs for examples and code snippets](#customnotification)

```ts
type NotifyOptions = {
Expand Down Expand Up @@ -640,6 +666,7 @@ const onboard = Onboard({
```

---

## Connecting a Wallet

To initiate a user to select and connect a wallet you can call the `connectWallet` function on an initialized Onboard instance. It will return a `Promise` that will resolve when the user either successfully connects a wallet, or when they dismiss the UI. The resolved value from the promise will be the latest state of the `wallets` array. The order of the wallets array is last to first, so the most recently selected wallet will be the first item in the array and can be thought of as the "primary wallet". If no wallet was selected, then the `wallets` array will have the same state as it had before calling `connectWallet`.
Expand Down Expand Up @@ -1016,7 +1043,7 @@ The `customNotification` method also returns a `dismiss` method that is called w

#### **preflightNotifications**

Notify can be used to deliver standard notifications along with preflight updates by passing a `PreflightNotificationsOptions` object to the `preflightNotifications` API action.
Notify can be used to deliver standard notifications along with preflight updates by passing a `PreflightNotificationsOptions` object to the `preflightNotifications` API action.

<img src="{notifyPreflightImg}" alt="Preflight notifications image"/>

Expand All @@ -1033,6 +1060,7 @@ Preflight event types include:
This API call will return a promise that resolves to the transaction hash (if `sendTransaction` resolves the transaction hash and is successful), the internal notification id (if no `sendTransaction` function is provided) or return nothing if an error occurs or `sendTransaction` is not provided or doesn't resolve to a string.

Example:

```typescript copy
const balanceValue = Object.values(balance)[0]
// if using ethers v6 this is:
Expand Down Expand Up @@ -1483,7 +1511,7 @@ module.exports = function override(config) {

Add the following dev dependencies:

`yarn add rollup-plugin-polyfill-node -D`
`yarn add rollup-plugin-polyfill-node crypto-browserify stream-browserify assert -D`

Then add the following to your `svelte.config.js` file:

Expand Down Expand Up @@ -1544,11 +1572,11 @@ export default config

### SvelteKit + Vite

Checkout a boilerplate example (here)[https://github.com/blocknative/web3-onboard/tree/develop/examples/with-sveltekit]
Checkout a boilerplate example [here](https://github.com/blocknative/web3-onboard/tree/develop/examples/with-sveltekit)

Add the following dev dependencies:

`yarn add rollup-plugin-polyfill-node -D`
`yarn add rollup-plugin-polyfill-node crypto-browserify stream-browserify assert -D`

Then add the following to your `svelte.config.js` file:

Expand Down Expand Up @@ -1657,11 +1685,11 @@ See [this github issue](https://github.com/blocknative/web3-onboard/issues/1568#

### Vite

Checkout a boilerplate example for Vite-React (here)[https://github.com/blocknative/web3-onboard/tree/develop/examples/with-vite-react]
Checkout a boilerplate example for Vite-React [here](https://github.com/blocknative/web3-onboard/tree/develop/examples/with-vite-react)

Add the following dev dependencies:

`npm i --save-dev rollup-plugin-polyfill-node`
`npm i --save-dev rollup-plugin-polyfill-node crypto-browserify stream-browserify assert`

Then add the following to your `vite.config.js` file:

Expand Down Expand Up @@ -1732,9 +1760,9 @@ build: {

### Next.js

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

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

:::admonition type=note

Expand Down
2 changes: 1 addition & 1 deletion docs/src/routes/docs/[...3]modules/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ module.exports = function override(config) {

Add the following dev dependencies:

`npm i --save-dev rollup-plugin-polyfill-node`
`npm i --save-dev rollup-plugin-polyfill-node crypto-browserify stream-browserify assert`

Then add the following to your `vite.config.js` file:

Expand Down
38 changes: 38 additions & 0 deletions docs/src/routes/docs/[...3]modules/unstoppable-resolution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Unstoppable Domains Resolution

A module to add Unstoppable Domain resolution to web3-onboard.

### Install

<Tabs values={['yarn', 'npm']}>
<TabPanel value="yarn">

```sh copy
yarn add @web3-onboard/unstoppable-resolution
```

</TabPanel>
<TabPanel value="npm">

```sh copy
npm install @web3-onboard/unstoppable-resolution
```

</TabPanel>
</Tabs>

### Standalone Setup

```typescript
import Onboard from '@web3-onboard/core'
import unstoppableResolution from '@web3-onboard/unstoppable-resolution'

const onboard = Onboard({
// ... other Onboard options
unstoppableResolution
})
```

## Build Environments

For build env configurations and setups please see the Build Env section [here](/docs/modules/core#build-environments)
2 changes: 1 addition & 1 deletion docs/src/routes/docs/[...3]modules/vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ module.exports = {

Add the following dev dependencies:

`npm i --save-dev rollup-plugin-polyfill-node`
`npm i --save-dev rollup-plugin-polyfill-node crypto-browserify stream-browserify assert`

Then add the following to your `vite.config.js` file:

Expand Down
1 change: 1 addition & 0 deletions docs/src/routes/docs/[...4]wallets/injected.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ const injected = injectedModule({
- DeFiWallet - _Desktop & Mobile_
- ApexWallet - _Desktop_
- BifrostWallet - _Desktop & Mobile_
- Safeheron - _Desktop_

## Build Environments

Expand Down
Loading