diff --git a/LICENSE b/LICENSE index 5f66e7c63..fd45cca8f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ -Copyright Web3Auth Inc. 2023. All rights reserved. +Copyright Torus Labs Private Limited 2023. All rights reserved. -You acknowledge and agree that Web3Auth Inc. (Web3Auth) (or Web3Auth's licensors) own all legal rights, titles and interests in and to the work, software, application, source code, documentation and any other documents in this repository (collectively, the β€œProgram”), including any intellectual property rights which subsist in the Program (whether those rights happen to be registered or not, and wherever in the world those rights may exist), whether in source code or any other form. +You acknowledge and agree that Torus Labs Private Limited (Web3Auth) (or Web3Auth's licensors) own all legal rights, titles and interests in and to the work, software, application, source code, documentation and any other documents in this repository (collectively, the β€œProgram”), including any intellectual property rights which subsist in the Program (whether those rights happen to be registered or not, and wherever in the world those rights may exist), whether in source code or any other form. Subject to the limited license below, you may not (and you may not permit anyone else to) distribute, publish, copy, modify, merge, combine with another program, create derivative works of, reverse engineer, decompile or otherwise attempt to extract the source code of, the Program or any part thereof, except that you may contribute to this repository. diff --git a/README.md b/README.md index 34c78aed8..f91b05051 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Checkout the official [Web3Auth Documentation](https://web3auth.io/docs) and [SD - Support for connecting to multiple wallets - DApp Active Session Management -...and a lot more + ...and a lot more ## πŸ’­ Choosing Between SDKs @@ -75,29 +75,33 @@ await web3auth.connect(); ## πŸ“¦ Packages within this repository -| Packages | `@latest` Version | Size | Description | -| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 🏠 **No-Modal** | -| `@web3auth/no-modal` | [![npm version](https://img.shields.io/npm/v/@web3auth/no-modal?label=%22%22)](https://www.npmjs.com/package/@web3auth/no-modal/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/no-modal?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/no-modal@latest) | Provides the core logic for handling adapters within web3auth. This package acts as a manager for all the adapters. You should use this package to build your custom login UI on top of web3auth. | -| `@web3auth/modal` | [![npm version](https://img.shields.io/npm/v/@web3auth/modal?label=%22%22)](https://www.npmjs.com/package/@web3auth/modal/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/modal?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/modal@latest) | Provides the main class for using default web3auth modal. It inherits `@web3auth/no-modal` package. So you can still call all the functions available in the `@web3auth/no-modal` api reference. The package includes all of our packages and gives you a simple way of implementing Web3Auth within your interface. | -| πŸ”Œ **Adapters** | -| `@web3auth/coinbase-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/coinbase-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/coinbase-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/coinbase-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/coinbase-adapter@latest) | Adds coinbase login functionality | -| `@web3auth/metamask-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/metamask-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/metamask-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/metamask-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/metamask-adapter@latest) | Adds metamask chrome extension login functionality | -| `@web3auth/openlogin-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/openlogin-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/openlogin-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/openlogin-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/openlogin-adapter@latest) | Adds social logins with MFA functionality | -| `@web3auth/phantom-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/phantom-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/phantom-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/phantom-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/phantom-adapter@latest) | Adds phantom chrome extension login functionality | -| `@web3auth/torus-evm-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/torus-evm-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/torus-evm-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/torus-evm-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/torus-evm-adapter@latest) | Adds Torus Wallet login functionality (https://app.tor.us) | -| `@web3auth/torus-solana-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/torus-solana-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/torus-solana-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/torus-solana-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/torus-solana-adapter@latest) | Adds Solana Torus Wallet login functionality (https://solana.tor.us) | -| `@web3auth/wallet-connect-v2-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/wallet-connect-v2-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/wallet-connect-v2-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/wallet-connect-v2-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/wallet-connect-v2-adapter@latest) | Adds wallet connect v2 login functionality + all supported adapters (eg: Metamask mobile, rainbow etc.) | -| πŸ‰ **Providers** | -| `@web3auth/base-provider` | [![npm version](https://img.shields.io/npm/v/@web3auth/base-provider?label=%22%22)](https://www.npmjs.com/package/@web3auth/base-provider/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/base-provider?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/base-provider@latest) | Base implementation of JRPC provider | -| `@web3auth/ethereum-provider` | [![npm version](https://img.shields.io/npm/v/@web3auth/ethereum-provider?label=%22%22)](https://www.npmjs.com/package/@web3auth/ethereum-provider/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/ethereum-provider?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/ethereum-provider@latest) | EIP-1193 compatible JRPC provider | -| `@web3auth/solana-provider` | [![npm version](https://img.shields.io/npm/v/@web3auth/solana-provider?label=%22%22)](https://www.npmjs.com/package/@web3auth/solana-provider/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/solana-provider?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/solana-provider@latest) | Solana chain compatible JRPC provider | -| πŸ‰ **Plugins** | | -| `@web3auth/wallet-services-plugin` | [![npm version](https://img.shields.io/npm/v/@web3auth/wallet-services-plugin?label=%22%22)](https://www.npmjs.com/package/@web3auth/wallet-services-plugin/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/wallet-services-plugin?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/wallet-services-plugin@latest) | Allows to inject your web3auth scoped private key into Wallet Services UI | -| `@web3auth/solana-wallet-connector-plugin` | [![npm version](https://img.shields.io/npm/v/@web3auth/solana-wallet-connector-plugin?label=%22%22)](https://www.npmjs.com/package/@web3auth/solana-wallet-connector-plugin/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/solana-wallet-connector-plugin?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/solana-wallet-connector-plugin@latest) | Allows to inject your web3auth scoped private key into torus solana wallet UI (https://solana.tor.us) | -| πŸ‰ **Low-Level** | -| `@web3auth/base` | [![npm version](https://img.shields.io/npm/v/@web3auth/base?label=%22%22)](https://www.npmjs.com/package/@web3auth/base/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/base?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/base@latest) | Base reusable functionalities for creating a web3auth instance | -| `@web3auth/ui` | [![npm version](https://img.shields.io/npm/v/@web3auth/ui?label=%22%22)](https://www.npmjs.com/package/@web3auth/ui/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/ui?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/ui@latest) | Provides the UI used for creating the modal | +| Packages | `@latest` Version | Size | Description | +| ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 🏠 **PnP Web** | +| `@web3auth/no-modal` | [![npm version](https://img.shields.io/npm/v/@web3auth/no-modal?label=%22%22)](https://www.npmjs.com/package/@web3auth/no-modal/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/no-modal?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/no-modal@latest) | Provides the core logic for handling adapters within web3auth. This package acts as a manager for all the adapters. You should use this package to build your custom login UI on top of web3auth. | +| `@web3auth/modal` | [![npm version](https://img.shields.io/npm/v/@web3auth/modal?label=%22%22)](https://www.npmjs.com/package/@web3auth/modal/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/modal?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/modal@latest) | Provides the main class for using default web3auth modal. It inherits `@web3auth/no-modal` package. So you can still call all the functions available in the `@web3auth/no-modal` api reference. The package includes all of our packages and gives you a simple way of implementing Web3Auth within your interface. | +| πŸͺ **PnP Web Hooks** | +| `@web3auth/modal-react-hooks` | [![npm version](https://img.shields.io/npm/v/@web3auth/modal-react-hooks?label=%22%22)](https://www.npmjs.com/package/@web3auth/modal-react-hooks/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/modal-react-hooks?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/modal-react-hooks@latest) | Provides React hooks for easy integration of Web3Auth Modal in React applications. Simplifies state management and Web3Auth interactions within React components. | +| `@web3auth/no-modal-react-hooks` | [![npm version](https://img.shields.io/npm/v/@web3auth/no-modal-react-hooks?label=%22%22)](https://www.npmjs.com/package/@web3auth/no-modal-react-hooks/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/no-modal-react-hooks?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/no-modal-react-hooks@latest) | Provides React hooks for integrating Web3Auth No Modal SDK in React applications. Offers flexibility for custom UI implementations while simplifying Web3Auth state management and interactions. | +| πŸ”Œ **Adapters** | +| `@web3auth/coinbase-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/coinbase-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/coinbase-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/coinbase-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/coinbase-adapter@latest) | Adds coinbase login functionality | +| `@web3auth/metamask-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/metamask-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/metamask-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/metamask-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/metamask-adapter@latest) | Adds metamask chrome extension login functionality | +| `@web3auth/openlogin-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/openlogin-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/openlogin-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/openlogin-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/openlogin-adapter@latest) | Adds social logins with MFA functionality | +| `@web3auth/phantom-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/phantom-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/phantom-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/phantom-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/phantom-adapter@latest) | Adds phantom chrome extension login functionality | +| `@web3auth/torus-evm-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/torus-evm-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/torus-evm-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/torus-evm-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/torus-evm-adapter@latest) | Adds Torus Wallet login functionality (https://app.tor.us) | +| `@web3auth/torus-solana-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/torus-solana-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/torus-solana-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/torus-solana-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/torus-solana-adapter@latest) | Adds Solana Torus Wallet login functionality (https://solana.tor.us) | +| `@web3auth/wallet-connect-v2-adapter` | [![npm version](https://img.shields.io/npm/v/@web3auth/wallet-connect-v2-adapter?label=%22%22)](https://www.npmjs.com/package/@web3auth/wallet-connect-v2-adapter/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/wallet-connect-v2-adapter?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/wallet-connect-v2-adapter@latest) | Adds wallet connect v2 login functionality + all supported adapters (eg: Metamask mobile, rainbow etc.) | +| πŸ‰ **Providers** | +| `@web3auth/base-provider` | [![npm version](https://img.shields.io/npm/v/@web3auth/base-provider?label=%22%22)](https://www.npmjs.com/package/@web3auth/base-provider/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/base-provider?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/base-provider@latest) | Base implementation of JRPC provider | +| `@web3auth/ethereum-provider` | [![npm version](https://img.shields.io/npm/v/@web3auth/ethereum-provider?label=%22%22)](https://www.npmjs.com/package/@web3auth/ethereum-provider/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/ethereum-provider?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/ethereum-provider@latest) | EIP-1193 compatible JRPC provider | +| `@web3auth/solana-provider` | [![npm version](https://img.shields.io/npm/v/@web3auth/solana-provider?label=%22%22)](https://www.npmjs.com/package/@web3auth/solana-provider/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/solana-provider?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/solana-provider@latest) | Solana chain compatible JRPC provider | +| πŸ‰ **Plugins** | | +| `@web3auth/wallet-services-plugin` | [![npm version](https://img.shields.io/npm/v/@web3auth/wallet-services-plugin?label=%22%22)](https://www.npmjs.com/package/@web3auth/wallet-services-plugin/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/wallet-services-plugin?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/wallet-services-plugin@latest) | Allows to inject your web3auth scoped private key into Wallet Services UI | +| `@web3auth/wallet-services-plugin-react-hooks` | [![npm version](https://img.shields.io/npm/v/@web3auth/wallet-services-plugin-react-hooks?label=%22%22)](https://www.npmjs.com/package/@web3auth/wallet-services-plugin-react-hooks/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/wallet-services-plugin-react-hooks?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/wallet-services-plugin-react-hooks@latest) | Allows to inject your web3auth scoped private key into Wallet Services UI | +| `@web3auth/solana-wallet-connector-plugin` | [![npm version](https://img.shields.io/npm/v/@web3auth/solana-wallet-connector-plugin?label=%22%22)](https://www.npmjs.com/package/@web3auth/solana-wallet-connector-plugin/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/solana-wallet-connector-plugin?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/solana-wallet-connector-plugin@latest) | Allows to inject your web3auth scoped private key into torus solana wallet UI (https://solana.tor.us) | +| πŸ‰ **Low-Level** | +| `@web3auth/base` | [![npm version](https://img.shields.io/npm/v/@web3auth/base?label=%22%22)](https://www.npmjs.com/package/@web3auth/base/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/base?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/base@latest) | Base reusable functionalities for creating a web3auth instance | +| `@web3auth/ui` | [![npm version](https://img.shields.io/npm/v/@web3auth/ui?label=%22%22)](https://www.npmjs.com/package/@web3auth/ui/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/ui?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/ui@latest) | Provides the UI used for creating the modal | ## βͺ Requirements diff --git a/packages/modal/src/modalManager.ts b/packages/modal/src/modalManager.ts index a50e861ac..3fb65e3b4 100644 --- a/packages/modal/src/modalManager.ts +++ b/packages/modal/src/modalManager.ts @@ -52,7 +52,7 @@ export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal { readonly options: Web3AuthOptions; - private modalConfig: AdaptersModalConfig = defaultOtherModalConfig; + private modalConfig: AdaptersModalConfig = clonedeep(defaultOtherModalConfig); constructor(options: Web3AuthOptions) { super(options);