UNPKG

@bitgo/utxo-ord

Version:

Utilities for building ordinals with BitGo utxo-lib

47 lines 1.68 kB
import { OrdOutput } from './OrdOutput'; /** * A range constraint */ type Parameters<T> = { /** Padding preceding the inscription output */ firstChangeOutput: T; /** The inscription output that will inherit the input inscription */ inscriptionOutput: T; /** Padding following the inscription output */ secondChangeOutput: T; /** Not a real output, used only to simplify calculations */ feeOutput: T; }; /** @return canonical sequence of parameters */ export declare function toArray<T>(p: Parameters<T>): [T, T, T, T]; export declare function toParameters<T>(firstChangeOutput: T, inscriptionOutput: T, secondChangeOutput: T, feeOutput: T): Parameters<T>; /** A finished output layout */ export type OutputLayout = Parameters<bigint>; /** * Translates a layout into OrdOutputs. Absent outputs are set to `null`. * * @param inscriptionInput * @param layout * @return OrdOutputs for layout */ export declare function getOrdOutputsForLayout(inscriptionInput: OrdOutput, layout: OutputLayout): Parameters<OrdOutput | null>; /** * High-level constraints for output layout */ export type Constraints = { minChangeOutput: bigint; minInscriptionOutput: bigint; maxInscriptionOutput: bigint; feeFixed: bigint; feePerOutput: bigint; satPos: bigint; total: bigint; }; /** * @param inscriptionInput * @param search * @return a solution that satisfies constraints. If no solution can be found, return `undefined`. */ export declare function findOutputLayout(inscriptionInput: OrdOutput, search: Omit<Constraints, 'satPos' | 'total'>): OutputLayout | undefined; export {}; //# sourceMappingURL=OutputLayout.d.ts.map