Skip to content

Commit

Permalink
migrate: web3auth to particle.network (#106)
Browse files Browse the repository at this point in the history
* fixes/meta/seo

* repository page ui fixed

* initial commit

* feat: add header to notification

* feat: add notification avatars

* feat: add notification data

* feat: update Notification

* feat: update notification page

add notification component

* fix : bug fixed

* style: pretty code

by ci

* settings Ui Done

* settings Ui Done

* fix/dashboard

* style: pretty code

by ci

* nvmrc:

Signed-off-by: Nasfame <[email protected]>

Took 7 minutes

* notification ui error fixed

* dashboard ui fixed

* style: pretty code

by ci

* fixed zoom error

* style: pretty code

by ci

* error fixed

* style: pretty code

by ci

* peer dep issue

* style: pretty code

by ci

---------

Signed-off-by: Nasfame <[email protected]>
Co-authored-by: Raji Roqeeb Olalekan <[email protected]>
Co-authored-by: sheriff Oladimeji <[email protected]>
Co-authored-by: Sheriff-Oladimeji <[email protected]>
Co-authored-by: Codebox124 <[email protected]>
Co-authored-by: Nasfame <[email protected]>
Co-authored-by: techyNonso <[email protected]>
Co-authored-by: Nasfame <[email protected]>
  • Loading branch information
8 people authored Nov 3, 2023
1 parent b213b62 commit 6a6f14c
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
### Description
- [x] Resolves <!-- Type '#' and issues will show up -->

- [x] Resolves <!-- Type '#' and issues will show up -->

### Checklist

- [x] I have followed the repository's contribution guidelines.
- [x] I have added necessary documentation or updated existing documentation.
- [x] My code follows the established code style and formatting of the project.
Expand Down
1 change: 1 addition & 0 deletions decs.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
declare module 'web3.storage'
declare module '@particle-network/auth'
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"@jest/globals": "^29.7.0",
"@lighthouse-web3/sdk": "^0.2.8",
"@nextui-org/react": "^2.1.13",
"@particle-network/auth": "^1.2.2",
"@particle-network/chains": "^1.3.0",
"@particle-network/provider": "^1.2.1",
"@prisma/client": "^5.5.2",
"@rainbow-me/rainbowkit": "^1.1.1",
"@types/node": "20.6.2",
Expand Down
82 changes: 82 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/app/dashboard/repository/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default function Page() {
<span className="text-xs border border-primary_11 px-3 mt-4 py-1 rounded-full">
Feature Extraction
</span>

</div>
</div>

Expand Down Expand Up @@ -155,6 +156,7 @@ export default function Page() {
</div>
</div>
</div>

</DashLayout>
)
}
43 changes: 43 additions & 0 deletions src/lib/particle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { ParticleNetwork, WalletEntryPosition } from '@particle-network/auth'
import { ParticleProvider } from '@particle-network/provider'
// import { SolanaWallet } from '@particle-network/solana-wallet'
import { Ethereum } from '@particle-network/chains'

const particle = new ParticleNetwork({
projectId: `${process.env.NEXT_PUBLIC_PROJECT_ID}`,
clientKey: `${process.env.NEXT_PUBLIC_CLIENT_KEY}`,
appId: `${process.env.NEXT_PUBLIC_APP_ID}`,
chainName: Ethereum.name, //optional: current chain name, default Ethereum.
chainId: Ethereum.id, //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
},
securityAccount: {
//optional: particle security account config
//prompt set payment password. 0: None, 1: Once(default), 2: Always
promptSettingWhenSign: 1,
//prompt set master password. 0: None(default), 1: Once, 2: Always
promptMasterPasswordSettingWhenLogin: 1,
},
})

const particleProvider = new ParticleProvider(particle.auth)
//if you need support solana chain
//const solanaWallet = new SolanaWallet(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.JsonRpcProvider(`${particleProvider}`) // new ethers.Jproviders.Web3Provider(particleProvider, 'any')
const ethersSigner = ethersProvider.getSigner()

0 comments on commit 6a6f14c

Please sign in to comment.