import { Fr } from '@aztec/foundation/curves/bn254'; import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin'; import { EthAddress } from '@aztec/foundation/eth-address'; import type { LogFn } from '@aztec/foundation/log'; import type { PXE } from '@aztec/pxe/server'; import { FunctionSelector } from '@aztec/stdlib/abi/function-selector'; import { AztecAddress } from '@aztec/stdlib/aztec-address'; import { PublicKeys } from '@aztec/stdlib/keys'; import { LogCursor, Tag } from '@aztec/stdlib/logs'; import { TxHash } from '@aztec/stdlib/tx/tx-hash'; import { type Command, Option } from 'commander'; export { LogCursor }; /** * If we can successfully resolve 'host.docker.internal', then we are running in a container, and we should treat * localhost as being host.docker.internal. */ export declare const getLocalhost: () => Promise; export declare const LOCALHOST: string; export declare const ETHEREUM_HOSTS: string, PRIVATE_KEY: string | undefined, MNEMONIC: string | undefined, API_KEY: string | undefined, CLI_VERSION: string | undefined; export declare function addOptions(program: Command, options: Option[]): Command; export declare const makeNodeOption: (mandatory: boolean) => Option; export declare const nodeOption: Option; export declare const l1ChainIdOption: Option; export declare const createSigningKeyOption: (description: string, mandatory: boolean, argsParser?: ((value: string, previous: import("@aztec/foundation/curves/bn254").Fq) => import("@aztec/foundation/curves/bn254").Fq) | undefined) => Option; export declare const logJson: (log: LogFn) => (obj: object) => void; /** * Updates a file in place atomically. * @param filePath - Path to file * @param contents - New contents to write */ export declare function atomicUpdateFile(filePath: string, contents: string): Promise; /** * Utility to select a TX sender either from user input * or from the first account that is found in a PXE instance. * @param pxe - The PXE instance that will be checked for an account. * @param _from - The user input. * @returns An Aztec address. Will throw if one can't be found in either options. */ export declare function getTxSender(pxe: PXE, _from?: string): Promise; /** * Parses and validates a hex string. Removes leading 0x if present, checks for hex validity, * and enforces an optional minimum length. * @param hex - The hex string to validate. * @param minLen - Optional minimum length (in hex characters, after stripping '0x'). * @returns The normalized hex string (without leading 0x). * @throws InvalidArgumentError if the string is not valid hex or does not meet the minimum length. */ export declare function parseHex(hex: string, minLen?: number): `0x${string}`; export declare function parseBigint(bigint: string): bigint | undefined; /** * Parses a hex encoded string to an Fr integer * @param str - Hex encoded string * @returns A integer */ export declare function parseFieldFromHexString(str: string): Fr; /** * Parses an AztecAddress from a string. * @param address - A serialized Aztec address * @returns An Aztec address * @throws InvalidArgumentError if the input string is not valid. */ export declare function parseAztecAddress(address: string): AztecAddress; /** * Parses an Ethereum address from a string. * @param address - A serialized Ethereum address * @returns An Ethereum address * @throws InvalidArgumentError if the input string is not valid. */ export declare function parseEthereumAddress(address: string): EthAddress; /** * Parses an AztecAddress from a string. * @param address - A serialized Aztec address * @returns An Aztec address * @throws InvalidArgumentError if the input string is not valid. */ export declare function parseOptionalAztecAddress(address: string): AztecAddress | undefined; /** * Parses an optional `--` triple into a {@link LogCursor}, * used as the `--after-log` argument of `get-logs` to resume pagination strictly after a previously-seen log. * Thin wrapper over {@link LogCursor.parseOptional} that surfaces parse errors as commander's * {@link InvalidArgumentError}. */ export declare function parseOptionalLogCursor(value: string): LogCursor | undefined; /** * Parses a log tag from a string. Tags are field-element values; we delegate to the {@link parseField} parser. * * @param tag - A hex string, integer, or boolean string representing the tag. * @returns A {@link Tag} wrapping the parsed field. */ export declare function parseTag(tag: string): Tag; /** * Parses a selector from a string. * @param selector - A serialized selector. * @returns A selector. * @throws InvalidArgumentError if the input string is not valid. */ export declare function parseOptionalSelector(selector: string): FunctionSelector | undefined; /** * Parses a string into an integer or returns undefined if the input is falsy. * * @param value - The string to parse into an integer. * @returns The parsed integer, or undefined if the input string is falsy. * @throws If the input is not a valid integer. */ export declare function parseOptionalInteger(value: string, min?: number, max?: number): number | undefined; /** * Parses a TxHash from a string. * @param txHash - A transaction hash * @returns A TxHash instance * @throws InvalidArgumentError if the input string is not valid. */ export declare function parseTxHash(txHash: string): TxHash; /** * Parses an optional TxHash from a string. * Calls parseTxHash internally. * @param txHash - A transaction hash * @returns A TxHash instance, or undefined if the input string is falsy. * @throws InvalidArgumentError if the input string is not valid. */ export declare function parseOptionalTxHash(txHash: string): TxHash | undefined; /** * Parses a public key from a string. * @param publicKey - A public keys object serialised as a string * @returns A PublicKeys instance * @throws InvalidArgumentError if the input string is not valid. */ export declare function parsePublicKey(publicKey: string): PublicKeys | undefined; /** * Parses a partial address from a string. * @param address - A partial address * @returns A Fr instance * @throws InvalidArgumentError if the input string is not valid. */ export declare function parsePartialAddress(address: string): Fr; /** * Parses an account signing key from a string. * @param signingKey - A string * @returns A signing key * @throws InvalidArgumentError if the input string is not valid. */ export declare function parseSigningKey(signingKey: string): GrumpkinScalar; /** * Parses a field from a string. * @param field - A string representing the field. * @returns A field. * @throws InvalidArgumentError if the input string is not valid. */ export declare function parseField(field: string): Fr; /** * Parses an array of strings to Frs. * @param fields - An array of strings representing the fields. * @returns An array of Frs. */ export declare function parseFields(fields: string[]): Fr[]; /** * Pretty prints an object as JSON * @param data - The object to stringify * @returns A JSON string */ export declare function prettyPrintJSON(data: Record): string; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWFuZHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9jb21tYW5kcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBQ25FLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUMzRCxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUNuRCxPQUFPLEtBQUssRUFBRSxHQUFHLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUM3QyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxxQ0FBcUMsQ0FBQztBQUN2RSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1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