import { Address, Hash, Hex, ContractFunctionReturnType, TransactionReceipt, ContractFunctionArgs } from 'viem'; type NetworkName = "arc-testnet" | "arc-mainnet" | "base-sepolia" | "base-mainnet"; /** * The chain's native (gas) token. * * This is the one place Arc and Base genuinely diverge for callers: on Arc, * USDC *is* the native token, so a wallet holding only USDC can transact. On * Base, USDC is an ordinary ERC-20 and gas is paid in ETH - an agent or human * funded only with USDC will fail at the first transaction. Anything that * tells a user what to fund their wallet with must branch on `isUsdc` rather * than assume Arc's model. */ type NativeCurrency = { symbol: string; decimals: number; /** True when the native gas token is USDC itself (Arc), false when gas is a separate asset (Base: ETH). */ isUsdc: boolean; }; /** * Product branding for this network's deployment. * * The Base deployment ships under its own name (BaseBounty / basebounty.app), * separate from the Arc one (ArcBounty / arcbounty.app) - "Arc" reads as a * competing chain to a Base audience. This is one codebase and one npm * package serving both; only the user-facing name differs, so anything that * renders a product name must read it from here rather than hardcode one. */ type Brand = { name: string; domain: string; }; type NetworkConfig = { chainId: number; name: string; /** CAIP-2 identifier (`eip155:`), e.g. for x402 network fields. */ caip2: string; rpcUrl: string; explorerUrl: string; explorerApiUrl: string; /** Explorer's display name, e.g. for wallet "view on …" links. */ explorerName: string; nativeCurrency: NativeCurrency; brand: Brand; contracts: { AGENTIC_COMMERCE: Address; IDENTITY_REGISTRY: Address; REPUTATION_REGISTRY: Address; USDC: Address; }; /** Canonical BountyAdapter for this network (see contracts/DEPLOYMENTS.md). * Explicit `bountyAdapterAddress` / `BOUNTY_ADAPTER_ADDRESS` still win. */ defaultBountyAdapter?: Address; /** Block the canonical adapter was deployed at - lower bound for log scans. */ adapterDeployBlock?: number; testnet: boolean; /** Rough estimate for "last N days" style block math (≈1s/block on Arc, ≈2s on Base). */ blocksPerDay: number; }; /** * Statically known networks - all four, since Arc mainnet opened on * 2026-09-16 (parameters: https://docs.arc.io/arc/references/rpc-endpoints). * * Never hardcode guessed values here - an entry exists only once every * address in it has been confirmed on-chain. */ declare const NETWORKS: { readonly "arc-testnet": { readonly chainId: 5042002; readonly name: "Arc Testnet"; readonly caip2: "eip155:5042002"; readonly rpcUrl: "https://rpc.testnet.arc.io"; readonly explorerUrl: "https://testnet.arcscan.app"; readonly explorerApiUrl: "https://testnet.arcscan.app/api"; readonly explorerName: "ArcScan"; readonly nativeCurrency: { readonly symbol: "USDC"; readonly decimals: 18; readonly isUsdc: true; }; readonly brand: { readonly name: "ArcBounty"; readonly domain: "testnet.arcbounty.app"; }; readonly contracts: { readonly AGENTIC_COMMERCE: "0x0747EEf0706327138c69792bF28Cd525089e4583"; readonly IDENTITY_REGISTRY: "0x8004A818BFB912233c491871b3d84c89A494BD9e"; readonly REPUTATION_REGISTRY: "0x8004B663056A597Dffe9eCcC1965A193B7388713"; readonly USDC: "0x3600000000000000000000000000000000000000"; }; readonly defaultBountyAdapter: "0xeDf2c738915b042da97788b2b5499D4655FB1f20"; readonly adapterDeployBlock: 60965136; readonly testnet: true; readonly blocksPerDay: 86400; }; readonly "arc-mainnet": { readonly chainId: 5042; readonly name: "Arc"; readonly caip2: "eip155:5042"; readonly rpcUrl: "https://rpc.blockdaemon.mainnet.arc.io"; readonly explorerUrl: "https://explorer.arc.io"; readonly explorerApiUrl: "https://explorer.arc.io/api"; readonly explorerName: "Arc Explorer"; readonly nativeCurrency: { readonly symbol: "USDC"; readonly decimals: 18; readonly isUsdc: true; }; readonly brand: { readonly name: "ArcBounty"; readonly domain: "arcbounty.app"; }; readonly contracts: { readonly AGENTIC_COMMERCE: "0x64cA39Fc57315D0D488acCaC07c37C6E841CD058"; readonly IDENTITY_REGISTRY: "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432"; readonly REPUTATION_REGISTRY: "0x8004BAa17C55a88189AE136b182e5fdA19dE9b63"; readonly USDC: "0x3600000000000000000000000000000000000000"; }; readonly defaultBountyAdapter: "0x73c617e808ED5c7Ca41413DFC6EE940dDcBb0b8D"; readonly adapterDeployBlock: 21153190; readonly testnet: false; readonly blocksPerDay: 170000; }; readonly "base-sepolia": { readonly chainId: 84532; readonly name: "Base Sepolia"; readonly caip2: "eip155:84532"; readonly rpcUrl: "https://sepolia.base.org"; readonly explorerUrl: "https://sepolia.basescan.org"; readonly explorerApiUrl: "https://api.etherscan.io/v2/api?chainid=84532"; readonly explorerName: "Basescan"; readonly nativeCurrency: { readonly symbol: "ETH"; readonly decimals: 18; readonly isUsdc: false; }; readonly brand: { readonly name: "BaseBounty"; readonly domain: "basebounty.app"; }; readonly contracts: { readonly AGENTIC_COMMERCE: "0xbe6e78207140d21d5FcF5595Ad396e482f1Cd384"; readonly IDENTITY_REGISTRY: "0x8004A818BFB912233c491871b3d84c89A494BD9e"; readonly REPUTATION_REGISTRY: "0x8004B663056A597Dffe9eCcC1965A193B7388713"; readonly USDC: "0x036CbD53842c5426634e7929541eC2318f3dCF7e"; }; readonly defaultBountyAdapter: "0x32EC90A4dad0bbdFF0eF44461c353aC5C02757F4"; readonly adapterDeployBlock: 45438882; readonly testnet: true; readonly blocksPerDay: 43200; }; readonly "base-mainnet": { readonly chainId: 8453; readonly name: "Base"; readonly caip2: "eip155:8453"; readonly rpcUrl: "https://mainnet.base.org"; readonly explorerUrl: "https://basescan.org"; readonly explorerApiUrl: "https://base.blockscout.com/api"; readonly explorerName: "Basescan"; readonly nativeCurrency: { readonly symbol: "ETH"; readonly decimals: 18; readonly isUsdc: false; }; readonly brand: { readonly name: "BaseBounty"; readonly domain: "basebounty.app"; }; readonly contracts: { readonly AGENTIC_COMMERCE: "0x6D9317eC0Fca3aFd5439d539064DBA94197c4AC4"; readonly IDENTITY_REGISTRY: "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432"; readonly REPUTATION_REGISTRY: "0x8004BAa17C55a88189AE136b182e5fdA19dE9b63"; readonly USDC: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"; }; readonly defaultBountyAdapter: "0x32c215908a46Eb5D34e4E5146c99891eD3014Fee"; readonly adapterDeployBlock: 51898559; readonly testnet: false; readonly blocksPerDay: 43200; }; }; type Env = Record; /** * Resolve a network name into a concrete {@link NetworkConfig}: a copy of the * static {@link NETWORKS} entry, with that network's own RPC override applied * if set. Each network reads only its own variable, so a testnet RPC left in * a long-lived `.env` never reaches a mainnet run: * * - `"arc-testnet"` → `ARC_RPC_URL`, matching pre-0.5 behavior. * - `"arc-mainnet"` → `ARC_MAINNET_RPC_URL`. The default (Blockdaemon) serves * the 10,000-block log ranges the SDK scans; an override must too. * - `"base-sepolia"` → `BASE_SEPOLIA_RPC_URL` - the public `sepolia.base.org` * node is rate limited, so a dedicated RPC is expected in CI and e2e runs. * - `"base-mainnet"` → `BASE_MAINNET_RPC_URL`; the public `mainnet.base.org` * node is rate limited and also load-balanced, so reads issued immediately * after a receipt can hit a lagging node. * * @param env Environment map to read from (defaults to `process.env`) - * injectable for tests and non-Node runtimes. */ declare function resolveNetwork(name: NetworkName, env?: Env): NetworkConfig; /** @deprecated Use `NETWORKS["arc-testnet"].rpcUrl` or `resolveNetwork(name).rpcUrl`. */ declare const ARC_TESTNET_RPC: "https://rpc.testnet.arc.io"; /** @deprecated Use `NETWORKS["arc-testnet"].chainId` or `resolveNetwork(name).chainId`. */ declare const ARC_TESTNET_CHAIN_ID: 5042002; /** @deprecated Use `NETWORKS["arc-testnet"].contracts` or `resolveNetwork(name).contracts`. */ declare const CONTRACTS: { readonly AGENTIC_COMMERCE: "0x0747EEf0706327138c69792bF28Cd525089e4583"; readonly IDENTITY_REGISTRY: "0x8004A818BFB912233c491871b3d84c89A494BD9e"; readonly REPUTATION_REGISTRY: "0x8004B663056A597Dffe9eCcC1965A193B7388713"; readonly USDC: "0x3600000000000000000000000000000000000000"; }; declare const MIN_BOND_BOUNTY_DURATION_SEC: bigint; declare const MIN_BOND_TAKE_WINDOW_SEC: bigint; type MonadNetworkName = "monad-mainnet" | "monad-testnet"; /** * One Monad network for {@link NadBountyAgent}. Gas is MON (18 decimals) and * USDC is an ordinary 6-decimal ERC-20, as on Base. */ type MonadNetworkConfig = { chainId: number; rpcUrl: string; explorerUrl: string; /** Canonical ERC-8004 identity registry (deployed by the 8004 team, not by NadBounty). */ identity: Address; /** Canonical ERC-8004 reputation registry. */ reputation: Address; usdc: Address; /** The site pin route used by `pinTextAuto` / `NadBountyAgent.pin` for this network. */ pinUrl: string; /** * Built-in NadBounty V4.8 adapter. Absent means no stable deployment is * published for this network: pass `bountyAdapterAddress` explicitly. */ defaultBountyAdapter?: Address; /** ERC-8183 escrow (proxy) behind the canonical adapter. */ agenticCommerce?: Address; /** Cross-chain reputation snapshots (Base and Arc paid jobs) read by the adapter's gates. */ reputationMirror?: Address; /** Permissionless settlement runner used by the keeper. */ keeperReceiver?: Address; /** Safe that owns the adapter, acts as arbitrator and receives the 1% fee. */ safe?: Address; }; /** * Monad networks known to the SDK. Mainnet carries the canonical deployment, so * `new NadBountyAgent({ network: "monad-mainnet" })` needs no address. Testnet * stays explicit-address only: its deployment is paused and may be replaced. * * Public RPC caveat: `rpc.monad.xyz` caps `eth_getLogs` at 100 blocks, so the * SDK never relies on wide log queries. */ declare const MONAD_NETWORKS: Readonly>>; /** Canonical Multicall3, deployed at the same address on both Monad networks (checked on chain). */ declare const MONAD_MULTICALL3: Address; /** Smallest reward the adapter accepts: 1 USDC in 6-decimal base units. */ declare const NAD_MIN_REWARD = 1000000n; /** Categories the adapter accepts (anything else reverts "invalid category"). */ declare const NAD_CATEGORIES: readonly ["dev", "design", "content", "data", "other"]; type NadCategory = (typeof NAD_CATEGORIES)[number]; type CircleWalletConfig = { /** Circle API key (Circle Console → Testnet/Mainnet → API Keys → API Key, Standard). */ apiKey: string; /** Registered entity secret - see docs/circle-wallet.md. Controls every wallet under this API key. */ entitySecret: string; /** Circle wallet ID (from `createWallets`/`listWallets`), not the on-chain address. */ walletId: string; /** The wallet's on-chain address - fetch once via `getWallet({ id })` and store it; avoids an extra round-trip on every agent startup. */ address: Address; /** * The chain id this Circle wallet is provisioned for on Circle's side * (e.g. 5042 for Arc mainnet, 5042002 for Arc testnet, 8453 for Base * mainnet). `ArcBountyAgent` * checks this against the network it was constructed for and refuses to * proceed on a mismatch - a wallet provisioned for one chain submitting a * transaction meant for another was previously caught nowhere (V4.7, H-03). * This is a caller-declared value, not independently re-verified against * Circle's API here - confirm it matches the wallet's real Circle-side * chain via the Console/API when setting this up. */ chainId: number; /** Override Circle's API base URL (defaults to https://api.circle.com). */ baseUrl?: string; }; type ArcBountyAgentConfigBase = { /** * Which network to operate on. Defaults to `"arc-testnet"`. * * All four networks are statically configured (see `resolveNetwork`); * `"arc-mainnet"` and `"base-mainnet"` move real USDC. * * Note that on Base the wallet needs ETH for gas *in addition to* USDC; * on Arc, USDC is the native gas token and is the only asset required. * Branch on `resolveNetwork(network).nativeCurrency.isUsdc` rather than * assuming Arc's model. */ network?: NetworkName; /** RPC URL (overrides the resolved network's default) */ rpcUrl?: string; /** IPFS metadata URI for agent registration (ipfs://Qm...) */ metadataURI?: string; /** BountyAdapter contract address (overrides default) */ bountyAdapterAddress?: Address; /** * This wallet's ERC-8004 agentId, pinned up front. Falls back to the * `AGENT_ID` environment variable. * * Strongly recommended in production. The canonical registry has no reverse * address → agentId lookup, so an unpinned id can only be discovered by * scanning Transfer logs - and public RPCs cap `eth_getLogs` at 10k blocks * (~5.5h on Base), which makes discovery unreliable exactly where it matters. * A pinned id is verified against `ownerOf` on first use, so a wrong value * fails loudly instead of reverting on-chain later. */ agentId?: bigint | number | string; }; type ArcBountyAgentConfig = ArcBountyAgentConfigBase & ({ /** Private key of the agent wallet (0x-prefixed hex). Mutually exclusive with `circleWallet`. */ privateKey: Hash; circleWallet?: never; } | { privateKey?: never; /** Sign via a Circle developer-controlled wallet instead of a raw private key. Mutually exclusive with `privateKey`. */ circleWallet: CircleWalletConfig; }); type BountyMeta = { jobId: bigint; poster: Address; reward: bigint; deadline: bigint; ipfsDescHash: string; category: string; tags: readonly string[]; agentId: bigint; agentOnly: boolean; humanOnly: boolean; whitelistedProvider: Address; assignedProvider: Address; submittedResultHash: string; submittedAt: bigint; isTaken: boolean; rejectedAt: bigint; rejectionReasonHash: string; inDispute: boolean; resolved: boolean; disputeInitiator: Address; disputeRaisedAt: bigint; disputeReasonHash: string; disputeResponseHash: string; disputeRulingHash: string; requireWorkerBond: boolean; workerBond: bigint; }; type ReputationScore = { averageScore: bigint; totalFeedbacks: bigint; totalJobs: bigint; }; type OpenBountiesFilter = { category?: string; agentOnly?: boolean; humanOnly?: boolean; maxReward?: number; minReward?: number; offset?: number; limit?: number; }; type CreateBountyOptions = { /** Reward in USDC dollars (will be scaled by 1e6) */ rewardUsdc: number; /** Unix seconds OR a Date OR seconds-from-now (if < 1e9 treated as duration) */ deadline: number | Date; /** Pre-pinned IPFS CID for the description (ipfs://... or bafy...) */ descriptionCid?: string; /** Or raw markdown - will be pinned for you */ descriptionText?: string; category: "dev" | "design" | "content" | "data" | "other"; tags?: string[]; /** Optional whitelisted provider - only this address may take */ provider?: Address; agentOnly?: boolean; humanOnly?: boolean; /** V4: require the worker to post a bond (refunded at submitWork, forfeited to you if they vanish). */ requireWorkerBond?: boolean; }; type SubmitWorkOptions = { /** Raw text/markdown result - will be pinned to IPFS */ text?: string; /** Pre-computed IPFS CID (ipfs://...) - skips pinning */ cid?: string; }; type DisputeEvidenceOptions = { /** Raw evidence text - will be pinned to IPFS */ text?: string; /** Pre-computed IPFS CID - skips pinning */ cid?: string; }; type AgentInfo = { agentId: bigint; address: Address; metadataURI: string; reputation: ReputationScore; }; type TxResult = { hash: Hash; }; type PendingActionKind = "rejection_pending" | "dispute_needs_response" | "arbitrator_timeout_claimable" | "auto_approve_claimable"; /** * One thing on this agent's own bounties that needs attention or is already * actionable. Returned by `getPendingActions()` - a read-only scan, no * transactions, no callbacks required. Built so an agent that only runs * on-demand (an MCP tool call, a single script invocation) can still find * out about a dispute or rejection without a background watchdog. */ type PendingAction = { kind: PendingActionKind; jobId: bigint; message: string; meta: BountyMeta; }; declare class ArcBountyAgent { /** Resolved config of the network this agent talks to (chain id, contracts, explorer…). */ readonly network: NetworkConfig; private readonly publicClient; private readonly signer; private readonly bountyAdapter; private readonly metadataURI; private readonly chain; private _agentId; /** True once `ownerOf(_agentId)` has confirmed this wallet owns that identity. */ private _agentIdVerified; constructor(config: ArcBountyAgentConfig); get address(): Address; /** * @param metadataURI Overrides the constructor's `metadataURI` for this call * only - callers that pin metadata just before registering (the MCP * server's `register_agent` tool does exactly this) need the freshly * pinned CID on-chain, not whatever (often empty) value the agent was * constructed with. */ register(metadataURI?: string): Promise; /** * Synchronous accessor for an ALREADY resolved id. It never touches the * chain, so it throws on a freshly constructed agent even when the wallet * demonstrably owns an identity - use `resolveAgentId()` for that. */ get agentId(): bigint; setAgentId(id: bigint): void; /** * Resolve this wallet's ERC-8004 agentId, touching the chain at most once per * process. Returns null when the wallet owns no identity. * * Order of resolution: * 1. a pinned id (constructor `agentId` / AGENT_ID), checked against * `ownerOf` - the same check `BountyAdapter.takeBounty` performs, so a * wrong pin fails here with a clear message instead of as a revert; * 2. a bounded Transfer(0x0 → self) log scan. * * Step 2 is best-effort by nature: the registry has no reverse address → * agentId lookup and public RPCs cap eth_getLogs at 10k blocks, so on Base it * only sees a few hours of history. Pin the id in production. */ resolveAgentId(): Promise; listOpenBounties(filter?: OpenBountiesFilter): Promise; getBounty(jobId: bigint): Promise; getBountyDescription(jobId: bigint): Promise; getMyBounties(): Promise; getPostedBounties(): Promise; createBounty(opts: CreateBountyOptions): Promise<{ hash: Hash; jobId?: bigint; }>; takeBounty(jobId: bigint, opts?: { skipBondTakeWindowGuard?: boolean; asHuman?: boolean; }): Promise; submitWork(jobId: bigint, options: SubmitWorkOptions): Promise; /** Approve a submission and pay the worker. Records on-chain reputation. */ approveBounty(jobId: bigint, reputationScore?: number): Promise; /** * Permissionless payout after APPROVAL_TIMEOUT (14d) from submission. * Use this from a watchdog agent to unstick ghosted posters. */ autoApprove(jobId: bigint): Promise; /** Propose rejection. Triggers a 48h challenge window for the worker. */ rejectBounty(jobId: bigint, evidence: DisputeEvidenceOptions): Promise; /** After the challenge window expires unchallenged, anyone may finalize. */ finalizeRejection(jobId: bigint): Promise; /** * V4.1: withdraw a pending rejection you proposed (poster only), returning * the bounty to the pre-rejection state so approveBounty is reachable * again. Only valid while the rejection is unchallenged and unresolved. */ withdrawRejection(jobId: bigint): Promise; /** Cancel a bounty (only valid before takeBounty). Full USDC refund. */ cancelBounty(jobId: bigint): Promise; /** Permissionless expiry after deadline. Refunds poster if no submission. */ expireBounty(jobId: bigint): Promise; /** * V4.6/V4.7 (M-04). Read how much USDC a failed direct payout parked for * `address` (defaults to this agent's own wallet) - a nonzero result means * a settlement completed but the money hasn't reached that balance yet. */ getPendingWithdrawal(address?: Address): Promise; /** Claim USDC parked by a failed direct payout - see `getPendingWithdrawal`. */ withdraw(): Promise; /** * V4.7 (C-02 safety net). Permissionless recovery for a job whose AC escrow * was force-refunded by AC's own `claimRefund` despite `AC_EXPIRY_BUFFER` - * meaning it sat unresolved for 90+ days. See the contract's V4.7 changelog * note for exactly how funds are attributed. */ reconcileExpiredEscrow(jobId: bigint): Promise; /** Arbitrator-only ruling. `payProvider` true → worker wins, false → refund. */ resolveDispute(jobId: bigint, payProvider: boolean, ruling: DisputeEvidenceOptions, reputationPenalty?: number): Promise; /** After 48h with no response, anyone may claim the default ruling. */ claimDefaultRuling(jobId: bigint): Promise; /** * V3.3 liveness fallback: if the respondent DID reply (so claimDefaultRuling * no longer applies) but the arbitrator never called resolveDispute within * ARBITRATOR_TIMEOUT (30d) of disputeRaisedAt, anyone may trigger a neutral * 50/50 split between poster and worker. No reputation penalty either way. */ claimArbitratorTimeout(jobId: bigint): Promise; /** Worker challenges a pending rejection - flips bounty into dispute with worker as initiator. */ challengeRejection(jobId: bigint, evidence: DisputeEvidenceOptions): Promise; /** Open a dispute (either party - after submission, before resolution). */ disputeBounty(jobId: bigint, evidence: DisputeEvidenceOptions): Promise; /** Respond to an open dispute (only the non-initiator may call). */ respondToDispute(jobId: bigint, evidence: DisputeEvidenceOptions): Promise; /** * Scans the full bounty set and calls expireBounty() on anything past its * deadline with no submission and not yet resolved. Stops after finding * `limit` candidates to expire. * * NOTE: `getOpenBounties` (used pre-V3.3) can NEVER return a candidate for * this - it excludes any bounty whose deadline has already passed by * definition (`_isOpenMatch` checks `block.timestamp <= deadline`). This * scan walks `allJobIds` directly instead, mirroring the keeper cron route * (`frontend/app/api/cron/keeper/route.ts`). */ expireStale(category?: string, limit?: number): Promise; getReputation(agentId?: bigint): Promise; /** * V4 anti-Sybil signal: count of distinct posters who've actually paid out * a completed bounty to this agent. Costs N real funded wallets to fake N - * unlike the raw ERC-8004 average score, which one alt account can inflate * for a few cents. See V4_DESIGN_ANTI_SYBIL.md. */ getUniquePosterCount(agentId?: bigint): Promise; getAgentInfo(): Promise; usdcBalance(): Promise; formatUsdc(raw: bigint): string; /** * Watch `BountyCreated` events and invoke `onMatch` for each new bounty that * passes the filter. Returns an `unwatch()` function - call it to stop. * * Idempotency: each jobId is delivered to `onMatch` at most once per process * lifetime, even if the chain emits a duplicate event (re-org, RPC retry). * If you need durable dedup across restarts, persist `seenJobIds` yourself. */ subscribeToNewBounties(filter: OpenBountiesFilter, onMatch: (meta: BountyMeta) => void | Promise): () => void; /** * Background watchdog over this agent's own assigned bounties. An agent * that only calls `takeBounty`/`submitWork` and then goes idle is exposed * to every counterparty-controlled window in the contract: a poster can * reject a correct submission (48h to challenge), open a dispute the agent * never responds to (48h to respond, then the *other* side wins by * default), or the agent may simply be owed a payout nobody triggered yet * (14d autoApprove / 30d claimArbitratorTimeout). `protect()` polls * `getMyBounties()` and reacts automatically: * * - **Pending rejection, not yet challenged** → calls `onRejection` (if * provided) for evidence and calls `challengeRejection`. Without a * callback, a rejection is only logged, never auto-challenged - silently * auto-disputing every rejection would be its own failure mode. * - **Dispute raised by the other party, not yet responded** → calls * `onDisputeAgainstMe` for evidence and calls `respondToDispute`. Same * caveat: no callback means log-only. * - **Dispute resolved-by-response but arbitrator never ruled (30d)** → * calls `claimArbitratorTimeout` automatically (permissionless, no * evidence needed - this just unsticks the agent's own frozen funds). * - **Submitted, approval window elapsed (14d), poster silent** → calls * `autoApprove` automatically. * * Returns an `unwatch()` function. Errors on any single bounty are logged * and swallowed so one bad case can't kill the whole watchdog. */ protect(options?: { pollingIntervalMs?: number; onRejection?: (meta: BountyMeta) => Promise; onDisputeAgainstMe?: (meta: BountyMeta) => Promise; onEvent?: (event: string, meta: BountyMeta) => void; }): () => void; /** * Read-only scan of this agent's own bounties (posted or assigned, via * `getMyBounties()`) for anything needing attention: a dispute raised * against it with no response yet, a pending rejection not yet challenged, * or funds it can now unstick permissionlessly (auto-approve / arbitrator * timeout). No transactions, no callbacks, no side effects - safe to call * from anywhere, including once per turn from an MCP tool. This is what * lets an agent that only runs on-demand (no background `protect()` loop) * still find out about a dispute instead of it passing silently. */ getPendingActions(): Promise; private _protectOnce; runOnce(filter: OpenBountiesFilter, runTask: (description: string, meta: BountyMeta) => Promise): Promise; /** * Wait for a receipt, but never forever. * * viem builds transactions from the *pending* nonce, and a load-balanced RPC * can serve that tag from a lagging replica. Measured on Base's public * endpoint 2026-08-28: `latest=27` and `pending=24` from the same host, * seconds apart. A transaction built on that stale nonce can never be * included, so an untimed `waitForTransactionReceipt` waits for a receipt * that will never exist - and every write in this SDK sat on that wait. Over * MCP it looked like the tool call itself had frozen, with no hash, no error * and nothing to retry against. * * The timeout turns that into something a caller can act on: it names the * hash, so the transaction can be looked up or resent, and it names the * cause, because "set a dedicated RPC" is the actual fix. */ private _waitForTx; /** * Write to BountyAdapter with the canonical (chain, account) tuple. All * mutating helpers funnel through here so future changes (gas estimation, * retry, paymaster) land in one place. */ /** * Estimate this call's gas and add half again, or return undefined and let * viem estimate as before. * * The adapter records ERC-8004 feedback inside a `try/catch`, deliberately: * a reputation write must never block a payout that already happened. But * `eth_estimateGas` binary-searches for the *lowest* limit at which the * transaction succeeds, and the outer call succeeds whether or not the inner * one runs out of gas - so the search settles on a limit where the feedback * silently fails. Measured on Base mainnet 2026-08-28: approveBounty at the * estimated limit emitted nothing from the registry, and the same call at * three times that limit emitted the feedback and used 316k gas. Every * approval had been quietly skipping the reputation write. * * Unused gas is refunded, so the buffer costs nothing but a slightly higher * balance requirement at send time. */ private _gasWithBuffer; private _writeAdapter; /** * Best-effort discovery: scan a bounded recent window for a * Transfer(0x0 → self) on the registry. Every public RPC we target caps * eth_getLogs at a 10,000-block range per call (Arc's, Base's own * mainnet.base.org, and drpc all reject a wider request outright), so we page * backward in 10k chunks up to a lookback ceiling instead of issuing one * oversized request. * * `scanned` distinguishes "completed and found nothing" from "gave up": the * caller must not treat an RPC failure as proof that no identity exists, or * `register()` mints a duplicate and orphans the first identity's reputation. * * The ceiling is expressed in DAYS and converted via the network's * `blocksPerDay`. A flat 500k-block window meant ~5.8 days on Arc but only * ~11.6 days on Base, and would shrink further on any faster chain; the call * budget keeps a miss cheap where that window runs to thousands of requests. * This is why production should pin `agentId` / AGENT_ID rather than rely on * discovery at all. */ private _findExistingAgentId; private _ensureUsdcAllowance; private _resolveEvidenceCid; } declare function parseUsdc(dollars: number): bigint; /** `d` < 1e9 is interpreted as duration-in-seconds from `nowSec` (~30yr cutoff). */ declare function resolveDeadline(d: number | Date, nowSec?: number): bigint; /** * V4 worker bond: max(minBond, reward * bondBps / 10_000). Mirrors * BountyAdapter._workerBondFor. Defaults are the live V4 parameters * (15% / $0.50 floor); pass the on-chain WORKER_BOND_BPS / MIN_WORKER_BOND * values to stay correct across redeploys with different parameters. */ declare function workerBondFor(reward: bigint, bondBps?: bigint, minBond?: bigint): bigint; /** * Client-side mirror of the contract's MIN_BOND_BOUNTY_DURATION check for * createBounty, padded by DEADLINE_SAFETY_BUFFER_SEC: a deadline that clears * the 24h floor by only a few seconds at signing time will fail it by the * time the tx mines (clock skew + mining delay), reverting tx 2 of 2 after * the USDC approve already went through. */ declare function bondCreateDeadlineOk(deadline: bigint, nowSec: bigint): boolean; /** * Client-side mirror of the contract's MIN_BOND_TAKE_WINDOW check (V4.2) for * takeBounty: taking a bond bounty with less than 12h to its deadline is a * bond-forfeiture trap for an auto-taking agent. Enforced here even against * pre-V4.2 deployments, which allow the take on-chain. */ declare function bondTakeWindowOk(deadline: bigint, nowSec: bigint): boolean; declare function matchesBountyFilter(m: BountyMeta, f: OpenBountiesFilter): boolean; declare const BOUNTY_ADAPTER_ABI: readonly [{ readonly name: "createBounty"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "p"; readonly type: "tuple"; readonly components: readonly [{ readonly name: "provider"; readonly type: "address"; }, { readonly name: "reward"; readonly type: "uint256"; }, { readonly name: "deadline"; readonly type: "uint256"; }, { readonly name: "ipfsDescHash"; readonly type: "string"; }, { readonly name: "category"; readonly type: "string"; }, { readonly name: "tags"; readonly type: "string[]"; }, { readonly name: "agentOnly"; readonly type: "bool"; }, { readonly name: "humanOnly"; readonly type: "bool"; }, { readonly name: "requireWorkerBond"; readonly type: "bool"; }]; }]; readonly outputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }]; }, { readonly name: "takeBounty"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }, { readonly name: "agentId"; readonly type: "uint256"; }]; readonly outputs: readonly []; }, { readonly name: "submitWork"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }, { readonly name: "ipfsResultHash"; readonly type: "string"; }]; readonly outputs: readonly []; }, { readonly name: "approveBounty"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }, { readonly name: "reputationScore"; readonly type: "uint8"; }]; readonly outputs: readonly []; }, { readonly name: "autoApprove"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }]; readonly outputs: readonly []; }, { readonly name: "rejectBounty"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }, { readonly name: "ipfsReasonHash"; readonly type: "string"; }]; readonly outputs: readonly []; }, { readonly name: "challengeRejection"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }, { readonly name: "ipfsReasonHash"; readonly type: "string"; }]; readonly outputs: readonly []; }, { readonly name: "finalizeRejection"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }]; readonly outputs: readonly []; }, { readonly name: "withdrawRejection"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }]; readonly outputs: readonly []; }, { readonly name: "cancelBounty"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }]; readonly outputs: readonly []; }, { readonly name: "expireBounty"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }]; readonly outputs: readonly []; }, { readonly name: "disputeBounty"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }, { readonly name: "ipfsReasonHash"; readonly type: "string"; }]; readonly outputs: readonly []; }, { readonly name: "respondToDispute"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }, { readonly name: "ipfsResponseHash"; readonly type: "string"; }]; readonly outputs: readonly []; }, { readonly name: "resolveDispute"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }, { readonly name: "payProvider"; readonly type: "bool"; }, { readonly name: "ipfsRulingHash"; readonly type: "string"; }, { readonly name: "reputationPenalty"; readonly type: "uint8"; }]; readonly outputs: readonly []; }, { readonly name: "claimDefaultRuling"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }]; readonly outputs: readonly []; }, { readonly name: "claimArbitratorTimeout"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }]; readonly outputs: readonly []; }, { readonly name: "withdraw"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: "amount"; readonly type: "uint256"; }]; }, { readonly name: "reconcileExpiredEscrow"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }]; readonly outputs: readonly []; }, { readonly name: "setPaused"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "p"; readonly type: "bool"; }]; readonly outputs: readonly []; }, { readonly name: "allJobIds"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; }, { readonly name: "getOpenBounties"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "category"; readonly type: "string"; }, { readonly name: "offset"; readonly type: "uint256"; }, { readonly name: "limit"; readonly type: "uint256"; }]; readonly outputs: readonly [{ readonly name: "result"; readonly type: "uint256[]"; }]; }, { readonly name: "getBountyMeta"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "tuple"; readonly components: readonly [{ readonly name: "jobId"; readonly type: "uint256"; }, { readonly name: "poster"; readonly type: "address"; }, { readonly name: "reward"; readonly type: "uint256"; }, { readonly name: "deadline"; readonly type: "uint256"; }, { readonly name: "ipfsDescHash"; readonly type: "string"; }, { readonly name: "category"; readonly type: "string"; }, { readonly name: "tags"; readonly type: "string[]"; }, { readonly name: "agentId"; readonly type: "uint256"; }, { readonly name: "agentOnly"; readonly type: "bool"; }, { readonly name: "humanOnly"; readonly type: "bool"; }, { readonly name: "whitelistedProvider"; readonly type: "address"; }, { readonly name: "assignedProvider"; readonly type: "address"; }, { readonly name: "submittedResultHash"; readonly type: "string"; }, { readonly name: "submittedAt"; readonly type: "uint256"; }, { readonly name: "isTaken"; readonly type: "bool"; }, { readonly name: "rejectedAt"; readonly type: "uint256"; }, { readonly name: "rejectionReasonHash"; readonly type: "string"; }, { readonly name: "inDispute"; readonly type: "bool"; }, { readonly name: "resolved"; readonly type: "bool"; }, { readonly name: "disputeInitiator"; readonly type: "address"; }, { readonly name: "disputeRaisedAt"; readonly type: "uint256"; }, { readonly name: "disputeReasonHash"; readonly type: "string"; }, { readonly name: "disputeResponseHash"; readonly type: "string"; }, { readonly name: "disputeRulingHash"; readonly type: "string"; }, { readonly name: "requireWorkerBond"; readonly type: "bool"; }, { readonly name: "workerBond"; readonly type: "uint256"; }]; }]; }, { readonly name: "getMyPostedBounties"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "poster"; readonly type: "address"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256[]"; }]; }, { readonly name: "getMyAssignedBounties"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "provider"; readonly type: "address"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256[]"; }]; }, { readonly name: "getAgentBounties"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256[]"; }]; }, { readonly name: "APPROVAL_TIMEOUT"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; }, { readonly name: "getAgentReputation"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "tuple"; readonly components: readonly [{ readonly name: "averageScore"; readonly type: "uint256"; }, { readonly name: "totalFeedbacks"; readonly type: "uint256"; }, { readonly name: "totalJobs"; readonly type: "uint256"; }]; }]; }, { readonly name: "totalBounties"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; }, { readonly name: "arbitrator"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; }]; }, { readonly name: "DISPUTE_RESPONSE_WINDOW"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; }, { readonly name: "REJECTION_CHALLENGE_WINDOW"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; }, { readonly name: "ARBITRATOR_TIMEOUT"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; }, { readonly name: "uniquePosterCount"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; }, { readonly name: "WORKER_BOND_BPS"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; }, { readonly name: "MIN_WORKER_BOND"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; }, { readonly name: "MIN_BOND_BOUNTY_DURATION"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; }, { readonly name: "pendingWithdrawals"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "payee"; readonly type: "address"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; }, { readonly name: "paused"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "bool"; }]; }, { readonly name: "BountyCreated"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "poster"; readonly type: "address"; readonly indexed: true; }, { readonly name: "reward"; readonly type: "uint256"; readonly indexed: false; }, { readonly name: "category"; readonly type: "string"; readonly indexed: false; }, { readonly name: "deadline"; readonly type: "uint256"; readonly indexed: false; }]; }, { readonly name: "BountyTaken"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "provider"; readonly type: "address"; readonly indexed: true; }, { readonly name: "agentId"; readonly type: "uint256"; readonly indexed: false; }]; }, { readonly name: "WorkSubmitted"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "provider"; readonly type: "address"; readonly indexed: true; }, { readonly name: "ipfsResultHash"; readonly type: "string"; readonly indexed: false; }]; }, { readonly name: "BountyCompleted"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "agentId"; readonly type: "uint256"; readonly indexed: false; }, { readonly name: "reputationScore"; readonly type: "uint256"; readonly indexed: false; }]; }, { readonly name: "DisputeRaised"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "initiator"; readonly type: "address"; readonly indexed: true; }, { readonly name: "reasonHash"; readonly type: "string"; readonly indexed: false; }]; }, { readonly name: "DisputeResponded"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "responder"; readonly type: "address"; readonly indexed: true; }, { readonly name: "responseHash"; readonly type: "string"; readonly indexed: false; }]; }, { readonly name: "DisputeResolved"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "payProvider"; readonly type: "bool"; readonly indexed: false; }, { readonly name: "rulingHash"; readonly type: "string"; readonly indexed: false; }, { readonly name: "defaultRuling"; readonly type: "bool"; readonly indexed: false; }]; }, { readonly name: "ArbitratorTimeoutClaimed"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "posterAmount"; readonly type: "uint256"; readonly indexed: false; }, { readonly name: "providerAmount"; readonly type: "uint256"; readonly indexed: false; }]; }, { readonly name: "WorkerBondPosted"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "worker"; readonly type: "address"; readonly indexed: true; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; }]; }, { readonly name: "WorkerBondRefunded"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "worker"; readonly type: "address"; readonly indexed: true; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; }]; }, { readonly name: "WorkerBondForfeited"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "poster"; readonly type: "address"; readonly indexed: true; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; }]; }, { readonly name: "BountyAutoApproved"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "provider"; readonly type: "address"; readonly indexed: true; }]; }, { readonly name: "BountyCancelled"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "reason"; readonly type: "string"; readonly indexed: false; }]; }, { readonly name: "BountyExpired"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }]; }, { readonly name: "ProtocolFeePaid"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "recipient"; readonly type: "address"; readonly indexed: true; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; }]; }, { readonly name: "RejectionProposed"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "poster"; readonly type: "address"; readonly indexed: true; }, { readonly name: "reasonHash"; readonly type: "string"; readonly indexed: false; }]; }, { readonly name: "RejectionFinalized"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }]; }, { readonly name: "RejectionChallenged"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "worker"; readonly type: "address"; readonly indexed: true; }, { readonly name: "reasonHash"; readonly type: "string"; readonly indexed: false; }]; }, { readonly name: "RejectionWithdrawn"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }]; }, { readonly name: "PayoutParked"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "payee"; readonly type: "address"; readonly indexed: true; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; }]; }, { readonly name: "WithdrawalClaimed"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "payee"; readonly type: "address"; readonly indexed: true; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; }]; }, { readonly name: "ExternalRefundReconciled"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; }, { readonly name: "poster"; readonly type: "address"; readonly indexed: true; }, { readonly name: "worker"; readonly type: "address"; readonly indexed: true; }, { readonly name: "posterAmount"; readonly type: "uint256"; readonly indexed: false; }, { readonly name: "workerAmount"; readonly type: "uint256"; readonly indexed: false; }]; }, { readonly name: "PausedSet"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "paused"; readonly type: "bool"; readonly indexed: false; }]; }]; declare const IDENTITY_REGISTRY_ABI: readonly [{ readonly name: "register"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "metadataURI"; readonly type: "string"; }]; readonly outputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; }]; }, { readonly name: "ownerOf"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; }]; }, { readonly name: "tokenURI"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "string"; }]; }, { readonly name: "Transfer"; readonly type: "event"; readonly inputs: readonly [{ readonly name: "from"; readonly type: "address"; readonly indexed: true; }, { readonly name: "to"; readonly type: "address"; readonly indexed: true; }, { readonly name: "tokenId"; readonly type: "uint256"; readonly indexed: true; }]; }]; declare const ERC20_ABI: readonly [{ readonly name: "approve"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "spender"; readonly type: "address"; }, { readonly name: "amount"; readonly type: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "bool"; }]; }, { readonly name: "allowance"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "owner"; readonly type: "address"; }, { readonly name: "spender"; readonly type: "address"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; }, { readonly name: "balanceOf"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly name: "account"; readonly type: "address"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; }]; /** * Read text back out of IPFS, racing every gateway within a round and * re-trying the whole list (with backoff) before giving up. * * The multi-round retry is not defensive padding. Content pinned seconds ago * is routinely unreachable through every public gateway at once while * providers propagate - measured on Base mainnet: a CID pinned weeks earlier * served 200 from ipfs.io while one pinned minutes earlier 504'd on all of * pinata/ipfs.io/cloudflare/dweb/w3s/4everland. A single pass therefore fails * exactly when a poster opens a submission right after the worker delivered * it, which reads as the worker having submitted nothing. * * V4.7 (M-05): gateways within a round are now raced concurrently (each with * its own timeout) rather than tried strictly one after another - previously * one hanging gateway (no timeout existed at all) stalled every other * gateway in the same round behind it. */ declare function fetchIpfsText(uriOrCid: string, opts?: { attempts?: number; delayMs?: number; sleep?: (ms: number) => Promise; }): Promise; declare function fetchIpfsJson(uriOrCid: string): Promise; /** True iff Pinata creds are reachable in env. Cheap to call repeatedly. */ declare function isPinningConfigured(): boolean; /** * Pin text content to IPFS via Pinata's v2 `pinFileToIPFS` API. Prefers a JWT * (PINATA_JWT, scoped for `pinFileToIPFS`, sent as Bearer), and falls back to a * key/secret pair (PINATA_API_KEY + PINATA_SECRET). Returns an `ipfs://` URI. * * Throws immediately (not deep inside an autonomous loop) if creds are missing. */ declare function pinText(content: string, filename?: string): Promise; /** * IPFS is chain-agnostic, so any site's pin route works for any network; each * deployment simply has its own. This is the ArcBounty/BaseBounty default. * Monad networks default to their own site, see {@link pinUrlFor}. */ declare const DEFAULT_PIN_URL = "https://arcbounty.app/api/ipfs/pin"; /** The pin route a network defaults to: nadbounty.app for Monad mainnet, its testnet site for Monad testnet. */ declare function pinUrlFor(network?: MonadNetworkName): string; /** Anything that can prove it controls `address`; custodial signers may not. */ type MessageSigner = { readonly address: Address; signMessage?: (message: string) => Promise; }; type PinViaSiteOptions = { /** * Defaults to ARCBOUNTY_PIN_URL, then the route of `network` when given * (nadbounty.app for "monad-mainnet", nadbounty-testnet.vercel.app for * "monad-testnet"), then {@link DEFAULT_PIN_URL}. */ url?: string; /** Picks the default pin route for a Monad network. Ignored when `url` or ARCBOUNTY_PIN_URL is set. */ network?: MonadNetworkName; fetchImpl?: (url: string, init: RequestInit) => Promise; now?: () => number; }; /** The exact message the site's pin route verifies - `pinAuthMessage` in frontend/lib/wallet-auth.ts. */ declare function pinAuthMessage(address: Address, timestamp: number): string; /** Pin text through the site's pin route, authenticated by a wallet signature. */ declare function pinTextViaSite(content: string, signer: MessageSigner, opts?: PinViaSiteOptions): Promise; /** Pin with what this process has: its own Pinata credentials, else the site signed by `signer`. */ declare function pinTextAuto(content: string, signer: MessageSigner, opts?: PinViaSiteOptions): Promise; /** * ERC-8004 agent metadata (TZ §4.3 + §12.3). * * IdentityRegistry.register() stores a URI; everyone reading it expects the * referenced JSON to follow this shape. Persistence matters - `data:` URIs * break the moment a verifier wants to fetch the manifest after registration, * so we always pin to IPFS. */ type ArcBountySection = { /** Min reputation a poster requires before this agent takes their bounty. */ min_reputation?: number; preferred_categories?: ReadonlyArray<"dev" | "design" | "content" | "data" | "other">; min_reward_usdc?: number; max_reward_usdc?: number; }; type AgentMetadata = { name: string; description: string; agent_type?: string; capabilities?: readonly string[]; version?: string; contact?: string; arcbounty?: ArcBountySection; }; /** * Validate a metadata blob before pinning. Strict by default - we'd rather * fail loudly on init than silently push a broken manifest to IPFS. */ declare function validateAgentMetadata(m: unknown): asserts m is AgentMetadata; /** Pin a validated metadata blob to IPFS and return the `ipfs://` URI. */ declare function pinAgentMetadata(meta: AgentMetadata): Promise; declare const BOUNTY_ADAPTER_V48_ABI: readonly [{ readonly type: "constructor"; readonly inputs: readonly [{ readonly name: "_agenticCommerce"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "_identityRegistry"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "_reputationRegistry"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "_usdc"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "_feeRecipient"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "_reputationMirror"; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "AC_EXPIRY_BUFFER"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "APPROVAL_TIMEOUT"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "ARBITRATOR_TIMEOUT"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "BPS_DENOMINATOR"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "DISPUTE_RESPONSE_WINDOW"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "MAX_CATEGORY"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "MAX_CID_LEN"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "MAX_TAGS"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "MAX_TAG_LEN"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "MIN_BOND_BOUNTY_DURATION"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "MIN_BOND_TAKE_WINDOW"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "MIN_REWARD"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "MIN_WORKER_BOND"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "REJECTION_CHALLENGE_WINDOW"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "WORKER_BOND_BPS"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "acceptArbitrator"; readonly inputs: readonly []; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "acceptContestChallengers"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "entryIndices"; readonly type: "uint8[]"; readonly internalType: "uint8[]"; }, { readonly name: "scores"; readonly type: "uint8[]"; readonly internalType: "uint8[]"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "acceptFeeRecipient"; readonly inputs: readonly []; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "acceptOwner"; readonly inputs: readonly []; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "agenticCommerce"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "contract IAgenticCommerce"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "allJobIds"; readonly inputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "approveBounty"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "reputationScore"; readonly type: "uint8"; readonly internalType: "uint8"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "arbitrator"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "autoApprove"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "bounties"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "tuple"; readonly internalType: "struct BountyAdapterV48.BountyMeta"; readonly components: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "poster"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "reward"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "deadline"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "ipfsDescHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "category"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "tags"; readonly type: "string[]"; readonly internalType: "string[]"; }, { readonly name: "agentId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "agentOnly"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "humanOnly"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "whitelistedProvider"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "assignedProvider"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "submittedResultHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "submittedAt"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "isTaken"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "rejectedAt"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "rejectionReasonHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "inDispute"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "resolved"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "disputeInitiator"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "disputeRaisedAt"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "disputeReasonHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "disputeResponseHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "disputeRulingHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "requireWorkerBond"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "workerBond"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "bondPayer"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "disputeByWorker"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "contest"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "maxEntries"; readonly type: "uint8"; readonly internalType: "uint8"; }, { readonly name: "winners"; readonly type: "uint8"; readonly internalType: "uint8"; }, { readonly name: "minJobs"; readonly type: "uint64"; readonly internalType: "uint64"; }, { readonly name: "minAvgScore"; readonly type: "uint8"; readonly internalType: "uint8"; }]; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "cancelBounty"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "challengeContestRejection"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "entryIndex"; readonly type: "uint8"; readonly internalType: "uint8"; }, { readonly name: "evidenceHash"; readonly type: "string"; readonly internalType: "string"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "challengeRejection"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "ipfsReasonHash"; readonly type: "string"; readonly internalType: "string"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "claimArbitratorTimeout"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "claimContestArbitratorTimeout"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "claimContestDefault"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "claimDefaultRuling"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "contestClosedAt"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "createBounty"; readonly inputs: readonly [{ readonly name: "p"; readonly type: "tuple"; readonly internalType: "struct BountyAdapterV48.CreateParams"; readonly components: readonly [{ readonly name: "provider"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "reward"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "deadline"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "ipfsDescHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "category"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "tags"; readonly type: "string[]"; readonly internalType: "string[]"; }, { readonly name: "agentOnly"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "humanOnly"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "requireWorkerBond"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "contest"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "maxEntries"; readonly type: "uint8"; readonly internalType: "uint8"; }, { readonly name: "winners"; readonly type: "uint8"; readonly internalType: "uint8"; }, { readonly name: "minJobs"; readonly type: "uint64"; readonly internalType: "uint64"; }, { readonly name: "minAvgScore"; readonly type: "uint8"; readonly internalType: "uint8"; }]; }]; readonly outputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "disputeBounty"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "ipfsReasonHash"; readonly type: "string"; readonly internalType: "string"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "enterContest"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "agentId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "resultHash"; readonly type: "string"; readonly internalType: "string"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "expireBounty"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "feeBps"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "feeRecipient"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "finalizeContestRejection"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "finalizeRejection"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "getAgentBounties"; readonly inputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256[]"; readonly internalType: "uint256[]"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getAgentBountyCount"; readonly inputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getAgentReputation"; readonly inputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "tuple"; readonly internalType: "struct BountyAdapterV48.ReputationScore"; readonly components: readonly [{ readonly name: "averageScore"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "totalFeedbacks"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "totalJobs"; readonly type: "uint256"; readonly internalType: "uint256"; }]; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getAssignedCount"; readonly inputs: readonly [{ readonly name: "provider"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getBountyMeta"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "tuple"; readonly internalType: "struct BountyAdapterV48.BountyMeta"; readonly components: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "poster"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "reward"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "deadline"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "ipfsDescHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "category"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "tags"; readonly type: "string[]"; readonly internalType: "string[]"; }, { readonly name: "agentId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "agentOnly"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "humanOnly"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "whitelistedProvider"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "assignedProvider"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "submittedResultHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "submittedAt"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "isTaken"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "rejectedAt"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "rejectionReasonHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "inDispute"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "resolved"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "disputeInitiator"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "disputeRaisedAt"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "disputeReasonHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "disputeResponseHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "disputeRulingHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "requireWorkerBond"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "workerBond"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "bondPayer"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "disputeByWorker"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "contest"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "maxEntries"; readonly type: "uint8"; readonly internalType: "uint8"; }, { readonly name: "winners"; readonly type: "uint8"; readonly internalType: "uint8"; }, { readonly name: "minJobs"; readonly type: "uint64"; readonly internalType: "uint64"; }, { readonly name: "minAvgScore"; readonly type: "uint8"; readonly internalType: "uint8"; }]; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getContestChallenge"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "entryIndex"; readonly type: "uint8"; readonly internalType: "uint8"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "tuple"; readonly internalType: "struct BountyAdapterV48.ContestChallenge"; readonly components: readonly [{ readonly name: "challengedAt"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "respondedAt"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "evidenceHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "responseHash"; readonly type: "string"; readonly internalType: "string"; }]; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getContestChallengers"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint8[]"; readonly internalType: "uint8[]"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getContestEntries"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "tuple[]"; readonly internalType: "struct BountyAdapterV48.ContestEntry[]"; readonly components: readonly [{ readonly name: "agentId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "entrant"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "resultHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "awarded"; readonly type: "bool"; readonly internalType: "bool"; }]; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getContestEntryIndex"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "agentId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "humanWallet"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly [{ readonly name: "indexPlusOne"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getContestState"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: "entryCount"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "closedAt"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "reviewDeadline"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "resolved"; readonly type: "bool"; readonly internalType: "bool"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getIdentityReputation"; readonly inputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "humanWallet"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly [{ readonly name: "paidJobs"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "scoreSum"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getMyAssignedBounties"; readonly inputs: readonly [{ readonly name: "provider"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256[]"; readonly internalType: "uint256[]"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getMyPostedBounties"; readonly inputs: readonly [{ readonly name: "poster"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256[]"; readonly internalType: "uint256[]"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getOpenBounties"; readonly inputs: readonly [{ readonly name: "category"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "offset"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "limit"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: "result"; readonly type: "uint256[]"; readonly internalType: "uint256[]"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getPostedCount"; readonly inputs: readonly [{ readonly name: "poster"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "identityKey"; readonly inputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "humanWallet"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "bytes32"; readonly internalType: "bytes32"; }]; readonly stateMutability: "pure"; }, { readonly type: "function"; readonly name: "identityRegistry"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "contract IMonadIdentityRegistry"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "localReputation"; readonly inputs: readonly [{ readonly name: "identity"; readonly type: "bytes32"; readonly internalType: "bytes32"; }]; readonly outputs: readonly [{ readonly name: "paidJobs"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "scoreSum"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "maxBountyAmount"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "owner"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "paused"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "bool"; readonly internalType: "bool"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "pendingArbitrator"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "pendingFeeRecipient"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "pendingIdentityWithdrawals"; readonly inputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: "amount"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "pendingOwner"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "pendingWithdrawals"; readonly inputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "pickContestWinners"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "entryIndices"; readonly type: "uint8[]"; readonly internalType: "uint8[]"; }, { readonly name: "scores"; readonly type: "uint8[]"; readonly internalType: "uint8[]"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "reconcileExpiredEscrow"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "rejectAllContestEntries"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "reasonHash"; readonly type: "string"; readonly internalType: "string"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "rejectBounty"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "ipfsReasonHash"; readonly type: "string"; readonly internalType: "string"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "replaceContestEntry"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "entryIndex"; readonly type: "uint8"; readonly internalType: "uint8"; }, { readonly name: "resultHash"; readonly type: "string"; readonly internalType: "string"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "reputationMirror"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "contract ReputationMirror"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "reputationRegistry"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "contract IReputationRegistry"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "resolveContestDispute"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "entryIndices"; readonly type: "uint8[]"; readonly internalType: "uint8[]"; }, { readonly name: "rulingHash"; readonly type: "string"; readonly internalType: "string"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "resolveDispute"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "payProvider"; readonly type: "bool"; readonly internalType: "bool"; }, { readonly name: "ipfsRulingHash"; readonly type: "string"; readonly internalType: "string"; }, { readonly name: "reputationPenalty"; readonly type: "uint8"; readonly internalType: "uint8"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "respondToContestChallenges"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "responseHash"; readonly type: "string"; readonly internalType: "string"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "respondToDispute"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "ipfsResponseHash"; readonly type: "string"; readonly internalType: "string"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "setMaxBountyAmount"; readonly inputs: readonly [{ readonly name: "next"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "setPaused"; readonly inputs: readonly [{ readonly name: "p"; readonly type: "bool"; readonly internalType: "bool"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "settleContestSilence"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "submitWork"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "ipfsResultHash"; readonly type: "string"; readonly internalType: "string"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "takeBounty"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "agentId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "totalBounties"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "transferArbitrator"; readonly inputs: readonly [{ readonly name: "next"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "transferFeeRecipient"; readonly inputs: readonly [{ readonly name: "next"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "transferOwner"; readonly inputs: readonly [{ readonly name: "next"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "uniquePosterCount"; readonly inputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "usdc"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "contract IERC20"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "withdraw"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: "amount"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "withdrawContestRejection"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "withdrawIdentity"; readonly inputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: "amount"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "withdrawRejection"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "event"; readonly name: "ArbitratorTimeoutClaimed"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "posterAmount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }, { readonly name: "providerAmount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ArbitratorTransferStarted"; readonly inputs: readonly [{ readonly name: "previous"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "pending"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ArbitratorTransferred"; readonly inputs: readonly [{ readonly name: "previous"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "next"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "BountyAutoApproved"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "provider"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "BountyCancelled"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "reason"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "BountyCompleted"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "agentId"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }, { readonly name: "reputationScore"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "BountyCreated"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "poster"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "reward"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }, { readonly name: "category"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }, { readonly name: "deadline"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "BountyExpired"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "BountyTaken"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "provider"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "agentId"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ContestArbitratorTimeout"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "posterAmount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }, { readonly name: "challengerAmount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }, { readonly name: "escrowRecovery"; readonly type: "bool"; readonly indexed: false; readonly internalType: "bool"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ContestAwarded"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "entryIndex"; readonly type: "uint8"; readonly indexed: true; readonly internalType: "uint8"; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }, { readonly name: "scored"; readonly type: "bool"; readonly indexed: false; readonly internalType: "bool"; }, { readonly name: "score"; readonly type: "uint8"; readonly indexed: false; readonly internalType: "uint8"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ContestChallengeResponded"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "entryIndex"; readonly type: "uint8"; readonly indexed: true; readonly internalType: "uint8"; }, { readonly name: "responseHash"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ContestChallenged"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "entryIndex"; readonly type: "uint8"; readonly indexed: true; readonly internalType: "uint8"; }, { readonly name: "evidenceHash"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }, { readonly name: "responseDeadline"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ContestClosed"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "closedAt"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ContestCreated"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "maxEntries"; readonly type: "uint8"; readonly indexed: false; readonly internalType: "uint8"; }, { readonly name: "winners"; readonly type: "uint8"; readonly indexed: false; readonly internalType: "uint8"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ContestEntered"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "entryIndex"; readonly type: "uint8"; readonly indexed: true; readonly internalType: "uint8"; }, { readonly name: "identity"; readonly type: "bytes32"; readonly indexed: true; readonly internalType: "bytes32"; }, { readonly name: "agentId"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }, { readonly name: "entrant"; readonly type: "address"; readonly indexed: false; readonly internalType: "address"; }, { readonly name: "resultHash"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ContestEntryReplaced"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "entryIndex"; readonly type: "uint8"; readonly indexed: true; readonly internalType: "uint8"; }, { readonly name: "resultHash"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ContestRefunded"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "escrowRecovery"; readonly type: "bool"; readonly indexed: false; readonly internalType: "bool"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ContestRejected"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "reasonHash"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }, { readonly name: "challengeDeadline"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ContestRejectionWithdrawn"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ContestRuling"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "refundPoster"; readonly type: "bool"; readonly indexed: false; readonly internalType: "bool"; }, { readonly name: "rulingHash"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ContestSettled"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "scored"; readonly type: "bool"; readonly indexed: false; readonly internalType: "bool"; }, { readonly name: "escrowRecovery"; readonly type: "bool"; readonly indexed: false; readonly internalType: "bool"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "DisputeRaised"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "initiator"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "reasonHash"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "DisputeResolved"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "payProvider"; readonly type: "bool"; readonly indexed: false; readonly internalType: "bool"; }, { readonly name: "rulingHash"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }, { readonly name: "defaultRuling"; readonly type: "bool"; readonly indexed: false; readonly internalType: "bool"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "DisputeResponded"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "responder"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "responseHash"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ExternalRefundReconciled"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "poster"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "worker"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "posterAmount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }, { readonly name: "workerAmount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "FeeRecipientTransferStarted"; readonly inputs: readonly [{ readonly name: "previous"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "pending"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "FeeRecipientTransferred"; readonly inputs: readonly [{ readonly name: "previous"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "next"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "IdentityPayoutParked"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "agentId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "IdentityWithdrawalClaimed"; readonly inputs: readonly [{ readonly name: "agentId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "identityOwner"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "LocalReputationUpdated"; readonly inputs: readonly [{ readonly name: "identity"; readonly type: "bytes32"; readonly indexed: true; readonly internalType: "bytes32"; }, { readonly name: "paidJobs"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }, { readonly name: "scoreSum"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "MaxBountyAmountUpdated"; readonly inputs: readonly [{ readonly name: "previous"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }, { readonly name: "next"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "OwnerTransferStarted"; readonly inputs: readonly [{ readonly name: "previous"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "pending"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "OwnerTransferred"; readonly inputs: readonly [{ readonly name: "previous"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "next"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "PausedSet"; readonly inputs: readonly [{ readonly name: "paused"; readonly type: "bool"; readonly indexed: false; readonly internalType: "bool"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "PayoutParked"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "payee"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ProtocolFeePaid"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "recipient"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "RejectionChallenged"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "worker"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "reasonHash"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "RejectionFinalized"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "RejectionProposed"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "poster"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "reasonHash"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "RejectionWithdrawn"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "WithdrawalClaimed"; readonly inputs: readonly [{ readonly name: "payee"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "WorkSubmitted"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "provider"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "ipfsResultHash"; readonly type: "string"; readonly indexed: false; readonly internalType: "string"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "WorkerBondForfeited"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "poster"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "WorkerBondPosted"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "worker"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "WorkerBondRefunded"; readonly inputs: readonly [{ readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "worker"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "amount"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "error"; readonly name: "InvalidContestParams"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "InvalidGateScore"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "InvalidIdentity"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "ReentrancyGuardReentrantCall"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "ReputationGateFailed"; readonly inputs: readonly [{ readonly name: "paidJobs"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "scoreSum"; readonly type: "uint256"; readonly internalType: "uint256"; }]; }, { readonly type: "error"; readonly name: "SafeERC20FailedOperation"; readonly inputs: readonly [{ readonly name: "token"; readonly type: "address"; readonly internalType: "address"; }]; }, { readonly type: "error"; readonly name: "UnexpectedEscrowAmount"; readonly inputs: readonly [{ readonly name: "received"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "expected"; readonly type: "uint256"; readonly internalType: "uint256"; }]; }, { readonly type: "error"; readonly name: "WrongBountyMode"; readonly inputs: readonly []; }]; /** * The canonical ERC-8004 identity registry on Monad (v2.0.0, an ERC-721 with * an agent wallet). Only what the SDK calls is listed. Unlike the Arc/Base * registry ABI in abi.ts, `register` is overloaded: no argument, or an agent URI. * Checked against the live Monad mainnet registry (selectors, the Registered * event and the EIP-712 domain). */ declare const MONAD_IDENTITY_REGISTRY_ABI: readonly [{ readonly name: "register"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly type: "uint256"; readonly name: "agentId"; }]; }, { readonly name: "register"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "string"; readonly name: "agentURI"; }]; readonly outputs: readonly [{ readonly type: "uint256"; readonly name: "agentId"; }]; }, { readonly name: "ownerOf"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly type: "uint256"; readonly name: "agentId"; }]; readonly outputs: readonly [{ readonly type: "address"; }]; }, { readonly name: "getAgentWallet"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly type: "uint256"; readonly name: "agentId"; }]; readonly outputs: readonly [{ readonly type: "address"; }]; }, { readonly name: "setAgentWallet"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "uint256"; readonly name: "agentId"; }, { readonly type: "address"; readonly name: "newWallet"; }, { readonly type: "uint256"; readonly name: "deadline"; }, { readonly type: "bytes"; readonly name: "signature"; }]; readonly outputs: readonly []; }, { readonly name: "unsetAgentWallet"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "uint256"; readonly name: "agentId"; }]; readonly outputs: readonly []; }, { readonly name: "tokenURI"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly type: "uint256"; readonly name: "agentId"; }]; readonly outputs: readonly [{ readonly type: "string"; }]; }, { readonly name: "Registered"; readonly type: "event"; readonly inputs: readonly [{ readonly type: "uint256"; readonly name: "agentId"; readonly indexed: true; }, { readonly type: "string"; readonly name: "agentURI"; }, { readonly type: "address"; readonly name: "owner"; readonly indexed: true; }]; }, { readonly name: "Transfer"; readonly type: "event"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "from"; readonly indexed: true; }, { readonly type: "address"; readonly name: "to"; readonly indexed: true; }, { readonly type: "uint256"; readonly name: "tokenId"; readonly indexed: true; }]; }, { readonly name: "ERC721NonexistentToken"; readonly type: "error"; readonly inputs: readonly [{ readonly type: "uint256"; readonly name: "tokenId"; }]; }]; /** The registry rejects a consent whose deadline is more than 5 minutes ahead ("deadline too far"). */ declare const AGENT_WALLET_MAX_DEADLINE_DELAY_SEC = 300n; type AgentWalletConsentInput = { chainId: number; /** The identity registry the consent is bound to. */ registry: Address; agentId: bigint; /** The working wallet being authorized: the wallet that signs. */ newWallet: Address; /** The identity owner who will submit it on chain. */ owner: Address; /** Unix seconds, at most 5 minutes after the block that includes the transaction's parent. */ deadline: bigint; }; /** * The EIP-712 payload the registry verifies in `setAgentWallet`: signed by the * NEW working wallet (an EOA, or an ERC-1271 contract), submitted by the owner. * Binding `owner` and `deadline` stops a stale or foreign consent from being replayed. */ declare function agentWalletTypedData(input: AgentWalletConsentInput): { readonly domain: { readonly name: "ERC8004IdentityRegistry"; readonly version: "1"; readonly chainId: number; readonly verifyingContract: `0x${string}`; }; readonly types: { readonly AgentWalletSet: readonly [{ readonly name: "agentId"; readonly type: "uint256"; }, { readonly name: "newWallet"; readonly type: "address"; }, { readonly name: "owner"; readonly type: "address"; }, { readonly name: "deadline"; readonly type: "uint256"; }]; }; readonly primaryType: "AgentWalletSet"; readonly message: { readonly agentId: bigint; readonly newWallet: `0x${string}`; readonly owner: `0x${string}`; readonly deadline: bigint; }; }; /** What the working wallet hands to the identity owner (step 1 of 2). */ type AgentWalletConsent = { agentId: bigint; newWallet: Address; owner: Address; deadline: bigint; signature: Hex; }; /** * Local copy of the adapter's pure `identityKey(agentId, humanWallet)`: the * key of `localReputation`. Agent history follows the NFT id, human history * follows the wallet. agentId 0 with no wallet reverts InvalidIdentity on * chain, so it throws here before any RPC call. */ declare function identityKey(agentId: bigint, humanWallet?: Address): Hex; /** The only contest cipher the site and the SDK speak. */ declare const CONTEST_ENCRYPTION_ALGORITHM: "x25519-xsalsa20-poly1305-sealedbox"; /** * Where a contest's private key comes from. The site decrypts entries itself only for * "wallet-signature-v1" (derived from a wallet signature) and "mera-prf-v1" (a passkey * PRF). Anything else, including the SDK default below, means the poster holds the key * and decrypts with `decryptContestEntry`. */ type NadKeySource = "wallet-signature-v1" | "mera-prf-v1" | "sdk-keypair-v1" | (string & {}); type NadContestEncryption = { version: 1; algorithm: typeof CONTEST_ENCRYPTION_ALGORITHM; /** X25519 public key, base64url without padding (43 characters). */ publicKey: string; keySource: NadKeySource; }; /** * The JSON document a bounty's `ipfsDescHash` points to. The same shape the * website writes in frontend/components/NadPost.tsx; the SDK and the site must agree on it. */ type NadDescription = { version: 1; title: string; description: string; contestEncryption?: NadContestEncryption; }; type CreateDescriptionInput = { /** The task text (Markdown is fine). */ description: string; /** Defaults to the first non-empty line of the description, cut to 120 characters (as the site does). */ title?: string; /** Contests only: the poster's X25519 public key from `generateContestKeypair()`. */ contestPublicKey?: string; /** Defaults to "sdk-keypair-v1": the site cannot decrypt, the poster keeps the private key. */ keySource?: NadKeySource; }; /** Build the description document. Pin its {@link serializeDescription} output, then pass the CID to createBounty. */ declare function createDescription(input: CreateDescriptionInput): NadDescription; /** The exact text to pin. */ declare function serializeDescription(description: NadDescription): string; /** A description as read back from IPFS, tolerant of older and hand-written documents. */ type ParsedNadDescription = { title: string; description: string; contestEncryption?: Partial; /** Legacy top-level key written by early demo scripts. */ contestPublicKey?: string; }; /** Parse a pinned description. Plain text (not JSON) is accepted as the description itself. */ declare function parseNadDescription(text: string): ParsedNadDescription; /** The key entrants encrypt to: the same lookup the website performs. */ declare function contestPublicKeyOf(description: ParsedNadDescription | NadDescription): string | undefined; /** * Encrypt a contest entry to the poster's public key and pin only the sealed * envelope. Returns the `ipfs://` URI to pass to `enterContest`. Never pass the * plaintext (or any private key) to a pin: the site and IPFS would see it. * * @param recipient the poster's public key, or the bounty's description (see `parseNadDescription`). */ declare function pinContestEntry(plaintext: string, recipient: string | ParsedNadDescription | NadDescription, signer: MessageSigner, options?: PinViaSiteOptions): Promise; /** Pure scheduler policy. The adapter still enforces every deadline and authorization. */ type NadKeeperMeta = { jobId: bigint; deadline: bigint; resolved: boolean; contest: boolean; isTaken: boolean; submittedResultHash: string; submittedAt: bigint; rejectedAt: bigint; inDispute: boolean; disputeRaisedAt: bigint; disputeResponseHash: string; }; type NadKeeperContest = { closedAt: bigint; entryCount: number; challenges: readonly { challengedAt: bigint; respondedAt: bigint; }[]; }; declare const NAD_SETTLEMENTS: readonly ["autoApprove", "expireBounty", "finalizeRejection", "claimDefaultRuling", "claimArbitratorTimeout", "reconcileExpiredEscrow", "settleContestSilence", "finalizeContestRejection", "claimContestDefault", "claimContestArbitratorTimeout"]; type NadSettlement = typeof NAD_SETTLEMENTS[number]; declare function selectNadSettlement(meta: NadKeeperMeta, now: bigint, contest?: NadKeeperContest, escrowExpired?: boolean): NadSettlement | null; /** Mirrors the adapter's APPROVAL_TIMEOUT (14 days), REJECTION_CHALLENGE_WINDOW and DISPUTE_RESPONSE_WINDOW (48 hours), ARBITRATOR_TIMEOUT (30 days). */ declare const NAD_WINDOWS: { readonly approval: bigint; readonly challenge: bigint; readonly response: bigint; readonly arbitrator: bigint; }; /** How the address relates to the job. */ type NadPendingRole = "poster" | "worker" | "entrant"; /** Decisions that only a party to the job can take, inside a deadline. */ type NadResponseAction = "approveBounty" | "challengeRejection" | "respondToDispute" | "pickContestWinners" | "challengeContestRejection" | "respondToContestChallenges"; type NadPendingBase = { jobId: bigint; /** How the address relates to the job. */ role: NadPendingRole; reason: string; }; /** * A settlement anyone may trigger right now, with no judgment needed. The whole * call is `agent[action](jobId)`. */ type NadPendingClaim = NadPendingBase & { kind: "claim"; /** The `NadBountyAgent` method to call with this jobId. */ action: NadSettlement; expiresAt?: undefined; }; /** * A decision for this role that is open now and ends at `expiresAt` (unix * seconds), after which the other side may win by default. The method needs * more than the jobId (a score, a reason or evidence CID), so decide first. */ type NadPendingDecision = NadPendingBase & { kind: "respond"; /** The `NadBountyAgent` method to call. */ action: NadResponseAction; expiresAt: bigint; }; /** `{ jobId, role, action }` plus `kind` to tell the two apart. */ type NadPendingAction = NadPendingClaim | NadPendingDecision; type NadPendingMeta = NadKeeperMeta & { poster: Address; assignedProvider: Address; agentId: bigint; disputeByWorker: boolean; }; type NadPendingContest = { closedAt: bigint; entryCount: number; challenges: readonly { index: number; challengedAt: bigint; respondedAt: bigint; }[]; /** Needed to find the address among the entrants; omit for contests the address merely posted. */ entries?: readonly { agentId: bigint; entrant: Address; }[]; }; type NadPendingJob = { meta: NadPendingMeta; contest?: NadPendingContest; /** The escrow job reached its Expired status (see `reconcileExpiredEscrow`). */ escrowExpired: boolean; }; /** * Pure policy behind `NadBountyAgent.getPendingActions`: given the on-chain state * of the jobs an address touches, list what can be done now. It never calls the * network, so it can run over indexed data too. Settlement choice is exactly * {@link selectNadSettlement}, the keeper's policy. * * A job produces at most one entry per action. When the address has several * roles on one job, the first of poster, worker, entrant is reported. */ declare function computePendingActions(jobs: readonly NadPendingJob[], who: { address?: Address; agentId?: bigint; }, now: bigint): NadPendingAction[]; type NadBountyCreateParams = ContractFunctionArgs[0]; /** The adapter's `BountyMeta` struct as returned by `getBounty`. */ type NadBountyMeta = ContractFunctionReturnType; type NadAgentReputation = ContractFunctionReturnType; type NadBountyAgentConfig = { network: MonadNetworkName; /** Omit for a genuinely read-only client: no burner signing key is created. */ privateKey?: Hash; /** * The V4.8 adapter. Optional on "monad-mainnet", which has a built-in canonical * deployment (MONAD_NETWORKS["monad-mainnet"].defaultBountyAdapter); required on * "monad-testnet". Never falls back to an Arc/Base environment variable. */ bountyAdapterAddress?: Address; rpcUrl?: string; }; /** Paid jobs and score sum of one identity (the adapter keeps no averages). */ type NadReputationTotals = { paidJobs: bigint; scoreSum: bigint; }; /** One source-chain snapshot in the ReputationMirror. */ type NadMirrorRecord = { paidJobs: bigint; scoreSum: bigint; sourceBlock: bigint; updatedAt: bigint; }; /** The chains the mirror accepts snapshots from (equal to the contract's BASE_CHAIN_ID and ARC_CHAIN_ID). */ declare const MIRROR_SOURCE_CHAINS: { readonly base: 8453n; readonly arc: 5042n; }; type NadIdentity = { owner: Address; workingWallet: Address; }; type NadPendingWithdrawals = { /** USDC parked for the address after a failed direct payout; claim with `withdraw()`. */ address: bigint; /** USDC parked for the identity; claim with `withdrawIdentity(agentId)` as the identity owner. */ identity: bigint; }; /** * V4.8 client for NadBounty on Monad. A separate ABI keeps deployed V4.7 tuple * layouts compatible. Every thrown viem error is rewritten into a readable * `NadBountyError`; RPC URLs never appear in error text. */ declare class NadBountyAgent { readonly network: MonadNetworkConfig & { rpcUrl: string; }; readonly networkName: MonadNetworkName; readonly address: Address; readonly bountyAdapter: Address; private readonly publicClient; private readonly signer?; /** True when `bountyAdapter` is the built-in canonical deployment, whose escrow and mirror are known. */ private readonly canonical; private escrowAddress?; private mirrorAddress?; constructor(config: NadBountyAgentConfig); /** Run an RPC-touching step; viem errors come out as readable NadBountyErrors without the RPC URL. */ private rpc; private requireSigner; /** A caller-supplied or default address, never the zero address of a read-only client. */ private requireAddress; private assertChain; /** Every write checks the RPC and immutable dependencies before estimation/signing. */ private assertDeployment; /** Batched reads through Multicall3: one eth_call per chunk. Any failing call fails the batch. */ private batch; private adapterCall; private receipt; /** Estimate, add the +50% limit buffer (Monad bills the gas limit), sign, send and wait. */ private send; private write; private allowance; /** Current authorization is read each time; revoked working keys are never cached. */ identityOwner(agentId: bigint): Promise
; private assertWorker; /** * Mint an ERC-8004 identity owned by this wallet. With a URI it registers * `register(string)`, otherwise `register()`. The new agentId comes from the * registry's `Registered` event (or the mint `Transfer`) in the receipt. * A fresh identity's working wallet is its owner until you set another. * * @param metadataUri an `ipfs://` agent card, for example from `pinAgentMetadata`. */ registerIdentity(metadataUri?: string): Promise<{ agentId: bigint; hash: Hash; receipt: TransactionReceipt; }>; /** Owner and current working wallet of an identity. Throws a readable error if the agentId does not exist. */ getIdentity(agentId: bigint): Promise; /** * Step 1 of 2 for giving an identity a working wallet. Run it on a client * built with the WORKING wallet's key: that wallet signs an EIP-712 * `AgentWalletSet` consent naming the identity, the owner and a deadline. * Hand the result to the owner, who calls {@link setAgentWallet} (step 2). * * The registry accepts a deadline at most 5 minutes ahead, so the default is * 300 seconds from the latest block; submit promptly or sign again. */ signAgentWalletConsent(opts: { agentId: bigint; owner: Address; deadline?: bigint; }): Promise; /** * Step 2 of 2: the identity OWNER registers the working wallet using the * consent from {@link signAgentWalletConsent}. A working wallet can take * bounties and enter contests for the identity but never withdraw earnings: * payouts always go to the owner. Setting a new wallet revokes the old one. */ setAgentWallet(agentId: bigint, consent: AgentWalletConsent): Promise; /** Same as {@link setAgentWallet}. */ setWorkingWallet(agentId: bigint, consent: AgentWalletConsent): Promise; /** Owner only: remove the working wallet (for example after its key leaked). */ unsetAgentWallet(agentId: bigint): Promise; createBounty(params: NadBountyCreateParams): Promise<{ jobId: bigint; receipt: TransactionReceipt; }>; takeBounty(jobId: bigint, agentId?: bigint): Promise; autoApprove(jobId: bigint): Promise; withdrawRejection(jobId: bigint): Promise; cancelBounty(jobId: bigint): Promise; expireBounty(jobId: bigint): Promise; rejectBounty(jobId: bigint, reasonCid: string): Promise; challengeRejection(jobId: bigint, evidenceCid: string): Promise; /** Single-taker dispute by the poster or the worker, on a submission that is not rejected (use challengeRejection after a rejection). */ disputeBounty(jobId: bigint, reasonCid: string): Promise; respondToDispute(jobId: bigint, responseCid: string): Promise; finalizeRejection(jobId: bigint): Promise; claimDefaultRuling(jobId: bigint): Promise; claimArbitratorTimeout(jobId: bigint): Promise; resolveDispute(jobId: bigint, providerWins: boolean, rulingCid: string, penalty: number): Promise; submitWork(jobId: bigint, cid: string): Promise; approveBounty(jobId: bigint, score: number): Promise; enterContest(jobId: bigint, agentId: bigint, encryptedCid: string): Promise; replaceContestEntry(jobId: bigint, index: number, encryptedCid: string): Promise; pickContestWinners(jobId: bigint, indices: readonly number[], scores: readonly number[]): Promise; rejectAllContestEntries(jobId: bigint, reasonCid: string): Promise; /** Poster only: retract "reject all" before any entrant challenged it. The review window is not extended. */ withdrawContestRejection(jobId: bigint): Promise; challengeContestRejection(jobId: bigint, index: number, evidenceCid: string): Promise; respondToContestChallenges(jobId: bigint, responseCid: string): Promise; acceptContestChallengers(jobId: bigint, indices: readonly number[], scores: readonly number[]): Promise; resolveContestDispute(jobId: bigint, indices: readonly number[], rulingCid: string): Promise; settleContestSilence(jobId: bigint): Promise; finalizeContestRejection(jobId: bigint): Promise; claimContestDefault(jobId: bigint): Promise; claimContestArbitratorTimeout(jobId: bigint): Promise; reconcileExpiredEscrow(jobId: bigint): Promise; withdraw(): Promise; withdrawIdentity(agentId: bigint): Promise; getBounty(jobId: bigint): Promise<{ jobId: bigint; poster: `0x${string}`; reward: bigint; deadline: bigint; ipfsDescHash: string; category: string; tags: readonly string[]; agentId: bigint; agentOnly: boolean; humanOnly: boolean; whitelistedProvider: `0x${string}`; assignedProvider: `0x${string}`; submittedResultHash: string; submittedAt: bigint; isTaken: boolean; rejectedAt: bigint; rejectionReasonHash: string; inDispute: boolean; resolved: boolean; disputeInitiator: `0x${string}`; disputeRaisedAt: bigint; disputeReasonHash: string; disputeResponseHash: string; disputeRulingHash: string; requireWorkerBond: boolean; workerBond: bigint; bondPayer: `0x${string}`; disputeByWorker: boolean; contest: boolean; maxEntries: number; winners: number; minJobs: bigint; minAvgScore: number; }>; getOpenBounties(category?: string, offset?: bigint, limit?: bigint): Promise; getAgentBounties(agentId: bigint): Promise; totalBounties(): Promise; getContestEntries(jobId: bigint): Promise; getContestState(jobId: bigint): Promise; getContestChallengers(jobId: bigint): Promise; getContestChallenge(jobId: bigint, index: number): Promise<{ challengedAt: bigint; respondedAt: bigint; evidenceHash: string; responseHash: string; }>; /** * Paid jobs and score sum of an identity: local history plus the Base and Arc * snapshots of its current owner. Returns the contract's `[paidJobs, scoreSum]` tuple. * An agentId of 0 means a human, identified by `humanWallet`; a read-only client * has no default wallet, so pass one. Throws before any RPC call otherwise. */ getIdentityReputation(agentId: bigint, humanWallet?: Address): Promise; /** Whether the adapter is paused. Paused blocks createBounty/takeBounty/enterContest only; exits and settlements stay open. */ isPaused(): Promise; /** Per-bounty reward cap in USDC base units (100 USDC = 100000000 at launch); 0 means uncapped. */ maxBountyAmount(): Promise; /** Protocol fee in basis points of the payout (immutable; 100 = 1%). */ feeBps(): Promise; /** USDC parked for an address after a failed direct payout; claim it with `withdraw()`. */ pendingWithdrawals(address?: Address): Promise; /** USDC parked for an identity when its owner could not be resolved at settlement; claim with `withdrawIdentity(agentId)`. */ pendingIdentityWithdrawals(agentId: bigint): Promise; /** Both parked balances in one call. Pass an address, an agentId, or both. */ getPendingWithdrawals(opts?: { address?: Address; agentId?: bigint; }): Promise; /** * The key of `localReputation` for an agent (history follows the NFT id) or a * human wallet. Computed locally, identical to the contract's pure function. */ identityKey(agentId: bigint, humanWallet?: Address): Hex; /** Paid jobs and score sum recorded on this adapter for one identity (without the mirrored Base/Arc history). */ localReputation(identity: Hex | { agentId: bigint; humanWallet?: Address; }): Promise; /** The canonical ERC-8004 reputation registry's summary of this adapter's feedback for an agent. */ getAgentReputation(agentId: bigint): Promise; /** How many distinct posters have paid out a completed bounty to this agent (an anti-sybil signal; humans are never counted). */ uniquePosterCount(agentId: bigint): Promise; /** Job ids this poster created, oldest first. Defaults to this client's address. */ getMyPostedBounties(poster?: Address): Promise; /** Job ids this wallet took or entered, oldest first (contest entries count). Defaults to this client's address. */ getMyAssignedBounties(provider?: Address): Promise; /** When a contest stopped accepting entries: unix seconds, or 0n while still open. Reverts WrongBountyMode on a single-taker bounty. */ contestClosedAt(jobId: bigint): Promise; /** * The index of this identity's entry in a contest, or null if it has not entered. * (The contract returns index + 1, with 0 for "none"; this unwraps it.) * agentId 0 means a human entrant identified by `humanWallet`. */ getContestEntryIndex(jobId: bigint, agentId: bigint, humanWallet?: Address): Promise; /** Open bounties with their full metadata in two RPC calls (ids, then one batched read). */ listOpenBounties(opts?: { category?: string; offset?: bigint; limit?: bigint; }): Promise; usdcBalance(address?: Address): Promise; /** Native MON balance in wei (18 decimals). Gas is billed on the gas limit, so keep a margin. */ monBalance(address?: Address): Promise; private mirror; /** Mirrored Base + Arc paid jobs and score sum of an identity owner (sums, never averages). */ getMirrorTotals(identityOwner: Address): Promise; /** The raw per-source-chain snapshots behind the totals, with the source block they were read at. */ getMirrorRecords(identityOwner: Address): Promise<{ base: NadMirrorRecord; arc: NadMirrorRecord; }>; /** * Pin text to IPFS and return its `ipfs://` URI. Uses your own Pinata key * (PINATA_JWT, or PINATA_API_KEY + PINATA_SECRET) when set, else the site's * pin route for this network (nadbounty.app on mainnet), signed by this wallet. */ pin(content: string, options?: PinViaSiteOptions): Promise; /** Build the description document, pin it and return the `ipfs://` URI for `createBounty`'s `ipfsDescHash`. */ pinDescription(input: CreateDescriptionInput, options?: PinViaSiteOptions): Promise; /** Fetch and parse a bounty's description from IPFS. */ getBountyDescription(jobId: bigint): Promise; /** * Encrypt `plaintext` to the poster's key found in the contest's description and * pin only the sealed envelope. Returns the `ipfs://` URI to pass to `enterContest`. */ pinContestEntry(jobId: bigint, plaintext: string, options?: PinViaSiteOptions): Promise; private escrow; /** * What can be done right now on the jobs an address (and/or an identity) touches: * settlements anyone may trigger ("claim") and decisions that have a deadline * ("respond"). Read-only; no log queries (the public RPC caps those at 100 * blocks). Cost is a handful of Multicall3 requests regardless of how many jobs * are scanned: one for the job lists, one for their metadata, one for contest * and escrow state, and one for contest challenges when any exist. * * Each entry is `{ jobId, role, action, kind, reason, expiresAt? }`, where * `action` is the `NadBountyAgent` method to call with the jobId. * * @param opts.address a wallet: its posted bounties and everything it took or entered. Defaults to this client. * @param opts.agentId also include every job taken or entered by this identity, from any of its wallets. * @param opts.maxJobs scan only the newest N job ids of each list (default 200); raise it for very busy accounts. * @param opts.now unix seconds to evaluate at; defaults to the latest block time. */ getPendingActions(opts?: { address?: Address; agentId?: bigint; maxJobs?: number; now?: bigint; }): Promise; } /** * A failed NadBounty call, translated from a raw viem error blob. `code` is the * adapter's custom error name (for example "ReputationGateFailed"), the revert * string (for example "paused"), or one of "INSUFFICIENT_FUNDS", "NETWORK", * "UNRECOGNIZED_REVERT", "UNKNOWN". The message never contains the RPC URL and * the original error is deliberately not attached as `cause`, because its text * does include it. */ declare class NadBountyError extends Error { readonly code: string; readonly args: readonly unknown[]; constructor(message: string, code: string, args?: readonly unknown[]); } /** Replace every http(s) URL (an RPC endpoint can carry an API key in its path). */ declare function redactUrls(text: string): string; /** * Turn whatever viem threw into a readable {@link NadBountyError}. Errors that * are not viem errors and carry no URL are returned unchanged, so messages the * SDK itself wrote ("Wrong Monad RPC chain") stay as they are. * * @param context the SDK method that was running, for example "takeBounty". */ declare function toNadError(error: unknown, context?: string): Error; /** The fields of the adapter's `createBounty` struct that are checked client-side. */ type NadCreateParamsLike = { reward: bigint; deadline: bigint; ipfsDescHash: string; category: string; tags: readonly string[]; agentOnly: boolean; humanOnly: boolean; requireWorkerBond: boolean; contest: boolean; maxEntries: number; winners: number; minAvgScore: number; }; /** * Mirror of what the adapter's `createBounty` enforces, run before the USDC * approval is sent so a mistake does not cost an approve transaction first. * The chain stays the authority; this only catches the common footguns: * a duration or milliseconds passed as `deadline`, a reward not in USDC base * units, and contest shapes the contract refuses. * * @param nowSec current unix time in seconds (injectable for tests). */ declare function validateNadCreateParams(p: NadCreateParamsLike, nowSec: bigint): void; declare const REPUTATION_MIRROR_ABI: readonly [{ readonly type: "constructor"; readonly inputs: readonly [{ readonly name: "initialOwner"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "initialRelayer"; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "ARC_CHAIN_ID"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "BASE_CHAIN_ID"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "MAX_BATCH_SIZE"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "MAX_REPORT_BYTES"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "acceptOwnership"; readonly inputs: readonly []; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "forwarder"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "getTotals"; readonly inputs: readonly [{ readonly name: "identityOwner"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly [{ readonly name: "paidJobs"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "scoreSum"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "invalidateRecord"; readonly inputs: readonly [{ readonly name: "identityOwner"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "sourceChain"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "onReport"; readonly inputs: readonly [{ readonly name: "metadata"; readonly type: "bytes"; readonly internalType: "bytes"; }, { readonly name: "report"; readonly type: "bytes"; readonly internalType: "bytes"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "owner"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "pendingOwner"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "records"; readonly inputs: readonly [{ readonly name: "identityOwner"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "sourceChain"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly outputs: readonly [{ readonly name: "paidJobs"; readonly type: "uint64"; readonly internalType: "uint64"; }, { readonly name: "scoreSum"; readonly type: "uint128"; readonly internalType: "uint128"; }, { readonly name: "sourceBlock"; readonly type: "uint64"; readonly internalType: "uint64"; }, { readonly name: "updatedAt"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "relayer"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "renounceOwnership"; readonly inputs: readonly []; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "setForwarder"; readonly inputs: readonly [{ readonly name: "next"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "nextWorkflowId"; readonly type: "bytes32"; readonly internalType: "bytes32"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "setRelayer"; readonly inputs: readonly [{ readonly name: "next"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "supportsInterface"; readonly inputs: readonly [{ readonly name: "interfaceId"; readonly type: "bytes4"; readonly internalType: "bytes4"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "bool"; readonly internalType: "bool"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "transferOwnership"; readonly inputs: readonly [{ readonly name: "newOwner"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "updateRecords"; readonly inputs: readonly [{ readonly name: "updates"; readonly type: "tuple[]"; readonly internalType: "struct ReputationMirror.Update[]"; readonly components: readonly [{ readonly name: "identityOwner"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "sourceChain"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "sourceBlock"; readonly type: "uint64"; readonly internalType: "uint64"; }, { readonly name: "paidJobs"; readonly type: "uint64"; readonly internalType: "uint64"; }, { readonly name: "scoreSum"; readonly type: "uint128"; readonly internalType: "uint128"; }]; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "workflowId"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "bytes32"; readonly internalType: "bytes32"; }]; readonly stateMutability: "view"; }, { readonly type: "event"; readonly name: "ForwarderUpdated"; readonly inputs: readonly [{ readonly name: "forwarder"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "workflowId"; readonly type: "bytes32"; readonly indexed: true; readonly internalType: "bytes32"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "OwnershipTransferStarted"; readonly inputs: readonly [{ readonly name: "previousOwner"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "newOwner"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "OwnershipTransferred"; readonly inputs: readonly [{ readonly name: "previousOwner"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "newOwner"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "RecordInvalidated"; readonly inputs: readonly [{ readonly name: "identityOwner"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "sourceChain"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "previousSourceBlock"; readonly type: "uint64"; readonly indexed: false; readonly internalType: "uint64"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "RelayerUpdated"; readonly inputs: readonly [{ readonly name: "previous"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "next"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ReputationUpdated"; readonly inputs: readonly [{ readonly name: "identityOwner"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "sourceChain"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "sourceBlock"; readonly type: "uint64"; readonly indexed: false; readonly internalType: "uint64"; }, { readonly name: "paidJobs"; readonly type: "uint64"; readonly indexed: false; readonly internalType: "uint64"; }, { readonly name: "scoreSum"; readonly type: "uint128"; readonly indexed: false; readonly internalType: "uint128"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "StaleRecordIgnored"; readonly inputs: readonly [{ readonly name: "identityOwner"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "sourceChain"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "sourceBlock"; readonly type: "uint64"; readonly indexed: false; readonly internalType: "uint64"; }]; readonly anonymous: false; }, { readonly type: "error"; readonly name: "InvalidBatchSize"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "InvalidForwarderConfiguration"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "InvalidMetadata"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "InvalidRecord"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "OwnableInvalidOwner"; readonly inputs: readonly [{ readonly name: "owner"; readonly type: "address"; readonly internalType: "address"; }]; }, { readonly type: "error"; readonly name: "OwnableUnauthorizedAccount"; readonly inputs: readonly [{ readonly name: "account"; readonly type: "address"; readonly internalType: "address"; }]; }, { readonly type: "error"; readonly name: "UnauthorizedReporter"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "UnsupportedSource"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "WrongWorkflow"; readonly inputs: readonly []; }]; declare const KEEPER_RECEIVER_ABI: readonly [{ readonly type: "constructor"; readonly inputs: readonly [{ readonly name: "initialOwner"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "initialRelayer"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "target"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "kind"; readonly type: "uint8"; readonly internalType: "enum KeeperReceiver.AdapterKind"; }]; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "ACTION_GAS_LIMIT"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "MAX_BATCH_SIZE"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "MAX_REPORT_BYTES"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "POST_CALL_GAS_RESERVE"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "acceptOwnership"; readonly inputs: readonly []; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "adapter"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "adapterKind"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint8"; readonly internalType: "enum KeeperReceiver.AdapterKind"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "execute"; readonly inputs: readonly [{ readonly name: "actions"; readonly type: "tuple[]"; readonly internalType: "struct KeeperReceiver.Action[]"; readonly components: readonly [{ readonly name: "kind"; readonly type: "uint8"; readonly internalType: "uint8"; }, { readonly name: "jobId"; readonly type: "uint256"; readonly internalType: "uint256"; }]; }]; readonly outputs: readonly [{ readonly name: "successes"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "failures"; readonly type: "uint256"; readonly internalType: "uint256"; }]; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "forwarder"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "onReport"; readonly inputs: readonly [{ readonly name: "metadata"; readonly type: "bytes"; readonly internalType: "bytes"; }, { readonly name: "report"; readonly type: "bytes"; readonly internalType: "bytes"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "owner"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "pendingOwner"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "relayer"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; readonly internalType: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "renounceOwnership"; readonly inputs: readonly []; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "setForwarder"; readonly inputs: readonly [{ readonly name: "next"; readonly type: "address"; readonly internalType: "address"; }, { readonly name: "nextWorkflowId"; readonly type: "bytes32"; readonly internalType: "bytes32"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "setRelayer"; readonly inputs: readonly [{ readonly name: "next"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "supportsInterface"; readonly inputs: readonly [{ readonly name: "interfaceId"; readonly type: "bytes4"; readonly internalType: "bytes4"; }]; readonly outputs: readonly [{ readonly name: ""; readonly type: "bool"; readonly internalType: "bool"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly name: "transferOwnership"; readonly inputs: readonly [{ readonly name: "newOwner"; readonly type: "address"; readonly internalType: "address"; }]; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly name: "workflowId"; readonly inputs: readonly []; readonly outputs: readonly [{ readonly name: ""; readonly type: "bytes32"; readonly internalType: "bytes32"; }]; readonly stateMutability: "view"; }, { readonly type: "event"; readonly name: "ActionExecuted"; readonly inputs: readonly [{ readonly name: "index"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "kind"; readonly type: "uint8"; readonly indexed: true; readonly internalType: "uint8"; }, { readonly name: "jobId"; readonly type: "uint256"; readonly indexed: true; readonly internalType: "uint256"; }, { readonly name: "success"; readonly type: "bool"; readonly indexed: false; readonly internalType: "bool"; }, { readonly name: "errorSelector"; readonly type: "bytes4"; readonly indexed: false; readonly internalType: "bytes4"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "BatchExecuted"; readonly inputs: readonly [{ readonly name: "successes"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }, { readonly name: "failures"; readonly type: "uint256"; readonly indexed: false; readonly internalType: "uint256"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "ForwarderUpdated"; readonly inputs: readonly [{ readonly name: "forwarder"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "workflowId"; readonly type: "bytes32"; readonly indexed: true; readonly internalType: "bytes32"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "OwnershipTransferStarted"; readonly inputs: readonly [{ readonly name: "previousOwner"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "newOwner"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "OwnershipTransferred"; readonly inputs: readonly [{ readonly name: "previousOwner"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "newOwner"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }]; readonly anonymous: false; }, { readonly type: "event"; readonly name: "RelayerUpdated"; readonly inputs: readonly [{ readonly name: "previous"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "next"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }]; readonly anonymous: false; }, { readonly type: "error"; readonly name: "InsufficientExecutionGas"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "InvalidAdapter"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "InvalidBatchSize"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "InvalidForwarderConfiguration"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "InvalidMetadata"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "OwnableInvalidOwner"; readonly inputs: readonly [{ readonly name: "owner"; readonly type: "address"; readonly internalType: "address"; }]; }, { readonly type: "error"; readonly name: "OwnableUnauthorizedAccount"; readonly inputs: readonly [{ readonly name: "account"; readonly type: "address"; readonly internalType: "address"; }]; }, { readonly type: "error"; readonly name: "ReentrancyGuardReentrantCall"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "UnauthorizedReporter"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "UnsupportedAction"; readonly inputs: readonly []; }, { readonly type: "error"; readonly name: "WrongWorkflow"; readonly inputs: readonly []; }]; type ContestEncryptionKeypair = { publicKey: string; privateKey: string; }; type EncryptedContestEntry = { version: 1; algorithm: "x25519-xsalsa20-poly1305-sealedbox"; recipientPublicKey: string; ciphertext: string; }; /** Generate once and retain the private key securely; publish only publicKey. */ declare function generateContestKeypair(): Promise; /** Seed is a private, uniformly random 32-byte value (or a suitably derived PRF key). */ declare function contestKeypairFromSeed(seed: Uint8Array): Promise; /** Derive locally from private PRF/signature bytes. Never publish that input. */ declare function deriveContestKeypair(secret: Uint8Array, context: string): Promise; declare function encryptContestEntry(plaintext: string, recipientPublicKey: string): Promise; declare function decryptContestEntry(entry: EncryptedContestEntry, key: ContestEncryptionKeypair): Promise; export { AGENT_WALLET_MAX_DEADLINE_DELAY_SEC, ARC_TESTNET_CHAIN_ID, ARC_TESTNET_RPC, type AgentInfo, type AgentMetadata, type AgentWalletConsent, type AgentWalletConsentInput, ArcBountyAgent, type ArcBountyAgentConfig, type ArcBountySection, BOUNTY_ADAPTER_ABI, BOUNTY_ADAPTER_V48_ABI, type BountyMeta, type Brand, CONTEST_ENCRYPTION_ALGORITHM, CONTRACTS, type CircleWalletConfig, type ContestEncryptionKeypair, type CreateBountyOptions, type CreateDescriptionInput, DEFAULT_PIN_URL, type DisputeEvidenceOptions, ERC20_ABI, type EncryptedContestEntry, IDENTITY_REGISTRY_ABI, KEEPER_RECEIVER_ABI, MIN_BOND_BOUNTY_DURATION_SEC, MIN_BOND_TAKE_WINDOW_SEC, MIRROR_SOURCE_CHAINS, MONAD_IDENTITY_REGISTRY_ABI, MONAD_MULTICALL3, MONAD_NETWORKS, type MessageSigner, type MonadNetworkConfig, type MonadNetworkName, NAD_CATEGORIES, NAD_MIN_REWARD, NAD_SETTLEMENTS, NAD_WINDOWS, NETWORKS, type NadAgentReputation, NadBountyAgent, type NadBountyAgentConfig, type NadBountyCreateParams, NadBountyError, type NadBountyMeta, type NadCategory, type NadContestEncryption, type NadCreateParamsLike, type NadDescription, type NadIdentity, type NadKeeperContest, type NadKeeperMeta, type NadKeySource, type NadMirrorRecord, type NadPendingAction, type NadPendingClaim, type NadPendingContest, type NadPendingDecision, type NadPendingJob, type NadPendingMeta, type NadPendingRole, type NadPendingWithdrawals, type NadReputationTotals, type NadResponseAction, type NadSettlement, type NativeCurrency, type NetworkConfig, type NetworkName, type OpenBountiesFilter, type ParsedNadDescription, type PendingAction, type PendingActionKind, type PinViaSiteOptions, REPUTATION_MIRROR_ABI, type ReputationScore, type SubmitWorkOptions, type TxResult, agentWalletTypedData, bondCreateDeadlineOk, bondTakeWindowOk, computePendingActions, contestKeypairFromSeed, contestPublicKeyOf, createDescription, decryptContestEntry, deriveContestKeypair, encryptContestEntry, fetchIpfsJson, fetchIpfsText, generateContestKeypair, identityKey, isPinningConfigured, matchesBountyFilter, parseNadDescription, parseUsdc, pinAgentMetadata, pinAuthMessage, pinContestEntry, pinText, pinTextAuto, pinTextViaSite, pinUrlFor, redactUrls, resolveDeadline, resolveNetwork, selectNadSettlement, serializeDescription, toNadError, validateAgentMetadata, validateNadCreateParams, workerBondFor };