Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish package for particle-auth #178

Merged
merged 5 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/particle-auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 2.0.0 (2023-30-05)

### Features
* particle-auth ([7b8fb1d](https://github.com/bcnmy/biconomy-client-sdk/commit/7b8fb1d05e3cc0196bc15806fa48100701af181e))
37 changes: 37 additions & 0 deletions packages/particle-auth/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# `@biconomy/particle-auth`

> 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();
```
43 changes: 43 additions & 0 deletions packages/particle-auth/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "@biconomy/particle-auth",
"version": "2.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 <chirag@biconomy.io>",
"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"
}
}
10 changes: 10 additions & 0 deletions packages/particle-auth/src/index.ts
Original file line number Diff line number Diff line change
@@ -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
}
14 changes: 14 additions & 0 deletions packages/particle-auth/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../tsconfig.settings.json",
"compilerOptions": {
"composite": true,
"outDir": "dist",
"baseUrl": "src",
"resolveJsonModule": true,
"esModuleInterop": true,
},
"include": [
"src",
"src/**/*.json"
]
}
5 changes: 5 additions & 0 deletions rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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