Incentiv uses a proprietary signing flow that lives inside the Incentiv Portal. Trying to reproduce that logic inside your dApp would be brittle, insecure, and would violate the user‑experience guidelines of the network. The Incentiv dApp SDK solves this by:
- Opening a secure pop‑up in the Incentiv Portal when you need the user to sign.
- Submitting the resulting UserOperation on your behalf.
- Returning the UserOperation hash so that you can track it afterwards.
- Providing a drop‑in
ethers.jsSignerso you can keep the rest of your code unchanged.
Features
- Zero private‑key handling in your site – users sign inside the Portal
IncentivSigner→ works anywhere anethers.Signeris expectedIncentivResolver→ low‑level helper if you don’t use ethers- Supports Staging, Testnet & Mainnet (or any custom Portal URL)
- Ships with TypeScript types
Installation
ethers v5.x only for now
Quick start
Browser‑only
IncentivResolver and IncentivSigner rely on window.open and postMessage, therefore they must run in a browser context (NodeJS & SSR are not supported).
API Reference
enum IncentivEnvironment
| Variant | URL |
|---|---|
| Staging | https://staging.incentiv.net |
| Testnet | https://testnet.incentiv.net |
| Mainnet | https://incentiv.net |
class IncentivResolver
| Method | Description |
|---|---|
static getAccountAddress(environment) | Opens the Portal pop‑up with intent CONNECT. Resolves with the user’s account address. |
constructor(environment) | Creates a resolver bound to a specific Portal URL. |
sendTransaction(tx: TransactionRequest) | Opens the Portal pop‑up with intent CALL, waits for the signature & submission, then resolves with the UserOperation hash. |
getPortalUrl() | Returns the Portal URL the resolver is bound to. |
class IncentivSigner extends ethers.Signer
| Method | Notes |
|---|---|
getAccountAddress() | Same as the static resolver call but also stores the address internally. |
sendTransaction(tx) | Returns a TransactionResponse‑like object whose .hash is the UserOperation hash. The .wait() method is not implemented yet. |
connect(provider) | Returns a new signer instance bound to the given provider. |
setAccountAddress(address) | Manually set / override the account address. |
signMessageandsignTransactionare intentionally unsupported – signing happens inside the Portal UI.