From d0f42774d5dac2fda1ebfeff4add3125a19c8a35 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Mon, 13 Mar 2023 15:51:41 -0600 Subject: [PATCH 01/16] allow instantiation with only chainid --- packages/common/package.json | 2 +- packages/common/src/types.ts | 6 +++--- packages/common/src/validation.ts | 6 +++--- packages/core/README.md | 6 +++--- packages/core/package.json | 4 ++-- packages/core/src/store/actions.ts | 2 +- .../src/views/shared/NetworkSelector.svelte | 3 ++- packages/demo/src/App.svelte | 21 +++++++++++++------ yarn.lock | 9 ++++++++ 9 files changed, 39 insertions(+), 20 deletions(-) diff --git a/packages/common/package.json b/packages/common/package.json index a010e2420..ae1732571 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/common", - "version": "2.2.3", + "version": "2.2.4-alpha.1", "description": "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, 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/common/src/types.ts b/packages/common/src/types.ts index 91183ad7c..96a9325ce 100644 --- a/packages/common/src/types.ts +++ b/packages/common/src/types.ts @@ -386,9 +386,9 @@ export enum ProviderRpcErrorCode { export interface Chain { namespace?: 'evm' id: ChainId - rpcUrl: string - label: string - token: TokenSymbol // eg ETH, BNB, MATIC + rpcUrl?: string + label?: string + token?: TokenSymbol // eg ETH, BNB, MATIC color?: string icon?: string // svg string providerConnectionInfo?: ConnectionInfo diff --git a/packages/common/src/validation.ts b/packages/common/src/validation.ts index 631af1e09..e61d2b2b1 100644 --- a/packages/common/src/validation.ts +++ b/packages/common/src/validation.ts @@ -31,9 +31,9 @@ export const providerConnectionInfoValidation = Joi.object({ export const chainValidation = Joi.object({ namespace: chainNamespaceValidation, id: chainIdValidation.required(), - rpcUrl: Joi.string().required(), - label: Joi.string().required(), - token: Joi.string().required(), + rpcUrl: Joi.string(), + label: Joi.string(), + token: Joi.string(), icon: Joi.string(), color: Joi.string(), publicRpcUrl: Joi.string(), diff --git a/packages/core/README.md b/packages/core/README.md index 51c36307f..d472205e3 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -82,9 +82,9 @@ An array of Chains that your app supports: type Chain = { id: ChainId // hex encoded string, eg '0x1' for Ethereum Mainnet namespace?: 'evm' // string indicating chain namespace. Defaults to 'evm' but will allow other chain namespaces in the future - rpcUrl: string // used for network requests (eg Alchemy or Infura end point) - label: string // used for display, eg Ethereum Mainnet - token: TokenSymbol // the native token symbol, eg ETH, BNB, MATIC + rpcUrl?: string // used for network requests (eg Alchemy or Infura end point). PLEASE NOTE- if not included, users may have to manually add networks that do not already exist in their wallet. Recommended to include for best user experience. + label?: string // used for display, eg Ethereum Mainnet. Recommended to include for best user experience. + token?: TokenSymbol // the native token symbol, eg ETH, BNB, MATIC. Recommended to include for best user experience. color?: string // the color used to represent the chain and will be used as a background for the icon icon?: string // the icon to represent the chain publicRpcUrl?: string // an optional public RPC used when adding a new chain config to the wallet diff --git a/packages/core/package.json b/packages/core/package.json index 01f0b526f..c5f067413 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/core", - "version": "2.15.5-alpha.1", + "version": "2.15.5-alpha.2", "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", @@ -85,7 +85,7 @@ }, "dependencies": { "@unstoppabledomains/resolution": "^8.0", - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "bignumber.js": "^9.0.0", "bnc-sdk": "^4.6.7", "bowser": "^2.11.0", diff --git a/packages/core/src/store/actions.ts b/packages/core/src/store/actions.ts index 77d6c6e99..e7fd2a4db 100644 --- a/packages/core/src/store/actions.ts +++ b/packages/core/src/store/actions.ts @@ -71,7 +71,7 @@ export function addChains(chains: Chain[]): void { ...rest, namespace, id: id.toLowerCase(), - rpcUrl: rpcUrl.trim() + rpcUrl: rpcUrl ? rpcUrl.trim() : null })) } diff --git a/packages/core/src/views/shared/NetworkSelector.svelte b/packages/core/src/views/shared/NetworkSelector.svelte index ba38d6271..423d159bb 100644 --- a/packages/core/src/views/shared/NetworkSelector.svelte +++ b/packages/core/src/views/shared/NetworkSelector.svelte @@ -6,6 +6,7 @@ import { wallets$ } from '../../streams.js' import { distinctUntilChanged, debounceTime, skip } from 'rxjs/operators' import caretIcon from '../../icons/caret.js' + import { id } from 'ethers/lib/utils.js' export let selectIcon: string = caretIcon export let colorVar: string @@ -134,7 +135,7 @@ > {/if} {#each chains as chain (chain.id)} - + {/each} {/if} diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index 06050f844..2f80177f1 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -210,11 +210,14 @@ label: 'Goerli', rpcUrl: `https://goerli.infura.io/v3/${infura_key}` }, + // { + // id: '0x13881', + // token: 'MATIC', + // label: 'Polygon - Mumbai', + // rpcUrl: 'https://matic-mumbai.chainstacklabs.com ' + // }, { id: '0x13881', - token: 'MATIC', - label: 'Polygon - Mumbai', - rpcUrl: 'https://matic-mumbai.chainstacklabs.com ' }, { id: '0x38', @@ -228,11 +231,14 @@ label: 'Polygon', rpcUrl: 'https://matic-mainnet.chainstacklabs.com' }, + // { + // id: 10, + // token: 'OETH', + // label: 'Optimism', + // rpcUrl: 'https://mainnet.optimism.io' + // }, { id: 10, - token: 'OETH', - label: 'Optimism', - rpcUrl: 'https://mainnet.optimism.io' }, { id: 42161, @@ -630,6 +636,9 @@ + {/if} diff --git a/yarn.lock b/yarn.lock index 479154cf6..0660df04e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3427,6 +3427,15 @@ "@walletconnect/window-getters" "^1.0.1" tslib "1.14.1" +"@web3-onboard/common@^2.2.3": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@web3-onboard/common/-/common-2.2.3.tgz#fc0841186d84cf017f4cf0368dcd349e6ed8dc8b" + integrity sha512-ZI0XuCpxtuL9XGgeWglXR6rhgLP261EMEstjonxy8ptuOKLlTJcgvL7wSx2MjNDO3i/qmb/PGQpInvxYx5klSA== + dependencies: + bignumber.js "^9.1.0" + ethers "5.5.4" + joi "^17.6.1" + "@web3-react/abstract-connector@^6.0.7": version "6.0.7" resolved "https://registry.yarnpkg.com/@web3-react/abstract-connector/-/abstract-connector-6.0.7.tgz#401b3c045f1e0fab04256311be49d5144e9badc6" From 5bb32e810be88db8f89ca5a87736584267ff2aa0 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Tue, 14 Mar 2023 14:16:08 -0600 Subject: [PATCH 02/16] update docs --- docs/package.json | 2 +- docs/src/routes/docs/[...3]modules/core.md | 8 ++++---- packages/core/README.md | 6 +++--- packages/demo/src/App.svelte | 20 ++++++++++---------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/package.json b/docs/package.json index eed5828bd..58ceacbca 100644 --- a/docs/package.json +++ b/docs/package.json @@ -56,7 +56,7 @@ "dependencies": { "bnc-sdk": "^4.6.6", "@web3-onboard/coinbase": "^2.1.4", - "@web3-onboard/core": "^2.15.4", + "@web3-onboard/core": "^2.15.5-alpha.2", "@web3-onboard/dcent": "^2.2.3", "@web3-onboard/enkrypt": "^2.0.0", "@web3-onboard/fortmatic": "^2.0.14", diff --git a/docs/src/routes/docs/[...3]modules/core.md b/docs/src/routes/docs/[...3]modules/core.md index 2bbf20c1f..1cbf135c4 100644 --- a/docs/src/routes/docs/[...3]modules/core.md +++ b/docs/src/routes/docs/[...3]modules/core.md @@ -111,10 +111,10 @@ An array of Chains that your app supports: ```ts type Chain = { id: ChainId // hex encoded string, eg '0x1' for Ethereum Mainnet - namespace?: 'evm' // string indicating chain namespace. Defaults to 'evm' but will allow other chain namespaces in the future - rpcUrl: string // used for network requests - label: string // used for display, eg Ethereum Mainnet - token: TokenSymbol // the native token symbol, eg ETH, BNB, MATIC + namespace?: 'evm' // string indicating chain namespace. Defaults to 'evm' but will allow other chain namespaces in the future + rpcUrl?: string // Recommended to include. Used for network requests. + label?: string // Recommended to include. Used for display, eg Ethereum Mainnet. + token?: TokenSymbol // Recommended to include. The native token symbol, eg ETH, BNB, MATIC. color?: string // the color used to represent the chain and will be used as a background for the icon icon?: string // the icon to represent the chain publicRpcUrl?: string // an optional public RPC used when adding a new chain config to the wallet diff --git a/packages/core/README.md b/packages/core/README.md index d472205e3..ff3194b0d 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -82,9 +82,9 @@ An array of Chains that your app supports: type Chain = { id: ChainId // hex encoded string, eg '0x1' for Ethereum Mainnet namespace?: 'evm' // string indicating chain namespace. Defaults to 'evm' but will allow other chain namespaces in the future - rpcUrl?: string // used for network requests (eg Alchemy or Infura end point). PLEASE NOTE- if not included, users may have to manually add networks that do not already exist in their wallet. Recommended to include for best user experience. - label?: string // used for display, eg Ethereum Mainnet. Recommended to include for best user experience. - token?: TokenSymbol // the native token symbol, eg ETH, BNB, MATIC. Recommended to include for best user experience. + rpcUrl?: string // Recommended to include. Used for network requests (eg Alchemy or Infura end point). + label?: string // Recommended to include. Used for display, eg Ethereum Mainnet. + token?: TokenSymbol // Recommended to include. The native token symbol, eg ETH, BNB, MATIC. color?: string // the color used to represent the chain and will be used as a background for the icon icon?: string // the icon to represent the chain publicRpcUrl?: string // an optional public RPC used when adding a new chain config to the wallet diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index 2f80177f1..88b06c571 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -204,20 +204,20 @@ label: 'Ethereum', rpcUrl: `https://mainnet.infura.io/v3/${infura_key}` }, - { - id: '0x5', - token: 'ETH', - label: 'Goerli', - rpcUrl: `https://goerli.infura.io/v3/${infura_key}` - }, // { - // id: '0x13881', - // token: 'MATIC', - // label: 'Polygon - Mumbai', - // rpcUrl: 'https://matic-mumbai.chainstacklabs.com ' + // id: '0x5', + // token: 'ETH', + // label: 'Goerli', + // rpcUrl: `https://goerli.infura.io/v3/${infura_key}` // }, + { + id: '0x5' + }, { id: '0x13881', + token: 'MATIC', + label: 'Polygon - Mumbai', + rpcUrl: 'https://matic-mumbai.chainstacklabs.com ' }, { id: '0x38', From 49d4f60b592fb7c0c89e84387441493940568d61 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Tue, 14 Mar 2023 14:39:18 -0600 Subject: [PATCH 03/16] update common and core package references --- docs/package.json | 2 +- examples/with-sveltekit/package.json | 2 +- packages/coinbase/package.json | 2 +- packages/core/package.json | 2 +- packages/dcent/package.json | 2 +- packages/demo/package.json | 2 +- packages/enkrypt/package.json | 2 +- packages/fortmatic/package.json | 2 +- packages/frontier/package.json | 2 +- packages/gas/package.json | 2 +- packages/gnosis/package.json | 2 +- packages/hw-common/package.json | 2 +- packages/infinity-wallet/package.json | 2 +- packages/injected/package.json | 2 +- packages/keepkey/package.json | 2 +- packages/keystone/package.json | 2 +- packages/ledger/package.json | 2 +- packages/magic/package.json | 2 +- packages/mew-wallet/package.json | 2 +- packages/mew/package.json | 2 +- packages/phantom/package.json | 2 +- packages/portis/package.json | 2 +- packages/react/package.json | 4 ++-- packages/sequence/package.json | 2 +- packages/taho/package.json | 2 +- packages/tallyho/package.json | 2 +- packages/torus/package.json | 2 +- packages/transaction-preview/package.json | 2 +- packages/trezor/package.json | 2 +- packages/trust/package.json | 2 +- packages/uauth/package.json | 2 +- packages/vue/package.json | 4 ++-- packages/walletconnect/package.json | 2 +- packages/walletlink/package.json | 2 +- packages/web3auth/package.json | 2 +- packages/xdefi/package.json | 2 +- packages/zeal/package.json | 2 +- 37 files changed, 39 insertions(+), 39 deletions(-) diff --git a/docs/package.json b/docs/package.json index c7ad63ca9..0c4c0630c 100644 --- a/docs/package.json +++ b/docs/package.json @@ -56,7 +56,7 @@ "dependencies": { "bnc-sdk": "^4.6.6", "@web3-onboard/coinbase": "^2.1.4", - "@web3-onboard/core": "^2.15.5-alpha.2", + "@web3-onboard/core": "^2.15.6-alpha.1", "@web3-onboard/dcent": "^2.2.3", "@web3-onboard/enkrypt": "^2.0.0", "@web3-onboard/fortmatic": "^2.0.14", diff --git a/examples/with-sveltekit/package.json b/examples/with-sveltekit/package.json index a4063d2c4..4d08c2593 100644 --- a/examples/with-sveltekit/package.json +++ b/examples/with-sveltekit/package.json @@ -32,7 +32,7 @@ "type": "module", "dependencies": { "@fontsource/fira-mono": "^4.5.10", - "@web3-onboard/core": "^2.15.4", + "@web3-onboard/core": "^2.15.6-alpha.1", "@web3-onboard/injected-wallets": "^2.8.1", "@web3-onboard/walletconnect": "^2.3.1", "buffer": "^6.0.3" diff --git a/packages/coinbase/package.json b/packages/coinbase/package.json index 63b2f7434..6a0031738 100644 --- a/packages/coinbase/package.json +++ b/packages/coinbase/package.json @@ -59,6 +59,6 @@ }, "dependencies": { "@coinbase/wallet-sdk": "^3.6.0", - "@web3-onboard/common": "^2.2.3" + "@web3-onboard/common": "^2.2.4-alpha.1" } } diff --git a/packages/core/package.json b/packages/core/package.json index c5f067413..2e8563ce2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/core", - "version": "2.15.5-alpha.2", + "version": "2.15.6-alpha.1", "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/dcent/package.json b/packages/dcent/package.json index 9c8e0640e..5d4dac529 100644 --- a/packages/dcent/package.json +++ b/packages/dcent/package.json @@ -56,7 +56,7 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "@web3-onboard/hw-common": "^2.1.0", "@ethereumjs/tx": "^3.4.0", "@ethersproject/providers": "^5.5.0", diff --git a/packages/demo/package.json b/packages/demo/package.json index a725eb068..8b163067b 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -23,7 +23,7 @@ "webpack-dev-server": "4.7.4" }, "dependencies": { - "@web3-onboard/core": "^2.15.5", + "@web3-onboard/core": "^2.15.6-alpha.1", "@web3-onboard/coinbase": "^2.1.4", "@web3-onboard/transaction-preview": "^2.0.4", "@web3-onboard/dcent": "^2.2.3", diff --git a/packages/enkrypt/package.json b/packages/enkrypt/package.json index 427863cfa..52634660e 100644 --- a/packages/enkrypt/package.json +++ b/packages/enkrypt/package.json @@ -63,6 +63,6 @@ "window": "^4.2.7" }, "dependencies": { - "@web3-onboard/common": "^2.2.3" + "@web3-onboard/common": "^2.2.4-alpha.1" } } diff --git a/packages/fortmatic/package.json b/packages/fortmatic/package.json index f03397b50..6d1aa05cd 100644 --- a/packages/fortmatic/package.json +++ b/packages/fortmatic/package.json @@ -58,7 +58,7 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "fortmatic": "^2.2.1" } } diff --git a/packages/frontier/package.json b/packages/frontier/package.json index 534e34bf9..d33517854 100644 --- a/packages/frontier/package.json +++ b/packages/frontier/package.json @@ -59,6 +59,6 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/common": "^2.2.3" + "@web3-onboard/common": "^2.2.4-alpha.1" } } \ No newline at end of file diff --git a/packages/gas/package.json b/packages/gas/package.json index d05a8eb7c..5bf69287a 100644 --- a/packages/gas/package.json +++ b/packages/gas/package.json @@ -32,7 +32,7 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "rxjs": "^7.5.2", "joi": "^17.6.1" } diff --git a/packages/gnosis/package.json b/packages/gnosis/package.json index d72881f6a..595aa8e99 100644 --- a/packages/gnosis/package.json +++ b/packages/gnosis/package.json @@ -59,6 +59,6 @@ "dependencies": { "@gnosis.pm/safe-apps-provider": "^0.9.2", "@gnosis.pm/safe-apps-sdk": "^6.1.1", - "@web3-onboard/common": "^2.2.3" + "@web3-onboard/common": "^2.2.4-alpha.1" } } diff --git a/packages/hw-common/package.json b/packages/hw-common/package.json index 63bd58881..edc06ac21 100644 --- a/packages/hw-common/package.json +++ b/packages/hw-common/package.json @@ -81,7 +81,7 @@ }, "dependencies": { "@ethereumjs/common": "2.6.2", - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "ethers": "5.5.4", "joi": "^17.6.1", "rxjs": "^7.5.2" diff --git a/packages/infinity-wallet/package.json b/packages/infinity-wallet/package.json index da09f8095..9cfea40d6 100644 --- a/packages/infinity-wallet/package.json +++ b/packages/infinity-wallet/package.json @@ -60,7 +60,7 @@ "devDependencies": { "@types/node": "^17.0.21", "typescript": "^4.5.5", - "@web3-onboard/common": "^2.2.3" + "@web3-onboard/common": "^2.2.4-alpha.1" }, "dependencies": { "@infinitywallet/infinity-connector": "^1.0.6" diff --git a/packages/injected/package.json b/packages/injected/package.json index 9c311e0c8..a33da9880 100644 --- a/packages/injected/package.json +++ b/packages/injected/package.json @@ -64,7 +64,7 @@ "window": "^4.2.7" }, "dependencies": { - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "joi": "^17.6.1", "lodash.uniqby": "^4.7.0" } diff --git a/packages/keepkey/package.json b/packages/keepkey/package.json index a261cd33c..f856ac301 100644 --- a/packages/keepkey/package.json +++ b/packages/keepkey/package.json @@ -63,7 +63,7 @@ "@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/common": "^2.2.4-alpha.1", "@web3-onboard/hw-common": "^2.1.0", "ethereumjs-util": "^7.1.3" } diff --git a/packages/keystone/package.json b/packages/keystone/package.json index 2ed61e523..88959756e 100644 --- a/packages/keystone/package.json +++ b/packages/keystone/package.json @@ -58,7 +58,7 @@ "@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/common": "^2.2.4-alpha.1", "@web3-onboard/hw-common": "^2.1.0" } } diff --git a/packages/ledger/package.json b/packages/ledger/package.json index 728bb43c5..7d46f3c77 100644 --- a/packages/ledger/package.json +++ b/packages/ledger/package.json @@ -61,7 +61,7 @@ "@ethersproject/providers": "^5.5.0", "@ledgerhq/connect-kit-loader": "^1.0.2", "@walletconnect/client": "^1.7.1", - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "rxjs": "^7.5.2" } } diff --git a/packages/magic/package.json b/packages/magic/package.json index eeee6f979..71e96a512 100644 --- a/packages/magic/package.json +++ b/packages/magic/package.json @@ -80,7 +80,7 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "joi": "^17.6.1", "magic-sdk": "^8.1.0", "rxjs": "^7.5.2" diff --git a/packages/mew-wallet/package.json b/packages/mew-wallet/package.json index 59e4ba969..f21274dac 100644 --- a/packages/mew-wallet/package.json +++ b/packages/mew-wallet/package.json @@ -64,7 +64,7 @@ "window": "^4.2.7" }, "dependencies": { - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "lodash.uniqby": "^4.7.0" } } diff --git a/packages/mew/package.json b/packages/mew/package.json index cff0d049e..a8654ab4d 100644 --- a/packages/mew/package.json +++ b/packages/mew/package.json @@ -59,7 +59,7 @@ "@myetherwallet/mewconnect-web-client": "^2.2.0-beta.14" }, "dependencies": { - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "rxjs": "^7.5.2" } } diff --git a/packages/phantom/package.json b/packages/phantom/package.json index a49ce7e67..0b2e6cbf7 100644 --- a/packages/phantom/package.json +++ b/packages/phantom/package.json @@ -59,6 +59,6 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/common": "^2.2.3" + "@web3-onboard/common": "^2.2.4-alpha.1" } } diff --git a/packages/portis/package.json b/packages/portis/package.json index a5aadf564..2da95fffe 100644 --- a/packages/portis/package.json +++ b/packages/portis/package.json @@ -57,6 +57,6 @@ }, "dependencies": { "@portis/web3": "^4.0.6", - "@web3-onboard/common": "^2.2.3" + "@web3-onboard/common": "^2.2.4-alpha.1" } } diff --git a/packages/react/package.json b/packages/react/package.json index a7c2754d9..d2bd0e637 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -62,8 +62,8 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/core": "^2.15.5", - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/core": "^2.15.6-alpha.1", + "@web3-onboard/common": "^2.2.4-alpha.1", "use-sync-external-store": "1.0.0" }, "peerDependencies": { diff --git a/packages/sequence/package.json b/packages/sequence/package.json index 5530b5ef4..f16de3739 100644 --- a/packages/sequence/package.json +++ b/packages/sequence/package.json @@ -56,7 +56,7 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "0xsequence": "^0.43.1" }, "peerDependencies": { diff --git a/packages/taho/package.json b/packages/taho/package.json index 35d849adc..fe5417e7d 100644 --- a/packages/taho/package.json +++ b/packages/taho/package.json @@ -66,7 +66,7 @@ "window": "^4.2.7" }, "dependencies": { - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "tallyho-detect-provider": "^1.0.0", "tallyho-onboarding": "^1.0.2" } diff --git a/packages/tallyho/package.json b/packages/tallyho/package.json index 2c90892db..3cb8b6e9f 100644 --- a/packages/tallyho/package.json +++ b/packages/tallyho/package.json @@ -64,7 +64,7 @@ "window": "^4.2.7" }, "dependencies": { - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "tallyho-detect-provider": "^1.0.0", "tallyho-onboarding": "^1.0.2" } diff --git a/packages/torus/package.json b/packages/torus/package.json index 6342f7a69..1122d1154 100644 --- a/packages/torus/package.json +++ b/packages/torus/package.json @@ -58,6 +58,6 @@ }, "dependencies": { "@toruslabs/torus-embed": "1.38.2", - "@web3-onboard/common": "^2.2.3" + "@web3-onboard/common": "^2.2.4-alpha.1" } } diff --git a/packages/transaction-preview/package.json b/packages/transaction-preview/package.json index ced0f57f4..94d016906 100644 --- a/packages/transaction-preview/package.json +++ b/packages/transaction-preview/package.json @@ -80,7 +80,7 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "bnc-sdk": "^4.6.7", "bowser": "^2.11.0", "joi": "^17.6.1", diff --git a/packages/trezor/package.json b/packages/trezor/package.json index dcc094df1..a9a5294d9 100644 --- a/packages/trezor/package.json +++ b/packages/trezor/package.json @@ -60,7 +60,7 @@ "dependencies": { "@ethereumjs/tx": "^3.4.0", "@ethersproject/providers": "^5.5.0", - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "@web3-onboard/hw-common": "^2.1.0", "buffer": "^6.0.3", "eth-crypto": "^2.1.0", diff --git a/packages/trust/package.json b/packages/trust/package.json index 99e90a8d8..02e5ff88f 100644 --- a/packages/trust/package.json +++ b/packages/trust/package.json @@ -61,6 +61,6 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/common": "^2.2.3" + "@web3-onboard/common": "^2.2.4-alpha.1" } } diff --git a/packages/uauth/package.json b/packages/uauth/package.json index 6a66ee268..13143c1dc 100644 --- a/packages/uauth/package.json +++ b/packages/uauth/package.json @@ -65,7 +65,7 @@ "@ethersproject/providers": "^5.5.0", "@walletconnect/client": "^1.7.1", "@walletconnect/qrcode-modal": "^1.7.1", - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "joi": "^17.6.1", "rxjs": "^7.5.2" } diff --git a/packages/vue/package.json b/packages/vue/package.json index b22a602e8..55f1831c9 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -62,8 +62,8 @@ "dependencies": { "@vueuse/core": "^8.4.2", "@vueuse/rxjs": "^8.2.0", - "@web3-onboard/common": "^2.2.3", - "@web3-onboard/core": "^2.15.5", + "@web3-onboard/common": "^2.2.4-alpha.1", + "@web3-onboard/core": "^2.15.6-alpha.1", "vue-demi": "^0.12.4" }, "peerDependencies": { diff --git a/packages/walletconnect/package.json b/packages/walletconnect/package.json index e010909dd..58475a7cc 100644 --- a/packages/walletconnect/package.json +++ b/packages/walletconnect/package.json @@ -63,7 +63,7 @@ "@walletconnect/ethereum-provider": "2.4.10", "@walletconnect/client": "^1.8.0", "@walletconnect/qrcode-modal": "^1.8.0", - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "rxjs": "^7.5.2" } } diff --git a/packages/walletlink/package.json b/packages/walletlink/package.json index 131091d6d..54962a765 100644 --- a/packages/walletlink/package.json +++ b/packages/walletlink/package.json @@ -58,7 +58,7 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "walletlink": "^2.5.0" } } diff --git a/packages/web3auth/package.json b/packages/web3auth/package.json index 862f2f5fa..2b3396ee2 100644 --- a/packages/web3auth/package.json +++ b/packages/web3auth/package.json @@ -56,7 +56,7 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/common": "^2.2.3", + "@web3-onboard/common": "^2.2.4-alpha.1", "@web3auth/base": "^3.3.0", "@web3auth/modal": "^3.3.0" } diff --git a/packages/xdefi/package.json b/packages/xdefi/package.json index d36b3ca45..c6e76c403 100644 --- a/packages/xdefi/package.json +++ b/packages/xdefi/package.json @@ -64,6 +64,6 @@ "window": "^4.2.7" }, "dependencies": { - "@web3-onboard/common": "^2.2.3" + "@web3-onboard/common": "^2.2.4-alpha.1" } } diff --git a/packages/zeal/package.json b/packages/zeal/package.json index 572c191dc..1e8dce97c 100644 --- a/packages/zeal/package.json +++ b/packages/zeal/package.json @@ -54,6 +54,6 @@ "window": "^4.2.7" }, "dependencies": { - "@web3-onboard/common": "^2.2.3" + "@web3-onboard/common": "^2.2.4-alpha.1" } } From cbc69de3ffd95beb358b3ae40dded1ee89203a72 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Tue, 14 Mar 2023 15:19:36 -0600 Subject: [PATCH 04/16] update all packages that use core and common --- docs/package.json | 40 ++++++++-------- docs/src/routes/docs/[...3]modules/core.md | 2 + examples/with-ledger/package.json | 2 +- examples/with-nextjs-13/package.json | 26 +++++------ examples/with-sveltekit/package.json | 4 +- examples/with-vite-react/package.json | 24 +++++----- examples/with-vuejs-v2/package.json | 2 +- examples/with-vuejs/package.json | 2 +- packages/coinbase/package.json | 2 +- packages/core/README.md | 4 +- packages/core/package.json | 2 +- .../src/views/shared/NetworkSelector.svelte | 2 +- packages/dcent/package.json | 4 +- packages/demo/package.json | 46 +++++++++---------- packages/demo/src/App.svelte | 20 +++----- packages/enkrypt/package.json | 2 +- packages/fortmatic/package.json | 2 +- packages/frontier/package.json | 2 +- packages/gas/package.json | 2 +- packages/gnosis/package.json | 2 +- packages/hw-common/package.json | 2 +- packages/infinity-wallet/package.json | 2 +- packages/injected/package.json | 2 +- packages/keepkey/package.json | 2 +- packages/keystone/package.json | 4 +- packages/ledger/package.json | 2 +- packages/magic/package.json | 2 +- packages/mew-wallet/package.json | 2 +- packages/mew/package.json | 2 +- packages/phantom/package.json | 2 +- packages/portis/package.json | 2 +- packages/react/package.json | 2 +- packages/sequence/package.json | 2 +- packages/taho/package.json | 2 +- packages/tallyho/package.json | 2 +- packages/torus/package.json | 2 +- packages/trezor/package.json | 4 +- packages/trust/package.json | 2 +- packages/uauth/package.json | 2 +- packages/vue/package.json | 2 +- packages/walletconnect/package.json | 2 +- packages/walletlink/package.json | 2 +- packages/web3auth/package.json | 2 +- packages/xdefi/package.json | 2 +- packages/zeal/package.json | 2 +- 45 files changed, 122 insertions(+), 124 deletions(-) diff --git a/docs/package.json b/docs/package.json index 0c4c0630c..2173bce4b 100644 --- a/docs/package.json +++ b/docs/package.json @@ -55,31 +55,31 @@ "type": "module", "dependencies": { "bnc-sdk": "^4.6.6", - "@web3-onboard/coinbase": "^2.1.4", + "@web3-onboard/coinbase": "^2.2.1-alpha.1", "@web3-onboard/core": "^2.15.6-alpha.1", - "@web3-onboard/dcent": "^2.2.3", - "@web3-onboard/enkrypt": "^2.0.0", + "@web3-onboard/dcent": "^2.2.4-alpha.1", + "@web3-onboard/enkrypt": "^2.0.1-alpha.1", "@web3-onboard/fortmatic": "^2.0.14", - "@web3-onboard/gas": "^2.1.4", - "@web3-onboard/gnosis": "^2.1.6", - "@web3-onboard/infinity-wallet": "^2.0.0", - "@web3-onboard/injected-wallets": "^2.8.1", + "@web3-onboard/gas": "^2.1.5-alpha.1", + "@web3-onboard/gnosis": "^2.1.7-alpha.1", + "@web3-onboard/infinity-wallet": "^2.0.1-alpha.1", + "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", "@web3-onboard/keepkey": "^2.3.3", - "@web3-onboard/keystone": "^2.3.3", - "@web3-onboard/ledger": "^2.4.2", - "@web3-onboard/magic": "^2.1.3", + "@web3-onboard/keystone": "^2.3.4-alpha.1", + "@web3-onboard/ledger": "^2.4.3-alpha.1", + "@web3-onboard/magic": "^2.1.4-alpha.1", "@web3-onboard/mew-wallet": "^2.0.0", - "@web3-onboard/portis": "^2.1.3", - "@web3-onboard/sequence": "^2.0.4", - "@web3-onboard/taho": "^2.0.0", - "@web3-onboard/torus": "^2.2.0", + "@web3-onboard/portis": "^2.1.4-alpha.1", + "@web3-onboard/sequence": "^2.0.5-alpha.1", + "@web3-onboard/taho": "^2.0.1-alpha.1", + "@web3-onboard/torus": "^2.2.2-alpha.1", "@web3-onboard/transaction-preview": "^2.0.4", - "@web3-onboard/trezor": "^2.3.3", - "@web3-onboard/trust": "^2.0.0", - "@web3-onboard/uauth": "^2.0.1", - "@web3-onboard/walletconnect": "^2.3.2", - "@web3-onboard/web3auth": "^2.1.4", - "@web3-onboard/xdefi": "^2.0.0", + "@web3-onboard/trezor": "^2.3.4-alpha.1", + "@web3-onboard/trust": "^2.0.1-alpha.1", + "@web3-onboard/uauth": "^2.0.2-alpha.1", + "@web3-onboard/walletconnect": "^2.3.3.-alpha.1", + "@web3-onboard/web3auth": "^2.1.5-alpha.1", + "@web3-onboard/xdefi": "^2.0.1-alpha.1", "animejs": "^3.2.1", "ethers": "^5.7.0" } diff --git a/docs/src/routes/docs/[...3]modules/core.md b/docs/src/routes/docs/[...3]modules/core.md index be8c8100d..2ce94f2b1 100644 --- a/docs/src/routes/docs/[...3]modules/core.md +++ b/docs/src/routes/docs/[...3]modules/core.md @@ -114,6 +114,8 @@ An array of Chains that your app supports: type Chain = { id: ChainId // hex encoded string, eg '0x1' for Ethereum Mainnet namespace?: 'evm' // string indicating chain namespace. Defaults to 'evm' but will allow other chain namespaces in the future + // PLEASE NOTE: Some wallets require an rpcUrl, label, and token for actions such as adding a new chain. + // It is recommended to include rpcUrl, label, and token for full functionality. rpcUrl?: string // Recommended to include. Used for network requests. label?: string // Recommended to include. Used for display, eg Ethereum Mainnet. token?: TokenSymbol // Recommended to include. The native token symbol, eg ETH, BNB, MATIC. diff --git a/examples/with-ledger/package.json b/examples/with-ledger/package.json index b166a44c6..58ba7ad94 100644 --- a/examples/with-ledger/package.json +++ b/examples/with-ledger/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@web3-onboard/ledger": "^2.1.6", + "@web3-onboard/ledger": "^2.4.3-alpha.1", "@web3-onboard/react": "^2.4.1", "next": "12.2.4", "react": "18.2.0", diff --git a/examples/with-nextjs-13/package.json b/examples/with-nextjs-13/package.json index ece23ace8..276c68189 100644 --- a/examples/with-nextjs-13/package.json +++ b/examples/with-nextjs-13/package.json @@ -12,23 +12,23 @@ "@types/node": "18.11.11", "@types/react": "18.0.26", "@types/react-dom": "18.0.9", - "@web3-onboard/coinbase": "^2.1.3", - "@web3-onboard/dcent": "^2.2.1", + "@web3-onboard/coinbase": "^2.2.1-alpha.1", + "@web3-onboard/dcent": "^2.2.4-alpha.1", "@web3-onboard/fortmatic": "^2.0.14", - "@web3-onboard/gnosis": "^2.1.3", - "@web3-onboard/injected-wallets": "^2.6.2", + "@web3-onboard/gnosis": "^2.1.7-alpha.1", + "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", "@web3-onboard/keepkey": "^2.3.1", - "@web3-onboard/keystone": "^2.3.1", - "@web3-onboard/ledger": "^2.3.1", - "@web3-onboard/magic": "^2.1.3", + "@web3-onboard/keystone": "^2.3.4-alpha.1", + "@web3-onboard/ledger": "^2.4.3-alpha.1", + "@web3-onboard/magic": "^2.1.4-alpha.1", "@web3-onboard/mew-wallet": "^2.0.0", - "@web3-onboard/portis": "^2.1.3", + "@web3-onboard/portis": "^2.1.4-alpha.1", "@web3-onboard/react": "^2.6.1", - "@web3-onboard/sequence": "^2.0.3", - "@web3-onboard/taho": "^2.0.0", - "@web3-onboard/torus": "^2.1.3", - "@web3-onboard/trezor": "^2.3.1", - "@web3-onboard/walletconnect": "^2.1.3", + "@web3-onboard/sequence": "^2.0.5-alpha.1", + "@web3-onboard/taho": "^2.0.1-alpha.1", + "@web3-onboard/torus": "^2.2.2-alpha.1", + "@web3-onboard/trezor": "^2.3.4-alpha.1", + "@web3-onboard/walletconnect": "^2.3.3.-alpha.1", "ethers": "^5.7.2", "next": "13.1.6", "react": "18.2.0", diff --git a/examples/with-sveltekit/package.json b/examples/with-sveltekit/package.json index 4d08c2593..63cb51e4c 100644 --- a/examples/with-sveltekit/package.json +++ b/examples/with-sveltekit/package.json @@ -33,8 +33,8 @@ "dependencies": { "@fontsource/fira-mono": "^4.5.10", "@web3-onboard/core": "^2.15.6-alpha.1", - "@web3-onboard/injected-wallets": "^2.8.1", - "@web3-onboard/walletconnect": "^2.3.1", + "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", + "@web3-onboard/walletconnect": "^2.3.3.-alpha.1", "buffer": "^6.0.3" } } diff --git a/examples/with-vite-react/package.json b/examples/with-vite-react/package.json index f5ed7075d..caae01338 100644 --- a/examples/with-vite-react/package.json +++ b/examples/with-vite-react/package.json @@ -9,23 +9,23 @@ "preview": "vite preview" }, "dependencies": { - "@web3-onboard/coinbase": "^2.1.3", - "@web3-onboard/dcent": "^2.2.1", + "@web3-onboard/coinbase": "^2.2.1-alpha.1", + "@web3-onboard/dcent": "^2.2.4-alpha.1", "@web3-onboard/fortmatic": "^2.0.14", - "@web3-onboard/gnosis": "^2.1.5", - "@web3-onboard/injected-wallets": "^2.6.2", + "@web3-onboard/gnosis": "^2.1.7-alpha.1", + "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", "@web3-onboard/keepkey": "^2.3.1", - "@web3-onboard/keystone": "^2.3.1", - "@web3-onboard/ledger": "^2.3.1", - "@web3-onboard/magic": "^2.1.3", + "@web3-onboard/keystone": "^2.3.4-alpha.1", + "@web3-onboard/ledger": "^2.4.3-alpha.1", + "@web3-onboard/magic": "^2.1.4-alpha.1", "@web3-onboard/mew": "^2.1.3", - "@web3-onboard/portis": "^2.1.3", + "@web3-onboard/portis": "^2.1.4-alpha.1", "@web3-onboard/react": "^2.4.1", - "@web3-onboard/sequence": "^2.0.3", + "@web3-onboard/sequence": "^2.0.5-alpha.1", "@web3-onboard/tallyho": "^2.0.1", - "@web3-onboard/torus": "^2.1.3", - "@web3-onboard/trezor": "^2.3.1", - "@web3-onboard/walletconnect": "^2.2.0", + "@web3-onboard/torus": "^2.2.2-alpha.1", + "@web3-onboard/trezor": "^2.3.4-alpha.1", + "@web3-onboard/walletconnect": "^2.3.3.-alpha.1", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/examples/with-vuejs-v2/package.json b/examples/with-vuejs-v2/package.json index 1f1d008f0..cdccb92fd 100644 --- a/examples/with-vuejs-v2/package.json +++ b/examples/with-vuejs-v2/package.json @@ -7,7 +7,7 @@ "serve": "vite preview" }, "dependencies": { - "@web3-onboard/injected-wallets": "^2.6.2", + "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", "@web3-onboard/vue": "^2.5.1", "vue": "^2.7.14", "vue-template-compiler": "2.7.14" diff --git a/examples/with-vuejs/package.json b/examples/with-vuejs/package.json index f5f46ed28..c7d45e1b5 100644 --- a/examples/with-vuejs/package.json +++ b/examples/with-vuejs/package.json @@ -8,7 +8,7 @@ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore" }, "dependencies": { - "@web3-onboard/injected-wallets": "^2.6.2", + "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", "@web3-onboard/vue": "^2.5.1", "pinia": "^2.0.29", "vue": "^3.2.45", diff --git a/packages/coinbase/package.json b/packages/coinbase/package.json index 6a0031738..5e96854b0 100644 --- a/packages/coinbase/package.json +++ b/packages/coinbase/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/coinbase", - "version": "2.2.0", + "version": "2.2.1-alpha.1", "description": "Coinbase SDK wallet module for connecting to Web3-Onboard. 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, 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/README.md b/packages/core/README.md index ff3194b0d..82d432746 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -82,7 +82,9 @@ An array of Chains that your app supports: type Chain = { id: ChainId // hex encoded string, eg '0x1' for Ethereum Mainnet namespace?: 'evm' // string indicating chain namespace. Defaults to 'evm' but will allow other chain namespaces in the future - rpcUrl?: string // Recommended to include. Used for network requests (eg Alchemy or Infura end point). + // PLEASE NOTE: Some wallets require an rpcUrl, label, and token for actions such as adding a new chain. + // It is recommended to include rpcUrl, label, and token for full functionality. + rpcUrl?: string // Recommended to include. Used for network requests (eg Alchemy or Infura end point). label?: string // Recommended to include. Used for display, eg Ethereum Mainnet. token?: TokenSymbol // Recommended to include. The native token symbol, eg ETH, BNB, MATIC. color?: string // the color used to represent the chain and will be used as a background for the icon diff --git a/packages/core/package.json b/packages/core/package.json index 2e8563ce2..5419cc068 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -69,7 +69,7 @@ "@types/lodash.partition": "^4.6.6", "@typescript-eslint/eslint-plugin": "^4.31.1", "@typescript-eslint/parser": "^4.31.1", - "@web3-onboard/gas": "^2.0.0", + "@web3-onboard/gas": "^2.1.5-alpha.1", "@web3-onboard/transaction-preview": "^2.0.4", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", diff --git a/packages/core/src/views/shared/NetworkSelector.svelte b/packages/core/src/views/shared/NetworkSelector.svelte index 423d159bb..fb6363c64 100644 --- a/packages/core/src/views/shared/NetworkSelector.svelte +++ b/packages/core/src/views/shared/NetworkSelector.svelte @@ -135,7 +135,7 @@ > {/if} {#each chains as chain (chain.id)} - + {/each} {/if} diff --git a/packages/dcent/package.json b/packages/dcent/package.json index 5d4dac529..4eb93c463 100644 --- a/packages/dcent/package.json +++ b/packages/dcent/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/dcent", - "version": "2.2.3", + "version": "2.2.4-alpha.1", "description": "D'CENT wallet module for connecting to Web3-Onboard. 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, 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", @@ -57,7 +57,7 @@ }, "dependencies": { "@web3-onboard/common": "^2.2.4-alpha.1", - "@web3-onboard/hw-common": "^2.1.0", + "@web3-onboard/hw-common": "^2.1.1-alpha.1", "@ethereumjs/tx": "^3.4.0", "@ethersproject/providers": "^5.5.0", "eth-dcent-keyring": "^0.2.2" diff --git a/packages/demo/package.json b/packages/demo/package.json index 8b163067b..50ed88789 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -24,33 +24,33 @@ }, "dependencies": { "@web3-onboard/core": "^2.15.6-alpha.1", - "@web3-onboard/coinbase": "^2.1.4", + "@web3-onboard/coinbase": "^2.2.1-alpha.1", "@web3-onboard/transaction-preview": "^2.0.4", - "@web3-onboard/dcent": "^2.2.3", - "@web3-onboard/frontier": "^2.0.0", + "@web3-onboard/dcent": "^2.2.4-alpha.1", + "@web3-onboard/frontier": "^2.0.1-alpha.1", "@web3-onboard/fortmatic": "^2.0.14", - "@web3-onboard/gas": "^2.1.3", - "@web3-onboard/gnosis": "^2.1.6", + "@web3-onboard/gas": "^2.1.5-alpha.1", + "@web3-onboard/gnosis": "^2.1.7-alpha.1", "@web3-onboard/keepkey": "^2.3.3", - "@web3-onboard/keystone": "^2.3.3", - "@web3-onboard/ledger": "^2.4.2", - "@web3-onboard/infinity-wallet": "^2.0.0", - "@web3-onboard/injected-wallets": "^2.8.2", - "@web3-onboard/magic": "^2.1.3", - "@web3-onboard/phantom": "^2.0.0-alpha.1", - "@web3-onboard/portis": "^2.1.3", - "@web3-onboard/sequence": "^2.0.4", - "@web3-onboard/trezor": "^2.3.3", - "@web3-onboard/trust": "^2.0.0", - "@web3-onboard/torus": "^2.2.1", - "@web3-onboard/taho": "^2.0.0", - "@web3-onboard/web3auth": "^2.1.4", - "@web3-onboard/walletconnect": "^2.3.2", - "@web3-onboard/enkrypt": "^2.0.0", + "@web3-onboard/keystone": "^2.3.4-alpha.1", + "@web3-onboard/ledger": "^2.4.3-alpha.1", + "@web3-onboard/infinity-wallet": "^2.0.1-alpha.1", + "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", + "@web3-onboard/magic": "^2.1.4-alpha.1", + "@web3-onboard/phantom": "^2.0.0-alpha.2", + "@web3-onboard/portis": "^2.1.4-alpha.1", + "@web3-onboard/sequence": "^2.0.5-alpha.1", + "@web3-onboard/trezor": "^2.3.4-alpha.1", + "@web3-onboard/trust": "^2.0.1-alpha.1", + "@web3-onboard/torus": "^2.2.2-alpha.1", + "@web3-onboard/taho": "^2.0.1-alpha.1", + "@web3-onboard/web3auth": "^2.1.5-alpha.1", + "@web3-onboard/walletconnect": "^2.3.3.-alpha.1", + "@web3-onboard/enkrypt": "^2.0.1-alpha.1", "@web3-onboard/mew-wallet": "^2.0.0", - "@web3-onboard/xdefi": "^2.0.0", - "@web3-onboard/uauth": "^2.0.0", - "@web3-onboard/zeal": "^2.0.0", + "@web3-onboard/xdefi": "^2.0.1-alpha.1", + "@web3-onboard/uauth": "^2.0.2-alpha.1", + "@web3-onboard/zeal": "^2.0.1-alpha.1", "vconsole": "^3.9.5" }, "license": "MIT", diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index 941506717..a005805ec 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -206,14 +206,11 @@ label: 'Ethereum', rpcUrl: `https://mainnet.infura.io/v3/${infura_key}` }, - // { - // id: '0x5', - // token: 'ETH', - // label: 'Goerli', - // rpcUrl: `https://goerli.infura.io/v3/${infura_key}` - // }, { - id: '0x5' + id: '0x5', + token: 'ETH', + label: 'Goerli', + rpcUrl: `https://goerli.infura.io/v3/${infura_key}` }, { id: '0x13881', @@ -233,14 +230,11 @@ label: 'Polygon', rpcUrl: 'https://matic-mainnet.chainstacklabs.com' }, - // { - // id: 10, - // token: 'OETH', - // label: 'Optimism', - // rpcUrl: 'https://mainnet.optimism.io' - // }, { id: 10, + token: 'OETH', + label: 'Optimism', + rpcUrl: 'https://mainnet.optimism.io' }, { id: 42161, diff --git a/packages/enkrypt/package.json b/packages/enkrypt/package.json index 52634660e..b0649ff9e 100644 --- a/packages/enkrypt/package.json +++ b/packages/enkrypt/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/enkrypt", - "version": "2.0.0", + "version": "2.0.1-alpha.1", "description": "Enkrypt SDK wallet module for connecting to Web3-Onboard. 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, 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/fortmatic/package.json b/packages/fortmatic/package.json index 6d1aa05cd..034f267df 100644 --- a/packages/fortmatic/package.json +++ b/packages/fortmatic/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/fortmatic", - "version": "2.0.15", + "version": "2.0.16-alpha.1", "description": "Fortmatic wallet module for connecting to Web3-Onboard. 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, 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/frontier/package.json b/packages/frontier/package.json index d33517854..6e430ce21 100644 --- a/packages/frontier/package.json +++ b/packages/frontier/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/frontier", - "version": "2.0.0", + "version": "2.0.1-alpha.1", "description": "Frontier Wallet SDK wallet module for connecting to Web3-Onboard. 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/gas/package.json b/packages/gas/package.json index 5bf69287a..062b67a96 100644 --- a/packages/gas/package.json +++ b/packages/gas/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/gas", - "version": "2.1.4", + "version": "2.1.5-alpha.1", "description": "Estimate the gas prices needed to get a transaction in to the next block for Ethereum Mainnet and Polygon Matic Mainnet.", "keywords": [ "gas", diff --git a/packages/gnosis/package.json b/packages/gnosis/package.json index 595aa8e99..593de7d26 100644 --- a/packages/gnosis/package.json +++ b/packages/gnosis/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/gnosis", - "version": "2.1.6", + "version": "2.1.7-alpha.1", "description": "Gnosis Safe module for connecting to Web3-Onboard. 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, 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/hw-common/package.json b/packages/hw-common/package.json index edc06ac21..8339f6718 100644 --- a/packages/hw-common/package.json +++ b/packages/hw-common/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/hw-common", - "version": "2.1.0", + "version": "2.1.1-alpha.1", "description": "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, 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/infinity-wallet/package.json b/packages/infinity-wallet/package.json index 9cfea40d6..9dbea9ba5 100644 --- a/packages/infinity-wallet/package.json +++ b/packages/infinity-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/infinity-wallet", - "version": "2.0.0", + "version": "2.0.1-alpha.1", "description": "Infinity Wallet SDK wallet module for connecting to Web3-Onboard. 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/injected/package.json b/packages/injected/package.json index a33da9880..9622b071c 100644 --- a/packages/injected/package.json +++ b/packages/injected/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/injected-wallets", - "version": "2.8.2", + "version": "2.8.3-alpha.1", "description": "Injected wallet module for connecting browser extension and mobile wallets to Web3-Onboard. 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, 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/keepkey/package.json b/packages/keepkey/package.json index f856ac301..d69bbb43b 100644 --- a/packages/keepkey/package.json +++ b/packages/keepkey/package.json @@ -64,7 +64,7 @@ "@shapeshiftoss/hdwallet-core": "^1.15.2", "@shapeshiftoss/hdwallet-keepkey-webusb": "^1.15.2", "@web3-onboard/common": "^2.2.4-alpha.1", - "@web3-onboard/hw-common": "^2.1.0", + "@web3-onboard/hw-common": "^2.1.1-alpha.1", "ethereumjs-util": "^7.1.3" } } diff --git a/packages/keystone/package.json b/packages/keystone/package.json index 88959756e..1cba9b5d2 100644 --- a/packages/keystone/package.json +++ b/packages/keystone/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/keystone", - "version": "2.3.3", + "version": "2.3.4-alpha.1", "description": "Keystone hardware wallet module for connecting to Web3-Onboard. 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, 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", @@ -59,6 +59,6 @@ "@ethersproject/providers": "^5.5.0", "@keystonehq/eth-keyring": "^0.14.00.3", "@web3-onboard/common": "^2.2.4-alpha.1", - "@web3-onboard/hw-common": "^2.1.0" + "@web3-onboard/hw-common": "^2.1.1-alpha.1" } } diff --git a/packages/ledger/package.json b/packages/ledger/package.json index 7d46f3c77..3aff5776e 100644 --- a/packages/ledger/package.json +++ b/packages/ledger/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/ledger", - "version": "2.4.2", + "version": "2.4.3-alpha.1", "description": "Ledger hardare wallet module for connecting to Web3-Onboard. 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, 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/magic/package.json b/packages/magic/package.json index 71e96a512..9c130b724 100644 --- a/packages/magic/package.json +++ b/packages/magic/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/magic", - "version": "2.1.3", + "version": "2.1.4-alpha.1", "description": "Magic SDK wallet module for connecting to Web3-Onboard. 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, 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/mew-wallet/package.json b/packages/mew-wallet/package.json index f21274dac..20fc20860 100644 --- a/packages/mew-wallet/package.json +++ b/packages/mew-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/mew-wallet", - "version": "2.0.0", + "version": "2.0.1-alpha.1", "description": "MEW (MyEtherWallet) Wallet SDK wallet module for connecting to Web3-Onboard. 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, 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/mew/package.json b/packages/mew/package.json index a8654ab4d..cff0d049e 100644 --- a/packages/mew/package.json +++ b/packages/mew/package.json @@ -59,7 +59,7 @@ "@myetherwallet/mewconnect-web-client": "^2.2.0-beta.14" }, "dependencies": { - "@web3-onboard/common": "^2.2.4-alpha.1", + "@web3-onboard/common": "^2.2.3", "rxjs": "^7.5.2" } } diff --git a/packages/phantom/package.json b/packages/phantom/package.json index 0b2e6cbf7..ad593f55c 100644 --- a/packages/phantom/package.json +++ b/packages/phantom/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/phantom", - "version": "2.0.0-alpha.1", + "version": "2.0.0-alpha.2", "description": "Phantom wallet module for connecting to Web3-Onboard. 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/portis/package.json b/packages/portis/package.json index 2da95fffe..0683544dd 100644 --- a/packages/portis/package.json +++ b/packages/portis/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/portis", - "version": "2.1.3", + "version": "2.1.4-alpha.1", "description": "Portis SDK wallet module for connecting to Web3-Onboard. 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, 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/react/package.json b/packages/react/package.json index d2bd0e637..7f2ccb2bf 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/react", - "version": "2.6.6", + "version": "2.6.7-alpha.1", "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", diff --git a/packages/sequence/package.json b/packages/sequence/package.json index f16de3739..d5da06088 100644 --- a/packages/sequence/package.json +++ b/packages/sequence/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/sequence", - "version": "2.0.4", + "version": "2.0.5-alpha.1", "description": "Sequence is the smartest Web3 wallet. Easy, fun and secure.", "keywords": [ "Ethereum", diff --git a/packages/taho/package.json b/packages/taho/package.json index fe5417e7d..ddc25c76f 100644 --- a/packages/taho/package.json +++ b/packages/taho/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/taho", - "version": "2.0.0", + "version": "2.0.1-alpha.1", "description": "Taho SDK wallet module for connecting to Web3-Onboard. 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, 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/tallyho/package.json b/packages/tallyho/package.json index 3cb8b6e9f..2c90892db 100644 --- a/packages/tallyho/package.json +++ b/packages/tallyho/package.json @@ -64,7 +64,7 @@ "window": "^4.2.7" }, "dependencies": { - "@web3-onboard/common": "^2.2.4-alpha.1", + "@web3-onboard/common": "^2.2.3", "tallyho-detect-provider": "^1.0.0", "tallyho-onboarding": "^1.0.2" } diff --git a/packages/torus/package.json b/packages/torus/package.json index 1122d1154..64331c321 100644 --- a/packages/torus/package.json +++ b/packages/torus/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/torus", - "version": "2.2.1", + "version": "2.2.2-alpha.1", "description": "Torus SDK wallet module for connecting to Web3-Onboard. 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/trezor/package.json b/packages/trezor/package.json index a9a5294d9..bf2c06d25 100644 --- a/packages/trezor/package.json +++ b/packages/trezor/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/trezor", - "version": "2.3.3", + "version": "2.3.4-alpha.1", "description": "Trezor hardware wallet module for connecting to Web3-Onboard. 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, 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", @@ -61,7 +61,7 @@ "@ethereumjs/tx": "^3.4.0", "@ethersproject/providers": "^5.5.0", "@web3-onboard/common": "^2.2.4-alpha.1", - "@web3-onboard/hw-common": "^2.1.0", + "@web3-onboard/hw-common": "^2.1.1-alpha.1", "buffer": "^6.0.3", "eth-crypto": "^2.1.0", "ethereumjs-util": "^7.1.3", diff --git a/packages/trust/package.json b/packages/trust/package.json index 02e5ff88f..060b32f9f 100644 --- a/packages/trust/package.json +++ b/packages/trust/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/trust", - "version": "2.0.0", + "version": "2.0.1-alpha.1", "description": "Trust Wallet SDK wallet module for connecting to Web3-Onboard. 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/uauth/package.json b/packages/uauth/package.json index 13143c1dc..d30ec5cc0 100644 --- a/packages/uauth/package.json +++ b/packages/uauth/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/uauth", - "version": "2.0.1", + "version": "2.0.2-alpha.1", "description": "Unstoppable Domains module for connecting to Web3-Onboard. 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, 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/vue/package.json b/packages/vue/package.json index 55f1831c9..cda5ae023 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/vue", - "version": "2.5.6", + "version": "2.5.7", "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 standardized 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", diff --git a/packages/walletconnect/package.json b/packages/walletconnect/package.json index 58475a7cc..87a3d5336 100644 --- a/packages/walletconnect/package.json +++ b/packages/walletconnect/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/walletconnect", - "version": "2.3.2", + "version": "2.3.3.-alpha.1", "description": "WalletConnect SDK module for connecting to Web3-Onboard. 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, 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/walletlink/package.json b/packages/walletlink/package.json index 54962a765..131091d6d 100644 --- a/packages/walletlink/package.json +++ b/packages/walletlink/package.json @@ -58,7 +58,7 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/common": "^2.2.4-alpha.1", + "@web3-onboard/common": "^2.2.3", "walletlink": "^2.5.0" } } diff --git a/packages/web3auth/package.json b/packages/web3auth/package.json index 2b3396ee2..d8bb0a698 100644 --- a/packages/web3auth/package.json +++ b/packages/web3auth/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/web3auth", - "version": "2.1.4", + "version": "2.1.5-alpha.1", "description": "Web3Auth SDK wallet module for connecting to Web3-Onboard. 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, 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/xdefi/package.json b/packages/xdefi/package.json index c6e76c403..ec00cb6a9 100644 --- a/packages/xdefi/package.json +++ b/packages/xdefi/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/xdefi", - "version": "2.0.0", + "version": "2.0.1-alpha.1", "description": "XDEFI wallet module for connecting to Web3-Onboard. 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, 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/zeal/package.json b/packages/zeal/package.json index 1e8dce97c..207431278 100644 --- a/packages/zeal/package.json +++ b/packages/zeal/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/zeal", - "version": "2.0.0", + "version": "2.0.1-alpha.1", "description": "Zeal SDK wallet module for connecting to Web3-Onboard.", "keywords": [ "Ethereum", From dc8e823c5e38519b5141b18c2a547530aaf1ce10 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Wed, 15 Mar 2023 09:51:40 -0600 Subject: [PATCH 05/16] update related package versions, add rpcUrl label and token to setChain --- docs/package.json | 6 ++--- docs/src/routes/docs/[...3]modules/core.md | 5 +++- docs/src/routes/docs/[...3]modules/react.md | 5 +++- examples/with-nextjs-13/package.json | 4 ++-- examples/with-sveltekit/package.json | 2 +- examples/with-vite-react/package.json | 4 ++-- packages/core/README.md | 5 +++- packages/core/package.json | 2 +- packages/core/src/chain.ts | 23 +++++++++++++------ packages/core/src/provider.ts | 13 +++++++---- packages/core/src/validation.ts | 8 ++++++- .../src/views/shared/NetworkSelector.svelte | 1 - packages/demo/package.json | 6 ++--- packages/fortmatic/src/index.ts | 4 ++-- packages/keepkey/src/index.ts | 2 +- packages/portis/src/index.ts | 4 ++-- packages/react/README.md | 5 +++- packages/torus/src/index.ts | 4 ++-- packages/transaction-preview/package.json | 2 +- packages/trezor/src/index.ts | 2 +- packages/vue/src/types.ts | 5 +++- packages/walletconnect/package.json | 2 +- packages/walletconnect/src/v2.ts | 2 +- yarn.lock | 8 +++++++ 24 files changed, 82 insertions(+), 42 deletions(-) diff --git a/docs/package.json b/docs/package.json index 2173bce4b..0d1ad08da 100644 --- a/docs/package.json +++ b/docs/package.json @@ -59,7 +59,7 @@ "@web3-onboard/core": "^2.15.6-alpha.1", "@web3-onboard/dcent": "^2.2.4-alpha.1", "@web3-onboard/enkrypt": "^2.0.1-alpha.1", - "@web3-onboard/fortmatic": "^2.0.14", + "@web3-onboard/fortmatic": "^2.0.16-alpha.1", "@web3-onboard/gas": "^2.1.5-alpha.1", "@web3-onboard/gnosis": "^2.1.7-alpha.1", "@web3-onboard/infinity-wallet": "^2.0.1-alpha.1", @@ -73,11 +73,11 @@ "@web3-onboard/sequence": "^2.0.5-alpha.1", "@web3-onboard/taho": "^2.0.1-alpha.1", "@web3-onboard/torus": "^2.2.2-alpha.1", - "@web3-onboard/transaction-preview": "^2.0.4", + "@web3-onboard/transaction-preview": "^2.0.5-alpha.1", "@web3-onboard/trezor": "^2.3.4-alpha.1", "@web3-onboard/trust": "^2.0.1-alpha.1", "@web3-onboard/uauth": "^2.0.2-alpha.1", - "@web3-onboard/walletconnect": "^2.3.3.-alpha.1", + "@web3-onboard/walletconnect": "^2.3.3-alpha.1", "@web3-onboard/web3auth": "^2.1.5-alpha.1", "@web3-onboard/xdefi": "^2.0.1-alpha.1", "animejs": "^3.2.1", diff --git a/docs/src/routes/docs/[...3]modules/core.md b/docs/src/routes/docs/[...3]modules/core.md index 2ce94f2b1..b96d02ea5 100644 --- a/docs/src/routes/docs/[...3]modules/core.md +++ b/docs/src/routes/docs/[...3]modules/core.md @@ -969,12 +969,15 @@ type SetChainOptions = { chainId: string // hex encoded string chainNamespace?: 'evm' // defaults to 'evm' (currently the only valid value, but will add more in future updates) wallet?: string // the wallet.label of the wallet to set chain + rpcUrl?: string // if chain was instantiated without rpcUrl, include here. Used for network requests + token?: string // if chain was instantiated without token, include here. Used for display, eg Ethereum Mainnet + label?: string // if chain was instantiated without label, include here. The native token symbol, eg ETH, BNB, MATIC } const success = await onboard.setChain({ chainId: '0x89' }) ``` -The `setChain` methods takes an options object with a `chainId` property hex encoded string for the chain id to switch to. The chain id must be one of the chains that Onboard was initialized with. If the wallet supports programatically adding and switching the chain, then the user will be prompted to do so, if not, then a modal will be displayed indicating to the user that they need to switch chains to continue. The `setChain` method returns a promise that resolves when either the user has confirmed the chain switch, or has dismissed the modal and resolves with a boolean indicating if the switch network was successful or not. The `setChain` method will by default switch the first wallet (the most recently connected) in the `wallets` array. A specific wallet can be targeted by passing in the `wallet.label` in the options object as the `wallet` parameter. +The `setChain` methods takes an options object with a `chainId` property hex encoded string for the chain id to switch to. The chain id must be one of the chains that Onboard was initialized with. If the wallet supports programatically adding and switching the chain, then the user will be prompted to do so, if not, then a modal will be displayed indicating to the user that they need to switch chains to continue. The `setChain` method returns a promise that resolves when either the user has confirmed the chain switch, or has dismissed the modal and resolves with a boolean indicating if the switch network was successful or not. The `setChain` method will by default switch the first wallet (the most recently connected) in the `wallets` array. A specific wallet can be targeted by passing in the `wallet.label` in the options object as the `wallet` parameter.If a chain was instantiated without an rpcUrl, token, or label, you can add these options for wallets that require this information for adding a new chain. ## Custom Styling diff --git a/docs/src/routes/docs/[...3]modules/react.md b/docs/src/routes/docs/[...3]modules/react.md index e422ff902..b7152c98d 100644 --- a/docs/src/routes/docs/[...3]modules/react.md +++ b/docs/src/routes/docs/[...3]modules/react.md @@ -196,7 +196,10 @@ type UseSetChain = ( type SetChainOptions = { chainId: string chainNamespace?: string - wallet?: WalletState['label'] + wallet?: WalletState['label'], + rpcUrl?: string, + label?: string, + token?: string, } const [ diff --git a/examples/with-nextjs-13/package.json b/examples/with-nextjs-13/package.json index 276c68189..3c6abbfee 100644 --- a/examples/with-nextjs-13/package.json +++ b/examples/with-nextjs-13/package.json @@ -14,7 +14,7 @@ "@types/react-dom": "18.0.9", "@web3-onboard/coinbase": "^2.2.1-alpha.1", "@web3-onboard/dcent": "^2.2.4-alpha.1", - "@web3-onboard/fortmatic": "^2.0.14", + "@web3-onboard/fortmatic": "^2.0.16-alpha.1", "@web3-onboard/gnosis": "^2.1.7-alpha.1", "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", "@web3-onboard/keepkey": "^2.3.1", @@ -28,7 +28,7 @@ "@web3-onboard/taho": "^2.0.1-alpha.1", "@web3-onboard/torus": "^2.2.2-alpha.1", "@web3-onboard/trezor": "^2.3.4-alpha.1", - "@web3-onboard/walletconnect": "^2.3.3.-alpha.1", + "@web3-onboard/walletconnect": "^2.3.3-alpha.1", "ethers": "^5.7.2", "next": "13.1.6", "react": "18.2.0", diff --git a/examples/with-sveltekit/package.json b/examples/with-sveltekit/package.json index 63cb51e4c..ab08b3cae 100644 --- a/examples/with-sveltekit/package.json +++ b/examples/with-sveltekit/package.json @@ -34,7 +34,7 @@ "@fontsource/fira-mono": "^4.5.10", "@web3-onboard/core": "^2.15.6-alpha.1", "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", - "@web3-onboard/walletconnect": "^2.3.3.-alpha.1", + "@web3-onboard/walletconnect": "^2.3.3-alpha.1", "buffer": "^6.0.3" } } diff --git a/examples/with-vite-react/package.json b/examples/with-vite-react/package.json index caae01338..bae437631 100644 --- a/examples/with-vite-react/package.json +++ b/examples/with-vite-react/package.json @@ -11,7 +11,7 @@ "dependencies": { "@web3-onboard/coinbase": "^2.2.1-alpha.1", "@web3-onboard/dcent": "^2.2.4-alpha.1", - "@web3-onboard/fortmatic": "^2.0.14", + "@web3-onboard/fortmatic": "^2.0.16-alpha.1", "@web3-onboard/gnosis": "^2.1.7-alpha.1", "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", "@web3-onboard/keepkey": "^2.3.1", @@ -25,7 +25,7 @@ "@web3-onboard/tallyho": "^2.0.1", "@web3-onboard/torus": "^2.2.2-alpha.1", "@web3-onboard/trezor": "^2.3.4-alpha.1", - "@web3-onboard/walletconnect": "^2.3.3.-alpha.1", + "@web3-onboard/walletconnect": "^2.3.3-alpha.1", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/packages/core/README.md b/packages/core/README.md index 82d432746..569c21640 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -910,12 +910,15 @@ type SetChainOptions = { chainId: string // hex encoded string chainNamespace?: 'evm' // defaults to 'evm' (currently the only valid value, but will add more in future updates) wallet?: string // the wallet.label of the wallet to set chain + rpcUrl?: string // if chain was instantiated without rpcUrl, include here. Used for network requests + token?: string // if chain was instantiated without token, include here. Used for display, eg Ethereum Mainnet + label?: string // if chain was instantiated without label, include here. The native token symbol, eg ETH, BNB, MATIC } const success = await onboard.setChain({ chainId: '0x89' }) ``` -The `setChain` methods takes an options object with a `chainId` property hex encoded string for the chain id to switch to. The chain id must be one of the chains that Onboard was initialized with. If the wallet supports programatically adding and switching the chain, then the user will be prompted to do so, if not, then a modal will be displayed indicating to the user that they need to switch chains to continue. The `setChain` method returns a promise that resolves when either the user has confirmed the chain switch, or has dismissed the modal and resolves with a boolean indicating if the switch network was successful or not. The `setChain` method will by default switch the first wallet (the most recently connected) in the `wallets` array. A specific wallet can be targeted by passing in the `wallet.label` in the options object as the `wallet` parameter. +The `setChain` methods takes an options object with a `chainId` property hex encoded string for the chain id to switch to. The chain id must be one of the chains that Onboard was initialized with. If the wallet supports programatically adding and switching the chain, then the user will be prompted to do so, if not, then a modal will be displayed indicating to the user that they need to switch chains to continue. The `setChain` method returns a promise that resolves when either the user has confirmed the chain switch, or has dismissed the modal and resolves with a boolean indicating if the switch network was successful or not. The `setChain` method will by default switch the first wallet (the most recently connected) in the `wallets` array. A specific wallet can be targeted by passing in the `wallet.label` in the options object as the `wallet` parameter. If a chain was instantiated without an rpcUrl, token, or label, you can add these options for wallets that require this information for adding a new chain. ## Custom Styling diff --git a/packages/core/package.json b/packages/core/package.json index 5419cc068..7bbfc4bb7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -70,7 +70,7 @@ "@typescript-eslint/eslint-plugin": "^4.31.1", "@typescript-eslint/parser": "^4.31.1", "@web3-onboard/gas": "^2.1.5-alpha.1", - "@web3-onboard/transaction-preview": "^2.0.4", + "@web3-onboard/transaction-preview": "^2.0.5-alpha.1", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.1", diff --git a/packages/core/src/chain.ts b/packages/core/src/chain.ts index ce4bf05ab..8de1e8604 100644 --- a/packages/core/src/chain.ts +++ b/packages/core/src/chain.ts @@ -9,9 +9,12 @@ import type { WalletState } from './types.js' import { toHexString } from './utils.js' async function setChain(options: { - chainId: string | number - chainNamespace?: string - wallet?: WalletState['label'] + chainId: string | number, + chainNamespace?: string, + wallet?: WalletState['label'], + rpcUrl?: string, + label?: string, + token?: string }): Promise { const error = validateSetChainOptions(options) @@ -20,7 +23,7 @@ async function setChain(options: { } const { wallets, chains } = state.get() - const { chainId, chainNamespace = 'evm', wallet: walletToSet } = options + const { chainId, chainNamespace = 'evm', wallet: walletToSet, rpcUrl, label, token } = options const chainIdHex = toHexString(chainId) // validate that chainId has been added to chains @@ -75,7 +78,10 @@ async function setChain(options: { wallet, chain, switchChainModalClosed$, - chainIdHex + chainIdHex, + rpcUrl, + label, + token, ) } @@ -93,10 +99,13 @@ const chainNotInWallet = async ( wallet: WalletState, chain: Chain, switchChainModalClosed$: Observable, - chainIdHex: string + chainIdHex: string, + rpcUrl?: string, + label?: string, + token?: string, ): Promise => { try { - await addNewChain(wallet.provider, chain) + await addNewChain(wallet.provider, chain, rpcUrl, label, token) await switchChain(wallet.provider, chainIdHex) return true } catch (error) { diff --git a/packages/core/src/provider.ts b/packages/core/src/provider.ts index 623146783..b85a34a5e 100644 --- a/packages/core/src/provider.ts +++ b/packages/core/src/provider.ts @@ -445,20 +445,23 @@ export function switchChain( export function addNewChain( provider: EIP1193Provider, - chain: Chain + chain: Chain, + rpcUrl?: string, + label?: string, + token?: string, ): Promise { return provider.request({ method: 'wallet_addEthereumChain', params: [ { chainId: chain.id, - chainName: chain.label, + chainName: chain.label || label, nativeCurrency: { - name: chain.label, - symbol: chain.token, + name: chain.label || label, + symbol: chain.token || token, decimals: 18 }, - rpcUrls: [chain.publicRpcUrl || chain.rpcUrl], + rpcUrls: [chain.publicRpcUrl || chain.rpcUrl || rpcUrl], blockExplorerUrls: chain.blockExplorerUrl ? [chain.blockExplorerUrl] : undefined diff --git a/packages/core/src/validation.ts b/packages/core/src/validation.ts index 38d38611b..d4599e308 100644 --- a/packages/core/src/validation.ts +++ b/packages/core/src/validation.ts @@ -240,7 +240,10 @@ const disconnectOptions = Joi.object({ const setChainOptions = Joi.object({ chainId: chainIdValidation.required(), chainNamespace: chainNamespaceValidation, - wallet: Joi.string() + wallet: Joi.string(), + rpcUrl: Joi.string(), + label: Joi.string(), + token: Joi.string() }) const customNotificationUpdate = Joi.object({ @@ -335,6 +338,9 @@ export function validateSetChainOptions(data: { chainId: ChainId | DecimalChainId chainNamespace?: string wallet?: WalletState['label'] + rpcUrl?: string + label?: string + token?: string }): ValidateReturn { return validate(setChainOptions, data) } diff --git a/packages/core/src/views/shared/NetworkSelector.svelte b/packages/core/src/views/shared/NetworkSelector.svelte index fb6363c64..7e851b548 100644 --- a/packages/core/src/views/shared/NetworkSelector.svelte +++ b/packages/core/src/views/shared/NetworkSelector.svelte @@ -6,7 +6,6 @@ import { wallets$ } from '../../streams.js' import { distinctUntilChanged, debounceTime, skip } from 'rxjs/operators' import caretIcon from '../../icons/caret.js' - import { id } from 'ethers/lib/utils.js' export let selectIcon: string = caretIcon export let colorVar: string diff --git a/packages/demo/package.json b/packages/demo/package.json index 50ed88789..38828121e 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -25,10 +25,10 @@ "dependencies": { "@web3-onboard/core": "^2.15.6-alpha.1", "@web3-onboard/coinbase": "^2.2.1-alpha.1", - "@web3-onboard/transaction-preview": "^2.0.4", + "@web3-onboard/transaction-preview": "^2.0.5-alpha.1", "@web3-onboard/dcent": "^2.2.4-alpha.1", "@web3-onboard/frontier": "^2.0.1-alpha.1", - "@web3-onboard/fortmatic": "^2.0.14", + "@web3-onboard/fortmatic": "^2.0.16-alpha.1", "@web3-onboard/gas": "^2.1.5-alpha.1", "@web3-onboard/gnosis": "^2.1.7-alpha.1", "@web3-onboard/keepkey": "^2.3.3", @@ -45,7 +45,7 @@ "@web3-onboard/torus": "^2.2.2-alpha.1", "@web3-onboard/taho": "^2.0.1-alpha.1", "@web3-onboard/web3auth": "^2.1.5-alpha.1", - "@web3-onboard/walletconnect": "^2.3.3.-alpha.1", + "@web3-onboard/walletconnect": "^2.3.3-alpha.1", "@web3-onboard/enkrypt": "^2.0.1-alpha.1", "@web3-onboard/mew-wallet": "^2.0.0", "@web3-onboard/xdefi": "^2.0.1-alpha.1", diff --git a/packages/fortmatic/src/index.ts b/packages/fortmatic/src/index.ts index f03df163e..8cce5d88d 100644 --- a/packages/fortmatic/src/index.ts +++ b/packages/fortmatic/src/index.ts @@ -19,7 +19,7 @@ function fortmatic(options: APIKey): WalletInit { let instance = new Fortmatic(apiKey, { chainId: parseInt(chains[0].id), - rpcUrl: chains[0].rpcUrl + rpcUrl: chains[0].rpcUrl || '' }) let fortmaticProvider = instance.getProvider() @@ -59,7 +59,7 @@ function fortmatic(options: APIKey): WalletInit { // re-instantiate instance with new network instance = new Fortmatic(apiKey, { chainId: parseInt(chain.id), - rpcUrl: chain.rpcUrl + rpcUrl: chain.rpcUrl || '' }) // get the provider again diff --git a/packages/keepkey/src/index.ts b/packages/keepkey/src/index.ts index b7d0a306a..cfb06086e 100644 --- a/packages/keepkey/src/index.ts +++ b/packages/keepkey/src/index.ts @@ -300,7 +300,7 @@ function keepkey({ } const keepKeyProvider = getHardwareWalletProvider( - () => currentChain.rpcUrl + () => currentChain.rpcUrl || '' ) const provider = createEIP1193Provider(keepKeyProvider, { diff --git a/packages/portis/src/index.ts b/packages/portis/src/index.ts index 856b5bb3a..6068fbf85 100644 --- a/packages/portis/src/index.ts +++ b/packages/portis/src/index.ts @@ -12,7 +12,7 @@ function portis(options: APIKey): WalletInit { const { createEIP1193Provider } = await import('@web3-onboard/common') const instance = new Portis(apiKey, { - nodeUrl: chains[0].rpcUrl, + nodeUrl: chains[0].rpcUrl || '', chainId: chains[0].id }) @@ -26,7 +26,7 @@ function portis(options: APIKey): WalletInit { if (!chain) throw new Error('chain must be set before switching') instance.changeNetwork({ - nodeUrl: chain.rpcUrl, + nodeUrl: chain.rpcUrl || '', chainId: chain.id }) diff --git a/packages/react/README.md b/packages/react/README.md index 4bdd4c4aa..dbedc2056 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -201,7 +201,10 @@ type UseSetChain = ( type SetChainOptions = { chainId: string chainNamespace?: string - wallet?: WalletState['label'] + wallet?: WalletState['label'], + rpcUrl?: string, + label?: string, + token?: string, } const [ diff --git a/packages/torus/src/index.ts b/packages/torus/src/index.ts index 459ecb176..defcef94e 100644 --- a/packages/torus/src/index.ts +++ b/packages/torus/src/index.ts @@ -42,7 +42,7 @@ function torus(options?: TorusOptions): WalletInit { buildEnv, enableLogging, network: { - host: chain.rpcUrl, + host: chain.rpcUrl || '', chainId: parseInt(chain.id), networkName: chain.label }, @@ -73,7 +73,7 @@ function torus(options?: TorusOptions): WalletInit { if (!chain) throw new Error('chain must be set before switching') await instance.setProvider({ - host: chain.rpcUrl, + host: chain.rpcUrl || '', chainId: parseInt(chain.id), networkName: chain.label }) diff --git a/packages/transaction-preview/package.json b/packages/transaction-preview/package.json index 94d016906..3db0cd324 100644 --- a/packages/transaction-preview/package.json +++ b/packages/transaction-preview/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/transaction-preview", - "version": "2.0.4", + "version": "2.0.5-alpha.1", "description": "In app preview of Ethereum transactions", "keywords": [ "Ethereum", diff --git a/packages/trezor/src/index.ts b/packages/trezor/src/index.ts index 95381ec69..cfedfd8b9 100644 --- a/packages/trezor/src/index.ts +++ b/packages/trezor/src/index.ts @@ -479,7 +479,7 @@ function trezor(options: TrezorOptions): WalletInit { } const trezorProvider = getHardwareWalletProvider( - () => currentChain?.rpcUrl + () => currentChain?.rpcUrl || '' ) const provider = createEIP1193Provider(trezorProvider, { diff --git a/packages/vue/src/types.ts b/packages/vue/src/types.ts index 670bc30a5..14aa03bb1 100644 --- a/packages/vue/src/types.ts +++ b/packages/vue/src/types.ts @@ -12,7 +12,10 @@ type ReadonlyRef = Readonly> type SetChainOptions = { chainId: string chainNamespace?: string - wallet: string + wallet: string, + rpcUrl?: string, + label?: string, + token?: string } interface OnboardComposable { diff --git a/packages/walletconnect/package.json b/packages/walletconnect/package.json index 87a3d5336..5ac6d1dad 100644 --- a/packages/walletconnect/package.json +++ b/packages/walletconnect/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/walletconnect", - "version": "2.3.3.-alpha.1", + "version": "2.3.3-alpha.1", "description": "WalletConnect SDK module for connecting to Web3-Onboard. 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, 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/walletconnect/src/v2.ts b/packages/walletconnect/src/v2.ts index ac4d118c2..6fe602539 100644 --- a/packages/walletconnect/src/v2.ts +++ b/packages/walletconnect/src/v2.ts @@ -85,7 +85,7 @@ function walletConnect(options?: WalletConnectOptions): WalletInit { rpcMap: chains .map(({ id, rpcUrl }) => ({ id, rpcUrl })) .reduce((rpcMap: Record, { id, rpcUrl }) => { - rpcMap[parseInt(id, 16)] = rpcUrl + rpcMap[parseInt(id, 16)] = rpcUrl || '' return rpcMap }, {}) }) diff --git a/yarn.lock b/yarn.lock index 65bcb3706..96f813bf4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3455,6 +3455,14 @@ ethers "5.5.4" joi "^17.6.1" +"@web3-onboard/mew-wallet@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@web3-onboard/mew-wallet/-/mew-wallet-2.0.0.tgz#34fb86cfd89efcf87552944a47ba77481e194f00" + integrity sha512-VgQbWaP99cdTGLs+px3QjTetn/n4XA5/u9NkV+xQk2aB2+7eIabPwSC05vj1Qc8dsUF/H9L1vhDPiNmpipC9mQ== + dependencies: + "@web3-onboard/common" "^2.2.3" + lodash.uniqby "^4.7.0" + "@web3-react/abstract-connector@^6.0.7": version "6.0.7" resolved "https://registry.yarnpkg.com/@web3-react/abstract-connector/-/abstract-connector-6.0.7.tgz#401b3c045f1e0fab04256311be49d5144e9badc6" From 8e308f0a45adaac49b0f05ed351b1d8564faad12 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Wed, 15 Mar 2023 09:59:54 -0600 Subject: [PATCH 06/16] update keepkey --- docs/package.json | 2 +- docs/src/routes/docs/[...3]modules/core.md | 2 +- examples/with-nextjs-13/package.json | 2 +- examples/with-vite-react/package.json | 4 ++-- packages/core/README.md | 2 +- packages/demo/package.json | 2 +- packages/keepkey/package.json | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/package.json b/docs/package.json index 0d1ad08da..1c86c8d0a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -64,7 +64,7 @@ "@web3-onboard/gnosis": "^2.1.7-alpha.1", "@web3-onboard/infinity-wallet": "^2.0.1-alpha.1", "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", - "@web3-onboard/keepkey": "^2.3.3", + "@web3-onboard/keepkey": "^2.3.4-alpha.1", "@web3-onboard/keystone": "^2.3.4-alpha.1", "@web3-onboard/ledger": "^2.4.3-alpha.1", "@web3-onboard/magic": "^2.1.4-alpha.1", diff --git a/docs/src/routes/docs/[...3]modules/core.md b/docs/src/routes/docs/[...3]modules/core.md index b96d02ea5..47aff1434 100644 --- a/docs/src/routes/docs/[...3]modules/core.md +++ b/docs/src/routes/docs/[...3]modules/core.md @@ -977,7 +977,7 @@ type SetChainOptions = { const success = await onboard.setChain({ chainId: '0x89' }) ``` -The `setChain` methods takes an options object with a `chainId` property hex encoded string for the chain id to switch to. The chain id must be one of the chains that Onboard was initialized with. If the wallet supports programatically adding and switching the chain, then the user will be prompted to do so, if not, then a modal will be displayed indicating to the user that they need to switch chains to continue. The `setChain` method returns a promise that resolves when either the user has confirmed the chain switch, or has dismissed the modal and resolves with a boolean indicating if the switch network was successful or not. The `setChain` method will by default switch the first wallet (the most recently connected) in the `wallets` array. A specific wallet can be targeted by passing in the `wallet.label` in the options object as the `wallet` parameter.If a chain was instantiated without an rpcUrl, token, or label, you can add these options for wallets that require this information for adding a new chain. +The `setChain` methods takes an options object with a `chainId` property hex encoded string for the chain id to switch to. The chain id must be one of the chains that Onboard was initialized with. If the wallet supports programatically adding and switching the chain, then the user will be prompted to do so, if not, then a modal will be displayed indicating to the user that they need to switch chains to continue. The `setChain` method returns a promise that resolves when either the user has confirmed the chain switch, or has dismissed the modal and resolves with a boolean indicating if the switch network was successful or not. The `setChain` method will by default switch the first wallet (the most recently connected) in the `wallets` array. A specific wallet can be targeted by passing in the `wallet.label` in the options object as the `wallet` parameter. If a chain was instantiated without an rpcUrl, token, or label, add these options for wallets that require this information for adding a new chain. ## Custom Styling diff --git a/examples/with-nextjs-13/package.json b/examples/with-nextjs-13/package.json index 3c6abbfee..e79c53686 100644 --- a/examples/with-nextjs-13/package.json +++ b/examples/with-nextjs-13/package.json @@ -17,7 +17,7 @@ "@web3-onboard/fortmatic": "^2.0.16-alpha.1", "@web3-onboard/gnosis": "^2.1.7-alpha.1", "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", - "@web3-onboard/keepkey": "^2.3.1", + "@web3-onboard/keepkey": "^2.3.4-alpha.1", "@web3-onboard/keystone": "^2.3.4-alpha.1", "@web3-onboard/ledger": "^2.4.3-alpha.1", "@web3-onboard/magic": "^2.1.4-alpha.1", diff --git a/examples/with-vite-react/package.json b/examples/with-vite-react/package.json index bae437631..f02182fbf 100644 --- a/examples/with-vite-react/package.json +++ b/examples/with-vite-react/package.json @@ -14,13 +14,13 @@ "@web3-onboard/fortmatic": "^2.0.16-alpha.1", "@web3-onboard/gnosis": "^2.1.7-alpha.1", "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", - "@web3-onboard/keepkey": "^2.3.1", + "@web3-onboard/keepkey": "^2.3.4-alpha.1", "@web3-onboard/keystone": "^2.3.4-alpha.1", "@web3-onboard/ledger": "^2.4.3-alpha.1", "@web3-onboard/magic": "^2.1.4-alpha.1", "@web3-onboard/mew": "^2.1.3", "@web3-onboard/portis": "^2.1.4-alpha.1", - "@web3-onboard/react": "^2.4.1", + "@web3-onboard/react": "^2.6.7-alpha.1", "@web3-onboard/sequence": "^2.0.5-alpha.1", "@web3-onboard/tallyho": "^2.0.1", "@web3-onboard/torus": "^2.2.2-alpha.1", diff --git a/packages/core/README.md b/packages/core/README.md index 569c21640..e0de76e0a 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -918,7 +918,7 @@ type SetChainOptions = { const success = await onboard.setChain({ chainId: '0x89' }) ``` -The `setChain` methods takes an options object with a `chainId` property hex encoded string for the chain id to switch to. The chain id must be one of the chains that Onboard was initialized with. If the wallet supports programatically adding and switching the chain, then the user will be prompted to do so, if not, then a modal will be displayed indicating to the user that they need to switch chains to continue. The `setChain` method returns a promise that resolves when either the user has confirmed the chain switch, or has dismissed the modal and resolves with a boolean indicating if the switch network was successful or not. The `setChain` method will by default switch the first wallet (the most recently connected) in the `wallets` array. A specific wallet can be targeted by passing in the `wallet.label` in the options object as the `wallet` parameter. If a chain was instantiated without an rpcUrl, token, or label, you can add these options for wallets that require this information for adding a new chain. +The `setChain` methods takes an options object with a `chainId` property hex encoded string for the chain id to switch to. The chain id must be one of the chains that Onboard was initialized with. If the wallet supports programatically adding and switching the chain, then the user will be prompted to do so, if not, then a modal will be displayed indicating to the user that they need to switch chains to continue. The `setChain` method returns a promise that resolves when either the user has confirmed the chain switch, or has dismissed the modal and resolves with a boolean indicating if the switch network was successful or not. The `setChain` method will by default switch the first wallet (the most recently connected) in the `wallets` array. A specific wallet can be targeted by passing in the `wallet.label` in the options object as the `wallet` parameter. If a chain was instantiated without an rpcUrl, token, or label, add these options for wallets that require this information for adding a new chain. ## Custom Styling diff --git a/packages/demo/package.json b/packages/demo/package.json index 38828121e..0ac668954 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -31,7 +31,7 @@ "@web3-onboard/fortmatic": "^2.0.16-alpha.1", "@web3-onboard/gas": "^2.1.5-alpha.1", "@web3-onboard/gnosis": "^2.1.7-alpha.1", - "@web3-onboard/keepkey": "^2.3.3", + "@web3-onboard/keepkey": "^2.3.4-alpha.1", "@web3-onboard/keystone": "^2.3.4-alpha.1", "@web3-onboard/ledger": "^2.4.3-alpha.1", "@web3-onboard/infinity-wallet": "^2.0.1-alpha.1", diff --git a/packages/keepkey/package.json b/packages/keepkey/package.json index d69bbb43b..84274631b 100644 --- a/packages/keepkey/package.json +++ b/packages/keepkey/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/keepkey", - "version": "2.3.3", + "version": "2.3.4-alpha.1", "description": "KeepKey hardware wallet module for connecting to Web3-Onboard. 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, 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", From 3cd269c0c9df77a87a5ae73f3b0679dee53c16cf Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Wed, 15 Mar 2023 15:41:59 -0600 Subject: [PATCH 07/16] update vue package with correct versioning --- examples/with-vuejs-v2/package.json | 2 +- examples/with-vuejs/package.json | 2 +- packages/vue/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/with-vuejs-v2/package.json b/examples/with-vuejs-v2/package.json index cdccb92fd..cdeb87822 100644 --- a/examples/with-vuejs-v2/package.json +++ b/examples/with-vuejs-v2/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", - "@web3-onboard/vue": "^2.5.1", + "@web3-onboard/vue": "^2.5.7-alpha.1", "vue": "^2.7.14", "vue-template-compiler": "2.7.14" }, diff --git a/examples/with-vuejs/package.json b/examples/with-vuejs/package.json index c7d45e1b5..2c9ade748 100644 --- a/examples/with-vuejs/package.json +++ b/examples/with-vuejs/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", - "@web3-onboard/vue": "^2.5.1", + "@web3-onboard/vue": "^2.5.7-alpha.1", "pinia": "^2.0.29", "vue": "^3.2.45", "vue-router": "^4.1.6" diff --git a/packages/vue/package.json b/packages/vue/package.json index cda5ae023..54f9fca39 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/vue", - "version": "2.5.7", + "version": "2.5.7-alpha.1", "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 standardized 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", From 102e4eeeefa8d89bae40d30256570925496da487 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Thu, 16 Mar 2023 11:02:12 -0600 Subject: [PATCH 08/16] update chain in state when new values passed to setChain --- packages/core/src/chain.ts | 17 ++++++++++------- packages/core/src/provider.ts | 11 ++++------- packages/core/src/store/actions.ts | 15 +++++++++++++-- packages/core/src/store/constants.ts | 1 + packages/core/src/store/index.ts | 17 +++++++++++++++-- packages/core/src/types.ts | 2 ++ 6 files changed, 45 insertions(+), 18 deletions(-) diff --git a/packages/core/src/chain.ts b/packages/core/src/chain.ts index 8de1e8604..d89d978f9 100644 --- a/packages/core/src/chain.ts +++ b/packages/core/src/chain.ts @@ -7,6 +7,7 @@ import { switchChainModal$ } from './streams.js' import { validateSetChainOptions } from './validation.js' import type { WalletState } from './types.js' import { toHexString } from './utils.js' +import { updateChain } from './store/actions.js' async function setChain(options: { chainId: string | number, @@ -74,14 +75,19 @@ async function setChain(options: { code === ProviderRpcErrorCode.UNRECOGNIZED_CHAIN_ID ) { // chain has not been added to wallet + if (rpcUrl || label || token) { + // If values passed, update chain in state + chain.rpcUrl = rpcUrl + chain.label = label + chain.token = token + updateChain(chain) + } + // add chain to wallet return chainNotInWallet( wallet, chain, switchChainModalClosed$, chainIdHex, - rpcUrl, - label, - token, ) } @@ -100,12 +106,9 @@ const chainNotInWallet = async ( chain: Chain, switchChainModalClosed$: Observable, chainIdHex: string, - rpcUrl?: string, - label?: string, - token?: string, ): Promise => { try { - await addNewChain(wallet.provider, chain, rpcUrl, label, token) + await addNewChain(wallet.provider, chain) await switchChain(wallet.provider, chainIdHex) return true } catch (error) { diff --git a/packages/core/src/provider.ts b/packages/core/src/provider.ts index b85a34a5e..ddf277729 100644 --- a/packages/core/src/provider.ts +++ b/packages/core/src/provider.ts @@ -446,22 +446,19 @@ export function switchChain( export function addNewChain( provider: EIP1193Provider, chain: Chain, - rpcUrl?: string, - label?: string, - token?: string, ): Promise { return provider.request({ method: 'wallet_addEthereumChain', params: [ { chainId: chain.id, - chainName: chain.label || label, + chainName: chain.label, nativeCurrency: { - name: chain.label || label, - symbol: chain.token || token, + name: chain.label, + symbol: chain.token, decimals: 18 }, - rpcUrls: [chain.publicRpcUrl || chain.rpcUrl || rpcUrl], + rpcUrls: [chain.publicRpcUrl || chain.rpcUrl], blockExplorerUrls: chain.blockExplorerUrl ? [chain.blockExplorerUrl] : undefined diff --git a/packages/core/src/store/actions.ts b/packages/core/src/store/actions.ts index e7fd2a4db..9a3c7dc63 100644 --- a/packages/core/src/store/actions.ts +++ b/packages/core/src/store/actions.ts @@ -28,7 +28,8 @@ import type { Notify, ConnectModalOptions, UpdateConnectModalAction, - Theme + Theme, + UpdateChainsAction } from '../types.js' import { @@ -60,7 +61,8 @@ import { ADD_NOTIFICATION, REMOVE_NOTIFICATION, UPDATE_ALL_WALLETS, - UPDATE_CONNECT_MODAL + UPDATE_CONNECT_MODAL, + UPDATE_CHAINS } from './constants.js' export function addChains(chains: Chain[]): void { @@ -78,6 +80,15 @@ export function addChains(chains: Chain[]): void { dispatch(action as AddChainsAction) } +export function updateChain(updatedChain: Chain): void { + // KAT TODO validate chain + const action = { + type: UPDATE_CHAINS, + payload: updatedChain + } + dispatch(action as UpdateChainsAction) +} + export function addWallet(wallet: WalletState): void { const error = validateWallet(wallet) diff --git a/packages/core/src/store/constants.ts b/packages/core/src/store/constants.ts index 80da33a55..d9d2c0e9f 100644 --- a/packages/core/src/store/constants.ts +++ b/packages/core/src/store/constants.ts @@ -1,4 +1,5 @@ export const ADD_CHAINS = 'add_chains' +export const UPDATE_CHAINS = 'update_chains' export const RESET_STORE = 'reset_store' export const ADD_WALLET = 'add_wallet' export const UPDATE_WALLET = 'update_wallet' diff --git a/packages/core/src/store/index.ts b/packages/core/src/store/index.ts index ce5e6d5a0..f9d240f1d 100644 --- a/packages/core/src/store/index.ts +++ b/packages/core/src/store/index.ts @@ -18,7 +18,8 @@ import type { AddNotificationAction, RemoveNotificationAction, UpdateAllWalletsAction, - UpdateConnectModalAction + UpdateConnectModalAction, + UpdateChainsAction } from '../types.js' import { @@ -35,7 +36,8 @@ import { SET_LOCALE, ADD_NOTIFICATION, REMOVE_NOTIFICATION, - UPDATE_ALL_WALLETS + UPDATE_ALL_WALLETS, + UPDATE_CHAINS } from './constants.js' function reducer(state: AppState, action: Action): AppState { @@ -47,6 +49,17 @@ function reducer(state: AppState, action: Action): AppState { ...state, chains: [...state.chains, ...(payload as Chain[])] } + + case UPDATE_CHAINS: { + const updatedChain = payload as UpdateChainsAction['payload'] + const chains = state.chains + const index = chains.findIndex((chain) => chain.id === updatedChain.id) + chains[index] = updatedChain + return { + ...state, + chains + } + } case ADD_WALLET: { const wallet = payload as AddWalletAction['payload'] diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 42d53155d..0d70c4563 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -332,6 +332,7 @@ export interface TxDetails { // ==== ACTIONS ==== // export type Action = | AddChainsAction + | UpdateChainsAction | AddWalletAction | UpdateWalletAction | RemoveWalletAction @@ -347,6 +348,7 @@ export type Action = | UpdateConnectModalAction export type AddChainsAction = { type: 'add_chains'; payload: Chain[] } +export type UpdateChainsAction = { type: 'update_chains'; payload: Chain} export type AddWalletAction = { type: 'add_wallet'; payload: WalletState } export type UpdateWalletAction = { From 8f09d3ae37f3f7eb1f095520b4fad10e2c176e15 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Thu, 16 Mar 2023 11:42:27 -0600 Subject: [PATCH 09/16] add chain validation to update chain --- packages/core/src/store/actions.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/core/src/store/actions.ts b/packages/core/src/store/actions.ts index 9a3c7dc63..1f3f892f5 100644 --- a/packages/core/src/store/actions.ts +++ b/packages/core/src/store/actions.ts @@ -44,7 +44,8 @@ import { validateUpdateBalances, validateNotify, validateConnectModalUpdate, - validateUpdateTheme + validateUpdateTheme, + validateSetChainOptions } from '../validation.js' import { @@ -81,7 +82,20 @@ export function addChains(chains: Chain[]): void { } export function updateChain(updatedChain: Chain): void { - // KAT TODO validate chain + const { + label, + token, + rpcUrl, + id: chainId, + namespace: chainNamespace + } = updatedChain + const error = validateSetChainOptions( + { label, token, rpcUrl, chainId, chainNamespace } + ) + + if (error) { + throw error + } const action = { type: UPDATE_CHAINS, payload: updatedChain From ec1824224d5f90fe37b8ba2812af3f8c4ec9b42e Mon Sep 17 00:00:00 2001 From: Kat Leight <33187102+leightkt@users.noreply.github.com> Date: Fri, 17 Mar 2023 09:09:11 -0600 Subject: [PATCH 10/16] Update packages/core/src/chain.ts Co-authored-by: Aaron --- packages/core/src/chain.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/core/src/chain.ts b/packages/core/src/chain.ts index d89d978f9..3389b2fd4 100644 --- a/packages/core/src/chain.ts +++ b/packages/core/src/chain.ts @@ -75,13 +75,19 @@ async function setChain(options: { code === ProviderRpcErrorCode.UNRECOGNIZED_CHAIN_ID ) { // chain has not been added to wallet - if (rpcUrl || label || token) { - // If values passed, update chain in state + if (rpcUrl) { chain.rpcUrl = rpcUrl + } + + if (label) { chain.label = label + } + + if (token) { chain.token = token - updateChain(chain) } + + updateChain(chain) // add chain to wallet return chainNotInWallet( wallet, From fa6b744a62f92e2e7df5938296d1773fb0dbbce0 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Fri, 17 Mar 2023 09:12:28 -0600 Subject: [PATCH 11/16] add conditional check for rpcUrl, label, and token --- packages/core/src/chain.ts | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/core/src/chain.ts b/packages/core/src/chain.ts index 3389b2fd4..1a64b60b7 100644 --- a/packages/core/src/chain.ts +++ b/packages/core/src/chain.ts @@ -75,19 +75,22 @@ async function setChain(options: { code === ProviderRpcErrorCode.UNRECOGNIZED_CHAIN_ID ) { // chain has not been added to wallet - if (rpcUrl) { - chain.rpcUrl = rpcUrl + if (rpcUrl || label || token) { + if (rpcUrl) { + chain.rpcUrl = rpcUrl + } + + if (label) { + chain.label = label + } + + if (token) { + chain.token = token + } + + updateChain(chain) } - if (label) { - chain.label = label - } - - if (token) { - chain.token = token - } - - updateChain(chain) // add chain to wallet return chainNotInWallet( wallet, From ca5cc3c46b41cc705235ae7717c890a81c874ef1 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Mon, 20 Mar 2023 10:06:54 -0600 Subject: [PATCH 12/16] correct package versions --- docs/package.json | 2 +- examples/with-ledger/package.json | 2 +- examples/with-nextjs-13/package.json | 2 +- examples/with-nextjs/package.json | 2 +- examples/with-sveltekit/package.json | 2 +- examples/with-vite-react/package.json | 2 +- examples/with-vuejs-v2/package.json | 2 +- examples/with-vuejs/package.json | 2 +- packages/core/package.json | 2 +- packages/demo/package.json | 2 +- packages/react/package.json | 4 ++-- packages/vue/package.json | 4 ++-- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/package.json b/docs/package.json index 1c86c8d0a..40725634b 100644 --- a/docs/package.json +++ b/docs/package.json @@ -56,7 +56,7 @@ "dependencies": { "bnc-sdk": "^4.6.6", "@web3-onboard/coinbase": "^2.2.1-alpha.1", - "@web3-onboard/core": "^2.15.6-alpha.1", + "@web3-onboard/core": "^2.15.7-alpha.1", "@web3-onboard/dcent": "^2.2.4-alpha.1", "@web3-onboard/enkrypt": "^2.0.1-alpha.1", "@web3-onboard/fortmatic": "^2.0.16-alpha.1", diff --git a/examples/with-ledger/package.json b/examples/with-ledger/package.json index 58ba7ad94..ba1e3d094 100644 --- a/examples/with-ledger/package.json +++ b/examples/with-ledger/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@web3-onboard/ledger": "^2.4.3-alpha.1", - "@web3-onboard/react": "^2.4.1", + "@web3-onboard/react": "^2.6.8-alpha.1", "next": "12.2.4", "react": "18.2.0", "react-dom": "18.2.0" diff --git a/examples/with-nextjs-13/package.json b/examples/with-nextjs-13/package.json index e79c53686..535e51cbf 100644 --- a/examples/with-nextjs-13/package.json +++ b/examples/with-nextjs-13/package.json @@ -23,7 +23,7 @@ "@web3-onboard/magic": "^2.1.4-alpha.1", "@web3-onboard/mew-wallet": "^2.0.0", "@web3-onboard/portis": "^2.1.4-alpha.1", - "@web3-onboard/react": "^2.6.1", + "@web3-onboard/react": "^2.6.8-alpha.1", "@web3-onboard/sequence": "^2.0.5-alpha.1", "@web3-onboard/taho": "^2.0.1-alpha.1", "@web3-onboard/torus": "^2.2.2-alpha.1", diff --git a/examples/with-nextjs/package.json b/examples/with-nextjs/package.json index c36bdb859..2bb9bf59b 100644 --- a/examples/with-nextjs/package.json +++ b/examples/with-nextjs/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@web3-onboard/react": "2.4.1", + "@web3-onboard/react": "2.6.8-alpha.1", "next": "12.2.5", "react": "18.2.0", "react-dom": "18.2.0" diff --git a/examples/with-sveltekit/package.json b/examples/with-sveltekit/package.json index ab08b3cae..fa6f6b545 100644 --- a/examples/with-sveltekit/package.json +++ b/examples/with-sveltekit/package.json @@ -32,7 +32,7 @@ "type": "module", "dependencies": { "@fontsource/fira-mono": "^4.5.10", - "@web3-onboard/core": "^2.15.6-alpha.1", + "@web3-onboard/core": "^2.15.7-alpha.1", "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", "@web3-onboard/walletconnect": "^2.3.3-alpha.1", "buffer": "^6.0.3" diff --git a/examples/with-vite-react/package.json b/examples/with-vite-react/package.json index f02182fbf..836775ff8 100644 --- a/examples/with-vite-react/package.json +++ b/examples/with-vite-react/package.json @@ -20,7 +20,7 @@ "@web3-onboard/magic": "^2.1.4-alpha.1", "@web3-onboard/mew": "^2.1.3", "@web3-onboard/portis": "^2.1.4-alpha.1", - "@web3-onboard/react": "^2.6.7-alpha.1", + "@web3-onboard/react": "^2.6.8-alpha.1", "@web3-onboard/sequence": "^2.0.5-alpha.1", "@web3-onboard/tallyho": "^2.0.1", "@web3-onboard/torus": "^2.2.2-alpha.1", diff --git a/examples/with-vuejs-v2/package.json b/examples/with-vuejs-v2/package.json index cdeb87822..e198d9aa8 100644 --- a/examples/with-vuejs-v2/package.json +++ b/examples/with-vuejs-v2/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", - "@web3-onboard/vue": "^2.5.7-alpha.1", + "@web3-onboard/vue": "^2.5.9-alpha.1", "vue": "^2.7.14", "vue-template-compiler": "2.7.14" }, diff --git a/examples/with-vuejs/package.json b/examples/with-vuejs/package.json index 2c9ade748..d2419fcf7 100644 --- a/examples/with-vuejs/package.json +++ b/examples/with-vuejs/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", - "@web3-onboard/vue": "^2.5.7-alpha.1", + "@web3-onboard/vue": "^2.5.8-alpha.1", "pinia": "^2.0.29", "vue": "^3.2.45", "vue-router": "^4.1.6" diff --git a/packages/core/package.json b/packages/core/package.json index 7bbfc4bb7..79ee44b86 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/core", - "version": "2.15.6-alpha.1", + "version": "2.15.7-alpha.1", "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/demo/package.json b/packages/demo/package.json index 7e84c7973..f29f043f2 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -23,7 +23,7 @@ "webpack-dev-server": "4.7.4" }, "dependencies": { - "@web3-onboard/core": "^2.15.6-alpha.1", + "@web3-onboard/core": "^2.15.7-alpha.1", "@web3-onboard/coinbase": "^2.2.1-alpha.1", "@web3-onboard/transaction-preview": "^2.0.5-alpha.1", "@web3-onboard/dcent": "^2.2.4-alpha.1", diff --git a/packages/react/package.json b/packages/react/package.json index 7f2ccb2bf..038a4699a 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/react", - "version": "2.6.7-alpha.1", + "version": "2.6.8-alpha.1", "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.15.6-alpha.1", + "@web3-onboard/core": "^2.15.7-alpha.1", "@web3-onboard/common": "^2.2.4-alpha.1", "use-sync-external-store": "1.0.0" }, diff --git a/packages/vue/package.json b/packages/vue/package.json index 54f9fca39..3d9f36ad0 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/vue", - "version": "2.5.7-alpha.1", + "version": "2.5.8-alpha.1", "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 standardized 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.4-alpha.1", - "@web3-onboard/core": "^2.15.6-alpha.1", + "@web3-onboard/core": "^2.15.7-alpha.1", "vue-demi": "^0.12.4" }, "peerDependencies": { From a67d86c50483f64ea19dd8399fa5d58b5f9f13b6 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Mon, 20 Mar 2023 11:44:19 -0600 Subject: [PATCH 13/16] versioning update, prettier cleanup --- docs/package.json | 2 +- examples/with-ledger/package.json | 2 +- examples/with-nextjs-13/package.json | 2 +- examples/with-nextjs/package.json | 2 +- examples/with-sveltekit/package.json | 2 +- examples/with-vite-react/package.json | 2 +- examples/with-vuejs-v2/package.json | 2 +- examples/with-vuejs/package.json | 2 +- packages/common/src/types.ts | 8 +++++ packages/core/package.json | 2 +- packages/core/src/chain.ts | 29 ++++++++++++------- packages/core/src/provider.ts | 2 +- .../src/views/shared/NetworkSelector.svelte | 4 ++- packages/demo/package.json | 2 +- packages/demo/src/App.svelte | 2 +- packages/react/package.json | 4 +-- packages/vue/package.json | 4 +-- 17 files changed, 45 insertions(+), 28 deletions(-) diff --git a/docs/package.json b/docs/package.json index 40725634b..f98e65caa 100644 --- a/docs/package.json +++ b/docs/package.json @@ -56,7 +56,7 @@ "dependencies": { "bnc-sdk": "^4.6.6", "@web3-onboard/coinbase": "^2.2.1-alpha.1", - "@web3-onboard/core": "^2.15.7-alpha.1", + "@web3-onboard/core": "^2.15.6-alpha.3", "@web3-onboard/dcent": "^2.2.4-alpha.1", "@web3-onboard/enkrypt": "^2.0.1-alpha.1", "@web3-onboard/fortmatic": "^2.0.16-alpha.1", diff --git a/examples/with-ledger/package.json b/examples/with-ledger/package.json index ba1e3d094..6a4ab5482 100644 --- a/examples/with-ledger/package.json +++ b/examples/with-ledger/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@web3-onboard/ledger": "^2.4.3-alpha.1", - "@web3-onboard/react": "^2.6.8-alpha.1", + "@web3-onboard/react": "^2.6.7-alpha.3", "next": "12.2.4", "react": "18.2.0", "react-dom": "18.2.0" diff --git a/examples/with-nextjs-13/package.json b/examples/with-nextjs-13/package.json index 535e51cbf..51f55f63f 100644 --- a/examples/with-nextjs-13/package.json +++ b/examples/with-nextjs-13/package.json @@ -23,7 +23,7 @@ "@web3-onboard/magic": "^2.1.4-alpha.1", "@web3-onboard/mew-wallet": "^2.0.0", "@web3-onboard/portis": "^2.1.4-alpha.1", - "@web3-onboard/react": "^2.6.8-alpha.1", + "@web3-onboard/react": "^2.6.7-alpha.3", "@web3-onboard/sequence": "^2.0.5-alpha.1", "@web3-onboard/taho": "^2.0.1-alpha.1", "@web3-onboard/torus": "^2.2.2-alpha.1", diff --git a/examples/with-nextjs/package.json b/examples/with-nextjs/package.json index 2bb9bf59b..c427a5938 100644 --- a/examples/with-nextjs/package.json +++ b/examples/with-nextjs/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@web3-onboard/react": "2.6.8-alpha.1", + "@web3-onboard/react": "2.6.7-alpha.3", "next": "12.2.5", "react": "18.2.0", "react-dom": "18.2.0" diff --git a/examples/with-sveltekit/package.json b/examples/with-sveltekit/package.json index fa6f6b545..13e69161b 100644 --- a/examples/with-sveltekit/package.json +++ b/examples/with-sveltekit/package.json @@ -32,7 +32,7 @@ "type": "module", "dependencies": { "@fontsource/fira-mono": "^4.5.10", - "@web3-onboard/core": "^2.15.7-alpha.1", + "@web3-onboard/core": "^2.15.6-alpha.3", "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", "@web3-onboard/walletconnect": "^2.3.3-alpha.1", "buffer": "^6.0.3" diff --git a/examples/with-vite-react/package.json b/examples/with-vite-react/package.json index 836775ff8..763356209 100644 --- a/examples/with-vite-react/package.json +++ b/examples/with-vite-react/package.json @@ -20,7 +20,7 @@ "@web3-onboard/magic": "^2.1.4-alpha.1", "@web3-onboard/mew": "^2.1.3", "@web3-onboard/portis": "^2.1.4-alpha.1", - "@web3-onboard/react": "^2.6.8-alpha.1", + "@web3-onboard/react": "^2.6.7-alpha.3", "@web3-onboard/sequence": "^2.0.5-alpha.1", "@web3-onboard/tallyho": "^2.0.1", "@web3-onboard/torus": "^2.2.2-alpha.1", diff --git a/examples/with-vuejs-v2/package.json b/examples/with-vuejs-v2/package.json index e49b3352f..e852002e9 100644 --- a/examples/with-vuejs-v2/package.json +++ b/examples/with-vuejs-v2/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", - "@web3-onboard/vue": "^2.5.8-alpha.1", + "@web3-onboard/vue": "^2.5.7-alpha.3", "vue": "^2.7.14", "vue-template-compiler": "2.7.14" }, diff --git a/examples/with-vuejs/package.json b/examples/with-vuejs/package.json index d2419fcf7..78bfa1f76 100644 --- a/examples/with-vuejs/package.json +++ b/examples/with-vuejs/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@web3-onboard/injected-wallets": "^2.8.3-alpha.1", - "@web3-onboard/vue": "^2.5.8-alpha.1", + "@web3-onboard/vue": "^2.5.7-alpha.3", "pinia": "^2.0.29", "vue": "^3.2.45", "vue-router": "^4.1.6" diff --git a/packages/common/src/types.ts b/packages/common/src/types.ts index 96a9325ce..5a166025d 100644 --- a/packages/common/src/types.ts +++ b/packages/common/src/types.ts @@ -386,6 +386,14 @@ export enum ProviderRpcErrorCode { export interface Chain { namespace?: 'evm' id: ChainId + /** + * Recommended to include. Used for network requests + * (eg Alchemy or Infura end point). + * PLEASE NOTE: Some wallets require an rpcUrl, label, + * and token for actions such as adding a new chain. + * It is recommended to include rpcUrl, label, + * and token for full functionality. + */ rpcUrl?: string label?: string token?: TokenSymbol // eg ETH, BNB, MATIC diff --git a/packages/core/package.json b/packages/core/package.json index 79ee44b86..90e02d91f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/core", - "version": "2.15.7-alpha.1", + "version": "2.15.6-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/chain.ts b/packages/core/src/chain.ts index 1a64b60b7..4868cd22a 100644 --- a/packages/core/src/chain.ts +++ b/packages/core/src/chain.ts @@ -10,11 +10,11 @@ import { toHexString } from './utils.js' import { updateChain } from './store/actions.js' async function setChain(options: { - chainId: string | number, - chainNamespace?: string, - wallet?: WalletState['label'], - rpcUrl?: string, - label?: string, + chainId: string | number + chainNamespace?: string + wallet?: WalletState['label'] + rpcUrl?: string + label?: string token?: string }): Promise { const error = validateSetChainOptions(options) @@ -24,7 +24,14 @@ async function setChain(options: { } const { wallets, chains } = state.get() - const { chainId, chainNamespace = 'evm', wallet: walletToSet, rpcUrl, label, token } = options + const { + chainId, + chainNamespace = 'evm', + wallet: walletToSet, + rpcUrl, + label, + token + } = options const chainIdHex = toHexString(chainId) // validate that chainId has been added to chains @@ -79,15 +86,15 @@ async function setChain(options: { if (rpcUrl) { chain.rpcUrl = rpcUrl } - + if (label) { chain.label = label } - + if (token) { chain.token = token } - + updateChain(chain) } @@ -96,7 +103,7 @@ async function setChain(options: { wallet, chain, switchChainModalClosed$, - chainIdHex, + chainIdHex ) } @@ -114,7 +121,7 @@ const chainNotInWallet = async ( wallet: WalletState, chain: Chain, switchChainModalClosed$: Observable, - chainIdHex: string, + chainIdHex: string ): Promise => { try { await addNewChain(wallet.provider, chain) diff --git a/packages/core/src/provider.ts b/packages/core/src/provider.ts index ddf277729..623146783 100644 --- a/packages/core/src/provider.ts +++ b/packages/core/src/provider.ts @@ -445,7 +445,7 @@ export function switchChain( export function addNewChain( provider: EIP1193Provider, - chain: Chain, + chain: Chain ): Promise { return provider.request({ method: 'wallet_addEthereumChain', diff --git a/packages/core/src/views/shared/NetworkSelector.svelte b/packages/core/src/views/shared/NetworkSelector.svelte index 7e851b548..f3cc385d0 100644 --- a/packages/core/src/views/shared/NetworkSelector.svelte +++ b/packages/core/src/views/shared/NetworkSelector.svelte @@ -134,7 +134,9 @@ > {/if} {#each chains as chain (chain.id)} - + {/each} {/if} diff --git a/packages/demo/package.json b/packages/demo/package.json index f29f043f2..b21faa339 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -23,7 +23,7 @@ "webpack-dev-server": "4.7.4" }, "dependencies": { - "@web3-onboard/core": "^2.15.7-alpha.1", + "@web3-onboard/core": "^2.15.6-alpha.3", "@web3-onboard/coinbase": "^2.2.1-alpha.1", "@web3-onboard/transaction-preview": "^2.0.5-alpha.1", "@web3-onboard/dcent": "^2.2.4-alpha.1", diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index a005805ec..50b492e4a 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -638,7 +638,7 @@ - diff --git a/packages/react/package.json b/packages/react/package.json index 038a4699a..f4d4d74e9 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/react", - "version": "2.6.8-alpha.1", + "version": "2.6.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.15.7-alpha.1", + "@web3-onboard/core": "^2.15.6-alpha.3", "@web3-onboard/common": "^2.2.4-alpha.1", "use-sync-external-store": "1.0.0" }, diff --git a/packages/vue/package.json b/packages/vue/package.json index 3d9f36ad0..a1a760fd2 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/vue", - "version": "2.5.8-alpha.1", + "version": "2.5.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 standardized 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.4-alpha.1", - "@web3-onboard/core": "^2.15.7-alpha.1", + "@web3-onboard/core": "^2.15.6-alpha.3", "vue-demi": "^0.12.4" }, "peerDependencies": { From fe1f3696e8919c7df881f60a9fc2abd8dd2e61e0 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Mon, 20 Mar 2023 14:40:15 -0600 Subject: [PATCH 14/16] add type notes for improved devEx --- docs/src/routes/docs/[...3]modules/react.md | 7 +++++-- packages/common/src/types.ts | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/src/routes/docs/[...3]modules/react.md b/docs/src/routes/docs/[...3]modules/react.md index b7152c98d..466c4dbdf 100644 --- a/docs/src/routes/docs/[...3]modules/react.md +++ b/docs/src/routes/docs/[...3]modules/react.md @@ -177,7 +177,7 @@ setPrimaryWallet(wallets[1], wallets[1].accounts[2].address) ## `useSetChain` -This hook allows you to set the chain of a user's connected wallet, keep track of the current chain the user is connected to and the status of setting the chain. Passing in a wallet label will operate on that connected wallet, otherwise it will default to the last connected wallet. +This hook allows you to set the chain of a user's connected wallet, keep track of the current chain the user is connected to and the status of setting the chain. Passing in a wallet label will operate on that connected wallet, otherwise it will default to the last connected wallet. If a chain was instantiated without an rpcUrl, token, or label, add these options for wallets that require this information for adding a new chain. ```typescript import { useSetChain } from '@web3-onboard/react' @@ -197,8 +197,11 @@ type SetChainOptions = { chainId: string chainNamespace?: string wallet?: WalletState['label'], - rpcUrl?: string, + // if chain was instantiated without rpcUrl, include here. Used for network requests + rpcUrl?: string, + // if chain was instantiated without token, include here. Used for display, eg Ethereum Mainnet label?: string, + // if chain was instantiated without label, include here. The native token symbol, eg ETH, BNB, MATIC token?: string, } diff --git a/packages/common/src/types.ts b/packages/common/src/types.ts index 5a166025d..80847c427 100644 --- a/packages/common/src/types.ts +++ b/packages/common/src/types.ts @@ -395,8 +395,10 @@ export interface Chain { * and token for full functionality. */ rpcUrl?: string + /* Recommended to include. Used for display, eg Ethereum Mainnet */ label?: string - token?: TokenSymbol // eg ETH, BNB, MATIC + /* Recommended to include. The native token symbol, eg ETH, BNB, MATIC */ + token?: TokenSymbol color?: string icon?: string // svg string providerConnectionInfo?: ConnectionInfo From e66b6c0a8e6b1fc17ac1f83a408b9a6e542caec0 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Mon, 20 Mar 2023 14:43:50 -0600 Subject: [PATCH 15/16] keep react package readme in line with docs --- packages/react/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/react/README.md b/packages/react/README.md index dbedc2056..db213cafc 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -182,7 +182,7 @@ setPrimaryWallet( ## `useSetChain` -This hook allows you to set the chain of a user's connected wallet, keep track of the current chain the user is connected to and the status of setting the chain. Passing in a wallet label will operate on that connected wallet, otherwise it will default to the last connected wallet. +This hook allows you to set the chain of a user's connected wallet, keep track of the current chain the user is connected to and the status of setting the chain. Passing in a wallet label will operate on that connected wallet, otherwise it will default to the last connected wallet. If a chain was instantiated without an rpcUrl, token, or label, add these options for wallets that require this information for adding a new chain. ```typescript import { useSetChain } from '@web3-onboard/react' @@ -202,8 +202,11 @@ type SetChainOptions = { chainId: string chainNamespace?: string wallet?: WalletState['label'], - rpcUrl?: string, + // if chain was instantiated without rpcUrl, include here. Used for network requests + rpcUrl?: string, + // if chain was instantiated without token, include here. Used for display, eg Ethereum Mainnet label?: string, + // if chain was instantiated without label, include here. The native token symbol, eg ETH, BNB, MATIC token?: string, } From 8e0d903bcfe0329cd709879d6865870a94198ee6 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Mon, 20 Mar 2023 15:01:41 -0600 Subject: [PATCH 16/16] add other type comments --- packages/common/src/types.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/common/src/types.ts b/packages/common/src/types.ts index 80847c427..6bcbb5390 100644 --- a/packages/common/src/types.ts +++ b/packages/common/src/types.ts @@ -384,7 +384,12 @@ export enum ProviderRpcErrorCode { } export interface Chain { + /** + * String indicating chain namespace. + * Defaults to 'evm' but will allow other chain namespaces in the future + */ namespace?: 'evm' + /* Hex encoded string, eg '0x1' for Ethereum Mainnet */ id: ChainId /** * Recommended to include. Used for network requests @@ -399,10 +404,18 @@ export interface Chain { label?: string /* Recommended to include. The native token symbol, eg ETH, BNB, MATIC */ token?: TokenSymbol + /** + * The color used to represent the chain and + * will be used as a background for the icon + */ color?: string - icon?: string // svg string + /* Svg string. The icon to represent the chain */ + icon?: string + /* Related to ConnectionInfo from 'ethers/lib/utils' */ providerConnectionInfo?: ConnectionInfo + /* An optional public RPC used when adding a new chain config to the wallet */ publicRpcUrl?: string + /* Also used when adding a new config to the wallet */ blockExplorerUrl?: string }