import { LibraryEntity, StructEntity } from './internal'; export declare type TypeResolver = (type: string) => string; export declare type ValueType = RawTypes | StructObject | ValueType[]; export interface ScryptTypeResolver { resolverType: (type: string) => string; resolverClass: (type: string) => typeof ScryptType; allTypes: () => Record; } export declare class ScryptType { protected _value: ValueType; protected _literal: string; protected _asm: string; protected _type: string; protected _typeResolver: TypeResolver; [key: string]: any; constructor(...value: ValueType[]); get value(): ValueType; get finalType(): string; get literal(): string; get type(): string; toASM(): string; toHex(): string; toString(format: string): string; toJSON(): string | unknown; toLiteral(): string; checkValue(value: ValueType[]): ValueType; equals(obj: ScryptType): boolean; serialize(): string; clone(): ScryptType; } export declare class Int extends ScryptType { constructor(intVal: number | bigint | string); toLiteral(): string; checkValue(value: ValueType[]): ValueType; toJSON(): string | unknown; serialize(): string; } export declare class Bool extends ScryptType { constructor(boolVal: boolean); toLiteral(): string; serialize(): string; } export declare class Bytes extends ScryptType { constructor(bytesVal: string); toLiteral(): string; serialize(): string; } export declare class String extends Bytes { constructor(val: string); static toUtf8Hex(val: string): string; static fromUtf8Hex(hex: string): string; toLiteral(): string; show(): string; } export declare class PrivKey extends Int { constructor(intVal: bigint | string | number); toLiteral(): string; toJSON(): string | unknown; serialize(): string; } export declare class PubKey extends ScryptType { constructor(bytesVal: string); toLiteral(): string; serialize(): string; } export declare class Sig extends ScryptType { constructor(bytesVal: string); toLiteral(): string; serialize(): string; } export declare class Ripemd160 extends ScryptType { constructor(bytesVal: string); toLiteral(): string; serialize(): string; } export declare class PubKeyHash extends Ripemd160 { } export declare class Sha1 extends ScryptType { constructor(bytesVal: string); toLiteral(): string; serialize(): string; } export declare class Sha256 extends ScryptType { constructor(bytesVal: string); toLiteral(): string; serialize(): string; } export declare enum SigHash { ALL = 1, NONE = 2, SINGLE = 3, FORKID = 64, ANYONECANPAY = 128, ALL_FORKID = 65, SINGLE_FORKID = 67, NONE_FORKID = 66, ANYONECANPAY_ALL_FORKID = 193, ANYONECANPAY_SINGLE_FORKID = 195, ANYONECANPAY_NONE_FORKID = 194 } export declare class SigHashType extends ScryptType { constructor(intVal: number); toLiteral(): string; serialize(): string; toString(): string; } interface Outpoint { hash: string; index: number; hex: string; } export declare class SigHashPreimage extends ScryptType { constructor(bytesVal: string); private _buf; private getReader; get nVersion(): number; get hashPrevouts(): string; get hashSequence(): string; get outpoint(): Outpoint; get scriptCode(): string; get amount(): number; get nSequence(): number; get hashOutputs(): string; get nLocktime(): number; get sighashType(): number; toString(format?: string): string; toLiteral(): string; toJSONObject(): { nVersion: number; hashPrevouts: string; hashSequence: string; outpoint: Outpoint; scriptCode: string; amount: number; nSequence: number; hashOutputs: string; nLocktime: number; sighashType: string; }; serialize(): string; } export declare class OpCodeType extends ScryptType { constructor(bytesVal: string); toLiteral(): string; serialize(): string; } export declare class Struct extends ScryptType { sorted: boolean; static structAst: StructEntity; constructor(o: StructObject); static setStructAst(self: Struct, structAst: StructEntity): void; static getStructAst(self: Struct): StructEntity; flatten(varName: string): import("./abi").Arguments; protected init(structAst: StructEntity): void; protected bind(): void; toASM(): string; /** * @deprecated use flatternStruct, see toASM */ toArray(): ScryptType[]; memberByIndex(index: number): string; /** * @deprecated use getMemberFinalType */ getMemberType(key: string): string; /** * Get the real member type of the structure */ getMemberFinalType(key: string): string; /** * Get the member type declared by the structure by structAst */ getMemberAstFinalType(key: string): string; getMembers(): string[]; memberByKey(key: string): SupportedParamType | undefined; clone(): ScryptType; toLiteral(): string; toJSON(): unknown; static isStruct(arg: SupportedParamType): boolean; serialize(): string; } export declare class Library extends ScryptType { private properties; private inferredTypes; static libraryAst: LibraryEntity; constructor(...args: SupportedParamType[]); static setLibraryAst(self: Library, libraryAst: LibraryEntity): void; static getLibraryAst(self: Library): LibraryEntity; getCtorArgs(): SupportedParamType[]; cloneProperties(): StructObject; clone(): ScryptType; getProperty(property: string): SupportedParamType; getProperties(): StructObject; getLibraryAst(): LibraryEntity; flatten(varName: string): import("./abi").Arguments; get finalType(): string; checkValue(args: SupportedParamType[]): ValueType; private inferrTypesByCtorArgs; inferrTypesByAssign(assignType: string): boolean; static hasGeneric(self: Library): boolean; attach(): void; static isLibrary(arg: SupportedParamType): boolean; protected bind(): void; setProperties(properties: Record): this; toJSON(): unknown; toLiteral(): string; } export declare class HashedMap extends Library { constructor(data: Bytes); } export declare class HashedSet extends Library { constructor(data: Bytes); } export declare type PrimitiveTypes = Int | Bool | Bytes | PrivKey | PubKey | Sig | Sha256 | Sha1 | SigHashType | Ripemd160 | OpCodeType | Struct; export declare type RawTypes = boolean | number | bigint | string; export declare type SingletonParamType = PrimitiveTypes | RawTypes; export declare type SupportedParamType = SingletonParamType | SupportedParamType[]; export declare type StructObject = Record; export declare enum VariableType { BOOL = "bool", INT = "int", BYTES = "bytes", PUBKEY = "PubKey", PRIVKEY = "PrivKey", SIG = "Sig", RIPEMD160 = "Ripemd160", SHA1 = "Sha1", SHA256 = "Sha256", SIGHASHTYPE = "SigHashType", SIGHASHPREIMAGE = "SigHashPreimage", OPCODETYPE = "OpCodeType", PUBKEYHASH = "PubKeyHash", STRUCT = "struct", LIBRARY = "library" } export declare const BasicType: any[]; export declare const BasicScryptType: Record; export declare function serializeSupportedParamType(x: SupportedParamType): string; export {};