@babylonlabs-io/ts-sdk 0.50.1 → 0.51.1
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/index.cjs +1 -1
- package/dist/index.js +13 -12
- package/dist/{peginState-CBAlxgXk.js → peginState-BB81JI6I.js} +17 -12
- package/dist/{peginState-CBAlxgXk.js.map → peginState-BB81JI6I.js.map} +1 -1
- package/dist/peginState-CBBJw4Za.cjs +2 -0
- package/dist/{peginState-BijNNT15.cjs.map → peginState-CBBJw4Za.cjs.map} +1 -1
- package/dist/{primeVpAuth-BTKhMdh1.js → primeVpAuth-DxMuWQCi.js} +180 -189
- package/dist/{primeVpAuth-BTKhMdh1.js.map → primeVpAuth-DxMuWQCi.js.map} +1 -1
- package/dist/{primeVpAuth-CXzKktIW.cjs → primeVpAuth-yTddDmGy.cjs} +2 -2
- package/dist/{primeVpAuth-CXzKktIW.cjs.map → primeVpAuth-yTddDmGy.cjs.map} +1 -1
- package/dist/{reservation-xTL2a9Q-.cjs → reservation-ClEs2X0H.cjs} +2 -2
- package/dist/{reservation-xTL2a9Q-.cjs.map → reservation-ClEs2X0H.cjs.map} +1 -1
- package/dist/{reservation-BxvKbQH2.js → reservation-cHDRn4DA.js} +2 -2
- package/dist/{reservation-BxvKbQH2.js.map → reservation-cHDRn4DA.js.map} +1 -1
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/createAuthenticatedVpClient.d.ts +0 -6
- package/dist/tbv/core/clients/vault-provider/auth/createAuthenticatedVpClient.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/primeVpAuth.d.ts +0 -8
- package/dist/tbv/core/clients/vault-provider/auth/primeVpAuth.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/tokenRegistry.d.ts +3 -14
- package/dist/tbv/core/clients/vault-provider/auth/tokenRegistry.d.ts.map +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +12 -11
- package/dist/tbv/core/services/deposit/index.d.ts +1 -1
- package/dist/tbv/core/services/deposit/index.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/peginState.d.ts +11 -0
- package/dist/tbv/core/services/deposit/peginState.d.ts.map +1 -1
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +18 -17
- package/dist/tbv/core/utils/index.cjs +1 -1
- package/dist/tbv/core/utils/index.js +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +12 -11
- package/package.json +1 -1
- package/dist/peginState-BijNNT15.cjs +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var b=Object.defineProperty;var T=(e,n,t)=>n in e?b(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var l=(e,n,t)=>T(e,typeof n!="symbol"?n+"":n,t);const d=require("bitcoinjs-lib"),x=require("buffer"),U=require("./bitcoin-CHfKAhcI.cjs"),$=require("./peginState-
|
|
2
|
-
//# sourceMappingURL=reservation-
|
|
1
|
+
"use strict";var b=Object.defineProperty;var T=(e,n,t)=>n in e?b(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var l=(e,n,t)=>T(e,typeof n!="symbol"?n+"":n,t);const d=require("bitcoinjs-lib"),x=require("buffer"),U=require("./bitcoin-CHfKAhcI.cjs"),$=require("./peginState-CBBJw4Za.cjs");class p extends Error{constructor(t){const r=t.length,a=r===1?"The UTXO for this peg-in is no longer available. It may have been spent in another transaction. Please create a new peg-in request with a different UTXO.":`${r} UTXOs for this peg-in are no longer available. They may have been spent. Please create a new peg-in request with different UTXOs.`;super(a);l(this,"missingUtxos");this.name="UtxoNotAvailableError",this.missingUtxos=t}}function h(e){const n=e.startsWith("0x")?e.slice(2):e;let t;try{t=d.Transaction.fromHex(n)}catch(r){throw new Error(`Failed to parse BTC transaction: ${r instanceof Error?r.message:String(r)}`)}return t.ins.map(r=>({txid:x.Buffer.from(r.hash).reverse().toString("hex"),vout:r.index}))}function v(e,n){const t=h(e);if(t.length===0)throw new Error("Transaction has no inputs");const r=new Set;for(const o of t){const i=`${o.txid.toLowerCase()}:${o.vout}`;if(r.has(i))throw new Error(`Transaction contains duplicate input ${o.txid}:${o.vout}. This would produce an invalid Bitcoin transaction.`);r.add(i)}const a=new Set(n.map(o=>`${o.txid.toLowerCase()}:${o.vout}`)),c=[];for(const o of t){const i=`${o.txid.toLowerCase()}:${o.vout}`;a.has(i)||c.push({txid:o.txid,vout:o.vout})}return{allAvailable:c.length===0,missingUtxos:c,totalInputs:t.length}}function S(e,n){const t=v(e,n);if(!t.allAvailable)throw new p(t.missingUtxos)}function y(e){try{return d.Transaction.fromHex(U.stripHexPrefix(e)).ins.map(t=>({txid:x.Buffer.from(t.hash).reverse().toString("hex"),vout:t.index}))}catch{return[]}}function f(e){return`${e.txid.toLowerCase()}:${e.vout}`}function A(e){const{selectedOutpoints:n,vaults:t=[],pendingPegins:r=[]}=e,a=new Set(n.map(f));if(a.size===0)return[];const c=new Set,o=new Set,i=(s,g)=>{if(!s)return;const u=s.toLowerCase();if(c.has(u))return;c.add(u);const w=y(g);for(const m of w)if(a.has(f(m))){o.add(s);return}};for(const s of t)s.status===$.ContractStatus.PENDING&&i(s.id,s.unsignedPrePeginTx);for(const s of r)s.unsignedTxHex&&i(s.id,s.unsignedTxHex);return Array.from(o)}exports.UtxoNotAvailableError=p;exports.assertUtxosAvailable=S;exports.extractInputsFromTransaction=h;exports.findOverlappingPendingVaults=A;exports.validateUtxosAvailable=v;
|
|
2
|
+
//# sourceMappingURL=reservation-ClEs2X0H.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reservation-xTL2a9Q-.cjs","sources":["../src/tbv/core/utils/utxo/availability.ts","../src/tbv/core/utils/utxo/reservation.ts"],"sourcesContent":["/**\n * UTXO Availability Validation\n *\n * Validates that UTXOs referenced in a pre-pegin transaction are still unspent\n * BEFORE asking the user to sign. This prevents wasted signing effort when\n * UTXOs have already been spent by unrelated transactions.\n *\n * These functions are pure — they accept pre-fetched UTXOs and perform no I/O.\n * The vault service wrapper is responsible for fetching UTXOs from the mempool.\n */\n\nimport { Transaction } from \"bitcoinjs-lib\";\nimport { Buffer } from \"buffer\";\n\n/**\n * Reference to a Bitcoin UTXO by its outpoint (txid + vout).\n *\n * Used by the availability check to compare a Pre-PegIn transaction's\n * declared inputs against the wallet's current spendable set. Txids are\n * compared case-insensitively; callers should treat the txid as opaque\n * lowercase hex.\n */\nexport interface UtxoRef {\n txid: string;\n vout: number;\n}\n\n/**\n * Information about a missing/spent UTXO.\n */\nexport interface MissingUtxoInfo {\n /** Transaction ID of the missing UTXO */\n txid: string;\n /** Output index of the missing UTXO */\n vout: number;\n}\n\n/**\n * Result of UTXO validation.\n */\nexport interface UtxoValidationResult {\n /** Whether all UTXOs are still available */\n allAvailable: boolean;\n /** List of missing UTXOs (if any) */\n missingUtxos: MissingUtxoInfo[];\n /** Total number of inputs checked */\n totalInputs: number;\n}\n\n/**\n * Error thrown when UTXOs are not available.\n */\nexport class UtxoNotAvailableError extends Error {\n public readonly missingUtxos: MissingUtxoInfo[];\n\n constructor(missingUtxos: MissingUtxoInfo[]) {\n const count = missingUtxos.length;\n const message =\n count === 1\n ? \"The UTXO for this peg-in is no longer available. It may have been spent in another transaction. Please create a new peg-in request with a different UTXO.\"\n : `${count} UTXOs for this peg-in are no longer available. They may have been spent. Please create a new peg-in request with different UTXOs.`;\n\n super(message);\n this.name = \"UtxoNotAvailableError\";\n this.missingUtxos = missingUtxos;\n }\n}\n\n/**\n * Extract input references (txid:vout) from an unsigned transaction.\n *\n * @param unsignedTxHex - Unsigned transaction hex\n * @returns Array of input references\n */\nexport function extractInputsFromTransaction(\n unsignedTxHex: string,\n): Array<{ txid: string; vout: number }> {\n const cleanHex = unsignedTxHex.startsWith(\"0x\")\n ? unsignedTxHex.slice(2)\n : unsignedTxHex;\n\n let tx: Transaction;\n try {\n tx = Transaction.fromHex(cleanHex);\n } catch (error) {\n throw new Error(\n `Failed to parse BTC transaction: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n\n return tx.ins.map((input) => ({\n // Bitcoin stores txid in reverse byte order\n txid: Buffer.from(input.hash).reverse().toString(\"hex\"),\n vout: input.index,\n }));\n}\n\n/**\n * Validate that all UTXOs in a transaction are still available.\n *\n * Pure function — accepts pre-fetched UTXOs instead of making network calls.\n * This should be called BEFORE signing to avoid wasting user effort\n * signing a transaction that will fail to broadcast.\n *\n * @param unsignedTxHex - Unsigned transaction hex\n * @param availableUtxos - Pre-fetched list of available UTXOs for the depositor\n * @returns Validation result with missing UTXO details\n */\nexport function validateUtxosAvailable(\n unsignedTxHex: string,\n availableUtxos: UtxoRef[],\n): UtxoValidationResult {\n const inputs = extractInputsFromTransaction(unsignedTxHex);\n\n if (inputs.length === 0) {\n throw new Error(\"Transaction has no inputs\");\n }\n\n // Detect duplicate inputs (same txid:vout referenced more than once).\n // This would produce an invalid Bitcoin transaction.\n const inputKeys = new Set<string>();\n for (const input of inputs) {\n const key = `${input.txid.toLowerCase()}:${input.vout}`;\n if (inputKeys.has(key)) {\n throw new Error(\n `Transaction contains duplicate input ${input.txid}:${input.vout}. ` +\n `This would produce an invalid Bitcoin transaction.`,\n );\n }\n inputKeys.add(key);\n }\n\n // Set of available outpoints for O(1) lookup. Lowercased so the comparison\n // is case-insensitive against whatever case the wallet returned.\n const availableSet = new Set(\n availableUtxos.map((utxo) => `${utxo.txid.toLowerCase()}:${utxo.vout}`),\n );\n\n // Check which inputs are missing\n const missingUtxos: MissingUtxoInfo[] = [];\n for (const input of inputs) {\n const key = `${input.txid.toLowerCase()}:${input.vout}`;\n if (!availableSet.has(key)) {\n missingUtxos.push({\n txid: input.txid,\n vout: input.vout,\n });\n }\n }\n\n return {\n allAvailable: missingUtxos.length === 0,\n missingUtxos,\n totalInputs: inputs.length,\n };\n}\n\n/**\n * Validate UTXOs and throw if any are not available.\n *\n * Pure convenience function that combines validation and error throwing.\n *\n * @param unsignedTxHex - Unsigned transaction hex\n * @param availableUtxos - Pre-fetched list of available UTXOs for the depositor\n * @throws UtxoNotAvailableError if any UTXOs are not available\n * @throws Error if validation fails\n */\nexport function assertUtxosAvailable(\n unsignedTxHex: string,\n availableUtxos: UtxoRef[],\n): void {\n const result = validateUtxosAvailable(unsignedTxHex, availableUtxos);\n\n if (!result.allAvailable) {\n throw new UtxoNotAvailableError(result.missingUtxos);\n }\n}\n","/**\n * Pending-vault outpoint overlap detection.\n *\n * Given the depositor's pending vaults (indexer + local cache) and the\n * outpoints a new deposit's coin selector picked, return the set of\n * pending vault ids whose Pre-PegIn BTC tx shares an input. Advisory\n * only — used to warn the user before signing.\n *\n * Only `PENDING` vaults contribute: VERIFIED+ have their Pre-PegIn\n * already confirmed on-chain, so those inputs cannot still appear in\n * the wallet's spendable set.\n */\nimport { Transaction } from \"bitcoinjs-lib\";\nimport { Buffer } from \"buffer\";\n\nimport { stripHexPrefix } from \"../../primitives/utils/bitcoin\";\nimport { ContractStatus } from \"../../services/deposit/peginState\";\n\nimport { type UtxoRef } from \"./availability\";\n\n/** Locally-known pending pegin. `id` is the bytes32 vault id. */\nexport interface PendingPeginLike {\n id?: string;\n unsignedTxHex?: string;\n}\n\n/** On-chain vault row from the indexer. */\nexport interface VaultLike {\n id?: string;\n status: number;\n unsignedPrePeginTx: string;\n}\n\nexport interface FindOverlappingPendingVaultsParams {\n selectedOutpoints: ReadonlyArray<UtxoRef>;\n vaults?: ReadonlyArray<VaultLike>;\n pendingPegins?: ReadonlyArray<PendingPeginLike>;\n}\n\nfunction extractInputUtxoRefs(txHex: string): UtxoRef[] {\n try {\n const tx = Transaction.fromHex(stripHexPrefix(txHex));\n return tx.ins.map((input) => ({\n txid: Buffer.from(input.hash).reverse().toString(\"hex\"),\n vout: input.index,\n }));\n } catch {\n return [];\n }\n}\n\nfunction outpointKey(o: UtxoRef): string {\n return `${o.txid.toLowerCase()}:${o.vout}`;\n}\n\n/**\n * Return the ids of pending vaults whose committed Pre-PegIn inputs\n * overlap any of the just-selected outpoints. On-chain `PENDING` vaults\n * take precedence over a same-id local pegin entry.\n */\nexport function findOverlappingPendingVaults(\n params: FindOverlappingPendingVaultsParams,\n): string[] {\n const { selectedOutpoints, vaults = [], pendingPegins = [] } = params;\n\n const selectedSet = new Set(selectedOutpoints.map(outpointKey));\n if (selectedSet.size === 0) return [];\n\n const seenIds = new Set<string>();\n const impacted = new Set<string>();\n\n const consider = (id: string | undefined, txHex: string): void => {\n if (!id) return;\n const idLower = id.toLowerCase();\n if (seenIds.has(idLower)) return;\n seenIds.add(idLower);\n const inputs = extractInputUtxoRefs(txHex);\n for (const input of inputs) {\n if (selectedSet.has(outpointKey(input))) {\n impacted.add(id);\n return;\n }\n }\n };\n\n // On-chain wins on id collision.\n for (const v of vaults) {\n if (v.status !== ContractStatus.PENDING) continue;\n consider(v.id, v.unsignedPrePeginTx);\n }\n for (const p of pendingPegins) {\n if (!p.unsignedTxHex) continue;\n consider(p.id, p.unsignedTxHex);\n }\n\n return Array.from(impacted);\n}\n"],"names":["UtxoNotAvailableError","missingUtxos","count","message","__publicField","extractInputsFromTransaction","unsignedTxHex","cleanHex","tx","Transaction","error","input","Buffer","validateUtxosAvailable","availableUtxos","inputs","inputKeys","key","availableSet","utxo","assertUtxosAvailable","result","extractInputUtxoRefs","txHex","stripHexPrefix","outpointKey","o","findOverlappingPendingVaults","params","selectedOutpoints","vaults","pendingPegins","selectedSet","seenIds","impacted","consider","id","idLower","v","ContractStatus","p"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"reservation-ClEs2X0H.cjs","sources":["../src/tbv/core/utils/utxo/availability.ts","../src/tbv/core/utils/utxo/reservation.ts"],"sourcesContent":["/**\n * UTXO Availability Validation\n *\n * Validates that UTXOs referenced in a pre-pegin transaction are still unspent\n * BEFORE asking the user to sign. This prevents wasted signing effort when\n * UTXOs have already been spent by unrelated transactions.\n *\n * These functions are pure — they accept pre-fetched UTXOs and perform no I/O.\n * The vault service wrapper is responsible for fetching UTXOs from the mempool.\n */\n\nimport { Transaction } from \"bitcoinjs-lib\";\nimport { Buffer } from \"buffer\";\n\n/**\n * Reference to a Bitcoin UTXO by its outpoint (txid + vout).\n *\n * Used by the availability check to compare a Pre-PegIn transaction's\n * declared inputs against the wallet's current spendable set. Txids are\n * compared case-insensitively; callers should treat the txid as opaque\n * lowercase hex.\n */\nexport interface UtxoRef {\n txid: string;\n vout: number;\n}\n\n/**\n * Information about a missing/spent UTXO.\n */\nexport interface MissingUtxoInfo {\n /** Transaction ID of the missing UTXO */\n txid: string;\n /** Output index of the missing UTXO */\n vout: number;\n}\n\n/**\n * Result of UTXO validation.\n */\nexport interface UtxoValidationResult {\n /** Whether all UTXOs are still available */\n allAvailable: boolean;\n /** List of missing UTXOs (if any) */\n missingUtxos: MissingUtxoInfo[];\n /** Total number of inputs checked */\n totalInputs: number;\n}\n\n/**\n * Error thrown when UTXOs are not available.\n */\nexport class UtxoNotAvailableError extends Error {\n public readonly missingUtxos: MissingUtxoInfo[];\n\n constructor(missingUtxos: MissingUtxoInfo[]) {\n const count = missingUtxos.length;\n const message =\n count === 1\n ? \"The UTXO for this peg-in is no longer available. It may have been spent in another transaction. Please create a new peg-in request with a different UTXO.\"\n : `${count} UTXOs for this peg-in are no longer available. They may have been spent. Please create a new peg-in request with different UTXOs.`;\n\n super(message);\n this.name = \"UtxoNotAvailableError\";\n this.missingUtxos = missingUtxos;\n }\n}\n\n/**\n * Extract input references (txid:vout) from an unsigned transaction.\n *\n * @param unsignedTxHex - Unsigned transaction hex\n * @returns Array of input references\n */\nexport function extractInputsFromTransaction(\n unsignedTxHex: string,\n): Array<{ txid: string; vout: number }> {\n const cleanHex = unsignedTxHex.startsWith(\"0x\")\n ? unsignedTxHex.slice(2)\n : unsignedTxHex;\n\n let tx: Transaction;\n try {\n tx = Transaction.fromHex(cleanHex);\n } catch (error) {\n throw new Error(\n `Failed to parse BTC transaction: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n\n return tx.ins.map((input) => ({\n // Bitcoin stores txid in reverse byte order\n txid: Buffer.from(input.hash).reverse().toString(\"hex\"),\n vout: input.index,\n }));\n}\n\n/**\n * Validate that all UTXOs in a transaction are still available.\n *\n * Pure function — accepts pre-fetched UTXOs instead of making network calls.\n * This should be called BEFORE signing to avoid wasting user effort\n * signing a transaction that will fail to broadcast.\n *\n * @param unsignedTxHex - Unsigned transaction hex\n * @param availableUtxos - Pre-fetched list of available UTXOs for the depositor\n * @returns Validation result with missing UTXO details\n */\nexport function validateUtxosAvailable(\n unsignedTxHex: string,\n availableUtxos: UtxoRef[],\n): UtxoValidationResult {\n const inputs = extractInputsFromTransaction(unsignedTxHex);\n\n if (inputs.length === 0) {\n throw new Error(\"Transaction has no inputs\");\n }\n\n // Detect duplicate inputs (same txid:vout referenced more than once).\n // This would produce an invalid Bitcoin transaction.\n const inputKeys = new Set<string>();\n for (const input of inputs) {\n const key = `${input.txid.toLowerCase()}:${input.vout}`;\n if (inputKeys.has(key)) {\n throw new Error(\n `Transaction contains duplicate input ${input.txid}:${input.vout}. ` +\n `This would produce an invalid Bitcoin transaction.`,\n );\n }\n inputKeys.add(key);\n }\n\n // Set of available outpoints for O(1) lookup. Lowercased so the comparison\n // is case-insensitive against whatever case the wallet returned.\n const availableSet = new Set(\n availableUtxos.map((utxo) => `${utxo.txid.toLowerCase()}:${utxo.vout}`),\n );\n\n // Check which inputs are missing\n const missingUtxos: MissingUtxoInfo[] = [];\n for (const input of inputs) {\n const key = `${input.txid.toLowerCase()}:${input.vout}`;\n if (!availableSet.has(key)) {\n missingUtxos.push({\n txid: input.txid,\n vout: input.vout,\n });\n }\n }\n\n return {\n allAvailable: missingUtxos.length === 0,\n missingUtxos,\n totalInputs: inputs.length,\n };\n}\n\n/**\n * Validate UTXOs and throw if any are not available.\n *\n * Pure convenience function that combines validation and error throwing.\n *\n * @param unsignedTxHex - Unsigned transaction hex\n * @param availableUtxos - Pre-fetched list of available UTXOs for the depositor\n * @throws UtxoNotAvailableError if any UTXOs are not available\n * @throws Error if validation fails\n */\nexport function assertUtxosAvailable(\n unsignedTxHex: string,\n availableUtxos: UtxoRef[],\n): void {\n const result = validateUtxosAvailable(unsignedTxHex, availableUtxos);\n\n if (!result.allAvailable) {\n throw new UtxoNotAvailableError(result.missingUtxos);\n }\n}\n","/**\n * Pending-vault outpoint overlap detection.\n *\n * Given the depositor's pending vaults (indexer + local cache) and the\n * outpoints a new deposit's coin selector picked, return the set of\n * pending vault ids whose Pre-PegIn BTC tx shares an input. Advisory\n * only — used to warn the user before signing.\n *\n * Only `PENDING` vaults contribute: VERIFIED+ have their Pre-PegIn\n * already confirmed on-chain, so those inputs cannot still appear in\n * the wallet's spendable set.\n */\nimport { Transaction } from \"bitcoinjs-lib\";\nimport { Buffer } from \"buffer\";\n\nimport { stripHexPrefix } from \"../../primitives/utils/bitcoin\";\nimport { ContractStatus } from \"../../services/deposit/peginState\";\n\nimport { type UtxoRef } from \"./availability\";\n\n/** Locally-known pending pegin. `id` is the bytes32 vault id. */\nexport interface PendingPeginLike {\n id?: string;\n unsignedTxHex?: string;\n}\n\n/** On-chain vault row from the indexer. */\nexport interface VaultLike {\n id?: string;\n status: number;\n unsignedPrePeginTx: string;\n}\n\nexport interface FindOverlappingPendingVaultsParams {\n selectedOutpoints: ReadonlyArray<UtxoRef>;\n vaults?: ReadonlyArray<VaultLike>;\n pendingPegins?: ReadonlyArray<PendingPeginLike>;\n}\n\nfunction extractInputUtxoRefs(txHex: string): UtxoRef[] {\n try {\n const tx = Transaction.fromHex(stripHexPrefix(txHex));\n return tx.ins.map((input) => ({\n txid: Buffer.from(input.hash).reverse().toString(\"hex\"),\n vout: input.index,\n }));\n } catch {\n return [];\n }\n}\n\nfunction outpointKey(o: UtxoRef): string {\n return `${o.txid.toLowerCase()}:${o.vout}`;\n}\n\n/**\n * Return the ids of pending vaults whose committed Pre-PegIn inputs\n * overlap any of the just-selected outpoints. On-chain `PENDING` vaults\n * take precedence over a same-id local pegin entry.\n */\nexport function findOverlappingPendingVaults(\n params: FindOverlappingPendingVaultsParams,\n): string[] {\n const { selectedOutpoints, vaults = [], pendingPegins = [] } = params;\n\n const selectedSet = new Set(selectedOutpoints.map(outpointKey));\n if (selectedSet.size === 0) return [];\n\n const seenIds = new Set<string>();\n const impacted = new Set<string>();\n\n const consider = (id: string | undefined, txHex: string): void => {\n if (!id) return;\n const idLower = id.toLowerCase();\n if (seenIds.has(idLower)) return;\n seenIds.add(idLower);\n const inputs = extractInputUtxoRefs(txHex);\n for (const input of inputs) {\n if (selectedSet.has(outpointKey(input))) {\n impacted.add(id);\n return;\n }\n }\n };\n\n // On-chain wins on id collision.\n for (const v of vaults) {\n if (v.status !== ContractStatus.PENDING) continue;\n consider(v.id, v.unsignedPrePeginTx);\n }\n for (const p of pendingPegins) {\n if (!p.unsignedTxHex) continue;\n consider(p.id, p.unsignedTxHex);\n }\n\n return Array.from(impacted);\n}\n"],"names":["UtxoNotAvailableError","missingUtxos","count","message","__publicField","extractInputsFromTransaction","unsignedTxHex","cleanHex","tx","Transaction","error","input","Buffer","validateUtxosAvailable","availableUtxos","inputs","inputKeys","key","availableSet","utxo","assertUtxosAvailable","result","extractInputUtxoRefs","txHex","stripHexPrefix","outpointKey","o","findOverlappingPendingVaults","params","selectedOutpoints","vaults","pendingPegins","selectedSet","seenIds","impacted","consider","id","idLower","v","ContractStatus","p"],"mappings":"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"}
|
|
@@ -4,7 +4,7 @@ var f = (e, n, t) => g(e, typeof n != "symbol" ? n + "" : n, t);
|
|
|
4
4
|
import { Transaction as p } from "bitcoinjs-lib";
|
|
5
5
|
import { Buffer as d } from "buffer";
|
|
6
6
|
import { s as w } from "./bitcoin-B5aNKtsk.js";
|
|
7
|
-
import { C as T } from "./peginState-
|
|
7
|
+
import { C as T } from "./peginState-BB81JI6I.js";
|
|
8
8
|
class U extends Error {
|
|
9
9
|
constructor(t) {
|
|
10
10
|
const r = t.length, a = r === 1 ? "The UTXO for this peg-in is no longer available. It may have been spent in another transaction. Please create a new peg-in request with a different UTXO." : `${r} UTXOs for this peg-in are no longer available. They may have been spent. Please create a new peg-in request with different UTXOs.`;
|
|
@@ -104,4 +104,4 @@ export {
|
|
|
104
104
|
L as f,
|
|
105
105
|
b as v
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=reservation-
|
|
107
|
+
//# sourceMappingURL=reservation-cHDRn4DA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reservation-BxvKbQH2.js","sources":["../src/tbv/core/utils/utxo/availability.ts","../src/tbv/core/utils/utxo/reservation.ts"],"sourcesContent":["/**\n * UTXO Availability Validation\n *\n * Validates that UTXOs referenced in a pre-pegin transaction are still unspent\n * BEFORE asking the user to sign. This prevents wasted signing effort when\n * UTXOs have already been spent by unrelated transactions.\n *\n * These functions are pure — they accept pre-fetched UTXOs and perform no I/O.\n * The vault service wrapper is responsible for fetching UTXOs from the mempool.\n */\n\nimport { Transaction } from \"bitcoinjs-lib\";\nimport { Buffer } from \"buffer\";\n\n/**\n * Reference to a Bitcoin UTXO by its outpoint (txid + vout).\n *\n * Used by the availability check to compare a Pre-PegIn transaction's\n * declared inputs against the wallet's current spendable set. Txids are\n * compared case-insensitively; callers should treat the txid as opaque\n * lowercase hex.\n */\nexport interface UtxoRef {\n txid: string;\n vout: number;\n}\n\n/**\n * Information about a missing/spent UTXO.\n */\nexport interface MissingUtxoInfo {\n /** Transaction ID of the missing UTXO */\n txid: string;\n /** Output index of the missing UTXO */\n vout: number;\n}\n\n/**\n * Result of UTXO validation.\n */\nexport interface UtxoValidationResult {\n /** Whether all UTXOs are still available */\n allAvailable: boolean;\n /** List of missing UTXOs (if any) */\n missingUtxos: MissingUtxoInfo[];\n /** Total number of inputs checked */\n totalInputs: number;\n}\n\n/**\n * Error thrown when UTXOs are not available.\n */\nexport class UtxoNotAvailableError extends Error {\n public readonly missingUtxos: MissingUtxoInfo[];\n\n constructor(missingUtxos: MissingUtxoInfo[]) {\n const count = missingUtxos.length;\n const message =\n count === 1\n ? \"The UTXO for this peg-in is no longer available. It may have been spent in another transaction. Please create a new peg-in request with a different UTXO.\"\n : `${count} UTXOs for this peg-in are no longer available. They may have been spent. Please create a new peg-in request with different UTXOs.`;\n\n super(message);\n this.name = \"UtxoNotAvailableError\";\n this.missingUtxos = missingUtxos;\n }\n}\n\n/**\n * Extract input references (txid:vout) from an unsigned transaction.\n *\n * @param unsignedTxHex - Unsigned transaction hex\n * @returns Array of input references\n */\nexport function extractInputsFromTransaction(\n unsignedTxHex: string,\n): Array<{ txid: string; vout: number }> {\n const cleanHex = unsignedTxHex.startsWith(\"0x\")\n ? unsignedTxHex.slice(2)\n : unsignedTxHex;\n\n let tx: Transaction;\n try {\n tx = Transaction.fromHex(cleanHex);\n } catch (error) {\n throw new Error(\n `Failed to parse BTC transaction: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n\n return tx.ins.map((input) => ({\n // Bitcoin stores txid in reverse byte order\n txid: Buffer.from(input.hash).reverse().toString(\"hex\"),\n vout: input.index,\n }));\n}\n\n/**\n * Validate that all UTXOs in a transaction are still available.\n *\n * Pure function — accepts pre-fetched UTXOs instead of making network calls.\n * This should be called BEFORE signing to avoid wasting user effort\n * signing a transaction that will fail to broadcast.\n *\n * @param unsignedTxHex - Unsigned transaction hex\n * @param availableUtxos - Pre-fetched list of available UTXOs for the depositor\n * @returns Validation result with missing UTXO details\n */\nexport function validateUtxosAvailable(\n unsignedTxHex: string,\n availableUtxos: UtxoRef[],\n): UtxoValidationResult {\n const inputs = extractInputsFromTransaction(unsignedTxHex);\n\n if (inputs.length === 0) {\n throw new Error(\"Transaction has no inputs\");\n }\n\n // Detect duplicate inputs (same txid:vout referenced more than once).\n // This would produce an invalid Bitcoin transaction.\n const inputKeys = new Set<string>();\n for (const input of inputs) {\n const key = `${input.txid.toLowerCase()}:${input.vout}`;\n if (inputKeys.has(key)) {\n throw new Error(\n `Transaction contains duplicate input ${input.txid}:${input.vout}. ` +\n `This would produce an invalid Bitcoin transaction.`,\n );\n }\n inputKeys.add(key);\n }\n\n // Set of available outpoints for O(1) lookup. Lowercased so the comparison\n // is case-insensitive against whatever case the wallet returned.\n const availableSet = new Set(\n availableUtxos.map((utxo) => `${utxo.txid.toLowerCase()}:${utxo.vout}`),\n );\n\n // Check which inputs are missing\n const missingUtxos: MissingUtxoInfo[] = [];\n for (const input of inputs) {\n const key = `${input.txid.toLowerCase()}:${input.vout}`;\n if (!availableSet.has(key)) {\n missingUtxos.push({\n txid: input.txid,\n vout: input.vout,\n });\n }\n }\n\n return {\n allAvailable: missingUtxos.length === 0,\n missingUtxos,\n totalInputs: inputs.length,\n };\n}\n\n/**\n * Validate UTXOs and throw if any are not available.\n *\n * Pure convenience function that combines validation and error throwing.\n *\n * @param unsignedTxHex - Unsigned transaction hex\n * @param availableUtxos - Pre-fetched list of available UTXOs for the depositor\n * @throws UtxoNotAvailableError if any UTXOs are not available\n * @throws Error if validation fails\n */\nexport function assertUtxosAvailable(\n unsignedTxHex: string,\n availableUtxos: UtxoRef[],\n): void {\n const result = validateUtxosAvailable(unsignedTxHex, availableUtxos);\n\n if (!result.allAvailable) {\n throw new UtxoNotAvailableError(result.missingUtxos);\n }\n}\n","/**\n * Pending-vault outpoint overlap detection.\n *\n * Given the depositor's pending vaults (indexer + local cache) and the\n * outpoints a new deposit's coin selector picked, return the set of\n * pending vault ids whose Pre-PegIn BTC tx shares an input. Advisory\n * only — used to warn the user before signing.\n *\n * Only `PENDING` vaults contribute: VERIFIED+ have their Pre-PegIn\n * already confirmed on-chain, so those inputs cannot still appear in\n * the wallet's spendable set.\n */\nimport { Transaction } from \"bitcoinjs-lib\";\nimport { Buffer } from \"buffer\";\n\nimport { stripHexPrefix } from \"../../primitives/utils/bitcoin\";\nimport { ContractStatus } from \"../../services/deposit/peginState\";\n\nimport { type UtxoRef } from \"./availability\";\n\n/** Locally-known pending pegin. `id` is the bytes32 vault id. */\nexport interface PendingPeginLike {\n id?: string;\n unsignedTxHex?: string;\n}\n\n/** On-chain vault row from the indexer. */\nexport interface VaultLike {\n id?: string;\n status: number;\n unsignedPrePeginTx: string;\n}\n\nexport interface FindOverlappingPendingVaultsParams {\n selectedOutpoints: ReadonlyArray<UtxoRef>;\n vaults?: ReadonlyArray<VaultLike>;\n pendingPegins?: ReadonlyArray<PendingPeginLike>;\n}\n\nfunction extractInputUtxoRefs(txHex: string): UtxoRef[] {\n try {\n const tx = Transaction.fromHex(stripHexPrefix(txHex));\n return tx.ins.map((input) => ({\n txid: Buffer.from(input.hash).reverse().toString(\"hex\"),\n vout: input.index,\n }));\n } catch {\n return [];\n }\n}\n\nfunction outpointKey(o: UtxoRef): string {\n return `${o.txid.toLowerCase()}:${o.vout}`;\n}\n\n/**\n * Return the ids of pending vaults whose committed Pre-PegIn inputs\n * overlap any of the just-selected outpoints. On-chain `PENDING` vaults\n * take precedence over a same-id local pegin entry.\n */\nexport function findOverlappingPendingVaults(\n params: FindOverlappingPendingVaultsParams,\n): string[] {\n const { selectedOutpoints, vaults = [], pendingPegins = [] } = params;\n\n const selectedSet = new Set(selectedOutpoints.map(outpointKey));\n if (selectedSet.size === 0) return [];\n\n const seenIds = new Set<string>();\n const impacted = new Set<string>();\n\n const consider = (id: string | undefined, txHex: string): void => {\n if (!id) return;\n const idLower = id.toLowerCase();\n if (seenIds.has(idLower)) return;\n seenIds.add(idLower);\n const inputs = extractInputUtxoRefs(txHex);\n for (const input of inputs) {\n if (selectedSet.has(outpointKey(input))) {\n impacted.add(id);\n return;\n }\n }\n };\n\n // On-chain wins on id collision.\n for (const v of vaults) {\n if (v.status !== ContractStatus.PENDING) continue;\n consider(v.id, v.unsignedPrePeginTx);\n }\n for (const p of pendingPegins) {\n if (!p.unsignedTxHex) continue;\n consider(p.id, p.unsignedTxHex);\n }\n\n return Array.from(impacted);\n}\n"],"names":["UtxoNotAvailableError","missingUtxos","count","message","__publicField","extractInputsFromTransaction","unsignedTxHex","cleanHex","tx","Transaction","error","input","Buffer","validateUtxosAvailable","availableUtxos","inputs","inputKeys","key","availableSet","utxo","assertUtxosAvailable","result","extractInputUtxoRefs","txHex","stripHexPrefix","outpointKey","o","findOverlappingPendingVaults","params","selectedOutpoints","vaults","pendingPegins","selectedSet","seenIds","impacted","consider","id","idLower","v","ContractStatus","p"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"reservation-cHDRn4DA.js","sources":["../src/tbv/core/utils/utxo/availability.ts","../src/tbv/core/utils/utxo/reservation.ts"],"sourcesContent":["/**\n * UTXO Availability Validation\n *\n * Validates that UTXOs referenced in a pre-pegin transaction are still unspent\n * BEFORE asking the user to sign. This prevents wasted signing effort when\n * UTXOs have already been spent by unrelated transactions.\n *\n * These functions are pure — they accept pre-fetched UTXOs and perform no I/O.\n * The vault service wrapper is responsible for fetching UTXOs from the mempool.\n */\n\nimport { Transaction } from \"bitcoinjs-lib\";\nimport { Buffer } from \"buffer\";\n\n/**\n * Reference to a Bitcoin UTXO by its outpoint (txid + vout).\n *\n * Used by the availability check to compare a Pre-PegIn transaction's\n * declared inputs against the wallet's current spendable set. Txids are\n * compared case-insensitively; callers should treat the txid as opaque\n * lowercase hex.\n */\nexport interface UtxoRef {\n txid: string;\n vout: number;\n}\n\n/**\n * Information about a missing/spent UTXO.\n */\nexport interface MissingUtxoInfo {\n /** Transaction ID of the missing UTXO */\n txid: string;\n /** Output index of the missing UTXO */\n vout: number;\n}\n\n/**\n * Result of UTXO validation.\n */\nexport interface UtxoValidationResult {\n /** Whether all UTXOs are still available */\n allAvailable: boolean;\n /** List of missing UTXOs (if any) */\n missingUtxos: MissingUtxoInfo[];\n /** Total number of inputs checked */\n totalInputs: number;\n}\n\n/**\n * Error thrown when UTXOs are not available.\n */\nexport class UtxoNotAvailableError extends Error {\n public readonly missingUtxos: MissingUtxoInfo[];\n\n constructor(missingUtxos: MissingUtxoInfo[]) {\n const count = missingUtxos.length;\n const message =\n count === 1\n ? \"The UTXO for this peg-in is no longer available. It may have been spent in another transaction. Please create a new peg-in request with a different UTXO.\"\n : `${count} UTXOs for this peg-in are no longer available. They may have been spent. Please create a new peg-in request with different UTXOs.`;\n\n super(message);\n this.name = \"UtxoNotAvailableError\";\n this.missingUtxos = missingUtxos;\n }\n}\n\n/**\n * Extract input references (txid:vout) from an unsigned transaction.\n *\n * @param unsignedTxHex - Unsigned transaction hex\n * @returns Array of input references\n */\nexport function extractInputsFromTransaction(\n unsignedTxHex: string,\n): Array<{ txid: string; vout: number }> {\n const cleanHex = unsignedTxHex.startsWith(\"0x\")\n ? unsignedTxHex.slice(2)\n : unsignedTxHex;\n\n let tx: Transaction;\n try {\n tx = Transaction.fromHex(cleanHex);\n } catch (error) {\n throw new Error(\n `Failed to parse BTC transaction: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n\n return tx.ins.map((input) => ({\n // Bitcoin stores txid in reverse byte order\n txid: Buffer.from(input.hash).reverse().toString(\"hex\"),\n vout: input.index,\n }));\n}\n\n/**\n * Validate that all UTXOs in a transaction are still available.\n *\n * Pure function — accepts pre-fetched UTXOs instead of making network calls.\n * This should be called BEFORE signing to avoid wasting user effort\n * signing a transaction that will fail to broadcast.\n *\n * @param unsignedTxHex - Unsigned transaction hex\n * @param availableUtxos - Pre-fetched list of available UTXOs for the depositor\n * @returns Validation result with missing UTXO details\n */\nexport function validateUtxosAvailable(\n unsignedTxHex: string,\n availableUtxos: UtxoRef[],\n): UtxoValidationResult {\n const inputs = extractInputsFromTransaction(unsignedTxHex);\n\n if (inputs.length === 0) {\n throw new Error(\"Transaction has no inputs\");\n }\n\n // Detect duplicate inputs (same txid:vout referenced more than once).\n // This would produce an invalid Bitcoin transaction.\n const inputKeys = new Set<string>();\n for (const input of inputs) {\n const key = `${input.txid.toLowerCase()}:${input.vout}`;\n if (inputKeys.has(key)) {\n throw new Error(\n `Transaction contains duplicate input ${input.txid}:${input.vout}. ` +\n `This would produce an invalid Bitcoin transaction.`,\n );\n }\n inputKeys.add(key);\n }\n\n // Set of available outpoints for O(1) lookup. Lowercased so the comparison\n // is case-insensitive against whatever case the wallet returned.\n const availableSet = new Set(\n availableUtxos.map((utxo) => `${utxo.txid.toLowerCase()}:${utxo.vout}`),\n );\n\n // Check which inputs are missing\n const missingUtxos: MissingUtxoInfo[] = [];\n for (const input of inputs) {\n const key = `${input.txid.toLowerCase()}:${input.vout}`;\n if (!availableSet.has(key)) {\n missingUtxos.push({\n txid: input.txid,\n vout: input.vout,\n });\n }\n }\n\n return {\n allAvailable: missingUtxos.length === 0,\n missingUtxos,\n totalInputs: inputs.length,\n };\n}\n\n/**\n * Validate UTXOs and throw if any are not available.\n *\n * Pure convenience function that combines validation and error throwing.\n *\n * @param unsignedTxHex - Unsigned transaction hex\n * @param availableUtxos - Pre-fetched list of available UTXOs for the depositor\n * @throws UtxoNotAvailableError if any UTXOs are not available\n * @throws Error if validation fails\n */\nexport function assertUtxosAvailable(\n unsignedTxHex: string,\n availableUtxos: UtxoRef[],\n): void {\n const result = validateUtxosAvailable(unsignedTxHex, availableUtxos);\n\n if (!result.allAvailable) {\n throw new UtxoNotAvailableError(result.missingUtxos);\n }\n}\n","/**\n * Pending-vault outpoint overlap detection.\n *\n * Given the depositor's pending vaults (indexer + local cache) and the\n * outpoints a new deposit's coin selector picked, return the set of\n * pending vault ids whose Pre-PegIn BTC tx shares an input. Advisory\n * only — used to warn the user before signing.\n *\n * Only `PENDING` vaults contribute: VERIFIED+ have their Pre-PegIn\n * already confirmed on-chain, so those inputs cannot still appear in\n * the wallet's spendable set.\n */\nimport { Transaction } from \"bitcoinjs-lib\";\nimport { Buffer } from \"buffer\";\n\nimport { stripHexPrefix } from \"../../primitives/utils/bitcoin\";\nimport { ContractStatus } from \"../../services/deposit/peginState\";\n\nimport { type UtxoRef } from \"./availability\";\n\n/** Locally-known pending pegin. `id` is the bytes32 vault id. */\nexport interface PendingPeginLike {\n id?: string;\n unsignedTxHex?: string;\n}\n\n/** On-chain vault row from the indexer. */\nexport interface VaultLike {\n id?: string;\n status: number;\n unsignedPrePeginTx: string;\n}\n\nexport interface FindOverlappingPendingVaultsParams {\n selectedOutpoints: ReadonlyArray<UtxoRef>;\n vaults?: ReadonlyArray<VaultLike>;\n pendingPegins?: ReadonlyArray<PendingPeginLike>;\n}\n\nfunction extractInputUtxoRefs(txHex: string): UtxoRef[] {\n try {\n const tx = Transaction.fromHex(stripHexPrefix(txHex));\n return tx.ins.map((input) => ({\n txid: Buffer.from(input.hash).reverse().toString(\"hex\"),\n vout: input.index,\n }));\n } catch {\n return [];\n }\n}\n\nfunction outpointKey(o: UtxoRef): string {\n return `${o.txid.toLowerCase()}:${o.vout}`;\n}\n\n/**\n * Return the ids of pending vaults whose committed Pre-PegIn inputs\n * overlap any of the just-selected outpoints. On-chain `PENDING` vaults\n * take precedence over a same-id local pegin entry.\n */\nexport function findOverlappingPendingVaults(\n params: FindOverlappingPendingVaultsParams,\n): string[] {\n const { selectedOutpoints, vaults = [], pendingPegins = [] } = params;\n\n const selectedSet = new Set(selectedOutpoints.map(outpointKey));\n if (selectedSet.size === 0) return [];\n\n const seenIds = new Set<string>();\n const impacted = new Set<string>();\n\n const consider = (id: string | undefined, txHex: string): void => {\n if (!id) return;\n const idLower = id.toLowerCase();\n if (seenIds.has(idLower)) return;\n seenIds.add(idLower);\n const inputs = extractInputUtxoRefs(txHex);\n for (const input of inputs) {\n if (selectedSet.has(outpointKey(input))) {\n impacted.add(id);\n return;\n }\n }\n };\n\n // On-chain wins on id collision.\n for (const v of vaults) {\n if (v.status !== ContractStatus.PENDING) continue;\n consider(v.id, v.unsignedPrePeginTx);\n }\n for (const p of pendingPegins) {\n if (!p.unsignedTxHex) continue;\n consider(p.id, p.unsignedTxHex);\n }\n\n return Array.from(impacted);\n}\n"],"names":["UtxoNotAvailableError","missingUtxos","count","message","__publicField","extractInputsFromTransaction","unsignedTxHex","cleanHex","tx","Transaction","error","input","Buffer","validateUtxosAvailable","availableUtxos","inputs","inputKeys","key","availableSet","utxo","assertUtxosAvailable","result","extractInputUtxoRefs","txHex","stripHexPrefix","outpointKey","o","findOverlappingPendingVaults","params","selectedOutpoints","vaults","pendingPegins","selectedSet","seenIds","impacted","consider","id","idLower","v","ContractStatus","p"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../mempoolApi-NMiYQAXI.cjs"),t=require("../../../primeVpAuth-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../mempoolApi-NMiYQAXI.cjs"),t=require("../../../primeVpAuth-yTddDmGy.cjs"),r=require("../../../types-WA0LrDk1.cjs");exports.MEMPOOL_API_URLS=e.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=e.ViemVaultRegistryReader;exports.getAddressTxs=e.getAddressTxs;exports.getAddressUtxos=e.getAddressUtxos;exports.getMempoolApiUrl=e.getMempoolApiUrl;exports.getNetworkFees=e.getNetworkFees;exports.getOutspend=e.getOutspend;exports.getTipHeight=e.getTipHeight;exports.getTxHex=e.getTxHex;exports.getTxInfo=e.getTxInfo;exports.getUtxoInfo=e.getUtxoInfo;exports.pushTx=e.pushTx;exports.validateOffchainParams=e.validateOffchainParams;exports.validatePegInConfiguration=e.validatePegInConfiguration;exports.validateTBVProtocolParams=e.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=t.OnChainBtcVaultStatus;exports.ServerIdentityError=t.ServerIdentityError;exports.VaultProviderRpcClient=t.VaultProviderRpcClient;exports.ViemProtocolParamsReader=t.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=t.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=t.ViemVaultKeeperReader;exports.VpResponseValidationError=t.VpResponseValidationError;exports.VpTokenRegistry=t.VpTokenRegistry;exports.batchPollByProvider=t.batchPollByProvider;exports.createAuthenticatedVpClient=t.createAuthenticatedVpClient;exports.primeVpTokenRegistry=t.primeVpTokenRegistry;exports.resolveProtocolAddresses=t.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=t.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=t.verifyServerIdentity;exports.vpTokenRegistry=t.vpTokenRegistry;exports.AUTH_EXPIRED_DATA_KIND=r.AUTH_EXPIRED_DATA_KIND;exports.DaemonStatus=r.DaemonStatus;exports.JSON_RPC_ERROR_CODES=r.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=r.JsonRpcClient;exports.JsonRpcError=r.JsonRpcError;exports.POST_WOTS_STATUSES=r.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=r.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=r.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=r.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=r.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=r.VP_TRANSIENT_STATUSES;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { M as s, V as r, g as t, a as o, b as i, c as R, d as T, e as n, f as S, h as d, i as l, p, v as A, j as P, k as _ } from "../../../mempoolApi-Dc1KSVNI.js";
|
|
2
|
-
import { O as V, S as g, V as c, g as m, h as v, i as I, a as O, d as f, b as u, f as C, p as U, r as x, v as h, c as y, e as D } from "../../../primeVpAuth-
|
|
2
|
+
import { O as V, S as g, V as c, g as m, h as v, i as I, a as O, d as f, b as u, f as C, p as U, r as x, v as h, c as y, e as D } from "../../../primeVpAuth-DxMuWQCi.js";
|
|
3
3
|
import { A as M, D as k, b, J as B, a as H, d as J, P as L, R as F, e as K, c as X, V as j } from "../../../types-CQDRQvV-.js";
|
|
4
4
|
export {
|
|
5
5
|
M as AUTH_EXPIRED_DATA_KIND,
|
|
@@ -14,12 +14,6 @@ export interface AuthenticatedVpClientConfig {
|
|
|
14
14
|
* x-only and asserted against every issued token's CWT `aud` claim.
|
|
15
15
|
*/
|
|
16
16
|
depositorBtcPubkey: string;
|
|
17
|
-
/**
|
|
18
|
-
* Opt into gRPC-subject auth for the artifact stream. Defaults to
|
|
19
|
-
* `false` (JSON-RPC bearer). Only enable against a proxy running with
|
|
20
|
-
* `ENABLE_GRPC_ARTIFACTS`. Forwarded to {@link vpTokenRegistry}.
|
|
21
|
-
*/
|
|
22
|
-
enableGrpcArtifactAuth?: boolean;
|
|
23
17
|
/** Optional outer-client tunables (timeout, retries, headers, etc.). */
|
|
24
18
|
options?: VaultProviderRpcClientOptions;
|
|
25
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAuthenticatedVpClient.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/createAuthenticatedVpClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,EACnC,MAAM,QAAQ,CAAC;AAKhB,MAAM,WAAW,2BAA2B;IAC1C,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,aAAa,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,kBAAkB,EAAE,gBAAgB,CAAC;IACrC;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B
|
|
1
|
+
{"version":3,"file":"createAuthenticatedVpClient.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/createAuthenticatedVpClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,EACnC,MAAM,QAAQ,CAAC;AAKhB,MAAM,WAAW,2BAA2B;IAC1C,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,aAAa,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,kBAAkB,EAAE,gBAAgB,CAAC;IACrC;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B,wEAAwE;IACxE,OAAO,CAAC,EAAE,6BAA6B,CAAC;CACzC;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,2BAA2B,GAClC,sBAAsB,CAoBxB"}
|
|
@@ -11,14 +11,6 @@ export interface PrimeVpAuthInput {
|
|
|
11
11
|
depositorBtcPubkey: string;
|
|
12
12
|
/** Optional headers forwarded to the inner token client (e.g. gateway auth). */
|
|
13
13
|
headers?: Record<string, string>;
|
|
14
|
-
/**
|
|
15
|
-
* Opt into gRPC-subject auth for the artifact stream. Defaults to
|
|
16
|
-
* `false`. Must match the value passed to a later
|
|
17
|
-
* `createAuthenticatedVpClient` for the same `peginTxid` —
|
|
18
|
-
* `VpTokenRegistry.getOrCreate` throws on a mismatch rather than
|
|
19
|
-
* serve the wrong-subject token from the primed provider.
|
|
20
|
-
*/
|
|
21
|
-
enableGrpcArtifactAuth?: boolean;
|
|
22
14
|
}
|
|
23
15
|
export declare function primeVpTokenRegistry(input: PrimeVpAuthInput): void;
|
|
24
16
|
//# sourceMappingURL=primeVpAuth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primeVpAuth.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/primeVpAuth.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKxD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,gBAAgB,CAAC;IACrC;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"primeVpAuth.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/primeVpAuth.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKxD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,gBAAgB,CAAC;IACrC;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAUlE"}
|
|
@@ -8,25 +8,14 @@ export interface VpTokenRegistryInput {
|
|
|
8
8
|
pinnedServerPubkey: OnChainBtcPubkey;
|
|
9
9
|
/** Depositor x-only pubkey (32-byte hex), asserted against each token's CWT `aud`. */
|
|
10
10
|
expectedAudienceXOnlyPubkey: string;
|
|
11
|
-
/**
|
|
12
|
-
* Opt into gRPC-subject auth for {@link GRPC_AUTH_GATED_METHODS}
|
|
13
|
-
* (currently the artifact stream). Defaults to `false`: those methods
|
|
14
|
-
* fall back into the JSON-RPC-subject set and authenticate via
|
|
15
|
-
* `auth_createDepositorToken`, matching a proxy that runs with
|
|
16
|
-
* `ENABLE_GRPC_ARTIFACTS` off. Set `true` only against a proxy that
|
|
17
|
-
* serves `auth_createDepositorTokenGrpc`.
|
|
18
|
-
*/
|
|
19
|
-
enableGrpcArtifactAuth?: boolean;
|
|
20
11
|
}
|
|
21
12
|
export declare class VpTokenRegistry {
|
|
22
13
|
private readonly entries;
|
|
23
14
|
/**
|
|
24
15
|
* Return the cached `VpTokenProvider` for `peginTxid` if one exists
|
|
25
|
-
* with matching `authAnchorHex
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* mask derivation drift, VP pubkey rotation, or a caller that disagrees
|
|
29
|
-
* on the auth subject (which the cached provider can't switch).
|
|
16
|
+
* with matching `authAnchorHex` and `pinnedServerPubkey`, otherwise
|
|
17
|
+
* construct and cache a fresh provider. A mismatch on either throws —
|
|
18
|
+
* silent overwrite would mask derivation drift or VP pubkey rotation.
|
|
30
19
|
*/
|
|
31
20
|
getOrCreate(input: VpTokenRegistryInput): VpTokenProvider;
|
|
32
21
|
/** Return the cached provider, or `undefined` if none. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenRegistry.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/tokenRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,sFAAsF;IACtF,2BAA2B,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"tokenRegistry.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/tokenRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,sFAAsF;IACtF,2BAA2B,EAAE,MAAM,CAAC;CACrC;AASD,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAE5D;;;;;OAKG;IACH,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe;IA8CzD,0DAA0D;IAC1D,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIpD;;;;OAIG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIhC;;;;;OAKG;IACH,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe,CAAC;IAC1D,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAAC;IACrD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,EAAE,qBAA6C,CAAC"}
|
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-HNbugpqL.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),n=require("../../verifyScriptPathSchnorrSignature-Cl7tu77P.cjs"),S=require("../../peginInput-DH6X4ITS.cjs"),A=require("../../noPayout-lyIRiUyG.cjs"),r=require("../../bitcoin-CHfKAhcI.cjs"),R=require("../../signing-Bnsro0hE.cjs"),c=require("../../validation-u8W7Lp2x.cjs"),u=require("../../PeginManager-BvxfSwsr.cjs"),p=require("../../PayoutManager-BZVEyi10.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"),i=require("../../mempoolApi-NMiYQAXI.cjs"),a=require("../../primeVpAuth-CXzKktIW.cjs"),s=require("../../types-WA0LrDk1.cjs"),g=require("../../errors-Bu0H-dZD.cjs"),e=require("../../buildAndBroadcastRefund-ob1n2iB3.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=i.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=i.ViemVaultRegistryReader;exports.getAddressTxs=i.getAddressTxs;exports.getAddressUtxos=i.getAddressUtxos;exports.getMempoolApiUrl=i.getMempoolApiUrl;exports.getNetworkFees=i.getNetworkFees;exports.getOutspend=i.getOutspend;exports.getTipHeight=i.getTipHeight;exports.getTxHex=i.getTxHex;exports.getTxInfo=i.getTxInfo;exports.getUtxoInfo=i.getUtxoInfo;exports.pushTx=i.pushTx;exports.validateOffchainParams=i.validateOffchainParams;exports.validatePegInConfiguration=i.validatePegInConfiguration;exports.validateTBVProtocolParams=i.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=a.OnChainBtcVaultStatus;exports.ServerIdentityError=a.ServerIdentityError;exports.VaultProviderRpcClient=a.VaultProviderRpcClient;exports.ViemProtocolParamsReader=a.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=a.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=a.ViemVaultKeeperReader;exports.VpResponseValidationError=a.VpResponseValidationError;exports.VpTokenRegistry=a.VpTokenRegistry;exports.batchPollByProvider=a.batchPollByProvider;exports.createAuthenticatedVpClient=a.createAuthenticatedVpClient;exports.primeVpTokenRegistry=a.primeVpTokenRegistry;exports.resolveProtocolAddresses=a.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=a.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=a.verifyServerIdentity;exports.vpTokenRegistry=a.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-HNbugpqL.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),n=require("../../verifyScriptPathSchnorrSignature-Cl7tu77P.cjs"),S=require("../../peginInput-DH6X4ITS.cjs"),A=require("../../noPayout-lyIRiUyG.cjs"),r=require("../../bitcoin-CHfKAhcI.cjs"),R=require("../../signing-Bnsro0hE.cjs"),c=require("../../validation-u8W7Lp2x.cjs"),u=require("../../PeginManager-BvxfSwsr.cjs"),p=require("../../PayoutManager-BZVEyi10.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"),P=require("../../reservation-ClEs2X0H.cjs"),i=require("../../mempoolApi-NMiYQAXI.cjs"),a=require("../../primeVpAuth-yTddDmGy.cjs"),s=require("../../types-WA0LrDk1.cjs"),g=require("../../errors-Bu0H-dZD.cjs"),e=require("../../buildAndBroadcastRefund-ob1n2iB3.cjs"),T=require("../../peginState-CBBJw4Za.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=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=P.UtxoNotAvailableError;exports.assertUtxosAvailable=P.assertUtxosAvailable;exports.extractInputsFromTransaction=P.extractInputsFromTransaction;exports.findOverlappingPendingVaults=P.findOverlappingPendingVaults;exports.validateUtxosAvailable=P.validateUtxosAvailable;exports.MEMPOOL_API_URLS=i.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=i.ViemVaultRegistryReader;exports.getAddressTxs=i.getAddressTxs;exports.getAddressUtxos=i.getAddressUtxos;exports.getMempoolApiUrl=i.getMempoolApiUrl;exports.getNetworkFees=i.getNetworkFees;exports.getOutspend=i.getOutspend;exports.getTipHeight=i.getTipHeight;exports.getTxHex=i.getTxHex;exports.getTxInfo=i.getTxInfo;exports.getUtxoInfo=i.getUtxoInfo;exports.pushTx=i.pushTx;exports.validateOffchainParams=i.validateOffchainParams;exports.validatePegInConfiguration=i.validatePegInConfiguration;exports.validateTBVProtocolParams=i.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=a.OnChainBtcVaultStatus;exports.ServerIdentityError=a.ServerIdentityError;exports.VaultProviderRpcClient=a.VaultProviderRpcClient;exports.ViemProtocolParamsReader=a.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=a.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=a.ViemVaultKeeperReader;exports.VpResponseValidationError=a.VpResponseValidationError;exports.VpTokenRegistry=a.VpTokenRegistry;exports.batchPollByProvider=a.batchPollByProvider;exports.createAuthenticatedVpClient=a.createAuthenticatedVpClient;exports.primeVpTokenRegistry=a.primeVpTokenRegistry;exports.resolveProtocolAddresses=a.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=a.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=a.verifyServerIdentity;exports.vpTokenRegistry=a.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;exports.isActivationDeadlinePassedOnChain=T.isActivationDeadlinePassedOnChain;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/tbv/core/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { computeMinClaimValue as i, computeMinPeginFee as n, deriveVaultId as u,
|
|
|
3
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-CeZp6tMw.js";
|
|
4
4
|
import { b as x, e as f, f as b } from "../../peginInput-BPRB9tUi.js";
|
|
5
5
|
import { a as O, b as V } from "../../noPayout-C1WCsqfd.js";
|
|
6
|
-
import { d as C, a as
|
|
6
|
+
import { d as C, a as h, b as F, 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
7
|
import { c as G } from "../../signing-DaLvGwQe.js";
|
|
8
8
|
import { B as Z, H as J, K as j, M as q, T as z } from "../../validation-CxqROCno.js";
|
|
9
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-COxRVrxa.js";
|
|
@@ -11,15 +11,15 @@ import { P as ua, c as la, v as pa } from "../../PayoutManager-D26nGR-e.js";
|
|
|
11
11
|
import { A as Pa, P as ca } from "../../ApplicationRegistry.abi-Dn2qk6JG.js";
|
|
12
12
|
import { B as Ea } from "../../BTCVaultRegistry.abi-Chs4AFBj.js";
|
|
13
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
|
|
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 ha, h as Fa, s as Ua, e as Na, w as ya } from "../../waitForTransactionReceiptSmartAware-Ckg_oZAo.js";
|
|
15
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-
|
|
16
|
+
import { U as $a, a as ae, e as ee, f as se, v as te } from "../../reservation-cHDRn4DA.js";
|
|
17
17
|
import { M as oe, V as ie, g as ne, a as ue, b as le, c as pe, d as de, e as Pe, f as ce, h as Te, i as Ee, p as Se, v as Ae, j as _e, k as ge } from "../../mempoolApi-Dc1KSVNI.js";
|
|
18
|
-
import { O as me, S as xe, V as fe, g as be, h as Ie, i as Oe, a as Ve, d as ve, b as Ce, f as
|
|
18
|
+
import { O as me, S as xe, V as fe, g as be, h as Ie, i as Oe, a as Ve, d as ve, b as Ce, f as he, p as Fe, r as Ue, v as Ne, c as ye, e as Be } from "../../primeVpAuth-DxMuWQCi.js";
|
|
19
19
|
import { A as Me, D as He, b as Le, J as Xe, a as ke, d as We, P as Ke, R as we, e as Ge, c as Ye, V as Ze } from "../../types-CQDRQvV-.js";
|
|
20
20
|
import { i as je, p as qe } from "../../errors-9AkghWyk.js";
|
|
21
21
|
import { B as Qe, C as $e, p as as, q as es, t as ss, u as ts, R as rs, a as os, n as is, o as ns, i as us, m as ls, l as ps, j as ds, r as Ps, b as cs, s as Ts, v as Es, g as Ss, h as As, d as _s, c as gs, e as Rs, f as ms, k as xs, w as fs } from "../../buildAndBroadcastRefund-Bmz9WJuN.js";
|
|
22
|
-
import { C as Is, P as Os, c as Vs, g as vs } from "../../peginState-
|
|
22
|
+
import { C as Is, P as Os, c as Vs, g as vs, i as Cs } from "../../peginState-BB81JI6I.js";
|
|
23
23
|
export {
|
|
24
24
|
Me as AUTH_EXPIRED_DATA_KIND,
|
|
25
25
|
Pa as ApplicationRegistryABI,
|
|
@@ -105,12 +105,12 @@ export {
|
|
|
105
105
|
r as computeNumLocalChallengers,
|
|
106
106
|
va as computePeginBaseFeeSats,
|
|
107
107
|
ta as computeWotsBlockPublicKeysHash,
|
|
108
|
-
|
|
108
|
+
he as createAuthenticatedVpClient,
|
|
109
109
|
g as createPayoutScript,
|
|
110
110
|
G as createTaprootScriptPathSignOptions,
|
|
111
111
|
C as deriveBip86ScriptPubKeyHex,
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
h as deriveNativeSegwitAddress,
|
|
113
|
+
F as deriveTaprootAddress,
|
|
114
114
|
u as deriveVaultId,
|
|
115
115
|
ra as deriveVaultRoot,
|
|
116
116
|
oa as deriveWotsBlocksFromSeed,
|
|
@@ -137,8 +137,8 @@ export {
|
|
|
137
137
|
pe as getNetworkFees,
|
|
138
138
|
de as getOutspend,
|
|
139
139
|
vs as getPeginProtocolState,
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
ha as getPsbtInputFields,
|
|
141
|
+
Fa as getScriptType,
|
|
142
142
|
B as getSortedXOnlyPubkeys,
|
|
143
143
|
Pe as getTipHeight,
|
|
144
144
|
ce as getTxHex,
|
|
@@ -146,6 +146,7 @@ export {
|
|
|
146
146
|
Ee as getUtxoInfo,
|
|
147
147
|
Ra as handleContractError,
|
|
148
148
|
D as hexToUint8Array,
|
|
149
|
+
Cs as isActivationDeadlinePassedOnChain,
|
|
149
150
|
M as isAddressFromPublicKey,
|
|
150
151
|
us as isDepositAmountValid,
|
|
151
152
|
ma as isKnownContractError,
|
|
@@ -157,7 +158,7 @@ export {
|
|
|
157
158
|
qe as parseFundingOutpointsFromTx,
|
|
158
159
|
ja as parseUnfundedWasmTransaction,
|
|
159
160
|
qa as peginOutputCount,
|
|
160
|
-
|
|
161
|
+
Fe as primeVpTokenRegistry,
|
|
161
162
|
L as processPublicKeyToXOnly,
|
|
162
163
|
Se as pushTx,
|
|
163
164
|
za as rateBasedTxBufferFee,
|
|
@@ -3,7 +3,7 @@ export { waitForPeginStatus, type WaitForPeginStatusParams, } from './waitForPeg
|
|
|
3
3
|
export { submitWotsPublicKey, type SubmitWotsPublicKeyParams, } from './submitWotsPublicKey';
|
|
4
4
|
export { signDepositorGraph, type DepositorGraphSigningContext, type SignDepositorGraphParams, } from './signDepositorGraph';
|
|
5
5
|
export { runDepositorPresignFlow, type PayoutSigningContext, type RunDepositorPresignFlowParams, } from './runDepositorPresignFlow';
|
|
6
|
-
export { ContractStatus, PeginAction, canPerformAction, getPeginProtocolState, type ExpirationReason, type GetPeginProtocolStateOptions, type PeginProtocolState, } from './peginState';
|
|
6
|
+
export { ContractStatus, PeginAction, canPerformAction, getPeginProtocolState, isActivationDeadlinePassedOnChain, type ExpirationReason, type GetPeginProtocolStateOptions, type PeginProtocolState, } from './peginState';
|
|
7
7
|
export { isDepositAmountValid, validateDepositAmount, validateRemainingCapacity, validateProviderSelection, validateVaultAmounts, validateVaultProviderPubkey, validateMultiVaultDepositInputs, type ValidationResult, type DepositFormValidityParams, type RemainingCapacityParams, type MultiVaultDepositFlowInputs, } from './validation';
|
|
8
8
|
export { validateOnChainParticipantKeys, type ValidateOnChainParticipantKeysParams, type ValidatedOnChainParticipantKeys, } from './validateOnChainParticipantKeys';
|
|
9
9
|
export { RegisteredVaultVersionMismatchError, isRegisteredVaultVersionMismatchError, verifyRegisteredVaultVersions, type VerifyRegisteredVaultVersionsParams, } from './verifyRegisteredVaultVersions';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/deposit/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,mBAAmB,EACnB,KAAK,yBAAyB,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,GACnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,2BAA2B,EAC3B,+BAA+B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,GACjC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,8BAA8B,EAC9B,KAAK,oCAAoC,EACzC,KAAK,+BAA+B,GACrC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,mCAAmC,EACnC,qCAAqC,EACrC,6BAA6B,EAC7B,KAAK,mCAAmC,GACzC,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/deposit/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,mBAAmB,EACnB,KAAK,yBAAyB,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,GACnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,iCAAiC,EACjC,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,2BAA2B,EAC3B,+BAA+B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,GACjC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,8BAA8B,EAC9B,KAAK,oCAAoC,EACzC,KAAK,+BAA+B,GACrC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,mCAAmC,EACnC,qCAAqC,EACrC,6BAA6B,EAC7B,KAAK,mCAAmC,GACzC,MAAM,iCAAiC,CAAC"}
|
|
@@ -90,4 +90,15 @@ export declare function getPeginProtocolState(contractStatus: ContractStatus, op
|
|
|
90
90
|
* Check if a specific action is available in the current state
|
|
91
91
|
*/
|
|
92
92
|
export declare function canPerformAction(state: PeginProtocolState, action: PeginAction): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Whether a vault's on-chain activation window has closed. Mirrors the
|
|
95
|
+
* BTCVaultRegistry check that reverts `ActivationDeadlineExpired`:
|
|
96
|
+
* `block.number > createdAt + pegInActivationTimeout` — strict `>`, so a
|
|
97
|
+
* boundary-equal block is NOT expired. All values are Ethereum block numbers.
|
|
98
|
+
*/
|
|
99
|
+
export declare function isActivationDeadlinePassedOnChain(params: {
|
|
100
|
+
currentBlock: bigint;
|
|
101
|
+
createdAtBlock: bigint;
|
|
102
|
+
pegInActivationTimeout: bigint;
|
|
103
|
+
}): boolean;
|
|
93
104
|
//# sourceMappingURL=peginState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peginState.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/deposit/peginState.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,oBAAY,cAAc;IACxB,oDAAoD;IACpD,OAAO,IAAI;IACX,gEAAgE;IAChE,QAAQ,IAAI;IACZ,qGAAqG;IACrG,MAAM,IAAI;IACV,0DAA0D;IAC1D,QAAQ,IAAI;IACZ,2FAA2F;IAC3F,UAAU,IAAI;IACd,kGAAkG;IAClG,OAAO,IAAI;IACX,uFAAuF;IACvF,mBAAmB,IAAI;IACvB,oFAAoF;IACpF,OAAO,IAAI;CACZ;AAED,iCAAiC;AACjC,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,eAAe,GACf,oBAAoB,CAAC;AAMzB;;GAEG;AACH,oBAAY,WAAW;IACrB,kEAAkE;IAClE,eAAe,oBAAoB;IACnC,+BAA+B;IAC/B,wBAAwB,6BAA6B;IACrD,uDAAuD;IACvD,6BAA6B,kCAAkC;IAC/D,uDAAuD;IACvD,cAAc,mBAAmB;IACjC,sEAAsE;IACtE,WAAW,gBAAgB;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,cAAc,EAAE,cAAc,CAAC;IAC/B,uEAAuE;IACvE,gBAAgB,EAAE,WAAW,EAAE,CAAC;CACjC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,4BAA4B;IAC3C,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gFAAgF;IAChF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,yEAAyE;IACzE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,cAAc,EAC9B,OAAO,GAAE,4BAAiC,GACzC,kBAAkB,CA6EpB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,kBAAkB,EACzB,MAAM,EAAE,WAAW,GAClB,OAAO,CAET"}
|
|
1
|
+
{"version":3,"file":"peginState.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/deposit/peginState.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,oBAAY,cAAc;IACxB,oDAAoD;IACpD,OAAO,IAAI;IACX,gEAAgE;IAChE,QAAQ,IAAI;IACZ,qGAAqG;IACrG,MAAM,IAAI;IACV,0DAA0D;IAC1D,QAAQ,IAAI;IACZ,2FAA2F;IAC3F,UAAU,IAAI;IACd,kGAAkG;IAClG,OAAO,IAAI;IACX,uFAAuF;IACvF,mBAAmB,IAAI;IACvB,oFAAoF;IACpF,OAAO,IAAI;CACZ;AAED,iCAAiC;AACjC,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,eAAe,GACf,oBAAoB,CAAC;AAMzB;;GAEG;AACH,oBAAY,WAAW;IACrB,kEAAkE;IAClE,eAAe,oBAAoB;IACnC,+BAA+B;IAC/B,wBAAwB,6BAA6B;IACrD,uDAAuD;IACvD,6BAA6B,kCAAkC;IAC/D,uDAAuD;IACvD,cAAc,mBAAmB;IACjC,sEAAsE;IACtE,WAAW,gBAAgB;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,cAAc,EAAE,cAAc,CAAC;IAC/B,uEAAuE;IACvE,gBAAgB,EAAE,WAAW,EAAE,CAAC;CACjC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,4BAA4B;IAC3C,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gFAAgF;IAChF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,yEAAyE;IACzE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,cAAc,EAC9B,OAAO,GAAE,4BAAiC,GACzC,kBAAkB,CA6EpB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,kBAAkB,EACzB,MAAM,EAAE,WAAW,GAClB,OAAO,CAET;AAMD;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,MAAM,EAAE;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,MAAM,CAAC;CAChC,GAAG,OAAO,CAGV"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../PayoutManager-BZVEyi10.cjs"),t=require("../../../buildAndBroadcastRefund-ob1n2iB3.cjs"),e=require("../../../peginState-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../PayoutManager-BZVEyi10.cjs"),t=require("../../../buildAndBroadcastRefund-ob1n2iB3.cjs"),e=require("../../../peginState-CBBJw4Za.cjs");exports.computeHashlock=a.computeHashlock;exports.validateSecretAgainstHashlock=a.validateSecretAgainstHashlock;exports.BIP68NotMatureError=t.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=t.ClaimerPegoutStatusValue;exports.REFUND_MAX_FEE_FRACTION_DENOMINATOR=t.REFUND_MAX_FEE_FRACTION_DENOMINATOR;exports.REFUND_MAX_FEE_FRACTION_NUMERATOR=t.REFUND_MAX_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_RATE_SATS_VB=t.REFUND_MAX_FEE_RATE_SATS_VB;exports.REFUND_VSIZE=t.REFUND_VSIZE;exports.RegisteredVaultVersionMismatchError=t.RegisteredVaultVersionMismatchError;exports.activateVault=t.activateVault;exports.buildAndBroadcastRefund=t.buildAndBroadcastRefund;exports.estimateRefundFeeSats=t.estimateRefundFeeSats;exports.isDepositAmountValid=t.isDepositAmountValid;exports.isPegoutTerminalStatus=t.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=t.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=t.isRegisteredVaultVersionMismatchError;exports.runDepositorPresignFlow=t.runDepositorPresignFlow;exports.signDepositorGraph=t.signDepositorGraph;exports.submitWotsPublicKey=t.submitWotsPublicKey;exports.validateDepositAmount=t.validateDepositAmount;exports.validateMultiVaultDepositInputs=t.validateMultiVaultDepositInputs;exports.validateOnChainParticipantKeys=t.validateOnChainParticipantKeys;exports.validateProviderSelection=t.validateProviderSelection;exports.validateRemainingCapacity=t.validateRemainingCapacity;exports.validateVaultAmounts=t.validateVaultAmounts;exports.validateVaultProviderPubkey=t.validateVaultProviderPubkey;exports.verifyRegisteredVaultVersions=t.verifyRegisteredVaultVersions;exports.waitForPeginStatus=t.waitForPeginStatus;exports.ContractStatus=e.ContractStatus;exports.PeginAction=e.PeginAction;exports.canPerformAction=e.canPerformAction;exports.getPeginProtocolState=e.getPeginProtocolState;exports.isActivationDeadlinePassedOnChain=e.isActivationDeadlinePassedOnChain;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
import { c as s, v as e } from "../../../PayoutManager-D26nGR-e.js";
|
|
2
|
-
import { B as o, C as r, p as
|
|
3
|
-
import { C as
|
|
2
|
+
import { B as o, C as r, p as n, q as u, t as l, u as d, R as c, a as R, n as g, o as A, i as E, m as P, l as m, j as v, r as p, b as V, s as _, v as F, g as S, h as D, d as N, c as C, e as M, f, k as h, w as O } from "../../../buildAndBroadcastRefund-Bmz9WJuN.js";
|
|
3
|
+
import { C as I, P as b, c as y, g as U, i as k } from "../../../peginState-BB81JI6I.js";
|
|
4
4
|
export {
|
|
5
5
|
o as BIP68NotMatureError,
|
|
6
6
|
r as ClaimerPegoutStatusValue,
|
|
7
|
-
|
|
7
|
+
I as ContractStatus,
|
|
8
8
|
b as PeginAction,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
n as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
|
|
10
|
+
u as REFUND_MAX_FEE_FRACTION_NUMERATOR,
|
|
11
11
|
l as REFUND_MAX_FEE_RATE_SATS_VB,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
d as REFUND_VSIZE,
|
|
13
|
+
c as RegisteredVaultVersionMismatchError,
|
|
14
14
|
R as activateVault,
|
|
15
15
|
g as buildAndBroadcastRefund,
|
|
16
16
|
y as canPerformAction,
|
|
17
17
|
s as computeHashlock,
|
|
18
|
-
|
|
18
|
+
A as estimateRefundFeeSats,
|
|
19
19
|
U as getPeginProtocolState,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
P as
|
|
23
|
-
|
|
24
|
-
v as
|
|
20
|
+
k as isActivationDeadlinePassedOnChain,
|
|
21
|
+
E as isDepositAmountValid,
|
|
22
|
+
P as isPegoutTerminalStatus,
|
|
23
|
+
m as isRecognizedPegoutStatus,
|
|
24
|
+
v as isRegisteredVaultVersionMismatchError,
|
|
25
|
+
p as runDepositorPresignFlow,
|
|
25
26
|
V as signDepositorGraph,
|
|
26
27
|
_ as submitWotsPublicKey,
|
|
27
28
|
F as validateDepositAmount,
|
|
28
29
|
S as validateMultiVaultDepositInputs,
|
|
29
30
|
D as validateOnChainParticipantKeys,
|
|
30
31
|
N as validateProviderSelection,
|
|
31
|
-
|
|
32
|
+
C as validateRemainingCapacity,
|
|
32
33
|
e as validateSecretAgainstHashlock,
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
M as validateVaultAmounts,
|
|
35
|
+
f as validateVaultProviderPubkey,
|
|
35
36
|
h as verifyRegisteredVaultVersions,
|
|
36
|
-
|
|
37
|
+
O as waitForPeginStatus
|
|
37
38
|
};
|
|
38
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../../signing-Bnsro0hE.cjs"),a=require("../../../validation-u8W7Lp2x.cjs"),e=require("../../../waitForTransactionReceiptSmartAware-U706oKTc.cjs"),t=require("../../../fundPeginTransaction-DuMwnytD.cjs"),E=require("../../../reservation-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../../signing-Bnsro0hE.cjs"),a=require("../../../validation-u8W7Lp2x.cjs"),e=require("../../../waitForTransactionReceiptSmartAware-U706oKTc.cjs"),t=require("../../../fundPeginTransaction-DuMwnytD.cjs"),E=require("../../../reservation-ClEs2X0H.cjs"),T=require("../../../bitcoin-CHfKAhcI.cjs");exports.createTaprootScriptPathSignOptions=_.createTaprootScriptPathSignOptions;exports.BITCOIN_ADDRESS_RE=a.BITCOIN_ADDRESS_RE;exports.HEX_RE=a.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=a.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=a.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=a.TXID_RE;exports.BitcoinScriptType=e.BitcoinScriptType;exports.applyChangeOutputPolicy=e.applyChangeOutputPolicy;exports.calculateBtcTxHash=e.calculateBtcTxHash;exports.computeChangeOutputFeeSats=e.computeChangeOutputFeeSats;exports.computeMaxDeposit=e.computeMaxDeposit;exports.computePeginBaseFeeSats=e.computePeginBaseFeeSats;exports.getDustThreshold=e.getDustThreshold;exports.getPsbtInputFields=e.getPsbtInputFields;exports.getScriptType=e.getScriptType;exports.selectUtxosForPegin=e.selectUtxosForPegin;exports.shouldAddChangeOutput=e.shouldAddChangeOutput;exports.waitForTransactionReceiptSmartAware=e.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=E.UtxoNotAvailableError;exports.assertUtxosAvailable=E.assertUtxosAvailable;exports.extractInputsFromTransaction=E.extractInputsFromTransaction;exports.findOverlappingPendingVaults=E.findOverlappingPendingVaults;exports.validateUtxosAvailable=E.validateUtxosAvailable;exports.getNetwork=T.getNetwork;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -2,7 +2,7 @@ import { c as t } from "../../../signing-DaLvGwQe.js";
|
|
|
2
2
|
import { B as E, H as T, K as _, M as o, T as r } from "../../../validation-CxqROCno.js";
|
|
3
3
|
import { B as S, a as A, f as i, c as n, b as c, d as R, g as u, i as I, h as F, s as O, e as P, w as U } from "../../../waitForTransactionReceiptSmartAware-Ckg_oZAo.js";
|
|
4
4
|
import { B as N, D as g, F as B, L as d, M as f, c as x, P as L, b as m, a as C, S as D, T as H, W as h, f as M, d as X, p as b, r as v } from "../../../fundPeginTransaction-96FxwYYJ.js";
|
|
5
|
-
import { U as G, a as W, e as w, f as y, v as V } from "../../../reservation-
|
|
5
|
+
import { U as G, a as W, e as w, f as y, v as V } from "../../../reservation-cHDRn4DA.js";
|
|
6
6
|
import { j as K } from "../../../bitcoin-B5aNKtsk.js";
|
|
7
7
|
export {
|
|
8
8
|
E as BITCOIN_ADDRESS_RE,
|
package/dist/tbv/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../challengeAssert-HNbugpqL.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),n=require("../verifyScriptPathSchnorrSignature-Cl7tu77P.cjs"),S=require("../peginInput-DH6X4ITS.cjs"),A=require("../noPayout-lyIRiUyG.cjs"),r=require("../bitcoin-CHfKAhcI.cjs"),R=require("../signing-Bnsro0hE.cjs"),c=require("../validation-u8W7Lp2x.cjs"),u=require("../PeginManager-BvxfSwsr.cjs"),p=require("../PayoutManager-BZVEyi10.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"),i=require("../mempoolApi-NMiYQAXI.cjs"),a=require("../primeVpAuth-CXzKktIW.cjs"),s=require("../types-WA0LrDk1.cjs"),g=require("../errors-Bu0H-dZD.cjs"),e=require("../buildAndBroadcastRefund-ob1n2iB3.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=i.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=i.ViemVaultRegistryReader;exports.getAddressTxs=i.getAddressTxs;exports.getAddressUtxos=i.getAddressUtxos;exports.getMempoolApiUrl=i.getMempoolApiUrl;exports.getNetworkFees=i.getNetworkFees;exports.getOutspend=i.getOutspend;exports.getTipHeight=i.getTipHeight;exports.getTxHex=i.getTxHex;exports.getTxInfo=i.getTxInfo;exports.getUtxoInfo=i.getUtxoInfo;exports.pushTx=i.pushTx;exports.validateOffchainParams=i.validateOffchainParams;exports.validatePegInConfiguration=i.validatePegInConfiguration;exports.validateTBVProtocolParams=i.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=a.OnChainBtcVaultStatus;exports.ServerIdentityError=a.ServerIdentityError;exports.VaultProviderRpcClient=a.VaultProviderRpcClient;exports.ViemProtocolParamsReader=a.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=a.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=a.ViemVaultKeeperReader;exports.VpResponseValidationError=a.VpResponseValidationError;exports.VpTokenRegistry=a.VpTokenRegistry;exports.batchPollByProvider=a.batchPollByProvider;exports.createAuthenticatedVpClient=a.createAuthenticatedVpClient;exports.primeVpTokenRegistry=a.primeVpTokenRegistry;exports.resolveProtocolAddresses=a.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=a.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=a.verifyServerIdentity;exports.vpTokenRegistry=a.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-HNbugpqL.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),n=require("../verifyScriptPathSchnorrSignature-Cl7tu77P.cjs"),S=require("../peginInput-DH6X4ITS.cjs"),A=require("../noPayout-lyIRiUyG.cjs"),r=require("../bitcoin-CHfKAhcI.cjs"),R=require("../signing-Bnsro0hE.cjs"),c=require("../validation-u8W7Lp2x.cjs"),u=require("../PeginManager-BvxfSwsr.cjs"),p=require("../PayoutManager-BZVEyi10.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"),P=require("../reservation-ClEs2X0H.cjs"),i=require("../mempoolApi-NMiYQAXI.cjs"),a=require("../primeVpAuth-yTddDmGy.cjs"),s=require("../types-WA0LrDk1.cjs"),g=require("../errors-Bu0H-dZD.cjs"),e=require("../buildAndBroadcastRefund-ob1n2iB3.cjs"),T=require("../peginState-CBBJw4Za.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=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=P.UtxoNotAvailableError;exports.assertUtxosAvailable=P.assertUtxosAvailable;exports.extractInputsFromTransaction=P.extractInputsFromTransaction;exports.findOverlappingPendingVaults=P.findOverlappingPendingVaults;exports.validateUtxosAvailable=P.validateUtxosAvailable;exports.MEMPOOL_API_URLS=i.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=i.ViemVaultRegistryReader;exports.getAddressTxs=i.getAddressTxs;exports.getAddressUtxos=i.getAddressUtxos;exports.getMempoolApiUrl=i.getMempoolApiUrl;exports.getNetworkFees=i.getNetworkFees;exports.getOutspend=i.getOutspend;exports.getTipHeight=i.getTipHeight;exports.getTxHex=i.getTxHex;exports.getTxInfo=i.getTxInfo;exports.getUtxoInfo=i.getUtxoInfo;exports.pushTx=i.pushTx;exports.validateOffchainParams=i.validateOffchainParams;exports.validatePegInConfiguration=i.validatePegInConfiguration;exports.validateTBVProtocolParams=i.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=a.OnChainBtcVaultStatus;exports.ServerIdentityError=a.ServerIdentityError;exports.VaultProviderRpcClient=a.VaultProviderRpcClient;exports.ViemProtocolParamsReader=a.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=a.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=a.ViemVaultKeeperReader;exports.VpResponseValidationError=a.VpResponseValidationError;exports.VpTokenRegistry=a.VpTokenRegistry;exports.batchPollByProvider=a.batchPollByProvider;exports.createAuthenticatedVpClient=a.createAuthenticatedVpClient;exports.primeVpTokenRegistry=a.primeVpTokenRegistry;exports.resolveProtocolAddresses=a.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=a.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=a.verifyServerIdentity;exports.vpTokenRegistry=a.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;exports.isActivationDeadlinePassedOnChain=T.isActivationDeadlinePassedOnChain;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|