From 76679361d09c5ff5dc172e9c0badb8e691cba1e6 Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Wed, 10 May 2023 02:41:37 +0800 Subject: [PATCH 01/22] feat: support bloctoWallet --- packages/blocto/README.md | 31 +++++++++++++++ packages/blocto/package.json | 72 +++++++++++++++++++++++++++++++++++ packages/blocto/src/icon.ts | 10 +++++ packages/blocto/src/index.ts | 33 ++++++++++++++++ packages/blocto/src/types.ts | 4 ++ packages/blocto/tsconfig.json | 16 ++++++++ 6 files changed, 166 insertions(+) create mode 100644 packages/blocto/README.md create mode 100644 packages/blocto/package.json create mode 100644 packages/blocto/src/icon.ts create mode 100644 packages/blocto/src/index.ts create mode 100644 packages/blocto/src/types.ts create mode 100644 packages/blocto/tsconfig.json diff --git a/packages/blocto/README.md b/packages/blocto/README.md new file mode 100644 index 000000000..46996d92f --- /dev/null +++ b/packages/blocto/README.md @@ -0,0 +1,31 @@ +# @web3-onboard/tallyho (now named Taho wallet) + +## (Deprecated) Wallet module for connecting Tally Ho Wallet to web3-onboard +_Use [@web3-onboard/taho](../taho/README.md)_ + +See [Taho Developer Docs](https://docs.tally.cash/tally/developers/integrating-dapps) + +### Install + +`npm i @web3-onboard/tallyho` + +## Usage + +```typescript +import Onboard from '@web3-onboard/core' +import tallyHoWalletModule from '@web3-onboard/tallyho' + +// initialize the module with options +const tallyHoWalletSdk = tallyHoWalletModule() + +const onboard = Onboard({ + // ... other Onboard options + wallets: [ + tallyHoWalletModule() + //... other wallets + ] +}) + +const connectedWallets = await onboard.connectWallet() +console.log(connectedWallets) +``` diff --git a/packages/blocto/package.json b/packages/blocto/package.json new file mode 100644 index 000000000..42fd70194 --- /dev/null +++ b/packages/blocto/package.json @@ -0,0 +1,72 @@ +{ + "name": "@web3-onboard/blocto", + "version": "2.0.4", + "description": "(DEPRECATED. Use @web3-onboard/blocto instead) Blocto 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", + "Tally Ho" + ], + "repository": { + "type": "git", + "url": "https://github.com/blocknative/web3-onboard.git", + "directory": "packages/core" + }, + "homepage": "https://onboard.blocknative.com", + "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.3.1", + "@blocto/sdk": "^0.4.4", + "tallyho-detect-provider": "^1.0.0", + "tallyho-onboarding": "^1.0.2" + } +} diff --git a/packages/blocto/src/icon.ts b/packages/blocto/src/icon.ts new file mode 100644 index 000000000..90368febb --- /dev/null +++ b/packages/blocto/src/icon.ts @@ -0,0 +1,10 @@ +export default ` + + + + + + + + +` diff --git a/packages/blocto/src/index.ts b/packages/blocto/src/index.ts new file mode 100644 index 000000000..774815ff6 --- /dev/null +++ b/packages/blocto/src/index.ts @@ -0,0 +1,33 @@ +import type { WalletInit } from '@web3-onboard/common' +import { createEIP1193Provider } from '@web3-onboard/common' +import { CustomWindow } from './types.js' +import detectEthereumProvider from 'tallyho-detect-provider' +import TallyHoOnboarding from 'tallyho-onboarding' +declare const window: CustomWindow + +function tallyHoWallet(): WalletInit { + if (typeof window === 'undefined') return () => null + return () => { + return { + label: 'Blocto', + injectedNamespace: 'tally', + checkProviderIdentity: ({ provider }: { provider: any }) => { + !!provider && !!provider['isTally'] + }, + getIcon: async () => (await import('./icon.js')).default, + getInterface: async () => { + const provider = await detectEthereumProvider({ mustBeTallyHo: true }) + if (!provider) { + const onboarding = new TallyHoOnboarding() + onboarding.startOnboarding() + throw new Error('Please install Taho to use this wallet') + } else { + return { provider: createEIP1193Provider(window.tally) } + } + }, + platforms: ['desktop'] + } + } +} + +export default tallyHoWallet diff --git a/packages/blocto/src/types.ts b/packages/blocto/src/types.ts new file mode 100644 index 000000000..1503a530d --- /dev/null +++ b/packages/blocto/src/types.ts @@ -0,0 +1,4 @@ +import type { ExternalProvider } from '@ethersproject/providers' +export interface CustomWindow extends Window { + tally: ExternalProvider +} diff --git a/packages/blocto/tsconfig.json b/packages/blocto/tsconfig.json new file mode 100644 index 000000000..53a27ffad --- /dev/null +++ b/packages/blocto/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 From 87f725d6d35e136f49a3f5bb731c44220da8225a Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Wed, 10 May 2023 08:09:04 +0800 Subject: [PATCH 02/22] feat: add blocto and update doc --- README.md | 1 + docs/src/routes/docs/[...4]wallets/blocto.md | 47 +++++++++++ packages/blocto/README.md | 15 ++-- packages/blocto/package.json | 4 +- packages/blocto/src/icon.ts | 16 ++-- packages/blocto/src/index.ts | 87 +++++++++++++++----- packages/blocto/src/types.ts | 4 - packages/demo/package.json | 3 +- packages/demo/src/App.svelte | 32 ++++--- 9 files changed, 156 insertions(+), 53 deletions(-) create mode 100644 docs/src/routes/docs/[...4]wallets/blocto.md delete mode 100644 packages/blocto/src/types.ts diff --git a/README.md b/README.md index df2ef767d..677acdc62 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ For full documentation, check out the README.md for each package or the [docs pa - [XDEFI](packages/xdefi/README.md) - [Infinity Wallet](packages/infinity-wallet/README.md) - [Frame](packages/frame/README.md) +- [Blocto](packages/blocto/README.md) **Hardware Wallets** diff --git a/docs/src/routes/docs/[...4]wallets/blocto.md b/docs/src/routes/docs/[...4]wallets/blocto.md new file mode 100644 index 000000000..d8f5ddb9a --- /dev/null +++ b/docs/src/routes/docs/[...4]wallets/blocto.md @@ -0,0 +1,47 @@ +# Blocto + +Wallet module for connecting Blocto SDK to web3-onboard. Check out the [Blocto Developer Docs](https://docs.blocto.app/blocto-sdk/javascript-sdk/evm-sdk) for more information. + +## Install + + + + +```sh copy +yarn add @web3-onboard/blocto +``` + + + + +```sh copy +npm install @web3-onboard/blocto +``` + + + + +## Usage + +```typescript +import Onboard from '@web3-onboard/core' +import bloctoModule from '@web3-onboard/blocto' + +// initialize the module with options +const blocto = bloctoModule() + +const onboard = Onboard({ + // ... other Onboard options + wallets: [ + blocto + //... other wallets + ] +}) + +const connectedWallets = await onboard.connectWallet() +console.log(connectedWallets) +``` + +## Build Environments + +For build env configurations and setups please see the Build Env section [here](/docs/modules/core#build-environments) diff --git a/packages/blocto/README.md b/packages/blocto/README.md index 46996d92f..3c382d222 100644 --- a/packages/blocto/README.md +++ b/packages/blocto/README.md @@ -1,27 +1,26 @@ -# @web3-onboard/tallyho (now named Taho wallet) +# @web3-onboard/blocto -## (Deprecated) Wallet module for connecting Tally Ho Wallet to web3-onboard -_Use [@web3-onboard/taho](../taho/README.md)_ +## Wallet module for connecting Blocto Wallet SDK to web3-onboard -See [Taho Developer Docs](https://docs.tally.cash/tally/developers/integrating-dapps) +See [Blocto Developer Docs](https://docs.blocto.app/blocto-sdk/javascript-sdk/evm-sdk) ### Install -`npm i @web3-onboard/tallyho` +`npm i @web3-onboard/blocto` ## Usage ```typescript import Onboard from '@web3-onboard/core' -import tallyHoWalletModule from '@web3-onboard/tallyho' +import bloctoModule from '@web3-onboard/blocto' // initialize the module with options -const tallyHoWalletSdk = tallyHoWalletModule() +const blocto = bloctoModule() const onboard = Onboard({ // ... other Onboard options wallets: [ - tallyHoWalletModule() + blocto //... other wallets ] }) diff --git a/packages/blocto/package.json b/packages/blocto/package.json index 42fd70194..216d358c9 100644 --- a/packages/blocto/package.json +++ b/packages/blocto/package.json @@ -65,8 +65,6 @@ }, "dependencies": { "@web3-onboard/common": "^2.3.1", - "@blocto/sdk": "^0.4.4", - "tallyho-detect-provider": "^1.0.0", - "tallyho-onboarding": "^1.0.2" + "@blocto/sdk": "^0.4.4" } } diff --git a/packages/blocto/src/icon.ts b/packages/blocto/src/icon.ts index 90368febb..b4dc051c1 100644 --- a/packages/blocto/src/icon.ts +++ b/packages/blocto/src/icon.ts @@ -1,10 +1,14 @@ export default ` - - - - - - + + + + + + + + + + ` diff --git a/packages/blocto/src/index.ts b/packages/blocto/src/index.ts index 774815ff6..50dabce55 100644 --- a/packages/blocto/src/index.ts +++ b/packages/blocto/src/index.ts @@ -1,33 +1,78 @@ import type { WalletInit } from '@web3-onboard/common' -import { createEIP1193Provider } from '@web3-onboard/common' -import { CustomWindow } from './types.js' -import detectEthereumProvider from 'tallyho-detect-provider' -import TallyHoOnboarding from 'tallyho-onboarding' -declare const window: CustomWindow -function tallyHoWallet(): WalletInit { +function BloctoWallet(): WalletInit { if (typeof window === 'undefined') return () => null return () => { return { label: 'Blocto', - injectedNamespace: 'tally', - checkProviderIdentity: ({ provider }: { provider: any }) => { - !!provider && !!provider['isTally'] - }, getIcon: async () => (await import('./icon.js')).default, - getInterface: async () => { - const provider = await detectEthereumProvider({ mustBeTallyHo: true }) - if (!provider) { - const onboarding = new TallyHoOnboarding() - onboarding.startOnboarding() - throw new Error('Please install Taho to use this wallet') - } else { - return { provider: createEIP1193Provider(window.tally) } + getInterface: async ({ chains }) => { + const { default: BloctoSDK } = await import('@blocto/sdk') + + const { createEIP1193Provider } = await import('@web3-onboard/common') + + const [defaultChain] = chains + + const instance = new BloctoSDK({ + ethereum: { + chainId: defaultChain.id, + rpc: defaultChain.rpcUrl + } + }) + const bloctoProvider: any = instance.ethereum + + const provider = createEIP1193Provider(bloctoProvider, { + eth_selectAccounts: null, + wallet_switchEthereumChain: async ({ params, baseRequest }) => { + const chain = chains.find(({ id }) => id === params[0].chainId) + if (!chain) throw new Error('chain must be set before switching') + const providerRpcurl = bloctoProvider.switchableNetwork[chain.id]?.rpc_url + const chainUrl = chain.rpcUrl; + if ( + providerRpcurl !== chainUrl + ) { + await baseRequest({ + method: 'wallet_addEthereumChain', + params: [ + { + chainId: chain.id, + rpcUrls: [chainUrl], + }, + ], + }); + } + await baseRequest({ + method: 'wallet_switchEthereumChain', + params: [{ chainId: chain.id }], + }); + return null + }, + eth_chainId: async ({ baseRequest }) => { + const chainId = await baseRequest({ method: 'eth_chainId' }) + return `0x${parseInt(chainId).toString(16)}` + } + }) + + provider.disconnect = () => instance?.ethereum?.request({ method: 'wallet_disconnect' }); + // patch the chainChanged event + const on = bloctoProvider.on.bind(bloctoProvider) + bloctoProvider.on = (event: string, listener: (arg0: string) => void) => { + on(event, (val: any) => { + if (event === 'chainChanged') { + listener(`0x${(val as number).toString(16)}`) + return + } + listener(val) + }) + return bloctoProvider + } + return { + provider, + instance } - }, - platforms: ['desktop'] + } } } } -export default tallyHoWallet +export default BloctoWallet diff --git a/packages/blocto/src/types.ts b/packages/blocto/src/types.ts deleted file mode 100644 index 1503a530d..000000000 --- a/packages/blocto/src/types.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ExternalProvider } from '@ethersproject/providers' -export interface CustomWindow extends Window { - tally: ExternalProvider -} diff --git a/packages/demo/package.json b/packages/demo/package.json index e74c3f053..cf00d66a6 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -54,7 +54,8 @@ "@web3-onboard/web3auth": "^2.2.2", "@web3-onboard/xdefi": "^2.0.3", "@web3-onboard/zeal": "^2.0.3", - "vconsole": "^3.9.5" + "vconsole": "^3.9.5", + "@dapperlabs/dappauth": "^2.0.5" }, "license": "MIT", "scripts": { diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index 73f11cb76..6ac050c60 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -28,6 +28,7 @@ import phantomModule from '@web3-onboard/phantom' import trustModule from '@web3-onboard/trust' import frontierModule from '@web3-onboard/frontier' + import bloctoModule from '@web3-onboard/blocto' import cedeStoreModule from '@web3-onboard/cede-store' import { recoverAddress, @@ -39,6 +40,7 @@ import { share } from 'rxjs/operators' import VConsole from 'vconsole' import blocknativeIcon from './blocknative-icon.js' + import DappAuth from '@dapperlabs/dappauth'; if (window.innerWidth < 700) { new VConsole() @@ -147,6 +149,7 @@ const trust = trustModule() const frontier = frontierModule() const cedeStore = cedeStoreModule() + const blocto = bloctoModule() const trezorOptions = { email: 'test@test.com', @@ -208,7 +211,8 @@ frontier, xdefi, frameWallet, - cedeStore + cedeStore, + blocto ], transactionPreview, gas, @@ -446,20 +450,28 @@ // if using ethers v6 this is: // ethersProvider = new ethers.BrowserProvider(wallet.provider, 'any') const ethersProvider = new ethers.providers.Web3Provider(provider, 'any') - const signer = ethersProvider?.getSigner() const addr = await signer?.getAddress() const signature = await signer?.signMessage(signMsg) + let verifySign = false; + let recoveredAddress = null; - const recoveredAddress = recoverAddress( - arrayify(hashMessage(signMsg)), - signature - ) - - if (recoveredAddress !== address) { - console.error( - "Signature failed. Recovered address doesn' match signing address." + try { + recoveredAddress = recoverAddress( + arrayify(hashMessage(signMsg)), + signature ) + verifySign = recoveredAddress === addr + } catch (error) { + console.error('Error recovering addressL', error); + verifySign = false + } + + // contract wallets verify EIP-1654 + const verifySignBy1654 = new DappAuth(provider); + const isAuthorizedSigner = await verifySignBy1654.isAuthorizedSigner(signMsg, signature, address); + if (!verifySign && !isAuthorizedSigner) { + console.error("Signature failed. Recovered address doesn' match signing address."); } console.log({ signMsg, signature, recoveredAddress, addr }) From bea6b9ec964f25745d45818d81df677f7c546eaa Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Wed, 10 May 2023 08:16:11 +0800 Subject: [PATCH 03/22] feat: update blocto description --- packages/blocto/package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/blocto/package.json b/packages/blocto/package.json index 216d358c9..bea5b30ae 100644 --- a/packages/blocto/package.json +++ b/packages/blocto/package.json @@ -1,7 +1,7 @@ { "name": "@web3-onboard/blocto", "version": "2.0.4", - "description": "(DEPRECATED. Use @web3-onboard/blocto instead) Blocto 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.", + "description": "Blocto 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", @@ -32,7 +32,8 @@ "Injected Wallet", "Crypto", "Crypto Wallet", - "Tally Ho" + "Tally Ho", + "Blocto" ], "repository": { "type": "git", From a6d8bb6457d48c8f95916af631c0eeb96c23e7e0 Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Wed, 10 May 2023 08:20:19 +0800 Subject: [PATCH 04/22] feat: update blocto version --- packages/blocto/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/blocto/package.json b/packages/blocto/package.json index bea5b30ae..2742e3807 100644 --- a/packages/blocto/package.json +++ b/packages/blocto/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/blocto", - "version": "2.0.4", + "version": "0.1.0", "description": "Blocto 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", @@ -66,6 +66,6 @@ }, "dependencies": { "@web3-onboard/common": "^2.3.1", - "@blocto/sdk": "^0.4.4" + "@blocto/sdk": "^0.4.6" } } From 6951e10d59a98f72e6760fed0bdcd734df50df94 Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Wed, 10 May 2023 08:27:33 +0800 Subject: [PATCH 05/22] docs: update blocto readme --- packages/blocto/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/blocto/README.md b/packages/blocto/README.md index 3c382d222..06b13365e 100644 --- a/packages/blocto/README.md +++ b/packages/blocto/README.md @@ -1,6 +1,6 @@ # @web3-onboard/blocto -## Wallet module for connecting Blocto Wallet SDK to web3-onboard +## Wallet module for connecting Blocto SDK to web3-onboard See [Blocto Developer Docs](https://docs.blocto.app/blocto-sdk/javascript-sdk/evm-sdk) From f9ca47f0bf7481f7a910e8b8b18aae74679181e1 Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Wed, 10 May 2023 08:44:59 +0800 Subject: [PATCH 06/22] docs: update introduction --- docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md b/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md index 9d054eaec..499d75d21 100644 --- a/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md +++ b/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md @@ -157,6 +157,7 @@ We recommend you add the [Core Repo](../../modules/core.md#install) and consider - [Portis](../../wallets/portis.md#install) - [Web3Auth](../../wallets/web3auth.md#install) - [Frame](../../wallets/frame.md#install) +- [Blocto](../../docs/wallets/blocto.md#install) **Hardware Wallets** From f44204e5c44dd01c3ac1b7d3da17b27992812da8 Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Fri, 12 May 2023 02:52:13 +0800 Subject: [PATCH 07/22] feat: add blocto circleci config --- .circleci/config.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index f4113427e..903872fdb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -395,6 +395,12 @@ jobs: working_directory: ~/web3-onboard-monorepo/packages/cede-store steps: - node-build-steps + build-blocto: + docker: + - image: cimg/node:16.13.1 + working_directory: ~/web3-onboard-monorepo/packages/blocto + steps: + - node-build-steps # Build staging/Alpha releases build-staging-core: @@ -625,6 +631,12 @@ jobs: working_directory: ~/web3-onboard-monorepo/packages/cede-store steps: - node-staging-build-steps + build-staging-blocto: + docker: + - image: cimg/node:16.13.1 + working_directory: ~/web3-onboard-monorepo/packages/blocto + steps: + - node-staging-build-steps workflows: version: 2 @@ -857,3 +869,9 @@ workflows: <<: *deploy_production_filters - build-staging-cede-store: <<: *deploy_staging_filters + blocto: + jobs: + - build-blocto: + <<: *deploy_production_filters + - build-staging-blocto: + <<: *deploy_staging_filters From a709b668fa1386c51e71d3b911de355b897d4598 Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Fri, 12 May 2023 11:03:22 +0800 Subject: [PATCH 08/22] feat: demo default use Polygon --- packages/demo/src/App.svelte | 16 +- yarn.lock | 321 ++++++++++++++++++++++++++++++++++- 2 files changed, 322 insertions(+), 15 deletions(-) diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index 6ac050c60..a766a818d 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -217,6 +217,12 @@ transactionPreview, gas, chains: [ + { + id: '0x13881', + token: 'MATIC', + label: 'Polygon - Mumbai', + rpcUrl: 'https://matic-mumbai.chainstacklabs.com ' + }, { id: '0x1', token: 'ETH', @@ -248,12 +254,6 @@ label: 'Goerli', rpcUrl: `https://goerli.infura.io/v3/${infura_key}` }, - { - id: '0x13881', - token: 'MATIC', - label: 'Polygon - Mumbai', - rpcUrl: 'https://matic-mumbai.chainstacklabs.com ' - }, { id: '0x38', token: 'BNB', @@ -480,7 +480,7 @@ let typedMsg = JSON.stringify( { domain: { - chainId: '0x5', + chainId: '0x13881', name: 'Web3-Onboard Test App', verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', version: '1' @@ -528,7 +528,7 @@ 2 ) const signTypedMessage = async (provider, address) => { - await onboard.setChain({ chainId: '0x5' }) + await onboard.setChain({ chainId: '0x13881' }) const signature = await provider.request({ method: 'eth_signTypedData_v4', params: [address, typedMsg] diff --git a/yarn.lock b/yarn.lock index f0eb7f749..e871e9ac7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -364,6 +364,16 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" +"@blocto/sdk@^0.4.6": + version "0.4.6" + resolved "https://registry.yarnpkg.com/@blocto/sdk/-/sdk-0.4.6.tgz#7f18baa33fb9eb0ebc2ad3c00cf3a8d99ff20c9a" + integrity sha512-LekO1+ESAdUvQjOxEVyIhdr47/ZFWZCy9mVGFrIcEd8FsxbO5jScATl+rYpE7gZ0WlPbA03u8irg8eOLGp+gsA== + dependencies: + bs58 "^5.0.0" + buffer "^6.0.3" + eip1193-provider "^1.0.1" + js-sha3 "^0.8.0" + "@cedelabs/providers@^0.0.7": version "0.0.7" resolved "https://registry.yarnpkg.com/@cedelabs/providers/-/providers-0.0.7.tgz#859070c5cf0a86841ce98d32c1599cc8de9b7869" @@ -446,6 +456,16 @@ dependencies: "@cspotcode/source-map-consumer" "0.8.0" +"@dapperlabs/dappauth@^2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@dapperlabs/dappauth/-/dappauth-2.0.5.tgz#6b1b83a9a3a6b7115baa53d8ae8ab593e10ee91e" + integrity sha512-Tw1WpR2lUSt+RMk7YtrolnhNZNOaSK7nprv4cqhAQ7Dvi1mENe3gqMW6Zl3oT2hi3v18s5yyNRhYkmAQB2e48A== + dependencies: + ethereumjs-abi "^0.6.6" + ethereumjs-util "^6.0.0" + safe-buffer "^5.1.2" + web3 "^1.2.1" + "@discoveryjs/json-ext@^0.5.0": version "0.5.6" resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz#d5e0706cf8c6acd8c6032f8d54070af261bbbb2f" @@ -466,6 +486,14 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@ethereumjs/common@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.5.0.tgz#ec61551b31bef7a69d1dc634d8932468866a4268" + integrity sha512-DEHjW6e38o+JmB/NO3GZBpW4lpaiBpkFgXF6jLcJ6gETBYpEyaA5nTimsWBUJR3Vmtm/didUEbNjajskugZORg== + dependencies: + crc-32 "^1.2.0" + ethereumjs-util "^7.1.1" + "@ethereumjs/common@2.6.2", "@ethereumjs/common@^2.0.0", "@ethereumjs/common@^2.4.0", "@ethereumjs/common@^2.6.0", "@ethereumjs/common@^2.6.1": version "2.6.2" resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.2.tgz#eb006c9329c75c80f634f340dc1719a5258244df" @@ -482,6 +510,14 @@ crc-32 "^1.2.0" ethereumjs-util "^7.1.4" +"@ethereumjs/common@^2.5.0": + version "2.6.5" + resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.5.tgz#0a75a22a046272579d91919cb12d84f2756e8d30" + integrity sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA== + dependencies: + crc-32 "^1.2.0" + ethereumjs-util "^7.1.5" + "@ethereumjs/common@^3.1.1": version "3.1.1" resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-3.1.1.tgz#6f754c8933727ad781f63ca3929caab542fe184e" @@ -516,6 +552,14 @@ "@ethereumjs/common" "^2.3.1" ethereumjs-util "^7.0.10" +"@ethereumjs/tx@3.3.2": + version "3.3.2" + resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.3.2.tgz#348d4624bf248aaab6c44fec2ae67265efe3db00" + integrity sha512-6AaJhwg4ucmwTvw/1qLaZUX5miWrwZ4nLOUsKyb/HtzS3BMw/CasKhdi1ims9mBKeK9sOJCH4qGKOBGyJCeeog== + dependencies: + "@ethereumjs/common" "^2.5.0" + ethereumjs-util "^7.1.2" + "@ethereumjs/tx@3.4.0": version "3.4.0" resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.4.0.tgz#7eb1947eefa55eb9cf05b3ca116fb7a3dbd0bce7" @@ -610,7 +654,7 @@ "@ethersproject/properties" "^5.5.0" "@ethersproject/strings" "^5.5.0" -"@ethersproject/abi@^5.0.1": +"@ethersproject/abi@^5.0.1", "@ethersproject/abi@^5.6.3": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== @@ -1135,7 +1179,7 @@ "@ethersproject/rlp" "^5.5.0" "@ethersproject/signing-key" "^5.5.0" -"@ethersproject/transactions@^5.7.0": +"@ethersproject/transactions@^5.6.2", "@ethersproject/transactions@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== @@ -2640,6 +2684,13 @@ dependencies: "@types/node" "*" +"@types/bn.js@^5.1.1": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" + integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== + dependencies: + "@types/node" "*" + "@types/body-parser@*": version "1.19.2" resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" @@ -4206,6 +4257,11 @@ abort-controller@^3.0.0: dependencies: event-target-shim "^5.0.0" +abortcontroller-polyfill@^1.7.3: + version "1.7.5" + resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz#6738495f4e901fbb57b6c0611d0c75f76c485bed" + integrity sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ== + abstract-leveldown@~2.6.0: version "2.6.3" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz#1c5e8c6a5ef965ae8c35dfb3a8770c476b82c4b8" @@ -6076,7 +6132,7 @@ eip-712@^0.4.3: keccak "^3.0.1" superstruct "^0.10.12" -eip1193-provider@1.0.1: +eip1193-provider@1.0.1, eip1193-provider@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/eip1193-provider/-/eip1193-provider-1.0.1.tgz#420d29cf4f6c443e3f32e718fb16fafb250637c3" integrity sha512-kSuqwQ26d7CzuS/t3yRXo2Su2cVH0QfvyKbr2H7Be7O5YDyIq4hQGCNTo5wRdP07bt+E2R/8nPCzey4ojBHf7g== @@ -6279,7 +6335,7 @@ es6-object-assign@^1.1.0: resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.1.0.tgz#c2c3582656247c39ea107cb1e6652b6f9f24523c" integrity sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw= -es6-promise@4.2.8, es6-promise@^4.0.3: +es6-promise@4.2.8, es6-promise@^4.0.3, es6-promise@^4.2.8: version "4.2.8" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== @@ -6720,7 +6776,7 @@ ethereum-provider@0.7.7: dependencies: events "3.3.0" -ethereumjs-abi@^0.6.8, "ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": +ethereumjs-abi@^0.6.6, ethereumjs-abi@^0.6.8, "ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": version "0.6.8" resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#ee3994657fa7a427238e6ba92a84d0b529bbcde0" dependencies: @@ -6852,6 +6908,17 @@ ethereumjs-util@^7.0.10, ethereumjs-util@^7.0.7, ethereumjs-util@^7.0.8, ethereu ethereum-cryptography "^0.1.3" rlp "^2.2.4" +ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.1, ethereumjs-util@^7.1.2, ethereumjs-util@^7.1.5: + version "7.1.5" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" + integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== + dependencies: + "@types/bn.js" "^5.1.0" + bn.js "^5.1.2" + create-hash "^1.1.2" + ethereum-cryptography "^0.1.3" + rlp "^2.2.4" + ethereumjs-utils@^5.2.5: version "5.2.5" resolved "https://registry.yarnpkg.com/ethereumjs-utils/-/ethereumjs-utils-5.2.5.tgz#76db76d021beb00f7d3f2fa9708a080444f079ea" @@ -7497,7 +7564,7 @@ google-protobuf@^3.15.8, google-protobuf@^3.7.0-rc.2: resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.19.4.tgz#8d32c3e34be9250956f28c0fb90955d13f311888" integrity sha512-OIPNCxsG2lkIvf+P5FNfJ/Km95CsXOBecS9ZcAU6m2Rq3svc0Apl9nB3GMDNKfQ9asNv4KjyAqGwPQFrVle3Yg== -got@9.6.0, got@^11.8.5, got@^7.1.0: +got@12.1.0, got@9.6.0, got@^11.8.5, got@^7.1.0: version "11.8.6" resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a" integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g== @@ -12005,6 +12072,17 @@ util@^0.12.0, util@^0.12.4: safe-buffer "^5.1.2" which-typed-array "^1.1.2" +util@^0.12.5: + version "0.12.5" + resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" + integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== + dependencies: + inherits "^2.0.3" + is-arguments "^1.0.4" + is-generator-function "^1.0.7" + is-typed-array "^1.1.3" + which-typed-array "^1.1.2" + utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -12015,7 +12093,7 @@ uuid@3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== -uuid@9.0.0: +uuid@9.0.0, uuid@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== @@ -12171,6 +12249,15 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" +web3-bzz@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.10.0.tgz#ac74bc71cdf294c7080a79091079192f05c5baed" + integrity sha512-o9IR59io3pDUsXTsps5pO5hW1D5zBmg46iNc2t4j2DkaYHNdDLwk2IP9ukoM2wg47QILfPEJYzhTfkS/CcX0KA== + dependencies: + "@types/node" "^12.12.6" + got "12.1.0" + swarm-js "^0.1.40" + web3-bzz@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.5.0.tgz#fed3f0895b4c51392eed4557235c1aaf79e0810b" @@ -12180,6 +12267,14 @@ web3-bzz@1.5.0: got "9.6.0" swarm-js "^0.1.40" +web3-core-helpers@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.10.0.tgz#1016534c51a5df77ed4f94d1fcce31de4af37fad" + integrity sha512-pIxAzFDS5vnbXvfvLSpaA1tfRykAe9adw43YCKsEYQwH0gCLL0kMLkaCX3q+Q8EVmAh+e1jWL/nl9U0de1+++g== + dependencies: + web3-eth-iban "1.10.0" + web3-utils "1.10.0" + web3-core-helpers@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.5.0.tgz#bca7645aaf2f22910df15d6d359e7f466b5d65ca" @@ -12196,6 +12291,17 @@ web3-core-helpers@1.5.2: web3-eth-iban "1.5.2" web3-utils "1.5.2" +web3-core-method@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.10.0.tgz#82668197fa086e8cc8066742e35a9d72535e3412" + integrity sha512-4R700jTLAMKDMhQ+nsVfIXvH6IGJlJzGisIfMKWAIswH31h5AZz7uDUW2YctI+HrYd+5uOAlS4OJeeT9bIpvkA== + dependencies: + "@ethersproject/transactions" "^5.6.2" + web3-core-helpers "1.10.0" + web3-core-promievent "1.10.0" + web3-core-subscriptions "1.10.0" + web3-utils "1.10.0" + web3-core-method@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.5.0.tgz#1940e4da7def63d00f9141b84c4d0d66d25428a7" @@ -12219,6 +12325,13 @@ web3-core-method@1.5.2: web3-core-subscriptions "1.5.2" web3-utils "1.5.2" +web3-core-promievent@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.10.0.tgz#cbb5b3a76b888df45ed3a8d4d8d4f54ccb66a37b" + integrity sha512-68N7k5LWL5R38xRaKFrTFT2pm2jBNFaM4GioS00YjAKXRQ3KjmhijOMG3TICz6Aa5+6GDWYelDNx21YAeZ4YTg== + dependencies: + eventemitter3 "4.0.4" + web3-core-promievent@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.5.0.tgz#fab9fe72520e46d8fee73ccf8d2f15243e4bc4fd" @@ -12233,6 +12346,17 @@ web3-core-promievent@1.5.2: dependencies: eventemitter3 "4.0.4" +web3-core-requestmanager@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.10.0.tgz#4b34f6e05837e67c70ff6f6993652afc0d54c340" + integrity sha512-3z/JKE++Os62APml4dvBM+GAuId4h3L9ckUrj7ebEtS2AR0ixyQPbrBodgL91Sv7j7cQ3Y+hllaluqjguxvSaQ== + dependencies: + util "^0.12.5" + web3-core-helpers "1.10.0" + web3-providers-http "1.10.0" + web3-providers-ipc "1.10.0" + web3-providers-ws "1.10.0" + web3-core-requestmanager@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.5.0.tgz#126427fb29efe15bbac090d3aad09b3842c6dbf6" @@ -12255,6 +12379,14 @@ web3-core-requestmanager@1.5.2: web3-providers-ipc "1.5.2" web3-providers-ws "1.5.2" +web3-core-subscriptions@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.10.0.tgz#b534592ee1611788fc0cb0b95963b9b9b6eacb7c" + integrity sha512-HGm1PbDqsxejI075gxBc5OSkwymilRWZufIy9zEpnWKNmfbuv5FfHgW1/chtJP6aP3Uq2vHkvTDl3smQBb8l+g== + dependencies: + eventemitter3 "4.0.4" + web3-core-helpers "1.10.0" + web3-core-subscriptions@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.5.0.tgz#c7f77fc0db061cd9290987b08540f91e9d4b8bca" @@ -12271,6 +12403,19 @@ web3-core-subscriptions@1.5.2: eventemitter3 "4.0.4" web3-core-helpers "1.5.2" +web3-core@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.10.0.tgz#9aa07c5deb478cf356c5d3b5b35afafa5fa8e633" + integrity sha512-fWySwqy2hn3TL89w5TM8wXF1Z2Q6frQTKHWmP0ppRQorEK8NcHJRfeMiv/mQlSKoTS1F6n/nv2uyZsixFycjYQ== + dependencies: + "@types/bn.js" "^5.1.1" + "@types/node" "^12.12.6" + bignumber.js "^9.0.0" + web3-core-helpers "1.10.0" + web3-core-method "1.10.0" + web3-core-requestmanager "1.10.0" + web3-utils "1.10.0" + web3-core@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.5.0.tgz#46c09283bcfe197df0c543dbe751650cea157a7f" @@ -12297,6 +12442,14 @@ web3-core@1.5.2: web3-core-requestmanager "1.5.2" web3-utils "1.5.2" +web3-eth-abi@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.10.0.tgz#53a7a2c95a571e205e27fd9e664df4919483cce1" + integrity sha512-cwS+qRBWpJ43aI9L3JS88QYPfFcSJJ3XapxOQ4j40v6mk7ATpA8CVK1vGTzpihNlOfMVRBkR95oAj7oL6aiDOg== + dependencies: + "@ethersproject/abi" "^5.6.3" + web3-utils "1.10.0" + web3-eth-abi@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.5.0.tgz#10a4bf11ec2302c6cf313b5de4e2e12d9620d648" @@ -12305,6 +12458,22 @@ web3-eth-abi@1.5.0: "@ethersproject/abi" "5.0.7" web3-utils "1.5.0" +web3-eth-accounts@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.10.0.tgz#2942beca0a4291455f32cf09de10457a19a48117" + integrity sha512-wiq39Uc3mOI8rw24wE2n15hboLE0E9BsQLdlmsL4Zua9diDS6B5abXG0XhFcoNsXIGMWXVZz4TOq3u4EdpXF/Q== + dependencies: + "@ethereumjs/common" "2.5.0" + "@ethereumjs/tx" "3.3.2" + eth-lib "0.2.8" + ethereumjs-util "^7.1.5" + scrypt-js "^3.0.1" + uuid "^9.0.0" + web3-core "1.10.0" + web3-core-helpers "1.10.0" + web3-core-method "1.10.0" + web3-utils "1.10.0" + web3-eth-accounts@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.5.0.tgz#1a71e12758440884450f4939290569ff82976cc3" @@ -12322,6 +12491,20 @@ web3-eth-accounts@1.5.0: web3-core-method "1.5.0" web3-utils "1.5.0" +web3-eth-contract@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.10.0.tgz#8e68c7654576773ec3c91903f08e49d0242c503a" + integrity sha512-MIC5FOzP/+2evDksQQ/dpcXhSqa/2hFNytdl/x61IeWxhh6vlFeSjq0YVTAyIzdjwnL7nEmZpjfI6y6/Ufhy7w== + dependencies: + "@types/bn.js" "^5.1.1" + web3-core "1.10.0" + web3-core-helpers "1.10.0" + web3-core-method "1.10.0" + web3-core-promievent "1.10.0" + web3-core-subscriptions "1.10.0" + web3-eth-abi "1.10.0" + web3-utils "1.10.0" + web3-eth-contract@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.5.0.tgz#f584a083316424110af95c3ad00c1c3a8a1796d2" @@ -12336,6 +12519,20 @@ web3-eth-contract@1.5.0: web3-eth-abi "1.5.0" web3-utils "1.5.0" +web3-eth-ens@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.10.0.tgz#96a676524e0b580c87913f557a13ed810cf91cd9" + integrity sha512-3hpGgzX3qjgxNAmqdrC2YUQMTfnZbs4GeLEmy8aCWziVwogbuqQZ+Gzdfrym45eOZodk+lmXyLuAdqkNlvkc1g== + dependencies: + content-hash "^2.5.2" + eth-ens-namehash "2.0.8" + web3-core "1.10.0" + web3-core-helpers "1.10.0" + web3-core-promievent "1.10.0" + web3-eth-abi "1.10.0" + web3-eth-contract "1.10.0" + web3-utils "1.10.0" + web3-eth-ens@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.5.0.tgz#f92ce19a541e42a0da4b8b04f7161d7a20ad3e86" @@ -12350,6 +12547,14 @@ web3-eth-ens@1.5.0: web3-eth-contract "1.5.0" web3-utils "1.5.0" +web3-eth-iban@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.10.0.tgz#5a46646401965b0f09a4f58e7248c8a8cd22538a" + integrity sha512-0l+SP3IGhInw7Q20LY3IVafYEuufo4Dn75jAHT7c2aDJsIolvf2Lc6ugHkBajlwUneGfbRQs/ccYPQ9JeMUbrg== + dependencies: + bn.js "^5.2.1" + web3-utils "1.10.0" + web3-eth-iban@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.5.0.tgz#8c3a1aa7aeed4080ba7d077612ce17025eb0d67d" @@ -12366,6 +12571,18 @@ web3-eth-iban@1.5.2: bn.js "^4.11.9" web3-utils "1.5.2" +web3-eth-personal@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.10.0.tgz#94d525f7a29050a0c2a12032df150ac5ea633071" + integrity sha512-anseKn98w/d703eWq52uNuZi7GhQeVjTC5/svrBWEKob0WZ5kPdo+EZoFN0sp5a5ubbrk/E0xSl1/M5yORMtpg== + dependencies: + "@types/node" "^12.12.6" + web3-core "1.10.0" + web3-core-helpers "1.10.0" + web3-core-method "1.10.0" + web3-net "1.10.0" + web3-utils "1.10.0" + web3-eth-personal@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.5.0.tgz#79e604f38439fbb7a9d4dcb20094359d20d3d388" @@ -12378,6 +12595,24 @@ web3-eth-personal@1.5.0: web3-net "1.5.0" web3-utils "1.5.0" +web3-eth@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.10.0.tgz#38b905e2759697c9624ab080cfcf4e6c60b3a6cf" + integrity sha512-Z5vT6slNMLPKuwRyKGbqeGYC87OAy8bOblaqRTgg94CXcn/mmqU7iPIlG4506YdcdK3x6cfEDG7B6w+jRxypKA== + dependencies: + web3-core "1.10.0" + web3-core-helpers "1.10.0" + web3-core-method "1.10.0" + web3-core-subscriptions "1.10.0" + web3-eth-abi "1.10.0" + web3-eth-accounts "1.10.0" + web3-eth-contract "1.10.0" + web3-eth-ens "1.10.0" + web3-eth-iban "1.10.0" + web3-eth-personal "1.10.0" + web3-net "1.10.0" + web3-utils "1.10.0" + web3-eth@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.5.0.tgz#819466117dfdc191095d6feb58b24023e016cb20" @@ -12396,6 +12631,15 @@ web3-eth@1.5.0: web3-net "1.5.0" web3-utils "1.5.0" +web3-net@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.10.0.tgz#be53e7f5dafd55e7c9013d49c505448b92c9c97b" + integrity sha512-NLH/N3IshYWASpxk4/18Ge6n60GEvWBVeM8inx2dmZJVmRI6SJIlUxbL8jySgiTn3MMZlhbdvrGo8fpUW7a1GA== + dependencies: + web3-core "1.10.0" + web3-core-method "1.10.0" + web3-utils "1.10.0" + web3-net@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.5.0.tgz#21ccbe7af3c3065633086b1e82ef100d833944b4" @@ -12433,6 +12677,16 @@ web3-provider-engine@16.0.1: xhr "^2.2.0" xtend "^4.0.1" +web3-providers-http@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.10.0.tgz#864fa48675e7918c9a4374e5f664b32c09d0151b" + integrity sha512-eNr965YB8a9mLiNrkjAWNAPXgmQWfpBfkkn7tpEFlghfww0u3I0tktMZiaToJVcL2+Xq+81cxbkpeWJ5XQDwOA== + dependencies: + abortcontroller-polyfill "^1.7.3" + cross-fetch "^3.1.4" + es6-promise "^4.2.8" + web3-core-helpers "1.10.0" + web3-providers-http@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.5.0.tgz#47297ac0f058e1c9af7a1528d1dfc2a67d602e93" @@ -12449,6 +12703,14 @@ web3-providers-http@1.5.2: web3-core-helpers "1.5.2" xhr2-cookies "1.1.0" +web3-providers-ipc@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.10.0.tgz#9747c7a6aee96a51488e32fa7c636c3460b39889" + integrity sha512-OfXG1aWN8L1OUqppshzq8YISkWrYHaATW9H8eh0p89TlWMc1KZOL9vttBuaBEi96D/n0eYDn2trzt22bqHWfXA== + dependencies: + oboe "2.1.5" + web3-core-helpers "1.10.0" + web3-providers-ipc@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.5.0.tgz#69d9b3a23f6bfd52f649f3bfbfa6696b159fa80a" @@ -12465,6 +12727,15 @@ web3-providers-ipc@1.5.2: oboe "2.1.5" web3-core-helpers "1.5.2" +web3-providers-ws@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.10.0.tgz#cb0b87b94c4df965cdf486af3a8cd26daf3975e5" + integrity sha512-sK0fNcglW36yD5xjnjtSGBnEtf59cbw4vZzJ+CmOWIKGIR96mP5l684g0WD0Eo+f4NQc2anWWXG74lRc9OVMCQ== + dependencies: + eventemitter3 "4.0.4" + web3-core-helpers "1.10.0" + websocket "^1.0.32" + web3-providers-ws@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.5.0.tgz#c78253af17dfdcd4f8a4c3a8ac1a684a73886ae7" @@ -12483,6 +12754,16 @@ web3-providers-ws@1.5.2: web3-core-helpers "1.5.2" websocket "^1.0.32" +web3-shh@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.10.0.tgz#c2979b87e0f67a7fef2ce9ee853bd7bfbe9b79a8" + integrity sha512-uNUUuNsO2AjX41GJARV9zJibs11eq6HtOe6Wr0FtRUcj8SN6nHeYIzwstAvJ4fXA53gRqFMTxdntHEt9aXVjpg== + dependencies: + web3-core "1.10.0" + web3-core-method "1.10.0" + web3-core-subscriptions "1.10.0" + web3-net "1.10.0" + web3-shh@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.5.0.tgz#eabf7c346605b107f51dfe5e6df9643a4b5eb7aa" @@ -12493,6 +12774,19 @@ web3-shh@1.5.0: web3-core-subscriptions "1.5.0" web3-net "1.5.0" +web3-utils@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.10.0.tgz#ca4c1b431a765c14ac7f773e92e0fd9377ccf578" + integrity sha512-kSaCM0uMcZTNUSmn5vMEhlo02RObGNRRCkdX0V9UTAU0+lrvn0HSaudyCo6CQzuXUsnuY2ERJGCGPfeWmv19Rg== + dependencies: + bn.js "^5.2.1" + ethereum-bloom-filters "^1.0.6" + ethereumjs-util "^7.1.0" + ethjs-unit "0.1.6" + number-to-bn "1.7.0" + randombytes "^2.1.0" + utf8 "3.0.0" + web3-utils@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.5.0.tgz#48c8ba0d95694e73b9a6d473d955880cd4758e4a" @@ -12532,6 +12826,19 @@ web3@1.5.0: web3-shh "1.5.0" web3-utils "1.5.0" +web3@^1.2.1: + version "1.10.0" + resolved "https://registry.yarnpkg.com/web3/-/web3-1.10.0.tgz#2fde0009f59aa756c93e07ea2a7f3ab971091274" + integrity sha512-YfKY9wSkGcM8seO+daR89oVTcbu18NsVfvOngzqMYGUU0pPSQmE57qQDvQzUeoIOHAnXEBNzrhjQJmm8ER0rng== + dependencies: + web3-bzz "1.10.0" + web3-core "1.10.0" + web3-eth "1.10.0" + web3-eth-personal "1.10.0" + web3-net "1.10.0" + web3-shh "1.10.0" + web3-utils "1.10.0" + webextension-polyfill-ts@^0.26.0: version "0.26.0" resolved "https://registry.yarnpkg.com/webextension-polyfill-ts/-/webextension-polyfill-ts-0.26.0.tgz#80b7063ddaf99abaa1ca73aad0cec09f306612d3" From 0c98bf6121d76e68295e4b8c590c52fb464c9b6c Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Tue, 16 May 2023 03:21:25 +0800 Subject: [PATCH 09/22] fix: move docs to new folder --- .../[...4]wallets/{blocto.md => [...28]blocto/+page.md} | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename docs/src/routes/docs/[...4]wallets/{blocto.md => [...28]blocto/+page.md} (95%) diff --git a/docs/src/routes/docs/[...4]wallets/blocto.md b/docs/src/routes/docs/[...4]wallets/[...28]blocto/+page.md similarity index 95% rename from docs/src/routes/docs/[...4]wallets/blocto.md rename to docs/src/routes/docs/[...4]wallets/[...28]blocto/+page.md index d8f5ddb9a..b0c56b073 100644 --- a/docs/src/routes/docs/[...4]wallets/blocto.md +++ b/docs/src/routes/docs/[...4]wallets/[...28]blocto/+page.md @@ -1,4 +1,8 @@ -# Blocto +--- +title: Blocto +--- + +# {$frontmatter.title} Wallet module for connecting Blocto SDK to web3-onboard. Check out the [Blocto Developer Docs](https://docs.blocto.app/blocto-sdk/javascript-sdk/evm-sdk) for more information. @@ -13,11 +17,9 @@ yarn add @web3-onboard/blocto - ```sh copy npm install @web3-onboard/blocto ``` - From 86a0601c8c7526d300ef105aad7e9fc1dec17141 Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Tue, 16 May 2023 03:31:24 +0800 Subject: [PATCH 10/22] feat: available in the docs connection module --- docs/src/lib/services/onboard.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/src/lib/services/onboard.js b/docs/src/lib/services/onboard.js index 88d5cc0fc..3353bed4e 100644 --- a/docs/src/lib/services/onboard.js +++ b/docs/src/lib/services/onboard.js @@ -53,6 +53,7 @@ const intiOnboard = async (theme) => { const { default: xdefiModule } = await import('@web3-onboard/xdefi') const { default: cedeModule } = await import('@web3-onboard/cede-store') const { default: frameModule } = await import('@web3-onboard/frame') + const { default: bloctoModule } = await import('@web3-onboard/blocto') const INFURA_ID = '8b60d52405694345a99bcb82e722e0af' const injected = injectedModule() @@ -107,6 +108,8 @@ const intiOnboard = async (theme) => { const frame = frameModule() + const blocto = bloctoModule() + return Onboard({ wallets: [ injected, @@ -131,7 +134,8 @@ const intiOnboard = async (theme) => { keepkey, portis, frame, - infinityWallet + infinityWallet, + blocto ], chains: [ { From af6400cdd6e1939f2c2c78b40cdb1f5fe9e23331 Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Wed, 17 May 2023 11:28:46 +0800 Subject: [PATCH 11/22] fix: resolve review change --- packages/blocto/package.json | 2 +- packages/demo/src/App.svelte | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/blocto/package.json b/packages/blocto/package.json index 2742e3807..1ce2bf9e9 100644 --- a/packages/blocto/package.json +++ b/packages/blocto/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/blocto", - "version": "0.1.0", + "version": "0.1.0-alpha.1", "description": "Blocto 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/demo/src/App.svelte b/packages/demo/src/App.svelte index a766a818d..809512e84 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -480,7 +480,7 @@ let typedMsg = JSON.stringify( { domain: { - chainId: '0x13881', + chainId: '0x5', name: 'Web3-Onboard Test App', verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', version: '1' @@ -528,7 +528,7 @@ 2 ) const signTypedMessage = async (provider, address) => { - await onboard.setChain({ chainId: '0x13881' }) + await onboard.setChain({ chainId: '0x5' }) const signature = await provider.request({ method: 'eth_signTypedData_v4', params: [address, typedMsg] From 23d0b7dbbf75c6f808ff57d2a60e4666704f11f4 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Wed, 17 May 2023 10:23:36 -0600 Subject: [PATCH 12/22] move docs page, update bloct package version --- docs/package.json | 1 + .../{[...9]injected => [...10]injected}/+page.md | 1 - .../{[...10]keepkey => [...11]keepkey}/+page.md | 0 .../{[...11]keystone => [...12]keystone}/+page.md | 0 .../{[...12]ledger => [...13]ledger}/+page.md | 0 .../{[...13]magic => [...14]magic}/+page.md | 0 .../{[...14]mew => [...15]mew}/+page.md | 0 .../{[...15]mewwallet => [...16]mewwallet}/+page.md | 0 .../{[...16]phantom => [...17]phantom}/+page.md | 0 .../{[...17]portis => [...18]portis}/+page.md | 0 .../{[...18]taho => [...19]taho}/+page.md | 0 .../{[...28]blocto => [...1]blocto}/+page.md | 2 ++ .../{[...19]tallyho => [...20]tallyho}/+page.md | 0 .../{[...20]torus => [...21]torus}/+page.md | 0 .../{[...21]trezor => [...22]trezor}/+page.md | 0 .../{[...22]uauth => [...23]uauth}/+page.md | 0 .../+page.md | 0 .../+page.md | 0 .../{[...25]web3auth => [...26]web3auth}/+page.md | 0 .../{[...26]xdefi => [...27]xdefi}/+page.md | 0 .../{[...27]zeal => [...28]zeal}/+page.md | 0 .../{[...1]coinbase => [...2]coinbase}/+page.md | 0 .../{[...2]dcent => [...3]dcent}/+page.md | 0 .../{[...3]enkrypt => [...4]enkrypt}/+page.md | 0 .../{[...4]fortmatic => [...5]fortmatic}/+page.md | 0 .../{[...5]frame => [...6]frame}/+page.md | 0 .../{[...6]frontier => [...7]frontier}/+page.md | 0 .../{[...7]gnosis => [...8]gnosis}/+page.md | 0 .../+page.md | 0 packages/blocto/package.json | 2 +- packages/demo/package.json | 3 ++- packages/demo/src/App.svelte | 12 ++++++------ 32 files changed, 12 insertions(+), 9 deletions(-) rename docs/src/routes/docs/[...4]wallets/{[...9]injected => [...10]injected}/+page.md (99%) rename docs/src/routes/docs/[...4]wallets/{[...10]keepkey => [...11]keepkey}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...11]keystone => [...12]keystone}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...12]ledger => [...13]ledger}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...13]magic => [...14]magic}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...14]mew => [...15]mew}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...15]mewwallet => [...16]mewwallet}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...16]phantom => [...17]phantom}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...17]portis => [...18]portis}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...18]taho => [...19]taho}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...28]blocto => [...1]blocto}/+page.md (99%) rename docs/src/routes/docs/[...4]wallets/{[...19]tallyho => [...20]tallyho}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...20]torus => [...21]torus}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...21]trezor => [...22]trezor}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...22]uauth => [...23]uauth}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...23]walletconnect => [...24]walletconnect}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...24]walletlink => [...25]walletlink}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...25]web3auth => [...26]web3auth}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...26]xdefi => [...27]xdefi}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...27]zeal => [...28]zeal}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...1]coinbase => [...2]coinbase}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...2]dcent => [...3]dcent}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...3]enkrypt => [...4]enkrypt}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...4]fortmatic => [...5]fortmatic}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...5]frame => [...6]frame}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...6]frontier => [...7]frontier}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...7]gnosis => [...8]gnosis}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...8]infinitywallet => [...9]infinitywallet}/+page.md (100%) diff --git a/docs/package.json b/docs/package.json index 1cdd31238..630c56208 100644 --- a/docs/package.json +++ b/docs/package.json @@ -47,6 +47,7 @@ }, "type": "module", "dependencies": { + "@web3-onboard/blocto": "2.0.0-alpha.2", "@web3-onboard/cede-store": "^2.0.2-alpha.2", "@web3-onboard/coinbase": "^2.2.4-alpha.1", "@web3-onboard/core": "^2.19.1-alpha.1", diff --git a/docs/src/routes/docs/[...4]wallets/[...9]injected/+page.md b/docs/src/routes/docs/[...4]wallets/[...10]injected/+page.md similarity index 99% rename from docs/src/routes/docs/[...4]wallets/[...9]injected/+page.md rename to docs/src/routes/docs/[...4]wallets/[...10]injected/+page.md index e7bc88f4d..f7588a3ad 100644 --- a/docs/src/routes/docs/[...4]wallets/[...9]injected/+page.md +++ b/docs/src/routes/docs/[...4]wallets/[...10]injected/+page.md @@ -318,7 +318,6 @@ const injected = injectedModule({ - ApexWallet - _Desktop_ - BifrostWallet - _Desktop & Mobile_ - Safeheron - _Desktop_ -- Talisman - _Desktop_ ## Build Environments diff --git a/docs/src/routes/docs/[...4]wallets/[...10]keepkey/+page.md b/docs/src/routes/docs/[...4]wallets/[...11]keepkey/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...10]keepkey/+page.md rename to docs/src/routes/docs/[...4]wallets/[...11]keepkey/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...11]keystone/+page.md b/docs/src/routes/docs/[...4]wallets/[...12]keystone/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...11]keystone/+page.md rename to docs/src/routes/docs/[...4]wallets/[...12]keystone/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...12]ledger/+page.md b/docs/src/routes/docs/[...4]wallets/[...13]ledger/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...12]ledger/+page.md rename to docs/src/routes/docs/[...4]wallets/[...13]ledger/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...13]magic/+page.md b/docs/src/routes/docs/[...4]wallets/[...14]magic/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...13]magic/+page.md rename to docs/src/routes/docs/[...4]wallets/[...14]magic/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...14]mew/+page.md b/docs/src/routes/docs/[...4]wallets/[...15]mew/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...14]mew/+page.md rename to docs/src/routes/docs/[...4]wallets/[...15]mew/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...15]mewwallet/+page.md b/docs/src/routes/docs/[...4]wallets/[...16]mewwallet/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...15]mewwallet/+page.md rename to docs/src/routes/docs/[...4]wallets/[...16]mewwallet/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...16]phantom/+page.md b/docs/src/routes/docs/[...4]wallets/[...17]phantom/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...16]phantom/+page.md rename to docs/src/routes/docs/[...4]wallets/[...17]phantom/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...17]portis/+page.md b/docs/src/routes/docs/[...4]wallets/[...18]portis/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...17]portis/+page.md rename to docs/src/routes/docs/[...4]wallets/[...18]portis/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...18]taho/+page.md b/docs/src/routes/docs/[...4]wallets/[...19]taho/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...18]taho/+page.md rename to docs/src/routes/docs/[...4]wallets/[...19]taho/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...28]blocto/+page.md b/docs/src/routes/docs/[...4]wallets/[...1]blocto/+page.md similarity index 99% rename from docs/src/routes/docs/[...4]wallets/[...28]blocto/+page.md rename to docs/src/routes/docs/[...4]wallets/[...1]blocto/+page.md index b0c56b073..7ef063a6f 100644 --- a/docs/src/routes/docs/[...4]wallets/[...28]blocto/+page.md +++ b/docs/src/routes/docs/[...4]wallets/[...1]blocto/+page.md @@ -17,9 +17,11 @@ yarn add @web3-onboard/blocto + ```sh copy npm install @web3-onboard/blocto ``` + diff --git a/docs/src/routes/docs/[...4]wallets/[...19]tallyho/+page.md b/docs/src/routes/docs/[...4]wallets/[...20]tallyho/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...19]tallyho/+page.md rename to docs/src/routes/docs/[...4]wallets/[...20]tallyho/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...20]torus/+page.md b/docs/src/routes/docs/[...4]wallets/[...21]torus/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...20]torus/+page.md rename to docs/src/routes/docs/[...4]wallets/[...21]torus/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...21]trezor/+page.md b/docs/src/routes/docs/[...4]wallets/[...22]trezor/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...21]trezor/+page.md rename to docs/src/routes/docs/[...4]wallets/[...22]trezor/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...22]uauth/+page.md b/docs/src/routes/docs/[...4]wallets/[...23]uauth/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...22]uauth/+page.md rename to docs/src/routes/docs/[...4]wallets/[...23]uauth/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...23]walletconnect/+page.md b/docs/src/routes/docs/[...4]wallets/[...24]walletconnect/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...23]walletconnect/+page.md rename to docs/src/routes/docs/[...4]wallets/[...24]walletconnect/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...24]walletlink/+page.md b/docs/src/routes/docs/[...4]wallets/[...25]walletlink/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...24]walletlink/+page.md rename to docs/src/routes/docs/[...4]wallets/[...25]walletlink/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...25]web3auth/+page.md b/docs/src/routes/docs/[...4]wallets/[...26]web3auth/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...25]web3auth/+page.md rename to docs/src/routes/docs/[...4]wallets/[...26]web3auth/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...26]xdefi/+page.md b/docs/src/routes/docs/[...4]wallets/[...27]xdefi/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...26]xdefi/+page.md rename to docs/src/routes/docs/[...4]wallets/[...27]xdefi/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...27]zeal/+page.md b/docs/src/routes/docs/[...4]wallets/[...28]zeal/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...27]zeal/+page.md rename to docs/src/routes/docs/[...4]wallets/[...28]zeal/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...1]coinbase/+page.md b/docs/src/routes/docs/[...4]wallets/[...2]coinbase/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...1]coinbase/+page.md rename to docs/src/routes/docs/[...4]wallets/[...2]coinbase/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...2]dcent/+page.md b/docs/src/routes/docs/[...4]wallets/[...3]dcent/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...2]dcent/+page.md rename to docs/src/routes/docs/[...4]wallets/[...3]dcent/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...3]enkrypt/+page.md b/docs/src/routes/docs/[...4]wallets/[...4]enkrypt/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...3]enkrypt/+page.md rename to docs/src/routes/docs/[...4]wallets/[...4]enkrypt/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...4]fortmatic/+page.md b/docs/src/routes/docs/[...4]wallets/[...5]fortmatic/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...4]fortmatic/+page.md rename to docs/src/routes/docs/[...4]wallets/[...5]fortmatic/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...5]frame/+page.md b/docs/src/routes/docs/[...4]wallets/[...6]frame/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...5]frame/+page.md rename to docs/src/routes/docs/[...4]wallets/[...6]frame/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...6]frontier/+page.md b/docs/src/routes/docs/[...4]wallets/[...7]frontier/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...6]frontier/+page.md rename to docs/src/routes/docs/[...4]wallets/[...7]frontier/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...7]gnosis/+page.md b/docs/src/routes/docs/[...4]wallets/[...8]gnosis/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...7]gnosis/+page.md rename to docs/src/routes/docs/[...4]wallets/[...8]gnosis/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...8]infinitywallet/+page.md b/docs/src/routes/docs/[...4]wallets/[...9]infinitywallet/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...8]infinitywallet/+page.md rename to docs/src/routes/docs/[...4]wallets/[...9]infinitywallet/+page.md diff --git a/packages/blocto/package.json b/packages/blocto/package.json index 1ce2bf9e9..dc6760bd2 100644 --- a/packages/blocto/package.json +++ b/packages/blocto/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/blocto", - "version": "0.1.0-alpha.1", + "version": "1.0.0-alpha.1", "description": "Blocto 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/demo/package.json b/packages/demo/package.json index cf00d66a6..b670cf437 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -25,8 +25,9 @@ }, "dependencies": { "@web3-onboard/cede-store": "^2.0.2", + "@web3-onboard/blocto": "2.0.0-alpha.2", + "@web3-onboard/core": "^2.19.1-alpha.1", "@web3-onboard/coinbase": "^2.2.3", - "@web3-onboard/core": "^2.19.1", "@web3-onboard/dcent": "^2.2.7", "@web3-onboard/enkrypt": "^2.0.3", "@web3-onboard/fortmatic": "^2.0.18", diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index 809512e84..6ac050c60 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -217,12 +217,6 @@ transactionPreview, gas, chains: [ - { - id: '0x13881', - token: 'MATIC', - label: 'Polygon - Mumbai', - rpcUrl: 'https://matic-mumbai.chainstacklabs.com ' - }, { id: '0x1', token: 'ETH', @@ -254,6 +248,12 @@ label: 'Goerli', rpcUrl: `https://goerli.infura.io/v3/${infura_key}` }, + { + id: '0x13881', + token: 'MATIC', + label: 'Polygon - Mumbai', + rpcUrl: 'https://matic-mumbai.chainstacklabs.com ' + }, { id: '0x38', token: 'BNB', From c8f57351d88b9bcbbc15bfc64a4b0cd54a463a02 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Wed, 17 May 2023 10:29:43 -0600 Subject: [PATCH 13/22] add blocto to docs script --- docs/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/package.json b/docs/package.json index 630c56208..5099c53c0 100644 --- a/docs/package.json +++ b/docs/package.json @@ -12,8 +12,8 @@ "format": "prettier --plugin-search-dir . --write .", "prepare": "svelte-kit sync", "test": "playwright test", - "w3o-latest-prod": "yarn add '@web3-onboard/core' '@web3-onboard/coinbase' '@web3-onboard/transaction-preview' '@web3-onboard/dcent' '@web3-onboard/frontier' '@web3-onboard/fortmatic' '@web3-onboard/frame' '@web3-onboard/gas' '@web3-onboard/gnosis' '@web3-onboard/keepkey' '@web3-onboard/keystone' '@web3-onboard/ledger' '@web3-onboard/infinity-wallet' '@web3-onboard/injected-wallets' '@web3-onboard/magic' '@web3-onboard/phantom' '@web3-onboard/portis' '@web3-onboard/sequence' '@web3-onboard/trezor' '@web3-onboard/trust' '@web3-onboard/torus' '@web3-onboard/taho' '@web3-onboard/web3auth' '@web3-onboard/walletconnect' '@web3-onboard/enkrypt' '@web3-onboard/mew-wallet' '@web3-onboard/xdefi' '@web3-onboard/uauth' '@web3-onboard/zeal' '@web3-onboard/cede-store'", - "w3o-latest-alpha": "yarn add '@web3-onboard/core@next' '@web3-onboard/coinbase@next' '@web3-onboard/transaction-preview@next' '@web3-onboard/dcent@next' '@web3-onboard/frontier@next' '@web3-onboard/fortmatic@next' '@web3-onboard/frame@next' '@web3-onboard/gas@next' '@web3-onboard/gnosis@next' '@web3-onboard/keepkey@next' '@web3-onboard/keystone@next' '@web3-onboard/ledger@next' '@web3-onboard/infinity-wallet@next' '@web3-onboard/injected-wallets@next' '@web3-onboard/magic@next' '@web3-onboard/phantom@next' '@web3-onboard/portis@next' '@web3-onboard/sequence@next' '@web3-onboard/trezor@next' '@web3-onboard/trust@next' '@web3-onboard/torus@next' '@web3-onboard/taho@next' '@web3-onboard/web3auth@next' '@web3-onboard/walletconnect@next' '@web3-onboard/enkrypt@next' '@web3-onboard/mew-wallet@next' '@web3-onboard/xdefi@next' '@web3-onboard/uauth@next' '@web3-onboard/zeal@next' '@web3-onboard/cede-store@next'" + "w3o-latest-prod": "yarn add '@web3-onboard/core' '@web3-onboard/coinbase' '@web3-onboard/transaction-preview' '@web3-onboard/dcent' '@web3-onboard/frontier' '@web3-onboard/fortmatic' '@web3-onboard/frame' '@web3-onboard/gas' '@web3-onboard/gnosis' '@web3-onboard/keepkey' '@web3-onboard/keystone' '@web3-onboard/ledger' '@web3-onboard/infinity-wallet' '@web3-onboard/injected-wallets' '@web3-onboard/magic' '@web3-onboard/phantom' '@web3-onboard/portis' '@web3-onboard/sequence' '@web3-onboard/trezor' '@web3-onboard/trust' '@web3-onboard/torus' '@web3-onboard/taho' '@web3-onboard/web3auth' '@web3-onboard/walletconnect' '@web3-onboard/enkrypt' '@web3-onboard/mew-wallet' '@web3-onboard/xdefi' '@web3-onboard/uauth' '@web3-onboard/zeal' '@web3-onboard/cede-store' '@web3-onboard/blocto'", + "w3o-latest-alpha": "yarn add '@web3-onboard/core@next' '@web3-onboard/coinbase@next' '@web3-onboard/transaction-preview@next' '@web3-onboard/dcent@next' '@web3-onboard/frontier@next' '@web3-onboard/fortmatic@next' '@web3-onboard/frame@next' '@web3-onboard/gas@next' '@web3-onboard/gnosis@next' '@web3-onboard/keepkey@next' '@web3-onboard/keystone@next' '@web3-onboard/ledger@next' '@web3-onboard/infinity-wallet@next' '@web3-onboard/injected-wallets@next' '@web3-onboard/magic@next' '@web3-onboard/phantom@next' '@web3-onboard/portis@next' '@web3-onboard/sequence@next' '@web3-onboard/trezor@next' '@web3-onboard/trust@next' '@web3-onboard/torus@next' '@web3-onboard/taho@next' '@web3-onboard/web3auth@next' '@web3-onboard/walletconnect@next' '@web3-onboard/enkrypt@next' '@web3-onboard/mew-wallet@next' '@web3-onboard/xdefi@next' '@web3-onboard/uauth@next' '@web3-onboard/zeal@next' '@web3-onboard/cede-store@next' '@web3-onboard/blocto@next'" }, "devDependencies": { "@algolia/client-search": "^4.17.0", From f62f4c64d2c63a162beba5fc0d91a76c3e29e887 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Thu, 18 May 2023 10:29:38 -0600 Subject: [PATCH 14/22] re-add Tailsman to list of injected wallets --- docs/src/routes/docs/[...4]wallets/[...10]injected/+page.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/routes/docs/[...4]wallets/[...10]injected/+page.md b/docs/src/routes/docs/[...4]wallets/[...10]injected/+page.md index f7588a3ad..e7bc88f4d 100644 --- a/docs/src/routes/docs/[...4]wallets/[...10]injected/+page.md +++ b/docs/src/routes/docs/[...4]wallets/[...10]injected/+page.md @@ -318,6 +318,7 @@ const injected = injectedModule({ - ApexWallet - _Desktop_ - BifrostWallet - _Desktop & Mobile_ - Safeheron - _Desktop_ +- Talisman - _Desktop_ ## Build Environments From e8c3b2dc5485fed3aa088ba8f1c88a46c267b65f Mon Sep 17 00:00:00 2001 From: "jimmy.pan" Date: Sat, 20 May 2023 03:41:11 +0800 Subject: [PATCH 15/22] Update packages/blocto/package.json Co-authored-by: Adam Carpenter --- packages/blocto/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/blocto/package.json b/packages/blocto/package.json index dc6760bd2..5884cbf52 100644 --- a/packages/blocto/package.json +++ b/packages/blocto/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/blocto", - "version": "1.0.0-alpha.1", + "version": "2.0.0-alpha.1", "description": "Blocto 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 a494400d65ca0addb4c496aab181c49b860b8bd3 Mon Sep 17 00:00:00 2001 From: "jimmy.pan" Date: Sat, 20 May 2023 03:41:44 +0800 Subject: [PATCH 16/22] Update docs/package.json Co-authored-by: Adam Carpenter --- docs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/package.json b/docs/package.json index 5099c53c0..d5baffba2 100644 --- a/docs/package.json +++ b/docs/package.json @@ -83,4 +83,4 @@ "ethers": "^5.7.0", "tailwindcss": "^3.3.1" } -} +} From bc4cf2d27bd5d29b70793d0d3b629f70f77790e6 Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Sat, 20 May 2023 03:55:17 +0800 Subject: [PATCH 17/22] fix: use Optional Chaining enhanced debugging --- packages/blocto/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/blocto/src/index.ts b/packages/blocto/src/index.ts index 50dabce55..ef13a1e97 100644 --- a/packages/blocto/src/index.ts +++ b/packages/blocto/src/index.ts @@ -24,10 +24,10 @@ function BloctoWallet(): WalletInit { const provider = createEIP1193Provider(bloctoProvider, { eth_selectAccounts: null, wallet_switchEthereumChain: async ({ params, baseRequest }) => { - const chain = chains.find(({ id }) => id === params[0].chainId) + const chain = chains.find(({ id }) => id === params?.[0]?.chainId) if (!chain) throw new Error('chain must be set before switching') - const providerRpcurl = bloctoProvider.switchableNetwork[chain.id]?.rpc_url - const chainUrl = chain.rpcUrl; + const providerRpcurl = bloctoProvider?.switchableNetwork?.[chain.id]?.rpc_url + const chainUrl = chain?.rpcUrl; if ( providerRpcurl !== chainUrl ) { From 2e07808dd4ab99b9c396a307281d958f388ed56e Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Tue, 23 May 2023 03:20:18 +0800 Subject: [PATCH 18/22] fix: bump version --- docs/package.json | 4 ++-- packages/demo/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/package.json b/docs/package.json index d5baffba2..d61da7a14 100644 --- a/docs/package.json +++ b/docs/package.json @@ -47,7 +47,7 @@ }, "type": "module", "dependencies": { - "@web3-onboard/blocto": "2.0.0-alpha.2", + "@web3-onboard/blocto": "2.0.0-alpha.1", "@web3-onboard/cede-store": "^2.0.2-alpha.2", "@web3-onboard/coinbase": "^2.2.4-alpha.1", "@web3-onboard/core": "^2.19.1-alpha.1", @@ -83,4 +83,4 @@ "ethers": "^5.7.0", "tailwindcss": "^3.3.1" } -} +} diff --git a/packages/demo/package.json b/packages/demo/package.json index ef3d129ec..ecfaa5bee 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -25,7 +25,7 @@ }, "dependencies": { "@web3-onboard/cede-store": "^2.0.2", - "@web3-onboard/blocto": "2.0.0-alpha.2", + "@web3-onboard/blocto": "2.0.0-alpha.1", "@web3-onboard/coinbase": "^2.2.3", "@web3-onboard/core": "^2.19.2", "@web3-onboard/dcent": "^2.2.7", From 490602505bc3ca2c2112062bbe24f5e892a4565e Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Tue, 23 May 2023 09:31:08 -0600 Subject: [PATCH 19/22] remove conditional prop chaining --- packages/blocto/src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/blocto/src/index.ts b/packages/blocto/src/index.ts index ef13a1e97..b0e208aeb 100644 --- a/packages/blocto/src/index.ts +++ b/packages/blocto/src/index.ts @@ -24,10 +24,10 @@ function BloctoWallet(): WalletInit { const provider = createEIP1193Provider(bloctoProvider, { eth_selectAccounts: null, wallet_switchEthereumChain: async ({ params, baseRequest }) => { - const chain = chains.find(({ id }) => id === params?.[0]?.chainId) + const chain = chains.find(({ id }) => id === params[0].chainId) if (!chain) throw new Error('chain must be set before switching') - const providerRpcurl = bloctoProvider?.switchableNetwork?.[chain.id]?.rpc_url - const chainUrl = chain?.rpcUrl; + const providerRpcurl = bloctoProvider.switchableNetwork[chain.id].rpc_url + const chainUrl = chain.rpcUrl; if ( providerRpcurl !== chainUrl ) { @@ -53,7 +53,7 @@ function BloctoWallet(): WalletInit { } }) - provider.disconnect = () => instance?.ethereum?.request({ method: 'wallet_disconnect' }); + provider.disconnect = () => instance.ethereum ? instance.ethereum.request({ method: 'wallet_disconnect' }): null // patch the chainChanged event const on = bloctoProvider.on.bind(bloctoProvider) bloctoProvider.on = (event: string, listener: (arg0: string) => void) => { From 35c5e731157dc9b45f4f2586a16bb041e21855a6 Mon Sep 17 00:00:00 2001 From: sanyu1225 Date: Sat, 27 May 2023 22:27:17 +0800 Subject: [PATCH 20/22] fix: backward compatible --- packages/blocto/src/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/blocto/src/index.ts b/packages/blocto/src/index.ts index b0e208aeb..0b49b8c72 100644 --- a/packages/blocto/src/index.ts +++ b/packages/blocto/src/index.ts @@ -24,13 +24,15 @@ function BloctoWallet(): WalletInit { const provider = createEIP1193Provider(bloctoProvider, { eth_selectAccounts: null, wallet_switchEthereumChain: async ({ params, baseRequest }) => { - const chain = chains.find(({ id }) => id === params[0].chainId) + const chain = chains.find(function(item) { + return item.id === (params && params[0] && params[0].chainId); + }); if (!chain) throw new Error('chain must be set before switching') - const providerRpcurl = bloctoProvider.switchableNetwork[chain.id].rpc_url + const providerRpcurl = bloctoProvider.switchableNetwork[chain.id] && bloctoProvider.switchableNetwork[chain.id].rpc_url; const chainUrl = chain.rpcUrl; if ( providerRpcurl !== chainUrl - ) { + ) { await baseRequest({ method: 'wallet_addEthereumChain', params: [ From ad4c0a71aacd5b82728194e1a31a2f4d2dd1d7e0 Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Mon, 12 Jun 2023 14:16:37 -0600 Subject: [PATCH 21/22] prettier bloct/index.ts --- packages/blocto/src/index.ts | 38 +++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/packages/blocto/src/index.ts b/packages/blocto/src/index.ts index 0b49b8c72..c61ae474d 100644 --- a/packages/blocto/src/index.ts +++ b/packages/blocto/src/index.ts @@ -24,29 +24,29 @@ function BloctoWallet(): WalletInit { const provider = createEIP1193Provider(bloctoProvider, { eth_selectAccounts: null, wallet_switchEthereumChain: async ({ params, baseRequest }) => { - const chain = chains.find(function(item) { - return item.id === (params && params[0] && params[0].chainId); - }); + const chain = chains.find(function (item) { + return item.id === (params && params[0] && params[0].chainId) + }) if (!chain) throw new Error('chain must be set before switching') - const providerRpcurl = bloctoProvider.switchableNetwork[chain.id] && bloctoProvider.switchableNetwork[chain.id].rpc_url; - const chainUrl = chain.rpcUrl; - if ( - providerRpcurl !== chainUrl - ) { + const providerRpcurl = + bloctoProvider.switchableNetwork[chain.id] && + bloctoProvider.switchableNetwork[chain.id].rpc_url + const chainUrl = chain.rpcUrl + if (providerRpcurl !== chainUrl) { await baseRequest({ method: 'wallet_addEthereumChain', params: [ { chainId: chain.id, - rpcUrls: [chainUrl], - }, - ], - }); + rpcUrls: [chainUrl] + } + ] + }) } await baseRequest({ method: 'wallet_switchEthereumChain', - params: [{ chainId: chain.id }], - }); + params: [{ chainId: chain.id }] + }) return null }, eth_chainId: async ({ baseRequest }) => { @@ -55,10 +55,16 @@ function BloctoWallet(): WalletInit { } }) - provider.disconnect = () => instance.ethereum ? instance.ethereum.request({ method: 'wallet_disconnect' }): null + provider.disconnect = () => + instance.ethereum + ? instance.ethereum.request({ method: 'wallet_disconnect' }) + : null // patch the chainChanged event const on = bloctoProvider.on.bind(bloctoProvider) - bloctoProvider.on = (event: string, listener: (arg0: string) => void) => { + bloctoProvider.on = ( + event: string, + listener: (arg0: string) => void + ) => { on(event, (val: any) => { if (event === 'chainChanged') { listener(`0x${(val as number).toString(16)}`) From 819c3a952575d2016949b7b12317bd87ca8ecf58 Mon Sep 17 00:00:00 2001 From: "jimmy.pan" Date: Thu, 15 Jun 2023 03:53:21 +0800 Subject: [PATCH 22/22] docs: blocto Build Environments --- .../docs/[...4]wallets/[...1]blocto/+page.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/src/routes/docs/[...4]wallets/[...1]blocto/+page.md b/docs/src/routes/docs/[...4]wallets/[...1]blocto/+page.md index 7ef063a6f..bb598a2c1 100644 --- a/docs/src/routes/docs/[...4]wallets/[...1]blocto/+page.md +++ b/docs/src/routes/docs/[...4]wallets/[...1]blocto/+page.md @@ -49,3 +49,40 @@ console.log(connectedWallets) ## Build Environments For build env configurations and setups please see the Build Env section [here](/docs/modules/core#build-environments) + +### Webpack 4 + +Node built-ins are automatically bundled in v4 so that portion is handled automatically. + +**Blocto** support will require a Babel to compile from es6 if not already supported. See config for Babel and Webpack4 as follows + +`npm i --save-dev @babel/cli @babel/core @babel/node @babel/plugin-proposal-nullish-coalescing-operator @babel/plugin-proposal-optional-chaining @babel/plugin-syntax-bigint @babel/register` +**AND** +`npm i babel-loader` + +**babel.config.js** + +```javascript +module.exports = (api) => { + api.cache(true) + const plugins = [ + '@babel/plugin-proposal-optional-chaining', + '@babel/plugin-proposal-nullish-coalescing-operator', + '@babel/plugin-syntax-bigint' + ] + return { plugins } +} +``` + +**webpack.config.js** + +```javascript +config.module.rules = [ + ...otherModuleRules, + { + test: /\.js$/, + exclude: (_) => !/node_modules\/(@web3auth|@ethereumjs)/.test(_), + loader: 'babel-loader' + } +] +```