From 5aec48b30d25af0e9ec211749c9ca43f9c37de69 Mon Sep 17 00:00:00 2001 From: mmjee Date: Wed, 2 Aug 2023 22:25:04 +0530 Subject: [PATCH 1/8] Arcana Auth SDK support (#1744) --- .circleci/config.yml | 14 +++++ README.md | 1 + docs/package.json | 1 + docs/src/lib/services/onboard.js | 5 ++ .../[...1]introduction/+page.md | 15 ++--- .../docs/[...3]modules/[...1]core/+page.md | 4 +- .../+page.md | 0 .../+page.md | 0 .../+page.md | 0 .../+page.md | 0 .../{[...13]ledger => [...14]ledger}/+page.md | 0 .../{[...14]magic => [...15]magic}/+page.md | 0 .../{[...15]mew => [...16]mew}/+page.md | 0 .../+page.md | 0 .../+page.md | 0 .../{[...18]portis => [...19]portis}/+page.md | 0 .../docs/[...4]wallets/[...1]arcana/+page.md | 59 +++++++++++++++++++ .../{[...19]taho => [...20]taho}/+page.md | 0 .../+page.md | 0 .../{[...21]torus => [...22]torus}/+page.md | 0 .../{[...22]trezor => [...23]trezor}/+page.md | 0 .../{[...23]uauth => [...24]uauth}/+page.md | 0 .../{[...23]venly => [...25]venly}/+page.md | 0 .../+page.md | 0 .../+page.md | 0 .../+page.md | 0 .../{[...27]xdefi => [...29]xdefi}/+page.md | 0 .../{[...1]blocto => [...2]blocto}/+page.md | 0 .../{[...28]zeal => [...30]zeal}/+page.md | 0 .../+page.md | 0 .../{[...3]dcent => [...4]dcent}/+page.md | 0 .../{[...4]enkrypt => [...5]enkrypt}/+page.md | 0 .../+page.md | 0 .../{[...6]frame => [...7]frame}/+page.md | 0 .../+page.md | 0 .../{[...8]gnosis => [...9]gnosis}/+page.md | 0 packages/arcana-auth/README.md | 36 +++++++++++ packages/arcana-auth/package.json | 21 +++++++ packages/arcana-auth/src/icon.ts | 38 ++++++++++++ packages/arcana-auth/src/index.ts | 30 ++++++++++ packages/arcana-auth/tsconfig.json | 15 +++++ packages/demo/package.json | 1 + packages/demo/src/App.svelte | 8 ++- yarn.lock | 19 ++++++ 44 files changed, 257 insertions(+), 10 deletions(-) rename docs/src/routes/docs/[...4]wallets/{[...9]infinitywallet => [...10]infinitywallet}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...10]injected => [...11]injected}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...11]keepkey => [...12]keepkey}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...12]keystone => [...13]keystone}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...13]ledger => [...14]ledger}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...14]magic => [...15]magic}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...15]mew => [...16]mew}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...16]mewwallet => [...17]mewwallet}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...17]phantom => [...18]phantom}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...18]portis => [...19]portis}/+page.md (100%) create mode 100644 docs/src/routes/docs/[...4]wallets/[...1]arcana/+page.md rename docs/src/routes/docs/[...4]wallets/{[...19]taho => [...20]taho}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...20]tallyho => [...21]tallyho}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...21]torus => [...22]torus}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...22]trezor => [...23]trezor}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...23]uauth => [...24]uauth}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...23]venly => [...25]venly}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...24]walletconnect => [...26]walletconnect}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...25]walletlink => [...27]walletlink}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...26]web3auth => [...28]web3auth}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...27]xdefi => [...29]xdefi}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...1]blocto => [...2]blocto}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...28]zeal => [...30]zeal}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...2]coinbase => [...3]coinbase}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...3]dcent => [...4]dcent}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...4]enkrypt => [...5]enkrypt}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...5]fortmatic => [...6]fortmatic}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...6]frame => [...7]frame}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...7]frontier => [...8]frontier}/+page.md (100%) rename docs/src/routes/docs/[...4]wallets/{[...8]gnosis => [...9]gnosis}/+page.md (100%) create mode 100644 packages/arcana-auth/README.md create mode 100644 packages/arcana-auth/package.json create mode 100644 packages/arcana-auth/src/icon.ts create mode 100644 packages/arcana-auth/src/index.ts create mode 100644 packages/arcana-auth/tsconfig.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 93dd73fc8..87a9334c7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -395,6 +395,10 @@ jobs: working_directory: ~/web3-onboard-monorepo/packages/cede-store steps: - node-build-steps + build-arcana-auth: + docker: + - image: cimg/node:16.13.1 + working_directory: ~/web3-onboard-monorepo/packages/arcana-auth build-blocto: docker: - image: cimg/node:16.13.1 @@ -637,6 +641,10 @@ jobs: working_directory: ~/web3-onboard-monorepo/packages/cede-store steps: - node-staging-build-steps + build-staging-arcana-auth: + docker: + - image: cimg/node:16.13.1 + working_directory: ~/web3-onboard-monorepo/packages/arcana-auth build-staging-blocto: docker: - image: cimg/node:16.13.1 @@ -881,6 +889,12 @@ workflows: <<: *deploy_production_filters - build-staging-cede-store: <<: *deploy_staging_filters + arcana-auth: + jobs: + - build-arcana-auth: + <<: *deploy_production_filters + - build-staging-arcana-auth: + <<: *deploy_staging_filters blocto: jobs: - build-blocto: diff --git a/README.md b/README.md index 677acdc62..5f4ed6410 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ For full documentation, check out the README.md for each package or the [docs pa **SDK Wallets** +- [Arcana](packages/arcana-auth/README.md) - [Coinbase](packages/coinbase/README.md) - [Trust](packages/trust/README.md) - [WalletConnect](packages/walletconnect/README.md) diff --git a/docs/package.json b/docs/package.json index 724579674..36f861043 100644 --- a/docs/package.json +++ b/docs/package.json @@ -49,6 +49,7 @@ }, "type": "module", "dependencies": { + "@web3-onboard/arcana-auth": "^2.0.0-alpha.1", "@web3-onboard/blocto": "^2.0.0", "@web3-onboard/cede-store": "^2.1.0-alpha.1", "@web3-onboard/coinbase": "^2.2.5-alpha.1", diff --git a/docs/src/lib/services/onboard.js b/docs/src/lib/services/onboard.js index 811c45ce3..fd34e272f 100644 --- a/docs/src/lib/services/onboard.js +++ b/docs/src/lib/services/onboard.js @@ -53,12 +53,16 @@ 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: arcanaModule } = await import('@web3-onboard/arcana-auth') const { default: bloctoModule } = await import('@web3-onboard/blocto') const { default: venlyModule } = await import('@web3-onboard/venly') const INFURA_ID = '8b60d52405694345a99bcb82e722e0af' const injected = injectedModule() const infinityWallet = infinityWalletModule() + const arcanaWallet = arcanaModule({ + clientID: 'xar_test_c9c3bc702eb13255c58dab0e74cfa859711c13cb' + }) const coinbase = coinbaseModule() const dcent = dcentModule() const walletConnect = walletConnectModule({ @@ -119,6 +123,7 @@ const intiOnboard = async (theme) => { wallets: [ injected, walletConnect, + arcanaWallet, coinbase, ledger, trezor, 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 499d75d21..7de759328 100644 --- a/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md +++ b/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md @@ -148,24 +148,25 @@ We recommend you add the [Core Repo](../../modules/core.md#install) and consider **SDK Wallets** +- [Arcana Auth](../../wallets/arcana.md#install) +- [Blocto](../../docs/wallets/blocto.md#install) - [Coinbase](../../wallets/coinbase.md#install) -- [WalletConnect](../../wallets/walletconnect.md#install) +- [Fortmatic](../../wallets/fortmatic.md#install) +- [Frame](../../wallets/frame.md#install) - [Gnosis](../../wallets/gnosis.md#install) - [Magic](../../wallets/magic.md#login-options) -- [Fortmatic](../../wallets/fortmatic.md#install) - [MEW](../../wallets/mewwallet.md#install) - [Portis](../../wallets/portis.md#install) - [Web3Auth](../../wallets/web3auth.md#install) -- [Frame](../../wallets/frame.md#install) -- [Blocto](../../docs/wallets/blocto.md#install) +- [WalletConnect](../../wallets/walletconnect.md#install) **Hardware Wallets** -- [Ledger](../../wallets/ledger.md#install) -- [Trezor](../../wallets/trezor.md#install) +- [D'cent](../../wallets/dcent.md#install) - [Keystone](../../wallets/keystone.md#install) - [KeepKey](../../wallets/keepkey.md#install) -- [D'cent](../../wallets/dcent.md#install) +- [Ledger](../../wallets/ledger.md#install) +- [Trezor](../../wallets/trezor.md#install) **Frameworks** diff --git a/docs/src/routes/docs/[...3]modules/[...1]core/+page.md b/docs/src/routes/docs/[...3]modules/[...1]core/+page.md index d1ed41801..ae6556ca9 100644 --- a/docs/src/routes/docs/[...3]modules/[...1]core/+page.md +++ b/docs/src/routes/docs/[...3]modules/[...1]core/+page.md @@ -64,14 +64,14 @@ If you would like to support all wallets, then you can install all of the wallet ```sh copy -yarn add @web3-onboard/coinbase @web3-onboard/fortmatic @web3-onboard/gnosis @web3-onboard/injected-wallets @web3-onboard/keepkey @web3-onboard/keystone @web3-onboard/ledger @web3-onboard/magic @web3-onboard/portis @web3-onboard/react @web3-onboard/torus @web3-onboard/trezor @web3-onboard/walletconnect @web3-onboard/web3auth @web3-onboard/dcent @web3-onboard/sequence @web3-onboard/enkrypt @web3-onboard/mew-wallet @web3-onboard/uauth @web3-onboard/zeal @web3-onboard/frontier +yarn add @web3-onboard/coinbase @web3-onboard/fortmatic @web3-onboard/gnosis @web3-onboard/injected-wallets @web3-onboard/arcana-auth @web3-onboard/keepkey @web3-onboard/keystone @web3-onboard/ledger @web3-onboard/magic @web3-onboard/portis @web3-onboard/react @web3-onboard/torus @web3-onboard/trezor @web3-onboard/walletconnect @web3-onboard/web3auth @web3-onboard/dcent @web3-onboard/sequence @web3-onboard/enkrypt @web3-onboard/mew-wallet @web3-onboard/uauth @web3-onboard/zeal @web3-onboard/frontier ``` ```sh copy -npm install @web3-onboard/coinbase @web3-onboard/fortmatic @web3-onboard/gnosis @web3-onboard/injected-wallets @web3-onboard/keepkey @web3-onboard/keystone @web3-onboard/ledger @web3-onboard/magic @web3-onboard/portis @web3-onboard/react @web3-onboard/torus @web3-onboard/trezor @web3-onboard/walletconnect @web3-onboard/web3auth @web3-onboard/dcent @web3-onboard/sequence @web3-onboard/enkrypt @web3-onboard/mew-wallet @web3-onboard/uauth @web3-onboard/zeal @web3-onboard/frontier +npm install @web3-onboard/coinbase @web3-onboard/fortmatic @web3-onboard/gnosis @web3-onboard/injected-wallets @web3-onboard/arcana-auth @web3-onboard/keepkey @web3-onboard/keystone @web3-onboard/ledger @web3-onboard/magic @web3-onboard/portis @web3-onboard/react @web3-onboard/torus @web3-onboard/trezor @web3-onboard/walletconnect @web3-onboard/web3auth @web3-onboard/dcent @web3-onboard/sequence @web3-onboard/enkrypt @web3-onboard/mew-wallet @web3-onboard/uauth @web3-onboard/zeal @web3-onboard/frontier ``` diff --git a/docs/src/routes/docs/[...4]wallets/[...9]infinitywallet/+page.md b/docs/src/routes/docs/[...4]wallets/[...10]infinitywallet/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...9]infinitywallet/+page.md rename to docs/src/routes/docs/[...4]wallets/[...10]infinitywallet/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...10]injected/+page.md b/docs/src/routes/docs/[...4]wallets/[...11]injected/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...10]injected/+page.md rename to docs/src/routes/docs/[...4]wallets/[...11]injected/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...11]keepkey/+page.md b/docs/src/routes/docs/[...4]wallets/[...12]keepkey/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...11]keepkey/+page.md rename to docs/src/routes/docs/[...4]wallets/[...12]keepkey/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...12]keystone/+page.md b/docs/src/routes/docs/[...4]wallets/[...13]keystone/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...12]keystone/+page.md rename to docs/src/routes/docs/[...4]wallets/[...13]keystone/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...13]ledger/+page.md b/docs/src/routes/docs/[...4]wallets/[...14]ledger/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...13]ledger/+page.md rename to docs/src/routes/docs/[...4]wallets/[...14]ledger/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...14]magic/+page.md b/docs/src/routes/docs/[...4]wallets/[...15]magic/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...14]magic/+page.md rename to docs/src/routes/docs/[...4]wallets/[...15]magic/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...15]mew/+page.md b/docs/src/routes/docs/[...4]wallets/[...16]mew/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...15]mew/+page.md rename to docs/src/routes/docs/[...4]wallets/[...16]mew/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...16]mewwallet/+page.md b/docs/src/routes/docs/[...4]wallets/[...17]mewwallet/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...16]mewwallet/+page.md rename to docs/src/routes/docs/[...4]wallets/[...17]mewwallet/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...17]phantom/+page.md b/docs/src/routes/docs/[...4]wallets/[...18]phantom/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...17]phantom/+page.md rename to docs/src/routes/docs/[...4]wallets/[...18]phantom/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...18]portis/+page.md b/docs/src/routes/docs/[...4]wallets/[...19]portis/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...18]portis/+page.md rename to docs/src/routes/docs/[...4]wallets/[...19]portis/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...1]arcana/+page.md b/docs/src/routes/docs/[...4]wallets/[...1]arcana/+page.md new file mode 100644 index 000000000..d516948c3 --- /dev/null +++ b/docs/src/routes/docs/[...4]wallets/[...1]arcana/+page.md @@ -0,0 +1,59 @@ +--- +title: Arcana Auth +--- + +# {$frontmatter.title} + +:::admonition type=warning +To ensure proper functionality of the embedded Arcana wallet in the Arcana Auth SDK, it may be necessary to disable certain other wallets that operate as browser extensions. +::: + +:::admonition type=tip +To enable the Arcana wallet in Web3 apps, developers must register and configure the authentication providers with the [Arcana Network](https://arcana.network) through the [Arcana Dashboard](https://dashboard.arcana.network) and obtain a unique client ID. Install and integrate the Auth SDK with the app using the registered client ID. Use the built-in plug-and-play login feature or plug in any custom UI to onboard users. Once the users authenticate, the Arcana wallet is accessible in the app's context to sign blockchain transactions and perform other Web3 wallet operations. + +For details, see [Quick Start Guide](https://docs.arcana.network/auth-quick-start.html). +::: + +[Web3-Onboard](https://onboard.blocknative.com/) is an open-source, framework-agnostic JavaScript library to onboard users to web3 apps. This package can be used to integrate [Arcana Wallet](https://docs.arcana.network/concepts/anwallet/index.html) support into Web3-Onboard's "Connect Wallet" modal. With this module, the Arcana wallet option will be shown for any app that integrates with the Arcana Auth SDK and uses it to onboard users. There is no need to download any browser extension. For more information on how to use the Arcana Wallet, please refer to the [Arcana Wallet User Guide](https://docs.arcana.network/user-guides/wallet-ui/index.html). + +### Install + + + + +```sh copy +yarn add @web3-onboard/core @web3-onboard/arcana-auth +``` + + + + +```sh copy +npm install @web3-onboard/core @web3-onboard/arcana-auth +``` + + + + +## Usage + +```typescript +import Onboard from '@web3-onboard/core' +import arcanaAuthModule from '@web3-onboard/arcana-auth' + +// initialize the module +const arcanaAuth = arcanaAuthModule({ + clientID: '' +}) + +const onboard = Onboard({ + // ... other Onboard options + wallets: [ + arcanaAuth, + //... other wallets + ] +}) + +const connectedWallets = await onboard.connectWallet() +console.log(connectedWallets) +``` diff --git a/docs/src/routes/docs/[...4]wallets/[...19]taho/+page.md b/docs/src/routes/docs/[...4]wallets/[...20]taho/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...19]taho/+page.md rename to docs/src/routes/docs/[...4]wallets/[...20]taho/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...20]tallyho/+page.md b/docs/src/routes/docs/[...4]wallets/[...21]tallyho/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...20]tallyho/+page.md rename to docs/src/routes/docs/[...4]wallets/[...21]tallyho/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...21]torus/+page.md b/docs/src/routes/docs/[...4]wallets/[...22]torus/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...21]torus/+page.md rename to docs/src/routes/docs/[...4]wallets/[...22]torus/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...22]trezor/+page.md b/docs/src/routes/docs/[...4]wallets/[...23]trezor/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...22]trezor/+page.md rename to docs/src/routes/docs/[...4]wallets/[...23]trezor/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...23]uauth/+page.md b/docs/src/routes/docs/[...4]wallets/[...24]uauth/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...23]uauth/+page.md rename to docs/src/routes/docs/[...4]wallets/[...24]uauth/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...23]venly/+page.md b/docs/src/routes/docs/[...4]wallets/[...25]venly/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...23]venly/+page.md rename to docs/src/routes/docs/[...4]wallets/[...25]venly/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...24]walletconnect/+page.md b/docs/src/routes/docs/[...4]wallets/[...26]walletconnect/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...24]walletconnect/+page.md rename to docs/src/routes/docs/[...4]wallets/[...26]walletconnect/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...25]walletlink/+page.md b/docs/src/routes/docs/[...4]wallets/[...27]walletlink/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...25]walletlink/+page.md rename to docs/src/routes/docs/[...4]wallets/[...27]walletlink/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...26]web3auth/+page.md b/docs/src/routes/docs/[...4]wallets/[...28]web3auth/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...26]web3auth/+page.md rename to docs/src/routes/docs/[...4]wallets/[...28]web3auth/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...27]xdefi/+page.md b/docs/src/routes/docs/[...4]wallets/[...29]xdefi/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...27]xdefi/+page.md rename to docs/src/routes/docs/[...4]wallets/[...29]xdefi/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...1]blocto/+page.md b/docs/src/routes/docs/[...4]wallets/[...2]blocto/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...1]blocto/+page.md rename to docs/src/routes/docs/[...4]wallets/[...2]blocto/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...28]zeal/+page.md b/docs/src/routes/docs/[...4]wallets/[...30]zeal/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...28]zeal/+page.md rename to docs/src/routes/docs/[...4]wallets/[...30]zeal/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...2]coinbase/+page.md b/docs/src/routes/docs/[...4]wallets/[...3]coinbase/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...2]coinbase/+page.md rename to docs/src/routes/docs/[...4]wallets/[...3]coinbase/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...3]dcent/+page.md b/docs/src/routes/docs/[...4]wallets/[...4]dcent/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...3]dcent/+page.md rename to docs/src/routes/docs/[...4]wallets/[...4]dcent/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...4]enkrypt/+page.md b/docs/src/routes/docs/[...4]wallets/[...5]enkrypt/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...4]enkrypt/+page.md rename to docs/src/routes/docs/[...4]wallets/[...5]enkrypt/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...5]fortmatic/+page.md b/docs/src/routes/docs/[...4]wallets/[...6]fortmatic/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...5]fortmatic/+page.md rename to docs/src/routes/docs/[...4]wallets/[...6]fortmatic/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...6]frame/+page.md b/docs/src/routes/docs/[...4]wallets/[...7]frame/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...6]frame/+page.md rename to docs/src/routes/docs/[...4]wallets/[...7]frame/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...7]frontier/+page.md b/docs/src/routes/docs/[...4]wallets/[...8]frontier/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...7]frontier/+page.md rename to docs/src/routes/docs/[...4]wallets/[...8]frontier/+page.md diff --git a/docs/src/routes/docs/[...4]wallets/[...8]gnosis/+page.md b/docs/src/routes/docs/[...4]wallets/[...9]gnosis/+page.md similarity index 100% rename from docs/src/routes/docs/[...4]wallets/[...8]gnosis/+page.md rename to docs/src/routes/docs/[...4]wallets/[...9]gnosis/+page.md diff --git a/packages/arcana-auth/README.md b/packages/arcana-auth/README.md new file mode 100644 index 000000000..ad8e0ad86 --- /dev/null +++ b/packages/arcana-auth/README.md @@ -0,0 +1,36 @@ +# @web3-onboard/arcana-auth + +## Wallet module for connecting Arcana Wallet SDK to web3-onboard + +[Web3-Onboard](https://onboard.blocknative.com/) is an open-source, framework-agnostic JavaScript library to onboard users to web3 apps. This package can be used to integrate [Arcana Wallet](https://docs.arcana.network/concepts/anwallet/index.html) support into Web3-Onboard's "Connect Wallet" modal. With this module, the Arcana wallet option will be shown for any app that integrates with the Arcana Auth SDK and uses it to onboard users. There is no need to download any browser extension. For more information on how to use the Arcana Wallet, please refer to the [Arcana Wallet User Guide](https://docs.arcana.network/user-guides/wallet-ui/index.html). Web3 app developers can refer to the [Arcana Wallet Developer Docs](https://docs.arcana.network/auth-quick-start.html) + +**Note** + +To ensure proper functionality of the embedded Arcana wallet in the Arcana Auth SDK, it may be necessary to disable certain other wallets that operate as browser extensions. + +### Install + +`npm install @web3-onboard/core @web3-onboard/arcana-auth` + +## Usage + +```typescript +import Onboard from '@web3-onboard/core' +import arcanaAuthModule from '@web3-onboard/arcana-auth' + +// initialize the module +const arcanaAuth = arcanaAuthModule({ + clientID: 'xar_test_c9c3bc702eb13255c58dab0e74cfa859711c13cb' +}) + +const onboard = Onboard({ + // ... other Onboard options + wallets: [ + arcanaAuth, + //... other wallets + ] +}) + +const connectedWallets = await onboard.connectWallet() +console.log(connectedWallets) +``` diff --git a/packages/arcana-auth/package.json b/packages/arcana-auth/package.json new file mode 100644 index 000000000..a08d207a0 --- /dev/null +++ b/packages/arcana-auth/package.json @@ -0,0 +1,21 @@ +{ + "name": "@web3-onboard/arcana-auth", + "version": "2.0.0-alpha.1", + "license": "MIT", + "description": "Arcana wallet is a built-in, secure Web3 wallet that users can access instantly when logging into an app integrated with the Arcana Auth SDK. It offers a customizable interface that can be branded to match the app's style. Users don't need to generate or manage cryptographic keys or remember passphrases. The wallet uses advanced distributed key generation, giving users full control over their wallets while onboarding Web3 apps using familiar Web2 authentication methods. It is user-friendly, secure, and puts users in control of their Web3 experience.", + "private": false, + "module": "dist/index.js", + "browser": "dist/index.js", + "main": "dist/index.js", + "scripts": { + "build": "tsc", + "dev": "tsc -w", + "type-check": "tsc --noEmit" + }, + "dependencies": { + "@arcana/auth": "^1.0.6" + }, + "devDependencies": { + "typescript": "^5.1.6" + } +} diff --git a/packages/arcana-auth/src/icon.ts b/packages/arcana-auth/src/icon.ts new file mode 100644 index 000000000..b36ae647d --- /dev/null +++ b/packages/arcana-auth/src/icon.ts @@ -0,0 +1,38 @@ +export default "\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" + +"\n" diff --git a/packages/arcana-auth/src/index.ts b/packages/arcana-auth/src/index.ts new file mode 100644 index 000000000..a37c48536 --- /dev/null +++ b/packages/arcana-auth/src/index.ts @@ -0,0 +1,30 @@ +import { createEIP1193Provider, WalletInit } from '@web3-onboard/common' +import icon from './icon' +import type { ConstructorParams } from '@arcana/auth/types' + +export default function (opts: { + clientID: string + params?: ConstructorParams +}): WalletInit { + return () => ({ + label: 'Arcana Auth', + async getIcon() { + return icon + }, + async getInterface() { + const { AuthProvider } = await import('@arcana/auth') + + const instance = new AuthProvider(opts.clientID, opts.params) + await instance.init() + return new Promise((resolve, reject) => { + instance.provider.once('connect', () => { + resolve({ + provider: createEIP1193Provider(instance.provider), + instance + }) + }) + instance.connect().catch(reject) + }) + } + }) +} diff --git a/packages/arcana-auth/tsconfig.json b/packages/arcana-auth/tsconfig.json new file mode 100644 index 000000000..592d71e8f --- /dev/null +++ b/packages/arcana-auth/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src/**/*"], + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + "declarationDir": "dist", + "paths": { + "*": ["./src/*", "./node_modules/*"] + }, + "typeRoots": ["node_modules/@types"], + "strict": false, + "allowSyntheticDefaultImports": true + } +} diff --git a/packages/demo/package.json b/packages/demo/package.json index 2ece2d750..51988c22a 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -24,6 +24,7 @@ "webpack-dev-server": "4.7.4" }, "dependencies": { + "@web3-onboard/arcana-auth": "^2.0.0-alpha.1", "@web3-onboard/cede-store": "^2.1.0", "@web3-onboard/blocto": "2.0.0", "@web3-onboard/coinbase": "^2.2.5", diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index ab804192d..04227bc3b 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -30,6 +30,7 @@ import frontierModule from '@web3-onboard/frontier' import bloctoModule from '@web3-onboard/blocto' import cedeStoreModule from '@web3-onboard/cede-store' + import arcanaAuthModule from '@web3-onboard/arcana-auth' import venlyModule from '@web3-onboard/venly' import { recoverAddress, @@ -131,6 +132,10 @@ 'DJuUOKvmNnlzy6ruVgeWYWIMKLRyYtjYa9Y10VCeJzWZcygDlrYLyXsBQjpJ2hxlBO9dnl8t9GmAC2qOP5vnIGo' }) + const arcanaAuth = arcanaAuthModule({ + clientID: 'xar_test_c9c3bc702eb13255c58dab0e74cfa859711c13cb' + }) + const torus = torusModule() const infinityWallet = infinityWalletModule() const ledger = ledgerModule({ projectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5' }) @@ -212,6 +217,7 @@ xdefi, frameWallet, cedeStore, + arcanaAuth, blocto, venly ], @@ -247,7 +253,7 @@ id: '0x5', token: 'ETH', label: 'Goerli', - rpcUrl: `https://goerli.infura.io/v3/${infura_key}` + rpcUrl: 'https://ethereum-goerli.publicnode.com' }, { id: '0x13881', diff --git a/yarn.lock b/yarn.lock index 3c02c1c68..ef7fb13e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -154,6 +154,15 @@ resolved "https://registry.yarnpkg.com/@apocentre/alias-sampling/-/alias-sampling-0.5.3.tgz#897ff181b48ad7b2bcb4ecf29400214888244f08" integrity sha512-7UDWIIF9hIeJqfKXkNIzkVandlwLf1FWTSdrb9iXvOP8oF544JRXQjCbiTmCv2c9n44n/FIWtehhBfNuAx2CZA== +"@arcana/auth@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@arcana/auth/-/auth-1.0.3.tgz#10008e95e9c43b5bafaf9a35ae8261c028975619" + integrity sha512-Ab6UoxqlsruzWZ3XPBL8jdfrW2GmU7F4dec7Qic/L6jePQTxjOkSkXqrTnZ8Zo4Ew3A/6r6j/8HcjbgFAyBoBQ== + dependencies: + "@metamask/safe-event-emitter" "^2.0.0" + eth-rpc-errors "^4.0.3" + penpal "^6.0.1" + "@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" @@ -9939,6 +9948,11 @@ penpal@3.0.7: resolved "https://registry.yarnpkg.com/penpal/-/penpal-3.0.7.tgz#d252711ed93b30f1d867eb82342785b3a95f5f75" integrity sha512-WSXiq5HnEvzvY05SHhaXcsviUmCvh4Ze8AiIZzvmdzaaYAAx4rx8c6Xq6+MaVDG/Nfve3VmGD8HyRP3CkPvPbQ== +penpal@^6.0.1: + version "6.2.2" + resolved "https://registry.yarnpkg.com/penpal/-/penpal-6.2.2.tgz#20a0a0592881a959e8c87116d854f9528b1aa601" + integrity sha512-RQD7hTx14/LY7QoS3tQYO3/fzVtwvZI+JeS5udgsu7FPaEDjlvfK9HBcme9/ipzSPKnrxSgacI9PI7154W62YQ== + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -12145,6 +12159,11 @@ typescript@^4.6.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== +typescript@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" + integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== + uint8arrays@^3.0.0, uint8arrays@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-3.1.1.tgz#2d8762acce159ccd9936057572dade9459f65ae0" From c3d99f8eed3e299f6a98a5f322ce73a6032d3fc5 Mon Sep 17 00:00:00 2001 From: Kat Leight <33187102+leightkt@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:07:32 -0600 Subject: [PATCH 2/8] Fix: Aracana Config (#1857) * add steps * build staging steps --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 87a9334c7..1eabe17ca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -399,6 +399,8 @@ jobs: docker: - image: cimg/node:16.13.1 working_directory: ~/web3-onboard-monorepo/packages/arcana-auth + steps: + - node-build-steps build-blocto: docker: - image: cimg/node:16.13.1 @@ -645,6 +647,8 @@ jobs: docker: - image: cimg/node:16.13.1 working_directory: ~/web3-onboard-monorepo/packages/arcana-auth + steps: + - node-staging-build-steps build-staging-blocto: docker: - image: cimg/node:16.13.1 From 170cd0cb1d73577bbd52e7e8ad1f7eed9a337460 Mon Sep 17 00:00:00 2001 From: Kat Leight <33187102+leightkt@users.noreply.github.com> Date: Wed, 2 Aug 2023 12:29:54 -0600 Subject: [PATCH 3/8] update arcana package and yarn (#1858) * update arcana package and yarn * fix spacing in config * try update spacing * reset spacing on config * update ci branch for test * add ts-ignore * reset config to develop * add file extension to icon --------- Co-authored-by: Adam Carpenter --- .circleci/config.yml | 2 +- packages/arcana-auth/package.json | 3 ++- packages/arcana-auth/src/index.ts | 3 ++- yarn.lock | 16 ++++++++-------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1eabe17ca..8e77be428 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -904,7 +904,7 @@ workflows: - build-blocto: <<: *deploy_production_filters - build-staging-blocto: - <<: *deploy_staging_filters + <<: *deploy_staging_filters venly: jobs: - build-venly: diff --git a/packages/arcana-auth/package.json b/packages/arcana-auth/package.json index a08d207a0..2994d19de 100644 --- a/packages/arcana-auth/package.json +++ b/packages/arcana-auth/package.json @@ -13,7 +13,8 @@ "type-check": "tsc --noEmit" }, "dependencies": { - "@arcana/auth": "^1.0.6" + "@arcana/auth": "^1.0.6", + "@web3-onboard/common": "2.3.3" }, "devDependencies": { "typescript": "^5.1.6" diff --git a/packages/arcana-auth/src/index.ts b/packages/arcana-auth/src/index.ts index a37c48536..57be577fd 100644 --- a/packages/arcana-auth/src/index.ts +++ b/packages/arcana-auth/src/index.ts @@ -1,5 +1,5 @@ import { createEIP1193Provider, WalletInit } from '@web3-onboard/common' -import icon from './icon' +import icon from './icon.js' import type { ConstructorParams } from '@arcana/auth/types' export default function (opts: { @@ -17,6 +17,7 @@ export default function (opts: { const instance = new AuthProvider(opts.clientID, opts.params) await instance.init() return new Promise((resolve, reject) => { + // @ts-ignore instance.provider.once('connect', () => { resolve({ provider: createEIP1193Provider(instance.provider), diff --git a/yarn.lock b/yarn.lock index ef7fb13e5..368ef6b3b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -154,10 +154,10 @@ resolved "https://registry.yarnpkg.com/@apocentre/alias-sampling/-/alias-sampling-0.5.3.tgz#897ff181b48ad7b2bcb4ecf29400214888244f08" integrity sha512-7UDWIIF9hIeJqfKXkNIzkVandlwLf1FWTSdrb9iXvOP8oF544JRXQjCbiTmCv2c9n44n/FIWtehhBfNuAx2CZA== -"@arcana/auth@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@arcana/auth/-/auth-1.0.3.tgz#10008e95e9c43b5bafaf9a35ae8261c028975619" - integrity sha512-Ab6UoxqlsruzWZ3XPBL8jdfrW2GmU7F4dec7Qic/L6jePQTxjOkSkXqrTnZ8Zo4Ew3A/6r6j/8HcjbgFAyBoBQ== +"@arcana/auth@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@arcana/auth/-/auth-1.0.6.tgz#6b84a37e600b56c54651634debc11c8a01d3e129" + integrity sha512-wJ/qP6bZcJR/U3YUtGWNF359grRjPoILrRYn4jix7zlguhY34Yc27NFhsDwq7yrgnPQYa4lLz6uOZf0pDOHbgA== dependencies: "@metamask/safe-event-emitter" "^2.0.0" eth-rpc-errors "^4.0.3" @@ -12159,10 +12159,10 @@ typescript@^4.6.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== -typescript@^5.0.4: - version "5.0.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" - integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== +typescript@^5.1.6: + version "5.1.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" + integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== uint8arrays@^3.0.0, uint8arrays@^3.1.0: version "3.1.1" From e851635203854a9bfc21423359abbeb0d5a7fe13 Mon Sep 17 00:00:00 2001 From: mmjee Date: Thu, 3 Aug 2023 19:48:36 +0530 Subject: [PATCH 4/8] Update Arcana Auth SDK version (#1860) --- packages/arcana-auth/package.json | 4 ++-- packages/arcana-auth/src/index.ts | 1 - yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/arcana-auth/package.json b/packages/arcana-auth/package.json index 2994d19de..37c9a6145 100644 --- a/packages/arcana-auth/package.json +++ b/packages/arcana-auth/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/arcana-auth", - "version": "2.0.0-alpha.1", + "version": "2.0.0-alpha.2", "license": "MIT", "description": "Arcana wallet is a built-in, secure Web3 wallet that users can access instantly when logging into an app integrated with the Arcana Auth SDK. It offers a customizable interface that can be branded to match the app's style. Users don't need to generate or manage cryptographic keys or remember passphrases. The wallet uses advanced distributed key generation, giving users full control over their wallets while onboarding Web3 apps using familiar Web2 authentication methods. It is user-friendly, secure, and puts users in control of their Web3 experience.", "private": false, @@ -13,7 +13,7 @@ "type-check": "tsc --noEmit" }, "dependencies": { - "@arcana/auth": "^1.0.6", + "@arcana/auth": "^1.0.7", "@web3-onboard/common": "2.3.3" }, "devDependencies": { diff --git a/packages/arcana-auth/src/index.ts b/packages/arcana-auth/src/index.ts index 57be577fd..9437113ac 100644 --- a/packages/arcana-auth/src/index.ts +++ b/packages/arcana-auth/src/index.ts @@ -17,7 +17,6 @@ export default function (opts: { const instance = new AuthProvider(opts.clientID, opts.params) await instance.init() return new Promise((resolve, reject) => { - // @ts-ignore instance.provider.once('connect', () => { resolve({ provider: createEIP1193Provider(instance.provider), diff --git a/yarn.lock b/yarn.lock index 368ef6b3b..dbd942f83 100644 --- a/yarn.lock +++ b/yarn.lock @@ -154,10 +154,10 @@ resolved "https://registry.yarnpkg.com/@apocentre/alias-sampling/-/alias-sampling-0.5.3.tgz#897ff181b48ad7b2bcb4ecf29400214888244f08" integrity sha512-7UDWIIF9hIeJqfKXkNIzkVandlwLf1FWTSdrb9iXvOP8oF544JRXQjCbiTmCv2c9n44n/FIWtehhBfNuAx2CZA== -"@arcana/auth@^1.0.6": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@arcana/auth/-/auth-1.0.6.tgz#6b84a37e600b56c54651634debc11c8a01d3e129" - integrity sha512-wJ/qP6bZcJR/U3YUtGWNF359grRjPoILrRYn4jix7zlguhY34Yc27NFhsDwq7yrgnPQYa4lLz6uOZf0pDOHbgA== +"@arcana/auth@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@arcana/auth/-/auth-1.0.7.tgz#58ed216b3e7a9cbea4ce64ce638b56f8739003e0" + integrity sha512-QSbVntohr0iTRJ/+FHYulNAC1agooNJXJOotNTnR75hXUMy1w5DNluvxCpEwa0gToyaKWmjqw3zVW4D7UoWtRw== dependencies: "@metamask/safe-event-emitter" "^2.0.0" eth-rpc-errors "^4.0.3" From fc45122b807015b61bc38ef4963d8c06af4439b8 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Thu, 3 Aug 2023 09:58:37 -0600 Subject: [PATCH 5/8] Feat: Add native Base chain support and to all quickstarts (#1859) * Add Base chain to all quickstarts * Bump core package in demo --- README.md | 6 +++++ docs/package.json | 2 +- docs/src/lib/services/onboard.js | 26 +++++++------------ docs/src/routes/+page.md | 6 +++++ .../[...1]introduction/+page.md | 6 +++++ .../[...1]installation/+page.md | 6 +++++ .../docs/[...3]modules/[...1]core/+page.md | 26 +++++++++---------- .../docs/[...3]modules/[...3]react/+page.md | 6 +++++ .../docs/[...3]modules/[...6]vue/+page.md | 6 +++++ .../[...4]wallets/[...11]injected/+page.md | 6 +++++ .../[...26]walletconnect/+page.md | 6 +++++ examples/with-ledger/package.json | 2 +- examples/with-ledger/pages/index.js | 21 +++++---------- examples/with-nextjs-13/package.json | 2 +- examples/with-nextjs/package.json | 2 +- examples/with-nextjs/pages/_app.js | 8 +++++- examples/with-sveltekit/package.json | 2 +- .../with-sveltekit/src/lib/web3-onboard.ts | 8 +++++- examples/with-vanilla-js/package.json | 2 +- examples/with-vanilla-js/src/onboard.js | 6 +++++ examples/with-vite-react/package.json | 2 +- examples/with-vite-react/src/web3-onboard.ts | 18 +++++-------- .../src/components/HelloWorld.vue | 6 +++++ packages/core/README.md | 14 +++++++++- packages/core/package.json | 2 +- packages/core/src/utils.ts | 5 ++++ packages/demo/package.json | 2 +- packages/demo/src/App.svelte | 8 +++++- packages/injected/README.md | 6 +++++ packages/react/README.md | 24 +++++++++++------ packages/react/package.json | 4 +-- packages/vue/README.md | 10 ++++++- packages/vue/package.json | 4 +-- 33 files changed, 178 insertions(+), 82 deletions(-) diff --git a/README.md b/README.md index 5f4ed6410..d6b918ea0 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,12 @@ const onboard = Onboard({ token: 'ETH', label: 'Ethereum Mainnet', rpcUrl: MAINNET_RPC_URL + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ] }) diff --git a/docs/package.json b/docs/package.json index 36f861043..34f0045c5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -53,7 +53,7 @@ "@web3-onboard/blocto": "^2.0.0", "@web3-onboard/cede-store": "^2.1.0-alpha.1", "@web3-onboard/coinbase": "^2.2.5-alpha.1", - "@web3-onboard/core": "^2.20.5-alpha.1", + "@web3-onboard/core": "^2.21.0-alpha.1", "@web3-onboard/dcent": "^2.2.7", "@web3-onboard/enkrypt": "^2.0.4", "@web3-onboard/fortmatic": "^2.0.19", diff --git a/docs/src/lib/services/onboard.js b/docs/src/lib/services/onboard.js index fd34e272f..e60216e5c 100644 --- a/docs/src/lib/services/onboard.js +++ b/docs/src/lib/services/onboard.js @@ -119,7 +119,7 @@ const intiOnboard = async (theme) => { }) return Onboard({ - connect: { autoConnectAllPreviousWallet: true }, + connect: { autoConnectAllPreviousWallet: true }, wallets: [ injected, walletConnect, @@ -177,10 +177,16 @@ const intiOnboard = async (theme) => { rpcUrl: 'https://rpc.sepolia.org/' }, { - id: '0x13881', + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' + }, + { + id: '0x89', token: 'MATIC', - label: 'Polygon - Mumbai', - rpcUrl: 'https://matic-mumbai.chainstacklabs.com' + label: 'Polygon', + rpcUrl: 'https://matic-mainnet.chainstacklabs.com' }, { id: '0x38', @@ -188,12 +194,6 @@ const intiOnboard = async (theme) => { label: 'Binance', rpcUrl: 'https://bsc-dataseed.binance.org/' }, - { - id: '0x89', - token: 'MATIC', - label: 'Polygon', - rpcUrl: 'https://matic-mainnet.chainstacklabs.com' - }, { id: '0xfa', token: 'FTM', @@ -211,12 +211,6 @@ const intiOnboard = async (theme) => { token: 'ARB-ETH', label: 'Arbitrum', rpcUrl: 'https://rpc.ankr.com/arbitrum' - }, - { - id: 84531, - token: 'ETH', - label: 'Base Goerli', - rpcUrl: 'https://goerli.base.org' } ], appMetadata: { diff --git a/docs/src/routes/+page.md b/docs/src/routes/+page.md index 7edd1acb9..8ecc94d75 100644 --- a/docs/src/routes/+page.md +++ b/docs/src/routes/+page.md @@ -117,6 +117,12 @@ const onboard = Onboard({ token: 'ETH', label: 'Ethereum Mainnet', rpcUrl: MAINNET_RPC_URL + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ] }) 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 7de759328..a91abd4b2 100644 --- a/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md +++ b/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md @@ -105,6 +105,12 @@ const onboard = Onboard({ token: 'ETH', label: 'Ethereum Mainnet', rpcUrl: MAINNET_RPC_URL + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ] }) diff --git a/docs/src/routes/docs/[...2]getting-started/[...1]installation/+page.md b/docs/src/routes/docs/[...2]getting-started/[...1]installation/+page.md index 956587cd2..9d0c8bff6 100644 --- a/docs/src/routes/docs/[...2]getting-started/[...1]installation/+page.md +++ b/docs/src/routes/docs/[...2]getting-started/[...1]installation/+page.md @@ -66,6 +66,12 @@ const chains = [ token: 'MATIC', label: 'Matic Mainnet', rpcUrl: 'https://matic-mainnet.chainstacklabs.com' + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ] ``` diff --git a/docs/src/routes/docs/[...3]modules/[...1]core/+page.md b/docs/src/routes/docs/[...3]modules/[...1]core/+page.md index ae6556ca9..9de1946b5 100644 --- a/docs/src/routes/docs/[...3]modules/[...1]core/+page.md +++ b/docs/src/routes/docs/[...3]modules/[...1]core/+page.md @@ -287,7 +287,7 @@ type ConnectModalOptions = { */ removeWhereIsMyWalletWarning?: boolean /** - * Hide the "I don't have a wallet" link displayed + * Hide the "I don't have a wallet" link displayed * on the left panel of the connect modal */ removeIDontHaveAWalletInfoLink?: boolean @@ -633,18 +633,24 @@ const onboard = Onboard({ label: 'Sepolia', rpcUrl: 'https://rpc.sepolia.org/' }, + { + id: '0x89', + token: 'MATIC', + label: 'Matic', + rpcUrl: 'https://matic-mainnet.chainstacklabs.com' + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' + }, { id: '0x38', token: 'BNB', label: 'Binance Smart Chain', rpcUrl: 'https://bsc-dataseed.binance.org/' }, - { - id: '0x89', - token: 'MATIC', - label: 'Matic Mainnet', - rpcUrl: 'https://matic-mainnet.chainstacklabs.com' - }, { id: 10, token: 'OETH', @@ -656,12 +662,6 @@ const onboard = Onboard({ token: 'ARB-ETH', label: 'Arbitrum', rpcUrl: 'https://rpc.ankr.com/arbitrum' - }, - { - id: 84531, - token: 'ETH', - label: 'Base Goerli', - rpcUrl: 'https://goerli.base.org' } ], appMetadata: { diff --git a/docs/src/routes/docs/[...3]modules/[...3]react/+page.md b/docs/src/routes/docs/[...3]modules/[...3]react/+page.md index 2e1067bd8..36fff6d8b 100644 --- a/docs/src/routes/docs/[...3]modules/[...3]react/+page.md +++ b/docs/src/routes/docs/[...3]modules/[...3]react/+page.md @@ -54,6 +54,12 @@ init({ token: 'ETH', label: 'Ethereum Mainnet', rpcUrl + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ] }) diff --git a/docs/src/routes/docs/[...3]modules/[...6]vue/+page.md b/docs/src/routes/docs/[...3]modules/[...6]vue/+page.md index 05828a26d..96239e2bd 100644 --- a/docs/src/routes/docs/[...3]modules/[...6]vue/+page.md +++ b/docs/src/routes/docs/[...3]modules/[...6]vue/+page.md @@ -43,6 +43,12 @@ const web3Onboard = init({ token: 'ETH', label: 'Ethereum Mainnet', rpcUrl + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ] }) diff --git a/docs/src/routes/docs/[...4]wallets/[...11]injected/+page.md b/docs/src/routes/docs/[...4]wallets/[...11]injected/+page.md index e196545ee..83bd4fdc1 100644 --- a/docs/src/routes/docs/[...4]wallets/[...11]injected/+page.md +++ b/docs/src/routes/docs/[...4]wallets/[...11]injected/+page.md @@ -47,6 +47,12 @@ const onboard = Onboard({ token: 'ETH', label: 'Ethereum Mainnet', rpcUrl: MAINNET_RPC_URL + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ], appMetadata: { diff --git a/docs/src/routes/docs/[...4]wallets/[...26]walletconnect/+page.md b/docs/src/routes/docs/[...4]wallets/[...26]walletconnect/+page.md index b154a4c38..f0e738d61 100644 --- a/docs/src/routes/docs/[...4]wallets/[...26]walletconnect/+page.md +++ b/docs/src/routes/docs/[...4]wallets/[...26]walletconnect/+page.md @@ -135,6 +135,12 @@ const onboard = Onboard({ ], chains: [ // chains that are passed as optional chains to WC wallet after cleaning and parsing as number[] + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' + }, { id: '0x89', token: 'MATIC', diff --git a/examples/with-ledger/package.json b/examples/with-ledger/package.json index 6a4ab5482..c4982257e 100644 --- a/examples/with-ledger/package.json +++ b/examples/with-ledger/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@web3-onboard/ledger": "^2.4.3-alpha.1", - "@web3-onboard/react": "^2.6.7-alpha.3", + "@web3-onboard/react": "^2.8.11-alpha.1", "next": "12.2.4", "react": "18.2.0", "react-dom": "18.2.0" diff --git a/examples/with-ledger/pages/index.js b/examples/with-ledger/pages/index.js index c174e0126..a67ad5570 100644 --- a/examples/with-ledger/pages/index.js +++ b/examples/with-ledger/pages/index.js @@ -16,7 +16,6 @@ const buttonStyles = { fontFamily: 'inherit' } - const INFURA__KEY = 'cf540cb0b3b643d399e59aef4f5ac179' const ledger = ledgerModule() @@ -31,16 +30,10 @@ init({ rpcUrl: `https://mainnet.infura.io/v3/${INFURA__KEY}` }, { - id: '0x3', - token: 'tROP', - label: 'Ropsten', - rpcUrl: `https://ropsten.infura.io/v3/${INFURA__KEY}` - }, - { - id: '0x4', - token: 'rETH', - label: 'Rinkeby', - rpcUrl: `https://rinkeby.infura.io/v3/${INFURA__KEY}` + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' }, { id: '0x38', @@ -62,9 +55,9 @@ init({ } ], appMetadata: { - name: "Web3-Onboard Demo", + name: 'Web3-Onboard Demo', icon: 'My App Icon', - description: "A demo of Web3-Onboard with Ledger." + description: 'A demo of Web3-Onboard with Ledger.' }, accountCenter: { desktop: { @@ -75,8 +68,6 @@ init({ } }) - - export default function Home() { const [{ wallet, connecting }, connect, disconnect] = useConnectWallet() diff --git a/examples/with-nextjs-13/package.json b/examples/with-nextjs-13/package.json index 8a6219006..00a063903 100644 --- a/examples/with-nextjs-13/package.json +++ b/examples/with-nextjs-13/package.json @@ -29,7 +29,7 @@ "@web3-onboard/trezor": "^2.4.0", "@web3-onboard/trust": "^2.0.2", "@web3-onboard/walletconnect": "^2.3.6", - "@web3-onboard/react": "^2.8.0", + "@web3-onboard/react": "^2.8.11-alpha.1", "ethers": "^5.7.2", "next": "13.1.6", "react": "18.2.0", diff --git a/examples/with-nextjs/package.json b/examples/with-nextjs/package.json index c427a5938..fbef32e63 100644 --- a/examples/with-nextjs/package.json +++ b/examples/with-nextjs/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@web3-onboard/react": "2.6.7-alpha.3", + "@web3-onboard/react": "2.8.11-alpha.1", "next": "12.2.5", "react": "18.2.0", "react-dom": "18.2.0" diff --git a/examples/with-nextjs/pages/_app.js b/examples/with-nextjs/pages/_app.js index 3e48b2674..6f1824185 100644 --- a/examples/with-nextjs/pages/_app.js +++ b/examples/with-nextjs/pages/_app.js @@ -17,8 +17,14 @@ const polygonMainnet = { label: 'Polygon', rpcUrl: 'https://matic-mainnet.chainstacklabs.com' } +const baseMainnet = { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' +} -const chains = [ethereumRopsten, polygonMainnet] +const chains = [ethereumRopsten, polygonMainnet, baseMainnet] const wallets = [injectedModule()] const web3Onboard = init({ diff --git a/examples/with-sveltekit/package.json b/examples/with-sveltekit/package.json index f74a50464..c2d395257 100644 --- a/examples/with-sveltekit/package.json +++ b/examples/with-sveltekit/package.json @@ -32,7 +32,7 @@ "type": "module", "dependencies": { "@fontsource/fira-mono": "^4.5.10", - "@web3-onboard/core": "^2.17.0", + "@web3-onboard/core": "^2.21.0-alpha.1", "@web3-onboard/injected-wallets": "^2.8.5", "@web3-onboard/walletconnect": "^2.3.6", "buffer": "^6.0.3" diff --git a/examples/with-sveltekit/src/lib/web3-onboard.ts b/examples/with-sveltekit/src/lib/web3-onboard.ts index 34f4ebd2c..5ce8d77bf 100644 --- a/examples/with-sveltekit/src/lib/web3-onboard.ts +++ b/examples/with-sveltekit/src/lib/web3-onboard.ts @@ -7,7 +7,7 @@ const injected = injectedWalletsModule() const walletConnect = walletConnectModule({ connectFirstChainId: true, qrcodeModalOptions: { - mobileLinks: ['rainbow', 'metamask', 'argent', 'trust', 'imtoken', 'pillar'] + mobileLinks: ['rainbow', 'metamask', 'argent', 'trust', 'imtoken', 'pillar'] } }) @@ -27,6 +27,12 @@ const chains = [ token: 'MATIC', label: 'Matic Mainnet', rpcUrl: 'https://matic-mainnet.chainstacklabs.com' + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ] diff --git a/examples/with-vanilla-js/package.json b/examples/with-vanilla-js/package.json index 1651146ef..f470427b4 100644 --- a/examples/with-vanilla-js/package.json +++ b/examples/with-vanilla-js/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@web3-onboard/coinbase": "^2.2.2", - "@web3-onboard/core": "^2.17.0-alpha.2", + "@web3-onboard/core": "^2.21.0-alpha.1", "@web3-onboard/injected-wallets": "^2.8.4", "@web3-onboard/walletconnect": "^2.3.5" } diff --git a/examples/with-vanilla-js/src/onboard.js b/examples/with-vanilla-js/src/onboard.js index bf12f8ee2..9c7c4e030 100644 --- a/examples/with-vanilla-js/src/onboard.js +++ b/examples/with-vanilla-js/src/onboard.js @@ -21,6 +21,12 @@ const chains = [ token: 'MATIC', label: 'Matic Mainnet', rpcUrl: 'https://matic-mainnet.chainstacklabs.com' + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ] diff --git a/examples/with-vite-react/package.json b/examples/with-vite-react/package.json index ac5f57bac..12f05a876 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/mew-wallet": "^2.0.4", "@web3-onboard/portis": "^2.1.4", - "@web3-onboard/react": "^2.8.0", + "@web3-onboard/react": "^2.8.11-alpha.1", "@web3-onboard/sequence": "^2.0.5", "@web3-onboard/taho": "^2.0.5", "@web3-onboard/tallyho": "^2.0.1", diff --git a/examples/with-vite-react/src/web3-onboard.ts b/examples/with-vite-react/src/web3-onboard.ts index 84587cb82..328d01c4b 100644 --- a/examples/with-vite-react/src/web3-onboard.ts +++ b/examples/with-vite-react/src/web3-onboard.ts @@ -114,23 +114,17 @@ export default init({ // used for network requests rpcUrl: `https://mainnet.infura.io/v3/${INFURA_KEY}` }, - { - id: '0x3', - token: 'tROP', - label: 'Ethereum Ropsten Testnet', - rpcUrl: `https://ropsten.infura.io/v3/${INFURA_KEY}` - }, - { - id: '0x4', - token: 'rETH', - label: 'Ethereum Rinkeby Testnet', - rpcUrl: `https://rinkeby.infura.io/v3/${INFURA_KEY}` - }, { id: '0x89', token: 'MATIC', label: 'Matic Mainnet', rpcUrl: 'https://matic-mainnet.chainstacklabs.com' + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ], appMetadata: { diff --git a/examples/with-vuejs-v2/src/components/HelloWorld.vue b/examples/with-vuejs-v2/src/components/HelloWorld.vue index d343da149..9df2db142 100644 --- a/examples/with-vuejs-v2/src/components/HelloWorld.vue +++ b/examples/with-vuejs-v2/src/components/HelloWorld.vue @@ -43,6 +43,12 @@ const web3Onboard = init({ label: 'Ethereum Mainnet', rpcUrl, }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' + } ], }); diff --git a/packages/core/README.md b/packages/core/README.md index 33c862f99..ee5e30996 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -253,7 +253,7 @@ type ConnectModalOptions = { */ removeWhereIsMyWalletWarning?: boolean /** - * Hide the "I don't have a wallet" link displayed + * Hide the "I don't have a wallet" link displayed * on the left panel of the connect modal */ removeIDontHaveAWalletInfoLink?: boolean @@ -578,6 +578,12 @@ const onboard = Onboard({ label: 'Goerli', rpcUrl: ETH_GOERLI_RPC }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' + }, { id: '0x38', token: 'BNB', @@ -865,6 +871,12 @@ const onboard = Onboard({ rpcUrl: `https://mainnet.infura.io/v3/${INFURA_KEY}` || `https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}` + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ] }) diff --git a/packages/core/package.json b/packages/core/package.json index 4b5336b32..f3779f2ea 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/core", - "version": "2.20.5", + "version": "2.21.0-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/utils.ts b/packages/core/src/utils.ts index 66663bc73..a6a696c9f 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -125,6 +125,7 @@ export const chainIdToLabel: Record = { '0x45': 'Optimism Kovan', '0xa86a': 'Avalanche', '0xa4ec': 'Celo', + '0x2105': 'Base', '0x14a33': 'Base Goerli', '0x64': 'Gnosis', '0x63564C40': 'Harmony One', @@ -209,6 +210,10 @@ export const chainStyles: Record = { icon: arbitrumIcon, color: '#33394B' }, + '0x2105': { + icon: baseIcon, + color: '#0259F9' + }, '0x14a33': { icon: baseIcon, color: '#0259F9' diff --git a/packages/demo/package.json b/packages/demo/package.json index 51988c22a..038ce2a37 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -28,7 +28,7 @@ "@web3-onboard/cede-store": "^2.1.0", "@web3-onboard/blocto": "2.0.0", "@web3-onboard/coinbase": "^2.2.5", - "@web3-onboard/core": "^2.20.5", + "@web3-onboard/core": "^2.21.0-alpha.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 04227bc3b..1557da6cf 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -42,7 +42,7 @@ import { share } from 'rxjs/operators' import VConsole from 'vconsole' import blocknativeIcon from './blocknative-icon.js' - import DappAuth from '@blocto/dappauth'; + import DappAuth from '@blocto/dappauth' if (window.innerWidth < 700) { new VConsole() @@ -261,6 +261,12 @@ label: 'Polygon - Mumbai', rpcUrl: 'https://matic-mumbai.chainstacklabs.com ' }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' + }, { id: '0x38', token: 'BNB', diff --git a/packages/injected/README.md b/packages/injected/README.md index f42e4bc92..9421054e0 100644 --- a/packages/injected/README.md +++ b/packages/injected/README.md @@ -20,6 +20,12 @@ const onboard = Onboard({ token: 'ETH', label: 'Ethereum Mainnet', rpcUrl: MAINNET_RPC_URL + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ], appMetadata: { diff --git a/packages/react/README.md b/packages/react/README.md index f4c8239f5..8a6a99b22 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -43,6 +43,12 @@ init({ token: 'ETH', label: 'Ethereum Mainnet', rpcUrl + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ] }) @@ -61,7 +67,10 @@ function App() { return (
-
@@ -72,6 +81,7 @@ export default App ``` ### Using the `Web3OnboardProvider` + You can use the context provider `Web3OnboardProvider` to better manage global state. Simply wrap the provider around your `App` and the initialized web3Onboard instance will be available in all children components. See example below. @@ -95,9 +105,9 @@ const web3Onboard = init({ wallets, chains, appMetadata: { - name: "Web3-Onboard Demo", + name: 'Web3-Onboard Demo', icon: 'App Icon', - description: "A demo of Web3-Onboard." + description: 'A demo of Web3-Onboard.' } }) @@ -165,6 +175,7 @@ const [ ``` + **`setPrimaryWallet`** The primary wallet (first in the list of connected wallets) and primary account (first in the list of connected accounts for a wallet) can be set by using the `setPrimaryWallet` function. The wallet that is set needs to be passed in for the first parameter and if you would like to set the primary account, the address of that account also needs to be passed in: @@ -174,10 +185,7 @@ setPrimaryWallet(wallets[1]) // set the second wallet in the wallets array as the primary wallet // as well as setting the third account in that wallet as the primary account -setPrimaryWallet( - wallets[1], - wallets[1].accounts[2].address -) +setPrimaryWallet(wallets[1], wallets[1].accounts[2].address) ``` ## `useSetChain` @@ -203,7 +211,7 @@ type SetChainOptions = { chainNamespace?: string wallet?: WalletState['label'], // if chain was instantiated without rpcUrl, include here. Used for network requests - rpcUrl?: string, + rpcUrl?: string, // if chain was instantiated without token, include here. Used for display, eg Ethereum Mainnet label?: string, // if chain was instantiated without label, include here. The native token symbol, eg ETH, BNB, MATIC diff --git a/packages/react/package.json b/packages/react/package.json index 1908440c1..e17dc1d48 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/react", - "version": "2.8.10", + "version": "2.8.11-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", @@ -63,7 +63,7 @@ }, "dependencies": { "@web3-onboard/common": "^2.3.3", - "@web3-onboard/core": "^2.20.5", + "@web3-onboard/core": "^2.21.0-alpha.1", "use-sync-external-store": "1.0.0" }, "peerDependencies": { diff --git a/packages/vue/README.md b/packages/vue/README.md index 5d7528698..043966047 100644 --- a/packages/vue/README.md +++ b/packages/vue/README.md @@ -24,7 +24,9 @@ const injected = injectedModule() // Only one RPC endpoint required per chain const rpcAPIKey = '' || '' -const rpcUrl = `https://eth-mainnet.g.alchemy.com/v2/${rpcAPIKey}` || `https://mainnet.infura.io/v3/${rpcAPIKey}` +const rpcUrl = + `https://eth-mainnet.g.alchemy.com/v2/${rpcAPIKey}` || + `https://mainnet.infura.io/v3/${rpcAPIKey}` const web3Onboard = init({ wallets: [injected], @@ -34,6 +36,12 @@ const web3Onboard = init({ token: 'ETH', label: 'Ethereum Mainnet', rpcUrl + }, + { + id: '0x2105', + token: 'ETH', + label: 'Base', + rpcUrl: 'https://mainnet.base.org' } ] }) diff --git a/packages/vue/package.json b/packages/vue/package.json index 261fe05f9..da473cde2 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/vue", - "version": "2.7.9", + "version": "2.7.10-alpha.1", "description": "A collection of Vue Composables for integrating Web3-Onboard in to a Vue or Nuxt project. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", @@ -63,7 +63,7 @@ "@vueuse/core": "^8.4.2", "@vueuse/rxjs": "^8.2.0", "@web3-onboard/common": "^2.3.3", - "@web3-onboard/core": "^2.20.5", + "@web3-onboard/core": "^2.21.0-alpha.1", "vue-demi": "^0.12.4" }, "peerDependencies": { From fb81a1e78d9a6eb1fb1c30be55fcbd895279fded Mon Sep 17 00:00:00 2001 From: Kat Leight <33187102+leightkt@users.noreply.github.com> Date: Thu, 3 Aug 2023 10:21:46 -0600 Subject: [PATCH 6/8] Release 2.24.7 (develop) (#1863) * update arcana/demo packages and root version * add ts-ignore for arcana * update core, react, vue versions --------- Co-authored-by: Adam Carpenter --- examples/with-sveltekit/package.json | 2 +- examples/with-vanilla-js/package.json | 2 +- package.json | 2 +- packages/arcana-auth/package.json | 2 +- packages/arcana-auth/src/index.ts | 1 + packages/core/package.json | 2 +- packages/demo/package.json | 2 +- packages/react/package.json | 4 ++-- packages/vue/package.json | 4 ++-- 9 files changed, 11 insertions(+), 10 deletions(-) diff --git a/examples/with-sveltekit/package.json b/examples/with-sveltekit/package.json index c2d395257..b46608387 100644 --- a/examples/with-sveltekit/package.json +++ b/examples/with-sveltekit/package.json @@ -32,7 +32,7 @@ "type": "module", "dependencies": { "@fontsource/fira-mono": "^4.5.10", - "@web3-onboard/core": "^2.21.0-alpha.1", + "@web3-onboard/core": "^2.21.0", "@web3-onboard/injected-wallets": "^2.8.5", "@web3-onboard/walletconnect": "^2.3.6", "buffer": "^6.0.3" diff --git a/examples/with-vanilla-js/package.json b/examples/with-vanilla-js/package.json index f470427b4..233518368 100644 --- a/examples/with-vanilla-js/package.json +++ b/examples/with-vanilla-js/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@web3-onboard/coinbase": "^2.2.2", - "@web3-onboard/core": "^2.21.0-alpha.1", + "@web3-onboard/core": "^2.21.0", "@web3-onboard/injected-wallets": "^2.8.4", "@web3-onboard/walletconnect": "^2.3.5" } diff --git a/package.json b/package.json index e70283f68..bd6941a9b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "web3-onboard-monorepo", - "version": "2.24.6", + "version": "2.24.7", "private": true, "workspaces": { "packages": [ diff --git a/packages/arcana-auth/package.json b/packages/arcana-auth/package.json index 37c9a6145..d47cf60f3 100644 --- a/packages/arcana-auth/package.json +++ b/packages/arcana-auth/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/arcana-auth", - "version": "2.0.0-alpha.2", + "version": "2.0.0", "license": "MIT", "description": "Arcana wallet is a built-in, secure Web3 wallet that users can access instantly when logging into an app integrated with the Arcana Auth SDK. It offers a customizable interface that can be branded to match the app's style. Users don't need to generate or manage cryptographic keys or remember passphrases. The wallet uses advanced distributed key generation, giving users full control over their wallets while onboarding Web3 apps using familiar Web2 authentication methods. It is user-friendly, secure, and puts users in control of their Web3 experience.", "private": false, diff --git a/packages/arcana-auth/src/index.ts b/packages/arcana-auth/src/index.ts index 9437113ac..57be577fd 100644 --- a/packages/arcana-auth/src/index.ts +++ b/packages/arcana-auth/src/index.ts @@ -17,6 +17,7 @@ export default function (opts: { const instance = new AuthProvider(opts.clientID, opts.params) await instance.init() return new Promise((resolve, reject) => { + // @ts-ignore instance.provider.once('connect', () => { resolve({ provider: createEIP1193Provider(instance.provider), diff --git a/packages/core/package.json b/packages/core/package.json index f3779f2ea..3237e2e34 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/core", - "version": "2.21.0-alpha.1", + "version": "2.21.0", "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 038ce2a37..1346ea252 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -24,7 +24,7 @@ "webpack-dev-server": "4.7.4" }, "dependencies": { - "@web3-onboard/arcana-auth": "^2.0.0-alpha.1", + "@web3-onboard/arcana-auth": "^2.0.0", "@web3-onboard/cede-store": "^2.1.0", "@web3-onboard/blocto": "2.0.0", "@web3-onboard/coinbase": "^2.2.5", diff --git a/packages/react/package.json b/packages/react/package.json index e17dc1d48..07e0315c7 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/react", - "version": "2.8.11-alpha.1", + "version": "2.8.11", "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", @@ -63,7 +63,7 @@ }, "dependencies": { "@web3-onboard/common": "^2.3.3", - "@web3-onboard/core": "^2.21.0-alpha.1", + "@web3-onboard/core": "^2.21.0", "use-sync-external-store": "1.0.0" }, "peerDependencies": { diff --git a/packages/vue/package.json b/packages/vue/package.json index da473cde2..d53dbf701 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/vue", - "version": "2.7.10-alpha.1", + "version": "2.7.10", "description": "A collection of Vue Composables for integrating Web3-Onboard in to a Vue or Nuxt project. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", @@ -63,7 +63,7 @@ "@vueuse/core": "^8.4.2", "@vueuse/rxjs": "^8.2.0", "@web3-onboard/common": "^2.3.3", - "@web3-onboard/core": "^2.21.0-alpha.1", + "@web3-onboard/core": "^2.21.0", "vue-demi": "^0.12.4" }, "peerDependencies": { From 8a88b3a373d95a04cadfa6b5016d7afacdb056cd Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Thu, 3 Aug 2023 10:54:30 -0600 Subject: [PATCH 7/8] Bump WC deps to the latest (#1866) --- packages/demo/package.json | 2 +- packages/walletconnect/package.json | 4 +- yarn.lock | 99 +++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 3 deletions(-) diff --git a/packages/demo/package.json b/packages/demo/package.json index 1346ea252..3071af7fe 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -53,7 +53,7 @@ "@web3-onboard/trust": "^2.0.3", "@web3-onboard/uauth": "^2.1.2", "@web3-onboard/venly": "^2.0.0", - "@web3-onboard/walletconnect": "^2.4.4", + "@web3-onboard/walletconnect": "^2.4.5-alpha.1", "@web3-onboard/web3auth": "^2.2.2", "@web3-onboard/xdefi": "^2.0.3", "@web3-onboard/zeal": "^2.0.3", diff --git a/packages/walletconnect/package.json b/packages/walletconnect/package.json index 50c82c64e..6758cc7bd 100644 --- a/packages/walletconnect/package.json +++ b/packages/walletconnect/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/walletconnect", - "version": "2.4.4", + "version": "2.4.5-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", @@ -61,7 +61,7 @@ "dependencies": { "@ethersproject/providers": "5.5.0", "@walletconnect/client": "^1.8.0", - "@walletconnect/ethereum-provider": "2.9.1", + "@walletconnect/ethereum-provider": "2.9.2", "@walletconnect/modal": "2.6.1", "@walletconnect/qrcode-modal": "^1.8.0", "@web3-onboard/common": "^2.3.3", diff --git a/yarn.lock b/yarn.lock index dbd942f83..10fe46644 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3505,6 +3505,28 @@ lodash.isequal "4.5.0" uint8arrays "^3.1.0" +"@walletconnect/core@2.9.2": + version "2.9.2" + resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.9.2.tgz#c46734ca63771b28fd77606fd521930b7ecfc5e1" + integrity sha512-VARMPAx8sIgodeyngDHbealP3B621PQqjqKsByFUTOep8ZI1/R/20zU+cmq6j9RCrL+kLKZcrZqeVzs8Z7OlqQ== + dependencies: + "@walletconnect/heartbeat" "1.2.1" + "@walletconnect/jsonrpc-provider" "1.0.13" + "@walletconnect/jsonrpc-types" "1.0.3" + "@walletconnect/jsonrpc-utils" "1.0.8" + "@walletconnect/jsonrpc-ws-connection" "1.0.13" + "@walletconnect/keyvaluestorage" "^1.0.2" + "@walletconnect/logger" "^2.0.1" + "@walletconnect/relay-api" "^1.0.9" + "@walletconnect/relay-auth" "^1.0.4" + "@walletconnect/safe-json" "^1.0.2" + "@walletconnect/time" "^1.0.2" + "@walletconnect/types" "2.9.2" + "@walletconnect/utils" "2.9.2" + events "^3.3.0" + lodash.isequal "4.5.0" + uint8arrays "^3.1.0" + "@walletconnect/core@^1.8.0": version "1.8.0" resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-1.8.0.tgz#6b2748b90c999d9d6a70e52e26a8d5e8bfeaa81e" @@ -3560,6 +3582,21 @@ "@walletconnect/utils" "2.9.1" events "^3.3.0" +"@walletconnect/ethereum-provider@2.9.2": + version "2.9.2" + resolved "https://registry.yarnpkg.com/@walletconnect/ethereum-provider/-/ethereum-provider-2.9.2.tgz#fb3a6fca279bb4e98e75baa2fb9730545d41bb99" + integrity sha512-eO1dkhZffV1g7vpG19XUJTw09M/bwGUwwhy1mJ3AOPbOSbMPvwiCuRz2Kbtm1g9B0Jv15Dl+TvJ9vTgYF8zoZg== + dependencies: + "@walletconnect/jsonrpc-http-connection" "^1.0.7" + "@walletconnect/jsonrpc-provider" "^1.0.13" + "@walletconnect/jsonrpc-types" "^1.0.3" + "@walletconnect/jsonrpc-utils" "^1.0.8" + "@walletconnect/sign-client" "2.9.2" + "@walletconnect/types" "2.9.2" + "@walletconnect/universal-provider" "2.9.2" + "@walletconnect/utils" "2.9.2" + events "^3.3.0" + "@walletconnect/events@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@walletconnect/events/-/events-1.0.1.tgz#2b5f9c7202019e229d7ccae1369a9e86bda7816c" @@ -3796,6 +3833,21 @@ "@walletconnect/utils" "2.9.1" events "^3.3.0" +"@walletconnect/sign-client@2.9.2": + version "2.9.2" + resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.9.2.tgz#ff4c81c082c2078878367d07f24bcb20b1f7ab9e" + integrity sha512-anRwnXKlR08lYllFMEarS01hp1gr6Q9XUgvacr749hoaC/AwGVlxYFdM8+MyYr3ozlA+2i599kjbK/mAebqdXg== + dependencies: + "@walletconnect/core" "2.9.2" + "@walletconnect/events" "^1.0.1" + "@walletconnect/heartbeat" "1.2.1" + "@walletconnect/jsonrpc-utils" "1.0.8" + "@walletconnect/logger" "^2.0.1" + "@walletconnect/time" "^1.0.2" + "@walletconnect/types" "2.9.2" + "@walletconnect/utils" "2.9.2" + events "^3.3.0" + "@walletconnect/socket-transport@^1.8.0": version "1.8.0" resolved "https://registry.yarnpkg.com/@walletconnect/socket-transport/-/socket-transport-1.8.0.tgz#9a1128a249628a0be11a0979b522fe82b44afa1b" @@ -3836,6 +3888,18 @@ "@walletconnect/logger" "^2.0.1" events "^3.3.0" +"@walletconnect/types@2.9.2": + version "2.9.2" + resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.9.2.tgz#d5fd5a61dc0f41cbdca59d1885b85207ac7bf8c5" + integrity sha512-7Rdn30amnJEEal4hk83cdwHUuxI1SWQ+K7fFFHBMqkuHLGi3tpMY6kpyfDxnUScYEZXqgRps4Jo5qQgnRqVM7A== + dependencies: + "@walletconnect/events" "^1.0.1" + "@walletconnect/heartbeat" "1.2.1" + "@walletconnect/jsonrpc-types" "1.0.3" + "@walletconnect/keyvaluestorage" "^1.0.2" + "@walletconnect/logger" "^2.0.1" + events "^3.3.0" + "@walletconnect/types@^1.8.0": version "1.8.0" resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-1.8.0.tgz#3f5e85b2d6b149337f727ab8a71b8471d8d9a195" @@ -3880,6 +3944,21 @@ "@walletconnect/utils" "2.9.1" events "^3.3.0" +"@walletconnect/universal-provider@2.9.2": + version "2.9.2" + resolved "https://registry.yarnpkg.com/@walletconnect/universal-provider/-/universal-provider-2.9.2.tgz#40e54e98bc48b1f2f5f77eb5b7f05462093a8506" + integrity sha512-JmaolkO8D31UdRaQCHwlr8uIFUI5BYhBzqYFt54Mc6gbIa1tijGOmdyr6YhhFO70LPmS6gHIjljwOuEllmlrxw== + dependencies: + "@walletconnect/jsonrpc-http-connection" "^1.0.7" + "@walletconnect/jsonrpc-provider" "1.0.13" + "@walletconnect/jsonrpc-types" "^1.0.2" + "@walletconnect/jsonrpc-utils" "^1.0.7" + "@walletconnect/logger" "^2.0.1" + "@walletconnect/sign-client" "2.9.2" + "@walletconnect/types" "2.9.2" + "@walletconnect/utils" "2.9.2" + events "^3.3.0" + "@walletconnect/utils@2.9.1": version "2.9.1" resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.9.1.tgz#92abc24b3af3ead42a3864e019dbf2f651ab2e47" @@ -3900,6 +3979,26 @@ query-string "7.1.3" uint8arrays "^3.1.0" +"@walletconnect/utils@2.9.2": + version "2.9.2" + resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.9.2.tgz#035bdb859ee81a4bcc6420f56114cc5ec3e30afb" + integrity sha512-D44hwXET/8JhhIjqljY6qxSu7xXnlPrf63UN/Qfl98vDjWlYVcDl2+JIQRxD9GPastw0S8XZXdRq59XDXLuZBg== + dependencies: + "@stablelib/chacha20poly1305" "1.0.1" + "@stablelib/hkdf" "1.0.1" + "@stablelib/random" "^1.0.2" + "@stablelib/sha256" "1.0.1" + "@stablelib/x25519" "^1.0.3" + "@walletconnect/relay-api" "^1.0.9" + "@walletconnect/safe-json" "^1.0.2" + "@walletconnect/time" "^1.0.2" + "@walletconnect/types" "2.9.2" + "@walletconnect/window-getters" "^1.0.1" + "@walletconnect/window-metadata" "^1.0.1" + detect-browser "5.3.0" + query-string "7.1.3" + uint8arrays "^3.1.0" + "@walletconnect/utils@^1.8.0": version "1.8.0" resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-1.8.0.tgz#2591a197c1fa7429941fe428876088fda6632060" From b3ab26d66a49ffdca747eba9ea26a1d5ebf40100 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Thu, 3 Aug 2023 11:08:26 -0600 Subject: [PATCH 8/8] Update docs for Base main (#1868) --- .../routes/docs/[...1]overview/[...1]introduction/+page.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 a91abd4b2..1e9c5f15a 100644 --- a/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md +++ b/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md @@ -37,9 +37,7 @@ web3-onboard supports all EVM networks. Supporting a new network is simply a mat - Ethereum - Polygon -- Base Goerli -- Goerli -- Sepolia +- Base - Arbitrum - Optimism - Avalanche @@ -49,6 +47,9 @@ web3-onboard supports all EVM networks. Supporting a new network is simply a mat - Gnosis Chain - Harmony One - Moonriver +- Goerli +- Sepolia +- Base Goerli - All other EVM network ### Optional - Use an API key to fetch real time transaction data, balances & gas