@babylonlabs-io/ts-sdk 2.0.2 → 3.0.0
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/PeginManager-CKf7Bjmj.js.map +1 -1
- package/dist/PeginManager-Dt2Z5ljw.cjs.map +1 -1
- package/dist/buildAndBroadcastReclaim-BDc-SK9i.cjs +2 -0
- package/dist/buildAndBroadcastReclaim-BDc-SK9i.cjs.map +1 -0
- package/dist/{buildAndBroadcastReclaim-B19cyK69.js → buildAndBroadcastReclaim-T5ZFPUpM.js} +284 -301
- package/dist/buildAndBroadcastReclaim-T5ZFPUpM.js.map +1 -0
- package/dist/{index-Bnavi_r3.js → index-B6w5MM-8.js} +91 -84
- package/dist/index-B6w5MM-8.js.map +1 -0
- package/dist/index-EHLYplSd.cjs +2 -0
- package/dist/index-EHLYplSd.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +90 -90
- package/dist/{primeVpAuth-PiUJksAq.js → primeVpAuth-Bdy_B_Sq.js} +3 -3
- package/dist/{primeVpAuth-PiUJksAq.js.map → primeVpAuth-Bdy_B_Sq.js.map} +1 -1
- package/dist/primeVpAuth-CQRsu6VB.cjs +2 -0
- package/dist/{primeVpAuth-D21PXgg2.cjs.map → primeVpAuth-CQRsu6VB.cjs.map} +1 -1
- package/dist/{json-rpc-client-DbpFfa_o.cjs → state-DMFlvLL3.cjs} +2 -2
- package/dist/state-DMFlvLL3.cjs.map +1 -0
- package/dist/{json-rpc-client-CQLbpuKK.js → state-mE-QfITd.js} +76 -55
- package/dist/state-mE-QfITd.js.map +1 -0
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +3 -3
- package/dist/tbv/core/clients/vault-provider/api.d.ts +2 -1
- package/dist/tbv/core/clients/vault-provider/api.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/status/index.cjs +1 -1
- package/dist/tbv/core/clients/vault-provider/status/index.js +2 -2
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +104 -104
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +75 -74
- package/dist/tbv/core/services/index.js.map +1 -1
- package/dist/tbv/core/services/pegout/state.d.ts +8 -3
- package/dist/tbv/core/services/pegout/state.d.ts.map +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +104 -104
- package/package.json +1 -1
- package/dist/buildAndBroadcastReclaim-B19cyK69.js.map +0 -1
- package/dist/buildAndBroadcastReclaim-DcbsjJdf.cjs +0 -2
- package/dist/buildAndBroadcastReclaim-DcbsjJdf.cjs.map +0 -1
- package/dist/index-Bnavi_r3.js.map +0 -1
- package/dist/index-CcdCNFLM.cjs +0 -2
- package/dist/index-CcdCNFLM.cjs.map +0 -1
- package/dist/json-rpc-client-CQLbpuKK.js.map +0 -1
- package/dist/json-rpc-client-DbpFfa_o.cjs.map +0 -1
- package/dist/primeVpAuth-D21PXgg2.cjs +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-EHLYplSd.cjs","sources":["../src/tbv/core/clients/vault-provider/validators.ts","../src/tbv/core/clients/vault-provider/api.ts","../src/tbv/core/clients/vault-provider/batchAttribution.ts","../src/tbv/core/clients/vault-provider/batchPoll.ts"],"sourcesContent":["/**\n * Runtime validation for vault provider RPC responses.\n *\n * All VP RPC methods return untyped JSON that TypeScript generics cast without\n * inspection. These validators check the critical top-level fields and\n * security-relevant values (status, txids, pubkeys). Optional progress\n * sub-fields (gc_data, ack_collection, claimer_graphs) are NOT validated\n * since they are informational and not used for signing or transaction\n * construction. Only `progress.presigning` sub-fields are checked.\n */\n\nimport { CHALLENGE_ASSERT_CONNECTORS_PER_CHALLENGER } from \"../../primitives/psbt/constants\";\nimport {\n COMPRESSED_PUBKEY_HEX_LEN,\n HEX_RE,\n X_ONLY_PUBKEY_HEX_LEN,\n} from \"../../utils/validation\";\n\nimport type {\n BatchGetPeginStatusResponse,\n BatchGetPegoutStatusResponse,\n GetPeginStatusResponse,\n GetPegoutStatusResponse,\n RequestDepositorClaimerArtifactsResponse,\n RequestDepositorPresignTransactionsResponse,\n} from \"./types\";\nimport { DaemonStatus } from \"./types\";\n\nconst DAEMON_STATUS_VALUES = new Set<string>(Object.values(DaemonStatus));\n\nconst VP_ERROR_PREVIEW_MAX_LEN = 200;\n\nfunction preview(value: unknown): string {\n return (\n JSON.stringify(value)?.slice(0, VP_ERROR_PREVIEW_MAX_LEN) ?? \"undefined\"\n );\n}\n\nconst UNRECOGNIZED_STATUS_ERROR_PREFIX =\n \"VP response validation failed: unrecognized status\";\n\n/**\n * Whether a batch status entry's `error` reports a pegin status outside\n * {@link DaemonStatus}. The batch validator moves such an entry to its\n * `error` slot, so one unknown status does not fail the whole reply.\n */\nexport function isUnrecognizedDaemonStatusError(error: string): boolean {\n return error.startsWith(UNRECOGNIZED_STATUS_ERROR_PREFIX);\n}\n\nconst VP_VALIDATION_USER_MESSAGE =\n \"The vault provider returned an unexpected response. Please try again or contact support.\";\n\n/**\n * Thrown when a VP RPC response fails runtime validation.\n *\n * `.message` is a user-facing string safe to display in the UI.\n * `.detail` contains the technical reason, suitable for logging.\n */\nexport class VpResponseValidationError extends Error {\n readonly detail: string;\n\n constructor(detail: string) {\n super(VP_VALIDATION_USER_MESSAGE);\n this.name = \"VpResponseValidationError\";\n this.detail = detail;\n }\n}\n\n/** Expected length (in hex chars) of a Bitcoin transaction ID (32 bytes). */\nconst TXID_HEX_LEN = 64;\n\n/** Expected length (in hex chars) of a GC output label hash (SHA-256). */\nconst LABEL_HASH_HEX_LEN = 64;\n\nfunction isNonEmptyHex(value: unknown): value is string {\n return typeof value === \"string\" && value.length > 0 && HEX_RE.test(value);\n}\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === \"string\" && value.length > 0;\n}\n\nfunction assertNonEmptyHex(value: unknown, field: string): void {\n if (!isNonEmptyHex(value)) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${field}\" must be a non-empty hex string, got ${preview(value)}`,\n );\n }\n}\n\nfunction assertNonEmptyString(value: unknown, field: string): void {\n if (!isNonEmptyString(value)) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${field}\" must be a non-empty string, got ${preview(value)}`,\n );\n }\n}\n\n/**\n * Accept both x-only (64-char) and compressed (66-char) pubkeys from VP responses.\n * The signing code normalizes to x-only via processPublicKeyToXOnly().\n */\nfunction assertBtcPubkey(value: unknown, field: string): void {\n if (\n !isNonEmptyHex(value) ||\n (value.length !== X_ONLY_PUBKEY_HEX_LEN &&\n value.length !== COMPRESSED_PUBKEY_HEX_LEN)\n ) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${field}\" must be a ${X_ONLY_PUBKEY_HEX_LEN} or ${COMPRESSED_PUBKEY_HEX_LEN}-char hex string (BTC pubkey), got ${preview(value)}`,\n );\n }\n}\n\n/**\n * Validate the optional presigning progress fields returned inside PeginProgressDetails.\n */\nfunction validatePresigningProgressFields(\n progress: Record<string, unknown>,\n): void {\n const presigning = progress.presigning;\n if (presigning === undefined || presigning === null) return;\n if (typeof presigning !== \"object\" || Array.isArray(presigning)) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"progress.presigning\" must be an object if present`,\n );\n }\n\n const p = presigning as Record<string, unknown>;\n\n if (\n p.depositor_graph_created !== undefined &&\n typeof p.depositor_graph_created !== \"boolean\"\n ) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"progress.presigning.depositor_graph_created\" must be a boolean if present, got ${preview(p.depositor_graph_created)}`,\n );\n }\n\n if (\n p.vk_challenger_presigning_completed !== undefined &&\n typeof p.vk_challenger_presigning_completed !== \"number\"\n ) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"progress.presigning.vk_challenger_presigning_completed\" must be a number if present, got ${preview(p.vk_challenger_presigning_completed)}`,\n );\n }\n\n if (\n p.vk_challenger_presigning_total !== undefined &&\n typeof p.vk_challenger_presigning_total !== \"number\"\n ) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"progress.presigning.vk_challenger_presigning_total\" must be a number if present, got ${preview(p.vk_challenger_presigning_total)}`,\n );\n }\n}\n\n/**\n * Validate a getPeginStatus response.\n *\n * Throws if the status field is not a recognized DaemonStatus value.\n */\nexport function validateGetPeginStatusResponse(\n response: unknown,\n): asserts response is GetPeginStatusResponse {\n if (response === null || typeof response !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: getPeginStatus response is not an object`,\n );\n }\n\n const r = response as Record<string, unknown>;\n\n if (!isNonEmptyHex(r.pegin_txid) || r.pegin_txid.length !== TXID_HEX_LEN) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"pegin_txid\" must be a ${TXID_HEX_LEN}-char hex string (txid), got ${preview(r.pegin_txid)}`,\n );\n }\n\n if (typeof r.status !== \"string\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"status\" must be a string`,\n );\n }\n\n if (!DAEMON_STATUS_VALUES.has(r.status)) {\n throw new VpResponseValidationError(\n `${UNRECOGNIZED_STATUS_ERROR_PREFIX} ${preview(r.status)}. Expected one of: ${[...DAEMON_STATUS_VALUES].join(\", \")}`,\n );\n }\n\n if (\n r.progress === null ||\n typeof r.progress !== \"object\" ||\n Array.isArray(r.progress)\n ) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"progress\" must be an object`,\n );\n }\n\n validatePresigningProgressFields(r.progress as Record<string, unknown>);\n\n if (typeof r.health_info !== \"string\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"health_info\" must be a string`,\n );\n }\n\n if (r.last_error !== undefined && typeof r.last_error !== \"string\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"last_error\" must be a string if present, got ${preview(r.last_error)}`,\n );\n }\n}\n\n/**\n * Validate a requestDepositorPresignTransactions response.\n */\nexport function validateRequestDepositorPresignTransactionsResponse(\n response: unknown,\n): asserts response is RequestDepositorPresignTransactionsResponse {\n if (response === null || typeof response !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: requestDepositorPresignTransactions response is not an object`,\n );\n }\n\n const r = response as Record<string, unknown>;\n\n if (!Array.isArray(r.txs)) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"txs\" must be an array`,\n );\n }\n\n for (let i = 0; i < r.txs.length; i++) {\n validateClaimerTransactions(r.txs[i], `txs[${i}]`);\n }\n\n if (r.depositor_graph === null || typeof r.depositor_graph !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"depositor_graph\" must be an object`,\n );\n }\n\n validateDepositorGraphTransactions(\n r.depositor_graph as Record<string, unknown>,\n );\n}\n\nfunction validateTransactionData(value: unknown, field: string): void {\n if (value === null || typeof value !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${field}\" must be an object`,\n );\n }\n const tx = value as Record<string, unknown>;\n assertNonEmptyHex(tx.tx_hex, `${field}.tx_hex`);\n}\n\nfunction validateClaimerTransactions(value: unknown, field: string): void {\n if (value === null || typeof value !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${field}\" must be an object`,\n );\n }\n\n const tx = value as Record<string, unknown>;\n\n assertBtcPubkey(tx.claimer_pubkey, `${field}.claimer_pubkey`);\n validateTransactionData(tx.claim_tx, `${field}.claim_tx`);\n validateTransactionData(tx.assert_tx, `${field}.assert_tx`);\n validateTransactionData(tx.payout_tx, `${field}.payout_tx`);\n assertNonEmptyString(tx.payout_psbt, `${field}.payout_psbt`);\n}\n\nfunction validateChallengeAssertConnectorData(\n value: unknown,\n field: string,\n): void {\n if (value === null || typeof value !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${field}\" must be an object`,\n );\n }\n\n const c = value as Record<string, unknown>;\n assertNonEmptyString(c.wots_pks_json, `${field}.wots_pks_json`);\n assertNonEmptyString(c.gc_wots_keys_json, `${field}.gc_wots_keys_json`);\n}\n\nfunction validatePresignDataPerChallenger(value: unknown, field: string): void {\n if (value === null || typeof value !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${field}\" must be an object`,\n );\n }\n\n const d = value as Record<string, unknown>;\n\n assertBtcPubkey(d.challenger_pubkey, `${field}.challenger_pubkey`);\n validateTransactionData(\n d.challenge_assert_x_tx,\n `${field}.challenge_assert_x_tx`,\n );\n validateTransactionData(\n d.challenge_assert_y_tx,\n `${field}.challenge_assert_y_tx`,\n );\n validateTransactionData(d.nopayout_tx, `${field}.nopayout_tx`);\n assertNonEmptyString(d.nopayout_psbt, `${field}.nopayout_psbt`);\n\n if (!Array.isArray(d.challenge_assert_connectors)) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${field}.challenge_assert_connectors\" must be an array`,\n );\n }\n\n if (\n d.challenge_assert_connectors.length !==\n CHALLENGE_ASSERT_CONNECTORS_PER_CHALLENGER\n ) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${field}.challenge_assert_connectors\" must have exactly ${CHALLENGE_ASSERT_CONNECTORS_PER_CHALLENGER} entries, got ${d.challenge_assert_connectors.length}`,\n );\n }\n\n for (let i = 0; i < d.challenge_assert_connectors.length; i++) {\n validateChallengeAssertConnectorData(\n d.challenge_assert_connectors[i],\n `${field}.challenge_assert_connectors[${i}]`,\n );\n }\n\n if (!Array.isArray(d.output_label_hashes)) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${field}.output_label_hashes\" must be an array`,\n );\n }\n\n // Each entry is a SHA-256 digest. The presign fingerprint hashes these\n // unframed, so a wrong length must fail here, before any signing prompt.\n for (let i = 0; i < d.output_label_hashes.length; i++) {\n const hash: unknown = d.output_label_hashes[i];\n if (!isNonEmptyHex(hash) || hash.length !== LABEL_HASH_HEX_LEN) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${field}.output_label_hashes[${i}]\" must be a ${LABEL_HASH_HEX_LEN}-char hex string, got ${preview(hash)}`,\n );\n }\n }\n}\n\n/**\n * Validate a requestDepositorClaimerArtifacts response.\n */\nexport function validateRequestDepositorClaimerArtifactsResponse(\n response: unknown,\n): asserts response is RequestDepositorClaimerArtifactsResponse {\n if (response === null || typeof response !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: requestDepositorClaimerArtifacts response is not an object`,\n );\n }\n\n const r = response as Record<string, unknown>;\n\n if (!isNonEmptyString(r.tx_graph_json)) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"tx_graph_json\" must be a non-empty string, got ${preview(r.tx_graph_json)}`,\n );\n }\n\n if (!isNonEmptyHex(r.verifying_key_hex)) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"verifying_key_hex\" must be a non-empty hex string, got ${preview(r.verifying_key_hex)}`,\n );\n }\n\n if (\n r.babe_sessions === null ||\n typeof r.babe_sessions !== \"object\" ||\n Array.isArray(r.babe_sessions)\n ) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"babe_sessions\" must be an object`,\n );\n }\n\n const sessionEntries = Object.entries(\n r.babe_sessions as Record<string, unknown>,\n );\n if (sessionEntries.length === 0) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"babe_sessions\" must contain at least one challenger entry`,\n );\n }\n\n for (const [key, session] of sessionEntries) {\n assertBtcPubkey(key, `babe_sessions[\"${key}\"]`);\n if (session === null || typeof session !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"babe_sessions.${key}\" must be an object`,\n );\n }\n const s = session as Record<string, unknown>;\n if (!isNonEmptyHex(s.decryptor_artifacts_hex)) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"babe_sessions.${key}.decryptor_artifacts_hex\" must be a non-empty hex string, got ${preview(s.decryptor_artifacts_hex)}`,\n );\n }\n }\n}\n\n/**\n * Validate a single pegout status payload. Embedded by\n * `validateBatchGetPegoutStatusResponse`. Mirrors btc-vault\n * `crates/vaultd/src/rpc/server/pegout_status.rs::GetPegoutStatusResponse`.\n */\nexport function validateGetPegoutStatusResponse(\n response: unknown,\n): asserts response is GetPegoutStatusResponse {\n if (response === null || typeof response !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: pegout status payload is not an object`,\n );\n }\n\n const r = response as Record<string, unknown>;\n\n if (!isNonEmptyHex(r.pegin_txid) || r.pegin_txid.length !== TXID_HEX_LEN) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"pegin_txid\" must be a ${TXID_HEX_LEN}-char hex string (txid), got ${preview(r.pegin_txid)}`,\n );\n }\n\n if (typeof r.found !== \"boolean\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"found\" must be a boolean, got ${preview(r.found)}`,\n );\n }\n\n // `claimer` is `Option<ClaimerPegoutStatus>` server-side; null when absent.\n if (r.claimer !== null) {\n if (typeof r.claimer !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"claimer\" must be an object or null, got ${preview(r.claimer)}`,\n );\n }\n validateClaimerPegoutStatus(r.claimer as Record<string, unknown>);\n }\n\n // `challengers: Vec<ChallengerStatus>` server-side; always present (possibly empty).\n if (!Array.isArray(r.challengers)) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"challengers\" must be an array, got ${preview(r.challengers)}`,\n );\n }\n for (let i = 0; i < r.challengers.length; i++) {\n validateChallengerStatus(r.challengers[i], i);\n }\n}\n\nfunction validateClaimerPegoutStatus(value: Record<string, unknown>): void {\n assertNonEmptyString(value.status, \"claimer.status\");\n if (typeof value.failed !== \"boolean\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"claimer.failed\" must be a boolean, got ${preview(value.failed)}`,\n );\n }\n assertNonEmptyString(value.claim_txid, \"claimer.claim_txid\");\n assertNonEmptyString(value.claimer_pubkey, \"claimer.claimer_pubkey\");\n assertNonEmptyString(value.assert_txid, \"claimer.assert_txid\");\n if (typeof value.created_at !== \"number\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"claimer.created_at\" must be a number, got ${preview(value.created_at)}`,\n );\n }\n if (typeof value.updated_at !== \"number\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"claimer.updated_at\" must be a number, got ${preview(value.updated_at)}`,\n );\n }\n}\n\nfunction validateChallengerStatus(value: unknown, index: number): void {\n if (value === null || typeof value !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"challengers[${index}]\" must be an object, got ${preview(value)}`,\n );\n }\n const c = value as Record<string, unknown>;\n assertNonEmptyString(c.status, `challengers[${index}].status`);\n assertNonEmptyString(c.claim_txid, `challengers[${index}].claim_txid`);\n assertNonEmptyString(c.claimer_pubkey, `challengers[${index}].claimer_pubkey`);\n assertNullableString(c.assert_txid, `challengers[${index}].assert_txid`);\n assertNullableString(\n c.challenge_assert_x_txid,\n `challengers[${index}].challenge_assert_x_txid`,\n );\n assertNullableString(\n c.challenge_assert_y_txid,\n `challengers[${index}].challenge_assert_y_txid`,\n );\n assertNullableString(c.nopayout_txid, `challengers[${index}].nopayout_txid`);\n if (typeof c.created_at !== \"number\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"challengers[${index}].created_at\" must be a number, got ${preview(c.created_at)}`,\n );\n }\n if (typeof c.updated_at !== \"number\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"challengers[${index}].updated_at\" must be a number, got ${preview(c.updated_at)}`,\n );\n }\n}\n\nfunction assertNullableString(value: unknown, field: string): void {\n if (value !== null && typeof value !== \"string\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${field}\" must be a string or null, got ${preview(value)}`,\n );\n }\n}\n\n/**\n * Validate a `batchGetPeginStatus` response. Per-result envelope shape:\n * `{ pegin_txid, result: GetPeginStatusResponse | null, error: string | null }`.\n * The inner result (when non-null) is validated via the single-item validator.\n * An entry whose inner result fails validation is replaced by an error entry;\n * the other entries are kept.\n */\nexport function validateBatchGetPeginStatusResponse(\n response: unknown,\n): asserts response is BatchGetPeginStatusResponse {\n validateBatchEnvelope(response, \"batchGetPeginStatus\", (entry) => {\n if (entry.result !== null) {\n validateGetPeginStatusResponse(entry.result);\n }\n });\n}\n\n/** Validate a `batchGetPegoutStatus` response. Same envelope as peginStatus. */\nexport function validateBatchGetPegoutStatusResponse(\n response: unknown,\n): asserts response is BatchGetPegoutStatusResponse {\n validateBatchEnvelope(response, \"batchGetPegoutStatus\", (entry) => {\n if (entry.result !== null) {\n validateGetPegoutStatusResponse(entry.result);\n }\n });\n}\n\ninterface BatchResultEnvelope {\n pegin_txid: string;\n result: unknown;\n error: string | null;\n}\n\nfunction validateBatchEnvelope(\n response: unknown,\n rpcName: string,\n validateInnerResult: (entry: BatchResultEnvelope, index: number) => void,\n): void {\n if (response === null || typeof response !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: ${rpcName} response is not an object`,\n );\n }\n const r = response as Record<string, unknown>;\n if (!Array.isArray(r.results)) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${rpcName}.results\" must be an array, got ${preview(r.results)}`,\n );\n }\n for (let i = 0; i < r.results.length; i++) {\n const entry = r.results[i];\n if (entry === null || typeof entry !== \"object\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${rpcName}.results[${i}]\" must be an object, got ${preview(entry)}`,\n );\n }\n const e = entry as Record<string, unknown>;\n if (\n !isNonEmptyHex(e.pegin_txid) ||\n e.pegin_txid.length !== TXID_HEX_LEN\n ) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${rpcName}.results[${i}].pegin_txid\" must be a ${TXID_HEX_LEN}-char hex string, got ${preview(e.pegin_txid)}`,\n );\n }\n if (e.error !== null && typeof e.error !== \"string\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${rpcName}.results[${i}].error\" must be a string or null, got ${preview(e.error)}`,\n );\n }\n // Exactly one of `result` / `error` must be populated. The server only\n // ever sets one per item; treating both-null as a protocol violation\n // surfaces server bugs early instead of letting them silently degrade.\n if (e.result === null && e.error === null) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${rpcName}.results[${i}]\" has neither \"result\" nor \"error\" populated`,\n );\n }\n if (e.result !== null && e.error !== null) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"${rpcName}.results[${i}]\" has both \"result\" and \"error\" populated`,\n );\n }\n // Isolate a bad inner result to its own entry, so one malformed or\n // unknown-status entry does not void the status of its siblings.\n try {\n validateInnerResult(e as unknown as BatchResultEnvelope, i);\n } catch (error) {\n if (!(error instanceof VpResponseValidationError)) throw error;\n r.results[i] = {\n pegin_txid: e.pegin_txid,\n result: null,\n error: error.detail,\n };\n }\n }\n}\n\nfunction validateDepositorGraphTransactions(\n graph: Record<string, unknown>,\n): void {\n validateTransactionData(graph.claim_tx, \"depositor_graph.claim_tx\");\n validateTransactionData(graph.assert_tx, \"depositor_graph.assert_tx\");\n validateTransactionData(graph.payout_tx, \"depositor_graph.payout_tx\");\n assertNonEmptyString(graph.payout_psbt, \"depositor_graph.payout_psbt\");\n\n if (!Array.isArray(graph.challenger_presign_data)) {\n throw new VpResponseValidationError(\n `VP response validation failed: \"depositor_graph.challenger_presign_data\" must be an array`,\n );\n }\n\n for (let i = 0; i < graph.challenger_presign_data.length; i++) {\n validatePresignDataPerChallenger(\n graph.challenger_presign_data[i],\n `depositor_graph.challenger_presign_data[${i}]`,\n );\n }\n\n if (typeof graph.offchain_params_version !== \"number\") {\n throw new VpResponseValidationError(\n `VP response validation failed: \"depositor_graph.offchain_params_version\" must be a number`,\n );\n }\n}\n","/**\n * JSON-RPC client for the Vault Provider API.\n *\n * Wraps {@link JsonRpcClient} with typed methods matching the\n * `vaultProvider_*` RPC namespace defined in the btc-vault pegin spec.\n *\n * Implements the narrow service interfaces (PeginStatusReader, WotsKeySubmitter,\n * PresignClient, ClaimerArtifactsReader) so it can be passed directly to\n * any deposit protocol service function.\n *\n * @see https://github.com/babylonlabs-io/btc-vault/blob/main/docs/pegin.md\n */\n\nimport type { PeginStatusReader, WotsKeySubmitter, PresignClient, ClaimerArtifactsReader } from \"../../services/deposit/interfaces\";\nimport { normalizeClaimerPegoutStatus } from \"../../services/pegout/state\";\n\nimport {\n type BearerTokenProvider,\n JsonRpcClient,\n type JsonRpcClientConfig,\n} from \"./json-rpc-client\";\nimport type {\n BatchGetPeginStatusParams,\n BatchGetPeginStatusResponse,\n BatchGetPegoutStatusParams,\n BatchGetPegoutStatusResponse,\n GetPeginStatusParams,\n GetPeginStatusResponse,\n RequestDepositorClaimerArtifactsParams,\n RequestDepositorClaimerArtifactsResponse,\n RequestDepositorPresignTransactionsParams,\n RequestDepositorPresignTransactionsResponse,\n SubmitDepositorPresignaturesParams,\n SubmitDepositorWotsKeyParams,\n} from \"./types\";\nimport {\n validateBatchGetPeginStatusResponse,\n validateBatchGetPegoutStatusResponse,\n validateGetPeginStatusResponse,\n validateRequestDepositorClaimerArtifactsResponse,\n validateRequestDepositorPresignTransactionsResponse,\n} from \"./validators\";\n\nexport interface VaultProviderRpcClientOptions {\n /** Timeout in milliseconds per request (default: 60000) */\n timeout?: number;\n /** Number of retry attempts for safe methods (default: 3) */\n retries?: number;\n /** Initial retry delay in milliseconds (default: 1000) */\n retryDelay?: number;\n /**\n * Custom retry predicate. Default retries only the idempotent read\n * methods: `getPeginStatus`, `batchGetPeginStatus`, `batchGetPegoutStatus`,\n * `requestDepositorPresignTransactions`.\n */\n retryableFor?: (method: string) => boolean;\n /** Custom headers. */\n headers?: Record<string, string>;\n /**\n * Per-request bearer-token source. A non-null return attaches\n * `Authorization: Bearer <token>`; `null` skips auth. Wire a\n * {@link VpTokenProvider} for depositor-gated methods.\n */\n tokenProvider?: BearerTokenProvider;\n /** Maximum response body size, in bytes, for typed JSON-RPC calls */\n maxResponseBytes?: number;\n}\n\nconst DEFAULT_TIMEOUT_MS = 60_000;\n\n/**\n * Concrete VP RPC client implementing all service interfaces.\n *\n * Usage:\n * ```ts\n * const client = new VaultProviderRpcClient(\"https://vp.example.com/rpc\");\n * const status = await client.getPeginStatus({ pegin_txid: \"abc...\" });\n * ```\n */\nexport class VaultProviderRpcClient\n implements PeginStatusReader, WotsKeySubmitter, PresignClient, ClaimerArtifactsReader\n{\n private client: JsonRpcClient;\n\n constructor(baseUrl: string, options?: VaultProviderRpcClientOptions) {\n const config: JsonRpcClientConfig = {\n baseUrl,\n timeout: options?.timeout ?? DEFAULT_TIMEOUT_MS,\n retries: options?.retries,\n retryDelay: options?.retryDelay,\n retryableFor: options?.retryableFor,\n headers: options?.headers,\n tokenProvider: options?.tokenProvider,\n maxResponseBytes: options?.maxResponseBytes,\n };\n this.client = new JsonRpcClient(config);\n }\n\n /**\n * Request the payout/claim/assert transactions that the depositor\n * needs to pre-sign before the vault can be activated on Bitcoin.\n */\n async requestDepositorPresignTransactions(\n params: RequestDepositorPresignTransactionsParams,\n signal?: AbortSignal,\n ): Promise<RequestDepositorPresignTransactionsResponse> {\n const response = await this.client.call<\n RequestDepositorPresignTransactionsParams,\n unknown\n >(\"vaultProvider_requestDepositorPresignTransactions\", params, signal);\n validateRequestDepositorPresignTransactionsResponse(response);\n return response;\n }\n\n /**\n * Submit the depositor's pre-signatures for the payout transactions\n * and the depositor-as-claimer graph.\n */\n async submitDepositorPresignatures(\n params: SubmitDepositorPresignaturesParams,\n signal?: AbortSignal,\n ): Promise<void> {\n return this.client.call<SubmitDepositorPresignaturesParams, void>(\n \"vaultProvider_submitDepositorPresignatures\",\n params,\n signal,\n );\n }\n\n /**\n * Submit the depositor's WOTS public key to the vault provider.\n * Called after the pegin is finalized on Ethereum, when the VP is in\n * `PendingDepositorWotsPK` status.\n */\n async submitDepositorWotsKey(\n params: SubmitDepositorWotsKeyParams,\n signal?: AbortSignal,\n ): Promise<void> {\n return this.client.call<SubmitDepositorWotsKeyParams, void>(\n \"vaultProvider_submitDepositorWotsKey\",\n params,\n signal,\n );\n }\n\n /**\n * Request the BaBe DecryptorArtifacts needed for the depositor to\n * independently evaluate garbled circuits during a challenge.\n */\n async requestDepositorClaimerArtifacts(\n params: RequestDepositorClaimerArtifactsParams,\n signal?: AbortSignal,\n ): Promise<RequestDepositorClaimerArtifactsResponse> {\n const response = await this.client.call<\n RequestDepositorClaimerArtifactsParams,\n unknown\n >(\"vaultProvider_requestDepositorClaimerArtifacts\", params, signal);\n validateRequestDepositorClaimerArtifactsResponse(response);\n return response;\n }\n\n /** Get the current pegin status from the vault provider daemon. */\n async getPeginStatus(\n params: GetPeginStatusParams,\n signal?: AbortSignal,\n ): Promise<GetPeginStatusResponse> {\n const response = await this.client.call<GetPeginStatusParams, unknown>(\n \"vaultProvider_getPeginStatus\",\n params,\n signal,\n );\n validateGetPeginStatusResponse(response);\n return response;\n }\n\n /**\n * Get pegin status for many txids in one round trip. Per-result envelope\n * isolates per-pegin failures from the overall RPC. Caller must chunk\n * inputs at `VP_BATCH_MAX_SIZE`.\n */\n async batchGetPeginStatus(\n params: BatchGetPeginStatusParams,\n signal?: AbortSignal,\n ): Promise<BatchGetPeginStatusResponse> {\n const response = await this.client.call<\n BatchGetPeginStatusParams,\n unknown\n >(\"vaultProvider_batchGetPeginStatus\", params, signal);\n validateBatchGetPeginStatusResponse(response);\n return response;\n }\n\n /**\n * Get pegout status for many txids in one round trip. Same per-result\n * envelope semantics as `batchGetPeginStatus`. A legacy claimer status\n * from an older daemon is replaced with its current name.\n */\n async batchGetPegoutStatus(\n params: BatchGetPegoutStatusParams,\n signal?: AbortSignal,\n ): Promise<BatchGetPegoutStatusResponse> {\n const response = await this.client.call<\n BatchGetPegoutStatusParams,\n unknown\n >(\"vaultProvider_batchGetPegoutStatus\", params, signal);\n validateBatchGetPegoutStatusResponse(response);\n for (const entry of response.results) {\n const claimer = entry.result?.claimer;\n if (claimer) claimer.status = normalizeClaimerPegoutStatus(claimer.status);\n }\n return response;\n }\n}\n","/**\n * Defensive helper for attributing per-item results in a VP batch RPC\n * response back to the requested txids. The server promises 1:1 ordered\n * results, but we don't trust that promise — a server bug could duplicate,\n * skip, or scramble items, and silent attribution-by-array-index would\n * mask the bug.\n *\n * Lowercases all txids on both sides to absorb case mismatch (the FE\n * strips `0x` but doesn't otherwise normalize).\n *\n * @module tbv/core/clients/vault-provider/batchAttribution\n */\n\n/** Per-item entry in a VP batch response. */\nexport interface BatchResultEntry<T> {\n pegin_txid: string;\n result: T | null;\n error: string | null;\n}\n\n/** Output of {@link attributeBatchResults}. */\nexport interface BatchAttributionResult<T> {\n /** Lowercase requested txid -> per-item envelope. */\n byTxid: Map<string, { result: T | null; error: string | null }>;\n /** Requested txids that did not appear in the response. */\n missing: string[];\n /** Echoed txids that were not in the request — logged + dropped. */\n unexpected: string[];\n /** Echoed txids that appeared more than once — first kept, rest dropped. */\n duplicate: string[];\n}\n\n/**\n * Attribute batch results to requested txids defensively.\n *\n * Both `requestedTxids` and the echoed `pegin_txid` field on each result\n * are lowercased before lookup. Duplicates and unexpected echoes are\n * surfaced so callers can flag the affected items as errored rather than\n * silently overwriting state.\n *\n * `requestedTxids` may contain duplicates; they are de-duplicated for the\n * purposes of map keys (each unique txid becomes a single map entry).\n */\nexport function attributeBatchResults<T>(\n requestedTxids: string[],\n results: ReadonlyArray<BatchResultEntry<T>>,\n): BatchAttributionResult<T> {\n const requestedSet = new Set<string>();\n for (const txid of requestedTxids) {\n requestedSet.add(txid.toLowerCase());\n }\n\n const byTxid = new Map<\n string,\n { result: T | null; error: string | null }\n >();\n const seen = new Set<string>();\n const duplicate: string[] = [];\n const unexpected: string[] = [];\n\n for (const entry of results) {\n const lower = entry.pegin_txid.toLowerCase();\n if (!requestedSet.has(lower)) {\n unexpected.push(lower);\n continue;\n }\n if (seen.has(lower)) {\n duplicate.push(lower);\n continue;\n }\n seen.add(lower);\n byTxid.set(lower, { result: entry.result, error: entry.error });\n }\n\n const missing: string[] = [];\n for (const txid of requestedSet) {\n if (!seen.has(txid)) missing.push(txid);\n }\n\n return { byTxid, missing, unexpected, duplicate };\n}\n","/**\n * Generic chunk + attribute + dispatch loop for VP batch RPCs.\n *\n * Wraps {@link attributeBatchResults} with chunking and per-callback\n * dispatch so the FE polling hooks (and any future SDK consumer) only\n * have to declare per-item handlers — chunking by `VP_BATCH_MAX_SIZE`,\n * lowercase txid normalization, missing/duplicate/unexpected\n * surfacing, and the duplicate-skip invariant in the byTxid loop are\n * all owned here.\n *\n * @module tbv/core/clients/vault-provider/batchPoll\n */\n\nimport {\n attributeBatchResults,\n type BatchResultEntry,\n} from \"./batchAttribution\";\nimport { VP_BATCH_MAX_SIZE } from \"./types\";\n\nexport interface BatchPollByProviderOptions<TItem, TResult> {\n /** Items to poll for this provider, e.g. `DepositToPoll[]`. */\n items: TItem[];\n /** Extract the canonical txid for each item. Helper lowercases it. */\n getTxid: (item: TItem) => string;\n /**\n * Per-chunk RPC call. Receives lowercased txids; returns the batch\n * envelope. Caller wraps `rpcClient.batchGet*Status({ pegin_txids })`.\n */\n batchCall: (\n txids: string[],\n ) => Promise<{ results: ReadonlyArray<BatchResultEntry<TResult>> }>;\n /**\n * Handle a per-item envelope. Exactly one of `result` / `error` is\n * populated (validator invariant). Caller decides UI state, logging,\n * etc. Not invoked for txids surfaced via {@link onDuplicate}.\n *\n * Note: `envelope.pegin_txid` is the lowercased txid the helper\n * sent in the request, not whatever case/encoding the server echoed.\n */\n onItem: (item: TItem, envelope: BatchResultEntry<TResult>) => void;\n /** Server omitted this item from the response. */\n onMissing: (item: TItem) => void;\n /** Server returned this item more than once. Caller picks UI state. */\n onDuplicate: (item: TItem) => void;\n /**\n * Optional aggregate signal for an entire chunk where the server\n * returned duplicates. Fires once per chunk (only if `count > 0`)\n * AFTER all per-item `onDuplicate` dispatches. Caller typically logs\n * the count alongside the provider name.\n */\n onDuplicateBatch?: (count: number) => void;\n /**\n * The whole chunk's RPC call failed (transport or response\n * validation). Receives the chunk and the error. Caller decides how\n * to project that onto per-item state.\n */\n onWholeBatchError: (chunk: TItem[], error: unknown) => void;\n /**\n * Server returned txids that were not in the request. Caller\n * typically logs the count for observability — there's no recovery\n * action since the original request items are unaffected. Optional;\n * defaults to no-op.\n */\n onUnexpected?: (echoedTxids: string[]) => void;\n /**\n * Maximum items per RPC call. Defaults to {@link VP_BATCH_MAX_SIZE}.\n * Exposed for tests so chunking can be exercised without 50+\n * fixtures.\n */\n batchSize?: number;\n}\n\nexport async function batchPollByProvider<TItem, TResult>(\n options: BatchPollByProviderOptions<TItem, TResult>,\n): Promise<void> {\n const {\n items,\n getTxid,\n batchCall,\n onItem,\n onMissing,\n onDuplicate,\n onDuplicateBatch,\n onWholeBatchError,\n onUnexpected,\n batchSize = VP_BATCH_MAX_SIZE,\n } = options;\n\n if (!Number.isInteger(batchSize) || batchSize <= 0) {\n throw new Error(\n `batchPollByProvider: batchSize must be a positive integer, got ${batchSize}`,\n );\n }\n\n for (let i = 0; i < items.length; i += batchSize) {\n const chunk = items.slice(i, i + batchSize);\n const txidToItem = new Map<string, TItem>();\n const txids: string[] = [];\n for (const item of chunk) {\n const lowerTxid = getTxid(item).toLowerCase();\n txidToItem.set(lowerTxid, item);\n txids.push(lowerTxid);\n }\n\n // Both the RPC call and attribution sit inside the same try/catch\n // so a malformed-batch validator throw is routed through\n // `onWholeBatchError` rather than aborting the polling pass.\n let attribution;\n try {\n const response = await batchCall(txids);\n attribution = attributeBatchResults<TResult>(txids, response.results);\n } catch (error) {\n onWholeBatchError(chunk, error);\n continue;\n }\n\n if (onUnexpected && attribution.unexpected.length > 0) {\n onUnexpected(attribution.unexpected);\n }\n\n const duplicateTxids = new Set(attribution.duplicate);\n for (const txid of duplicateTxids) {\n const item = txidToItem.get(txid);\n if (item) onDuplicate(item);\n }\n if (onDuplicateBatch && duplicateTxids.size > 0) {\n onDuplicateBatch(duplicateTxids.size);\n }\n for (const txid of attribution.missing) {\n const item = txidToItem.get(txid);\n if (item) onMissing(item);\n }\n for (const [txid, envelope] of attribution.byTxid) {\n // Skip duplicates — already dispatched via onDuplicate above.\n if (duplicateTxids.has(txid)) continue;\n const item = txidToItem.get(txid);\n if (!item) continue;\n onItem(item, {\n pegin_txid: txid,\n result: envelope.result,\n error: envelope.error,\n });\n }\n }\n}\n"],"names":["DAEMON_STATUS_VALUES","DaemonStatus","VP_ERROR_PREVIEW_MAX_LEN","preview","value","_a","UNRECOGNIZED_STATUS_ERROR_PREFIX","isUnrecognizedDaemonStatusError","error","VP_VALIDATION_USER_MESSAGE","VpResponseValidationError","detail","__publicField","TXID_HEX_LEN","LABEL_HASH_HEX_LEN","isNonEmptyHex","HEX_RE","isNonEmptyString","assertNonEmptyHex","field","assertNonEmptyString","assertBtcPubkey","X_ONLY_PUBKEY_HEX_LEN","COMPRESSED_PUBKEY_HEX_LEN","validatePresigningProgressFields","progress","presigning","p","validateGetPeginStatusResponse","response","r","validateRequestDepositorPresignTransactionsResponse","i","validateClaimerTransactions","validateDepositorGraphTransactions","validateTransactionData","tx","validateChallengeAssertConnectorData","c","validatePresignDataPerChallenger","d","CHALLENGE_ASSERT_CONNECTORS_PER_CHALLENGER","hash","validateRequestDepositorClaimerArtifactsResponse","sessionEntries","key","session","s","validateGetPegoutStatusResponse","validateClaimerPegoutStatus","validateChallengerStatus","index","assertNullableString","validateBatchGetPeginStatusResponse","validateBatchEnvelope","entry","validateBatchGetPegoutStatusResponse","rpcName","validateInnerResult","e","graph","DEFAULT_TIMEOUT_MS","VaultProviderRpcClient","baseUrl","options","config","JsonRpcClient","params","signal","claimer","normalizeClaimerPegoutStatus","attributeBatchResults","requestedTxids","results","requestedSet","txid","byTxid","seen","duplicate","unexpected","lower","missing","batchPollByProvider","items","getTxid","batchCall","onItem","onMissing","onDuplicate","onDuplicateBatch","onWholeBatchError","onUnexpected","batchSize","VP_BATCH_MAX_SIZE","chunk","txidToItem","txids","item","lowerTxid","attribution","duplicateTxids","envelope"],"mappings":"sSA4BMA,EAAuB,IAAI,IAAY,OAAO,OAAOC,EAAAA,YAAY,CAAC,EAElEC,EAA2B,IAEjC,SAASC,EAAQC,EAAwB,OACvC,QACEC,EAAA,KAAK,UAAUD,CAAK,IAApB,YAAAC,EAAuB,MAAM,EAAGH,KAA6B,WAEjE,CAEA,MAAMI,EACJ,qDAOK,SAASC,EAAgCC,EAAwB,CACtE,OAAOA,EAAM,WAAWF,CAAgC,CAC1D,CAEA,MAAMG,EACJ,2FAQK,MAAMC,UAAkC,KAAM,CAGnD,YAAYC,EAAgB,CAC1B,MAAMF,CAA0B,EAHzBG,EAAA,eAIP,KAAK,KAAO,4BACZ,KAAK,OAASD,CAChB,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GA,EAAI4D,CAAS,EACpCG,MAAiB,IACjBC,EAAkB,CAAA,EACxB,UAAWC,KAAQH,EAAO,CACxB,MAAMI,EAAYd,EAAQa,CAAI,EAAE,YAAA,EAChCF,EAAW,IAAIG,EAAWD,CAAI,EAC9BD,EAAM,KAAKE,CAAS,CACtB,CAKA,IAAIC,EACJ,GAAI,CACF,MAAMtE,EAAW,MAAMwD,EAAUW,CAAK,EACtCG,EAAc5B,GAA+ByB,EAAOnE,EAAS,OAAO,CACtE,OAASrB,EAAO,CACdkF,EAAkBI,EAAOtF,CAAK,EAC9B,QACF,CAEImF,GAAgBQ,EAAY,WAAW,OAAS,GAClDR,EAAaQ,EAAY,UAAU,EAGrC,MAAMC,EAAiB,IAAI,IAAID,EAAY,SAAS,EACpD,UAAWxB,KAAQyB,EAAgB,CACjC,MAAMH,EAAOF,EAAW,IAAIpB,CAAI,EAC5BsB,KAAkBA,CAAI,CAC5B,CACIR,GAAoBW,EAAe,KAAO,GAC5CX,EAAiBW,EAAe,IAAI,EAEtC,UAAWzB,KAAQwB,EAAY,QAAS,CACtC,MAAMF,EAAOF,EAAW,IAAIpB,CAAI,EAC5BsB,KAAgBA,CAAI,CAC1B,CACA,SAAW,CAACtB,EAAM0B,CAAQ,IAAKF,EAAY,OAAQ,CAEjD,GAAIC,EAAe,IAAIzB,CAAI,EAAG,SAC9B,MAAMsB,EAAOF,EAAW,IAAIpB,CAAI,EAC3BsB,GACLX,EAAOW,EAAM,CACX,WAAYtB,EACZ,OAAQ0B,EAAS,OACjB,MAAOA,EAAS,KAAA,CACjB,CACH,CACF,CACF"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./verifyScriptPathSchnorrSignature-BKZihCjk.cjs"),O=require("./secp256k1-DDHQ1_za.cjs"),a=require("./tbv/core/wasm/index.cjs"),R=require("./verifyKeyPathSchnorrSignature-Gm9EmZkx.cjs"),P=require("./noPayout-DAWBQ0eG.cjs"),N=require("./challengeAssert-Z7_YULBb.cjs"),r=require("./bitcoin-D-O2GjbC.cjs"),F=require("./abortSignals-msbmbqFe.cjs"),I=require("./signing-3l5Aqd-H.cjs"),E=require("./validation-C6XTfZak.cjs"),y=require("./tbv/core/utils/eth/index.cjs"),A=require("./PeginManager-Dt2Z5ljw.cjs"),d=require("./PayoutManager-B6GFbG3X.cjs"),s=require("./tbv/core/clients/mempool/index.cjs"),p=require("./types-DJxOEU3P.cjs"),C=require("./onChainBtcPubkey-BlzxYImF.cjs"),u=require("./pegin-registration-client-BdJ6c7si.cjs"),h=require("./ProtocolParams.abi-Db2USqQm.cjs"),M=require("./BTCVaultRegistry.abi-BQ5tFNSu.cjs"),l=require("./BTCVaultRegistryKeyEpochs.abi-DCJnzKer.cjs"),S=require("./deriveVaultRoot-C3uqnJto.cjs"),V=require("./parseFundingOutpoints-C_-PT9BT.cjs"),v=require("./shared/index.cjs"),c=require("./psbtInputFields-BrV_ZfL_.cjs"),i=require("./fundPeginTransaction-54-Rwb2k.cjs"),T=require("./reservation-ECxjZi5t.cjs"),m=require("./index-CcdCNFLM.cjs"),o=require("./json-rpc-client-DbpFfa_o.cjs"),g=require("./primeVpAuth-D21PXgg2.cjs"),t=require("./toRefundInputs-B_GlIXjk.cjs"),e=require("./buildAndBroadcastReclaim-DcbsjJdf.cjs"),_=require("./peginState-DUv10EJR.cjs");exports.PEGIN_DEPOSITOR_CLAIM_VOUT=n.PEGIN_DEPOSITOR_CLAIM_VOUT;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.computeNumLocalChallengers=n.computeNumLocalChallengers;exports.createPayoutScript=n.createPayoutScript;exports.deriveDepositorClaimDescriptor=n.deriveDepositorClaimDescriptor;exports.deriveDepositorClaimScriptPubKey=n.deriveDepositorClaimScriptPubKey;exports.extractPayoutSignature=n.extractPayoutSignature;exports.assertValidVaultCoreVersion=O.assertValidVaultCoreVersion;exports.attachFinalizedAssert=a.attachFinalizedAssert;exports.computeMinClaimValue=a.computeMinClaimValue;exports.computeMinPeginFee=a.computeMinPeginFee;exports.deriveVaultId=a.deriveVaultId;exports.expandAuthAnchor=a.expandAuthAnchor;exports.expandHashlockSecret=a.expandHashlockSecret;exports.expandWotsSeed=a.expandWotsSeed;exports.finalizePayout=a.finalizePayout;exports.finalizeWronglyChallenged=a.finalizeWronglyChallenged;exports.peginP2aAnchorOutput=a.peginP2aAnchorOutput;exports.pinPegoutProof=a.pinPegoutProof;exports.supportedTxGraphVersions=a.supportedTxGraphVersions;exports.validatePeginP2aAnchor=a.validatePeginP2aAnchor;exports.assertKeyPathSchnorrSignature=R.assertKeyPathSchnorrSignature;exports.assertReturnedKeyPathSignatures=R.assertReturnedKeyPathSignatures;exports.buildPeginInputPsbt=R.buildPeginInputPsbt;exports.extractPeginInputSignature=R.extractPeginInputSignature;exports.finalizePeginInputPsbt=R.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=P.buildNoPayoutPsbt;exports.buildReclaimPsbt=P.buildReclaimPsbt;exports.buildRefundPsbt=P.buildRefundPsbt;exports.estimateReclaimFeeSats=P.estimateReclaimFeeSats;exports.finalizeScriptPathWithSignatures=P.finalizeScriptPathWithSignatures;exports.reclaimVsize=P.reclaimVsize;exports.buildChallengeAssertPsbt=N.buildChallengeAssertPsbt;exports.canonicalizeBtcPubkey=r.canonicalizeBtcPubkey;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.combineAbortSignals=F.combineAbortSignals;exports.calculateBtcTxHash=I.calculateBtcTxHash;exports.createTaprootScriptPathSignOptions=I.createTaprootScriptPathSignOptions;exports.createTaprootScriptPathSignOptionsForInput=I.createTaprootScriptPathSignOptionsForInput;exports.BITCOIN_ADDRESS_RE=E.BITCOIN_ADDRESS_RE;exports.COMPRESSED_PUBKEY_HEX_LEN=E.COMPRESSED_PUBKEY_HEX_LEN;exports.HEX_RE=E.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=E.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=E.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=E.TXID_RE;exports.X_ONLY_PUBKEY_HEX_LEN=E.X_ONLY_PUBKEY_HEX_LEN;exports.waitForTransactionReceiptSmartAware=y.waitForTransactionReceiptSmartAware;exports.PeginManager=A.PeginManager;exports.buildDepositTerms=A.buildDepositTerms;exports.computeWotsBlockPublicKeysHash=A.computeWotsBlockPublicKeysHash;exports.deriveWotsBlocksFromSeed=A.deriveWotsBlocksFromSeed;exports.ensurePrePeginTermsApproval=A.ensurePrePeginTermsApproval;exports.PayoutManager=d.PayoutManager;exports.computeHashlock=d.computeHashlock;exports.forwardDepositApproval=d.forwardDepositApproval;exports.requireChangeAddress=d.requireChangeAddress;exports.supportsDepositApproval=d.supportsDepositApproval;exports.validateSecretAgainstHashlock=d.validateSecretAgainstHashlock;exports.MEMPOOL_API_URLS=s.MEMPOOL_API_URLS;exports.getAddressTxs=s.getAddressTxs;exports.getAddressUtxos=s.getAddressUtxos;exports.getMempoolApiUrl=s.getMempoolApiUrl;exports.getNetworkFees=s.getNetworkFees;exports.getOutspend=s.getOutspend;exports.getTipHeight=s.getTipHeight;exports.getTxHex=s.getTxHex;exports.getTxInfo=s.getTxInfo;exports.getUtxoInfo=s.getUtxoInfo;exports.pushTx=s.pushTx;exports.OnChainBtcVaultStatus=p.OnChainBtcVaultStatus;exports.ViemOperationKeyReader=p.ViemOperationKeyReader;exports.ViemProtocolParamsReader=p.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=p.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=p.ViemVaultKeeperReader;exports.resolveProtocolAddresses=p.resolveProtocolAddresses;exports.assertOnChainBtcPubkey=C.assertOnChainBtcPubkey;exports.derivePeginVaultId=C.derivePeginVaultId;exports.COMMISSION_BPS_HEADROOM=u.COMMISSION_BPS_HEADROOM;exports.MAX_ACCEPTABLE_COMMISSION_BPS_CAP=u.MAX_ACCEPTABLE_COMMISSION_BPS_CAP;exports.RegistrationLogsUnavailableError=u.RegistrationLogsUnavailableError;exports.ViemPeginRegistrationClient=u.ViemPeginRegistrationClient;exports.ViemVaultRegistryReader=u.ViemVaultRegistryReader;exports.capMaxAcceptableCommissionBps=u.capMaxAcceptableCommissionBps;exports.isRegistrationLogsUnavailableError=u.isRegistrationLogsUnavailableError;exports.validateOffchainParams=u.validateOffchainParams;exports.validatePegInConfiguration=u.validatePegInConfiguration;exports.validateTBVProtocolParams=u.validateTBVProtocolParams;exports.ApplicationRegistryABI=h.ApplicationRegistryABI;exports.ProtocolParamsABI=h.ProtocolParamsABI;exports.BTCVaultRegistryABI=M.BTCVaultRegistryABI;exports.BTCVaultRegistryKeyEpochsABI=l.BTCVaultRegistryKeyEpochsABI;exports.CONTRACT_ERRORS=l.CONTRACT_ERRORS;exports.PEGIN_FINGERPRINT_CHANGED_SELECTOR=l.PEGIN_FINGERPRINT_CHANGED_SELECTOR;exports.PeginFingerprintChangedError=l.PeginFingerprintChangedError;exports.extractErrorData=l.extractErrorData;exports.getContractErrorMessage=l.getContractErrorMessage;exports.handleContractError=l.handleContractError;exports.isKnownContractError=l.isKnownContractError;exports.isPeginFingerprintChangedError=l.isPeginFingerprintChangedError;exports.VAULT_APP_NAME=S.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=S.buildFundingOutpointsCommitment;exports.buildVaultContext=S.buildVaultContext;exports.deriveVaultRoot=S.deriveVaultRoot;exports.forwardDeriveContextHash=S.forwardDeriveContextHash;exports.parseFundingOutpointsFromTx=V.parseFundingOutpointsFromTx;exports.BitcoinNetworks=v.BitcoinNetworks;exports.BitcoinScriptType=c.BitcoinScriptType;exports.applyChangeOutputPolicy=c.applyChangeOutputPolicy;exports.computeChangeOutputFeeSats=c.computeChangeOutputFeeSats;exports.computeMaxDeposit=c.computeMaxDeposit;exports.computePeginBaseFeeSats=c.computePeginBaseFeeSats;exports.getDustThreshold=c.getDustThreshold;exports.getPsbtInputFields=c.getPsbtInputFields;exports.getScriptType=c.getScriptType;exports.selectUtxosForPegin=c.selectUtxosForPegin;exports.shouldAddChangeOutput=c.shouldAddChangeOutput;exports.BTC_DUST_SAT=i.BTC_DUST_SAT;exports.DUST_THRESHOLD=i.DUST_THRESHOLD;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=i.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=i.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=i.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=i.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=i.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=i.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=i.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=i.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=i.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=i.fundPeginTransaction;exports.parseUnfundedWasmTransaction=i.parseUnfundedWasmTransaction;exports.peginOutputCount=i.peginOutputCount;exports.rateBasedTxBufferFee=i.rateBasedTxBufferFee;exports.UtxoNotAvailableError=T.UtxoNotAvailableError;exports.assertUtxosAvailable=T.assertUtxosAvailable;exports.extractInputsFromTransaction=T.extractInputsFromTransaction;exports.findOverlappingPendingVaults=T.findOverlappingPendingVaults;exports.validateUtxosAvailable=T.validateUtxosAvailable;exports.VaultProviderRpcClient=m.VaultProviderRpcClient;exports.VpResponseValidationError=m.VpResponseValidationError;exports.batchPollByProvider=m.batchPollByProvider;exports.isUnrecognizedDaemonStatusError=m.isUnrecognizedDaemonStatusError;exports.validateRequestDepositorClaimerArtifactsResponse=m.validateRequestDepositorClaimerArtifactsResponse;exports.AUTH_REJECTED_RPC_CODE=o.AUTH_REJECTED_RPC_CODE;exports.DaemonStatus=o.DaemonStatus;exports.JSON_RPC_ERROR_CODES=o.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=o.JsonRpcClient;exports.JsonRpcError=o.JsonRpcError;exports.POST_WOTS_STATUSES=o.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=o.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=o.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=o.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=o.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=o.VP_TRANSIENT_STATUSES;exports.isAuthRejectedError=o.isAuthRejectedError;exports.ServerIdentityError=g.ServerIdentityError;exports.VpTokenRegistry=g.VpTokenRegistry;exports.createAuthenticatedVpClient=g.createAuthenticatedVpClient;exports.primeVpTokenRegistry=g.primeVpTokenRegistry;exports.verifyServerIdentity=g.verifyServerIdentity;exports.vpTokenRegistry=g.vpTokenRegistry;exports.DEPOSIT_TERMS_REJECTED_ERROR_NAME=t.DEPOSIT_TERMS_REJECTED_ERROR_NAME;exports.DepositTermsRejectedError=t.DepositTermsRejectedError;exports.PEGIN_FINGERPRINT_DOMAIN=t.PEGIN_FINGERPRINT_DOMAIN;exports.PEGIN_FINGERPRINT_DOMAIN_PREIMAGE=t.PEGIN_FINGERPRINT_DOMAIN_PREIMAGE;exports.PeginFingerprintInputError=t.PeginFingerprintInputError;exports.PeginParamsAmbiguousError=t.PeginParamsAmbiguousError;exports.PeginParamsIncompleteSpaceError=t.PeginParamsIncompleteSpaceError;exports.PeginParamsNotFoundError=t.PeginParamsNotFoundError;exports.PeginSizingIntegrityError=t.PeginSizingIntegrityError;exports.UnanchoredPrePeginError=t.UnanchoredPrePeginError;exports.VaultRootMismatchError=t.VaultRootMismatchError;exports.buildPeginParamsCandidates=t.buildPeginParamsCandidates;exports.computePeginFingerprint=t.computePeginFingerprint;exports.deriveHashlocksFromPrePegin=t.deriveHashlocksFromPrePegin;exports.describePeginParamsCandidate=t.describePeginParamsCandidate;exports.describeUnresolvedVersion=t.describeUnresolvedVersion;exports.encodePeginFingerprintPreimage=t.encodePeginFingerprintPreimage;exports.isDepositTermsRejectedError=t.isDepositTermsRejectedError;exports.isPeginFingerprintInputError=t.isPeginFingerprintInputError;exports.isWotsMismatchError=t.isWotsMismatchError;exports.rebuildDepositTermsCore=t.rebuildDepositTermsCore;exports.reconstructPeginParams=t.reconstructPeginParams;exports.toRefundInputs=t.toRefundInputs;exports.ApplicationEntryPointMismatchError=e.ApplicationEntryPointMismatchError;exports.ArtifactsVaultMismatchError=e.ArtifactsVaultMismatchError;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ChallengerSetMismatchError=e.ChallengerSetMismatchError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.DELEGATED_CLAIM_TX_GRAPH_VERSION=e.DELEGATED_CLAIM_TX_GRAPH_VERSION;exports.GraphFingerprintError=e.GraphFingerprintError;exports.PEGIN_ETH_CONFIRMATIONS=e.PEGIN_ETH_CONFIRMATIONS;exports.ParticipantKeyDriftError=e.ParticipantKeyDriftError;exports.PayoutDestinationError=e.PayoutDestinationError;exports.PeginRegistrationMissingError=e.PeginRegistrationMissingError;exports.PeginRegistrationNotFinalError=e.PeginRegistrationNotFinalError;exports.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR=e.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR;exports.RECLAIM_MAX_FEE_FRACTION_NUMERATOR=e.RECLAIM_MAX_FEE_FRACTION_NUMERATOR;exports.RECLAIM_MAX_FEE_RATE_SATS_VB=e.RECLAIM_MAX_FEE_RATE_SATS_VB;exports.RECLAIM_WARN_FEE_FRACTION_NUMERATOR=e.RECLAIM_WARN_FEE_FRACTION_NUMERATOR;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.ReclaimUneconomicalError=e.ReclaimUneconomicalError;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.VaultIdBindingError=e.VaultIdBindingError;exports.activateVault=e.activateVault;exports.activateVaultAndRedeem=e.activateVaultAndRedeem;exports.assembleWatchtowerArtifacts=e.assembleWatchtowerArtifacts;exports.assertArtifactsUsableForVault=e.assertArtifactsUsableForVault;exports.assertChallengerSetMatchesVault=e.assertChallengerSetMatchesVault;exports.assertClaimSpendsVault=e.assertClaimSpendsVault;exports.assertPayoutPaysRegisteredScript=e.assertPayoutPaysRegisteredScript;exports.assertReturnedGraphMatchesFingerprint=e.assertReturnedGraphMatchesFingerprint;exports.assertVaultProviderHintAccepted=e.assertVaultProviderHintAccepted;exports.buildAndBroadcastReclaim=e.buildAndBroadcastReclaim;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.deriveClaimerWotsKeypair=e.deriveClaimerWotsKeypair;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.fingerprintReturnedGraph=e.fingerprintReturnedGraph;exports.isApplicationEntryPointMismatchError=e.isApplicationEntryPointMismatchError;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isHintAccepted=e.isHintAccepted;exports.isParticipantKeyDriftError=e.isParticipantKeyDriftError;exports.isPeginRegistrationMissingError=e.isPeginRegistrationMissingError;exports.isPeginRegistrationNotFinalError=e.isPeginRegistrationNotFinalError;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.matchKeyHint=e.matchKeyHint;exports.matchKeySetHint=e.matchKeySetHint;exports.resolveCurrentParticipantKeys=e.resolveCurrentParticipantKeys;exports.resolveParticipantKeysAtEpochs=e.resolveParticipantKeysAtEpochs;exports.runDepositorPresignFlow=e.runDepositorPresignFlow;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.summarizeWatchtowerArtifacts=e.summarizeWatchtowerArtifacts;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.verifyRegisteredParticipantKeys=e.verifyRegisteredParticipantKeys;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginRegistrationDepth=e.waitForPeginRegistrationDepth;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=_.ContractStatus;exports.PeginAction=_.PeginAction;exports.activationDeadlineBlocksRemaining=_.activationDeadlineBlocksRemaining;exports.canPerformAction=_.canPerformAction;exports.getPeginProtocolState=_.getPeginProtocolState;exports.isActivationDeadlinePassedOnChain=_.isActivationDeadlinePassedOnChain;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./verifyScriptPathSchnorrSignature-BKZihCjk.cjs"),O=require("./secp256k1-DDHQ1_za.cjs"),n=require("./tbv/core/wasm/index.cjs"),R=require("./verifyKeyPathSchnorrSignature-Gm9EmZkx.cjs"),P=require("./noPayout-DAWBQ0eG.cjs"),N=require("./challengeAssert-Z7_YULBb.cjs"),r=require("./bitcoin-D-O2GjbC.cjs"),F=require("./abortSignals-msbmbqFe.cjs"),I=require("./signing-3l5Aqd-H.cjs"),E=require("./validation-C6XTfZak.cjs"),y=require("./tbv/core/utils/eth/index.cjs"),A=require("./PeginManager-Dt2Z5ljw.cjs"),d=require("./PayoutManager-B6GFbG3X.cjs"),s=require("./tbv/core/clients/mempool/index.cjs"),p=require("./types-DJxOEU3P.cjs"),C=require("./onChainBtcPubkey-BlzxYImF.cjs"),u=require("./pegin-registration-client-BdJ6c7si.cjs"),h=require("./ProtocolParams.abi-Db2USqQm.cjs"),M=require("./BTCVaultRegistry.abi-BQ5tFNSu.cjs"),l=require("./BTCVaultRegistryKeyEpochs.abi-DCJnzKer.cjs"),S=require("./deriveVaultRoot-C3uqnJto.cjs"),V=require("./parseFundingOutpoints-C_-PT9BT.cjs"),v=require("./shared/index.cjs"),c=require("./psbtInputFields-BrV_ZfL_.cjs"),i=require("./fundPeginTransaction-54-Rwb2k.cjs"),T=require("./reservation-ECxjZi5t.cjs"),m=require("./index-EHLYplSd.cjs"),a=require("./state-DMFlvLL3.cjs"),g=require("./primeVpAuth-CQRsu6VB.cjs"),t=require("./toRefundInputs-B_GlIXjk.cjs"),e=require("./buildAndBroadcastReclaim-BDc-SK9i.cjs"),_=require("./peginState-DUv10EJR.cjs");exports.PEGIN_DEPOSITOR_CLAIM_VOUT=o.PEGIN_DEPOSITOR_CLAIM_VOUT;exports.PsbtSubstitutionError=o.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=o.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=o.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=o.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=o.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=o.buildPrePeginPsbt;exports.computeNumLocalChallengers=o.computeNumLocalChallengers;exports.createPayoutScript=o.createPayoutScript;exports.deriveDepositorClaimDescriptor=o.deriveDepositorClaimDescriptor;exports.deriveDepositorClaimScriptPubKey=o.deriveDepositorClaimScriptPubKey;exports.extractPayoutSignature=o.extractPayoutSignature;exports.assertValidVaultCoreVersion=O.assertValidVaultCoreVersion;exports.attachFinalizedAssert=n.attachFinalizedAssert;exports.computeMinClaimValue=n.computeMinClaimValue;exports.computeMinPeginFee=n.computeMinPeginFee;exports.deriveVaultId=n.deriveVaultId;exports.expandAuthAnchor=n.expandAuthAnchor;exports.expandHashlockSecret=n.expandHashlockSecret;exports.expandWotsSeed=n.expandWotsSeed;exports.finalizePayout=n.finalizePayout;exports.finalizeWronglyChallenged=n.finalizeWronglyChallenged;exports.peginP2aAnchorOutput=n.peginP2aAnchorOutput;exports.pinPegoutProof=n.pinPegoutProof;exports.supportedTxGraphVersions=n.supportedTxGraphVersions;exports.validatePeginP2aAnchor=n.validatePeginP2aAnchor;exports.assertKeyPathSchnorrSignature=R.assertKeyPathSchnorrSignature;exports.assertReturnedKeyPathSignatures=R.assertReturnedKeyPathSignatures;exports.buildPeginInputPsbt=R.buildPeginInputPsbt;exports.extractPeginInputSignature=R.extractPeginInputSignature;exports.finalizePeginInputPsbt=R.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=P.buildNoPayoutPsbt;exports.buildReclaimPsbt=P.buildReclaimPsbt;exports.buildRefundPsbt=P.buildRefundPsbt;exports.estimateReclaimFeeSats=P.estimateReclaimFeeSats;exports.finalizeScriptPathWithSignatures=P.finalizeScriptPathWithSignatures;exports.reclaimVsize=P.reclaimVsize;exports.buildChallengeAssertPsbt=N.buildChallengeAssertPsbt;exports.canonicalizeBtcPubkey=r.canonicalizeBtcPubkey;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.combineAbortSignals=F.combineAbortSignals;exports.calculateBtcTxHash=I.calculateBtcTxHash;exports.createTaprootScriptPathSignOptions=I.createTaprootScriptPathSignOptions;exports.createTaprootScriptPathSignOptionsForInput=I.createTaprootScriptPathSignOptionsForInput;exports.BITCOIN_ADDRESS_RE=E.BITCOIN_ADDRESS_RE;exports.COMPRESSED_PUBKEY_HEX_LEN=E.COMPRESSED_PUBKEY_HEX_LEN;exports.HEX_RE=E.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=E.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=E.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=E.TXID_RE;exports.X_ONLY_PUBKEY_HEX_LEN=E.X_ONLY_PUBKEY_HEX_LEN;exports.waitForTransactionReceiptSmartAware=y.waitForTransactionReceiptSmartAware;exports.PeginManager=A.PeginManager;exports.buildDepositTerms=A.buildDepositTerms;exports.computeWotsBlockPublicKeysHash=A.computeWotsBlockPublicKeysHash;exports.deriveWotsBlocksFromSeed=A.deriveWotsBlocksFromSeed;exports.ensurePrePeginTermsApproval=A.ensurePrePeginTermsApproval;exports.PayoutManager=d.PayoutManager;exports.computeHashlock=d.computeHashlock;exports.forwardDepositApproval=d.forwardDepositApproval;exports.requireChangeAddress=d.requireChangeAddress;exports.supportsDepositApproval=d.supportsDepositApproval;exports.validateSecretAgainstHashlock=d.validateSecretAgainstHashlock;exports.MEMPOOL_API_URLS=s.MEMPOOL_API_URLS;exports.getAddressTxs=s.getAddressTxs;exports.getAddressUtxos=s.getAddressUtxos;exports.getMempoolApiUrl=s.getMempoolApiUrl;exports.getNetworkFees=s.getNetworkFees;exports.getOutspend=s.getOutspend;exports.getTipHeight=s.getTipHeight;exports.getTxHex=s.getTxHex;exports.getTxInfo=s.getTxInfo;exports.getUtxoInfo=s.getUtxoInfo;exports.pushTx=s.pushTx;exports.OnChainBtcVaultStatus=p.OnChainBtcVaultStatus;exports.ViemOperationKeyReader=p.ViemOperationKeyReader;exports.ViemProtocolParamsReader=p.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=p.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=p.ViemVaultKeeperReader;exports.resolveProtocolAddresses=p.resolveProtocolAddresses;exports.assertOnChainBtcPubkey=C.assertOnChainBtcPubkey;exports.derivePeginVaultId=C.derivePeginVaultId;exports.COMMISSION_BPS_HEADROOM=u.COMMISSION_BPS_HEADROOM;exports.MAX_ACCEPTABLE_COMMISSION_BPS_CAP=u.MAX_ACCEPTABLE_COMMISSION_BPS_CAP;exports.RegistrationLogsUnavailableError=u.RegistrationLogsUnavailableError;exports.ViemPeginRegistrationClient=u.ViemPeginRegistrationClient;exports.ViemVaultRegistryReader=u.ViemVaultRegistryReader;exports.capMaxAcceptableCommissionBps=u.capMaxAcceptableCommissionBps;exports.isRegistrationLogsUnavailableError=u.isRegistrationLogsUnavailableError;exports.validateOffchainParams=u.validateOffchainParams;exports.validatePegInConfiguration=u.validatePegInConfiguration;exports.validateTBVProtocolParams=u.validateTBVProtocolParams;exports.ApplicationRegistryABI=h.ApplicationRegistryABI;exports.ProtocolParamsABI=h.ProtocolParamsABI;exports.BTCVaultRegistryABI=M.BTCVaultRegistryABI;exports.BTCVaultRegistryKeyEpochsABI=l.BTCVaultRegistryKeyEpochsABI;exports.CONTRACT_ERRORS=l.CONTRACT_ERRORS;exports.PEGIN_FINGERPRINT_CHANGED_SELECTOR=l.PEGIN_FINGERPRINT_CHANGED_SELECTOR;exports.PeginFingerprintChangedError=l.PeginFingerprintChangedError;exports.extractErrorData=l.extractErrorData;exports.getContractErrorMessage=l.getContractErrorMessage;exports.handleContractError=l.handleContractError;exports.isKnownContractError=l.isKnownContractError;exports.isPeginFingerprintChangedError=l.isPeginFingerprintChangedError;exports.VAULT_APP_NAME=S.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=S.buildFundingOutpointsCommitment;exports.buildVaultContext=S.buildVaultContext;exports.deriveVaultRoot=S.deriveVaultRoot;exports.forwardDeriveContextHash=S.forwardDeriveContextHash;exports.parseFundingOutpointsFromTx=V.parseFundingOutpointsFromTx;exports.BitcoinNetworks=v.BitcoinNetworks;exports.BitcoinScriptType=c.BitcoinScriptType;exports.applyChangeOutputPolicy=c.applyChangeOutputPolicy;exports.computeChangeOutputFeeSats=c.computeChangeOutputFeeSats;exports.computeMaxDeposit=c.computeMaxDeposit;exports.computePeginBaseFeeSats=c.computePeginBaseFeeSats;exports.getDustThreshold=c.getDustThreshold;exports.getPsbtInputFields=c.getPsbtInputFields;exports.getScriptType=c.getScriptType;exports.selectUtxosForPegin=c.selectUtxosForPegin;exports.shouldAddChangeOutput=c.shouldAddChangeOutput;exports.BTC_DUST_SAT=i.BTC_DUST_SAT;exports.DUST_THRESHOLD=i.DUST_THRESHOLD;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=i.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=i.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=i.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=i.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=i.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=i.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=i.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=i.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=i.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=i.fundPeginTransaction;exports.parseUnfundedWasmTransaction=i.parseUnfundedWasmTransaction;exports.peginOutputCount=i.peginOutputCount;exports.rateBasedTxBufferFee=i.rateBasedTxBufferFee;exports.UtxoNotAvailableError=T.UtxoNotAvailableError;exports.assertUtxosAvailable=T.assertUtxosAvailable;exports.extractInputsFromTransaction=T.extractInputsFromTransaction;exports.findOverlappingPendingVaults=T.findOverlappingPendingVaults;exports.validateUtxosAvailable=T.validateUtxosAvailable;exports.VaultProviderRpcClient=m.VaultProviderRpcClient;exports.VpResponseValidationError=m.VpResponseValidationError;exports.batchPollByProvider=m.batchPollByProvider;exports.isUnrecognizedDaemonStatusError=m.isUnrecognizedDaemonStatusError;exports.validateRequestDepositorClaimerArtifactsResponse=m.validateRequestDepositorClaimerArtifactsResponse;exports.AUTH_REJECTED_RPC_CODE=a.AUTH_REJECTED_RPC_CODE;exports.ClaimerPegoutStatusValue=a.ClaimerPegoutStatusValue;exports.DaemonStatus=a.DaemonStatus;exports.JSON_RPC_ERROR_CODES=a.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=a.JsonRpcClient;exports.JsonRpcError=a.JsonRpcError;exports.POST_WOTS_STATUSES=a.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=a.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=a.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=a.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=a.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=a.VP_TRANSIENT_STATUSES;exports.isAuthRejectedError=a.isAuthRejectedError;exports.isPegoutTerminalStatus=a.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=a.isRecognizedPegoutStatus;exports.ServerIdentityError=g.ServerIdentityError;exports.VpTokenRegistry=g.VpTokenRegistry;exports.createAuthenticatedVpClient=g.createAuthenticatedVpClient;exports.primeVpTokenRegistry=g.primeVpTokenRegistry;exports.verifyServerIdentity=g.verifyServerIdentity;exports.vpTokenRegistry=g.vpTokenRegistry;exports.DEPOSIT_TERMS_REJECTED_ERROR_NAME=t.DEPOSIT_TERMS_REJECTED_ERROR_NAME;exports.DepositTermsRejectedError=t.DepositTermsRejectedError;exports.PEGIN_FINGERPRINT_DOMAIN=t.PEGIN_FINGERPRINT_DOMAIN;exports.PEGIN_FINGERPRINT_DOMAIN_PREIMAGE=t.PEGIN_FINGERPRINT_DOMAIN_PREIMAGE;exports.PeginFingerprintInputError=t.PeginFingerprintInputError;exports.PeginParamsAmbiguousError=t.PeginParamsAmbiguousError;exports.PeginParamsIncompleteSpaceError=t.PeginParamsIncompleteSpaceError;exports.PeginParamsNotFoundError=t.PeginParamsNotFoundError;exports.PeginSizingIntegrityError=t.PeginSizingIntegrityError;exports.UnanchoredPrePeginError=t.UnanchoredPrePeginError;exports.VaultRootMismatchError=t.VaultRootMismatchError;exports.buildPeginParamsCandidates=t.buildPeginParamsCandidates;exports.computePeginFingerprint=t.computePeginFingerprint;exports.deriveHashlocksFromPrePegin=t.deriveHashlocksFromPrePegin;exports.describePeginParamsCandidate=t.describePeginParamsCandidate;exports.describeUnresolvedVersion=t.describeUnresolvedVersion;exports.encodePeginFingerprintPreimage=t.encodePeginFingerprintPreimage;exports.isDepositTermsRejectedError=t.isDepositTermsRejectedError;exports.isPeginFingerprintInputError=t.isPeginFingerprintInputError;exports.isWotsMismatchError=t.isWotsMismatchError;exports.rebuildDepositTermsCore=t.rebuildDepositTermsCore;exports.reconstructPeginParams=t.reconstructPeginParams;exports.toRefundInputs=t.toRefundInputs;exports.ApplicationEntryPointMismatchError=e.ApplicationEntryPointMismatchError;exports.ArtifactsVaultMismatchError=e.ArtifactsVaultMismatchError;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ChallengerSetMismatchError=e.ChallengerSetMismatchError;exports.DELEGATED_CLAIM_TX_GRAPH_VERSION=e.DELEGATED_CLAIM_TX_GRAPH_VERSION;exports.GraphFingerprintError=e.GraphFingerprintError;exports.PEGIN_ETH_CONFIRMATIONS=e.PEGIN_ETH_CONFIRMATIONS;exports.ParticipantKeyDriftError=e.ParticipantKeyDriftError;exports.PayoutDestinationError=e.PayoutDestinationError;exports.PeginRegistrationMissingError=e.PeginRegistrationMissingError;exports.PeginRegistrationNotFinalError=e.PeginRegistrationNotFinalError;exports.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR=e.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR;exports.RECLAIM_MAX_FEE_FRACTION_NUMERATOR=e.RECLAIM_MAX_FEE_FRACTION_NUMERATOR;exports.RECLAIM_MAX_FEE_RATE_SATS_VB=e.RECLAIM_MAX_FEE_RATE_SATS_VB;exports.RECLAIM_WARN_FEE_FRACTION_NUMERATOR=e.RECLAIM_WARN_FEE_FRACTION_NUMERATOR;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.ReclaimUneconomicalError=e.ReclaimUneconomicalError;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.VaultIdBindingError=e.VaultIdBindingError;exports.activateVault=e.activateVault;exports.activateVaultAndRedeem=e.activateVaultAndRedeem;exports.assembleWatchtowerArtifacts=e.assembleWatchtowerArtifacts;exports.assertArtifactsUsableForVault=e.assertArtifactsUsableForVault;exports.assertChallengerSetMatchesVault=e.assertChallengerSetMatchesVault;exports.assertClaimSpendsVault=e.assertClaimSpendsVault;exports.assertPayoutPaysRegisteredScript=e.assertPayoutPaysRegisteredScript;exports.assertReturnedGraphMatchesFingerprint=e.assertReturnedGraphMatchesFingerprint;exports.assertVaultProviderHintAccepted=e.assertVaultProviderHintAccepted;exports.buildAndBroadcastReclaim=e.buildAndBroadcastReclaim;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.deriveClaimerWotsKeypair=e.deriveClaimerWotsKeypair;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.fingerprintReturnedGraph=e.fingerprintReturnedGraph;exports.isApplicationEntryPointMismatchError=e.isApplicationEntryPointMismatchError;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isHintAccepted=e.isHintAccepted;exports.isParticipantKeyDriftError=e.isParticipantKeyDriftError;exports.isPeginRegistrationMissingError=e.isPeginRegistrationMissingError;exports.isPeginRegistrationNotFinalError=e.isPeginRegistrationNotFinalError;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.matchKeyHint=e.matchKeyHint;exports.matchKeySetHint=e.matchKeySetHint;exports.resolveCurrentParticipantKeys=e.resolveCurrentParticipantKeys;exports.resolveParticipantKeysAtEpochs=e.resolveParticipantKeysAtEpochs;exports.runDepositorPresignFlow=e.runDepositorPresignFlow;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.summarizeWatchtowerArtifacts=e.summarizeWatchtowerArtifacts;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.verifyRegisteredParticipantKeys=e.verifyRegisteredParticipantKeys;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginRegistrationDepth=e.waitForPeginRegistrationDepth;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=_.ContractStatus;exports.PeginAction=_.PeginAction;exports.activationDeadlineBlocksRemaining=_.activationDeadlineBlocksRemaining;exports.canPerformAction=_.canPerformAction;exports.getPeginProtocolState=_.getPeginProtocolState;exports.isActivationDeadlinePassedOnChain=_.isActivationDeadlinePassedOnChain;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -24,18 +24,18 @@ import { BitcoinNetworks as Ke } from "./shared/index.js";
|
|
|
24
24
|
import { B as Ge, a as ke, c as We, b as we, d as ze, g as Ye, h as je, f as Je, s as Ze, e as qe } from "./psbtInputFields-CCVyaQMi.js";
|
|
25
25
|
import { B as $e, D as as, L as es, M as ss, c as rs, P as ts, b as is, a as os, S as ns, T as ps, W as Ps, f as Es, d as ls, p as cs, r as us } from "./fundPeginTransaction-CwhRbCQC.js";
|
|
26
26
|
import { U as gs, a as Rs, e as As, f as _s, v as ms } from "./reservation-DOAHVT3B.js";
|
|
27
|
-
import { V as Ss, a as Cs, b as Is, i as fs, v as hs } from "./index-
|
|
28
|
-
import { A as Ns,
|
|
29
|
-
import { S as
|
|
30
|
-
import { D as
|
|
31
|
-
import { t as
|
|
27
|
+
import { V as Ss, a as Cs, b as Is, i as fs, v as hs } from "./index-B6w5MM-8.js";
|
|
28
|
+
import { A as Ns, C as bs, D as Vs, J as xs, a as Fs, b as Ms, d as vs, P as ys, R as Ds, e as Us, c as Bs, V as Hs, i as Ls, g as Ks, f as Xs } from "./state-mE-QfITd.js";
|
|
29
|
+
import { S as ks, V as Ws, c as ws, p as zs, v as Ys, a as js } from "./primeVpAuth-Bdy_B_Sq.js";
|
|
30
|
+
import { D as Zs, f as qs, P as Qs, a as $s, b as ar, o as er, p as sr, n as rr, q as tr, U as ir, V as or, j as nr, c as pr, h as Pr, l as Er, k as lr, e as cr, g as ur, d as dr, i as gr, r as Rr, m as Ar, t as _r } from "./toRefundInputs-DIIdhjvu.js";
|
|
31
|
+
import { t as Tr, A as Sr, X as Cr, C as Ir, D as fr, G as hr, i as Or, I as Nr, P as br, j as Vr, k as xr, a4 as Fr, a5 as Mr, a6 as vr, a7 as yr, _ as Dr, $ as Ur, a0 as Br, a1 as Hr, a2 as Lr, R as Kr, V as Xr, a as Gr, b as kr, c as Wr, e as wr, f as zr, h as Yr, g as jr, n as Jr, O as Zr, a3 as qr, Y as Qr, d as $r, Z as at, o as et, u as st, x as rt, Q as tt, J as it, l as ot, m as nt, L as pt, S as Pt, T as Et, U as lt, W as ct, r as ut, p as dt, q as gt, s as Rt, y as At, z as _t, v as mt, B as Tt, E as St, F as Ct, H as It, K as ft, M as ht, w as Ot, N as Nt } from "./buildAndBroadcastReclaim-T5ZFPUpM.js";
|
|
32
32
|
import { C as Vt, P as xt, a as Ft, c as Mt, g as vt, i as yt } from "./peginState-BU2ONFXF.js";
|
|
33
33
|
export {
|
|
34
34
|
Ns as AUTH_REJECTED_RPC_CODE,
|
|
35
|
-
|
|
35
|
+
Tr as ApplicationEntryPointMismatchError,
|
|
36
36
|
Ae as ApplicationRegistryABI,
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
Sr as ArtifactsVaultMismatchError,
|
|
38
|
+
Cr as BIP68NotMatureError,
|
|
39
39
|
ga as BITCOIN_ADDRESS_RE,
|
|
40
40
|
Te as BTCVaultRegistryABI,
|
|
41
41
|
Ce as BTCVaultRegistryKeyEpochsABI,
|
|
@@ -45,19 +45,19 @@ export {
|
|
|
45
45
|
oe as COMMISSION_BPS_HEADROOM,
|
|
46
46
|
Ra as COMPRESSED_PUBKEY_HEX_LEN,
|
|
47
47
|
Ie as CONTRACT_ERRORS,
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
Ir as ChallengerSetMismatchError,
|
|
49
|
+
bs as ClaimerPegoutStatusValue,
|
|
50
50
|
Vt as ContractStatus,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
fr as DELEGATED_CLAIM_TX_GRAPH_VERSION,
|
|
52
|
+
Zs as DEPOSIT_TERMS_REJECTED_ERROR_NAME,
|
|
53
53
|
as as DUST_THRESHOLD,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
Vs as DaemonStatus,
|
|
55
|
+
qs as DepositTermsRejectedError,
|
|
56
|
+
hr as GraphFingerprintError,
|
|
57
57
|
Aa as HEX_RE,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
xs as JSON_RPC_ERROR_CODES,
|
|
59
|
+
Fs as JsonRpcClient,
|
|
60
|
+
Ms as JsonRpcError,
|
|
61
61
|
_a as KNOWN_SCRIPT_PREFIXES,
|
|
62
62
|
es as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
63
63
|
ne as MAX_ACCEPTABLE_COMMISSION_BPS_CAP,
|
|
@@ -69,53 +69,53 @@ export {
|
|
|
69
69
|
ts as P2TR_INPUT_SIZE,
|
|
70
70
|
is as PEGIN_AUTH_ANCHOR_OUTPUTS,
|
|
71
71
|
s as PEGIN_DEPOSITOR_CLAIM_VOUT,
|
|
72
|
-
|
|
72
|
+
Or as PEGIN_ETH_CONFIRMATIONS,
|
|
73
73
|
fe as PEGIN_FINGERPRINT_CHANGED_SELECTOR,
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
Qs as PEGIN_FINGERPRINT_DOMAIN,
|
|
75
|
+
$s as PEGIN_FINGERPRINT_DOMAIN_PREIMAGE,
|
|
76
76
|
os as PEGIN_FIXED_OUTPUTS,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
vs as POST_WOTS_STATUSES,
|
|
78
|
+
ys as PRE_DEPOSITOR_SIGNATURES_STATES,
|
|
79
|
+
Nr as ParticipantKeyDriftError,
|
|
80
|
+
br as PayoutDestinationError,
|
|
81
81
|
Fa as PayoutManager,
|
|
82
82
|
xt as PeginAction,
|
|
83
83
|
he as PeginFingerprintChangedError,
|
|
84
|
-
|
|
84
|
+
ar as PeginFingerprintInputError,
|
|
85
85
|
ha as PeginManager,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
er as PeginParamsAmbiguousError,
|
|
87
|
+
sr as PeginParamsIncompleteSpaceError,
|
|
88
|
+
rr as PeginParamsNotFoundError,
|
|
89
|
+
Vr as PeginRegistrationMissingError,
|
|
90
|
+
xr as PeginRegistrationNotFinalError,
|
|
91
|
+
tr as PeginSizingIntegrityError,
|
|
92
92
|
_e as ProtocolParamsABI,
|
|
93
93
|
r as PsbtSubstitutionError,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
Fr as RECLAIM_MAX_FEE_FRACTION_DENOMINATOR,
|
|
95
|
+
Mr as RECLAIM_MAX_FEE_FRACTION_NUMERATOR,
|
|
96
|
+
vr as RECLAIM_MAX_FEE_RATE_SATS_VB,
|
|
97
|
+
yr as RECLAIM_WARN_FEE_FRACTION_NUMERATOR,
|
|
98
|
+
Dr as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
|
|
99
|
+
Ur as REFUND_MAX_FEE_FRACTION_NUMERATOR,
|
|
100
|
+
Br as REFUND_MAX_FEE_RATE_SATS_VB,
|
|
101
|
+
Hr as REFUND_VSIZE,
|
|
102
|
+
Lr as ReclaimUneconomicalError,
|
|
103
|
+
Kr as RegisteredVaultVersionMismatchError,
|
|
104
104
|
pe as RegistrationLogsUnavailableError,
|
|
105
|
-
|
|
105
|
+
Ds as RpcErrorCode,
|
|
106
106
|
ns as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
107
|
-
|
|
107
|
+
ks as ServerIdentityError,
|
|
108
108
|
Ta as TXID_RE,
|
|
109
109
|
ps as TX_BUFFER_SIZE_OVERHEAD,
|
|
110
|
-
|
|
110
|
+
ir as UnanchoredPrePeginError,
|
|
111
111
|
gs as UtxoNotAvailableError,
|
|
112
112
|
Me as VAULT_APP_NAME,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
Us as VP_BATCH_MAX_SIZE,
|
|
114
|
+
Bs as VP_TERMINAL_FAILURE_STATUSES,
|
|
115
|
+
Hs as VP_TRANSIENT_STATUSES,
|
|
116
|
+
Xr as VaultIdBindingError,
|
|
117
117
|
Ss as VaultProviderRpcClient,
|
|
118
|
-
|
|
118
|
+
or as VaultRootMismatchError,
|
|
119
119
|
qa as ViemOperationKeyReader,
|
|
120
120
|
Pe as ViemPeginRegistrationClient,
|
|
121
121
|
Qa as ViemProtocolParamsReader,
|
|
@@ -123,38 +123,38 @@ export {
|
|
|
123
123
|
ae as ViemVaultKeeperReader,
|
|
124
124
|
Ee as ViemVaultRegistryReader,
|
|
125
125
|
Cs as VpResponseValidationError,
|
|
126
|
-
|
|
126
|
+
Ws as VpTokenRegistry,
|
|
127
127
|
Ps as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
128
128
|
Sa as X_ONLY_PUBKEY_HEX_LEN,
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
Gr as activateVault,
|
|
130
|
+
kr as activateVaultAndRedeem,
|
|
131
131
|
Ft as activationDeadlineBlocksRemaining,
|
|
132
132
|
ke as applyChangeOutputPolicy,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
Wr as assembleWatchtowerArtifacts,
|
|
134
|
+
wr as assertArtifactsUsableForVault,
|
|
135
|
+
zr as assertChallengerSetMatchesVault,
|
|
136
|
+
Yr as assertClaimSpendsVault,
|
|
137
137
|
F as assertKeyPathSchnorrSignature,
|
|
138
138
|
re as assertOnChainBtcPubkey,
|
|
139
|
-
|
|
139
|
+
jr as assertPayoutPaysRegisteredScript,
|
|
140
140
|
t as assertPsbtUnsignedTxMatches,
|
|
141
|
-
|
|
141
|
+
Jr as assertReturnedGraphMatchesFingerprint,
|
|
142
142
|
M as assertReturnedKeyPathSignatures,
|
|
143
143
|
i as assertScriptPathSchnorrSignature,
|
|
144
144
|
Rs as assertUtxosAvailable,
|
|
145
145
|
g as assertValidVaultCoreVersion,
|
|
146
|
-
|
|
146
|
+
Zr as assertVaultProviderHintAccepted,
|
|
147
147
|
A as attachFinalizedAssert,
|
|
148
148
|
Is as batchPollByProvider,
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
qr as buildAndBroadcastReclaim,
|
|
150
|
+
Qr as buildAndBroadcastRefund,
|
|
151
151
|
W as buildChallengeAssertPsbt,
|
|
152
152
|
Oa as buildDepositTerms,
|
|
153
153
|
ve as buildFundingOutpointsCommitment,
|
|
154
154
|
B as buildNoPayoutPsbt,
|
|
155
155
|
o as buildPayoutPsbt,
|
|
156
156
|
v as buildPeginInputPsbt,
|
|
157
|
-
|
|
157
|
+
nr as buildPeginParamsCandidates,
|
|
158
158
|
n as buildPeginTxFromFundedPrePegin,
|
|
159
159
|
p as buildPrePeginPsbt,
|
|
160
160
|
H as buildReclaimPsbt,
|
|
@@ -172,30 +172,30 @@ export {
|
|
|
172
172
|
m as computeMinPeginFee,
|
|
173
173
|
P as computeNumLocalChallengers,
|
|
174
174
|
ze as computePeginBaseFeeSats,
|
|
175
|
-
|
|
175
|
+
pr as computePeginFingerprint,
|
|
176
176
|
Na as computeWotsBlockPublicKeysHash,
|
|
177
|
-
|
|
177
|
+
ws as createAuthenticatedVpClient,
|
|
178
178
|
E as createPayoutScript,
|
|
179
179
|
ca as createTaprootScriptPathSignOptions,
|
|
180
180
|
ua as createTaprootScriptPathSignOptionsForInput,
|
|
181
181
|
Y as deriveBip86ScriptPubKeyHex,
|
|
182
|
-
|
|
182
|
+
$r as deriveClaimerWotsKeypair,
|
|
183
183
|
l as deriveDepositorClaimDescriptor,
|
|
184
184
|
c as deriveDepositorClaimScriptPubKey,
|
|
185
|
-
|
|
185
|
+
Pr as deriveHashlocksFromPrePegin,
|
|
186
186
|
j as deriveNativeSegwitAddress,
|
|
187
187
|
te as derivePeginVaultId,
|
|
188
188
|
J as deriveTaprootAddress,
|
|
189
189
|
T as deriveVaultId,
|
|
190
190
|
De as deriveVaultRoot,
|
|
191
191
|
ba as deriveWotsBlocksFromSeed,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
Er as describePeginParamsCandidate,
|
|
193
|
+
lr as describeUnresolvedVersion,
|
|
194
|
+
cr as encodePeginFingerprintPreimage,
|
|
195
195
|
Z as ensureHexPrefix,
|
|
196
196
|
Va as ensurePrePeginTermsApproval,
|
|
197
197
|
K as estimateReclaimFeeSats,
|
|
198
|
-
|
|
198
|
+
at as estimateRefundFeeSats,
|
|
199
199
|
S as expandAuthAnchor,
|
|
200
200
|
C as expandHashlockSecret,
|
|
201
201
|
I as expandWotsSeed,
|
|
@@ -208,7 +208,7 @@ export {
|
|
|
208
208
|
X as finalizeScriptPathWithSignatures,
|
|
209
209
|
h as finalizeWronglyChallenged,
|
|
210
210
|
_s as findOverlappingPendingVaults,
|
|
211
|
-
|
|
211
|
+
et as fingerprintReturnedGraph,
|
|
212
212
|
q as formatSatoshisToBtc,
|
|
213
213
|
va as forwardDepositApproval,
|
|
214
214
|
Ue as forwardDeriveContextHash,
|
|
@@ -233,24 +233,24 @@ export {
|
|
|
233
233
|
aa as hexToUint8Array,
|
|
234
234
|
yt as isActivationDeadlinePassedOnChain,
|
|
235
235
|
ea as isAddressFromPublicKey,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
236
|
+
st as isApplicationEntryPointMismatchError,
|
|
237
|
+
Ls as isAuthRejectedError,
|
|
238
|
+
rt as isDepositAmountValid,
|
|
239
|
+
ur as isDepositTermsRejectedError,
|
|
240
|
+
tt as isHintAccepted,
|
|
241
241
|
Ve as isKnownContractError,
|
|
242
|
-
|
|
242
|
+
it as isParticipantKeyDriftError,
|
|
243
243
|
xe as isPeginFingerprintChangedError,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
244
|
+
dr as isPeginFingerprintInputError,
|
|
245
|
+
ot as isPeginRegistrationMissingError,
|
|
246
|
+
nt as isPeginRegistrationNotFinalError,
|
|
247
|
+
Ks as isPegoutTerminalStatus,
|
|
248
|
+
Xs as isRecognizedPegoutStatus,
|
|
249
249
|
pt as isRegisteredVaultVersionMismatchError,
|
|
250
250
|
ce as isRegistrationLogsUnavailableError,
|
|
251
251
|
fs as isUnrecognizedDaemonStatusError,
|
|
252
252
|
sa as isValidHex,
|
|
253
|
-
|
|
253
|
+
gr as isWotsMismatchError,
|
|
254
254
|
Pt as matchKeyHint,
|
|
255
255
|
Et as matchKeySetHint,
|
|
256
256
|
He as parseFundingOutpointsFromTx,
|
|
@@ -258,13 +258,13 @@ export {
|
|
|
258
258
|
cs as peginOutputCount,
|
|
259
259
|
O as peginP2aAnchorOutput,
|
|
260
260
|
N as pinPegoutProof,
|
|
261
|
-
|
|
261
|
+
zs as primeVpTokenRegistry,
|
|
262
262
|
ra as processPublicKeyToXOnly,
|
|
263
263
|
ja as pushTx,
|
|
264
264
|
us as rateBasedTxBufferFee,
|
|
265
|
-
|
|
265
|
+
Rr as rebuildDepositTermsCore,
|
|
266
266
|
G as reclaimVsize,
|
|
267
|
-
|
|
267
|
+
Ar as reconstructPeginParams,
|
|
268
268
|
ya as requireChangeAddress,
|
|
269
269
|
lt as resolveCurrentParticipantKeys,
|
|
270
270
|
ct as resolveParticipantKeysAtEpochs,
|
|
@@ -278,7 +278,7 @@ export {
|
|
|
278
278
|
Rt as summarizeWatchtowerArtifacts,
|
|
279
279
|
b as supportedTxGraphVersions,
|
|
280
280
|
Da as supportsDepositApproval,
|
|
281
|
-
|
|
281
|
+
_r as toRefundInputs,
|
|
282
282
|
ia as toXOnly,
|
|
283
283
|
oa as uint8ArrayToHex,
|
|
284
284
|
At as validateDepositAmount,
|
|
@@ -298,8 +298,8 @@ export {
|
|
|
298
298
|
na as validateWalletPubkey,
|
|
299
299
|
ft as verifyRegisteredParticipantKeys,
|
|
300
300
|
ht as verifyRegisteredVaultVersions,
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
Ys as verifyServerIdentity,
|
|
302
|
+
js as vpTokenRegistry,
|
|
303
303
|
Ot as waitForPeginRegistrationDepth,
|
|
304
304
|
Nt as waitForPeginStatus,
|
|
305
305
|
Ia as waitForTransactionReceiptSmartAware
|
|
@@ -2,8 +2,8 @@ var Q = Object.defineProperty;
|
|
|
2
2
|
var Z = (r, e, t) => e in r ? Q(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var d = (r, e, t) => Z(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import { s as x, S as ee, h as te, p as D } from "./bitcoin-C-TuHb-v.js";
|
|
5
|
-
import { V as re } from "./index-
|
|
6
|
-
import { a as ne } from "./
|
|
5
|
+
import { V as re } from "./index-B6w5MM-8.js";
|
|
6
|
+
import { a as ne } from "./state-mE-QfITd.js";
|
|
7
7
|
import * as J from "@bitcoin-js/tiny-secp256k1-asmjs";
|
|
8
8
|
import { X as A, H as f, C as V } from "./validation-OSC0xTHB.js";
|
|
9
9
|
import { v as ie } from "./bip322Verify-BXYrHBh8.js";
|
|
@@ -742,4 +742,4 @@ export {
|
|
|
742
742
|
nt as p,
|
|
743
743
|
ue as v
|
|
744
744
|
};
|
|
745
|
-
//# sourceMappingURL=primeVpAuth-
|
|
745
|
+
//# sourceMappingURL=primeVpAuth-Bdy_B_Sq.js.map
|