From 7b8fb1d05e3cc0196bc15806fa48100701af181e Mon Sep 17 00:00:00 2001 From: amanraj1608 Date: Tue, 30 May 2023 15:15:27 +0530 Subject: [PATCH 1/3] feat: particle auth integration --- packages/particle-auth/CHANGELOG.md | 3 ++ packages/particle-auth/README.md | 37 ++++++++++++++++++++++++ packages/particle-auth/package.json | 43 ++++++++++++++++++++++++++++ packages/particle-auth/src/index.ts | 10 +++++++ packages/particle-auth/tsconfig.json | 14 +++++++++ rebuild.sh | 5 ++++ 6 files changed, 112 insertions(+) create mode 100644 packages/particle-auth/CHANGELOG.md create mode 100644 packages/particle-auth/README.md create mode 100644 packages/particle-auth/package.json create mode 100644 packages/particle-auth/src/index.ts create mode 100644 packages/particle-auth/tsconfig.json diff --git a/packages/particle-auth/CHANGELOG.md b/packages/particle-auth/CHANGELOG.md new file mode 100644 index 000000000..c443c8f96 --- /dev/null +++ b/packages/particle-auth/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 (2023-30-05) + +### Features diff --git a/packages/particle-auth/README.md b/packages/particle-auth/README.md new file mode 100644 index 000000000..35c33ad8c --- /dev/null +++ b/packages/particle-auth/README.md @@ -0,0 +1,37 @@ +# `@biconomy/transak` + +> A library to import the particle-auth for web directly from [Biconomy SDK](https://github.com/bcnmy/biconomy-client-sdk) + +## Usage + +```ts +import { ParticleNetwork, WalletEntryPosition } from "@particle-network/auth"; +import { ParticleProvider } from "@particle-network/provider"; +import Web3 from "web3"; + +const particle = new ParticleNetwork({ + projectId: "xx", + clientKey: "xx", + appId: "xx", + chainName: "Ethereum", //optional: current chain name, default Ethereum. + chainId: 1, //optional: current chain id, default 1. + wallet: { //optional: by default, the wallet entry is displayed in the bottom right corner of the webpage. + displayWalletEntry: true, //show wallet entry when connect particle. + defaultWalletEntryPosition: WalletEntryPosition.BR, //wallet entry position + uiMode: "dark", //optional: light or dark, if not set, the default is the same as web auth. + supportChains: [{ id: 1, name: "Ethereum"}, { id: 5, name: "Ethereum"}], // optional: web wallet support chains. + customStyle: {}, //optional: custom wallet style + } +}); + +const particleProvider = new ParticleProvider(particle.auth); + +//if you use web3.js +window.web3 = new Web3(particleProvider); +window.web3.currentProvider.isParticleNetwork // => true + +//if you use ethers.js +import { ethers } from "ethers"; +const ethersProvider = new ethers.providers.Web3Provider(particleProvider, "any"); +const ethersSigner = ethersProvider.getSigner(); +``` diff --git a/packages/particle-auth/package.json b/packages/particle-auth/package.json new file mode 100644 index 000000000..b2e5f5749 --- /dev/null +++ b/packages/particle-auth/package.json @@ -0,0 +1,43 @@ +{ + "name": "@biconomy/particle-auth", + "version": "1.0.0", + "description": "particle auth for biconomy sdk", + "main": "./dist/src/index.js", + "typings": "./dist/src/index.d.ts", + "keywords": [ + "legos", + "batching", + "one-click", + "cross-chain", + "particle", + "particle-auth" + ], + "author": "livingrockrises ", + "homepage": "https://github.com/bcnmy/biconomy-client-sdk#readme", + "license": "MIT", + "files": [ + "dist/*", + "README.md" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/bcnmy/biconomy-client-sdk.git" + }, + "scripts": { + "unbuild": "rimraf dist *.tsbuildinfo", + "build": "rimraf dist && tsc", + "format": "prettier --write \"{src,tests}/**/*.ts\"", + "lint": "tslint -p tsconfig.json" + }, + "bugs": { + "url": "https://github.com/bcnmy/biconomy-client-sdk/issues" + }, + "publishConfig": { + "access": "public" + }, + "dependencies": { + "@particle-network/auth": "^0.13.1", + "@particle-network/biconomy": "^0.1.0", + "@particle-network/provider": "^0.13.1" + } +} diff --git a/packages/particle-auth/src/index.ts b/packages/particle-auth/src/index.ts new file mode 100644 index 000000000..fd073876e --- /dev/null +++ b/packages/particle-auth/src/index.ts @@ -0,0 +1,10 @@ +import * as ParticleAuth from '@particle-network/auth' +import * as BiconomyAccount from '@particle-network/biconomy' +import { ParticleProvider, ParticleDelegateProvider } from '@particle-network/provider' + +export { + ParticleAuth as ParticleAuthModule, + BiconomyAccount as BiconomyAccountModule, + ParticleProvider, + ParticleDelegateProvider +} diff --git a/packages/particle-auth/tsconfig.json b/packages/particle-auth/tsconfig.json new file mode 100644 index 000000000..2a945f000 --- /dev/null +++ b/packages/particle-auth/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "composite": true, + "outDir": "dist", + "baseUrl": "src", + "resolveJsonModule": true, + "esModuleInterop": true, + }, + "include": [ + "src", + "src/**/*.json" + ] +} \ No newline at end of file diff --git a/rebuild.sh b/rebuild.sh index f0a33f933..7c33601eb 100755 --- a/rebuild.sh +++ b/rebuild.sh @@ -54,6 +54,11 @@ rm -rf packages/transak/yarn.lock rm -rf packages/transak/package-lock.json rm -rf packages/transak/dist +rm -rf packages/particle-auth/node_modules +rm -rf packages/particle-auth/yarn.lock +rm -rf packages/particle-auth/package-lock.json +rm -rf packages/particle-auth/dist + #npx lerna bootstrap --force-local #npm run build #npm link \ No newline at end of file From 0a63ff17bb38b1bc2fd68669b74c2efd5a959d31 Mon Sep 17 00:00:00 2001 From: amanraj1608 Date: Tue, 30 May 2023 15:37:17 +0530 Subject: [PATCH 2/3] fix: typo --- packages/particle-auth/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/particle-auth/README.md b/packages/particle-auth/README.md index 35c33ad8c..b167b8bdc 100644 --- a/packages/particle-auth/README.md +++ b/packages/particle-auth/README.md @@ -1,4 +1,4 @@ -# `@biconomy/transak` +# `@biconomy/particle-auth` > A library to import the particle-auth for web directly from [Biconomy SDK](https://github.com/bcnmy/biconomy-client-sdk) From 9d58397789ae95239f7d02415d12322365075186 Mon Sep 17 00:00:00 2001 From: livingrockrises <90545960+livingrockrises@users.noreply.github.com> Date: Tue, 30 May 2023 21:26:46 +0530 Subject: [PATCH 3/3] chore: finalise package version for publishing particle-auth --- packages/particle-auth/CHANGELOG.md | 3 ++- packages/particle-auth/package.json | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/particle-auth/CHANGELOG.md b/packages/particle-auth/CHANGELOG.md index c443c8f96..78955d2d1 100644 --- a/packages/particle-auth/CHANGELOG.md +++ b/packages/particle-auth/CHANGELOG.md @@ -1,3 +1,4 @@ -## 1.0.0 (2023-30-05) +## 2.0.0 (2023-30-05) ### Features +* particle-auth ([7b8fb1d](https://github.com/bcnmy/biconomy-client-sdk/commit/7b8fb1d05e3cc0196bc15806fa48100701af181e)) diff --git a/packages/particle-auth/package.json b/packages/particle-auth/package.json index b2e5f5749..ab1111594 100644 --- a/packages/particle-auth/package.json +++ b/packages/particle-auth/package.json @@ -1,7 +1,7 @@ { "name": "@biconomy/particle-auth", - "version": "1.0.0", - "description": "particle auth for biconomy sdk", + "version": "2.0.0", + "description": "Particle auth for Biconomy SDK", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts", "keywords": [