Skip to content
Open
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
19 changes: 11 additions & 8 deletions docs/pages/permissionless/how-to/signers/particle-network.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,30 @@ import SmartAccounts from "./smartAccounts.mdx"

# How to use a Particle Network signer with permissionless.js

[Particle Network](https://particle.network/) is an intent-centric, modular wallet-as-a-service (WaaS). By utilizing MPC-TSS for key management, Particle can streamline onboarding via familiar Web2 methods such as Google, emails, and phone numbers.
[Particle Network](https://particle.network) provides Wallet Abstraction services that simplify user onboarding.

By combining permissionless.js with Particle, you can use Particle to enable a smooth social login experience, while using ZeroDev as the smart wallet to sponsor gas for users, batch transactions, and more.
The [Particle Auth SDK](https://developers.particle.network/api-reference/auth/desktop-sdks/web) offers seamless 2-click onboarding using social logins, powered by MPC-TSS. It allows users to quickly sign up using familiar Web2 options like Google, email, or phone numbers.

## Setup
For a streamlined social login experience, you can combine Particle with permissionless.js while leveraging any smart account; as Particle acts as a signer. This setup enables features like gas fee sponsorship, transaction batching, and more, further enhancing the user experience within your application.

## Setup

To use Particle Network with permissionless.js, first create an application that integrates with Particle Network.

- Refer to the [Particle Network documentation site](https://docs.particle.network/) for instructions on setting up an application with the Particle Network.
- For a quick start, Particle Network provides a guide, available [here](https://docs.particle.network/getting-started/get-started).
- Follow the Quickstart on the [Particle docs](https://developers.particle.network/guides/wallet-as-a-service/waas/auth/web-quickstart) to quickly spin up a Particle Auth project.

## Integration

Integrating permissionless.js with Particle Network is straightforward after setting up the project. Particle Network provides an Externally Owned Account (EOA) wallet to use as a signer with permissionless.js accounts.

### Create the Particle Network object
After following the Particle Network documentation, you will have access to a `ParticleProvider` object as shown below that you can pass as an owner to `createeSmartAccountClient`:
### Initialize the Particle Network Object

After setting up your Particle Auth project, you’ll have access to a `provider` object via the `useEthereum()` hook, as shown below. You can then pass this `provider` as the owner parameter when initializing `createSmartAccountClient`:

```typescript
// [!include ~/snippets/signers/particle-network.ts:main]
```

### Use with permissionless.js

<SmartAccounts />
<SmartAccounts />
17 changes: 6 additions & 11 deletions docs/snippets/signers/particle-network.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
// [!region main]
import { ParticleNetwork } from "@particle-network/auth"
import { ParticleProvider } from "@particle-network/provider"
import { useEthereum } from "@particle-network/authkit";

// Param options here will be specific to your project. See the Particle docs for more info.
const particle = new ParticleNetwork({
projectId,
clientKey,
appId,
chainName,
chainId,
})
const smartAccountOwner = new ParticleProvider(particle.auth)
// Inside your component or app function
const { provider } = useEthereum();

// Assign provider to smartAccountOwner
const smartAccountOwner = provider;
// [!endregion main]