import type { EnvVar, Job, JobEnvironmentsEncrypted, JobId } from './env.js'; /** * Metric pool IDs on the `acurastCompute` pallet (u8). Field names mirror the * on-chain pool slugs (`v1_`). Only pools that exist on every supported * network are exposed — `ram_speed` and `storage_speed` (canary/devnet only) * are intentionally omitted. */ export interface BenchmarkPoolIds { cpuSingleCore: number; cpuMultiCore: number; ramTotal: number; storageAvail: number; } /** * Optional minimum processor benchmark criteria. Encoded on-chain as * `Vec<(pool_id, numerator, denominator)>` rational FixedU128 thresholds. * Each filter maps to one chain pool (see {@link BenchmarkPoolIds}). */ export interface BenchmarkFilters { /** Minimum total RAM (bytes). Routed to the `v1_ram_total` pool. */ minRamTotalBytes?: number; /** Minimum CPU single-core benchmark score. */ minCpuSingleCoreScore?: number; /** Minimum CPU multi-core benchmark score. */ minCpuMultiCoreScore?: number; /** Minimum available storage capacity (bytes). Routed to the `v1_storage_avail` pool. */ minStorageAvailBytes?: number; /** Override default metric pool IDs when governance reassigns them. */ poolIds?: Partial; } export interface AcurastProjectConfig { projectName: string; fileUrl: string; entrypoint?: string; image?: { url: string; sha256: string; }; network: 'mainnet' | 'canary'; onlyAttestedDevices: boolean; startAt?: { msFromNow: number; } | { timestamp: number | string; }; assignmentStrategy: { type: AssignmentStrategyVariant.Single; instantMatch?: { processor: string; maxAllowedStartDelayInMs: number; }[]; } | { type: AssignmentStrategyVariant.Competing; }; execution: { type: 'onetime'; maxExecutionTimeInMs: number; } | { type: 'interval'; intervalInMs: number; numberOfExecutions: number; maxExecutionTimeInMs?: number; }; maxAllowedStartDelayInMs: number; usageLimit: { maxMemory: number; maxNetworkRequests: number; maxStorage: number; }; numberOfReplicas: number; requiredModules?: RequiredModules[]; minProcessorReputation: number; maxCostPerExecution: number; includeEnvironmentVariables?: string[]; processorWhitelist?: string[]; minProcessorVersions?: { android?: string | number; ios?: string | number; }; restartPolicy?: RestartPolicy; runtime?: DeploymentRuntime; mutability?: ScriptMutability; reuseKeysFrom?: [MultiOrigin, string, number]; enableDevtools?: boolean; benchmarkFilters?: BenchmarkFilters; } export interface AcurastDeployment { deployedAt: string; assignments: { processorId: string; status: 'matched' | 'acknowledged' | 'failed'; }[]; status: 'init' | 'deployed' | 'failed'; config: AcurastProjectConfig; registration: JobRegistration; deploymentId?: JobId; envInfo?: { localPubKey: string; envEncrypted: JobEnvironmentsEncrypted; }; } export interface AcurastCliConfig { projects: { [projectName: string]: AcurastProjectConfig; }; } export declare enum AssignmentStrategyVariant { Single = "Single", Competing = "Competing" } export interface JobRegistration { script: string; allowedSources?: string[]; allowOnlyVerifiedSources: boolean; schedule: { duration: number; startTime: number; endTime: number; interval: number; maxStartDelay: number; }; memory: number; networkRequests: number; storage: number; requiredModules?: any[]; mutability: ScriptMutability; reuseKeysFrom?: [MultiOrigin, string, number]; extra: { requirements: { assignmentStrategy: { variant: AssignmentStrategyVariant; instantMatch?: { source: string; startDelay: number; }[]; }; slots: number; reward: number; minReputation?: number; instantMatch?: { source: string; startDelay: number; }[]; processorVersion?: { min: { platform: number; buildNumber: number; }[]; }; runtime: DeploymentRuntime; }; }; } export declare enum RestartPolicy { /** * The execution will not be restarted, it will run once and then stop. If it fails, it will not be restarted. */ No = "no", /** * The execution will be restarted only if it fails. It will restart 3 times per execution to prevent a crash-loop. If it succeeds, it will not be restarted. NOTE: There will be no failure reports on the first and second failure. Only the third failure will be reported. */ OnFailure = "onFailure", /** * The execution will be restarted if it fails or succeeds during the execution window, for a maximum of 3 times per execution. NOTE: There will be no execution reports for the first and second termination. Only the third termination will be reported. */ Always = "always" } export declare enum DeploymentRuntime { NodeJS = "NodeJS", NodeJSWithBundle = "NodeJSWithBundle", Shell = "Shell" } export declare enum ScriptMutability { Immutable = "Immutable", Mutable = "Mutable" } export declare enum MultiOrigin { Acurast = "Acurast" } export declare enum RequiredModules { DataEncryption = "DataEncryption", LLM = "LLM", Shell = "Shell" } export declare class DeploymentError extends Error { readonly code: string; readonly details?: any | undefined; constructor(messageOrError: unknown, code: string, details?: any | undefined); } export type { EnvVar, Job, JobEnvironmentsEncrypted, JobId }; //# sourceMappingURL=project.d.ts.map