Skip to content

Commit cb8529e

Browse files
authored
[core, react, vue]: Fix - AC Expanded Balance Right Align & Chain ID validation and Error Message (#1324)
* Add alignment to balance row within AC and bump versions * Handle duplicate chain ID within Chain Validation * Update docs links to new docs site
1 parent 8531a73 commit cb8529e

File tree

11 files changed

+120
-20
lines changed

11 files changed

+120
-20
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if (wallets[0]) {
7171

7272
**Onboard v1 migration guide**
7373

74-
If you're coming from v1, we've created a [migration guide for you](https://docs.blocknative.com/onboard/migration-guide).
74+
If you're coming from v1, we've created a [migration guide for you](https://onboard.blocknative.com/docs/overview/onboard.js-migration-guide#background).
7575

7676
## Documentation
7777

examples/with-ledger/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the
3232

3333
## Learn More
3434

35-
To learn more about how you can use web3Onboard to integrate Ledger and other popular web3 wallets into your dApps, take a look at our documentation: [Web3Onboard Documentation](https://docs.blocknative.com/onboard) for more details.
35+
To learn more about how you can use web3Onboard to integrate Ledger and other popular web3 wallets into your dApps, take a look at our documentation: [Web3Onboard Documentation](https://onboard.blocknative.com/docs/overview/introduction#features) for more details.

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/core",
3-
"version": "2.9.1-alpha.2",
3+
"version": "2.9.1-alpha.3",
44
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",

packages/core/src/validation.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,18 @@ const account = Joi.object({
5959
balance
6060
})
6161

62-
const chains = Joi.array().items(chainValidation)
62+
const chains = Joi.array()
63+
.items(chainValidation)
64+
.unique((a, b) => a.id === b.id)
65+
.error(e => {
66+
if (e[0].code === 'array.unique') {
67+
return new Error(
68+
`There is a duplicate Chain ID in your Onboard Chains array: ${e}`
69+
)
70+
}
71+
return new Error(`${e}`)
72+
})
73+
6374
const accounts = Joi.array().items(account)
6475

6576
const wallet = Joi.object({

packages/core/src/views/account-center/WalletRow.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
white-space: nowrap;
105105
text-overflow: ellipsis;
106106
width: 7.25rem;
107+
text-align: end;
107108
}
108109
109110
.elipsis-container {

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"dependencies": {
2525
"@web3-onboard/coinbase": "^2.1.3",
26-
"@web3-onboard/core": "^2.9.1-alpha.2",
26+
"@web3-onboard/core": "^2.9.1-alpha.3",
2727
"@web3-onboard/dcent": "^2.2.1",
2828
"@web3-onboard/fortmatic": "^2.0.14",
2929
"@web3-onboard/gas": "^2.1.3",

packages/demo/src/App.svelte

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,28 +141,40 @@
141141
rpcUrl: 'https://ropsten.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e'
142142
},
143143
{
144-
id: 4,
145-
token: 'rETH',
146-
label: 'Rinkeby',
147-
rpcUrl: 'https://rinkeby.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e'
148-
},
149-
{
150-
id: 137,
151-
token: 'MATIC',
152-
label: 'Polygon',
153-
rpcUrl: 'https://matic-mainnet.chainstacklabs.com'
144+
id: '0x5',
145+
token: 'ETH',
146+
label: 'Goerli',
147+
rpcUrl: `https://goerli.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e`
154148
},
155149
{
156150
id: '0x13881',
157151
token: 'MATIC',
158152
label: 'Polygon - Mumbai',
159153
rpcUrl: 'https://matic-mumbai.chainstacklabs.com '
160154
},
155+
{
156+
id: '0x38',
157+
token: 'BNB',
158+
label: 'Binance',
159+
rpcUrl: 'https://bsc-dataseed.binance.org/'
160+
},
161+
{
162+
id: 137,
163+
token: 'MATIC',
164+
label: 'Polygon',
165+
rpcUrl: 'https://matic-mainnet.chainstacklabs.com'
166+
},
161167
{
162168
id: 10,
163169
token: 'OETH',
164170
label: 'Optimism',
165171
rpcUrl: 'https://mainnet.optimism.io'
172+
},
173+
{
174+
id: 42161,
175+
token: 'ARB-ETH',
176+
label: 'Arbitrum',
177+
rpcUrl: 'https://rpc.ankr.com/arbitrum'
166178
}
167179
],
168180
// connect: {

packages/gas/README.md

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

3-
## A module for requesting streams or single requests of gas price estimates from the [Blocknative Gas Platform API](https://docs.blocknative.com/gas-platform).
3+
## A module for requesting streams or single requests of gas price estimates from the [Blocknative Gas Platform API](https://onboard.blocknative.com/docs/packages/gas).
44

55
### Install
66

packages/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/react",
3-
"version": "2.3.7-alpha.2",
3+
"version": "2.3.7-alpha.3",
44
"description": "A collection of React hooks for integrating Web3-Onboard in to React and Next.js projects. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -62,7 +62,7 @@
6262
"typescript": "^4.5.5"
6363
},
6464
"dependencies": {
65-
"@web3-onboard/core": "^2.9.1-alpha.2",
65+
"@web3-onboard/core": "^2.9.1-alpha.3",
6666
"@web3-onboard/common": "^2.2.3",
6767
"use-sync-external-store": "1.0.0"
6868
},

packages/vue/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/vue",
3-
"version": "2.2.7-alpha.2",
3+
"version": "2.2.7-alpha.3",
44
"description": "A collection of Vue Composables for integrating Web3-Onboard in to a Vue or Nuxt project. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -63,7 +63,7 @@
6363
"@vueuse/core": "^8.4.2",
6464
"@vueuse/rxjs": "^8.2.0",
6565
"@web3-onboard/common": "^2.2.3",
66-
"@web3-onboard/core": "^2.9.1-alpha.2",
66+
"@web3-onboard/core": "^2.9.1-alpha.3",
6767
"vue-demi": "^0.12.4"
6868
},
6969
"peerDependencies": {

yarn.lock

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2953,6 +2953,82 @@
29532953
dependencies:
29542954
"@walletconnect/window-getters" "^1.0.0"
29552955

2956+
"@web3-onboard/dcent@^2.2.1":
2957+
version "2.2.1"
2958+
resolved "https://registry.yarnpkg.com/@web3-onboard/dcent/-/dcent-2.2.1.tgz#88a0aa781e7bd2279cf32751a69f19c97532ccf3"
2959+
integrity sha512-RO7HJnkRMcod4R5Nb2YU63GiNuvpiucKI+F6AmsHwVksj2qcS3fwlJl09uZVK1a2ERkNUSNhp4BCTUsc9esuxw==
2960+
dependencies:
2961+
"@ethereumjs/tx" "^3.4.0"
2962+
"@ethersproject/providers" "^5.5.0"
2963+
"@web3-onboard/common" "^2.2.3"
2964+
"@web3-onboard/hw-common" "^2.0.3"
2965+
eth-dcent-keyring "^0.2.2"
2966+
2967+
"@web3-onboard/hw-common@^2.0.3":
2968+
version "2.0.3"
2969+
resolved "https://registry.yarnpkg.com/@web3-onboard/hw-common/-/hw-common-2.0.3.tgz#8e73ef3c94d2f513e8439804f8a541ccac1cf845"
2970+
integrity sha512-hfCVVgNjKIJXjinqMTmYfxqiOTausYj77IrWhSaIk9W9PfAEX+BnPLMhmbuNb39FBVWg/ucvMIiG3pwY6hXoOw==
2971+
dependencies:
2972+
"@ethereumjs/common" "2.6.2"
2973+
"@web3-onboard/common" "^2.2.3"
2974+
ethers "5.5.4"
2975+
joi "^17.6.1"
2976+
rxjs "^7.5.2"
2977+
2978+
"@web3-onboard/keepkey@^2.3.1":
2979+
version "2.3.1"
2980+
resolved "https://registry.yarnpkg.com/@web3-onboard/keepkey/-/keepkey-2.3.1.tgz#00712e1799f2016da2f1fd22f461989e5c436713"
2981+
integrity sha512-OA36iTNLkLjFQrt2xsNou+kEdjBVQDxHDJeeTcII4OjEqcTP300GifNd2RIW5sTWP+CK6hx2EWZLDUZGXVJe0A==
2982+
dependencies:
2983+
"@ethersproject/providers" "^5.5.0"
2984+
"@shapeshiftoss/hdwallet-core" "^1.15.2"
2985+
"@shapeshiftoss/hdwallet-keepkey-webusb" "^1.15.2"
2986+
"@web3-onboard/common" "^2.2.3"
2987+
"@web3-onboard/hw-common" "^2.0.3"
2988+
ethereumjs-util "^7.1.3"
2989+
2990+
"@web3-onboard/keystone@^2.3.1":
2991+
version "2.3.1"
2992+
resolved "https://registry.yarnpkg.com/@web3-onboard/keystone/-/keystone-2.3.1.tgz#b9a47fa4a4df3462ccd1326466ce883697208cde"
2993+
integrity sha512-Evz3/DLcpCIH9pvAmr1Ukd7yNodGgkoLiLmYP9MjEk5FVC1N7/e7sQYQVJ9CmbH9x2a+s37XBsx+g55G2a3cow==
2994+
dependencies:
2995+
"@ethereumjs/tx" "^3.4.0"
2996+
"@ethersproject/providers" "^5.5.0"
2997+
"@keystonehq/eth-keyring" "^0.14.00.3"
2998+
"@web3-onboard/common" "^2.2.3"
2999+
"@web3-onboard/hw-common" "^2.0.3"
3000+
3001+
"@web3-onboard/ledger@^2.3.1":
3002+
version "2.3.1"
3003+
resolved "https://registry.yarnpkg.com/@web3-onboard/ledger/-/ledger-2.3.1.tgz#21afedd376da9dc54e32493f9cafaadd043511f0"
3004+
integrity sha512-KNBwJFbL0vivqmArSqTI+05AKhikP/HYLEbuVI9brY5YM/5LXap/QslM8FYECmomOyCofpouPV4AreSWkyRvuA==
3005+
dependencies:
3006+
"@ethereumjs/tx" "^3.4.0"
3007+
"@ethersproject/providers" "^5.5.0"
3008+
"@ledgerhq/hw-app-eth" "^6.19.0"
3009+
"@ledgerhq/hw-transport-u2f" "^5.36.0-deprecated"
3010+
"@ledgerhq/hw-transport-webusb" "^6.19.0"
3011+
"@metamask/eth-sig-util" "^4.0.0"
3012+
"@web3-onboard/common" "^2.2.3"
3013+
"@web3-onboard/hw-common" "^2.0.3"
3014+
buffer "^6.0.3"
3015+
ethereumjs-util "^7.1.3"
3016+
3017+
"@web3-onboard/trezor@^2.3.1":
3018+
version "2.3.1"
3019+
resolved "https://registry.yarnpkg.com/@web3-onboard/trezor/-/trezor-2.3.1.tgz#48e4f25cd647dd668aca13293a30e68757e00122"
3020+
integrity sha512-fINzu1TzMUSh9BlXZC4geQDP1lV4nOtl+8mTHw116L1GYtqAFwtVWmxGx7jzrpyxDj02CQha8UIqiHiOK43f8w==
3021+
dependencies:
3022+
"@ethereumjs/tx" "^3.4.0"
3023+
"@ethersproject/providers" "^5.5.0"
3024+
"@web3-onboard/common" "^2.2.3"
3025+
"@web3-onboard/hw-common" "^2.0.3"
3026+
buffer "^6.0.3"
3027+
eth-crypto "^2.1.0"
3028+
ethereumjs-util "^7.1.3"
3029+
hdkey "^2.0.1"
3030+
trezor-connect "^8.2.11"
3031+
29563032
"@web3auth/base-plugin@^1.0.1":
29573033
version "1.0.1"
29583034
resolved "https://registry.yarnpkg.com/@web3auth/base-plugin/-/base-plugin-1.0.1.tgz#1e2a87acf745299fdff6f92e6c46ee9bc38aa670"

0 commit comments

Comments
 (0)