-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
init commit for wallet services plugin
- Loading branch information
Showing
13 changed files
with
1,506 additions
and
861 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
packages/plugins/wallet-services-connector-plugin/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Web3Auth Wallet Services Connector Plugin | ||
|
||
[![npm version](https://img.shields.io/npm/v/@web3auth/torus-wallet-connector-plugin?label=%22%22)](https://www.npmjs.com/package/@web3auth/torus-wallet-connector-plugin/v/latest) | ||
[![minzip](https://img.shields.io/bundlephobia/minzip/@web3auth/torus-wallet-connector-plugin?label=%22%22)](https://bundlephobia.com/result?p=@web3auth/torus-wallet-connector-plugin@latest) | ||
|
||
> Web3Auth is where passwordless auth meets non-custodial key infrastructure for Web3 apps and wallets. By aggregating OAuth (Google, Twitter, Discord) logins, different wallets and innovative Multi Party Computation (MPC) - Web3Auth provides a seamless login experience to every user on your application. | ||
Web3Auth Torus Wallet Connector Plugin helps you get the functionalities of the Torus Wallet into your Web3Auth Instance. It helps you use your Web3Auth key in the Torus Wallet, making it easier for your end user to make transactions, add money into their wallet and even use it across different applications using Torus Wallet. | ||
|
||
## 📖 Documentation | ||
|
||
Read more about the Web3Auth Torus Wallet Connector Plugin in the [official Web3Auth Documentation](https://web3auth.io/docs/sdk/web/plugins/torus-wallet). | ||
|
||
## 💡 Features | ||
- Plug and Play, OAuth based Web3 Authentication Service | ||
- Fully decentralized, non-custodial key infrastructure | ||
- End to end Whitelabelable solution | ||
- Threshold Cryptography based Key Reconstruction | ||
- Multi Factor Authentication Setup & Recovery (Includes password, backup phrase, device factor editing/deletion etc) | ||
- Support for WebAuthn & Passwordless Login | ||
- Support for connecting to multiple wallets | ||
- DApp Active Session Management | ||
|
||
...and a lot more | ||
|
||
## 🔗 Installation | ||
|
||
```shell | ||
npm i --save @web3auth/torus-wallet-connector-plugin | ||
``` | ||
|
||
## 🩹 Example | ||
|
||
Checkout the examples for your preferred blockchain and platform in our [examples repository](https://github.com/Web3Auth/examples/) | ||
|
||
## 🌐 Demo | ||
|
||
Checkout the [Web3Auth Demo](https://demo-app.web3auth.io/) to see how Web3Auth can be used in your application. | ||
|
||
## 💬 Troubleshooting and Support | ||
|
||
- Have a look at our [Community Portal](https://community.web3auth.io/) to see if anyone has any questions or issues you might be having. Feel free to reate new topics and we'll help you out as soon as possible. | ||
- Checkout our [Troubleshooting Documentation Page](https://web3auth.io/docs/troubleshooting) to know the common issues and solutions. | ||
- For Priority Support, please have a look at our [Pricing Page](https://web3auth.io/pricing.html) for the plan that suits your needs. |
68 changes: 68 additions & 0 deletions
68
packages/plugins/wallet-services-connector-plugin/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"name": "@web3auth/wallet-services-connector-plugin", | ||
"version": "7.2.1", | ||
"description": "Wallet services connector for which can be used with Web3Auth or private key providers used inside Web3Auth", | ||
"keywords": [ | ||
"web3Auth/wallet-services-connector-plugin", | ||
"web3Auth", | ||
"multichainWallet", | ||
"blockchain", | ||
"ethereum", | ||
"metamask" | ||
], | ||
"main": "dist/walletServicesConnectorPlugin.cjs.js", | ||
"module": "dist/walletServicesConnectorPlugin.esm.js", | ||
"unpkg": "dist/walletServicesConnectorPlugin.umd.min.js", | ||
"jsdelivr": "dist/walletServicesConnectorPlugin.umd.min.js", | ||
"types": "dist/types/index.d.ts", | ||
"author": "Torus Labs", | ||
"homepage": "https://github.com/Web3Auth/Web3Auth/tree/master/packages/plugins/wallet-services-connector-plugin#readme", | ||
"license": "ISC", | ||
"scripts": { | ||
"test": "mocha --config ../../../.mocharc.json test/**.ts", | ||
"test-debugger": "mocha --config ../../../.mocharc.json --inspect-brk test/**.ts", | ||
"dev": "torus-scripts start", | ||
"build": "torus-scripts build", | ||
"lint": "eslint --fix 'src/**/*.ts'", | ||
"prepack": "npm run build", | ||
"pre-commit": "lint-staged --cwd ." | ||
}, | ||
"files": [ | ||
"dist", | ||
"src" | ||
], | ||
"devDependencies": { | ||
"@metamask/rpc-errors": "^6.1.0" | ||
}, | ||
"dependencies": { | ||
"@web3auth/ws-embed": "../../../../wallet-services/packages/ws-embed", | ||
"@web3auth/base": "^7.2.1", | ||
"@web3auth/base-plugin": "^7.2.1", | ||
"@web3auth/no-modal": "^7.2.1", | ||
"@web3auth/openlogin-adapter": "^7.2.1", | ||
"loglevel": "^1.8.1" | ||
}, | ||
"peerDependencies": { | ||
"@babel/runtime": "^7.x" | ||
}, | ||
"lint-staged": { | ||
"!(*d).ts": [ | ||
"eslint --cache --fix", | ||
"prettier --write" | ||
] | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Web3Auth/Web3Auth.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/Web3Auth/Web3Auth/issues" | ||
}, | ||
"engines": { | ||
"node": ">=18.x", | ||
"npm": ">=9.x" | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
packages/plugins/wallet-services-connector-plugin/src/errors.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { ErrorCodes, IWeb3AuthError, Web3AuthError } from "@web3auth/base"; | ||
|
||
export class WalletServicesPluginError extends Web3AuthError { | ||
protected static messages: ErrorCodes = { | ||
5210: "Wallet Services Plugin is not initialized", | ||
5211: "Web3Auth is connected to unsupported adapter. Wallet services connector plugin requires web3auth connected to openlogin adapter.", | ||
5212: "Provider is required..", | ||
5213: "Web3Auth instance is required while initialization.", | ||
5214: "Web3Auth is not connected.", | ||
5215: "UserInfo is required.", | ||
5216: "Plugin is already initialized", | ||
5217: "Wallet services instance is not set.", | ||
}; | ||
|
||
public constructor(code: number, message?: string) { | ||
// takes care of stack and proto | ||
super(code, message); | ||
|
||
// Set name explicitly as minification can mangle class names | ||
Object.defineProperty(this, "name", { value: "WalletServicesPluginError" }); | ||
} | ||
|
||
public static fromCode(code: number, extraMessage = ""): IWeb3AuthError { | ||
return new WalletServicesPluginError(code, `${WalletServicesPluginError.messages[code]}${extraMessage}`); | ||
} | ||
|
||
public static notInitialized(extraMessage = ""): IWeb3AuthError { | ||
return WalletServicesPluginError.fromCode(5210, extraMessage); | ||
} | ||
|
||
public static unsupportedAdapter(extraMessage = ""): IWeb3AuthError { | ||
return WalletServicesPluginError.fromCode(5211, extraMessage); | ||
} | ||
|
||
public static providerRequired(extraMessage = ""): IWeb3AuthError { | ||
return WalletServicesPluginError.fromCode(5212, extraMessage); | ||
} | ||
|
||
public static web3authRequired(extraMessage = ""): IWeb3AuthError { | ||
return WalletServicesPluginError.fromCode(5213, extraMessage); | ||
} | ||
|
||
public static web3AuthNotConnected(extraMessage = ""): IWeb3AuthError { | ||
return WalletServicesPluginError.fromCode(5214, extraMessage); | ||
} | ||
|
||
public static userInfoRequired(extraMessage = ""): IWeb3AuthError { | ||
return WalletServicesPluginError.fromCode(5215, extraMessage); | ||
} | ||
|
||
public static alreadyInitialized(extraMessage = ""): IWeb3AuthError { | ||
return WalletServicesPluginError.fromCode(5216, extraMessage); | ||
} | ||
|
||
public static torusWalletNotSet(extraMessage = ""): IWeb3AuthError { | ||
return WalletServicesPluginError.fromCode(5217, extraMessage); | ||
} | ||
|
||
public static unsupportedChainNamespace(extraMessage = ""): IWeb3AuthError { | ||
return WalletServicesPluginError.fromCode(5218, extraMessage); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./plugin"; |
Oops, something went wrong.