import type { PrePeginParams, PrePeginResult, PeginTxResult, HtlcConnectorParams, HtlcConnectorInfo, PeginP2aAnchorInfo, PayoutConnectorParams, PayoutConnectorInfo, Network, AssertPayoutNoPayoutConnectorParams, AssertPayoutScriptInfo, AssertNoPayoutScriptInfo, ChallengeAssertConnectorParams, ChallengeAssertScriptInfo } from './types.js'; import type * as Bindings from '../dist/generated/vault_wasm.js'; /** * HTLC output index for single deposits. */ export declare function initWasm(): Promise; export declare function createPrePeginTransaction(params: PrePeginParams): Promise; export declare function buildPeginTxFromPrePegin(params: PrePeginParams, timelockPegin: number, fundedPrePeginTxHex: string, htlcVout: number): Promise; export declare function getPrePeginHtlcConnectorInfo(params: HtlcConnectorParams): Promise; export declare function computeMinClaimValue(txGraphVersion: number, numLocalChallengers: number, numUniversalChallengers: number, councilQuorum: number, councilSize: number, feeRate: bigint): Promise; export declare function computeMinPeginFee(txGraphVersion: number, numVks: number, numUcs: number, minPeginFeeRate: bigint): Promise; /** * Floor of the Payout transaction fee under `txGraphVersion`: the minimum of * `estimatedVsize * feeRate` across every output-sizing model a deployed * vault provider is known to have used (fixed-34, intermediate, * script-aware). A VP-built payout paying less than this is provably not * produced by any known VP build. `out0Len` must be the TRUSTED length of the * pinned outs[0] script (1..=128); `out1Len` is the measured, UNTRUSTED * commission-script length — safe here because padding cannot raise the floor * (the fixed-34 model saturates the minimum) and shortening only lowers it. * Pass `undefined` for `out1Len` on 2-output (non-VP-claimer) payouts. * `feeRate` is the vault's version-locked `offchainParams.feeRate`. */ export declare function computePayoutFeeFloor(txGraphVersion: number, numVaultKeepers: number, numUniversalChallengers: number, numLocalChallengers: number, councilSize: number, out0Len: number, out1Len: number | null | undefined, feeRate: bigint): Promise; /** * Tx graph versions the shipped vault-wasm binary can build. Callers must * preflight the required version (fresh: active; resume: stamped) against * this list and fail closed instead of hitting per-call errors mid-flow. * * Note: the facade constructors themselves fail closed on unsupported * versions, and derived objects carry the version they were built with — * value-level cross-checks live in `assertWasmPeginSizing` and the golden * byte-parity tests, not in a per-call version echo. */ export declare function supportedTxGraphVersions(): Promise; /** * The PegIn transaction's P2A (pay-to-anchor) output for a graph version: 240 * sats at vout 2, script `51024e73`. Every supported version's PegIn carries * the anchor, so a facade that returns none throws. */ export declare function peginP2aAnchorOutput(txGraphVersion: number): Promise; /** * Validate a PegIn transaction's P2A anchor against a graph version's rule: * the exact anchor (240 sats, vout 2, P2A script). Throws on any mismatch. */ export declare function validatePeginP2aAnchor(txGraphVersion: number, txHex: string): Promise; export declare function createPayoutConnector(params: PayoutConnectorParams, network: Network): Promise; export declare function getPeginPayoutScriptInfo(params: PayoutConnectorParams): Promise<{ payoutScript: string; payoutControlBlock: string; }>; export declare function getAssertPayoutScriptInfo(params: AssertPayoutNoPayoutConnectorParams): Promise; export declare function getAssertNoPayoutScriptInfo(params: AssertPayoutNoPayoutConnectorParams, challengerPubkey: string): Promise; export declare function getChallengeAssertScriptInfo(params: ChallengeAssertConnectorParams): Promise; /** * Derive 32-byte `authAnchor` (OP_RETURN preimage → VP bearer token). * @stability frozen — owned by btc-vault Rust via the vault-wasm pin (`VAULT_WASM_COMMIT`); rotation breaks VP auth for existing deposits. */ export declare function expandAuthAnchor(root: Uint8Array): Promise; /** * Derive 32-byte `hashlockSecret` for HTLC `htlcVout` (preimage → `activateVaultWithSecret`). * @stability frozen — owned by btc-vault Rust; rotation means affected vaults can never activate. */ export declare function expandHashlockSecret(root: Uint8Array, htlcVout: number): Promise; /** * Derive 64-byte `wotsSeed` for HTLC `htlcVout` (→ WOTS keys, hashed as `depositorWotsPkHash`). * @stability frozen — owned by btc-vault Rust; rotation breaks existing `depositorWotsPkHash` → no claim path. */ export declare function expandWotsSeed(root: Uint8Array, htlcVout: number): Promise; /** * Derives the vault ID from a PegIn transaction hash and depositor ETH address. * * Vault ID = keccak256(abi.encode(peginTxHash, depositor)) * This matches the Solidity-side derivation in BTCVaultRegistry. * * @param peginTxHash - 32-byte PegIn tx hash in display order (big-endian), hex encoded * @param depositor - 20-byte Ethereum address of the depositor, hex encoded * @returns Hex-encoded vault ID (32 bytes) */ export declare function deriveVaultId(peginTxHash: string, depositor: string): Promise; export type { Network, PrePeginParams, PrePeginResult, PeginTxResult, PeginP2aAnchorInfo, HtlcConnectorParams, HtlcConnectorInfo, PayoutConnectorParams, PayoutConnectorInfo, AssertPayoutNoPayoutConnectorParams, AssertPayoutScriptInfo, AssertNoPayoutScriptInfo, ChallengeAssertConnectorParams, ChallengeAssertScriptInfo, ChallengeAssertOutputConnectorParams, WatchtowerArtifactsInputs, WotsKeypairDerivation, WronglyChallengedPsbts, WronglyChallengedSigs, } from './types.js'; export { TAP_INTERNAL_KEY, tapInternalPubkey } from './constants.js'; export { assertPositiveBigintArray } from './value-guards.js'; export declare const getChallengeAssertOutputScriptPubKey: (params: import("./types.js").ChallengeAssertOutputConnectorParams) => Promise; export declare const buildAssertClaimerPsbt: (txGraphVersion: number, graphJson: string) => Promise, buildClaimPsbt: (txGraphVersion: number, graphJson: string) => Promise, buildPayoutClaimerPsbt: (txGraphVersion: number, graphJson: string) => Promise, buildPayoutDepositorPsbt: (txGraphVersion: number, graphJson: string) => Promise, buildWatchtowerArtifacts: (inputs: import("./types.js").WatchtowerArtifactsInputs) => Promise, buildWronglyChallengedPsbts: (txGraphVersion: number, graphJson: string) => Promise, attachFinalizedAssert: (txGraphVersion: number, artifactsJson: string, keypairJson: string) => Promise, extractTapScriptSig: (psbtBase64: string, inputIndex: number) => Promise, finalizeClaimTx: (txGraphVersion: number, graphJson: string, depositorSigHex: string) => Promise, finalizePayout: (txGraphVersion: number, artifactsJson: string) => Promise, finalizeWronglyChallenged: (txGraphVersion: number, artifactsJson: string, challengerPkHex: string, gcIndex: number, preimageHex: string) => Promise, pinPegoutProof: (txGraphVersion: number, artifactsJson: string, proofHex: string) => Promise, validateWotsKeypairAgainstGraph: (txGraphVersion: number, keypair: unknown, graphJson: string) => Promise, verifyGraphPresignatures: (txGraphVersion: number, graphJson: string) => Promise, verifyWatchtowerArtifacts: (txGraphVersion: number, artifactsJson: string) => Promise, wotsKeypairFromSeed: (wotsSeed: Uint8Array) => Promise; /** wasm-bindgen class with no value guards. See README "WASM Classes". */ export declare const WasmPeginTx: typeof Bindings.WasmPeginTx; export type WasmPeginTx = Bindings.WasmPeginTx; /** wasm-bindgen class with no value guards. See README "WASM Classes". */ export declare const WasmPeginPayoutConnector: typeof Bindings.WasmPeginPayoutConnector; export type WasmPeginPayoutConnector = Bindings.WasmPeginPayoutConnector; /** wasm-bindgen class with no value guards. See README "WASM Classes". */ export declare const WasmPrePeginTx: typeof Bindings.WasmPrePeginTx; export type WasmPrePeginTx = Bindings.WasmPrePeginTx; /** wasm-bindgen class with no value guards. See README "WASM Classes". */ export declare const WasmPrePeginHtlcConnector: typeof Bindings.WasmPrePeginHtlcConnector; export type WasmPrePeginHtlcConnector = Bindings.WasmPrePeginHtlcConnector; //# sourceMappingURL=index-node.d.ts.map