import * as viem from 'viem'; import { PackageReference } from './package-reference'; import type { RawChainDefinition } from './actions'; export type ContractArtifact = { contractName: string; sourceName: string; abi: viem.Abi; bytecode: viem.Hex; deployedBytecode: string; linkReferences: { [fileName: string]: { [contractName: string]: { start: number; length: number; }[]; }; }; source?: { solcVersion: string; input: string; }; }; export type ContractData = { address: viem.Address; abi: viem.Abi; constructorArgs?: any[]; linkedLibraries?: { [sourceName: string]: { [libName: string]: string; }; }; deployTxnHash: string; deployTxnBlockNumber?: string; deployTimestamp?: string; contractName: string; sourceName: string; deployedOn: string; highlight?: boolean; gasUsed: number; gasCost: string; }; export type ContractMap = { [label: string]: ContractData; }; export type TransactionMap = { [label: string]: { hash: viem.Hash | ''; blockNumber?: string; timestamp?: string; events: EventMap; deployedOn: string; gasUsed: number; gasCost: string; signer: string; }; }; export type EventMap = { [name: string]: { args: string[]; }[]; }; export interface PreChainBuilderContext { chainId: number; package: any; timestamp: number; defaultSigner: viem.Address; overrideSettings: { [label: string]: string; }; } export interface ChainBuilderContext extends PreChainBuilderContext { contracts: ContractMap; txns: TransactionMap; settings: { [label: string]: string; }; extras?: { [label: string]: string; }; imports: BundledChainBuilderOutputs; [shortContract: string]: any; } export type CannonContextGlobals = 'imports' | 'contracts' | 'txns' | 'settings' | 'extras'; export declare const CannonHelperContext: { readonly String: (value: string) => string; readonly Number: (value: string) => number; readonly BigInt: (value: string) => bigint; readonly Array: { readonly from: { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; }; readonly isArray: (arg: any) => arg is any[]; }; readonly Date: { readonly now: () => number; }; readonly JSON: { readonly stringify: (value: any) => string; readonly parse: (value: string) => any; }; readonly console: { readonly log: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }; readonly error: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }; readonly warn: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }; readonly info: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }; readonly debug: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }; }; readonly parseFloat: (n: string) => number; readonly parseInt: (n: string) => number; readonly isNaN: (n: any) => boolean; readonly isFinite: (n: any) => boolean; readonly AddressZero: "0x0000000000000000000000000000000000000000"; readonly HashZero: "0x0000000000000000000000000000000000000000000000000000000000000000"; readonly MaxUint256: bigint; readonly defaultAbiCoder: { readonly encode: (a: string[], v: any[]) => `0x${string}`; readonly decode: (a: string[], v: viem.Hex | viem.ByteArray) => unknown[]; }; readonly zeroPad: (a: viem.Hex, s: number) => `0x${string}`; readonly hexZeroPad: (a: viem.Hex, s: number) => `0x${string}`; readonly hexlify: typeof viem.toHex; readonly stripZeros: typeof viem.trim; readonly formatBytes32String: (v: string) => `0x${string}`; readonly parseBytes32String: (v: viem.Hex) => string; readonly id: (v: string) => `0x${string}`; readonly formatEther: typeof viem.formatEther; readonly formatUnits: (s: bigint, units: number | string) => string; readonly parseEther: typeof viem.parseEther; readonly parseUnits: (s: string, units: number | string) => bigint; readonly keccak256: typeof viem.keccak256; readonly sha256: typeof viem.sha256; readonly ripemd160: typeof viem.ripemd160; readonly solidityPack: typeof viem.encodePacked; readonly solidityKeccak256: (a: string[], v: any[]) => `0x${string}`; readonly soliditySha256: (a: string[], v: any[]) => `0x${string}`; readonly serializeTransaction: typeof viem.serializeTransaction; readonly parseTransaction: typeof viem.parseTransaction; readonly encodeFunctionData: typeof viem.encodeFunctionData; readonly decodeFunctionData: typeof viem.decodeFunctionData; readonly encodeFunctionResult: typeof viem.encodeFunctionResult; readonly decodeFunctionResult: typeof viem.decodeFunctionResult; readonly offchainLookupAbiItem: { readonly name: "OffchainLookup"; readonly type: "error"; readonly inputs: readonly [{ readonly name: "sender"; readonly type: "address"; }, { readonly name: "urls"; readonly type: "string[]"; }, { readonly name: "callData"; readonly type: "bytes"; }, { readonly name: "callbackFunction"; readonly type: "bytes4"; }, { readonly name: "extraData"; readonly type: "bytes"; }]; }; readonly offchainLookupSignature: string; readonly assertCurrentChain: typeof viem.assertCurrentChain; readonly stringify: { (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; (value: any, replacer?: (number | string)[] | null, space?: string | number): string; }; readonly serializeTypedData: typeof viem.serializeTypedData; readonly validateTypedData: typeof viem.validateTypedData; readonly decodeAbiParameters: typeof viem.decodeAbiParameters; readonly decodeErrorResult: typeof viem.decodeErrorResult; readonly decodeEventLog: typeof viem.decodeEventLog; readonly encodeAbiParameters: typeof viem.encodeAbiParameters; readonly encodeDeployData: typeof viem.encodeDeployData; readonly encodeErrorResult: typeof viem.encodeErrorResult; readonly encodeEventTopics: typeof viem.encodeEventTopics; readonly parseEventLogs: typeof viem.parseEventLogs; readonly getAbiItem: typeof viem.getAbiItem; readonly parseAbi: typeof viem.parseAbi; readonly parseAbiItem: typeof viem.parseAbiItem; readonly parseAbiParameter: typeof viem.parseAbiParameter; readonly parseAbiParameters: typeof viem.parseAbiParameters; readonly encodePacked: typeof viem.encodePacked; readonly getContractAddress: typeof viem.getContractAddress; readonly getCreateAddress: typeof viem.getCreateAddress; readonly getCreate2Address: typeof viem.getCreate2Address; readonly getAddress: typeof viem.getAddress; readonly isAddress: typeof viem.isAddress; readonly isAddressEqual: typeof viem.isAddressEqual; readonly concat: typeof viem.concat; readonly concatBytes: typeof viem.concatBytes; readonly concatHex: typeof viem.concatHex; readonly isBytes: typeof viem.isBytes; readonly isHex: typeof viem.isHex; readonly pad: typeof viem.pad; readonly padBytes: typeof viem.padBytes; readonly padHex: typeof viem.padHex; readonly size: typeof viem.size; readonly slice: typeof viem.slice; readonly sliceBytes: typeof viem.sliceBytes; readonly sliceHex: typeof viem.sliceHex; readonly trim: typeof viem.trim; readonly defineBlock: ({ exclude, format: overrides, }: { exclude?: exclude | undefined; format: (_: parametersOverride) => returnTypeOverride; }) => { exclude: exclude | undefined; format: (args: parametersOverride) => { [K in keyof returnTypeOverride]: returnTypeOverride[K]; } & { [_key in exclude[number]]: never; }; type: "block"; }; readonly formatBlock: typeof viem.formatBlock; readonly defineTransaction: ({ exclude, format: overrides, }: { exclude?: exclude | undefined; format: (_: parametersOverride) => returnTypeOverride; }) => { exclude: exclude | undefined; format: (args: parametersOverride) => { [K in keyof returnTypeOverride]: returnTypeOverride[K]; } & { [_key in exclude[number]]: never; }; type: "transaction"; }; readonly formatTransaction: typeof viem.formatTransaction; readonly transactionType: { readonly '0x0': "legacy"; readonly '0x1': "eip2930"; readonly '0x2': "eip1559"; readonly '0x3': "eip4844"; readonly '0x4': "eip7702"; }; readonly formatLog: typeof viem.formatLog; readonly defineTransactionReceipt: ({ exclude, format: overrides, }: { exclude?: exclude | undefined; format: (_: parametersOverride) => returnTypeOverride; }) => { exclude: exclude | undefined; format: (args: parametersOverride) => { [K in keyof returnTypeOverride]: returnTypeOverride[K]; } & { [_key in exclude[number]]: never; }; type: "transactionReceipt"; }; readonly defineTransactionRequest: ({ exclude, format: overrides, }: { exclude?: exclude | undefined; format: (_: parametersOverride) => returnTypeOverride; }) => { exclude: exclude | undefined; format: (args: parametersOverride) => { [K in keyof returnTypeOverride]: returnTypeOverride[K]; } & { [_key in exclude[number]]: never; }; type: "transactionRequest"; }; readonly formatTransactionRequest: typeof viem.formatTransactionRequest; readonly toRlp: typeof viem.toRlp; readonly boolToBytes: typeof viem.boolToBytes; readonly toBytes: typeof viem.toBytes; readonly hexToBytes: typeof viem.hexToBytes; readonly numberToBytes: typeof viem.numberToBytes; readonly stringToBytes: typeof viem.stringToBytes; readonly boolToHex: typeof viem.boolToHex; readonly bytesToHex: typeof viem.bytesToHex; readonly toHex: typeof viem.toHex; readonly numberToHex: typeof viem.numberToHex; readonly stringToHex: typeof viem.stringToHex; readonly bytesToBigInt: typeof viem.bytesToBigInt; readonly bytesToBool: typeof viem.bytesToBool; readonly bytesToNumber: typeof viem.bytesToNumber; readonly bytesToString: typeof viem.bytesToString; readonly fromBytes: typeof viem.fromBytes; readonly fromHex: typeof viem.fromHex; readonly hexToBool: typeof viem.hexToBool; readonly hexToBigInt: typeof viem.hexToBigInt; readonly hexToNumber: typeof viem.hexToNumber; readonly hexToString: typeof viem.hexToString; readonly fromRlp: typeof viem.fromRlp; readonly getContractError: typeof viem.getContractError; readonly toEventSelector: typeof viem.toEventHash; readonly toFunctionSelector: (fn: string | viem.AbiFunction) => `0x${string}`; readonly toEventSignature: (def: string | viem.AbiFunction | viem.AbiEvent) => string; readonly toFunctionSignature: (def: string | viem.AbiFunction | viem.AbiEvent) => string; readonly toEventHash: typeof viem.toEventHash; readonly toFunctionHash: typeof viem.toEventHash; readonly isHash: typeof viem.isHash; readonly hashTypedData: typeof viem.hashTypedData; readonly recoverAddress: typeof viem.recoverAddress; readonly recoverMessageAddress: typeof viem.recoverMessageAddress; readonly recoverPublicKey: typeof viem.recoverPublicKey; readonly recoverTypedDataAddress: typeof viem.recoverTypedDataAddress; readonly verifyHash: typeof viem.verifyHash; readonly verifyMessage: typeof viem.verifyMessage; readonly verifyTypedData: typeof viem.verifyTypedData; readonly hashMessage: typeof viem.hashMessage; readonly parseErc6492Signature: typeof viem.parseErc6492Signature; readonly isErc6492Signature: typeof viem.isErc6492Signature; readonly serializeErc6492Signature: typeof viem.serializeErc6492Signature; readonly getSerializedTransactionType: typeof viem.getSerializedTransactionType; readonly getTransactionType: typeof viem.getTransactionType; readonly assertRequest: typeof viem.assertRequest; readonly assertTransactionEIP1559: typeof viem.assertTransactionEIP1559; readonly assertTransactionEIP2930: typeof viem.assertTransactionEIP2930; readonly assertTransactionLegacy: typeof viem.assertTransactionLegacy; readonly serializeAccessList: typeof viem.serializeAccessList; readonly formatGwei: typeof viem.formatGwei; readonly parseGwei: typeof viem.parseGwei; readonly maxInt8: bigint; readonly maxInt16: bigint; readonly maxInt24: bigint; readonly maxInt32: bigint; readonly maxInt40: bigint; readonly maxInt48: bigint; readonly maxInt56: bigint; readonly maxInt64: bigint; readonly maxInt72: bigint; readonly maxInt80: bigint; readonly maxInt88: bigint; readonly maxInt96: bigint; readonly maxInt104: bigint; readonly maxInt112: bigint; readonly maxInt120: bigint; readonly maxInt128: bigint; readonly maxInt136: bigint; readonly maxInt144: bigint; readonly maxInt152: bigint; readonly maxInt160: bigint; readonly maxInt168: bigint; readonly maxInt176: bigint; readonly maxInt184: bigint; readonly maxInt192: bigint; readonly maxInt200: bigint; readonly maxInt208: bigint; readonly maxInt216: bigint; readonly maxInt224: bigint; readonly maxInt232: bigint; readonly maxInt240: bigint; readonly maxInt248: bigint; readonly maxInt256: bigint; readonly minInt8: bigint; readonly minInt16: bigint; readonly minInt24: bigint; readonly minInt32: bigint; readonly minInt40: bigint; readonly minInt48: bigint; readonly minInt56: bigint; readonly minInt64: bigint; readonly minInt72: bigint; readonly minInt80: bigint; readonly minInt88: bigint; readonly minInt96: bigint; readonly minInt104: bigint; readonly minInt112: bigint; readonly minInt120: bigint; readonly minInt128: bigint; readonly minInt136: bigint; readonly minInt144: bigint; readonly minInt152: bigint; readonly minInt160: bigint; readonly minInt168: bigint; readonly minInt176: bigint; readonly minInt184: bigint; readonly minInt192: bigint; readonly minInt200: bigint; readonly minInt208: bigint; readonly minInt216: bigint; readonly minInt224: bigint; readonly minInt232: bigint; readonly minInt240: bigint; readonly minInt248: bigint; readonly minInt256: bigint; readonly maxUint8: bigint; readonly maxUint16: bigint; readonly maxUint24: bigint; readonly maxUint32: bigint; readonly maxUint40: bigint; readonly maxUint48: bigint; readonly maxUint56: bigint; readonly maxUint64: bigint; readonly maxUint72: bigint; readonly maxUint80: bigint; readonly maxUint88: bigint; readonly maxUint96: bigint; readonly maxUint104: bigint; readonly maxUint112: bigint; readonly maxUint120: bigint; readonly maxUint128: bigint; readonly maxUint136: bigint; readonly maxUint144: bigint; readonly maxUint152: bigint; readonly maxUint160: bigint; readonly maxUint168: bigint; readonly maxUint176: bigint; readonly maxUint184: bigint; readonly maxUint192: bigint; readonly maxUint200: bigint; readonly maxUint208: bigint; readonly maxUint216: bigint; readonly maxUint224: bigint; readonly maxUint232: bigint; readonly maxUint240: bigint; readonly maxUint248: bigint; readonly maxUint256: bigint; readonly zeroAddress: "0x0000000000000000000000000000000000000000"; readonly zeroHash: "0x0000000000000000000000000000000000000000000000000000000000000000"; }; export type BuildOptions = { [val: string]: string; }; export type StorageMode = 'all' | 'metadata' | 'none'; export type CannonSigner = { wallet: viem.WalletClient; address: viem.Address; }; export type Contract = Pick; export interface ChainBuilderRuntimeInfo { provider: viem.PublicClient; chainId: number; getSigner: (addr: viem.Address) => Promise; getDefaultSigner?: (txn: Omit, salt?: string) => Promise; getArtifact?: (name: string) => Promise; snapshots: boolean; allowPartialDeploy: boolean; subpkgDepth: number; gasPrice?: bigint; gasFee?: bigint; priorityGasFee?: bigint; } export interface PackageState { ref: PackageReference | null; currentLabel: string; } export type BundledOutput = { url: string; tags?: string[]; target?: string; preset?: string; } & ChainArtifacts; export interface BundledChainBuilderOutputs { [module: string]: BundledOutput; } export type ChainArtifacts = Partial>; export interface ChainBuilderOptions { [key: string]: string; } /** * The deployment info is the main output of the cannon build process, and what is ultimately the blob referenced by the registry when pulling a package. * It contains all the information * needed to interface with a deployment generated by cannon. */ export type DeploymentInfo = { generator: `cannon ${string}`; timestamp: number; def: RawChainDefinition; options: ChainBuilderOptions; status?: 'complete' | 'partial' | 'none'; seq?: number; track?: string; state: DeploymentState; meta: any; miscUrl: string; chainId?: number; }; export type DeploymentManifest = { def: RawChainDefinition; npmPackage: any; upgradeFrom?: string; misc: { ipfsHash: string; }; deploys: { [chainId: string]: { [preset: string]: { hash: string; }; }; }; }; /** * After executing a build step, this object is recorded to the DeploymentInfo for future reference. */ export type StepState = { version: number; hash: string | null; artifacts: ChainArtifacts; chainDump?: viem.Hex | null; }; export type DeploymentState = { [label: string]: StepState; }; export declare function combineCtx(ctxs: ChainBuilderContext[]): ChainBuilderContext; //# sourceMappingURL=types.d.ts.map