From f9ffbadb422ad84ffc2a28ab50e95fcc1376af93 Mon Sep 17 00:00:00 2001 From: Daniel <25051234+dasanra@users.noreply.github.com> Date: Tue, 8 Nov 2022 16:44:01 +0100 Subject: [PATCH 01/15] Enable new domain at Gnosis package (#1347) --- packages/gnosis/package.json | 2 +- packages/gnosis/src/icon.ts | 4 ++-- packages/gnosis/src/index.ts | 10 +++++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/gnosis/package.json b/packages/gnosis/package.json index 9b62b0ad8..729a0f024 100644 --- a/packages/gnosis/package.json +++ b/packages/gnosis/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/gnosis", - "version": "2.1.4", + "version": "2.1.5-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/gnosis/src/icon.ts b/packages/gnosis/src/icon.ts index 99bd18a8a..1bd36fd17 100644 --- a/packages/gnosis/src/icon.ts +++ b/packages/gnosis/src/icon.ts @@ -1,5 +1,5 @@ export default ` - - + + ` diff --git a/packages/gnosis/src/index.ts b/packages/gnosis/src/index.ts index 050aa1ceb..edd43f1c6 100644 --- a/packages/gnosis/src/index.ts +++ b/packages/gnosis/src/index.ts @@ -5,14 +5,18 @@ type GnosisOptions = { } function gnosis(options?: GnosisOptions): WalletInit { - const { whitelistedDomains = [/gnosis-safe.io/] } = options || {} + const { whitelistedDomains = [ + /^https:\/\/gnosis-safe\.io$/, + /^https:\/\/app\.safe\.global$/, + /^https:\/\/safe\.global$/ + ] } = options || {} return () => { const loadedInIframe = window.self !== window.top return loadedInIframe ? { - label: 'Gnosis Safe', + label: 'Safe', getIcon: async () => (await import('./icon.js')).default, getInterface: async () => { const { default: SafeAppsSDK } = await import( @@ -44,7 +48,7 @@ function gnosis(options?: GnosisOptions): WalletInit { if (!safe) { throw new Error( - `App must be loaded in a Safe App context, head to the Gnosis Safe App and open this website as an app.` + `App must be loaded in a Safe App context, head to the Safe and open this website as an app.` ) } From c4dc9c3f391ff5fe0dac28fd1e86e5daaca61ca9 Mon Sep 17 00:00:00 2001 From: Samuele Agostinelli Date: Thu, 10 Nov 2022 17:20:57 -0500 Subject: [PATCH 02/15] Sequence package added as part of peerDepencies (#1335) * sequence-peer-depency * update sequence connector version * removed dependency 0xsequence in example * Update examples/with-vite-react/package.json * Update examples/with-vite-react/package.json * Update packages/sequence/package.json * Update packages/sequence/package.json Co-authored-by: Adam Carpenter --- examples/with-vite-react/package.json | 2 +- packages/demo/package.json | 2 +- packages/sequence/README.md | 2 +- packages/sequence/package.json | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/with-vite-react/package.json b/examples/with-vite-react/package.json index 5786bb2df..197eea18f 100644 --- a/examples/with-vite-react/package.json +++ b/examples/with-vite-react/package.json @@ -21,7 +21,7 @@ "@web3-onboard/mew": "^2.1.3", "@web3-onboard/portis": "^2.1.3", "@web3-onboard/react": "^2.3.5", - "@web3-onboard/sequence": "^2.0.2", + "@web3-onboard/sequence": "^2.0.3-alpha.1", "@web3-onboard/tallyho": "^2.0.1", "@web3-onboard/torus": "^2.1.3", "@web3-onboard/trezor": "^2.3.1", diff --git a/packages/demo/package.json b/packages/demo/package.json index 237dafd21..cde5a2185 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -34,7 +34,7 @@ "@web3-onboard/ledger": "^2.3.2", "@web3-onboard/magic": "^2.1.3", "@web3-onboard/portis": "^2.1.3", - "@web3-onboard/sequence": "^2.0.2", + "@web3-onboard/sequence": "^2.0.3-alpha.1", "@web3-onboard/torus": "^2.1.3", "@web3-onboard/trezor": "^2.3.2", "@web3-onboard/tallyho": "^2.0.1", diff --git a/packages/sequence/README.md b/packages/sequence/README.md index 03bed1cb4..9af0a1b12 100644 --- a/packages/sequence/README.md +++ b/packages/sequence/README.md @@ -4,7 +4,7 @@ ### Install -`npm i @web3-onboard/sequence` +`npm i @web3-onboard/sequence @0xsequence` ## Options diff --git a/packages/sequence/package.json b/packages/sequence/package.json index bbce69c6d..d7272b5ec 100644 --- a/packages/sequence/package.json +++ b/packages/sequence/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/sequence", - "version": "2.0.2", + "version": "2.0.3-alpha.1", "description": "Sequence is the smartest Web3 wallet. Easy, fun and secure.", "keywords": [ "Ethereum", @@ -58,5 +58,8 @@ "dependencies": { "@web3-onboard/common": "^2.2.3", "0xsequence": "^0.40.5" + }, + "peerDependencies": { + "0xsequence": ">=0.40.5" } } From 6cfe072ba7f8bd5204a2937310015ef3aaaff3f4 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Mon, 14 Nov 2022 16:41:49 -0700 Subject: [PATCH 03/15] [walletConnect v2.2.0-alpha.1]: Fix - walletConnect support for wallet_switchEthereumChain method (#1363) * Working as expected * Bump version for release * Cleanup * Revert demo app changes, bump version for release * version bump mminor instead of patch * Refactor --- packages/demo/package.json | 2 +- packages/walletconnect/package.json | 2 +- packages/walletconnect/src/index.ts | 55 ++++++++++++++++++++++++----- yarn.lock | 9 +++++ 4 files changed, 58 insertions(+), 10 deletions(-) diff --git a/packages/demo/package.json b/packages/demo/package.json index cde5a2185..eb85077d7 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -38,7 +38,7 @@ "@web3-onboard/torus": "^2.1.3", "@web3-onboard/trezor": "^2.3.2", "@web3-onboard/tallyho": "^2.0.1", - "@web3-onboard/walletconnect": "^2.1.3", + "@web3-onboard/walletconnect": "^2.2.0-alpha.1", "@web3-onboard/web3auth": "^2.1.3", "vconsole": "^3.9.5" }, diff --git a/packages/walletconnect/package.json b/packages/walletconnect/package.json index bbd10b83d..bd086a0d4 100644 --- a/packages/walletconnect/package.json +++ b/packages/walletconnect/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/walletconnect", - "version": "2.1.3", + "version": "2.2.0-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/index.ts b/packages/walletconnect/src/index.ts index 9ac95cf54..a419ea840 100644 --- a/packages/walletconnect/src/index.ts +++ b/packages/walletconnect/src/index.ts @@ -15,6 +15,14 @@ interface WalletConnectOptions { connectFirstChainId?: boolean } +const isHexString = (value: string | number) => { + if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/)) { + return false + } + + return true +} + function walletConnect(options?: WalletConnectOptions): WalletInit { const { bridge = 'https://bridge.walletconnect.org', @@ -97,7 +105,10 @@ function walletConnect(options?: WalletConnectOptions): WalletInit { next: ({ params }) => { const [{ accounts, chainId }] = params this.emit('accountsChanged', accounts) - this.emit('chainChanged', `0x${chainId.toString(16)}`) + const hexChainId = isHexString(chainId) + ? chainId + : `0x${chainId.toString(16)}` + this.emit('chainChanged', hexChainId) }, error: console.warn }) @@ -125,7 +136,9 @@ function walletConnect(options?: WalletConnectOptions): WalletInit { this.request = async ({ method, params }) => { if (method === 'eth_chainId') { - return `0x${this.connector.chainId.toString(16)}` + return isHexString(this.connector.chainId) + ? this.connector.chainId + : `0x${this.connector.chainId.toString(16)}` } if (method === 'eth_requestAccounts') { @@ -154,7 +167,10 @@ function walletConnect(options?: WalletConnectOptions): WalletInit { }) } else { const { accounts, chainId } = this.connector.session - this.emit('chainChanged', `0x${chainId.toString(16)}`) + const hexChainId = isHexString(chainId) + ? chainId + : `0x${chainId.toString(16)}` + this.emit('chainChanged', hexChainId) return resolve(accounts) } @@ -171,7 +187,10 @@ function walletConnect(options?: WalletConnectOptions): WalletInit { next: ({ params }) => { const [{ accounts, chainId }] = params this.emit('accountsChanged', accounts) - this.emit('chainChanged', `0x${chainId.toString(16)}`) + const hexChainId = isHexString(chainId) + ? chainId + : `0x${chainId.toString(16)}` + this.emit('chainChanged', hexChainId) QRCodeModal.close() resolve(accounts) }, @@ -180,16 +199,36 @@ function walletConnect(options?: WalletConnectOptions): WalletInit { }) } - if ( - method === 'wallet_switchEthereumChain' || - method === 'eth_selectAccounts' - ) { + if (method === 'eth_selectAccounts') { throw new ProviderRpcError({ code: ProviderRpcErrorCode.UNSUPPORTED_METHOD, message: `The Provider does not support the requested method: ${method}` }) } + if (method == 'wallet_switchEthereumChain') { + if (!params) { + throw new ProviderRpcError({ + code: ProviderRpcErrorCode.INVALID_PARAMS, + message: `The Provider requires a chainId to be passed in as an argument` + }) + } + const chainIdObj = params[0] as { chainId?: number } + if ( + !chainIdObj.hasOwnProperty('chainId') || + typeof chainIdObj['chainId'] === 'undefined' + ) { + throw new ProviderRpcError({ + code: ProviderRpcErrorCode.INVALID_PARAMS, + message: `The Provider requires a chainId to be passed in as an argument` + }) + } + return this.connector.updateSession({ + chainId: chainIdObj.chainId, + accounts: this.connector.accounts + }) + } + // @ts-ignore if (method === 'eth_sendTransaction') { // @ts-ignore diff --git a/yarn.lock b/yarn.lock index 33ec05902..9a08f62dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2953,6 +2953,15 @@ dependencies: "@walletconnect/window-getters" "^1.0.0" +"@web3-onboard/gnosis@^2.1.3": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@web3-onboard/gnosis/-/gnosis-2.1.4.tgz#8f0bfa50bf662084091c61cc7c9248bb44e0ea6d" + integrity sha512-lTAnfc3FEy6zmc/SIOI9dW0oVH23WM+Nqo8pAfjKOUrGq+ChyyA7ghhP1dUoKfJgAtblUC5MKHzPLdL+K+PYNw== + dependencies: + "@gnosis.pm/safe-apps-provider" "^0.9.2" + "@gnosis.pm/safe-apps-sdk" "^6.1.1" + "@web3-onboard/common" "^2.2.3" + "@web3auth/base-plugin@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@web3auth/base-plugin/-/base-plugin-1.0.1.tgz#1e2a87acf745299fdff6f92e6c46ee9bc38aa670" From c5d6889a3a1ff1f018ef9c5c8771be9c20a5babc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 09:20:57 -0700 Subject: [PATCH 04/15] Bump loader-utils from 2.0.2 to 2.0.3 (#1355) Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.2 to 2.0.3. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.3/CHANGELOG.md) - [Commits](https://github.com/webpack/loader-utils/compare/v2.0.2...v2.0.3) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9a08f62dd..08ee7e2b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7353,11 +7353,9 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= json5@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" + version "2.2.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" + integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== jsonfile@^4.0.0: version "4.0.0" @@ -7512,9 +7510,9 @@ loader-runner@^4.2.0: integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== loader-utils@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129" - integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A== + version "2.0.3" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.3.tgz#d4b15b8504c63d1fc3f2ade52d41bc8459d6ede1" + integrity sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" From 656ef4872d1b2cf4873e803393fcbebdcedfc623 Mon Sep 17 00:00:00 2001 From: Taylor Dawson Date: Tue, 15 Nov 2022 08:52:01 -0800 Subject: [PATCH 05/15] Fix css var typo (#1362) * Fix css var typo * Bump core in vue and react pckgs Co-authored-by: Adam Carpenter --- packages/core/package.json | 2 +- packages/core/src/views/account-center/Micro.svelte | 2 +- packages/demo/package.json | 2 +- packages/react/package.json | 4 ++-- packages/vue/package.json | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 10f669310..6eb8c5cb3 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/core", - "version": "2.10.0", + "version": "2.10.1-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/core/src/views/account-center/Micro.svelte b/packages/core/src/views/account-center/Micro.svelte index 58533cb0a..031e3f38b 100644 --- a/packages/core/src/views/account-center/Micro.svelte +++ b/packages/core/src/views/account-center/Micro.svelte @@ -22,7 +22,7 @@ var(--onboard-white, var(--white)) ); border: 1px solid - var(--acount-center-border, var(--onboard-gray-100, var(--gray-100))); + var(--account-center-border, var(--onboard-gray-100, var(--gray-100))); box-shadow: var( --account-center-box-shadow, var(--onboard-shadow-3, var(--shadow-3)) diff --git a/packages/demo/package.json b/packages/demo/package.json index eb85077d7..da88c43bf 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@web3-onboard/coinbase": "^2.1.3", - "@web3-onboard/core": "^2.10.0", + "@web3-onboard/core": "^2.10.1-alpha.1", "@web3-onboard/dcent": "^2.2.2", "@web3-onboard/fortmatic": "^2.0.14", "@web3-onboard/gas": "^2.1.3", diff --git a/packages/react/package.json b/packages/react/package.json index f8ded9c7e..9c3950f9d 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/react", - "version": "2.4.0", + "version": "2.4.1-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.10.0", + "@web3-onboard/core": "^2.10.1-alpha.1", "@web3-onboard/common": "^2.2.3", "use-sync-external-store": "1.0.0" }, diff --git a/packages/vue/package.json b/packages/vue/package.json index c3b50cedc..50d25a732 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/vue", - "version": "2.3.0", + "version": "2.3.1-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 standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", @@ -63,7 +63,7 @@ "@vueuse/core": "^8.4.2", "@vueuse/rxjs": "^8.2.0", "@web3-onboard/common": "^2.2.3", - "@web3-onboard/core": "^2.10.0", + "@web3-onboard/core": "^2.10.1-alpha.1", "vue-demi": "^0.12.4" }, "peerDependencies": { From 95ad7d7d402f068b819226f18c11c147b44731a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 10:05:04 -0700 Subject: [PATCH 06/15] Bump socket.io-parser from 3.3.2 to 3.3.3 in /examples/with-vite-react (#1365) Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 3.3.2 to 3.3.3. - [Release notes](https://github.com/socketio/socket.io-parser/releases) - [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/socket.io-parser/compare/3.3.2...3.3.3) --- updated-dependencies: - dependency-name: socket.io-parser dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- examples/with-vite-react/yarn.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/with-vite-react/yarn.lock b/examples/with-vite-react/yarn.lock index f07177ec3..f29476662 100644 --- a/examples/with-vite-react/yarn.lock +++ b/examples/with-vite-react/yarn.lock @@ -2984,10 +2984,10 @@ "@web3-onboard/core" "^2.8.5" use-sync-external-store "1.0.0" -"@web3-onboard/sequence@^2.0.2": - version "2.0.2" - resolved "https://registry.npmjs.org/@web3-onboard/sequence/-/sequence-2.0.2.tgz#e95d5382771c1220e05d8bbc6e68f5dcdfd05394" - integrity sha512-1Cy0CG6zNgyRG1G453XfxjMx59jqrDXpPFNjzg645/6bW6jdyqEEPa7rTXcSx3Dav5A93E6ePH1vJtZKW64Hhw== +"@web3-onboard/sequence@^2.0.3-alpha.1": + version "2.0.3-alpha.1" + resolved "https://registry.yarnpkg.com/@web3-onboard/sequence/-/sequence-2.0.3-alpha.1.tgz#fb71aa65f6c1fb5a09705731c859641cdc95fbf4" + integrity sha512-E/JQormX7phENgnPtqtTEomxTCEzXQIRqU4w7/jFzYI/XkVoVvjjflQZ7Z8r2mH55fPowvVHrmB0K5l4sOW2lw== dependencies: "0xsequence" "^0.40.5" "@web3-onboard/common" "^2.2.3" @@ -3973,7 +3973,7 @@ component-bind@1.0.0: component-emitter@~1.3.0: version "1.3.0" - resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== component-inherit@0.0.3: @@ -6240,7 +6240,7 @@ isarray@0.0.1: isarray@2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" integrity sha512-c2cu3UxbI+b6kR3fy0nRnAhodsvR9dx7U5+znCOzdj6IfP3upFURTr0Xl5BlQZNKZjEtxrmVyfSdeE3O57smoQ== isarray@^2.0.1: @@ -6872,7 +6872,7 @@ mri@^1.1.0: ms@2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== ms@2.1.2: @@ -8286,9 +8286,9 @@ socket.io-client@^2.3.0: to-array "0.1.4" socket.io-parser@~3.3.0: - version "3.3.2" - resolved "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz#ef872009d0adcf704f2fbe830191a14752ad50b6" - integrity sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg== + version "3.3.3" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.3.3.tgz#3a8b84823eba87f3f7624e64a8aaab6d6318a72f" + integrity sha512-qOg87q1PMWWTeO01768Yh9ogn7chB9zkKtQnya41Y355S0UmpXgpcrFwAgjYJxu9BdKug5r5e9YtVSeWhKBUZg== dependencies: component-emitter "~1.3.0" debug "~3.1.0" From d1b38dcba49aa9ff7226a5a5d8731f167a182b5e Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Tue, 15 Nov 2022 10:18:16 -0700 Subject: [PATCH 07/15] Bump versions for release --- examples/with-ledger/package.json | 2 +- examples/with-nextjs/package.json | 2 +- examples/with-sveltekit/package.json | 2 +- examples/with-vite-react/package.json | 8 ++++---- examples/with-vuejs-v2/package.json | 2 +- examples/with-vuejs/package.json | 2 +- packages/core/package.json | 2 +- packages/demo/package.json | 8 ++++---- packages/gnosis/package.json | 2 +- packages/react/package.json | 4 ++-- packages/sequence/package.json | 2 +- packages/vue/package.json | 4 ++-- packages/walletconnect/package.json | 2 +- yarn.lock | 8 ++++---- 14 files changed, 25 insertions(+), 25 deletions(-) diff --git a/examples/with-ledger/package.json b/examples/with-ledger/package.json index f54680019..b166a44c6 100644 --- a/examples/with-ledger/package.json +++ b/examples/with-ledger/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@web3-onboard/ledger": "^2.1.6", - "@web3-onboard/react": "^2.2.4", + "@web3-onboard/react": "^2.4.1", "next": "12.2.4", "react": "18.2.0", "react-dom": "18.2.0" diff --git a/examples/with-nextjs/package.json b/examples/with-nextjs/package.json index 41a96126e..c36bdb859 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.2.6", + "@web3-onboard/react": "2.4.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 077446439..aaae818fb 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.0", - "@web3-onboard/walletconnect": "^2.1.2", + "@web3-onboard/walletconnect": "^2.2.0", "buffer": "^6.0.3" } } diff --git a/examples/with-vite-react/package.json b/examples/with-vite-react/package.json index 197eea18f..63af3b5c5 100644 --- a/examples/with-vite-react/package.json +++ b/examples/with-vite-react/package.json @@ -12,7 +12,7 @@ "@web3-onboard/coinbase": "^2.1.3", "@web3-onboard/dcent": "^2.2.1", "@web3-onboard/fortmatic": "^2.0.14", - "@web3-onboard/gnosis": "^2.1.3", + "@web3-onboard/gnosis": "^2.2.0", "@web3-onboard/injected-wallets": "^2.2.4", "@web3-onboard/keepkey": "^2.3.1", "@web3-onboard/keystone": "^2.3.1", @@ -20,12 +20,12 @@ "@web3-onboard/magic": "^2.1.3", "@web3-onboard/mew": "^2.1.3", "@web3-onboard/portis": "^2.1.3", - "@web3-onboard/react": "^2.3.5", - "@web3-onboard/sequence": "^2.0.3-alpha.1", + "@web3-onboard/react": "^2.4.1", + "@web3-onboard/sequence": "^2.0.3", "@web3-onboard/tallyho": "^2.0.1", "@web3-onboard/torus": "^2.1.3", "@web3-onboard/trezor": "^2.3.1", - "@web3-onboard/walletconnect": "^2.1.3", + "@web3-onboard/walletconnect": "^2.2.0", "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 8222324bf..04701b18b 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.2.0", - "@web3-onboard/vue": "^2.2.1", + "@web3-onboard/vue": "^2.3.1", "vue": "^2.6.12", "vue-template-compiler": "^2.7.10" }, diff --git a/examples/with-vuejs/package.json b/examples/with-vuejs/package.json index 3a60cce97..3c82ad746 100644 --- a/examples/with-vuejs/package.json +++ b/examples/with-vuejs/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@web3-onboard/injected-wallets": "^2.0.15", - "@web3-onboard/vue": "^2.1.6", + "@web3-onboard/vue": "^2.3.1", "pinia": "^2.0.16", "vue": "^3.2.37", "vue-router": "^4.1.2" diff --git a/packages/core/package.json b/packages/core/package.json index 6eb8c5cb3..a0569d54a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/core", - "version": "2.10.1-alpha.1", + "version": "2.10.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 da88c43bf..0cf864854 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -23,22 +23,22 @@ }, "dependencies": { "@web3-onboard/coinbase": "^2.1.3", - "@web3-onboard/core": "^2.10.1-alpha.1", + "@web3-onboard/core": "^2.10.1", "@web3-onboard/dcent": "^2.2.2", "@web3-onboard/fortmatic": "^2.0.14", "@web3-onboard/gas": "^2.1.3", - "@web3-onboard/gnosis": "^2.1.3", + "@web3-onboard/gnosis": "^2.2.0", "@web3-onboard/injected-wallets": "^2.3.0", "@web3-onboard/keepkey": "^2.3.2", "@web3-onboard/keystone": "^2.3.2", "@web3-onboard/ledger": "^2.3.2", "@web3-onboard/magic": "^2.1.3", "@web3-onboard/portis": "^2.1.3", - "@web3-onboard/sequence": "^2.0.3-alpha.1", + "@web3-onboard/sequence": "^2.0.3", "@web3-onboard/torus": "^2.1.3", "@web3-onboard/trezor": "^2.3.2", "@web3-onboard/tallyho": "^2.0.1", - "@web3-onboard/walletconnect": "^2.2.0-alpha.1", + "@web3-onboard/walletconnect": "^2.2.0", "@web3-onboard/web3auth": "^2.1.3", "vconsole": "^3.9.5" }, diff --git a/packages/gnosis/package.json b/packages/gnosis/package.json index 729a0f024..b9ffc7994 100644 --- a/packages/gnosis/package.json +++ b/packages/gnosis/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/gnosis", - "version": "2.1.5-alpha.1", + "version": "2.1.5", "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/react/package.json b/packages/react/package.json index 9c3950f9d..2ddc80554 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/react", - "version": "2.4.1-alpha.1", + "version": "2.4.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.10.1-alpha.1", + "@web3-onboard/core": "^2.10.1", "@web3-onboard/common": "^2.2.3", "use-sync-external-store": "1.0.0" }, diff --git a/packages/sequence/package.json b/packages/sequence/package.json index d7272b5ec..e75ba8bba 100644 --- a/packages/sequence/package.json +++ b/packages/sequence/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/sequence", - "version": "2.0.3-alpha.1", + "version": "2.0.3", "description": "Sequence is the smartest Web3 wallet. Easy, fun and secure.", "keywords": [ "Ethereum", diff --git a/packages/vue/package.json b/packages/vue/package.json index 50d25a732..ef8c95a36 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/vue", - "version": "2.3.1-alpha.1", + "version": "2.3.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 standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", @@ -63,7 +63,7 @@ "@vueuse/core": "^8.4.2", "@vueuse/rxjs": "^8.2.0", "@web3-onboard/common": "^2.2.3", - "@web3-onboard/core": "^2.10.1-alpha.1", + "@web3-onboard/core": "^2.10.1", "vue-demi": "^0.12.4" }, "peerDependencies": { diff --git a/packages/walletconnect/package.json b/packages/walletconnect/package.json index bd086a0d4..ccfbd0845 100644 --- a/packages/walletconnect/package.json +++ b/packages/walletconnect/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/walletconnect", - "version": "2.2.0-alpha.1", + "version": "2.2.0", "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/yarn.lock b/yarn.lock index 08ee7e2b0..35b2637d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2953,10 +2953,10 @@ dependencies: "@walletconnect/window-getters" "^1.0.0" -"@web3-onboard/gnosis@^2.1.3": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@web3-onboard/gnosis/-/gnosis-2.1.4.tgz#8f0bfa50bf662084091c61cc7c9248bb44e0ea6d" - integrity sha512-lTAnfc3FEy6zmc/SIOI9dW0oVH23WM+Nqo8pAfjKOUrGq+ChyyA7ghhP1dUoKfJgAtblUC5MKHzPLdL+K+PYNw== +"@web3-onboard/gnosis@^2.2.0": + version "2.1.5-alpha.1" + resolved "https://registry.yarnpkg.com/@web3-onboard/gnosis/-/gnosis-2.1.5-alpha.1.tgz#cc2c0efe21beac540f4b87c4690cf26fd60e5293" + integrity sha512-Z4b620aROhGhbkThaJT8L4VVLA5jOTJ7OIMfxAZSOoT7K+CFik+D1uUg51KJspwtQRmbkmEC2fR6BVppP4vjuw== dependencies: "@gnosis.pm/safe-apps-provider" "^0.9.2" "@gnosis.pm/safe-apps-sdk" "^6.1.1" From 11dd10557dc2a85854e595acf84acb519c101daf Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Tue, 15 Nov 2022 10:18:57 -0700 Subject: [PATCH 08/15] Bump pckg for release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b69fe42da..972639a0b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "web3-onboard-monorepo", - "version": "2.14.1", + "version": "2.14.2", "private": true, "workspaces": { "packages": [ From 864755f76836fb2c9890da5c77095be7346b2e1a Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Tue, 15 Nov 2022 10:30:43 -0700 Subject: [PATCH 09/15] fix gnosis versioning --- examples/with-vite-react/package.json | 2 +- packages/demo/package.json | 2 +- yarn.lock | 9 --------- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/examples/with-vite-react/package.json b/examples/with-vite-react/package.json index 63af3b5c5..05b72bd4d 100644 --- a/examples/with-vite-react/package.json +++ b/examples/with-vite-react/package.json @@ -12,7 +12,7 @@ "@web3-onboard/coinbase": "^2.1.3", "@web3-onboard/dcent": "^2.2.1", "@web3-onboard/fortmatic": "^2.0.14", - "@web3-onboard/gnosis": "^2.2.0", + "@web3-onboard/gnosis": "^2.1.5", "@web3-onboard/injected-wallets": "^2.2.4", "@web3-onboard/keepkey": "^2.3.1", "@web3-onboard/keystone": "^2.3.1", diff --git a/packages/demo/package.json b/packages/demo/package.json index 0cf864854..439f1b88f 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -27,7 +27,7 @@ "@web3-onboard/dcent": "^2.2.2", "@web3-onboard/fortmatic": "^2.0.14", "@web3-onboard/gas": "^2.1.3", - "@web3-onboard/gnosis": "^2.2.0", + "@web3-onboard/gnosis": "^2.1.5", "@web3-onboard/injected-wallets": "^2.3.0", "@web3-onboard/keepkey": "^2.3.2", "@web3-onboard/keystone": "^2.3.2", diff --git a/yarn.lock b/yarn.lock index 35b2637d0..dd0b0d6ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2953,15 +2953,6 @@ dependencies: "@walletconnect/window-getters" "^1.0.0" -"@web3-onboard/gnosis@^2.2.0": - version "2.1.5-alpha.1" - resolved "https://registry.yarnpkg.com/@web3-onboard/gnosis/-/gnosis-2.1.5-alpha.1.tgz#cc2c0efe21beac540f4b87c4690cf26fd60e5293" - integrity sha512-Z4b620aROhGhbkThaJT8L4VVLA5jOTJ7OIMfxAZSOoT7K+CFik+D1uUg51KJspwtQRmbkmEC2fR6BVppP4vjuw== - dependencies: - "@gnosis.pm/safe-apps-provider" "^0.9.2" - "@gnosis.pm/safe-apps-sdk" "^6.1.1" - "@web3-onboard/common" "^2.2.3" - "@web3auth/base-plugin@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@web3auth/base-plugin/-/base-plugin-1.0.1.tgz#1e2a87acf745299fdff6f92e6c46ee9bc38aa670" From 314a9a7f893137455f551b31ce0b5e17fc418641 Mon Sep 17 00:00:00 2001 From: Gamaliel 'Yel' Padillo Date: Wed, 16 Nov 2022 14:45:07 -0800 Subject: [PATCH 10/15] Add Enkrypt and MEW Wallet DApp browser as SDKs (#1291) * devop: add enkrypt and mew wallet * chore: update version * update packages with necessary changes to fit current W3O patterns(versioning, injected packages changes, routing for docs) * Remove enkrypt from injected provider labels * Remove yarn lock within mew package * Mark mew package as deprecated * devop: remove unused packages * devop: move tsconfig to the right places, fix build * devop: remove tsconfig in the wrong place * Update docs and deploy for new mew-wallet package * Update enkrypt injected provider * Update injected, MEW Wallet and Enkrypt packages * Update handling of ChainIds * fix: throw error for unsupported chains * chore: make mew wallet throw error on unsupported chains * devop: add check for ios unsupported chains * chore: change error * chore: change error * chore: change error * chore: remove console * chore: remove hex conversion code * Remove package level yarn.lock files * Remove unused mew icon from injected package * Add yarn options to readmes * Clean up log * Bump mew package version to display deprecated warning * chore: update logo * Update packages/enkrypt/README.md * Prettier formatting * Apply suggestions from code review * Refine mew package.json Co-authored-by: Adam Carpenter --- .circleci/config.yml | 36 +++++++++++++ README.md | 3 +- packages/demo/package.json | 4 +- packages/demo/src/App.svelte | 7 +++ packages/enkrypt/README.md | 31 ++++++++++++ packages/enkrypt/package.json | 68 +++++++++++++++++++++++++ packages/enkrypt/src/icon.ts | 12 +++++ packages/enkrypt/src/index.ts | 45 +++++++++++++++++ packages/enkrypt/src/types.ts | 6 +++ packages/enkrypt/tsconfig.json | 15 ++++++ packages/injected/package.json | 2 +- packages/injected/src/constants.ts | 3 +- packages/injected/src/icons/enkrypt.ts | 17 +++++++ packages/injected/src/types.ts | 14 ++++-- packages/injected/src/wallets.ts | 43 +++++++++++++++- packages/mew-wallet/README.md | 31 ++++++++++++ packages/mew-wallet/package.json | 70 ++++++++++++++++++++++++++ packages/mew-wallet/src/icon.ts | 24 +++++++++ packages/mew-wallet/src/index.ts | 46 +++++++++++++++++ packages/mew-wallet/src/types.ts | 8 +++ packages/mew-wallet/tsconfig.json | 16 ++++++ packages/mew/README.md | 3 ++ packages/mew/package.json | 4 +- packages/mew/src/index.ts | 3 ++ 24 files changed, 501 insertions(+), 10 deletions(-) create mode 100644 packages/enkrypt/README.md create mode 100644 packages/enkrypt/package.json create mode 100644 packages/enkrypt/src/icon.ts create mode 100644 packages/enkrypt/src/index.ts create mode 100644 packages/enkrypt/src/types.ts create mode 100644 packages/enkrypt/tsconfig.json create mode 100644 packages/injected/src/icons/enkrypt.ts create mode 100644 packages/mew-wallet/README.md create mode 100644 packages/mew-wallet/package.json create mode 100644 packages/mew-wallet/src/icon.ts create mode 100644 packages/mew-wallet/src/index.ts create mode 100644 packages/mew-wallet/src/types.ts create mode 100644 packages/mew-wallet/tsconfig.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 30b2c461c..70f2319f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -219,6 +219,12 @@ jobs: working_directory: ~/web3-onboard-monorepo/packages/mew steps: - node-build-steps + build-mew-wallet: + docker: + - image: cimg/node:16.13.1 + working_directory: ~/web3-onboard-monorepo/packages/mew-wallet + steps: + - node-build-steps build-portis: docker: - image: cimg/node:16.13.1 @@ -309,6 +315,12 @@ jobs: working_directory: ~/web3-onboard-monorepo/packages/tallyho steps: - node-build-steps + build-enkrypt: + docker: + - image: cimg/node:16.13.1 + working_directory: ~/web3-onboard-monorepo/packages/enkrypt + steps: + - node-build-steps # Build staging/Alpha releases build-staging-core: @@ -365,6 +377,12 @@ jobs: working_directory: ~/web3-onboard-monorepo/packages/mew steps: - node-staging-build-steps + build-staging-mew-wallet: + docker: + - image: cimg/node:16.13.1 + working_directory: ~/web3-onboard-monorepo/packages/mew-wallet + steps: + - node-staging-build-steps build-staging-portis: docker: - image: cimg/node:16.13.1 @@ -455,6 +473,12 @@ jobs: working_directory: ~/web3-onboard-monorepo/packages/tallyho steps: - node-staging-build-steps + build-staging-enkrypt: + docker: + - image: cimg/node:16.13.1 + working_directory: ~/web3-onboard-monorepo/packages/enkrypt + steps: + - node-staging-build-steps workflows: version: 2 @@ -513,6 +537,12 @@ workflows: <<: *deploy_production_filters - build-staging-mew: <<: *deploy_staging_filters + mew-wallet: + jobs: + - build-mew-wallet: + <<: *deploy_production_filters + - build-staging-mew-wallet: + <<: *deploy_staging_filters portis: jobs: - build-portis: @@ -603,3 +633,9 @@ workflows: <<: *deploy_production_filters - build-staging-tallyho: <<: *deploy_staging_filters + enkrypt: + jobs: + - build-enkrypt: + <<: *deploy_production_filters + - build-staging-enkrypt: + <<: *deploy_staging_filters diff --git a/README.md b/README.md index bfe8821a1..a8e0e8acb 100644 --- a/README.md +++ b/README.md @@ -93,10 +93,11 @@ For full documentation, check out the README.md for each package: - [Magic](packages/magic/README.md) - [Fortmatic](packages/fortmatic/README.md) - [Portis](packages/portis/README.md) -- [MEW](packages/mew/README.md) +- [MEW-Wallet](packages/mew-wallet/README.md) - [Web3Auth](packages/web3auth/README.md) - [Sequence](packages/sequence/README.md) - [TallyHo](packages/tallyho/README.md) +- [Enkrypt](packages/enkrypt/README.md) **Hardware Wallets** diff --git a/packages/demo/package.json b/packages/demo/package.json index da88c43bf..aacb2717f 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -28,7 +28,7 @@ "@web3-onboard/fortmatic": "^2.0.14", "@web3-onboard/gas": "^2.1.3", "@web3-onboard/gnosis": "^2.1.3", - "@web3-onboard/injected-wallets": "^2.3.0", + "@web3-onboard/injected-wallets": "^2.4.0-alpha.1", "@web3-onboard/keepkey": "^2.3.2", "@web3-onboard/keystone": "^2.3.2", "@web3-onboard/ledger": "^2.3.2", @@ -40,6 +40,8 @@ "@web3-onboard/tallyho": "^2.0.1", "@web3-onboard/walletconnect": "^2.2.0-alpha.1", "@web3-onboard/web3auth": "^2.1.3", + "@web3-onboard/enkrypt": "^2.0.0-alpha.1", + "@web3-onboard/mew-wallet": "^2.0.0-alpha.1", "vconsole": "^3.9.5" }, "license": "MIT", diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index 95f3e3ea8..21e0070b3 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -17,6 +17,8 @@ import dcentModule from '@web3-onboard/dcent' import sequenceModule from '@web3-onboard/sequence' import tallyHoModule from '@web3-onboard/tallyho' + import enkryptModule from '@web3-onboard/enkrypt' + import mewWalletModule from '@web3-onboard/mew-wallet' import { recoverAddress, arrayify, @@ -107,6 +109,9 @@ const sequence = sequenceModule() + const enrkypt = enkryptModule() + const mewWallet = mewWalletModule() + const onboard = Onboard({ wallets: [ injected, @@ -114,6 +119,8 @@ ledger, trezor, walletConnect, + enrkypt, + mewWallet, keepkey, keystone, coinbaseWallet, diff --git a/packages/enkrypt/README.md b/packages/enkrypt/README.md new file mode 100644 index 000000000..383996bb0 --- /dev/null +++ b/packages/enkrypt/README.md @@ -0,0 +1,31 @@ +# @web3-onboard/enkrypt + +## Wallet module for connecting Enkrypt wallet through web3-onboard + +### Install + +**NPM** +`npm i @web3-onboard/core @web3-onboard/enkrypt` + +**Yarn** +`yarn add @web3-onboard/core @web3-onboard/enkrypt` + +## Usage + +```typescript +import Onboard from '@web3-onboard/core' +import enrkypt from '@web3-onboard/enkrypt' + +const enrkyptModule = enrkypt() + +const onboard = Onboard({ + // ... other Onboard options + wallets: [ + enrkyptModule + //... other wallets + ] +}) + +const connectedWallets = await onboard.connectWallet() +console.log(connectedWallets) +``` diff --git a/packages/enkrypt/package.json b/packages/enkrypt/package.json new file mode 100644 index 000000000..5b766d1ba --- /dev/null +++ b/packages/enkrypt/package.json @@ -0,0 +1,68 @@ +{ + "name": "@web3-onboard/enkrypt", + "version": "2.0.0-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", + "Web3", + "EVM", + "dapp", + "Multichain", + "Wallet", + "Transaction", + "Provider", + "Hardware Wallet", + "Notifications", + "React", + "Svelte", + "Vue", + "Next", + "Nuxt", + "MetaMask", + "Coinbase", + "WalletConnect", + "Ledger", + "Trezor", + "Connect Wallet", + "Ethereum Hooks", + "Blocknative", + "Mempool", + "pending", + "confirmed", + "Injected Wallet", + "Crypto", + "Crypto Wallet", + "Enkrypt" + ], + "repository": { + "type": "git", + "url": "https://github.com/blocknative/web3-onboard.git", + "directory": "packages/core" + }, + "homepage": "https://www.blocknative.com/onboard", + "bugs": "https://github.com/blocknative/web3-onboard/issues", + "module": "dist/index.js", + "browser": "dist/index.js", + "main": "dist/index.js", + "type": "module", + "typings": "dist/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "build": "tsc", + "dev": "tsc -w", + "type-check": "tsc --noEmit" + }, + "license": "MIT", + "devDependencies": { + "@ethersproject/providers": "^5.5.0", + "@types/node": "^17.0.21", + "ts-node": "^10.2.1", + "typescript": "^4.5.5", + "window": "^4.2.7" + }, + "dependencies": { + "@web3-onboard/common": "^2.2.2" + } +} diff --git a/packages/enkrypt/src/icon.ts b/packages/enkrypt/src/icon.ts new file mode 100644 index 000000000..f747e66b9 --- /dev/null +++ b/packages/enkrypt/src/icon.ts @@ -0,0 +1,12 @@ +export default ` + + + + + + + + + + +` diff --git a/packages/enkrypt/src/index.ts b/packages/enkrypt/src/index.ts new file mode 100644 index 000000000..3373a1ad2 --- /dev/null +++ b/packages/enkrypt/src/index.ts @@ -0,0 +1,45 @@ +import type { + WalletInit, + SimpleEventEmitter, + EIP1193Provider +} from '@web3-onboard/common' +import { createEIP1193Provider } from '@web3-onboard/common' +import { CustomWindow } from './types.js' +declare const window: CustomWindow + +function enkrypt(): WalletInit { + if (typeof window === 'undefined') return () => null + return () => { + return { + label: 'Enkrypt', + getIcon: async () => (await import('./icon.js')).default, + getInterface: async () => { + const enkryptExists = window.hasOwnProperty('enkrypt') + + if (enkryptExists) { + const enkryptProvider: EIP1193Provider = window.enkrypt.providers + .ethereum as EIP1193Provider + const addListener: SimpleEventEmitter['on'] = + enkryptProvider.on.bind(enkryptProvider) + + enkryptProvider.on = (event, func) => { + addListener(event, func) + } + + const provider = createEIP1193Provider(enkryptProvider) + + provider.removeListener = (event, func) => {} + + return { + provider + } + } else { + window.open('https://enkrypt.com', '_blank') + throw new Error('Please Install Enkrypt to use this wallet') + } + } + } + } +} + +export default enkrypt diff --git a/packages/enkrypt/src/types.ts b/packages/enkrypt/src/types.ts new file mode 100644 index 000000000..8b7b33127 --- /dev/null +++ b/packages/enkrypt/src/types.ts @@ -0,0 +1,6 @@ +import type { ExternalProvider } from '@ethersproject/providers' +export interface CustomWindow extends Window { + enkrypt: { + providers: { ethereum: ExternalProvider } + } +} diff --git a/packages/enkrypt/tsconfig.json b/packages/enkrypt/tsconfig.json new file mode 100644 index 000000000..09ae989f9 --- /dev/null +++ b/packages/enkrypt/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src/**/*"], + + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + "declaration": true, + "declarationDir": "dist", + "paths": { + "*": ["./src/*", "./node_modules/*"] + }, + "typeRoots": ["node_modules/@types"] + } +} \ No newline at end of file diff --git a/packages/injected/package.json b/packages/injected/package.json index e0fef418f..3ef89ba78 100644 --- a/packages/injected/package.json +++ b/packages/injected/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/injected-wallets", - "version": "2.3.0", + "version": "2.4.0-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/injected/src/constants.ts b/packages/injected/src/constants.ts index b58dec0f3..53ede9960 100644 --- a/packages/injected/src/constants.ts +++ b/packages/injected/src/constants.ts @@ -15,5 +15,6 @@ export const WALLET_NAMES: { [key: string]: string } = { frame: 'Frame', bitkeep: 'BitKeep', sequence: 'Sequence', - core: 'Core' + core: 'Core', + enkrypt: 'Enkrypt' } diff --git a/packages/injected/src/icons/enkrypt.ts b/packages/injected/src/icons/enkrypt.ts new file mode 100644 index 000000000..3e65f53d5 --- /dev/null +++ b/packages/injected/src/icons/enkrypt.ts @@ -0,0 +1,17 @@ +export default ` + + + + + + + +` diff --git a/packages/injected/src/types.ts b/packages/injected/src/types.ts index 42db002ca..f12098925 100644 --- a/packages/injected/src/types.ts +++ b/packages/injected/src/types.ts @@ -48,7 +48,8 @@ export enum ProviderIdentityFlag { Sequence = 'isSequence', Core = 'isAvalanche', Opera = 'isOpera', - Bitski = 'isBitski' + Bitski = 'isBitski', + Enkrypt = 'isEnkrypt' } export enum ProviderLabel { @@ -87,7 +88,8 @@ export enum ProviderLabel { GameStop = 'GameStop Wallet', BitKeep = 'BitKeep', Sequence = 'Sequence', - Core = 'Core' + Core = 'Core', + Enkrypt = 'Enkrypt' } export interface MeetOneProvider extends ExternalProvider { @@ -110,7 +112,8 @@ export enum InjectedNameSpace { GameStop = 'gamestop', BitKeep = 'bitkeep', Avalanche = 'avalanche', - Bitski = 'Bitski' + Bitski = 'Bitski', + Enkrypt = 'enkrypt' } export interface CustomWindow extends Window { @@ -130,6 +133,11 @@ export interface CustomWindow extends Window { Bitski: { getProvider(): InjectedProvider } + enkrypt: { + providers: { + ethereum: InjectedProvider + } + } } export type InjectedProvider = ExternalProvider & diff --git a/packages/injected/src/wallets.ts b/packages/injected/src/wallets.ts index d241ec836..d470a77dc 100644 --- a/packages/injected/src/wallets.ts +++ b/packages/injected/src/wallets.ts @@ -578,6 +578,46 @@ const bitski: InjectedWalletModule = { platforms: ['all'] } +const enkrypt: InjectedWalletModule = { + label: ProviderLabel.Enkrypt, + injectedNamespace: InjectedNameSpace.Enkrypt, + checkProviderIdentity: ({ provider }) => + !!provider && !!provider.providers && !!provider.providers.ethereum, + getIcon: async () => (await import('./icons/enkrypt.js')).default, + getInterface: async () => { + const addListener: SimpleEventEmitter['on'] = + window.enkrypt.providers.ethereum.on.bind( + window.enkrypt.providers.ethereum + ) + + window.enkrypt.providers.ethereum.on = (event, func) => { + // intercept chainChanged event and format string + if (event === 'chainChanged') { + addListener(event, (chainId: ChainId) => { + const cb = func as ChainListener + cb(`0x${parseInt(chainId as string).toString(16)}`) + }) + } else { + addListener(event, func) + } + } + + const provider = createEIP1193Provider(window.enkrypt.providers.ethereum, { + eth_chainId: ({ baseRequest }) => + baseRequest({ method: 'eth_chainId' }).then( + id => `0x${parseInt(id as string).toString(16)}` + ) + }) + + provider.removeListener = (event, func) => {} + + return { + provider + } + }, + platforms: ['all'] +} + const wallets = [ exodus, metamask, @@ -612,7 +652,8 @@ const wallets = [ bitkeep, sequence, core, - bitski + bitski, + enkrypt ] export default wallets diff --git a/packages/mew-wallet/README.md b/packages/mew-wallet/README.md new file mode 100644 index 000000000..51f9b8f96 --- /dev/null +++ b/packages/mew-wallet/README.md @@ -0,0 +1,31 @@ +# @web3-onboard/mew-wallet + +## Wallet module for connecting Mew wallet through web3-onboard + +### Install + +**NPM** +`npm i @web3-onboard/core @web3-onboard/mew-wallet` + +**Yarn** +`yarn add @web3-onboard/core @web3-onboard/mew-wallet` + +## Usage + +```typescript +import Onboard from '@web3-onboard/core' +import mewWallet from '@web3-onboard/mew-wallet' + +const mewWalletModule = mewWallet() + +const onboard = Onboard({ + // ... other Onboard options + wallets: [ + mewWalletModule + //... other wallets + ] +}) + +const connectedWallets = await onboard.connectWallet() +console.log(connectedWallets) +``` diff --git a/packages/mew-wallet/package.json b/packages/mew-wallet/package.json new file mode 100644 index 000000000..337b208bc --- /dev/null +++ b/packages/mew-wallet/package.json @@ -0,0 +1,70 @@ +{ + "name": "@web3-onboard/mew-wallet", + "version": "2.0.0-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", + "Web3", + "EVM", + "dapp", + "Multichain", + "Wallet", + "Transaction", + "Provider", + "Hardware Wallet", + "Notifications", + "React", + "Svelte", + "Vue", + "Next", + "Nuxt", + "MetaMask", + "Coinbase", + "WalletConnect", + "Ledger", + "Trezor", + "Connect Wallet", + "Ethereum Hooks", + "Blocknative", + "Mempool", + "pending", + "confirmed", + "Injected Wallet", + "Crypto", + "Crypto Wallet", + "MEW wallet" + ], + "repository": { + "type": "git", + "url": "https://github.com/blocknative/web3-onboard.git", + "directory": "packages/core" + }, + "homepage": "https://www.blocknative.com/onboard", + "bugs": "https://github.com/blocknative/web3-onboard/issues", + "module": "dist/index.js", + "browser": "dist/index.js", + "main": "dist/index.js", + "type": "module", + "typings": "dist/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "build": "tsc", + "dev": "tsc -w", + "type-check": "tsc --noEmit" + }, + "license": "MIT", + "devDependencies": { + "@ethersproject/providers": "^5.5.0", + "@types/lodash.uniqby": "^4.7.6", + "@types/node": "^17.0.21", + "ts-node": "^10.2.1", + "typescript": "^4.5.5", + "window": "^4.2.7" + }, + "dependencies": { + "@web3-onboard/common": "^2.2.2", + "lodash.uniqby": "^4.7.0" + } +} diff --git a/packages/mew-wallet/src/icon.ts b/packages/mew-wallet/src/icon.ts new file mode 100644 index 000000000..6938be49a --- /dev/null +++ b/packages/mew-wallet/src/icon.ts @@ -0,0 +1,24 @@ +export default ` + + + + + + + + + + + + + + + + + + + + + + +` diff --git a/packages/mew-wallet/src/index.ts b/packages/mew-wallet/src/index.ts new file mode 100644 index 000000000..bb5170408 --- /dev/null +++ b/packages/mew-wallet/src/index.ts @@ -0,0 +1,46 @@ +import { ProviderRpcError, WalletInit } from '@web3-onboard/common' +import { createEIP1193Provider } from '@web3-onboard/common' +import { CustomWindow } from './types.js' +declare const window: CustomWindow + +function mewWallet(): WalletInit { + if (typeof window === 'undefined') return () => null + return ({ device }) => { + return device.type === 'mobile' + ? { + label: 'MEW wallet', + getIcon: async () => (await import('./icon.js')).default, + getInterface: async () => { + const provider = + window.hasOwnProperty('ethereum') && window.ethereum.isMEWwallet + if (provider) { + return { + provider: createEIP1193Provider(window.ethereum, { + wallet_switchEthereumChain: async ({ params }) => { + if (device.os.name.toLowerCase() === 'ios') { + throw new ProviderRpcError({ + message: 'MEW Wallet iOS only supports ETH network', + code: 4200 + }) + } + window.ethereum.setChainId(parseInt(params[0].chainId)) + return null + } + }) + } + } else { + window.open( + 'https://download.mewwallet.com?source=onboard', + '_blank' + ) + throw new Error( + 'Please Install MEW wallet and use within the MEW DApp browser' + ) + } + } + } + : null + } +} + +export default mewWallet diff --git a/packages/mew-wallet/src/types.ts b/packages/mew-wallet/src/types.ts new file mode 100644 index 000000000..8163cf1de --- /dev/null +++ b/packages/mew-wallet/src/types.ts @@ -0,0 +1,8 @@ +import type { ExternalProvider } from '@ethersproject/providers' +interface CustomExternalProvider extends ExternalProvider { + isMEWwallet: boolean + setChainId: (param: number) => {} +} +export interface CustomWindow extends Window { + ethereum: CustomExternalProvider +} diff --git a/packages/mew-wallet/tsconfig.json b/packages/mew-wallet/tsconfig.json new file mode 100644 index 000000000..1877915c8 --- /dev/null +++ b/packages/mew-wallet/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src/**/*"], + + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + "declaration": true, + "declarationDir": "dist", + "allowSyntheticDefaultImports": true, + "paths": { + "*": ["./src/*", "./node_modules/*"] + }, + "typeRoots": ["node_modules/@types"] + } +} \ No newline at end of file diff --git a/packages/mew/README.md b/packages/mew/README.md index 49b7f25d7..dd1248385 100644 --- a/packages/mew/README.md +++ b/packages/mew/README.md @@ -1,5 +1,8 @@ # @web3-onboard/mew +## (Deprecated) Wallet module for connecting WalletLink to web3-onboard +_Use [@web3-onboard/mew-wallet](../mew-wallet/README.md)_ + ## Wallet module for connecting Mew wallet to web3-onboard ### Install diff --git a/packages/mew/package.json b/packages/mew/package.json index 58c47fe40..48eb0337f 100644 --- a/packages/mew/package.json +++ b/packages/mew/package.json @@ -1,7 +1,7 @@ { "name": "@web3-onboard/mew", - "version": "2.1.3", - "description": "MEW (My Ether 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.", + "version": "2.1.4-alpha.1", + "description": "(DEPRECATED. Use @web3-onboard/mew-wallet instead) MEW (My Ether 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", "Web3", diff --git a/packages/mew/src/index.ts b/packages/mew/src/index.ts index abc930e9b..d099ed12d 100644 --- a/packages/mew/src/index.ts +++ b/packages/mew/src/index.ts @@ -68,4 +68,7 @@ function mew(): WalletInit { } } +/** + * @deprecated Use @web3-onboard/mew-wallet + */ export default mew From 0e2b2081b1eaf7f5fa1ed846377fc8f660cab433 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Wed, 16 Nov 2022 16:40:15 -0700 Subject: [PATCH 11/15] Update versions for release --- packages/demo/package.json | 6 +++--- packages/enkrypt/package.json | 4 ++-- packages/injected/package.json | 2 +- packages/mew-wallet/package.json | 4 ++-- packages/mew/package.json | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/demo/package.json b/packages/demo/package.json index 36fd200b4..478888e36 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -28,7 +28,7 @@ "@web3-onboard/fortmatic": "^2.0.14", "@web3-onboard/gas": "^2.1.3", "@web3-onboard/gnosis": "^2.1.5", - "@web3-onboard/injected-wallets": "^2.4.0-alpha.1", + "@web3-onboard/injected-wallets": "^2.4.0", "@web3-onboard/keepkey": "^2.3.2", "@web3-onboard/keystone": "^2.3.2", "@web3-onboard/ledger": "^2.3.2", @@ -40,8 +40,8 @@ "@web3-onboard/tallyho": "^2.0.1", "@web3-onboard/walletconnect": "^2.2.0", "@web3-onboard/web3auth": "^2.1.3", - "@web3-onboard/enkrypt": "^2.0.0-alpha.1", - "@web3-onboard/mew-wallet": "^2.0.0-alpha.1", + "@web3-onboard/enkrypt": "^2.0.0", + "@web3-onboard/mew-wallet": "^2.0.0", "vconsole": "^3.9.5" }, "license": "MIT", diff --git a/packages/enkrypt/package.json b/packages/enkrypt/package.json index 5b766d1ba..427863cfa 100644 --- a/packages/enkrypt/package.json +++ b/packages/enkrypt/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/enkrypt", - "version": "2.0.0-alpha.1", + "version": "2.0.0", "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", @@ -63,6 +63,6 @@ "window": "^4.2.7" }, "dependencies": { - "@web3-onboard/common": "^2.2.2" + "@web3-onboard/common": "^2.2.3" } } diff --git a/packages/injected/package.json b/packages/injected/package.json index 3ef89ba78..dd81d4630 100644 --- a/packages/injected/package.json +++ b/packages/injected/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/injected-wallets", - "version": "2.4.0-alpha.1", + "version": "2.4.0", "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/mew-wallet/package.json b/packages/mew-wallet/package.json index 337b208bc..59e4ba969 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-alpha.1", + "version": "2.0.0", "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", @@ -64,7 +64,7 @@ "window": "^4.2.7" }, "dependencies": { - "@web3-onboard/common": "^2.2.2", + "@web3-onboard/common": "^2.2.3", "lodash.uniqby": "^4.7.0" } } diff --git a/packages/mew/package.json b/packages/mew/package.json index 48eb0337f..cff0d049e 100644 --- a/packages/mew/package.json +++ b/packages/mew/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/mew", - "version": "2.1.4-alpha.1", + "version": "2.1.4", "description": "(DEPRECATED. Use @web3-onboard/mew-wallet instead) MEW (My Ether 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", From e41aa4fe03f4a56183fb49e37bc5344a77a5992b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 11:28:35 -0700 Subject: [PATCH 12/15] Bump loader-utils from 2.0.3 to 2.0.4 (#1370) Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.3 to 2.0.4. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.4/CHANGELOG.md) - [Commits](https://github.com/webpack/loader-utils/compare/v2.0.3...v2.0.4) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 08ee7e2b0..23ae3ded7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7510,9 +7510,9 @@ loader-runner@^4.2.0: integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== loader-utils@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.3.tgz#d4b15b8504c63d1fc3f2ade52d41bc8459d6ede1" - integrity sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A== + version "2.0.4" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" + integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" From ad8568897d7d96e55c75ce93aa14dcfdd8694358 Mon Sep 17 00:00:00 2001 From: Vincent Shadbolt Date: Thu, 17 Nov 2022 11:39:16 -0800 Subject: [PATCH 13/15] Add Unstoppable Domains to login options (#1334) * Added uauth as available login option * added uauth dependencies * updated uauth readme * added function for getting uauth user scopes data * updated main readme with Unstoppable Domains * prettier fixes * removed excess console log * updated MINOR version of both demo app and monorepo * update circleci configs with uauth * updated versioning * walletConnect improvements to uauth package * updated uauth icon and added function return type * dynamic import of uauth class * added uauth option validation * moved user object from exported function to module instance * Update packages/uauth/README.md * Update packages/uauth/README.md * Prettier formatting * updated readme with redirect URI notes * Add notes to types for ide dev relay * circleci config merge fixes Co-authored-by: Adam Carpenter --- .circleci/config.yml | 18 ++ README.md | 1 + packages/demo/package.json | 1 + packages/demo/src/App.svelte | 35 ++- packages/injected/src/icons/core.ts | 2 +- packages/uauth/README.md | 82 +++++++ packages/uauth/package.json | 72 ++++++ packages/uauth/src/icon.ts | 6 + packages/uauth/src/index.ts | 368 ++++++++++++++++++++++++++++ packages/uauth/src/types.ts | 32 +++ packages/uauth/src/validation.ts | 27 ++ packages/uauth/tsconfig.json | 14 ++ yarn.lock | 214 +++++++++++++++- 13 files changed, 864 insertions(+), 8 deletions(-) create mode 100644 packages/uauth/README.md create mode 100644 packages/uauth/package.json create mode 100644 packages/uauth/src/icon.ts create mode 100644 packages/uauth/src/index.ts create mode 100644 packages/uauth/src/types.ts create mode 100644 packages/uauth/src/validation.ts create mode 100644 packages/uauth/tsconfig.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 70f2319f0..b71ccb054 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -321,6 +321,12 @@ jobs: working_directory: ~/web3-onboard-monorepo/packages/enkrypt steps: - node-build-steps + build-uauth: + docker: + - image: cimg/node:16.13.1 + working_directory: ~/web3-onboard-monorepo/packages/uauth + steps: + - node-build-steps # Build staging/Alpha releases build-staging-core: @@ -479,6 +485,12 @@ jobs: working_directory: ~/web3-onboard-monorepo/packages/enkrypt steps: - node-staging-build-steps + build-staging-uauth: + docker: + - image: cimg/node:16.13.1 + working_directory: ~/web3-onboard-monorepo/packages/uauth + steps: + - node-staging-build-steps workflows: version: 2 @@ -639,3 +651,9 @@ workflows: <<: *deploy_production_filters - build-staging-enkrypt: <<: *deploy_staging_filters + uauth: + jobs: + - build-uauth: + <<: *deploy_production_filters + - build-staging-uauth: + <<: *deploy_staging_filters diff --git a/README.md b/README.md index a8e0e8acb..9b3ef6eda 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ For full documentation, check out the README.md for each package: - [Sequence](packages/sequence/README.md) - [TallyHo](packages/tallyho/README.md) - [Enkrypt](packages/enkrypt/README.md) +- [Unstoppable Domains](packages/uauth/README.md) **Hardware Wallets** diff --git a/packages/demo/package.json b/packages/demo/package.json index aacb2717f..c1b08bc5b 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -42,6 +42,7 @@ "@web3-onboard/web3auth": "^2.1.3", "@web3-onboard/enkrypt": "^2.0.0-alpha.1", "@web3-onboard/mew-wallet": "^2.0.0-alpha.1", + "@web3-onboard/uauth": "^2.0.0-alpha.1", "vconsole": "^3.9.5" }, "license": "MIT", diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index 21e0070b3..57c08cfec 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -19,6 +19,7 @@ import tallyHoModule from '@web3-onboard/tallyho' import enkryptModule from '@web3-onboard/enkrypt' import mewWalletModule from '@web3-onboard/mew-wallet' + import uauthModule from '@web3-onboard/uauth' import { recoverAddress, arrayify, @@ -31,6 +32,7 @@ import blocknativeIcon from './blocknative-icon' import blocknativeLogo from './blocknative-logo' import { onMount } from 'svelte' + import wallets from '@web3-onboard/injected-wallets/dist/wallets' let windowWidth @@ -98,6 +100,14 @@ } const trezor = trezorModule(trezorOptions) + const uauthOptions = { + clientID: 'a25c3a65-a1f2-46cc-a515-a46fe7acb78c', + redirectUri: 'http://localhost:8080/', + scope: + 'openid wallet email:optional humanity_check:optional profile:optional social:optional' + } + const uauth = uauthModule(uauthOptions) + const magic = magicModule({ apiKey: 'pk_live_02207D744E81C2BA' // userEmail: 'test@test.com' @@ -131,7 +141,8 @@ gnosis, dcent, sequence, - tallyho + tallyho, + uauth ], gas, chains: [ @@ -245,8 +256,8 @@ } }, // containerElements: { - // El must be present at time of JS script execution - // See ../public/index.html for element example + // El must be present at time of JS script execution + // See ../public/index.html for element example // accountCenter: '#sample-container-el' // }, // Sign up for your free api key at www.Blocknative.com @@ -255,6 +266,12 @@ // Subscribe to wallet updates const wallets$ = onboard.state.select('wallets').pipe(share()) + wallets$.subscribe(wallet => { + const unstoppableUser = wallet.find( + provider => provider.label === 'Unstoppable' + ) + if (unstoppableUser) console.log(unstoppableUser.instance.user) + }) const signTransactionMessage = async provider => { const ethersProvider = new ethers.providers.Web3Provider(provider, 'any') @@ -949,7 +966,7 @@ {/if} {#if $wallets$ && !hideForIframe} - {#each $wallets$ as { icon, label, accounts, chains, provider }} + {#each $wallets$ as { icon, label, accounts, chains, provider, instance }}
{@html icon}
@@ -958,6 +975,16 @@
Chains: {JSON.stringify(chains, null, 2)}
+ {#if label === 'Unstoppable'} +
Unstoppable User: {instance.user.sub}
+
Unstoppable Wallet: {instance.user.wallet_address}
+
Unstoppable Email: {instance.user.email || ''}
+
+ Unstoppable Humanity: {instance.user.humanity_check_id || ''} +
+
Unstoppable Profile: {instance.user.profile || ''}
+ {/if} + {#each accounts as { address, ens, balance }}