JavaScript / TypeScript client that lets any web dApp send transactions through the Incentiv Portal.
ethers.js
Signer
so you can keep the rest of your code unchanged.IncentivSigner
→ works anywhere an ethers.Signer
is expectedIncentivResolver
→ low‑level helper if you don’t use ethersIncentivResolver
and IncentivSigner
rely on window.open
and postMessage
, therefore they must run in a browser context (NodeJS & SSR are not supported).
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. |
signMessage
andsignTransaction
are intentionally unsupported – signing happens inside the Portal UI.