/** * ERC-7750 Opacus Nitro — Decentralized Task Execution * * USE CASE * -------- * An AI agent (or any on-chain service) registers itself and earns USDC/ETH for * completing tasks. A developer integrates this into their dApp so that users * can hire agents without a centralised coordinator. * * Typical flow: * 1. Deployer deploys ERC7750OpacusNitro.sol on their chain. * 2. User calls submitTask(agentAddress, payload, USDC, 100e6) * → 1 USDC goes to Opacus treasury, 99 USDC locked in contract * 3. Agent reads the TaskSubmitted event, does the work off-chain. * 4. Agent calls completeTask(taskId, resultHash) → receives 99 USDC. * 5. If agent ghosts, user calls cancelTask(taskId) → gets 99 USDC back. */ import { ethers } from 'ethers'; export interface NitroTask { submitter: string; agent: string; token: string; grossAmount: bigint; netAmount: bigint; resultHash: string; status: number; createdAt: number; } export interface NitroSubmitOptions { /** ERC-20 token address. Use ethers.ZeroAddress ('0x000...') for ETH */ token: string; /** Gross amount (fee will be deducted automatically by the contract) */ grossAmount: bigint; /** Arbitrary payload for the agent, e.g. JSON task description */ payload: Uint8Array | string; } export declare class NitroClient { private contract; /** * @param address Deployed ERC7750OpacusNitro contract address * @param signerOrProvider Signer for write operations, Provider for reads */ constructor(address: string, signerOrProvider: ethers.Signer | ethers.Provider); /** * Submit a task to a specific agent and lock the payment. * The contract automatically forwards 1% to the Opacus treasury. * * @example * const id = await client.submit('0xAgent...', { * token: USDC_ADDRESS, * grossAmount: 100n * 10n**6n, // 100 USDC gross → agent gets 99 USDC * payload: JSON.stringify({ task: 'summarise', url: '...' }) * }); */ submit(agentAddress: string, opts: NitroSubmitOptions): Promise; /** Complete a task and trigger payment to the agent */ complete(taskId: string, resultHash: string): Promise; /** Cancel a task and get the net amount refunded (before agent completes) */ cancel(taskId: string): Promise; /** Fetch task details */ getTask(taskId: string): Promise; /** Listen for new tasks assigned to a specific agent */ onTask(agentAddress: string, cb: (taskId: string, task: NitroTask) => void): void; } //# sourceMappingURL=ERC7750NitroClient.d.ts.map