Skip to content

Commit

Permalink
Merge pull request #1658 from blocknative/release/2.21.3
Browse files Browse the repository at this point in the history
Release 2.21.3 (docs)
  • Loading branch information
Adamj1232 authored Apr 21, 2023
2 parents 1912931 + c82af09 commit 56be08e
Show file tree
Hide file tree
Showing 65 changed files with 4,948 additions and 2,348 deletions.
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.
8 changes: 4 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@
"type": "module",
"dependencies": {
"@web3-onboard/coinbase": "^2.2.2",
"@web3-onboard/core": "^2.16.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.4",
"@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",
Expand All @@ -75,10 +75,10 @@
"@web3-onboard/taho": "^2.0.2",
"@web3-onboard/torus": "^2.2.3",
"@web3-onboard/transaction-preview": "^2.0.6",
"@web3-onboard/trezor": "^2.3.5",
"@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.5",
"@web3-onboard/walletconnect": "^2.3.6-alpha.1",
"@web3-onboard/web3auth": "^2.2.1",
"@web3-onboard/xdefi": "^2.0.2",
"animejs": "^3.2.1",
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

1 comment on commit 56be08e

@vercel
Copy link

@vercel vercel bot commented on 56be08e Apr 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.