import { type RegisterWebhookParams, type RegisterWebhookResult, type SimulatePolicyDataParams, type SimulatePolicyDataResult, type SimulatePolicyDataWithClientParams, type SimulatePolicyDataWithClientResult, type SimulatePolicyParams, type SimulatePolicyResult, type SimulateTaskParams, type SimulateTaskResult, type SubmitEvaluationRequestParams, type SubmitIntentResult, type Task, type TaskId, type TaskResponseResult, TaskStatus, type UnregisterWebhookResult } from '../../types/task'; import { type Address, type PublicClient as Client, type Hex, type WalletClient } from 'viem'; export interface CreateTaskResult { task_id: Hex; task_request: unknown; status: 'Completed' | 'Failed'; aggregation_response: unknown; timestamp: number; error?: unknown; } export interface PendingTaskBuilder { readonly taskId?: TaskId; waitForTaskResponded: ({ timeoutMs, }: { timeoutMs?: number; }) => Promise; } declare const waitForTaskResponded: (publicClient: Client, args: { taskId?: Hex; timeoutMs?: number; abortSignal?: AbortSignal; }, taskManagerAddress: Address, taskRequestedAtBlock?: bigint) => Promise; declare const getTaskResponseHash: (publicClient: Client, args: { taskId: TaskId; }, taskManagerAddress: Address) => Promise; declare const getTaskStatus: (publicClient: Client, args: { taskId: TaskId; }, taskManagerAddress: Address, attestationValidatorAddress: Address) => Promise; declare function submitEvaluationRequest(walletClient: WalletClient, args: SubmitEvaluationRequestParams, taskManagerAddress: Address, apiKey: string, gatewayApiUrlOverride?: string): Promise<{ result: { taskId: Hex; txHash: Hex; }; } & PendingTaskBuilder>; /** * Evaluate intent directly without waiting for task response confirmation on source chain. * Results are to be used with `validateAttestationDirect` on NewtonPolicyClient (NewtonProverTaskManagerShared) * * @param walletClient - Wallet client * @param args - Evaluation request parameters * @param apiKey - API key * @param gatewayApiUrlOverride - Gateway API URL override * @returns Evaluation result */ declare function evaluateIntentDirect(walletClient: WalletClient, args: SubmitEvaluationRequestParams, apiKey: string, gatewayApiUrlOverride?: string): Promise<{ result: { evaluationResult: boolean; task: Task; taskResponse: unknown; blsSignature: unknown; }; }>; /** * Submit intent and subscribe to task response on source chain (this will be slower but can be used to challenge the task evaluation) * Results are to be used with `validateAttestation` on NewtonPolicyClient (NewtonProverTaskManager) * * @param walletClient - Wallet client * @param args * @param apiKey * @param gatewayApiUrlOverride * @returns */ declare function submitIntentAndSubscribe(walletClient: WalletClient, args: SubmitEvaluationRequestParams, apiKey: string, gatewayApiUrlOverride?: string): Promise<{ result: SubmitIntentResult; ws: WebSocket; }>; /** * Simulates task evaluation (newt_simulateTask). Forwards to an operator and returns allow/deny without executing on-chain. */ declare function simulateTask(walletClient: WalletClient, args: SimulateTaskParams, apiKey: string, gatewayApiUrlOverride?: string): Promise; /** * Simulates full Rego policy evaluation (newt_simulatePolicy). Tests policy with sample intent and policy data; may require ownership if PolicyData uses stored secrets. */ declare function simulatePolicy(walletClient: WalletClient, args: SimulatePolicyParams, apiKey: string, gatewayApiUrlOverride?: string): Promise; /** * Simulates PolicyData WASM execution with caller-provided secrets (newt_simulatePolicyData). No ownership verification. */ declare function simulatePolicyData(walletClient: WalletClient, args: SimulatePolicyDataParams, apiKey: string, gatewayApiUrlOverride?: string): Promise; /** * Simulates PolicyData WASM execution with stored secrets for a policy client (newt_simulatePolicyDataWithClient). Requires ownership. */ declare function simulatePolicyDataWithClient(walletClient: WalletClient, args: SimulatePolicyDataWithClientParams, apiKey: string, gatewayApiUrlOverride?: string): Promise; /** * Register a webhook for task failure notifications (newt_registerWebhook). */ declare function registerWebhook(chainId: number, apiKey: string, params: RegisterWebhookParams, gatewayApiUrlOverride?: string): Promise; /** * Unregister the webhook for the API key (newt_unregisterWebhook). */ declare function unregisterWebhook(chainId: number, apiKey: string, gatewayApiUrlOverride?: string): Promise; export { submitEvaluationRequest, waitForTaskResponded, getTaskResponseHash, getTaskStatus, evaluateIntentDirect, submitIntentAndSubscribe, simulateTask, simulatePolicy, simulatePolicyData, simulatePolicyDataWithClient, registerWebhook, unregisterWebhook, };