From 6efe346ae9c0808d6f4f6417c0fa332cd8daa60a Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Wed, 19 Oct 2022 10:01:17 -0600 Subject: [PATCH 1/3] Add alignment to balance row within AC and bump versions --- packages/core/package.json | 2 +- .../src/views/account-center/WalletRow.svelte | 1 + packages/demo/package.json | 2 +- packages/demo/src/App.svelte | 32 +++++--- packages/react/package.json | 4 +- packages/vue/package.json | 4 +- yarn.lock | 76 +++++++++++++++++++ 7 files changed, 105 insertions(+), 16 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 55265ef35..72275ab64 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/core", - "version": "2.9.1-alpha.2", + "version": "2.9.1-alpha.3", "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.", "keywords": [ "Ethereum", diff --git a/packages/core/src/views/account-center/WalletRow.svelte b/packages/core/src/views/account-center/WalletRow.svelte index 2a9774468..964415a4b 100644 --- a/packages/core/src/views/account-center/WalletRow.svelte +++ b/packages/core/src/views/account-center/WalletRow.svelte @@ -104,6 +104,7 @@ white-space: nowrap; text-overflow: ellipsis; width: 7.25rem; + text-align: end; } .elipsis-container { diff --git a/packages/demo/package.json b/packages/demo/package.json index 75220601c..0e9735283 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@web3-onboard/coinbase": "^2.1.3", - "@web3-onboard/core": "^2.9.1-alpha.2", + "@web3-onboard/core": "^2.9.1-alpha.3", "@web3-onboard/dcent": "^2.2.1", "@web3-onboard/fortmatic": "^2.0.14", "@web3-onboard/gas": "^2.1.3", diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index a3d5e9005..e237e70d3 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -141,16 +141,10 @@ rpcUrl: 'https://ropsten.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e' }, { - id: 4, - token: 'rETH', - label: 'Rinkeby', - rpcUrl: 'https://rinkeby.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e' - }, - { - id: 137, - token: 'MATIC', - label: 'Polygon', - rpcUrl: 'https://matic-mainnet.chainstacklabs.com' + id: '0x5', + token: 'ETH', + label: 'Goerli', + rpcUrl: `https://goerli.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e` }, { id: '0x13881', @@ -158,11 +152,29 @@ label: 'Polygon - Mumbai', rpcUrl: 'https://matic-mumbai.chainstacklabs.com ' }, + { + id: '0x38', + token: 'BNB', + label: 'Binance', + rpcUrl: 'https://bsc-dataseed.binance.org/' + }, + { + id: 137, + token: 'MATIC', + label: 'Polygon', + rpcUrl: 'https://matic-mainnet.chainstacklabs.com' + }, { id: 10, token: 'OETH', label: 'Optimism', rpcUrl: 'https://mainnet.optimism.io' + }, + { + id: 42161, + token: 'ARB-ETH', + label: 'Arbitrum', + rpcUrl: 'https://rpc.ankr.com/arbitrum' } ], // connect: { diff --git a/packages/react/package.json b/packages/react/package.json index dba4374ce..61f4631ac 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/react", - "version": "2.3.7-alpha.2", + "version": "2.3.7-alpha.3", "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.", "keywords": [ "Ethereum", @@ -62,7 +62,7 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/core": "^2.9.1-alpha.2", + "@web3-onboard/core": "^2.9.1-alpha.3", "@web3-onboard/common": "^2.2.3", "use-sync-external-store": "1.0.0" }, diff --git a/packages/vue/package.json b/packages/vue/package.json index e97b8efab..eba7323ed 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/vue", - "version": "2.2.7-alpha.2", + "version": "2.2.7-alpha.3", "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.", "keywords": [ "Ethereum", @@ -63,7 +63,7 @@ "@vueuse/core": "^8.4.2", "@vueuse/rxjs": "^8.2.0", "@web3-onboard/common": "^2.2.3", - "@web3-onboard/core": "^2.9.1-alpha.2", + "@web3-onboard/core": "^2.9.1-alpha.3", "vue-demi": "^0.12.4" }, "peerDependencies": { diff --git a/yarn.lock b/yarn.lock index 33ec05902..83649787c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2953,6 +2953,82 @@ dependencies: "@walletconnect/window-getters" "^1.0.0" +"@web3-onboard/dcent@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@web3-onboard/dcent/-/dcent-2.2.1.tgz#88a0aa781e7bd2279cf32751a69f19c97532ccf3" + integrity sha512-RO7HJnkRMcod4R5Nb2YU63GiNuvpiucKI+F6AmsHwVksj2qcS3fwlJl09uZVK1a2ERkNUSNhp4BCTUsc9esuxw== + dependencies: + "@ethereumjs/tx" "^3.4.0" + "@ethersproject/providers" "^5.5.0" + "@web3-onboard/common" "^2.2.3" + "@web3-onboard/hw-common" "^2.0.3" + eth-dcent-keyring "^0.2.2" + +"@web3-onboard/hw-common@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@web3-onboard/hw-common/-/hw-common-2.0.3.tgz#8e73ef3c94d2f513e8439804f8a541ccac1cf845" + integrity sha512-hfCVVgNjKIJXjinqMTmYfxqiOTausYj77IrWhSaIk9W9PfAEX+BnPLMhmbuNb39FBVWg/ucvMIiG3pwY6hXoOw== + dependencies: + "@ethereumjs/common" "2.6.2" + "@web3-onboard/common" "^2.2.3" + ethers "5.5.4" + joi "^17.6.1" + rxjs "^7.5.2" + +"@web3-onboard/keepkey@^2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@web3-onboard/keepkey/-/keepkey-2.3.1.tgz#00712e1799f2016da2f1fd22f461989e5c436713" + integrity sha512-OA36iTNLkLjFQrt2xsNou+kEdjBVQDxHDJeeTcII4OjEqcTP300GifNd2RIW5sTWP+CK6hx2EWZLDUZGXVJe0A== + dependencies: + "@ethersproject/providers" "^5.5.0" + "@shapeshiftoss/hdwallet-core" "^1.15.2" + "@shapeshiftoss/hdwallet-keepkey-webusb" "^1.15.2" + "@web3-onboard/common" "^2.2.3" + "@web3-onboard/hw-common" "^2.0.3" + ethereumjs-util "^7.1.3" + +"@web3-onboard/keystone@^2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@web3-onboard/keystone/-/keystone-2.3.1.tgz#b9a47fa4a4df3462ccd1326466ce883697208cde" + integrity sha512-Evz3/DLcpCIH9pvAmr1Ukd7yNodGgkoLiLmYP9MjEk5FVC1N7/e7sQYQVJ9CmbH9x2a+s37XBsx+g55G2a3cow== + dependencies: + "@ethereumjs/tx" "^3.4.0" + "@ethersproject/providers" "^5.5.0" + "@keystonehq/eth-keyring" "^0.14.00.3" + "@web3-onboard/common" "^2.2.3" + "@web3-onboard/hw-common" "^2.0.3" + +"@web3-onboard/ledger@^2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@web3-onboard/ledger/-/ledger-2.3.1.tgz#21afedd376da9dc54e32493f9cafaadd043511f0" + integrity sha512-KNBwJFbL0vivqmArSqTI+05AKhikP/HYLEbuVI9brY5YM/5LXap/QslM8FYECmomOyCofpouPV4AreSWkyRvuA== + dependencies: + "@ethereumjs/tx" "^3.4.0" + "@ethersproject/providers" "^5.5.0" + "@ledgerhq/hw-app-eth" "^6.19.0" + "@ledgerhq/hw-transport-u2f" "^5.36.0-deprecated" + "@ledgerhq/hw-transport-webusb" "^6.19.0" + "@metamask/eth-sig-util" "^4.0.0" + "@web3-onboard/common" "^2.2.3" + "@web3-onboard/hw-common" "^2.0.3" + buffer "^6.0.3" + ethereumjs-util "^7.1.3" + +"@web3-onboard/trezor@^2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@web3-onboard/trezor/-/trezor-2.3.1.tgz#48e4f25cd647dd668aca13293a30e68757e00122" + integrity sha512-fINzu1TzMUSh9BlXZC4geQDP1lV4nOtl+8mTHw116L1GYtqAFwtVWmxGx7jzrpyxDj02CQha8UIqiHiOK43f8w== + dependencies: + "@ethereumjs/tx" "^3.4.0" + "@ethersproject/providers" "^5.5.0" + "@web3-onboard/common" "^2.2.3" + "@web3-onboard/hw-common" "^2.0.3" + buffer "^6.0.3" + eth-crypto "^2.1.0" + ethereumjs-util "^7.1.3" + hdkey "^2.0.1" + trezor-connect "^8.2.11" + "@web3auth/base-plugin@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@web3auth/base-plugin/-/base-plugin-1.0.1.tgz#1e2a87acf745299fdff6f92e6c46ee9bc38aa670" From e3194e3c5926883c2ed1153a75ea4384ac5db8c6 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Wed, 19 Oct 2022 10:37:52 -0600 Subject: [PATCH 2/3] Handle duplicate chain ID within Chain Validation --- packages/core/src/validation.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/core/src/validation.ts b/packages/core/src/validation.ts index 38ccd05c4..85788a3d1 100644 --- a/packages/core/src/validation.ts +++ b/packages/core/src/validation.ts @@ -59,7 +59,18 @@ const account = Joi.object({ balance }) -const chains = Joi.array().items(chainValidation) +const chains = Joi.array() + .items(chainValidation) + .unique((a, b) => a.id === b.id) + .error(e => { + if (e[0].code === 'array.unique') { + return new Error( + `There is a duplicate Chain ID in your Onboard Chains array: ${e}` + ) + } + return new Error(`${e}`) + }) + const accounts = Joi.array().items(account) const wallet = Joi.object({ From f90f817c420fc807c8176cdde07d980a908c699b Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Wed, 19 Oct 2022 11:56:01 -0600 Subject: [PATCH 3/3] Update docs links to new docs site --- README.md | 2 +- examples/with-ledger/README.md | 2 +- packages/gas/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 55f09836c..bfe8821a1 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ if (wallets[0]) { **Onboard v1 migration guide** -If you're coming from v1, we've created a [migration guide for you](https://docs.blocknative.com/onboard/migration-guide). +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). ## Documentation diff --git a/examples/with-ledger/README.md b/examples/with-ledger/README.md index 4f59ab4bd..9ee1ba13e 100644 --- a/examples/with-ledger/README.md +++ b/examples/with-ledger/README.md @@ -32,4 +32,4 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the ## Learn More -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. +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. diff --git a/packages/gas/README.md b/packages/gas/README.md index ceca031cf..da9db35d0 100644 --- a/packages/gas/README.md +++ b/packages/gas/README.md @@ -1,6 +1,6 @@ # @web3-onboard/gas -## A module for requesting streams or single requests of gas price estimates from the [Blocknative Gas Platform API](https://docs.blocknative.com/gas-platform). +## 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). ### Install