import { Schema, FastCheck, Inspectable } from "effect";
/**
* The length in bytes of a KeyHash.
*
* @since 2.0.0
* @category constants
*/
export declare const KEYHASH_BYTES_LENGTH = 28;
/**
* The length in hex characters of a KeyHash.
*
* @since 2.0.0
* @category constants
*/
export declare const KEYHASH_HEX_LENGTH = 56;
declare const KeyHashError_base: new = {}>(args: import("effect/Types").Equals extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
readonly _tag: "KeyHashError";
} & Readonly;
/**
* Error class for KeyHash related operations.
*
* @example
* import { KeyHash } from "@lucid-evolution/experimental";
* import assert from "assert";
*
* const error = new KeyHash.KeyHashError({ message: "Invalid key hash" });
* assert(error.message === "Invalid key hash");
*
* @since 2.0.0
* @category errors
*/
export declare class KeyHashError extends KeyHashError_base<{
message?: string;
reason?: "InvalidHexLength" | "InvalidBytesLength" | "InvalidHexFormat" | "InvalidCBORFormat";
}> {
}
export declare const NominalType: unique symbol;
export interface KeyHash {
readonly [NominalType]: unique symbol;
}
declare const KeyHash_base: Schema.TaggedClass;
} & {
hash: Schema.SchemaClass, string & import("effect/Brand").Brand<"HexString">, never>;
}>;
/**
* Schema for KeyHash representing a verification key hash.
* Follows CIP-0019 binary representation.
*
* @since 2.0.0
* @category schemas
*/
export declare class KeyHash extends KeyHash_base {
[Inspectable.NodeInspectSymbol](): {
_tag: string;
hash: string & import("effect/Brand").Brand<"HexString">;
};
}
export declare const KeyHashBytes: Schema.SchemaClass, Uint8Array, never>;
export declare const Bytes: Schema.transform, Uint8Array, never>, typeof KeyHash>;
export declare const HexString: Schema.transform, string & import("effect/Brand").Brand<"HexString">, never>, typeof KeyHash>;
/**
* Check if two KeyHash instances are equal.
*
* @example
* import { KeyHash } from "@lucid-evolution/experimental";
* import assert from "assert";
*
* @since 2.0.0
* @category equality
*/
export declare const equals: (a: KeyHash, b: KeyHash) => boolean;
/**
* Generate a random KeyHash.
*
* @example
* import { KeyHash } from "@lucid-evolution/experimental";
* import { FastCheck } from "effect";
* import assert from "assert";
*
* const randomSamples = FastCheck.sample(KeyHash.generator, 20);
* randomSamples.forEach((keyHash) => {
* assert(keyHash.hash.length === 56);
* });
*
* @since 2.0.0
* @category generators
*/
export declare const generator: FastCheck.Arbitrary;
/**
* Synchronous encoding utilities for KeyHash.
*
* @since 2.0.0
* @category encoding/decoding
*/
export declare const Encode: {
hex: (a: KeyHash, overrideOptions?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"HexString">;
bytes: (a: KeyHash, overrideOptions?: import("effect/SchemaAST").ParseOptions) => Uint8Array;
};
/**
* Synchronous decoding utilities for KeyHash.
*
* @since 2.0.0
* @category encoding/decoding
*/
export declare const Decode: {
hex: (u: unknown, overrideOptions?: import("effect/SchemaAST").ParseOptions) => KeyHash;
bytes: (u: unknown, overrideOptions?: import("effect/SchemaAST").ParseOptions) => KeyHash;
};
/**
* Either encoding utilities for KeyHash.
*
* @since 2.0.0
* @category encoding/decoding
*/
export declare const EncodeEither: {
hex: (a: KeyHash, overrideOptions?: import("effect/SchemaAST").ParseOptions) => import("effect/Either").Either, import("effect/ParseResult").ParseError>;
bytes: (a: KeyHash, overrideOptions?: import("effect/SchemaAST").ParseOptions) => import("effect/Either").Either, import("effect/ParseResult").ParseError>;
};
/**
* Either decoding utilities for KeyHash.
*
* @since 2.0.0
* @category encoding/decoding
*/
export declare const DecodeEither: {
hex: (u: unknown, overrideOptions?: import("effect/SchemaAST").ParseOptions) => import("effect/Either").Either;
bytes: (u: unknown, overrideOptions?: import("effect/SchemaAST").ParseOptions) => import("effect/Either").Either;
};
export {};
//# sourceMappingURL=KeyHash.d.ts.map