@babylonlabs-io/ts-sdk 0.48.0 → 0.48.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PayoutManager-BbemBIo9.js → PayoutManager-D02AePm4.js} +78 -65
- package/dist/PayoutManager-D02AePm4.js.map +1 -0
- package/dist/PayoutManager-DD1audlx.cjs +2 -0
- package/dist/PayoutManager-DD1audlx.cjs.map +1 -0
- package/dist/{PeginManager-BMO6R9I9.js → PeginManager-6seoi9mV.js} +217 -198
- package/dist/PeginManager-6seoi9mV.js.map +1 -0
- package/dist/PeginManager-CHZieoEQ.cjs +2 -0
- package/dist/PeginManager-CHZieoEQ.cjs.map +1 -0
- package/dist/buildAndBroadcastRefund-Bi07LxuY.cjs +2 -0
- package/dist/buildAndBroadcastRefund-Bi07LxuY.cjs.map +1 -0
- package/dist/{buildAndBroadcastRefund-sfl7Aac9.js → buildAndBroadcastRefund-DXHs6unL.js} +412 -362
- package/dist/buildAndBroadcastRefund-DXHs6unL.js.map +1 -0
- package/dist/{challengeAssert-1fy_EzAi.js → challengeAssert-ChvLypwc.js} +7 -7
- package/dist/{challengeAssert-1fy_EzAi.js.map → challengeAssert-ChvLypwc.js.map} +1 -1
- package/dist/challengeAssert-Culc7DoS.cjs +2 -0
- package/dist/{challengeAssert-DEw-z3n9.cjs.map → challengeAssert-Culc7DoS.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +170 -169
- package/dist/noPayout-CA4-x5vZ.js +174 -0
- package/dist/noPayout-CA4-x5vZ.js.map +1 -0
- package/dist/noPayout-CJ_Acpl_.cjs +2 -0
- package/dist/noPayout-CJ_Acpl_.cjs.map +1 -0
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +168 -167
- package/dist/tbv/core/managers/PayoutManager.d.ts.map +1 -1
- package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
- package/dist/tbv/core/managers/index.cjs +1 -1
- package/dist/tbv/core/managers/index.js +2 -2
- package/dist/tbv/core/primitives/index.cjs +1 -1
- package/dist/tbv/core/primitives/index.d.ts +8 -7
- package/dist/tbv/core/primitives/index.d.ts.map +1 -1
- package/dist/tbv/core/primitives/index.js +30 -29
- package/dist/tbv/core/primitives/psbt/__tests__/verifyScriptPathSchnorrSignature.test.d.ts +14 -0
- package/dist/tbv/core/primitives/psbt/__tests__/verifyScriptPathSchnorrSignature.test.d.ts.map +1 -0
- package/dist/tbv/core/primitives/psbt/refund.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/verifyScriptPathSchnorrSignature.d.ts +53 -0
- package/dist/tbv/core/primitives/psbt/verifyScriptPathSchnorrSignature.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts.map +1 -1
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +2 -2
- package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts +20 -0
- package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts.map +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +168 -167
- package/dist/tbv/integrations/aave/clients/__tests__/hub.test.d.ts +2 -0
- package/dist/tbv/integrations/aave/clients/__tests__/hub.test.d.ts.map +1 -0
- package/dist/tbv/integrations/aave/clients/abis/AaveHub.abi.json.d.ts +24 -0
- package/dist/tbv/integrations/aave/clients/hub.d.ts +28 -0
- package/dist/tbv/integrations/aave/clients/hub.d.ts.map +1 -0
- package/dist/tbv/integrations/aave/clients/index.d.ts +1 -0
- package/dist/tbv/integrations/aave/clients/index.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/index.cjs +1 -1
- package/dist/tbv/integrations/aave/index.cjs.map +1 -1
- package/dist/tbv/integrations/aave/index.d.ts +1 -1
- package/dist/tbv/integrations/aave/index.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/index.js +246 -193
- package/dist/tbv/integrations/aave/index.js.map +1 -1
- package/dist/verifyScriptPathSchnorrSignature-D43cncKJ.cjs +2 -0
- package/dist/verifyScriptPathSchnorrSignature-D43cncKJ.cjs.map +1 -0
- package/dist/verifyScriptPathSchnorrSignature-DFJAEleY.js +563 -0
- package/dist/verifyScriptPathSchnorrSignature-DFJAEleY.js.map +1 -0
- package/package.json +3 -3
- package/dist/PayoutManager-BLpgkfOS.cjs +0 -2
- package/dist/PayoutManager-BLpgkfOS.cjs.map +0 -1
- package/dist/PayoutManager-BbemBIo9.js.map +0 -1
- package/dist/PeginManager-BMO6R9I9.js.map +0 -1
- package/dist/PeginManager-CfkjDMy7.cjs +0 -2
- package/dist/PeginManager-CfkjDMy7.cjs.map +0 -1
- package/dist/assertPsbtUnsignedTxMatches-BHyBdtxs.js +0 -481
- package/dist/assertPsbtUnsignedTxMatches-BHyBdtxs.js.map +0 -1
- package/dist/assertPsbtUnsignedTxMatches-s9H0Qqkl.cjs +0 -2
- package/dist/assertPsbtUnsignedTxMatches-s9H0Qqkl.cjs.map +0 -1
- package/dist/buildAndBroadcastRefund-sfl7Aac9.js.map +0 -1
- package/dist/buildAndBroadcastRefund-tR9sGPwy.cjs +0 -2
- package/dist/buildAndBroadcastRefund-tR9sGPwy.cjs.map +0 -1
- package/dist/challengeAssert-DEw-z3n9.cjs +0 -2
- package/dist/noPayout-5-wtWQ_f.js +0 -154
- package/dist/noPayout-5-wtWQ_f.js.map +0 -1
- package/dist/noPayout-DNevEzJR.cjs +0 -2
- package/dist/noPayout-DNevEzJR.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noPayout-CJ_Acpl_.cjs","sources":["../src/tbv/core/primitives/psbt/refund.ts","../src/tbv/core/primitives/psbt/noPayout.ts"],"sourcesContent":["/**\n * Refund PSBT Builder Primitive\n *\n * Builds an unsigned refund PSBT for a depositor to reclaim BTC from\n * a timed-out Pre-PegIn HTLC output via the refund script (leaf 1).\n *\n * The refund script enforces a CSV timelock (timelockRefund blocks) and\n * requires only the depositor's Schnorr signature — no vault provider or\n * keeper involvement.\n *\n * @module primitives/psbt/refund\n */\n\nimport {\n getPrePeginHtlcConnectorInfo,\n initWasm,\n tapInternalPubkey,\n WasmPrePeginTx,\n} from \"@babylonlabs-io/babylon-tbv-rust-wasm\";\nimport { Buffer } from \"buffer\";\nimport { Psbt, Transaction } from \"bitcoinjs-lib\";\n\nimport {\n TAPSCRIPT_LEAF_VERSION,\n deriveBip86ScriptPubKeyHex,\n hexToUint8Array,\n stripHexPrefix,\n uint8ArrayToHex,\n} from \"../utils/bitcoin\";\nimport { normalizeAuthAnchorHash, type PrePeginParams } from \"./pegin\";\n\n/**\n * Parameters for building a refund PSBT\n */\nexport interface BuildRefundPsbtParams {\n /** Same PrePeginParams used when the original Pre-PegIn tx was created */\n prePeginParams: PrePeginParams;\n /** Funded Pre-PegIn transaction hex (the tx whose HTLC output is being refunded) */\n fundedPrePeginTxHex: string;\n /** Index of the HTLC output in the Pre-PegIn transaction */\n htlcVout: number;\n /** Transaction fee in satoshis for the refund transaction */\n refundFee: bigint;\n /** SHA256 hash commitment for the HTLC (64 hex chars, no 0x prefix) */\n hashlock: string;\n}\n\n/**\n * Result of building a refund PSBT\n */\nexport interface BuildRefundPsbtResult {\n /** PSBT hex ready for depositor signing */\n psbtHex: string;\n}\n\n/**\n * Build a PSBT for signing the refund transaction.\n *\n * The refund transaction spends the Pre-PegIn HTLC output via leaf 1\n * (the refund script: `<timelockRefund> CSV DROP <depositorPubkey> CHECKSIG`).\n * The PSBT includes the tapLeafScript entry so the depositor's wallet can\n * sign using Taproot script-path spending.\n *\n * The input's sequence is set to `timelockRefund` by the WASM, enforcing\n * the Bitcoin CSV timelock. The refund broadcast will be rejected by the\n * network if the timelock has not yet expired.\n *\n * @param params - Refund PSBT parameters\n * @returns PSBT hex for depositor signing\n * @throws If the HTLC output at htlcVout is not found\n * @throws If the refund transaction does not have exactly 1 input\n */\nexport async function buildRefundPsbt(\n params: BuildRefundPsbtParams,\n): Promise<BuildRefundPsbtResult> {\n await initWasm();\n\n const { prePeginParams, fundedPrePeginTxHex, htlcVout, refundFee, hashlock } =\n params;\n\n // The 14th positional arg `auth_anchor_hash` is `Option<String>` in\n // the Rust WASM constructor (the 9th arg `min_pegin_fee_rate` requires\n // the two-rate constructor from btc-vault #1930). Production peg-ins\n // (PeginManager) always commit an OP_RETURN <PUSH32 SHA256(authAnchor)>\n // output at `vout = hashlocks.length`; the unfunded template must\n // include it so `fromFundedTransaction` aligns with the funded tx.\n // Normalize identically to the peg-in primitives (`0x` strip,\n // lowercase, length/charset validation) so a direct primitive caller\n // reusing successful peg-in params doesn't hand unnormalized bytes to\n // WASM. Pass `undefined` for legacy non-auth-anchored Pre-PegIns.\n const normalizedAuthAnchorHash = normalizeAuthAnchorHash(\n prePeginParams.authAnchorHash,\n );\n const unfundedTx = new (WasmPrePeginTx as unknown as new (\n depositor: string,\n vault_provider: string,\n vault_keepers: string[],\n universal_challengers: string[],\n hashlocks: string[],\n pegin_amounts: BigUint64Array,\n timelock_refund: number,\n fee_rate: bigint,\n min_pegin_fee_rate: bigint,\n num_local_challengers: number,\n council_quorum: number,\n council_size: number,\n network: string,\n auth_anchor_hash?: string,\n ) => typeof WasmPrePeginTx.prototype)(\n prePeginParams.depositorPubkey,\n prePeginParams.vaultProviderPubkey,\n prePeginParams.vaultKeeperPubkeys,\n prePeginParams.universalChallengerPubkeys,\n [...prePeginParams.hashlocks],\n new BigUint64Array(prePeginParams.pegInAmounts),\n prePeginParams.timelockRefund,\n prePeginParams.feeRate,\n prePeginParams.minPeginFeeRate,\n prePeginParams.numLocalChallengers,\n prePeginParams.councilQuorum,\n prePeginParams.councilSize,\n prePeginParams.network,\n normalizedAuthAnchorHash,\n );\n\n let fundedTx: WasmPrePeginTx | null = null;\n try {\n // Cross-check the reconstructed unfunded template against the funded\n // transaction: the WASM template's HTLC scriptPubKey at `htlcVout`\n // must equal the bytes the funded tx carries at the same output.\n // If they disagree, the template was reconstructed from the wrong\n // (hashlocks, amounts) vector — signing it would produce a refund\n // that does not spend the on-chain HTLC the depositor expects.\n // This is the explicit invariant the audit recommends: never sign a\n // refund whose template doesn't match the on-chain output bytes.\n const expectedHtlcScriptPubKey = unfundedTx\n .getHtlcScriptPubKey(htlcVout)\n .toLowerCase();\n // The reconstructed template's HTLC output value at `htlcVout`,\n // sized by WASM from the supplied `pegInAmounts` via the protocol\n // formula `htlcValue = peginAmount + depositorClaimValue + minPeginFee`.\n // Captured before `fromFundedTransaction` to bind it to the value the\n // funded tx actually carries (see the cross-check below).\n const expectedHtlcValue = unfundedTx.getHtlcValue(htlcVout);\n\n fundedTx = unfundedTx.fromFundedTransaction(fundedPrePeginTxHex);\n\n const refundTxHex = fundedTx.buildRefundTx(refundFee, htlcVout);\n\n const htlcConnector = await getPrePeginHtlcConnectorInfo({\n depositorPubkey: prePeginParams.depositorPubkey,\n vaultProviderPubkey: prePeginParams.vaultProviderPubkey,\n vaultKeeperPubkeys: prePeginParams.vaultKeeperPubkeys,\n universalChallengerPubkeys: prePeginParams.universalChallengerPubkeys,\n hashlock,\n timelockRefund: prePeginParams.timelockRefund,\n network: prePeginParams.network,\n });\n\n const cleanPrePeginHex = fundedPrePeginTxHex.startsWith(\"0x\")\n ? fundedPrePeginTxHex.slice(2)\n : fundedPrePeginTxHex;\n const prePeginTx = Transaction.fromHex(cleanPrePeginHex);\n\n const htlcOutput = prePeginTx.outs[htlcVout];\n if (!htlcOutput) {\n throw new Error(\n `HTLC output at vout ${htlcVout} not found in funded Pre-PegIn tx ` +\n `(tx has ${prePeginTx.outs.length} outputs)`,\n );\n }\n\n const actualHtlcScriptPubKey = uint8ArrayToHex(\n new Uint8Array(htlcOutput.script),\n ).toLowerCase();\n if (actualHtlcScriptPubKey !== expectedHtlcScriptPubKey) {\n throw new Error(\n `HTLC scriptPubKey mismatch at vout ${htlcVout}: reconstructed ` +\n `template expects ${expectedHtlcScriptPubKey}, funded tx carries ` +\n `${actualHtlcScriptPubKey}. Refund refused — the (hashlocks, ` +\n `pegInAmounts) vector does not match the on-chain commitment.`,\n );\n }\n\n // Value cross-check (mirrors the script check above): the template's\n // HTLC value — derived by WASM from `pegInAmounts` via the protocol\n // formula — must equal the value the funded tx pays at this output.\n // A caller that hands the full HTLC output value (or any wrong amount)\n // as `pegInAmounts` would inflate the template value and trip this\n // guard, rather than silently signing a refund built from a template\n // that disagrees with the on-chain commitment.\n const actualHtlcValue = BigInt(htlcOutput.value);\n if (actualHtlcValue !== expectedHtlcValue) {\n throw new Error(\n `HTLC value mismatch at vout ${htlcVout}: reconstructed template ` +\n `expects ${expectedHtlcValue} sat, funded tx carries ` +\n `${actualHtlcValue} sat. Refund refused — the pegInAmounts vector ` +\n `does not match the on-chain commitment.`,\n );\n }\n\n const refundTx = Transaction.fromHex(refundTxHex);\n\n if (refundTx.ins.length !== 1) {\n throw new Error(\n `Refund transaction must have exactly 1 input, got ${refundTx.ins.length}`,\n );\n }\n\n const refundInput = refundTx.ins[0];\n\n // Verify the refund input spends the correct Pre-PegIn HTLC output\n const prePeginTxid = prePeginTx.getId();\n const refundInputTxid = uint8ArrayToHex(\n new Uint8Array(refundInput.hash).slice().reverse(),\n );\n if (refundInputTxid !== prePeginTxid) {\n throw new Error(\n `Refund input does not reference the Pre-PegIn transaction. ` +\n `Expected ${prePeginTxid}, got ${refundInputTxid}`,\n );\n }\n if (refundInput.index !== htlcVout) {\n throw new Error(\n `Refund input index ${refundInput.index} does not match expected htlcVout ${htlcVout}`,\n );\n }\n\n const psbt = new Psbt();\n psbt.setVersion(refundTx.version);\n psbt.setLocktime(refundTx.locktime);\n\n psbt.addInput({\n hash: refundInput.hash,\n index: refundInput.index,\n sequence: refundInput.sequence,\n witnessUtxo: {\n script: htlcOutput.script,\n value: htlcOutput.value,\n },\n tapLeafScript: [\n {\n leafVersion: TAPSCRIPT_LEAF_VERSION,\n script: Buffer.from(hexToUint8Array(htlcConnector.refundScript)),\n controlBlock: Buffer.from(\n hexToUint8Array(htlcConnector.refundControlBlock),\n ),\n },\n ],\n tapInternalKey: Buffer.from(tapInternalPubkey),\n });\n\n // Output side: pin the single refund output to the depositor's own\n // BIP-86 P2TR address, mirroring the input-side pinning above. WASM\n // builds the refund output from the refund leaf's depositor key, so a\n // correct template always pays exactly one output back to the depositor.\n // Asserting it here means a malformed template (or a tampered WASM)\n // cannot redirect the reclaimed funds to a script the depositor does\n // not control.\n if (refundTx.outs.length !== 1) {\n throw new Error(\n `Refund transaction must have exactly 1 output, got ${refundTx.outs.length}`,\n );\n }\n const refundOutput = refundTx.outs[0];\n const expectedDepositorScriptPubKey = stripHexPrefix(\n deriveBip86ScriptPubKeyHex(prePeginParams.depositorPubkey),\n ).toLowerCase();\n const actualRefundOutputScriptPubKey = uint8ArrayToHex(\n new Uint8Array(refundOutput.script),\n ).toLowerCase();\n if (actualRefundOutputScriptPubKey !== expectedDepositorScriptPubKey) {\n throw new Error(\n `Refund output scriptPubKey ${actualRefundOutputScriptPubKey} does not ` +\n `match the depositor's BIP-86 address ${expectedDepositorScriptPubKey}. ` +\n `Refund refused — the reclaimed funds would not return to the depositor.`,\n );\n }\n\n // Value: the single refund output must return the full HTLC value minus\n // exactly the requested fee. The refund is 1-in/1-out (asserted above), so\n // a value below `htlcValue - refundFee` means WASM applied a larger fee\n // than requested — the difference would be burned as miner fee. Pin it so\n // the depositor reclaims the expected amount, not a silently reduced one.\n const expectedRefundOutputValue = actualHtlcValue - refundFee;\n if (BigInt(refundOutput.value) !== expectedRefundOutputValue) {\n throw new Error(\n `Refund output value ${BigInt(refundOutput.value)} sat does not equal ` +\n `the HTLC value ${actualHtlcValue} sat minus the requested fee ` +\n `${refundFee} sat (expected ${expectedRefundOutputValue} sat). ` +\n `Refund refused — the reclaimed amount would be burned as excess fee.`,\n );\n }\n\n psbt.addOutput({\n script: refundOutput.script,\n value: refundOutput.value,\n });\n\n return { psbtHex: psbt.toHex() };\n } finally {\n fundedTx?.free();\n unfundedTx.free();\n }\n}\n","/**\n * NoPayout PSBT Builder\n *\n * Builds unsigned PSBTs for the depositor's NoPayout transaction\n * (depositor-as-claimer path, per challenger). The depositor signs input 0\n * using the NoPayout taproot script from WasmAssertPayoutNoPayoutConnector.\n *\n * @module primitives/psbt/noPayout\n * @see btc-vault crates/vault/docs/btc-transactions-spec.md — Assert output 0 NoPayout connector\n */\n\nimport {\n type AssertPayoutNoPayoutConnectorParams,\n type Network,\n getAssertNoPayoutScriptInfo,\n tapInternalPubkey,\n} from \"@babylonlabs-io/babylon-tbv-rust-wasm\";\nimport { Buffer } from \"buffer\";\nimport { Psbt, Transaction, payments } from \"bitcoinjs-lib\";\n\nimport {\n TAPSCRIPT_LEAF_VERSION,\n getNetwork,\n hexToUint8Array,\n processPublicKeyToXOnly,\n stripHexPrefix,\n} from \"../utils/bitcoin\";\n\n/**\n * Parameters for building a NoPayout PSBT\n */\nexport interface NoPayoutParams {\n /** NoPayout transaction hex (unsigned) from VP */\n noPayoutTxHex: string;\n /** Challenger's x-only public key (hex encoded) */\n challengerPubkey: string;\n /** Prevouts for all inputs [{script_pubkey, value}] from VP */\n prevouts: Array<{ script_pubkey: string; value: number }>;\n /** Parameters for the Assert Payout/NoPayout connector */\n connectorParams: AssertPayoutNoPayoutConnectorParams;\n}\n\n/**\n * Build unsigned NoPayout PSBT.\n *\n * The NoPayout transaction is specific to each challenger.\n * Input 0 is the one the depositor signs using the NoPayout taproot script path.\n *\n * @param params - NoPayout parameters\n * @returns Unsigned PSBT hex ready for signing\n */\nexport async function buildNoPayoutPsbt(\n params: NoPayoutParams,\n): Promise<string> {\n const noPayoutTxHex = stripHexPrefix(params.noPayoutTxHex);\n const noPayoutTx = Transaction.fromHex(noPayoutTxHex);\n\n // Get NoPayout script and control block for this challenger\n const { noPayoutScript, noPayoutControlBlock } =\n await getAssertNoPayoutScriptInfo(\n params.connectorParams,\n params.challengerPubkey,\n );\n\n const scriptBytes = hexToUint8Array(noPayoutScript);\n const controlBlockBytes = hexToUint8Array(noPayoutControlBlock);\n\n const psbt = new Psbt();\n psbt.setVersion(noPayoutTx.version);\n psbt.setLocktime(noPayoutTx.locktime);\n\n // Add all inputs - depositor signs input 0 only\n for (let i = 0; i < noPayoutTx.ins.length; i++) {\n const input = noPayoutTx.ins[i];\n const prevout = params.prevouts[i];\n\n if (!prevout) {\n throw new Error(`Missing prevout data for input ${i}`);\n }\n\n const inputData: Parameters<typeof psbt.addInput>[0] = {\n hash: input.hash,\n index: input.index,\n sequence: input.sequence,\n witnessUtxo: {\n script: Buffer.from(hexToUint8Array(stripHexPrefix(prevout.script_pubkey))),\n value: prevout.value,\n },\n };\n\n // Input 0: depositor signs using taproot script path\n if (i === 0) {\n inputData.tapLeafScript = [\n {\n leafVersion: TAPSCRIPT_LEAF_VERSION,\n script: Buffer.from(scriptBytes),\n controlBlock: Buffer.from(controlBlockBytes),\n },\n ];\n inputData.tapInternalKey = Buffer.from(tapInternalPubkey);\n }\n\n psbt.addInput(inputData);\n }\n\n // Add outputs\n for (const output of noPayoutTx.outs) {\n psbt.addOutput({\n script: output.script,\n value: output.value,\n });\n }\n\n return psbt.toHex();\n}\n\n/**\n * Validate that a NoPayout transaction pays to the challenger via the\n * protocol-defined output structure: a single BIP-86 P2TR output derived from\n * the challenger's x-only pubkey.\n *\n * Mirrors the per-role payout output validation now inlined in\n * `buildPayoutPsbt` for the NoPayout path, where the sink is fixed by the\n * protocol rather than read from on-chain registration\n * (see `crates/vault/src/transactions/nopayout.rs::NoPayoutTx::new`).\n *\n * @param noPayoutTxHex - Raw NoPayout transaction hex\n * @param challengerPubkey - Challenger's x-only public key (hex)\n * @param network - Bitcoin network used to derive the P2TR scriptPubKey\n * @throws If the transaction does not have exactly one output\n * @throws If the single output's scriptPubKey does not equal the BIP-86 P2TR\n * scriptPubKey for the challenger\n */\nexport function assertNoPayoutOutputMatchesChallenger(\n noPayoutTxHex: string,\n challengerPubkey: string,\n network: Network,\n): void {\n const tx = Transaction.fromHex(stripHexPrefix(noPayoutTxHex));\n\n if (tx.outs.length !== 1) {\n throw new Error(\n `NoPayout transaction must have exactly 1 output, got ${tx.outs.length}`,\n );\n }\n\n const xOnly = hexToUint8Array(processPublicKeyToXOnly(challengerPubkey));\n const { output: expectedScript } = payments.p2tr({\n internalPubkey: Buffer.from(xOnly),\n network: getNetwork(network),\n });\n if (!expectedScript) {\n throw new Error(\n \"Failed to derive challenger BIP-86 P2TR scriptPubKey for NoPayout output validation\",\n );\n }\n\n if (!tx.outs[0].script.equals(expectedScript)) {\n throw new Error(\n \"NoPayout transaction does not pay to the expected challenger BIP-86 P2TR address\",\n );\n }\n}\n"],"names":["buildRefundPsbt","params","initWasm","prePeginParams","fundedPrePeginTxHex","htlcVout","refundFee","hashlock","normalizedAuthAnchorHash","normalizeAuthAnchorHash","unfundedTx","WasmPrePeginTx","fundedTx","expectedHtlcScriptPubKey","expectedHtlcValue","refundTxHex","htlcConnector","getPrePeginHtlcConnectorInfo","cleanPrePeginHex","prePeginTx","Transaction","htlcOutput","actualHtlcScriptPubKey","uint8ArrayToHex","actualHtlcValue","refundTx","refundInput","prePeginTxid","refundInputTxid","psbt","Psbt","TAPSCRIPT_LEAF_VERSION","Buffer","hexToUint8Array","tapInternalPubkey","refundOutput","expectedDepositorScriptPubKey","stripHexPrefix","deriveBip86ScriptPubKeyHex","actualRefundOutputScriptPubKey","expectedRefundOutputValue","buildNoPayoutPsbt","noPayoutTxHex","noPayoutTx","noPayoutScript","noPayoutControlBlock","getAssertNoPayoutScriptInfo","scriptBytes","controlBlockBytes","i","input","prevout","inputData","output","assertNoPayoutOutputMatchesChallenger","challengerPubkey","network","tx","xOnly","processPublicKeyToXOnly","expectedScript","payments","getNetwork"],"mappings":"sNAwEA,eAAsBA,EACpBC,EACgC,CAChC,MAAMC,WAAA,EAEN,KAAM,CAAE,eAAAC,EAAgB,oBAAAC,EAAqB,SAAAC,EAAU,UAAAC,EAAW,SAAAC,GAChEN,EAYIO,EAA2BC,EAAAA,wBAC/BN,EAAe,cAAA,EAEXO,EAAa,IAAKC,EAAAA,eAgBtBR,EAAe,gB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YAAarB,EAAAA,uBACb,OAAQC,EAAAA,OAAO,KAAKe,CAAW,EAC/B,aAAcf,EAAAA,OAAO,KAAKgB,CAAiB,CAAA,CAC7C,EAEFI,EAAU,eAAiBpB,SAAO,KAAKE,EAAAA,iBAAiB,GAG1DL,EAAK,SAASuB,CAAS,CACzB,CAGA,UAAWC,KAAUV,EAAW,KAC9Bd,EAAK,UAAU,CACb,OAAQwB,EAAO,OACf,MAAOA,EAAO,KAAA,CACf,EAGH,OAAOxB,EAAK,MAAA,CACd,CAmBO,SAASyB,EACdZ,EACAa,EACAC,EACM,CACN,MAAMC,EAAKrC,EAAAA,YAAY,QAAQiB,EAAAA,eAAeK,CAAa,CAAC,EAE5D,GAAIe,EAAG,KAAK,SAAW,EACrB,MAAM,IAAI,MACR,wDAAwDA,EAAG,KAAK,MAAM,EAAA,EAI1E,MAAMC,EAAQzB,EAAAA,gBAAgB0B,EAAAA,wBAAwBJ,CAAgB,CAAC,EACjE,CAAE,OAAQK,GAAmBC,EAAAA,SAAS,KAAK,CAC/C,eAAgB7B,EAAAA,OAAO,KAAK0B,CAAK,EACjC,QAASI,EAAAA,WAAWN,CAAO,CAAA,CAC5B,EACD,GAAI,CAACI,EACH,MAAM,IAAI,MACR,qFAAA,EAIJ,GAAI,CAACH,EAAG,KAAK,CAAC,EAAE,OAAO,OAAOG,CAAc,EAC1C,MAAM,IAAI,MACR,kFAAA,CAGN"}
|
package/dist/tbv/core/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../challengeAssert-DEw-z3n9.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),u=require("../../assertPsbtUnsignedTxMatches-s9H0Qqkl.cjs"),A=require("../../peginInput-DH6X4ITS.cjs"),S=require("../../noPayout-DNevEzJR.cjs"),r=require("../../bitcoin-CHfKAhcI.cjs"),R=require("../../signing-Bnsro0hE.cjs"),P=require("../../validation-u8W7Lp2x.cjs"),n=require("../../PeginManager-CfkjDMy7.cjs"),p=require("../../PayoutManager-BLpgkfOS.cjs"),_=require("../../ApplicationRegistry.abi-BAPhJch3.cjs"),m=require("../../BTCVaultRegistry.abi-JdeqLz4x.cjs"),d=require("../../errors-CGcNP0rV.cjs"),o=require("../../waitForTransactionReceiptSmartAware-U706oKTc.cjs"),t=require("../../fundPeginTransaction-DuMwnytD.cjs"),c=require("../../reservation-xTL2a9Q-.cjs"),a=require("../../mempoolApi-C_9JhjCI.cjs"),i=require("../../primeVpAuth-Br6RwE3r.cjs"),s=require("../../types-WA0LrDk1.cjs"),g=require("../../errors-Bu0H-dZD.cjs"),e=require("../../buildAndBroadcastRefund-tR9sGPwy.cjs"),T=require("../../peginState-BijNNT15.cjs");exports.buildChallengeAssertPsbt=E.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=E.buildDepositorPayoutPsbt;exports.computeNumLocalChallengers=E.computeNumLocalChallengers;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>l.computeMinClaimValue});Object.defineProperty(exports,"computeMinPeginFee",{enumerable:!0,get:()=>l.computeMinPeginFee});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>l.deriveVaultId});Object.defineProperty(exports,"expandAuthAnchor",{enumerable:!0,get:()=>l.expandAuthAnchor});Object.defineProperty(exports,"expandHashlockSecret",{enumerable:!0,get:()=>l.expandHashlockSecret});Object.defineProperty(exports,"expandWotsSeed",{enumerable:!0,get:()=>l.expandWotsSeed});exports.PsbtSubstitutionError=u.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=u.assertPsbtUnsignedTxMatches;exports.buildPayoutPsbt=u.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=u.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=u.buildPrePeginPsbt;exports.createPayoutScript=u.createPayoutScript;exports.extractPayoutSignature=u.extractPayoutSignature;exports.buildPeginInputPsbt=A.buildPeginInputPsbt;exports.extractPeginInputSignature=A.extractPeginInputSignature;exports.finalizePeginInputPsbt=A.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=S.buildNoPayoutPsbt;exports.buildRefundPsbt=S.buildRefundPsbt;exports.deriveBip86ScriptPubKeyHex=r.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=r.deriveNativeSegwitAddress;exports.deriveTaprootAddress=r.deriveTaprootAddress;exports.ensureHexPrefix=r.ensureHexPrefix;exports.formatSatoshisToBtc=r.formatSatoshisToBtc;exports.getNetwork=r.getNetwork;exports.getSortedXOnlyPubkeys=r.getSortedXOnlyPubkeys;exports.hexToUint8Array=r.hexToUint8Array;exports.isAddressFromPublicKey=r.isAddressFromPublicKey;exports.isValidHex=r.isValidHex;exports.processPublicKeyToXOnly=r.processPublicKeyToXOnly;exports.stripHexPrefix=r.stripHexPrefix;exports.toXOnly=r.toXOnly;exports.uint8ArrayToHex=r.uint8ArrayToHex;exports.validateWalletPubkey=r.validateWalletPubkey;exports.createTaprootScriptPathSignOptions=R.createTaprootScriptPathSignOptions;exports.BITCOIN_ADDRESS_RE=P.BITCOIN_ADDRESS_RE;exports.HEX_RE=P.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=P.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=P.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=P.TXID_RE;exports.PeginManager=n.PeginManager;exports.VAULT_APP_NAME=n.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=n.buildFundingOutpointsCommitment;exports.buildVaultContext=n.buildVaultContext;exports.computeWotsBlockPublicKeysHash=n.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=n.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=n.deriveWotsBlocksFromSeed;exports.estimateSubmitPeginRequestBatchGas=n.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=p.PayoutManager;exports.computeHashlock=p.computeHashlock;exports.validateSecretAgainstHashlock=p.validateSecretAgainstHashlock;exports.ApplicationRegistryABI=_.ApplicationRegistryABI;exports.ProtocolParamsABI=_.ProtocolParamsABI;exports.BTCVaultRegistryABI=m.BTCVaultRegistryABI;exports.CONTRACT_ERRORS=d.CONTRACT_ERRORS;exports.extractErrorData=d.extractErrorData;exports.getContractErrorMessage=d.getContractErrorMessage;exports.handleContractError=d.handleContractError;exports.isKnownContractError=d.isKnownContractError;exports.BitcoinScriptType=o.BitcoinScriptType;exports.applyChangeOutputPolicy=o.applyChangeOutputPolicy;exports.calculateBtcTxHash=o.calculateBtcTxHash;exports.computeChangeOutputFeeSats=o.computeChangeOutputFeeSats;exports.computeMaxDeposit=o.computeMaxDeposit;exports.computePeginBaseFeeSats=o.computePeginBaseFeeSats;exports.getDustThreshold=o.getDustThreshold;exports.getPsbtInputFields=o.getPsbtInputFields;exports.getScriptType=o.getScriptType;exports.selectUtxosForPegin=o.selectUtxosForPegin;exports.shouldAddChangeOutput=o.shouldAddChangeOutput;exports.waitForTransactionReceiptSmartAware=o.waitForTransactionReceiptSmartAware;exports.BTC_DUST_SAT=t.BTC_DUST_SAT;exports.DUST_THRESHOLD=t.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=t.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=t.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=t.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=t.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=t.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=t.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=t.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=t.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=t.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=t.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=t.fundPeginTransaction;exports.parseUnfundedWasmTransaction=t.parseUnfundedWasmTransaction;exports.peginOutputCount=t.peginOutputCount;exports.rateBasedTxBufferFee=t.rateBasedTxBufferFee;exports.UtxoNotAvailableError=c.UtxoNotAvailableError;exports.assertUtxosAvailable=c.assertUtxosAvailable;exports.extractInputsFromTransaction=c.extractInputsFromTransaction;exports.findOverlappingPendingVaults=c.findOverlappingPendingVaults;exports.validateUtxosAvailable=c.validateUtxosAvailable;exports.MEMPOOL_API_URLS=a.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=a.ViemVaultRegistryReader;exports.getAddressTxs=a.getAddressTxs;exports.getAddressUtxos=a.getAddressUtxos;exports.getMempoolApiUrl=a.getMempoolApiUrl;exports.getNetworkFees=a.getNetworkFees;exports.getTipHeight=a.getTipHeight;exports.getTxHex=a.getTxHex;exports.getTxInfo=a.getTxInfo;exports.getUtxoInfo=a.getUtxoInfo;exports.pushTx=a.pushTx;exports.validateOffchainParams=a.validateOffchainParams;exports.validatePegInConfiguration=a.validatePegInConfiguration;exports.validateTBVProtocolParams=a.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=i.OnChainBtcVaultStatus;exports.ServerIdentityError=i.ServerIdentityError;exports.VaultProviderRpcClient=i.VaultProviderRpcClient;exports.ViemProtocolParamsReader=i.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=i.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=i.ViemVaultKeeperReader;exports.VpResponseValidationError=i.VpResponseValidationError;exports.VpTokenRegistry=i.VpTokenRegistry;exports.batchPollByProvider=i.batchPollByProvider;exports.createAuthenticatedVpClient=i.createAuthenticatedVpClient;exports.primeVpTokenRegistry=i.primeVpTokenRegistry;exports.resolveProtocolAddresses=i.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=i.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=i.verifyServerIdentity;exports.vpTokenRegistry=i.vpTokenRegistry;exports.AUTH_EXPIRED_DATA_KIND=s.AUTH_EXPIRED_DATA_KIND;exports.DaemonStatus=s.DaemonStatus;exports.JSON_RPC_ERROR_CODES=s.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=s.JsonRpcClient;exports.JsonRpcError=s.JsonRpcError;exports.POST_WOTS_STATUSES=s.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=s.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=s.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=s.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=s.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=s.VP_TRANSIENT_STATUSES;exports.isWotsMismatchError=g.isWotsMismatchError;exports.parseFundingOutpointsFromTx=g.parseFundingOutpointsFromTx;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.REFUND_MAX_FEE_FRACTION_DENOMINATOR=e.REFUND_MAX_FEE_FRACTION_DENOMINATOR;exports.REFUND_MAX_FEE_FRACTION_NUMERATOR=e.REFUND_MAX_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_RATE_SATS_VB=e.REFUND_MAX_FEE_RATE_SATS_VB;exports.REFUND_VSIZE=e.REFUND_VSIZE;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.activateVault=e.activateVault;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.runDepositorPresignFlow=e.runDepositorPresignFlow;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.validateDepositAmount=e.validateDepositAmount;exports.validateMultiVaultDepositInputs=e.validateMultiVaultDepositInputs;exports.validateOnChainParticipantKeys=e.validateOnChainParticipantKeys;exports.validateProviderSelection=e.validateProviderSelection;exports.validateRemainingCapacity=e.validateRemainingCapacity;exports.validateVaultAmounts=e.validateVaultAmounts;exports.validateVaultProviderPubkey=e.validateVaultProviderPubkey;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=T.ContractStatus;exports.PeginAction=T.PeginAction;exports.canPerformAction=T.canPerformAction;exports.getPeginProtocolState=T.getPeginProtocolState;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../challengeAssert-Culc7DoS.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),n=require("../../verifyScriptPathSchnorrSignature-D43cncKJ.cjs"),S=require("../../peginInput-DH6X4ITS.cjs"),A=require("../../noPayout-CJ_Acpl_.cjs"),r=require("../../bitcoin-CHfKAhcI.cjs"),R=require("../../signing-Bnsro0hE.cjs"),c=require("../../validation-u8W7Lp2x.cjs"),u=require("../../PeginManager-CHZieoEQ.cjs"),p=require("../../PayoutManager-DD1audlx.cjs"),_=require("../../ApplicationRegistry.abi-BAPhJch3.cjs"),m=require("../../BTCVaultRegistry.abi-JdeqLz4x.cjs"),P=require("../../errors-CGcNP0rV.cjs"),o=require("../../waitForTransactionReceiptSmartAware-U706oKTc.cjs"),t=require("../../fundPeginTransaction-DuMwnytD.cjs"),d=require("../../reservation-xTL2a9Q-.cjs"),a=require("../../mempoolApi-C_9JhjCI.cjs"),i=require("../../primeVpAuth-Br6RwE3r.cjs"),s=require("../../types-WA0LrDk1.cjs"),g=require("../../errors-Bu0H-dZD.cjs"),e=require("../../buildAndBroadcastRefund-Bi07LxuY.cjs"),T=require("../../peginState-BijNNT15.cjs");exports.buildChallengeAssertPsbt=E.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=E.buildDepositorPayoutPsbt;exports.computeNumLocalChallengers=E.computeNumLocalChallengers;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>l.computeMinClaimValue});Object.defineProperty(exports,"computeMinPeginFee",{enumerable:!0,get:()=>l.computeMinPeginFee});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>l.deriveVaultId});Object.defineProperty(exports,"expandAuthAnchor",{enumerable:!0,get:()=>l.expandAuthAnchor});Object.defineProperty(exports,"expandHashlockSecret",{enumerable:!0,get:()=>l.expandHashlockSecret});Object.defineProperty(exports,"expandWotsSeed",{enumerable:!0,get:()=>l.expandWotsSeed});exports.PsbtSubstitutionError=n.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=n.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=n.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=n.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=n.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=n.buildPrePeginPsbt;exports.createPayoutScript=n.createPayoutScript;exports.extractPayoutSignature=n.extractPayoutSignature;exports.buildPeginInputPsbt=S.buildPeginInputPsbt;exports.extractPeginInputSignature=S.extractPeginInputSignature;exports.finalizePeginInputPsbt=S.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=A.buildNoPayoutPsbt;exports.buildRefundPsbt=A.buildRefundPsbt;exports.deriveBip86ScriptPubKeyHex=r.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=r.deriveNativeSegwitAddress;exports.deriveTaprootAddress=r.deriveTaprootAddress;exports.ensureHexPrefix=r.ensureHexPrefix;exports.formatSatoshisToBtc=r.formatSatoshisToBtc;exports.getNetwork=r.getNetwork;exports.getSortedXOnlyPubkeys=r.getSortedXOnlyPubkeys;exports.hexToUint8Array=r.hexToUint8Array;exports.isAddressFromPublicKey=r.isAddressFromPublicKey;exports.isValidHex=r.isValidHex;exports.processPublicKeyToXOnly=r.processPublicKeyToXOnly;exports.stripHexPrefix=r.stripHexPrefix;exports.toXOnly=r.toXOnly;exports.uint8ArrayToHex=r.uint8ArrayToHex;exports.validateWalletPubkey=r.validateWalletPubkey;exports.createTaprootScriptPathSignOptions=R.createTaprootScriptPathSignOptions;exports.BITCOIN_ADDRESS_RE=c.BITCOIN_ADDRESS_RE;exports.HEX_RE=c.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=c.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=c.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=c.TXID_RE;exports.PeginManager=u.PeginManager;exports.VAULT_APP_NAME=u.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=u.buildFundingOutpointsCommitment;exports.buildVaultContext=u.buildVaultContext;exports.computeWotsBlockPublicKeysHash=u.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=u.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=u.deriveWotsBlocksFromSeed;exports.estimateSubmitPeginRequestBatchGas=u.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=p.PayoutManager;exports.computeHashlock=p.computeHashlock;exports.validateSecretAgainstHashlock=p.validateSecretAgainstHashlock;exports.ApplicationRegistryABI=_.ApplicationRegistryABI;exports.ProtocolParamsABI=_.ProtocolParamsABI;exports.BTCVaultRegistryABI=m.BTCVaultRegistryABI;exports.CONTRACT_ERRORS=P.CONTRACT_ERRORS;exports.extractErrorData=P.extractErrorData;exports.getContractErrorMessage=P.getContractErrorMessage;exports.handleContractError=P.handleContractError;exports.isKnownContractError=P.isKnownContractError;exports.BitcoinScriptType=o.BitcoinScriptType;exports.applyChangeOutputPolicy=o.applyChangeOutputPolicy;exports.calculateBtcTxHash=o.calculateBtcTxHash;exports.computeChangeOutputFeeSats=o.computeChangeOutputFeeSats;exports.computeMaxDeposit=o.computeMaxDeposit;exports.computePeginBaseFeeSats=o.computePeginBaseFeeSats;exports.getDustThreshold=o.getDustThreshold;exports.getPsbtInputFields=o.getPsbtInputFields;exports.getScriptType=o.getScriptType;exports.selectUtxosForPegin=o.selectUtxosForPegin;exports.shouldAddChangeOutput=o.shouldAddChangeOutput;exports.waitForTransactionReceiptSmartAware=o.waitForTransactionReceiptSmartAware;exports.BTC_DUST_SAT=t.BTC_DUST_SAT;exports.DUST_THRESHOLD=t.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=t.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=t.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=t.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=t.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=t.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=t.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=t.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=t.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=t.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=t.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=t.fundPeginTransaction;exports.parseUnfundedWasmTransaction=t.parseUnfundedWasmTransaction;exports.peginOutputCount=t.peginOutputCount;exports.rateBasedTxBufferFee=t.rateBasedTxBufferFee;exports.UtxoNotAvailableError=d.UtxoNotAvailableError;exports.assertUtxosAvailable=d.assertUtxosAvailable;exports.extractInputsFromTransaction=d.extractInputsFromTransaction;exports.findOverlappingPendingVaults=d.findOverlappingPendingVaults;exports.validateUtxosAvailable=d.validateUtxosAvailable;exports.MEMPOOL_API_URLS=a.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=a.ViemVaultRegistryReader;exports.getAddressTxs=a.getAddressTxs;exports.getAddressUtxos=a.getAddressUtxos;exports.getMempoolApiUrl=a.getMempoolApiUrl;exports.getNetworkFees=a.getNetworkFees;exports.getTipHeight=a.getTipHeight;exports.getTxHex=a.getTxHex;exports.getTxInfo=a.getTxInfo;exports.getUtxoInfo=a.getUtxoInfo;exports.pushTx=a.pushTx;exports.validateOffchainParams=a.validateOffchainParams;exports.validatePegInConfiguration=a.validatePegInConfiguration;exports.validateTBVProtocolParams=a.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=i.OnChainBtcVaultStatus;exports.ServerIdentityError=i.ServerIdentityError;exports.VaultProviderRpcClient=i.VaultProviderRpcClient;exports.ViemProtocolParamsReader=i.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=i.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=i.ViemVaultKeeperReader;exports.VpResponseValidationError=i.VpResponseValidationError;exports.VpTokenRegistry=i.VpTokenRegistry;exports.batchPollByProvider=i.batchPollByProvider;exports.createAuthenticatedVpClient=i.createAuthenticatedVpClient;exports.primeVpTokenRegistry=i.primeVpTokenRegistry;exports.resolveProtocolAddresses=i.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=i.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=i.verifyServerIdentity;exports.vpTokenRegistry=i.vpTokenRegistry;exports.AUTH_EXPIRED_DATA_KIND=s.AUTH_EXPIRED_DATA_KIND;exports.DaemonStatus=s.DaemonStatus;exports.JSON_RPC_ERROR_CODES=s.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=s.JsonRpcClient;exports.JsonRpcError=s.JsonRpcError;exports.POST_WOTS_STATUSES=s.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=s.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=s.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=s.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=s.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=s.VP_TRANSIENT_STATUSES;exports.isWotsMismatchError=g.isWotsMismatchError;exports.parseFundingOutpointsFromTx=g.parseFundingOutpointsFromTx;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.REFUND_MAX_FEE_FRACTION_DENOMINATOR=e.REFUND_MAX_FEE_FRACTION_DENOMINATOR;exports.REFUND_MAX_FEE_FRACTION_NUMERATOR=e.REFUND_MAX_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_RATE_SATS_VB=e.REFUND_MAX_FEE_RATE_SATS_VB;exports.REFUND_VSIZE=e.REFUND_VSIZE;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.activateVault=e.activateVault;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.runDepositorPresignFlow=e.runDepositorPresignFlow;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.validateDepositAmount=e.validateDepositAmount;exports.validateMultiVaultDepositInputs=e.validateMultiVaultDepositInputs;exports.validateOnChainParticipantKeys=e.validateOnChainParticipantKeys;exports.validateProviderSelection=e.validateProviderSelection;exports.validateRemainingCapacity=e.validateRemainingCapacity;exports.validateVaultAmounts=e.validateVaultAmounts;exports.validateVaultProviderPubkey=e.validateVaultProviderPubkey;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=T.ContractStatus;exports.PeginAction=T.PeginAction;exports.canPerformAction=T.canPerformAction;exports.getPeginProtocolState=T.getPeginProtocolState;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/tbv/core/index.js
CHANGED
|
@@ -1,191 +1,192 @@
|
|
|
1
|
-
import { a as s, b as t, c as r } from "../../challengeAssert-
|
|
2
|
-
import { computeMinClaimValue as i, computeMinPeginFee as n, deriveVaultId as u, expandAuthAnchor as l, expandHashlockSecret as p, expandWotsSeed as
|
|
3
|
-
import { P as c, d as T,
|
|
4
|
-
import { b as
|
|
5
|
-
import { a as
|
|
6
|
-
import { d as
|
|
7
|
-
import { c as
|
|
8
|
-
import { B as
|
|
9
|
-
import { P as
|
|
10
|
-
import { P as
|
|
11
|
-
import { A as da, P as
|
|
12
|
-
import { B as
|
|
13
|
-
import { C as Aa, e as
|
|
14
|
-
import { B as
|
|
15
|
-
import { B as
|
|
16
|
-
import { U as
|
|
17
|
-
import { M as
|
|
18
|
-
import { O as Re, S as
|
|
19
|
-
import { A as
|
|
20
|
-
import { i as
|
|
21
|
-
import { B as
|
|
22
|
-
import { C as
|
|
1
|
+
import { a as s, b as t, c as r } from "../../challengeAssert-ChvLypwc.js";
|
|
2
|
+
import { computeMinClaimValue as i, computeMinPeginFee as n, deriveVaultId as u, expandAuthAnchor as l, expandHashlockSecret as p, expandWotsSeed as P } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
|
+
import { P as c, d as T, f as E, c as S, b as A, a as _, g, e as R } from "../../verifyScriptPathSchnorrSignature-DFJAEleY.js";
|
|
4
|
+
import { b as x, e as f, f as b } from "../../peginInput-BPRB9tUi.js";
|
|
5
|
+
import { a as O, b as V } from "../../noPayout-CA4-x5vZ.js";
|
|
6
|
+
import { d as C, a as F, b as h, e as U, f as N, j as y, g as B, h as D, i as M, c as H, p as L, s as X, t as k, u as W, v as K } from "../../bitcoin-B5aNKtsk.js";
|
|
7
|
+
import { c as G } from "../../signing-DaLvGwQe.js";
|
|
8
|
+
import { B as Z, H as J, K as j, M as q, T as z } from "../../validation-CxqROCno.js";
|
|
9
|
+
import { P as $, V as aa, b as ea, a as sa, c as ta, f as ra, d as oa, e as ia } from "../../PeginManager-6seoi9mV.js";
|
|
10
|
+
import { P as ua, c as la, v as pa } from "../../PayoutManager-D02AePm4.js";
|
|
11
|
+
import { A as da, P as ca } from "../../ApplicationRegistry.abi-Dn2qk6JG.js";
|
|
12
|
+
import { B as Ea } from "../../BTCVaultRegistry.abi-Chs4AFBj.js";
|
|
13
|
+
import { C as Aa, e as _a, g as ga, h as Ra, i as ma } from "../../errors-Blc-JWnI.js";
|
|
14
|
+
import { B as fa, a as ba, f as Ia, c as Oa, b as Va, d as va, g as Ca, i as Fa, h as ha, s as Ua, e as Na, w as ya } from "../../waitForTransactionReceiptSmartAware-Ckg_oZAo.js";
|
|
15
|
+
import { B as Da, D as Ma, F as Ha, L as La, M as Xa, c as ka, P as Wa, b as Ka, a as wa, S as Ga, T as Ya, W as Za, f as Ja, d as ja, p as qa, r as za } from "../../fundPeginTransaction-96FxwYYJ.js";
|
|
16
|
+
import { U as $a, a as ae, e as ee, f as se, v as te } from "../../reservation-BxvKbQH2.js";
|
|
17
|
+
import { M as oe, V as ie, g as ne, a as ue, b as le, c as pe, d as Pe, e as de, f as ce, h as Te, p as Ee, v as Se, i as Ae, j as _e } from "../../mempoolApi-BxT89SAq.js";
|
|
18
|
+
import { O as Re, S as me, V as xe, g as fe, h as be, i as Ie, a as Oe, d as Ve, b as ve, f as Ce, p as Fe, r as he, v as Ue, c as Ne, e as ye } from "../../primeVpAuth-rbejoBPu.js";
|
|
19
|
+
import { A as De, D as Me, b as He, J as Le, a as Xe, d as ke, P as We, R as Ke, e as we, c as Ge, V as Ye } from "../../types-CQDRQvV-.js";
|
|
20
|
+
import { i as Je, p as je } from "../../errors-9AkghWyk.js";
|
|
21
|
+
import { B as ze, C as Qe, p as $e, q as as, t as es, u as ss, R as ts, a as rs, n as os, o as is, i as ns, m as us, l as ls, j as ps, r as Ps, b as ds, s as cs, v as Ts, g as Es, h as Ss, d as As, c as _s, e as gs, f as Rs, k as ms, w as xs } from "../../buildAndBroadcastRefund-DXHs6unL.js";
|
|
22
|
+
import { C as bs, P as Is, c as Os, g as Vs } from "../../peginState-CBAlxgXk.js";
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
De as AUTH_EXPIRED_DATA_KIND,
|
|
25
25
|
da as ApplicationRegistryABI,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
ze as BIP68NotMatureError,
|
|
27
|
+
Z as BITCOIN_ADDRESS_RE,
|
|
28
|
+
Ea as BTCVaultRegistryABI,
|
|
29
|
+
Da as BTC_DUST_SAT,
|
|
30
|
+
fa as BitcoinScriptType,
|
|
31
31
|
Aa as CONTRACT_ERRORS,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
Qe as ClaimerPegoutStatusValue,
|
|
33
|
+
bs as ContractStatus,
|
|
34
|
+
Ma as DUST_THRESHOLD,
|
|
35
|
+
Me as DaemonStatus,
|
|
36
|
+
Ha as FEE_SAFETY_MARGIN,
|
|
37
|
+
J as HEX_RE,
|
|
38
|
+
He as JSON_RPC_ERROR_CODES,
|
|
39
|
+
Le as JsonRpcClient,
|
|
40
|
+
Xe as JsonRpcError,
|
|
41
|
+
j as KNOWN_SCRIPT_PREFIXES,
|
|
42
|
+
La as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
43
|
+
Xa as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
44
|
+
q as MAX_REASONABLE_FEE_SATS,
|
|
45
|
+
ka as MAX_REASONABLE_PEGIN_VBYTES,
|
|
46
|
+
oe as MEMPOOL_API_URLS,
|
|
47
47
|
Re as OnChainBtcVaultStatus,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
Wa as P2TR_INPUT_SIZE,
|
|
49
|
+
Ka as PEGIN_AUTH_ANCHOR_OUTPUTS,
|
|
50
|
+
wa as PEGIN_FIXED_OUTPUTS,
|
|
51
|
+
ke as POST_WOTS_STATUSES,
|
|
52
|
+
We as PRE_DEPOSITOR_SIGNATURES_STATES,
|
|
53
|
+
ua as PayoutManager,
|
|
54
|
+
Is as PeginAction,
|
|
55
|
+
$ as PeginManager,
|
|
56
|
+
ca as ProtocolParamsABI,
|
|
57
57
|
c as PsbtSubstitutionError,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
58
|
+
$e as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
|
|
59
|
+
as as REFUND_MAX_FEE_FRACTION_NUMERATOR,
|
|
60
|
+
es as REFUND_MAX_FEE_RATE_SATS_VB,
|
|
61
|
+
ss as REFUND_VSIZE,
|
|
62
|
+
ts as RegisteredVaultVersionMismatchError,
|
|
63
|
+
Ke as RpcErrorCode,
|
|
64
|
+
Ga as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
65
|
+
me as ServerIdentityError,
|
|
66
|
+
z as TXID_RE,
|
|
67
|
+
Ya as TX_BUFFER_SIZE_OVERHEAD,
|
|
68
|
+
$a as UtxoNotAvailableError,
|
|
69
|
+
aa as VAULT_APP_NAME,
|
|
70
|
+
we as VP_BATCH_MAX_SIZE,
|
|
71
|
+
Ge as VP_TERMINAL_FAILURE_STATUSES,
|
|
72
|
+
Ye as VP_TRANSIENT_STATUSES,
|
|
73
|
+
xe as VaultProviderRpcClient,
|
|
74
|
+
fe as ViemProtocolParamsReader,
|
|
75
|
+
be as ViemUniversalChallengerReader,
|
|
76
|
+
Ie as ViemVaultKeeperReader,
|
|
77
|
+
ie as ViemVaultRegistryReader,
|
|
78
|
+
Oe as VpResponseValidationError,
|
|
79
|
+
Ve as VpTokenRegistry,
|
|
80
|
+
Za as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
81
|
+
rs as activateVault,
|
|
82
|
+
ba as applyChangeOutputPolicy,
|
|
83
83
|
T as assertPsbtUnsignedTxMatches,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
E as assertScriptPathSchnorrSignature,
|
|
85
|
+
ae as assertUtxosAvailable,
|
|
86
|
+
ve as batchPollByProvider,
|
|
87
|
+
os as buildAndBroadcastRefund,
|
|
87
88
|
s as buildChallengeAssertPsbt,
|
|
88
89
|
t as buildDepositorPayoutPsbt,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
ea as buildFundingOutpointsCommitment,
|
|
91
|
+
O as buildNoPayoutPsbt,
|
|
92
|
+
S as buildPayoutPsbt,
|
|
93
|
+
x as buildPeginInputPsbt,
|
|
93
94
|
A as buildPeginTxFromFundedPrePegin,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
_ as buildPrePeginPsbt,
|
|
96
|
+
V as buildRefundPsbt,
|
|
97
|
+
sa as buildVaultContext,
|
|
98
|
+
Ia as calculateBtcTxHash,
|
|
99
|
+
Os as canPerformAction,
|
|
100
|
+
Oa as computeChangeOutputFeeSats,
|
|
101
|
+
la as computeHashlock,
|
|
102
|
+
Va as computeMaxDeposit,
|
|
102
103
|
i as computeMinClaimValue,
|
|
103
104
|
n as computeMinPeginFee,
|
|
104
105
|
r as computeNumLocalChallengers,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
106
|
+
va as computePeginBaseFeeSats,
|
|
107
|
+
ta as computeWotsBlockPublicKeysHash,
|
|
108
|
+
Ce as createAuthenticatedVpClient,
|
|
109
|
+
g as createPayoutScript,
|
|
110
|
+
G as createTaprootScriptPathSignOptions,
|
|
111
|
+
C as deriveBip86ScriptPubKeyHex,
|
|
112
|
+
F as deriveNativeSegwitAddress,
|
|
113
|
+
h as deriveTaprootAddress,
|
|
113
114
|
u as deriveVaultId,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
ra as deriveVaultRoot,
|
|
116
|
+
oa as deriveWotsBlocksFromSeed,
|
|
117
|
+
U as ensureHexPrefix,
|
|
118
|
+
is as estimateRefundFeeSats,
|
|
119
|
+
ia as estimateSubmitPeginRequestBatchGas,
|
|
119
120
|
l as expandAuthAnchor,
|
|
120
121
|
p as expandHashlockSecret,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
P as expandWotsSeed,
|
|
123
|
+
_a as extractErrorData,
|
|
124
|
+
ee as extractInputsFromTransaction,
|
|
124
125
|
R as extractPayoutSignature,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
126
|
+
f as extractPeginInputSignature,
|
|
127
|
+
b as finalizePeginInputPsbt,
|
|
128
|
+
se as findOverlappingPendingVaults,
|
|
129
|
+
N as formatSatoshisToBtc,
|
|
130
|
+
Ja as fundPeginTransaction,
|
|
131
|
+
ne as getAddressTxs,
|
|
132
|
+
ue as getAddressUtxos,
|
|
133
|
+
ga as getContractErrorMessage,
|
|
134
|
+
Ca as getDustThreshold,
|
|
135
|
+
le as getMempoolApiUrl,
|
|
136
|
+
y as getNetwork,
|
|
137
|
+
pe as getNetworkFees,
|
|
138
|
+
Vs as getPeginProtocolState,
|
|
139
|
+
Fa as getPsbtInputFields,
|
|
140
|
+
ha as getScriptType,
|
|
141
|
+
B as getSortedXOnlyPubkeys,
|
|
142
|
+
Pe as getTipHeight,
|
|
142
143
|
de as getTxHex,
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
ce as getTxInfo,
|
|
145
|
+
Te as getUtxoInfo,
|
|
145
146
|
Ra as handleContractError,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
147
|
+
D as hexToUint8Array,
|
|
148
|
+
M as isAddressFromPublicKey,
|
|
149
|
+
ns as isDepositAmountValid,
|
|
150
|
+
ma as isKnownContractError,
|
|
151
|
+
us as isPegoutTerminalStatus,
|
|
152
|
+
ls as isRecognizedPegoutStatus,
|
|
153
|
+
ps as isRegisteredVaultVersionMismatchError,
|
|
154
|
+
H as isValidHex,
|
|
155
|
+
Je as isWotsMismatchError,
|
|
156
|
+
je as parseFundingOutpointsFromTx,
|
|
157
|
+
ja as parseUnfundedWasmTransaction,
|
|
158
|
+
qa as peginOutputCount,
|
|
159
|
+
Fe as primeVpTokenRegistry,
|
|
160
|
+
L as processPublicKeyToXOnly,
|
|
161
|
+
Ee as pushTx,
|
|
162
|
+
za as rateBasedTxBufferFee,
|
|
163
|
+
he as resolveProtocolAddresses,
|
|
164
|
+
Ps as runDepositorPresignFlow,
|
|
165
|
+
Ua as selectUtxosForPegin,
|
|
166
|
+
Na as shouldAddChangeOutput,
|
|
166
167
|
ds as signDepositorGraph,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
168
|
+
X as stripHexPrefix,
|
|
169
|
+
cs as submitWotsPublicKey,
|
|
170
|
+
k as toXOnly,
|
|
171
|
+
W as uint8ArrayToHex,
|
|
172
|
+
Ts as validateDepositAmount,
|
|
173
|
+
Es as validateMultiVaultDepositInputs,
|
|
174
|
+
Se as validateOffchainParams,
|
|
175
|
+
Ss as validateOnChainParticipantKeys,
|
|
175
176
|
Ae as validatePegInConfiguration,
|
|
176
177
|
As as validateProviderSelection,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
_s as validateRemainingCapacity,
|
|
179
|
+
Ue as validateRequestDepositorClaimerArtifactsResponse,
|
|
180
|
+
pa as validateSecretAgainstHashlock,
|
|
181
|
+
_e as validateTBVProtocolParams,
|
|
182
|
+
te as validateUtxosAvailable,
|
|
183
|
+
gs as validateVaultAmounts,
|
|
183
184
|
Rs as validateVaultProviderPubkey,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
185
|
+
K as validateWalletPubkey,
|
|
186
|
+
ms as verifyRegisteredVaultVersions,
|
|
187
|
+
Ne as verifyServerIdentity,
|
|
188
|
+
ye as vpTokenRegistry,
|
|
189
|
+
xs as waitForPeginStatus,
|
|
190
|
+
ya as waitForTransactionReceiptSmartAware
|
|
190
191
|
};
|
|
191
192
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayoutManager.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/PayoutManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"PayoutManager.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/PayoutManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAmB,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAML,KAAK,OAAO,EACb,MAAM,eAAe,CAAC;AAMvB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED;;GAEG;AACH,UAAU,oBAAoB;IAC5B;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAEhC;;OAEG;IACH,6BAA6B,EAAE,MAAM,EAAE,CAAC;IAExC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;;;OAQG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;IACH,4BAA4B,EAAE,MAAM,CAAC;IAErC;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC5D;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAE7C;;;;OAIG;gBACS,MAAM,EAAE,mBAAmB;IAIvC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,qBAAqB,CACzB,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,qBAAqB,CAAC;IAsDjC;;;;OAIG;IACH,UAAU,IAAI,OAAO;IAIrB;;;;OAIG;IACH,oBAAoB,IAAI,OAAO;IAI/B;;;;;;;;OAQG;IACG,2BAA2B,CAAC,YAAY,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAC1E,KAAK,CAAC;QACJ,eAAe,EAAE,MAAM,CAAC;QACxB,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAAC,CACH;CAuFF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeginManager.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/PeginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"PeginManager.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/PeginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AASd,OAAO,KAAK,EACV,aAAa,EACb,IAAI,EAEL,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,OAAO,EASL,KAAK,OAAO,EAEb,MAAM,eAAe,CAAC;AASvB,OAAO,EASL,KAAK,IAAI,EACV,MAAM,UAAU,CAAC;AA6ClB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH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IACH,uBAAuB,IAAI,OAAO;CAGnC;AAmED,MAAM,WAAW,wCAAwC;IACvD,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,kCAAkC,CACtD,MAAM,EAAE,wCAAwC,GAC/C,OAAO,CAAC,MAAM,CAAC,CA4CjB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../PeginManager-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../PeginManager-CHZieoEQ.cjs"),a=require("../../../PayoutManager-DD1audlx.cjs");exports.PeginManager=e.PeginManager;exports.estimateSubmitPeginRequestBatchGas=e.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=a.PayoutManager;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as t, e as r } from "../../../PeginManager-
|
|
2
|
-
import { P as o } from "../../../PayoutManager-
|
|
1
|
+
import { P as t, e as r } from "../../../PeginManager-6seoi9mV.js";
|
|
2
|
+
import { P as o } from "../../../PayoutManager-D02AePm4.js";
|
|
3
3
|
export {
|
|
4
4
|
o as PayoutManager,
|
|
5
5
|
t as PeginManager,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../challengeAssert-Culc7DoS.cjs"),i=require("@babylonlabs-io/babylon-tbv-rust-wasm"),t=require("../../../verifyScriptPathSchnorrSignature-D43cncKJ.cjs"),u=require("../../../peginInput-DH6X4ITS.cjs"),s=require("../../../noPayout-CJ_Acpl_.cjs"),e=require("../../../bitcoin-CHfKAhcI.cjs");exports.buildChallengeAssertPsbt=r.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=r.buildDepositorPayoutPsbt;exports.computeNumLocalChallengers=r.computeNumLocalChallengers;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>i.computeMinClaimValue});Object.defineProperty(exports,"computeMinPeginFee",{enumerable:!0,get:()=>i.computeMinPeginFee});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>i.deriveVaultId});exports.PsbtSubstitutionError=t.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=t.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=t.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=t.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=t.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=t.buildPrePeginPsbt;exports.createPayoutScript=t.createPayoutScript;exports.extractPayoutSignature=t.extractPayoutSignature;exports.buildPeginInputPsbt=u.buildPeginInputPsbt;exports.extractPeginInputSignature=u.extractPeginInputSignature;exports.finalizePeginInputPsbt=u.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=s.buildNoPayoutPsbt;exports.buildRefundPsbt=s.buildRefundPsbt;exports.deriveBip86ScriptPubKeyHex=e.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=e.deriveNativeSegwitAddress;exports.deriveTaprootAddress=e.deriveTaprootAddress;exports.ensureHexPrefix=e.ensureHexPrefix;exports.formatSatoshisToBtc=e.formatSatoshisToBtc;exports.getSortedXOnlyPubkeys=e.getSortedXOnlyPubkeys;exports.hexToUint8Array=e.hexToUint8Array;exports.isAddressFromPublicKey=e.isAddressFromPublicKey;exports.isValidHex=e.isValidHex;exports.processPublicKeyToXOnly=e.processPublicKeyToXOnly;exports.stripHexPrefix=e.stripHexPrefix;exports.toXOnly=e.toXOnly;exports.uint8ArrayToHex=e.uint8ArrayToHex;exports.validateWalletPubkey=e.validateWalletPubkey;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
* @module primitives
|
|
75
75
|
*/
|
|
76
76
|
export { computeNumLocalChallengers } from './challengers';
|
|
77
|
-
export type { Network } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
78
77
|
export { computeMinClaimValue, computeMinPeginFee, deriveVaultId, } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
78
|
+
export type { AssertPayoutNoPayoutConnectorParams, ChallengeAssertConnectorParams, Network, PayoutConnectorParams, } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
79
79
|
/**
|
|
80
80
|
* 0x-prefixed bytes32, keccak256(abi.encode(peginTxHash, depositor)).
|
|
81
81
|
* On-chain vault identifier used by BTCVaultRegistry contract.
|
|
@@ -84,17 +84,18 @@ export { computeMinClaimValue, computeMinPeginFee, deriveVaultId, } from '@babyl
|
|
|
84
84
|
* Derive with `deriveVaultId(peginTxHash, depositorAddress)`.
|
|
85
85
|
*/
|
|
86
86
|
export type VaultId = `0x${string}`;
|
|
87
|
-
export
|
|
88
|
-
export {
|
|
89
|
-
export
|
|
90
|
-
export { buildPeginInputPsbt, extractPeginInputSignature, finalizePeginInputPsbt } from './psbt/peginInput';
|
|
87
|
+
export { buildPeginTxFromFundedPrePegin, buildPrePeginPsbt, } from './psbt/pegin';
|
|
88
|
+
export type { BuildPeginTxParams, PeginTxResult, PrePeginParams, PrePeginPsbtResult, } from './psbt/pegin';
|
|
89
|
+
export { buildPeginInputPsbt, extractPeginInputSignature, finalizePeginInputPsbt, } from './psbt/peginInput';
|
|
91
90
|
export type { BuildPeginInputPsbtParams, BuildPeginInputPsbtResult, } from './psbt/peginInput';
|
|
92
91
|
export { buildRefundPsbt } from './psbt/refund';
|
|
93
92
|
export type { BuildRefundPsbtParams, BuildRefundPsbtResult, } from './psbt/refund';
|
|
94
93
|
export { buildPayoutPsbt, extractPayoutSignature } from './psbt/payout';
|
|
95
94
|
export type { PayoutParams, PayoutPsbtResult } from './psbt/payout';
|
|
96
|
-
export {
|
|
95
|
+
export { PsbtSubstitutionError, assertPsbtUnsignedTxMatches, } from './psbt/assertPsbtUnsignedTxMatches';
|
|
97
96
|
export type { AssertPsbtUnsignedTxMatchesParams } from './psbt/assertPsbtUnsignedTxMatches';
|
|
97
|
+
export { assertScriptPathSchnorrSignature } from './psbt/verifyScriptPathSchnorrSignature';
|
|
98
|
+
export type { VerifyScriptPathSchnorrSignatureParams } from './psbt/verifyScriptPathSchnorrSignature';
|
|
98
99
|
export { buildDepositorPayoutPsbt } from './psbt/depositorPayout';
|
|
99
100
|
export type { DepositorPayoutParams } from './psbt/depositorPayout';
|
|
100
101
|
export { buildNoPayoutPsbt } from './psbt/noPayout';
|
|
@@ -103,5 +104,5 @@ export { buildChallengeAssertPsbt } from './psbt/challengeAssert';
|
|
|
103
104
|
export type { ChallengeAssertParams } from './psbt/challengeAssert';
|
|
104
105
|
export { createPayoutScript } from './scripts/payout';
|
|
105
106
|
export type { PayoutScriptParams, PayoutScriptResult } from './scripts/payout';
|
|
106
|
-
export { deriveBip86ScriptPubKeyHex, deriveNativeSegwitAddress, deriveTaprootAddress, getSortedXOnlyPubkeys, hexToUint8Array, isAddressFromPublicKey, isValidHex,
|
|
107
|
+
export { deriveBip86ScriptPubKeyHex, deriveNativeSegwitAddress, deriveTaprootAddress, ensureHexPrefix, formatSatoshisToBtc, getSortedXOnlyPubkeys, hexToUint8Array, isAddressFromPublicKey, isValidHex, processPublicKeyToXOnly, stripHexPrefix, toXOnly, uint8ArrayToHex, validateWalletPubkey, type WalletPubkeyValidationResult, } from './utils/bitcoin';
|
|
107
108
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/primitives/index.ts"],"names":[],"mappings":"AAAA;;;;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