export type Solution = { asm: string; nSequence?: number; nLockTime?: number; }; export type Satisfactions = { sats?: Solution[]; dsats?: Solution[]; }; export type SatisfactionsMap = Record; export type SolutionFilter = (solution: Solution) => boolean; export type SolutionCounter = { maxSolutions: number; count: number; }; export type SatisfactionsMakerOptions = { isSolutionAllowed?: SolutionFilter | undefined; isSignatureKnown?: ((key: string) => boolean) | undefined; maxSolutions?: number | null | undefined; }; /** * Creates a satisfactions maker with optional pruning and enumeration limits. * * The returned object mirrors the Miniscript fragment set and provides helper * functions that return sat/dsat solutions for each fragment. When * `isSolutionAllowed` is provided, solutions that do not pass the filter are * skipped during enumeration. When `maxSolutions` is set, enumeration throws * once the counter exceeds that limit. `isSignatureKnown` lets multisig * fragments (`multi`, `multi_a`) ignore keys that are known to be unavailable. */ export declare const createSatisfactionsMaker: ({ isSolutionAllowed, isSignatureKnown, maxSolutions }?: SatisfactionsMakerOptions) => { 0: () => Satisfactions; 1: () => Satisfactions; pk_k: (key: string) => Satisfactions; pk_h: (key: string) => Satisfactions; older: (n: string | number) => Satisfactions; after: (n: string | number) => Satisfactions; sha256: (h: string) => Satisfactions; ripemd160: (h: string) => Satisfactions; hash256: (h: string) => Satisfactions; hash160: (h: string) => Satisfactions; andor: (X: Satisfactions, Y: Satisfactions, Z: Satisfactions) => Satisfactions; and_v: (X: Satisfactions, Y: Satisfactions) => Satisfactions; and_b: (X: Satisfactions, Y: Satisfactions) => Satisfactions; or_b: (X: Satisfactions, Z: Satisfactions) => Satisfactions; or_c: (X: Satisfactions, Z: Satisfactions) => Satisfactions; or_d: (X: Satisfactions, Z: Satisfactions) => Satisfactions; or_i: (X: Satisfactions, Z: Satisfactions) => Satisfactions; thresh: (k: string | number, ...satisfactionsArray: Satisfactions[]) => Satisfactions; multi: (k: string | number, ...keys: string[]) => Satisfactions; multi_a: (k: string | number, ...keys: string[]) => Satisfactions; a: (X: Satisfactions) => Satisfactions; s: (X: Satisfactions) => Satisfactions; c: (X: Satisfactions) => Satisfactions; d: (X: Satisfactions) => Satisfactions; v: (X: Satisfactions) => Satisfactions; /** * j:X corresponds to SIZE 0NOTEQUAL IF [X] ENDIF * * By definition, this: "dsat(X) X" produces a zero. * * * A dsat needs to make this "dsat(X) X" return zero. * The easiest dsat for j:X is using 0: * 0 SIZE 0NOTEQUAL IF [X] ENDIF * 0 0 0NOTEQUAL IF [X] ENDIF * 0 0 IF [X] ENDIF * 0 * Now let's do the case where dsat(X) finishes with a 0: "... 0" * ... 0 SIZE 0NOTEQUAL IF [X] ENDIF * ... 0 0 0NOTEQUAL IF [X] ENDIF * ... 0 0 IF [X] ENDIF * ... 0 * DSAT(X) * The final expression is "DSAT(X)". * It should have either been "0" or "DSAT(X) X" * Thus, this is not a valid dsat. * Now let's do the case where dsat(X) is this: "... " * ... SIZE 0NOTEQUAL IF [X] ENDIF * ... 0NOTEQUAL IF [X] ENDIF * ... 1 IF [X] ENDIF * ... [X] * DSAT(X) [X] * DSAT(X) X is a good dsat */ j: (X: Satisfactions) => Satisfactions; n: (X: Satisfactions) => Satisfactions; }; export type SatisfactionsMaker = ReturnType;