/// import { Blake2b } from "blake2b"; import { BytesLike } from "@ckb-lumos/codec"; import { BI, BIish } from "@ckb-lumos/bi"; import { Script, Input } from "./api"; import { Hash, HexNumber, HexString } from "./primitive"; type CKBHasherOptions = { outLength?: number; }; declare class CKBHasher { hasher: Blake2b; outLength: number; constructor(options?: CKBHasherOptions); update(data: string | ArrayBuffer): this; digestHex(): Hash; } /** * create a 32-bytes Blake2b hash with the CKB personalization * @param data */ declare function ckbHash(data: BytesLike): Hash; /** * create a 20-bytes Blake2b hash with the CKB personalization * @param data */ declare function ckbHash160(data: BytesLike): Hash; /** * compute lock/type hash * * @param script */ declare function computeScriptHash(script: Script): string; declare function hashCode(buffer: Buffer): number; /** * @deprecated please follow the {@link https://lumos-website.vercel.app/migrations/migrate-to-v0.19 migration-guide} * convert bigint to BigUInt64 little-endian hex string * @param num */ declare function toBigUInt64LE(num: BIish): HexString; declare function toBigUInt64LECompatible(num: BIish): HexString; /** * @deprecated please follow the {@link https://lumos-website.vercel.app/migrations/migrate-to-v0.19 migration-guide} * convert BigUInt64 little-endian hex string to bigint * * @param hex BigUInt64 little-endian hex string */ declare function readBigUInt64LE(hex: HexString): bigint; /** * @deprecated please follow the {@link https://lumos-website.vercel.app/migrations/migrate-to-v0.19 migration-guide} */ declare function readBigUInt64LECompatible(hex: HexString): BI; /** * @deprecated please follow the {@link https://lumos-website.vercel.app/migrations/migrate-to-v0.19 migration-guide} * convert bigint to BigUInt128 little-endian hex string * * @param u128 */ declare function toBigUInt128LE(u128: BIish): string; declare function toBigUInt128LECompatible(num: BIish): HexNumber; /** * @deprecated please follow the {@link https://lumos-website.vercel.app/migrations/migrate-to-v0.19 migration-guide} * convert BigUInt64 little-endian hex string to bigint * * @param leHex BigUInt128 little-endian hex string */ declare function readBigUInt128LE(leHex: HexString): bigint; /** * @deprecated please follow the {@link https://lumos-website.vercel.app/migrations/migrate-to-v0.19 migration-guide} */ declare function readBigUInt128LECompatible(leHex: HexString): BI; declare function assertHexString(debugPath: string, str: string): void; declare function assertHexadecimal(debugPath: string, str: string): void; declare function isDeepEqual(a: any, b: any): boolean; /** * Generate a type script for type id {@link https://xuejie.space/2020_02_03_introduction_to_ckb_script_programming_type_id/} * @param input * @param outputIndex */ declare function generateTypeIdScript(input: Input, outputIndex?: string): Script; declare function deepCamel(data: any): any; declare function deepCamelizeTransaction(data: any): any; export { CKBHasher, ckbHash, ckbHash160, deepCamel, deepCamelizeTransaction, toBigUInt64LE, toBigUInt64LECompatible, readBigUInt64LE, readBigUInt64LECompatible, toBigUInt128LE, toBigUInt128LECompatible, readBigUInt128LE, readBigUInt128LECompatible, computeScriptHash, hashCode, assertHexString, assertHexadecimal, isDeepEqual, generateTypeIdScript, }; //# sourceMappingURL=utils.d.ts.map