/** * @fileoverview chainweb_deploy_module - build, preflight, and submit a Pact module deploy. * * Highest-risk tool in the v0.2 set. Guarded by construction: * * 1. The signer declaration is ALWAYS UNSCOPED — `.addSigner(publicKey)` * with NO capability callback. Memory lesson: scoped signers can't * satisfy `enforce-keyset` / `enforce-guard(keyset-ref-guard(...))` * on-chain, which is exactly what module-deploy governance evaluates. * See user-memory devnet-deploy-patterns.md. * * 2. `createTableCalls` are appended to the module code inside the SAME * transaction. Memory lesson: a separate `(create-table ...)` tx fails * with "Module admin is necessary for operation". We do not let * callers accidentally split this. * * 3. Module code size ≤512KB. Typical Pact modules are <50KB; the 10× * buffer catches accidental blob submission. * * 4. This server NEVER accepts private keys. The caller supplies the * signer's public key, and — if they want the server to submit — * a `sigs` array of the upstream-computed signatures. Without `sigs` * the tool runs preflight only and returns the unsigned envelope for * the caller to sign and re-submit via `chainweb_send`. */ import { z } from 'zod'; import type { ChainwebClient } from '../client/fetch.js'; /** 512KB hard cap on the combined module code + create-table calls. */ export declare const MAX_MODULE_CODE_BYTES: number; /** 64KB envData cap (same rationale as continue_pact). */ export declare const MAX_ENV_DATA_BYTES: number; export declare const DeployModuleInputShape: { chainId: z.ZodString; module: z.ZodObject<{ code: z.ZodString; ns: z.ZodOptional; keysetRef: z.ZodOptional; }, z.core.$strip>; envData: z.ZodOptional>; signerKey: z.ZodString; gasLimit: z.ZodDefault; createTableCalls: z.ZodOptional>; sender: z.ZodOptional; sigs: z.ZodOptional>>; }; export declare const DeployModuleInputSchema: z.ZodObject<{ chainId: z.ZodString; module: z.ZodObject<{ code: z.ZodString; ns: z.ZodOptional; keysetRef: z.ZodOptional; }, z.core.$strip>; envData: z.ZodOptional>; signerKey: z.ZodString; gasLimit: z.ZodDefault; createTableCalls: z.ZodOptional>; sender: z.ZodOptional; sigs: z.ZodOptional>>; }, z.core.$strip>; export interface DeployModuleResult { chainId: string; preflight: { ok: boolean; gasUsed: number; error?: string; }; deployed: boolean; /** Present iff `deployed: true`. */ requestKey?: string; /** Present iff `deployed: false` and preflight ok — returned for external signing. */ unsignedTx?: { cmd: string; hash: string; }; } export interface DeployModuleToolConfig { client: ChainwebClient; defaultSender?: string; gasPrice?: number; } export declare function createDeployModuleTool(config: DeployModuleToolConfig): (args: unknown) => Promise<{ content: DeployModuleResult[]; }>; //# sourceMappingURL=deploy-module.d.ts.map