import { Equal, FastCheck, Hash, Schema } from "effect";
import * as CBOR from "./CBOR.js";
declare const NativeScriptError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
    readonly _tag: "NativeScriptError";
} & Readonly<A>;
/**
 * Error class for Native script related operations.
 *
 * @since 2.0.0
 * @category errors
 */
export declare class NativeScriptError extends NativeScriptError_base<{
    message?: string;
    cause?: unknown;
}> {
}
/**
 * Native script encoded type definition (wire format)
 *
 * @since 2.0.0
 * @category model
 */
export type NativeScriptEncoded = {
    readonly _tag: "ScriptPubKey";
    readonly keyHash: string;
} | {
    readonly _tag: "InvalidBefore";
    readonly slot: string;
} | {
    readonly _tag: "InvalidHereafter";
    readonly slot: string;
} | {
    readonly _tag: "ScriptAll";
    readonly scripts: ReadonlyArray<NativeScriptEncoded>;
} | {
    readonly _tag: "ScriptAny";
    readonly scripts: ReadonlyArray<NativeScriptEncoded>;
} | {
    readonly _tag: "ScriptNOfK";
    readonly required: string;
    readonly scripts: ReadonlyArray<NativeScriptEncoded>;
};
/**
 * Native script type definition (runtime representation)
 *
 * @since 2.0.0
 * @category model
 */
export type NativeScriptVariants = {
    readonly _tag: "ScriptPubKey";
    readonly keyHash: Uint8Array;
} | {
    readonly _tag: "InvalidBefore";
    readonly slot: bigint;
} | {
    readonly _tag: "InvalidHereafter";
    readonly slot: bigint;
} | {
    readonly _tag: "ScriptAll";
    readonly scripts: ReadonlyArray<NativeScriptVariants>;
} | {
    readonly _tag: "ScriptAny";
    readonly scripts: ReadonlyArray<NativeScriptVariants>;
} | {
    readonly _tag: "ScriptNOfK";
    readonly required: bigint;
    readonly scripts: ReadonlyArray<NativeScriptVariants>;
};
/**
 * Internal Union schema for the actual native script variants
 *
 * @since 2.0.0
 * @category schemas
 */
export declare const NativeScriptVariants: Schema.Schema<NativeScriptVariants, NativeScriptEncoded>;
declare const NativeScript_base: Schema.TaggedClass<NativeScript, "NativeScript", {
    readonly _tag: Schema.tag<"NativeScript">;
} & {
    script: Schema.Schema<NativeScriptVariants, NativeScriptEncoded, never>;
}>;
/**
 * TaggedClass schema for native scripts containing the Union
 *
 * @since 2.0.0
 * @category schemas
 */
export declare class NativeScript extends NativeScript_base {
    [Equal.symbol](that: unknown): boolean;
    [Hash.symbol](): number;
}
/**
 * Create a signature script for a specific key hash
 *
 * @since 2.0.0
 * @category constructors
 */
export declare const makeScriptPubKey: (keyHash: Uint8Array) => NativeScript;
/**
 * Create a time-based script that is invalid before a slot
 *
 * @since 2.0.0
 * @category constructors
 */
export declare const makeInvalidBefore: (slot: bigint) => NativeScript;
/**
 * Create a time-based script that is invalid after a slot
 *
 * @since 2.0.0
 * @category constructors
 */
export declare const makeInvalidHereafter: (slot: bigint) => NativeScript;
/**
 * Create a script that requires all nested scripts
 *
 * @since 2.0.0
 * @category constructors
 */
export declare const makeScriptAll: (scripts: ReadonlyArray<NativeScriptVariants>) => NativeScript;
/**
 * Create a script that requires any one nested script
 *
 * @since 2.0.0
 * @category constructors
 */
export declare const makeScriptAny: (scripts: ReadonlyArray<NativeScriptVariants>) => NativeScript;
/**
 * Create a script that requires at least N nested scripts
 *
 * @since 2.0.0
 * @category constructors
 */
export declare const makeScriptNOfK: (required: bigint, scripts: ReadonlyArray<NativeScriptVariants>) => NativeScript;
/**
 * Convert a NativeScript to JSON representation matching cardano-cli format
 *
 * @since 2.0.0
 * @category conversion
 */
export declare const toJSON: (script: NativeScriptVariants) => any;
/**
 * CDDL representation following Cardano specification
 *
 * native_script =
 *   [ script_pubkey      // 0
 *   // script_all         // 1
 *   // script_any         // 2
 *   // script_n_of_k      // 3
 *   // invalid_before     // 4
 *   // invalid_hereafter  // 5
 *   ]
 *
 * @since 2.0.0
 * @category model
 */
export type NativeScriptCDDL = readonly [0n, Uint8Array] | readonly [1n, ReadonlyArray<NativeScriptCDDL>] | readonly [2n, ReadonlyArray<NativeScriptCDDL>] | readonly [3n, bigint, ReadonlyArray<NativeScriptCDDL>] | readonly [4n, bigint] | readonly [5n, bigint];
export declare const CDDLSchema: Schema.Schema<NativeScriptCDDL>;
/**
 * Transform between NativeScript and CDDL representation
 *
 * @since 2.0.0
 * @category schemas
 */
export declare const FromCDDL: Schema.Schema<NativeScript, NativeScriptCDDL>;
export declare const FromCBORBytes: (options?: CBOR.CodecOptions) => Schema.transform<Schema.transformOrFail<typeof Schema.Uint8ArrayFromSelf, Schema.declare<CBOR.CBOR, CBOR.CBOR, readonly [], never>, never>, Schema.Schema<NativeScript, NativeScriptCDDL, never>>;
export declare const FromCBORHex: (options?: CBOR.CodecOptions) => Schema.transform<Schema.Schema<Uint8Array<ArrayBufferLike>, string, never>, Schema.transform<Schema.transformOrFail<typeof Schema.Uint8ArrayFromSelf, Schema.declare<CBOR.CBOR, CBOR.CBOR, readonly [], never>, never>, Schema.Schema<NativeScript, NativeScriptCDDL, never>>>;
/**
 * Check if the given value is a valid NativeScript
 *
 * @since 2.0.0
 * @category predicates
 */
export declare const is: (u: unknown, overrideOptions?: import("effect/SchemaAST").ParseOptions | number) => u is NativeScriptVariants;
/**
 * FastCheck arbitrary for generating random NativeScript instances
 *
 * @since 2.0.0
 * @category testing
 */
export declare const arbitrary: FastCheck.Arbitrary<NativeScript>;
/**
 * Parse a NativeScript from CBOR bytes.
 *
 * @since 2.0.0
 * @category parsing
 */
export declare const fromCBORBytes: (bytes: Uint8Array, options?: CBOR.CodecOptions) => NativeScript;
/**
 * Parse a NativeScript from CBOR hex string.
 *
 * @since 2.0.0
 * @category parsing
 */
export declare const fromCBORHex: (hex: string, options?: CBOR.CodecOptions) => NativeScript;
/**
 * Convert a NativeScript to CBOR bytes.
 *
 * @since 2.0.0
 * @category encoding
 */
export declare const toCBORBytes: (nativeScript: NativeScript, options?: CBOR.CodecOptions) => Uint8Array;
/**
 * Convert a NativeScript to CBOR hex string.
 *
 * @since 2.0.0
 * @category encoding
 */
export declare const toCBORHex: (nativeScript: NativeScript, options?: CBOR.CodecOptions) => string;
/**
 * Count the maximum number of key hashes (signers) required to satisfy a native script.
 * This is used for fee calculation to ensure the fake witness set has the correct size.
 *
 * Algorithm:
 * - ScriptPubKey: 1 signer required
 * - ScriptAll: sum of all nested scripts (all must be satisfied)
 * - ScriptAny: maximum of nested scripts (pessimistic - assume most expensive path)
 * - ScriptNOfK: sum of top N most expensive nested scripts
 * - InvalidBefore/InvalidHereafter: 0 signers (time-based only)
 *
 * @since 2.0.0
 * @category utilities
 */
export declare const countRequiredSigners: (script: NativeScriptVariants) => number;
/**
 * Extract all key hashes from a native script.
 * Recursively traverses nested scripts to find all ScriptPubKey key hashes.
 *
 * @since 2.0.0
 * @category utilities
 */
export declare const extractKeyHashes: (script: NativeScriptVariants) => ReadonlyArray<Uint8Array>;
export {};
//# sourceMappingURL=NativeScripts.d.ts.map