Skip to content

Commit c47f6a8

Browse files
authored
Merge pull request #1503 from blocknative/update/consolidate-branches
Update branch paths and targets for `develop`, `main` and `docs` branches - (main)
2 parents db05333 + 195b306 commit c47f6a8

File tree

17 files changed

+55
-107
lines changed

17 files changed

+55
-107
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ aliases:
1818
- &deploy_production_filters
1919
filters:
2020
branches:
21-
only: v2-web3-onboard
21+
only: main
2222

2323
- &deploy_staging_filters
2424
filters:
2525
branches:
26-
only: v2-web3-onboard-develop
26+
only: develop
2727

2828
- &test_package_version_for_alpha_tag_break_false
2929
run:

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Deploy documentation to Pages
44
on:
55
# Runs on pushes targeting the default branch
66
push:
7-
branches: ["docs-main"]
7+
branches: ["docs"]
88

99
# Allows you to run this workflow manually from the Actions tab
1010
workflow_dispatch:

.github/workflows/pr-status-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
workflow_dispatch:
66
pull_request:
77
branches:
8-
- v2-web3-onboard-develop
8+
- develop
99

1010
jobs:
1111
checks:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ If you would like to test out the current functionality of V2 in a small browser
121121

122122
- Clone the repo: `git clone git@github.com:blocknative/onboard.git`
123123
- Change in to the onboard directory: `cd onboard`
124-
- Checkout the V2 feature branch: `git checkout v2-web3-onboard`
124+
- Checkout the V2 feature branch: `git checkout main`
125125
- Install the dependencies: `yarn` (if running a M1 mac - `yarn install-m1-mac`)
126126
- Run all packages in dev mode: `yarn dev`
127127
- To view the demo app in the browser after running the above steps navigate to [http://localhost:8080](http://localhost:8080)

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ Run `yarn build` and confirm no errors present from the proposed changes.
2222

2323
Confirm vercel build within PR builds without error and check instance deployment for accuracy.
2424

25-
PR should target branch the main develop branch - [v2-web3-onboard-develop](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard-develop).
25+
PR should target branch the main develop branch - [develop](https://github.com/blocknative/web3-onboard/tree/develop).

docs/src/lib/components/ConnectWalletButton.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@
1919
2020
onMount(async () => {
2121
if (!onboard) {
22-
onboard = await getOnboard()
22+
if (document.location.href.includes('theming-tool')) {
23+
onboard = await getOnboard('default')
24+
} else {
25+
onboard = await getOnboard('system')
26+
}
2327
}
24-
const sub = onboard.state.select('wallets').subscribe((wallets) => {
28+
onboard.state.select('wallets').subscribe((wallets) => {
2529
connectedWallets = wallets
2630
buttonText = wallets.length ? 'Disconnect' : (buttonText = 'Connect')
2731
})

docs/src/lib/components/Footer.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
let text = {
1313
license: 'Released under the MIT License.',
14-
copyright: '© 2022 Blocknative. All Rights Reserved.'
14+
copyright: '© 2023 Blocknative. All Rights Reserved.'
1515
}
1616
</script>
1717

docs/src/lib/components/ThemeCustomizer.svelte

Lines changed: 14 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,25 @@
11
<script>
2-
import Onboard from '@web3-onboard/core'
3-
import injectedModule from '@web3-onboard/injected-wallets'
2+
import getOnboard from '$lib/services/onboard'
43
54
import { share } from 'rxjs/operators'
65
import { onMount } from 'svelte'
76
8-
const INFURA_ID = '8b60d52405694345a99bcb82e722e0af'
9-
const injected = injectedModule()
10-
11-
const onboard = Onboard({
12-
wallets: [injected],
13-
chains: [
14-
{
15-
id: '0x1',
16-
token: 'ETH',
17-
label: 'Ethereum Mainnet',
18-
rpcUrl: `https://mainnet.infura.io/v3/${INFURA_ID}`
19-
},
20-
{
21-
id: '0x5',
22-
token: 'ETH',
23-
label: 'Ethereum Goerli Testnet',
24-
rpcUrl: `https://goerli.infura.io/v3/${INFURA_ID}`
25-
},
26-
{
27-
id: '0x13881',
28-
token: 'MATIC',
29-
label: 'Polygon - Mumbai',
30-
rpcUrl: 'https://matic-mumbai.chainstacklabs.com '
31-
},
32-
{
33-
id: '0x38',
34-
token: 'BNB',
35-
label: 'Binance',
36-
rpcUrl: 'https://bsc-dataseed.binance.org/'
37-
},
38-
{
39-
id: 137,
40-
token: 'MATIC',
41-
label: 'Polygon',
42-
rpcUrl: 'https://matic-mainnet.chainstacklabs.com'
43-
},
44-
{
45-
id: 10,
46-
token: 'OETH',
47-
label: 'Optimism',
48-
rpcUrl: 'https://mainnet.optimism.io'
49-
},
50-
{
51-
id: 42161,
52-
token: 'ARB-ETH',
53-
label: 'Arbitrum',
54-
rpcUrl: 'https://rpc.ankr.com/arbitrum'
55-
}
56-
],
57-
appMetadata: {
58-
name: 'Documentation',
59-
description: 'Example showcasing how to connect a wallet.',
60-
recommendedInjectedWallets: [
61-
{ name: 'MetaMask', url: 'https://metamask.io' },
62-
{ name: 'Coinbase', url: 'https://wallet.coinbase.com/' }
63-
]
64-
},
65-
accountCenter: {
66-
desktop: { enabled: true },
67-
mobile: { enabled: true }
68-
},
69-
theme: 'system'
70-
})
7+
let onboard
8+
let wallets$
719
7210
const themes = ['system', 'default', 'light', 'dark', 'custom']
73-
let selectedTheme = 'system'
74-
75-
// Subscribe to wallet updates
76-
const wallets$ = onboard.state.select('wallets').pipe(share())
11+
let selectedTheme = 'custom'
7712
7813
let webURL = ''
7914
let iframeUsed = false
8015
let hideDirections = false
8116
17+
const loadOnboard = async () => {
18+
onboard = await getOnboard('default')
19+
onboard.state.actions.updateTheme('default')
20+
wallets$ = onboard.state.select('wallets').pipe(share())
21+
}
22+
8223
const isValidUrl = (urlString) => {
8324
try {
8425
return Boolean(new URL(urlString))
@@ -112,7 +53,8 @@
11253
if (onboardCloseBtnVisible) onboardCloseBtnVisible?.click()
11354
}
11455
115-
const handleConnectWalletBtn = () => {
56+
const handleConnectWalletBtn = async () => {
57+
if (!onboard) await loadOnboard()
11658
!!$wallets$ && $wallets$.length
11759
? onboard.disconnectWallet({ label: $wallets$[0].label })
11860
: onboard.connectWallet()
@@ -234,6 +176,8 @@
234176
}
235177
236178
onMount(async () => {
179+
await loadOnboard()
180+
await onboard.state.actions.updateTheme('default')
237181
handleImageDrop()
238182
})
239183
</script>

docs/src/lib/services/onboard.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import bnIcon from '$lib/components/icons/bnWhiteBackground.js'
21
let onboard
3-
const getOnboard = async () => {
2+
const getOnboard = async (passedTheme) => {
43
if (!onboard) {
54
const key = 'svelteness::color-scheme'
65
const scheme = localStorage[key]
7-
let theme = scheme || 'system'
6+
let theme = passedTheme || scheme || 'system'
87
onboard = await intiOnboard(theme)
98
classMutationListener()
9+
} else {
10+
await onboard.state.actions.updateTheme(passedTheme)
1011
}
1112
return onboard
1213
}
@@ -173,7 +174,6 @@ const intiOnboard = async (theme) => {
173174
],
174175
appMetadata: {
175176
name: 'Documentation',
176-
icon: bnIcon,
177177
description: 'Example showcasing how to connect a wallet.',
178178
recommendedInjectedWallets: [
179179
{ name: 'MetaMask', url: 'https://metamask.io' },

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Test out the current functionality of web3-onboard in a small browser demo:
169169

170170
- Clone the repo: `git clone git@github.com:blocknative/web3-onboard.git`
171171
- Change it to the onboard directory: `cd web3-onboard`
172-
- Checkout the main web3-onboard branch: `git checkout v2-web3-onboard`
172+
- Checkout the main web3-onboard branch: `git checkout main`
173173
- Install the dependencies: `yarn` (if running a M1 mac - `yarn install-m1-mac`)
174174
- Run all packages in dev mode: `yarn dev`
175175
- [View demo app in the browser](http://localhost:8080/)

docs/src/routes/docs/[...1]overview/[...2]contribution-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ After making changes within a web3-onboard package you will want to bump the ver
2626
We use both semantic and `alpha` versioning for publishing and testing packages prior to official release. This means if you do not see an `-alpha.x` tag on the version of the package you made changes in you will need to not only bump the version but also add an alpha flag followed by an alpha version number starting at 1 (ex. `-alpha.1`).
2727

2828
Example : Adding a new injected wallet to the `injected` package -
29-
[Injected Package.json](https://github.com/blocknative/web3-onboard/blob/v2-web3-onboard-develop/packages/injected/package.json#L3) changes : `"version": "2.2.4",` --> `"version": "2.3.0-alpha.1",`
29+
[Injected Package.json](https://github.com/blocknative/web3-onboard/blob/develop/packages/injected/package.json#L3) changes : `"version": "2.2.4",` --> `"version": "2.3.0-alpha.1",`
3030

3131
Example 2 : Bug fix within the `core` package -
3232
[Core package.json](https://github.com/blocknative/web3-onboard/blob/8531a73d69365f7d584320f1c4b97a5d90f1c34e/packages/core/package.json#L3) changes: `"version": "2.9.1-alpha.1",` --> `"version": "2.9.1-alpha.2",`
@@ -44,7 +44,7 @@ If you cannot write the code yourself to add a new wallet, then go ahead and cre
4444

4545
### Documentation contributions
4646

47-
In order to contribute to the docs, you'll have to create a PR on the [v2-web3-onboard-develop branch](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard-develop). If you contribute code, you should definitely document it appropriately. We highly encourage the community to improve web3-onboard docs, if you have any questions don't hesitate to reach out.
47+
In order to contribute to the docs, you'll have to create a PR on the [develop branch](https://github.com/blocknative/web3-onboard/tree/develop). If you contribute code, you should definitely document it appropriately. We highly encourage the community to improve web3-onboard docs, if you have any questions don't hesitate to reach out.
4848

4949
## Feedback
5050

docs/src/routes/docs/[...1]overview/[...3]onboard.js-migration-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ If you have bnc-onboard installed, you will need to install web3-onboard instead
1818
3. Make use of our API actions like `await onboard.connectWallet()` to allow a user to connect their wallets.
1919

2020
For a full code overview of the upgrade process using the React Hooks package please see [this PR](https://github.com/blocknative/react-demo/pull/160/files) with special attention to the `App.js` and `services.js` files.
21-
To help you get started quickly we’ve put together [a set of examples across multiple frameworks that includes the above-mentioned steps](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard-develop/examples).
21+
To help you get started quickly we’ve put together [a set of examples across multiple frameworks that includes the above-mentioned steps](https://github.com/blocknative/web3-onboard/tree/develop/examples).
2222

2323
### Package Upgrade - Modularization
2424

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ npm install @web3-onboard/coinbase @web3-onboard/fortmatic @web3-onboard/gnosis
5353
Checkout our full library of quick start examples for connecting and interacting with EVM based wallets
5454

5555
- **[React](https://github.com/blocknative/react-demo)**
56-
- **[Nextjs 13](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-nextjs-13)**
57-
- **[Nextjs](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-nextjs)**
58-
- **[Svelte](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/packages/demo)**
59-
- **[SvelteKit](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-sveltekit)**
60-
- **[Vite/React](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-vite-react)**
61-
- **[Vue](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-vuejs)**
62-
- **[Vue2](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-vuejs-v2)**
56+
- **[Nextjs 13](https://github.com/blocknative/web3-onboard/tree/main/examples/with-nextjs-13)**
57+
- **[Nextjs](https://github.com/blocknative/web3-onboard/tree/main/examples/with-nextjs)**
58+
- **[Svelte](https://github.com/blocknative/web3-onboard/tree/main/packages/demo)**
59+
- **[SvelteKit](https://github.com/blocknative/web3-onboard/tree/main/examples/with-sveltekit)**
60+
- **[Vite/React](https://github.com/blocknative/web3-onboard/tree/main/examples/with-vite-react)**
61+
- **[Vue](https://github.com/blocknative/web3-onboard/tree/main/examples/with-vuejs)**
62+
- **[Vue2](https://github.com/blocknative/web3-onboard/tree/main/examples/with-vuejs-v2)**
6363

6464
## Initialization
6565

@@ -178,7 +178,7 @@ type Locale = string // eg 'en', 'es'
178178
type i18nOptions = Record<Locale, i18n>
179179
```
180180
181-
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/v2-web3-onboard-develop/packages/core/src/i18n/en.json).
181+
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).
182182
Onboard is using the [ICU syntax](https://formatjs.io/docs/core-concepts/icu-syntax/) for formatting under the hood.
183183
184184
**`theme`**
@@ -258,7 +258,7 @@ Currently notifications are positioned in the same location as the account cente
258258
The `transactionHandler` can react off any property of the Ethereum TransactionData returned to the callback from the event (see console.log in example init). In turn, it can return a Custom `Notification` object to define the verbiage, styling, or add functionality:
259259
260260
- `Notification.message` - to completely customize the message shown
261-
- `Notification.eventCode` - handle codes in your own way - see codes here under the notify prop [default en file here](https://github.com/blocknative/web3-onboard/blob/v2-web3-onboard-develop/packages/core/src/i18n/en.json)
261+
- `Notification.eventCode` - handle codes in your own way - see codes here under the notify prop [default en file here](https://github.com/blocknative/web3-onboard/blob/develop/packages/core/src/i18n/en.json)
262262
- `Notification.type` - icon type displayed (see `NotificationType` below for options)
263263
- `Notification.autoDismiss` - time (in ms) after which the notification will be dismissed. If set to `0` the notification will remain on screen until the user dismisses the notification, refreshes the page or navigates away from the site with the notifications
264264
- `Notification.link` - add link to the transaction hash. For instance, a link to the transaction on etherscan

packages/core/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<a href="https://onboard.blocknative.com/">
2-
<img alt="Web3-Onboard UI Components" src="https://github.com/blocknative/web3-onboard/blob/v2-web3-onboard-develop/assets/core.svg?raw=true" />
2+
<img alt="Web3-Onboard UI Components" src="https://github.com/blocknative/web3-onboard/blob/develop/assets/core.svg?raw=true" />
33
</a>
44

55
# @web3-onboard/core
@@ -11,13 +11,13 @@ This is the core package that contains all of the UI and logic to be able to sea
1111
Checkout our full library of quick start examples for connecting and interacting with EVM based wallets
1212

1313
- **[React](https://github.com/blocknative/react-demo)**
14-
- **[Nextjs 13](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-nextjs-13)**
15-
- **[Nextjs](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-nextjs)**
16-
- **[Svelte](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/packages/demo)**
17-
- **[SvelteKit](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-sveltekit)**
18-
- **[Vite/React](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-vite-react)**
19-
- **[Vue](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-vuejs)**
20-
- **[Vue2](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-vuejs-v2)**
14+
- **[Nextjs 13](https://github.com/blocknative/web3-onboard/tree/main/examples/with-nextjs-13)**
15+
- **[Nextjs](https://github.com/blocknative/web3-onboard/tree/main/examples/with-nextjs)**
16+
- **[Svelte](https://github.com/blocknative/web3-onboard/tree/main/packages/demo)**
17+
- **[SvelteKit](https://github.com/blocknative/web3-onboard/tree/main/examples/with-sveltekit)**
18+
- **[Vite/React](https://github.com/blocknative/web3-onboard/tree/main/examples/with-vite-react)**
19+
- **[Vue](https://github.com/blocknative/web3-onboard/tree/main/examples/with-vuejs)**
20+
- **[Vue2](https://github.com/blocknative/web3-onboard/tree/main/examples/with-vuejs-v2)**
2121

2222
## Installation
2323

packages/react/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<a href="https://onboard.blocknative.com/">
2-
<img alt="Web3-Onboard UI Components" src="https://github.com/blocknative/web3-onboard/blob/v2-web3-onboard-develop/assets/core.svg?raw=true" />
2+
<img alt="Web3-Onboard UI Components" src="https://github.com/blocknative/web3-onboard/blob/develop/assets/core.svg?raw=true" />
33
</a>
44

55
# @web3-onboard/react

packages/transaction-preview/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# @web3-onboard/transaction-preview
22

33
## A modular UI for previewing a single or set of unsigned Ethereum transactions.
4-
![Transaction Preview Flow](https://github.com/blocknative/web3-onboard/blob/v2-web3-onboard-develop/assets/transaction-preview.gif?raw=true "Transaction Preview Flow")
4+
![Transaction Preview Flow](https://github.com/blocknative/web3-onboard/blob/develop/assets/transaction-preview.gif?raw=true "Transaction Preview Flow")
55

66
#### Full Transaction Preview package documentation available [here](https://onboard.blocknative.com/docs/packages/transaction-preview)
77

packages/vue/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<a href="https://onboard.blocknative.com/">
2-
<img alt="Web3-Onboard UI Components" src="https://github.com/blocknative/web3-onboard/blob/v2-web3-onboard-develop/assets/core.svg?raw=true" />
2+
<img alt="Web3-Onboard UI Components" src="https://github.com/blocknative/web3-onboard/blob/develop/assets/core.svg?raw=true" />
33
</a>
44

55
# @web3-onboard/vue

0 commit comments

Comments
 (0)