This guide shows you how to register the HyperAuth payment service worker and submit payments from a user’s smart account. Payments are signed locally in the signer worker and submitted directly to the Pimlico bundler — no server proxy is required.Documentation Index
Fetch the complete documentation index at: https://docs.hyperauth.dev/llms.txt
Use this file to discover all available pages before exploring further.
Register the payment handler
Register the payment service worker once during app initialisation, before any payment flow. This enables the browser’s Payment Request API to discover HyperAuth as a payment method.registerPaymentHandler registers the service worker at /pay/sw.js with scope /pay/ and the payment method URL https://did.run/pay. Override any of these if your deployment differs:
registerPaymentHandler returns { success: false, error: 'Service workers not supported' } rather than throwing.
Submit a payment
submitPayment builds and signs an ERC-4337 UserOperation that transfers tokens to the recipient, submits it to the bundler, and returns the user operation hash and an explorer URL.
The vault must be unlocked to sign the payment. Signing happens inside the Dedicated Worker running enclave.wasm; the signed operation is then submitted directly to the Pimlico bundler endpoint.
label field is optional and for your own record-keeping only.
Supported chains
The explorer URL is automatically set based onchainId:
| Chain ID | Explorer |
|---|---|
8453 | basescan.org |
84532 | sepolia.basescan.org |
1 | etherscan.io |
Error handling
submitPayment throws a PluginCallError if signing fails (e.g. vault is locked) or if the bundler rejects the operation.
submitPayment does not wait for on-chain confirmation. To wait for the UserOp to be included in a block, use waitForReceipt with the returned userOpHash: