@babylonlabs-io/ts-sdk 0.79.1 → 1.1.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/README.md +11 -5
- package/dist/{signPsbtsWithFallback-f7QLp0q8.js → PayoutManager-CHTOwj0E.js} +26 -26
- package/dist/PayoutManager-CHTOwj0E.js.map +1 -0
- package/dist/PayoutManager-CpfQjtL0.cjs +2 -0
- package/dist/PayoutManager-CpfQjtL0.cjs.map +1 -0
- package/dist/PeginManager-6tjlGd0t.cjs +2 -0
- package/dist/PeginManager-6tjlGd0t.cjs.map +1 -0
- package/dist/{PeginManager-BXlh3ar0.js → PeginManager-DEldv_Ro.js} +23 -22
- package/dist/PeginManager-DEldv_Ro.js.map +1 -0
- package/dist/buildAndBroadcastReclaim-BwT6Jxp5.cjs +2 -0
- package/dist/buildAndBroadcastReclaim-BwT6Jxp5.cjs.map +1 -0
- package/dist/buildAndBroadcastReclaim-CqO2DoP8.js +1919 -0
- package/dist/buildAndBroadcastReclaim-CqO2DoP8.js.map +1 -0
- package/dist/challengeAssert-Cp_GeRg8.js.map +1 -1
- package/dist/challengeAssert-Z7_YULBb.cjs.map +1 -1
- package/dist/deriveVaultRoot-BwbXmN0x.js +79 -0
- package/dist/deriveVaultRoot-BwbXmN0x.js.map +1 -0
- package/dist/deriveVaultRoot-DvhkHzNb.cjs +2 -0
- package/dist/deriveVaultRoot-DvhkHzNb.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +286 -268
- package/dist/index.js.map +1 -1
- package/dist/noPayout-DAWBQ0eG.cjs +2 -0
- package/dist/noPayout-DAWBQ0eG.cjs.map +1 -0
- package/dist/{noPayout-DiGr4eas.js → noPayout-qBXWKwav.js} +3 -3
- package/dist/noPayout-qBXWKwav.js.map +1 -0
- package/dist/onChainBtcPubkey-BXry_CM4.cjs +2 -0
- package/dist/onChainBtcPubkey-BXry_CM4.cjs.map +1 -0
- package/dist/onChainBtcPubkey-C1WqyxPM.js +159 -0
- package/dist/onChainBtcPubkey-C1WqyxPM.js.map +1 -0
- package/dist/parseFundingOutpoints-C_-PT9BT.cjs +2 -0
- package/dist/parseFundingOutpoints-C_-PT9BT.cjs.map +1 -0
- package/dist/parseFundingOutpoints-GSM-IaaK.js +17 -0
- package/dist/parseFundingOutpoints-GSM-IaaK.js.map +1 -0
- package/dist/{pegin-registration-client-pcczkzMg.js → pegin-registration-client-1sZ-74UC.js} +260 -383
- package/dist/pegin-registration-client-1sZ-74UC.js.map +1 -0
- package/dist/pegin-registration-client-BNV44jzw.cjs +2 -0
- package/dist/pegin-registration-client-BNV44jzw.cjs.map +1 -0
- package/dist/shared/index.cjs.map +1 -1
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/wallets/interfaces/BitcoinWallet.d.ts +6 -3
- package/dist/shared/wallets/interfaces/BitcoinWallet.d.ts.map +1 -1
- package/dist/signing-3l5Aqd-H.cjs +2 -0
- package/dist/signing-3l5Aqd-H.cjs.map +1 -0
- package/dist/signing-Dhr2t0Z6.js +39 -0
- package/dist/signing-Dhr2t0Z6.js.map +1 -0
- package/dist/tbv/core/clients/eth/index.cjs +1 -1
- package/dist/tbv/core/clients/eth/index.js +8 -8
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +8 -8
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.d.ts +1 -1
- package/dist/tbv/core/index.js +284 -266
- package/dist/tbv/core/index.js.map +1 -1
- package/dist/tbv/core/managers/PayoutManager.d.ts +1 -1
- package/dist/tbv/core/managers/PeginManager.d.ts +1 -1
- package/dist/tbv/core/managers/index.cjs +1 -1
- package/dist/tbv/core/managers/index.js +2 -2
- package/dist/tbv/core/primitives/index.cjs +1 -1
- package/dist/tbv/core/primitives/index.d.ts +1 -1
- package/dist/tbv/core/primitives/index.js +3 -3
- package/dist/tbv/core/primitives/psbt/__tests__/assertPeginTxShape.test.d.ts +5 -3
- package/dist/tbv/core/primitives/psbt/__tests__/assertPeginTxShape.test.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/__tests__/deriveExpectedPeginPayoutScriptPubKey.test.d.ts +8 -0
- package/dist/tbv/core/primitives/psbt/__tests__/deriveExpectedPeginPayoutScriptPubKey.test.d.ts.map +1 -0
- package/dist/tbv/core/primitives/psbt/assertWasmPeginSizing.d.ts +6 -0
- package/dist/tbv/core/primitives/psbt/assertWasmPeginSizing.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/challengeAssert.d.ts +2 -2
- package/dist/tbv/core/primitives/psbt/challengeAssert.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/noPayout.d.ts +1 -1
- package/dist/tbv/core/primitives/psbt/noPayout.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/payout.d.ts +13 -7
- package/dist/tbv/core/primitives/psbt/payout.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/pegin.d.ts +4 -1
- package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
- package/dist/tbv/core/recovery/recoveryErrors.d.ts +1 -1
- package/dist/tbv/core/services/delegated-claim/__tests__/assembleWatchtowerArtifacts.test.d.ts +15 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/assembleWatchtowerArtifacts.test.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/deriveClaimerWotsKeypair.test.d.ts +11 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/deriveClaimerWotsKeypair.test.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/readWatchtowerArtifacts.test.d.ts +10 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/readWatchtowerArtifacts.test.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/vaultIdBinding.test.d.ts +10 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/vaultIdBinding.test.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/wotsKeypair.golden.test.d.ts +11 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/wotsKeypair.golden.test.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts +46 -0
- package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/challengerBinding.d.ts +72 -0
- package/dist/tbv/core/services/delegated-claim/challengerBinding.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/deriveClaimerWotsKeypair.d.ts +63 -0
- package/dist/tbv/core/services/delegated-claim/deriveClaimerWotsKeypair.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/index.d.ts +55 -0
- package/dist/tbv/core/services/delegated-claim/index.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/payoutBinding.d.ts +65 -0
- package/dist/tbv/core/services/delegated-claim/payoutBinding.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts +70 -0
- package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/types.d.ts +105 -0
- package/dist/tbv/core/services/delegated-claim/types.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/vaultIdBinding.d.ts +44 -0
- package/dist/tbv/core/services/delegated-claim/vaultIdBinding.d.ts.map +1 -0
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.d.ts +1 -0
- package/dist/tbv/core/services/index.d.ts.map +1 -1
- package/dist/tbv/core/services/index.js +73 -56
- package/dist/tbv/core/services/index.js.map +1 -1
- package/dist/tbv/core/utils/index.cjs +1 -1
- package/dist/tbv/core/utils/index.js +44 -43
- package/dist/tbv/core/utils/signing.d.ts +24 -0
- package/dist/tbv/core/utils/signing.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/__tests__/context.golden.test.d.ts +4 -4
- package/dist/tbv/core/vault-secrets/__tests__/context.test.d.ts +1 -2
- package/dist/tbv/core/vault-secrets/__tests__/context.test.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/__tests__/deriveContextHash.vectors.test.d.ts +40 -0
- package/dist/tbv/core/vault-secrets/__tests__/deriveContextHash.vectors.test.d.ts.map +1 -0
- package/dist/tbv/core/vault-secrets/context.d.ts +2 -2
- package/dist/tbv/core/vault-secrets/deriveVaultRoot.d.ts +5 -6
- package/dist/tbv/core/vault-secrets/deriveVaultRoot.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/index.cjs +1 -1
- package/dist/tbv/core/vault-secrets/index.d.ts +2 -2
- package/dist/tbv/core/vault-secrets/index.js +9 -8
- package/dist/tbv/core/vault-secrets/index.js.map +1 -1
- package/dist/tbv/core/wasm/index.cjs +1 -1
- package/dist/tbv/core/wasm/index.cjs.map +1 -1
- package/dist/tbv/core/wasm/index.d.ts +113 -14
- package/dist/tbv/core/wasm/index.d.ts.map +1 -1
- package/dist/tbv/core/wasm/index.js +180 -94
- package/dist/tbv/core/wasm/index.js.map +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +284 -266
- package/dist/tbv/index.js.map +1 -1
- package/dist/tbv/integrations/aave/types.d.ts +1 -1
- package/dist/testing/MockBitcoinWallet.d.ts +1 -1
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/toRefundInputs-BaN9XluU.cjs +2 -0
- package/dist/toRefundInputs-BaN9XluU.cjs.map +1 -0
- package/dist/{toRefundInputs-9inv4Ai4.js → toRefundInputs-mtuuYezp.js} +24 -23
- package/dist/toRefundInputs-mtuuYezp.js.map +1 -0
- package/dist/{types-B9YhlXe8.js → types-BdCEoANP.js} +2 -2
- package/dist/{types-B9YhlXe8.js.map → types-BdCEoANP.js.map} +1 -1
- package/dist/{types-C1tpDycc.cjs → types-BuxreSq4.cjs} +2 -2
- package/dist/{types-C1tpDycc.cjs.map → types-BuxreSq4.cjs.map} +1 -1
- package/dist/{verifyKeyPathSchnorrSignature-BVtNwgK6.js → verifyKeyPathSchnorrSignature-BQHNhRj6.js} +2 -2
- package/dist/{verifyKeyPathSchnorrSignature-BVtNwgK6.js.map → verifyKeyPathSchnorrSignature-BQHNhRj6.js.map} +1 -1
- package/dist/{verifyKeyPathSchnorrSignature-BjB8Znly.cjs → verifyKeyPathSchnorrSignature-Gm9EmZkx.cjs} +2 -2
- package/dist/{verifyKeyPathSchnorrSignature-BjB8Znly.cjs.map → verifyKeyPathSchnorrSignature-Gm9EmZkx.cjs.map} +1 -1
- package/dist/verifyScriptPathSchnorrSignature-BKZihCjk.cjs +2 -0
- package/dist/verifyScriptPathSchnorrSignature-BKZihCjk.cjs.map +1 -0
- package/dist/{verifyScriptPathSchnorrSignature-D_epga4j.js → verifyScriptPathSchnorrSignature-CpjSTfMj.js} +371 -330
- package/dist/verifyScriptPathSchnorrSignature-CpjSTfMj.js.map +1 -0
- package/package.json +3 -3
- package/dist/PeginManager-BXlh3ar0.js.map +0 -1
- package/dist/PeginManager-BuVSknB0.cjs +0 -2
- package/dist/PeginManager-BuVSknB0.cjs.map +0 -1
- package/dist/buildAndBroadcastReclaim-N9dXH9dm.cjs +0 -2
- package/dist/buildAndBroadcastReclaim-N9dXH9dm.cjs.map +0 -1
- package/dist/buildAndBroadcastReclaim-O6z9kvc4.js +0 -1545
- package/dist/buildAndBroadcastReclaim-O6z9kvc4.js.map +0 -1
- package/dist/noPayout-4RZB2g1e.cjs +0 -2
- package/dist/noPayout-4RZB2g1e.cjs.map +0 -1
- package/dist/noPayout-DiGr4eas.js.map +0 -1
- package/dist/onChainBtcPubkey-BbxRrbvg.cjs +0 -2
- package/dist/onChainBtcPubkey-BbxRrbvg.cjs.map +0 -1
- package/dist/onChainBtcPubkey-C-6UWpD8.js +0 -34
- package/dist/onChainBtcPubkey-C-6UWpD8.js.map +0 -1
- package/dist/parseFundingOutpoints-B4iQeX6q.cjs +0 -2
- package/dist/parseFundingOutpoints-B4iQeX6q.cjs.map +0 -1
- package/dist/parseFundingOutpoints-BQWvINfm.js +0 -93
- package/dist/parseFundingOutpoints-BQWvINfm.js.map +0 -1
- package/dist/pegin-registration-client-CZgcU2_0.cjs +0 -2
- package/dist/pegin-registration-client-CZgcU2_0.cjs.map +0 -1
- package/dist/pegin-registration-client-pcczkzMg.js.map +0 -1
- package/dist/signPsbtsWithFallback-DtwzL5AA.cjs +0 -2
- package/dist/signPsbtsWithFallback-DtwzL5AA.cjs.map +0 -1
- package/dist/signPsbtsWithFallback-f7QLp0q8.js.map +0 -1
- package/dist/signing-BJ3X66b-.cjs +0 -2
- package/dist/signing-BJ3X66b-.cjs.map +0 -1
- package/dist/signing-Cm-McVR2.js +0 -22
- package/dist/signing-Cm-McVR2.js.map +0 -1
- package/dist/toRefundInputs-9inv4Ai4.js.map +0 -1
- package/dist/toRefundInputs-DitGWAnz.cjs +0 -2
- package/dist/toRefundInputs-DitGWAnz.cjs.map +0 -1
- package/dist/verifyScriptPathSchnorrSignature-D_epga4j.js.map +0 -1
- package/dist/verifyScriptPathSchnorrSignature-DaRqvEgW.cjs +0 -2
- package/dist/verifyScriptPathSchnorrSignature-DaRqvEgW.cjs.map +0 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Binding between a delegated-claim Payout and the destination the vault
|
|
3
|
+
* registered on chain.
|
|
4
|
+
*
|
|
5
|
+
* The Payout transaction is built by the vault provider and moves the whole
|
|
6
|
+
* recovered peg-in. Its outputs are the one thing in this flow that decides
|
|
7
|
+
* where the money lands, and nothing in the artifacts file constrains them:
|
|
8
|
+
* the Rust verification proves the bundled signatures are self-consistent
|
|
9
|
+
* with the same graph that named the outputs. So a graph correctly bound to
|
|
10
|
+
* this vault can still carry a Payout that pays somebody else, and the
|
|
11
|
+
* depositor would sign it in the same prompt as everything else.
|
|
12
|
+
*
|
|
13
|
+
* This is the claim-side counterpart of `assertPayoutOutputLayout` in
|
|
14
|
+
* `primitives/psbt/payout.ts`, which the deposit-time path already runs for
|
|
15
|
+
* the same `depositor-as-claimer` role. It pins the same four things: the
|
|
16
|
+
* output count, the payout script, the CPFP anchor value, and the version
|
|
17
|
+
* and locktime the depositor's signature commits to.
|
|
18
|
+
*
|
|
19
|
+
* @module services/delegated-claim/payoutBinding
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Thrown when a Payout does not pay the vault's registered destination.
|
|
23
|
+
*
|
|
24
|
+
* @experimental
|
|
25
|
+
*/
|
|
26
|
+
export declare class PayoutDestinationError extends Error {
|
|
27
|
+
/** The vault's registered payout scriptPubKey, hex. */
|
|
28
|
+
readonly expectedScriptHex: string;
|
|
29
|
+
/** The scriptPubKey the Payout actually pays, hex. */
|
|
30
|
+
readonly actualScriptHex: string;
|
|
31
|
+
constructor(
|
|
32
|
+
/** The vault's registered payout scriptPubKey, hex. */
|
|
33
|
+
expectedScriptHex: string,
|
|
34
|
+
/** The scriptPubKey the Payout actually pays, hex. */
|
|
35
|
+
actualScriptHex: string);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The Payout to check, and the destination it must pay.
|
|
39
|
+
*
|
|
40
|
+
* @experimental
|
|
41
|
+
*/
|
|
42
|
+
export interface AssertPayoutPaysRegisteredScriptParams {
|
|
43
|
+
/** A Payout signing PSBT, base64, as the graph produced it. */
|
|
44
|
+
payoutPsbtBase64: string;
|
|
45
|
+
/**
|
|
46
|
+
* `depositorPayoutScriptPubKey` as the vault registered it on chain, hex.
|
|
47
|
+
* The vault provider does not choose this value, which is the whole point
|
|
48
|
+
* of comparing against it.
|
|
49
|
+
*/
|
|
50
|
+
registeredPayoutScriptPubKey: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Throws unless the Payout pays the vault's registered payout script.
|
|
54
|
+
*
|
|
55
|
+
* Run this on every Payout PSBT before the wallet is prompted. Both the
|
|
56
|
+
* depositor and the claimer PSBT describe the same transaction, so both must
|
|
57
|
+
* pass; checking only one would leave the other free to differ.
|
|
58
|
+
*
|
|
59
|
+
* @throws {@link PayoutDestinationError} when output 0 pays elsewhere, or a
|
|
60
|
+
* plain error when the layout is not the canonical claimer layout.
|
|
61
|
+
*
|
|
62
|
+
* @experimental
|
|
63
|
+
*/
|
|
64
|
+
export declare function assertPayoutPaysRegisteredScript(params: AssertPayoutPaysRegisteredScriptParams): void;
|
|
65
|
+
//# sourceMappingURL=payoutBinding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payoutBinding.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/delegated-claim/payoutBinding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAgBH;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAE7C,uDAAuD;IACvD,QAAQ,CAAC,iBAAiB,EAAE,MAAM;IAClC,sDAAsD;IACtD,QAAQ,CAAC,eAAe,EAAE,MAAM;;IAHhC,uDAAuD;IAC9C,iBAAiB,EAAE,MAAM;IAClC,sDAAsD;IAC7C,eAAe,EAAE,MAAM;CAUnC;AAED;;;;GAIG;AACH,MAAM,WAAW,sCAAsC;IACrD,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,4BAA4B,EAAE,MAAM,CAAC;CACtC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,sCAAsC,GAC7C,IAAI,CAmDN"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { WatchtowerArtifactsSummary } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Graph version the delegated-claim artifacts format exists for. Vaults on
|
|
4
|
+
* graph v1 and v2 predate it and have no artifacts path at all.
|
|
5
|
+
*
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
export declare const DELEGATED_CLAIM_TX_GRAPH_VERSION = 3;
|
|
9
|
+
/**
|
|
10
|
+
* Thrown when an artifacts file does not describe the vault being claimed.
|
|
11
|
+
*
|
|
12
|
+
* @experimental
|
|
13
|
+
*/
|
|
14
|
+
export declare class ArtifactsVaultMismatchError extends Error {
|
|
15
|
+
readonly expectedVaultId: string;
|
|
16
|
+
readonly actualVaultId: string;
|
|
17
|
+
constructor(expectedVaultId: string, actualVaultId: string);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Reads the small, self-describing fields of an artifacts file.
|
|
21
|
+
*
|
|
22
|
+
* This parses the whole JSON, so it is bounded by whatever the file carries
|
|
23
|
+
* in `babe_sessions`. Keep those sessions in their own file: a bundle with
|
|
24
|
+
* real sessions runs to hundreds of megabytes per challenger and cannot be
|
|
25
|
+
* parsed in a browser tab.
|
|
26
|
+
*
|
|
27
|
+
* Experimental: this API can change in a minor release. Pin the SDK
|
|
28
|
+
* version if you build on it.
|
|
29
|
+
*
|
|
30
|
+
* @throws If the file is not JSON, or lacks the fields every artifacts file
|
|
31
|
+
* has.
|
|
32
|
+
* @experimental
|
|
33
|
+
*/
|
|
34
|
+
export declare function summarizeWatchtowerArtifacts(artifactsJson: string): WatchtowerArtifactsSummary;
|
|
35
|
+
/**
|
|
36
|
+
* The file to check, and the vault it must belong to.
|
|
37
|
+
*
|
|
38
|
+
* @experimental
|
|
39
|
+
*/
|
|
40
|
+
export interface AssertArtifactsUsableParams {
|
|
41
|
+
artifactsJson: string;
|
|
42
|
+
/** Vault the caller intends to claim, `0x`-prefixed or bare hex. */
|
|
43
|
+
expectedVaultId: string;
|
|
44
|
+
/**
|
|
45
|
+
* Depositor's Ethereum address, used with the file's PegIn txid to
|
|
46
|
+
* re-derive the vault id. Without it the only check would be the file's
|
|
47
|
+
* self-declared `vault_id`.
|
|
48
|
+
*/
|
|
49
|
+
depositorEthAddress: string;
|
|
50
|
+
/**
|
|
51
|
+
* Graph version to verify under. Defaults to the only version the format
|
|
52
|
+
* exists for. A file that records a different `vault_core_version` is
|
|
53
|
+
* rejected rather than verified under this one.
|
|
54
|
+
*/
|
|
55
|
+
txGraphVersion?: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Verifies an artifacts file and confirms it is the one for this vault.
|
|
59
|
+
*
|
|
60
|
+
* Experimental: this API can change in a minor release. Pin the SDK
|
|
61
|
+
* version if you build on it.
|
|
62
|
+
*
|
|
63
|
+
* @throws {@link ArtifactsVaultMismatchError} when the file names a different
|
|
64
|
+
* vault, {@link VaultIdBindingError} when the graph it carries
|
|
65
|
+
* belongs to another vault whatever the file says, or a verification
|
|
66
|
+
* error when any bundled signature does not hold against that graph.
|
|
67
|
+
* @experimental
|
|
68
|
+
*/
|
|
69
|
+
export declare function assertArtifactsUsableForVault(params: AssertArtifactsUsableParams): Promise<WatchtowerArtifactsSummary>;
|
|
70
|
+
//# sourceMappingURL=readWatchtowerArtifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readWatchtowerArtifacts.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/delegated-claim/readWatchtowerArtifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAO1D;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAElD;;;;GAIG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IAElD,QAAQ,CAAC,eAAe,EAAE,MAAM;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM;gBADrB,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,MAAM;CAQjC;AAYD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,MAAM,GACpB,0BAA0B,CA2C5B;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,0BAA0B,CAAC,CA+CrC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* The small, non-opaque fields of an `artifacts.json` file.
|
|
4
|
+
*
|
|
5
|
+
* @experimental
|
|
6
|
+
*/
|
|
7
|
+
export interface WatchtowerArtifactsSummary {
|
|
8
|
+
/**
|
|
9
|
+
* Vault Core version the file records, absent on files written before the
|
|
10
|
+
* field existed. `assertArtifactsUsableForVault` refuses a file whose
|
|
11
|
+
* value differs from the version it verifies under.
|
|
12
|
+
*/
|
|
13
|
+
vaultCoreVersion?: number;
|
|
14
|
+
/** 32-byte on-chain vault id, as the file records it. */
|
|
15
|
+
vaultId: string;
|
|
16
|
+
/** Txid of the fully signed Claim transaction the file carries. */
|
|
17
|
+
claimTxid: string;
|
|
18
|
+
/**
|
|
19
|
+
* Txid of the PegIn output that Claim spends. Together with the depositor's
|
|
20
|
+
* Ethereum address this derives the vault id, which is the only check that
|
|
21
|
+
* binds the file's graph to a vault — `vault_id` itself is self-declared.
|
|
22
|
+
*/
|
|
23
|
+
peginTxid: string;
|
|
24
|
+
proverCircuitVersion: number;
|
|
25
|
+
/**
|
|
26
|
+
* Block of the finalized `VaultClaimableBy` event, or `0n` when the file was
|
|
27
|
+
* assembled before the Ethereum withdrawal was initiated. A claim run
|
|
28
|
+
* against zero proves the wrong block and fails before Assert, so
|
|
29
|
+
* `assertArtifactsUsableForVault` refuses it.
|
|
30
|
+
*
|
|
31
|
+
* `bigint`, matching {@link DelegatedClaimVaultContext} and the WASM
|
|
32
|
+
* boundary — a block number is a u64 there.
|
|
33
|
+
*/
|
|
34
|
+
claimableEventBlockNumber: bigint;
|
|
35
|
+
/** Hex challenger public keys the file carries BaBe sessions for. */
|
|
36
|
+
babeSessionChallengerPubkeys: string[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Inputs the vault provider supplies for artifact assembly.
|
|
40
|
+
*
|
|
41
|
+
* @experimental
|
|
42
|
+
*/
|
|
43
|
+
export interface ClaimerArtifactsSource {
|
|
44
|
+
/** `tx_graph_json` from `requestDepositorClaimerArtifacts`. */
|
|
45
|
+
txGraphJson: string;
|
|
46
|
+
/**
|
|
47
|
+
* `verifying_key_hex` from the same response.
|
|
48
|
+
*
|
|
49
|
+
* Trusted from the vault provider. This value is written into the
|
|
50
|
+
* artifacts file and is the key `pinPegoutProof` later verifies the
|
|
51
|
+
* Groth16 proof against, so a provider that supplies a key of its own
|
|
52
|
+
* choosing makes that verification prove nothing. No registry read in
|
|
53
|
+
* this SDK exposes a verifying key, or a hash of one, per
|
|
54
|
+
* `proverCircuitVersion`, so there is nothing to compare it with yet.
|
|
55
|
+
* Obtain it over an authenticated channel, and re-check it here once the
|
|
56
|
+
* chain exposes an anchor.
|
|
57
|
+
*/
|
|
58
|
+
verifyingKeyHex: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* On-chain facts the assembled artifacts commit to.
|
|
62
|
+
*
|
|
63
|
+
* @experimental
|
|
64
|
+
*/
|
|
65
|
+
export interface DelegatedClaimVaultContext {
|
|
66
|
+
vaultId: Hex;
|
|
67
|
+
/**
|
|
68
|
+
* Depositor's Ethereum address, the one the vault was registered under.
|
|
69
|
+
* With the PegIn txid it re-derives {@link DelegatedClaimVaultContext.vaultId},
|
|
70
|
+
* which is how a vault-provider-served graph is bound to this vault.
|
|
71
|
+
*/
|
|
72
|
+
depositorEthAddress: Hex;
|
|
73
|
+
/**
|
|
74
|
+
* `depositorPayoutScriptPubKey` as the vault registered it on chain, hex.
|
|
75
|
+
* The Payout the vault provider builds is checked against this before the
|
|
76
|
+
* wallet signs it.
|
|
77
|
+
*/
|
|
78
|
+
registeredPayoutScriptPubKey: string;
|
|
79
|
+
/** Vault provider's BTC public key, registered on chain for this vault. */
|
|
80
|
+
vaultProviderBtcPubkey: string;
|
|
81
|
+
/** Vault keepers registered on chain, the local challengers of this claim. */
|
|
82
|
+
vaultKeeperBtcPubkeys: string[];
|
|
83
|
+
/** Universal challengers registered on chain. */
|
|
84
|
+
universalChallengerBtcPubkeys: string[];
|
|
85
|
+
/** Graph (vault core) version of the vault. Delegated claim requires 3. */
|
|
86
|
+
txGraphVersion: number;
|
|
87
|
+
proverCircuitVersion: number;
|
|
88
|
+
/**
|
|
89
|
+
* Vault Core version from the finalized `PegInSubmitted` event. The builder
|
|
90
|
+
* refuses a graph that records a different one, which is what stops a graph
|
|
91
|
+
* built under other rules from being signed.
|
|
92
|
+
*/
|
|
93
|
+
vaultCoreVersion: number;
|
|
94
|
+
/**
|
|
95
|
+
* Block of the finalized `VaultClaimableBy` event.
|
|
96
|
+
*
|
|
97
|
+
* Zero is accepted, because the file is meant to be assembled while the
|
|
98
|
+
* vault provider is still online, which can be long before the withdrawal
|
|
99
|
+
* is initiated. Such a file is not claimable as written: nothing in the SDK
|
|
100
|
+
* fills the field in later, and `assertArtifactsUsableForVault` refuses it.
|
|
101
|
+
* Pass the real block whenever the event has already finalized.
|
|
102
|
+
*/
|
|
103
|
+
claimableEventBlockNumber: bigint;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/delegated-claim/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;;;;;;;OAQG;IACH,yBAAyB,EAAE,MAAM,CAAC;IAClC,qEAAqE;IACrE,4BAA4B,EAAE,MAAM,EAAE,CAAC;CACxC;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,GAAG,CAAC;IACb;;;;OAIG;IACH,mBAAmB,EAAE,GAAG,CAAC;IACzB;;;;OAIG;IACH,4BAA4B,EAAE,MAAM,CAAC;IACrC,2EAA2E;IAC3E,sBAAsB,EAAE,MAAM,CAAC;IAC/B,8EAA8E;IAC9E,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,iDAAiD;IACjD,6BAA6B,EAAE,MAAM,EAAE,CAAC;IACxC,2EAA2E;IAC3E,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;;;;;OAQG;IACH,yBAAyB,EAAE,MAAM,CAAC;CACnC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Transaction } from 'bitcoinjs-lib';
|
|
2
|
+
/**
|
|
3
|
+
* Thrown when a graph does not belong to the vault it is presented for.
|
|
4
|
+
*
|
|
5
|
+
* @experimental
|
|
6
|
+
*/
|
|
7
|
+
export declare class VaultIdBindingError extends Error {
|
|
8
|
+
readonly expectedVaultId: string;
|
|
9
|
+
readonly derivedVaultId: string;
|
|
10
|
+
readonly peginTxid: string;
|
|
11
|
+
constructor(expectedVaultId: string, derivedVaultId: string, peginTxid: string);
|
|
12
|
+
}
|
|
13
|
+
/** Display-order txid of the PegIn output the Claim PSBT spends. */
|
|
14
|
+
export declare function peginTxidFromClaimPsbt(claimPsbtBase64: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Display-order txid of the PegIn output a signed Claim transaction spends.
|
|
17
|
+
*/
|
|
18
|
+
export declare function peginTxidFromClaimTx(claimTx: Transaction): string;
|
|
19
|
+
/**
|
|
20
|
+
* The three values the on-chain vault id is derived from and compared with.
|
|
21
|
+
*
|
|
22
|
+
* @experimental
|
|
23
|
+
*/
|
|
24
|
+
export interface AssertClaimSpendsVaultParams {
|
|
25
|
+
/** Display-order PegIn txid, from the Claim's first input. */
|
|
26
|
+
peginTxid: string;
|
|
27
|
+
/** Depositor's Ethereum address, the second half of the on-chain id. */
|
|
28
|
+
depositorEthAddress: string;
|
|
29
|
+
/** Vault id the graph or file claims to be for. */
|
|
30
|
+
expectedVaultId: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Throws unless the Claim's PegIn input derives the expected vault id.
|
|
34
|
+
*
|
|
35
|
+
* Experimental: this API can change in a minor release. Pin the SDK
|
|
36
|
+
* version if you build on it.
|
|
37
|
+
*
|
|
38
|
+
* @throws {@link VaultIdBindingError} when the graph belongs to another vault.
|
|
39
|
+
* @experimental
|
|
40
|
+
*/
|
|
41
|
+
export declare function assertClaimSpendsVault(params: AssertClaimSpendsVaultParams): void;
|
|
42
|
+
/** Lowercase, `0x`-prefixed form of a 32-byte vault id. */
|
|
43
|
+
export declare function normalizeVaultId(vaultId: string): string;
|
|
44
|
+
//# sourceMappingURL=vaultIdBinding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vaultIdBinding.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/delegated-claim/vaultIdBinding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAQ,WAAW,EAAE,MAAM,eAAe,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAE1C,QAAQ,CAAC,eAAe,EAAE,MAAM;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM;gBAFjB,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM;CAU7B;AAED,oEAAoE;AACpE,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAYtE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAQjE;AAED;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mDAAmD;IACnD,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,4BAA4B,GACnC,IAAI,CAQN;AAED,2DAA2D;AAC3D,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGxD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../PayoutManager-CpfQjtL0.cjs"),t=require("../../../buildAndBroadcastReclaim-BwT6Jxp5.cjs"),i=require("../wasm/index.cjs"),e=require("../../../peginState-eaQ4IO_R.cjs");exports.computeHashlock=a.computeHashlock;exports.validateSecretAgainstHashlock=a.validateSecretAgainstHashlock;exports.ApplicationEntryPointMismatchError=t.ApplicationEntryPointMismatchError;exports.ArtifactsVaultMismatchError=t.ArtifactsVaultMismatchError;exports.BIP68NotMatureError=t.BIP68NotMatureError;exports.ChallengerSetMismatchError=t.ChallengerSetMismatchError;exports.ClaimerPegoutStatusValue=t.ClaimerPegoutStatusValue;exports.DELEGATED_CLAIM_TX_GRAPH_VERSION=t.DELEGATED_CLAIM_TX_GRAPH_VERSION;exports.PEGIN_ETH_CONFIRMATIONS=t.PEGIN_ETH_CONFIRMATIONS;exports.ParticipantKeyDriftError=t.ParticipantKeyDriftError;exports.PayoutDestinationError=t.PayoutDestinationError;exports.PeginRegistrationMissingError=t.PeginRegistrationMissingError;exports.PeginRegistrationNotFinalError=t.PeginRegistrationNotFinalError;exports.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR=t.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR;exports.RECLAIM_MAX_FEE_FRACTION_NUMERATOR=t.RECLAIM_MAX_FEE_FRACTION_NUMERATOR;exports.RECLAIM_MAX_FEE_RATE_SATS_VB=t.RECLAIM_MAX_FEE_RATE_SATS_VB;exports.RECLAIM_WARN_FEE_FRACTION_NUMERATOR=t.RECLAIM_WARN_FEE_FRACTION_NUMERATOR;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.ReclaimUneconomicalError=t.ReclaimUneconomicalError;exports.RegisteredVaultVersionMismatchError=t.RegisteredVaultVersionMismatchError;exports.VaultIdBindingError=t.VaultIdBindingError;exports.activateVault=t.activateVault;exports.activateVaultAndRedeem=t.activateVaultAndRedeem;exports.assembleWatchtowerArtifacts=t.assembleWatchtowerArtifacts;exports.assertArtifactsUsableForVault=t.assertArtifactsUsableForVault;exports.assertChallengerSetMatchesVault=t.assertChallengerSetMatchesVault;exports.assertClaimSpendsVault=t.assertClaimSpendsVault;exports.assertPayoutPaysRegisteredScript=t.assertPayoutPaysRegisteredScript;exports.assertVaultProviderHintAccepted=t.assertVaultProviderHintAccepted;exports.buildAndBroadcastReclaim=t.buildAndBroadcastReclaim;exports.buildAndBroadcastRefund=t.buildAndBroadcastRefund;exports.deriveClaimerWotsKeypair=t.deriveClaimerWotsKeypair;exports.estimateRefundFeeSats=t.estimateRefundFeeSats;exports.isApplicationEntryPointMismatchError=t.isApplicationEntryPointMismatchError;exports.isDepositAmountValid=t.isDepositAmountValid;exports.isHintAccepted=t.isHintAccepted;exports.isParticipantKeyDriftError=t.isParticipantKeyDriftError;exports.isPeginRegistrationMissingError=t.isPeginRegistrationMissingError;exports.isPeginRegistrationNotFinalError=t.isPeginRegistrationNotFinalError;exports.isPegoutTerminalStatus=t.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=t.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=t.isRegisteredVaultVersionMismatchError;exports.matchKeyHint=t.matchKeyHint;exports.matchKeySetHint=t.matchKeySetHint;exports.resolveCurrentParticipantKeys=t.resolveCurrentParticipantKeys;exports.resolveParticipantKeysAtEpochs=t.resolveParticipantKeysAtEpochs;exports.runDepositorPresignFlow=t.runDepositorPresignFlow;exports.signDepositorGraph=t.signDepositorGraph;exports.submitWotsPublicKey=t.submitWotsPublicKey;exports.summarizeWatchtowerArtifacts=t.summarizeWatchtowerArtifacts;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.verifyRegisteredParticipantKeys=t.verifyRegisteredParticipantKeys;exports.verifyRegisteredVaultVersions=t.verifyRegisteredVaultVersions;exports.waitForPeginRegistrationDepth=t.waitForPeginRegistrationDepth;exports.waitForPeginStatus=t.waitForPeginStatus;exports.attachFinalizedAssert=i.attachFinalizedAssert;exports.finalizePayout=i.finalizePayout;exports.finalizeWronglyChallenged=i.finalizeWronglyChallenged;exports.pinPegoutProof=i.pinPegoutProof;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/services/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/services/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
@@ -1,63 +1,80 @@
|
|
|
1
|
-
import { c as s, v as i } from "../../../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { c as s, v as i } from "../../../PayoutManager-CHTOwj0E.js";
|
|
2
|
+
import { p as r, A as o, X as n, C as l, T as E, D as c, i as A, F as u, P as R, j as d, k as P, a4 as _, a5 as g, a6 as m, a7 as p, _ as M, $ as F, a0 as N, a1 as C, a2 as V, R as h, V as y, a as S, b as v, c as I, e as T, f, h as D, g as O, L as K, a3 as U, Y as H, d as b, Z as X, q as B, t as L, M as W, G as w, l as z, m as x, W as G, U as k, I as Z, N as j, O as q, Q as J, S as Q, r as Y, n as $, o as aa, s as ta, u as sa, x as ia, v as ea, y as ra, z as oa, B as na, E as la, H as Ea, J as ca, w as Aa, K as ua } from "../../../buildAndBroadcastReclaim-CqO2DoP8.js";
|
|
3
|
+
import { attachFinalizedAssert as da, finalizePayout as Pa, finalizeWronglyChallenged as _a, pinPegoutProof as ga } from "../wasm/index.js";
|
|
4
|
+
import { C as pa, P as Ma, c as Fa, g as Na, i as Ca } from "../../../peginState-CxDiaKuk.js";
|
|
4
5
|
export {
|
|
5
6
|
r as ApplicationEntryPointMismatchError,
|
|
6
|
-
o as
|
|
7
|
-
n as
|
|
8
|
-
|
|
9
|
-
E as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
A as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
g as
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
F as
|
|
24
|
-
N as
|
|
7
|
+
o as ArtifactsVaultMismatchError,
|
|
8
|
+
n as BIP68NotMatureError,
|
|
9
|
+
l as ChallengerSetMismatchError,
|
|
10
|
+
E as ClaimerPegoutStatusValue,
|
|
11
|
+
pa as ContractStatus,
|
|
12
|
+
c as DELEGATED_CLAIM_TX_GRAPH_VERSION,
|
|
13
|
+
A as PEGIN_ETH_CONFIRMATIONS,
|
|
14
|
+
u as ParticipantKeyDriftError,
|
|
15
|
+
R as PayoutDestinationError,
|
|
16
|
+
Ma as PeginAction,
|
|
17
|
+
d as PeginRegistrationMissingError,
|
|
18
|
+
P as PeginRegistrationNotFinalError,
|
|
19
|
+
_ as RECLAIM_MAX_FEE_FRACTION_DENOMINATOR,
|
|
20
|
+
g as RECLAIM_MAX_FEE_FRACTION_NUMERATOR,
|
|
21
|
+
m as RECLAIM_MAX_FEE_RATE_SATS_VB,
|
|
22
|
+
p as RECLAIM_WARN_FEE_FRACTION_NUMERATOR,
|
|
23
|
+
M as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
|
|
24
|
+
F as REFUND_MAX_FEE_FRACTION_NUMERATOR,
|
|
25
|
+
N as REFUND_MAX_FEE_RATE_SATS_VB,
|
|
26
|
+
C as REFUND_VSIZE,
|
|
27
|
+
V as ReclaimUneconomicalError,
|
|
28
|
+
h as RegisteredVaultVersionMismatchError,
|
|
29
|
+
y as VaultIdBindingError,
|
|
30
|
+
S as activateVault,
|
|
25
31
|
v as activateVaultAndRedeem,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
I as assembleWatchtowerArtifacts,
|
|
33
|
+
T as assertArtifactsUsableForVault,
|
|
34
|
+
f as assertChallengerSetMatchesVault,
|
|
35
|
+
D as assertClaimSpendsVault,
|
|
36
|
+
O as assertPayoutPaysRegisteredScript,
|
|
37
|
+
K as assertVaultProviderHintAccepted,
|
|
38
|
+
da as attachFinalizedAssert,
|
|
39
|
+
U as buildAndBroadcastReclaim,
|
|
40
|
+
H as buildAndBroadcastRefund,
|
|
41
|
+
Fa as canPerformAction,
|
|
30
42
|
s as computeHashlock,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
b as deriveClaimerWotsKeypair,
|
|
44
|
+
X as estimateRefundFeeSats,
|
|
45
|
+
Pa as finalizePayout,
|
|
46
|
+
_a as finalizeWronglyChallenged,
|
|
47
|
+
Na as getPeginProtocolState,
|
|
48
|
+
Ca as isActivationDeadlinePassedOnChain,
|
|
49
|
+
B as isApplicationEntryPointMismatchError,
|
|
50
|
+
L as isDepositAmountValid,
|
|
51
|
+
W as isHintAccepted,
|
|
52
|
+
w as isParticipantKeyDriftError,
|
|
53
|
+
z as isPeginRegistrationMissingError,
|
|
54
|
+
x as isPeginRegistrationNotFinalError,
|
|
55
|
+
G as isPegoutTerminalStatus,
|
|
56
|
+
k as isRecognizedPegoutStatus,
|
|
57
|
+
Z as isRegisteredVaultVersionMismatchError,
|
|
58
|
+
j as matchKeyHint,
|
|
59
|
+
q as matchKeySetHint,
|
|
60
|
+
ga as pinPegoutProof,
|
|
61
|
+
J as resolveCurrentParticipantKeys,
|
|
62
|
+
Q as resolveParticipantKeysAtEpochs,
|
|
63
|
+
Y as runDepositorPresignFlow,
|
|
64
|
+
$ as signDepositorGraph,
|
|
65
|
+
aa as submitWotsPublicKey,
|
|
66
|
+
ta as summarizeWatchtowerArtifacts,
|
|
67
|
+
sa as validateDepositAmount,
|
|
68
|
+
ia as validateMultiVaultDepositInputs,
|
|
69
|
+
ea as validateOnChainParticipantKeys,
|
|
70
|
+
ra as validateProviderSelection,
|
|
71
|
+
oa as validateRemainingCapacity,
|
|
55
72
|
i as validateSecretAgainstHashlock,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
73
|
+
na as validateVaultAmounts,
|
|
74
|
+
la as validateVaultProviderPubkey,
|
|
75
|
+
Ea as verifyRegisteredParticipantKeys,
|
|
76
|
+
ca as verifyRegisteredVaultVersions,
|
|
77
|
+
Aa as waitForPeginRegistrationDepth,
|
|
78
|
+
ua as waitForPeginStatus
|
|
62
79
|
};
|
|
63
80
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../abortSignals-msbmbqFe.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../abortSignals-msbmbqFe.cjs"),E=require("../../../signing-3l5Aqd-H.cjs"),_=require("../../../validation-C6XTfZak.cjs"),n=require("./eth/index.cjs"),e=require("../../../psbtInputFields-BrV_ZfL_.cjs"),t=require("../../../fundPeginTransaction-54-Rwb2k.cjs"),a=require("../../../reservation-Dr2HLCxx.cjs"),r=require("../../../bitcoin-D-O2GjbC.cjs");exports.combineAbortSignals=i.combineAbortSignals;exports.calculateBtcTxHash=E.calculateBtcTxHash;exports.createTaprootScriptPathSignOptions=E.createTaprootScriptPathSignOptions;exports.createTaprootScriptPathSignOptionsForInput=E.createTaprootScriptPathSignOptionsForInput;exports.BITCOIN_ADDRESS_RE=_.BITCOIN_ADDRESS_RE;exports.COMPRESSED_PUBKEY_HEX_LEN=_.COMPRESSED_PUBKEY_HEX_LEN;exports.HEX_RE=_.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=_.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=_.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=_.TXID_RE;exports.X_ONLY_PUBKEY_HEX_LEN=_.X_ONLY_PUBKEY_HEX_LEN;exports.waitForTransactionReceiptSmartAware=n.waitForTransactionReceiptSmartAware;exports.BitcoinScriptType=e.BitcoinScriptType;exports.applyChangeOutputPolicy=e.applyChangeOutputPolicy;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.BTC_DUST_SAT=t.BTC_DUST_SAT;exports.DUST_THRESHOLD=t.DUST_THRESHOLD;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=a.UtxoNotAvailableError;exports.assertUtxosAvailable=a.assertUtxosAvailable;exports.extractInputsFromTransaction=a.extractInputsFromTransaction;exports.findOverlappingPendingVaults=a.findOverlappingPendingVaults;exports.validateUtxosAvailable=a.validateUtxosAvailable;exports.getNetwork=r.getNetwork;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,53 +1,54 @@
|
|
|
1
1
|
import { c as t } from "../../../abortSignals-BPpAUL1Z.js";
|
|
2
|
-
import { c as
|
|
3
|
-
import { B as
|
|
4
|
-
import { waitForTransactionReceiptSmartAware as
|
|
5
|
-
import { B as R, a as U, c as
|
|
6
|
-
import { B as
|
|
7
|
-
import { U as
|
|
8
|
-
import { k as
|
|
2
|
+
import { c as o, a as E, b as _ } from "../../../signing-Dhr2t0Z6.js";
|
|
3
|
+
import { B as T, C as p, H as S, K as n, M as i, T as A, X as c } from "../../../validation-OSC0xTHB.js";
|
|
4
|
+
import { waitForTransactionReceiptSmartAware as O } from "./eth/index.js";
|
|
5
|
+
import { B as R, a as U, c as I, b as l, d as F, g as N, h as g, f as B, s as f, e as x } from "../../../psbtInputFields-CCVyaQMi.js";
|
|
6
|
+
import { B as m, D as d, L as C, M as D, c as X, P as H, b as h, a as b, S as M, T as Y, W as v, f as W, d as y, p as G, r as K } from "../../../fundPeginTransaction-CwhRbCQC.js";
|
|
7
|
+
import { U as V, a as Z, e as k, f as j, v as q } from "../../../reservation-Cj9F0rP9.js";
|
|
8
|
+
import { k as J } from "../../../bitcoin-C-TuHb-v.js";
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
T as BITCOIN_ADDRESS_RE,
|
|
11
|
+
m as BTC_DUST_SAT,
|
|
12
12
|
R as BitcoinScriptType,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
p as COMPRESSED_PUBKEY_HEX_LEN,
|
|
14
|
+
d as DUST_THRESHOLD,
|
|
15
|
+
S as HEX_RE,
|
|
16
|
+
n as KNOWN_SCRIPT_PREFIXES,
|
|
17
|
+
C as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
18
|
+
D as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
19
|
+
i as MAX_REASONABLE_FEE_SATS,
|
|
20
|
+
X as MAX_REASONABLE_PEGIN_VBYTES,
|
|
21
|
+
H as P2TR_INPUT_SIZE,
|
|
22
|
+
h as PEGIN_AUTH_ANCHOR_OUTPUTS,
|
|
23
|
+
b as PEGIN_FIXED_OUTPUTS,
|
|
24
24
|
M as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
A as TXID_RE,
|
|
26
|
+
Y as TX_BUFFER_SIZE_OVERHEAD,
|
|
27
|
+
V as UtxoNotAvailableError,
|
|
28
|
+
v as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
29
|
+
c as X_ONLY_PUBKEY_HEX_LEN,
|
|
30
30
|
U as applyChangeOutputPolicy,
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
Z as assertUtxosAvailable,
|
|
32
|
+
o as calculateBtcTxHash,
|
|
33
33
|
t as combineAbortSignals,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
k as
|
|
40
|
-
|
|
34
|
+
I as computeChangeOutputFeeSats,
|
|
35
|
+
l as computeMaxDeposit,
|
|
36
|
+
F as computePeginBaseFeeSats,
|
|
37
|
+
E as createTaprootScriptPathSignOptions,
|
|
38
|
+
_ as createTaprootScriptPathSignOptionsForInput,
|
|
39
|
+
k as extractInputsFromTransaction,
|
|
40
|
+
j as findOverlappingPendingVaults,
|
|
41
|
+
W as fundPeginTransaction,
|
|
41
42
|
N as getDustThreshold,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
J as getNetwork,
|
|
44
|
+
g as getPsbtInputFields,
|
|
45
|
+
B as getScriptType,
|
|
46
|
+
y as parseUnfundedWasmTransaction,
|
|
47
|
+
G as peginOutputCount,
|
|
48
|
+
K as rateBasedTxBufferFee,
|
|
48
49
|
f as selectUtxosForPegin,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
x as shouldAddChangeOutput,
|
|
51
|
+
q as validateUtxosAvailable,
|
|
52
|
+
O as waitForTransactionReceiptSmartAware
|
|
52
53
|
};
|
|
53
54
|
//# sourceMappingURL=index.js.map
|
|
@@ -12,4 +12,28 @@ import { SignPsbtOptions } from '../../../shared/wallets/interfaces';
|
|
|
12
12
|
* for indices 0 through inputCount-1.
|
|
13
13
|
*/
|
|
14
14
|
export declare function createTaprootScriptPathSignOptions(publicKey: string, inputCount: number): SignPsbtOptions;
|
|
15
|
+
/**
|
|
16
|
+
* Create SignPsbtOptions for a Taproot script-path PSBT whose signing input
|
|
17
|
+
* is not input 0 — the delegated-claim Payout, where input 0 is the PegIn
|
|
18
|
+
* UTXO and the claimer signs the Assert connector at input 1.
|
|
19
|
+
*
|
|
20
|
+
* Same flags and the same caveat as
|
|
21
|
+
* {@link createTaprootScriptPathSignOptions}: the produced signature must be
|
|
22
|
+
* validated before the PSBT is treated as signed.
|
|
23
|
+
*
|
|
24
|
+
* @param publicKey - Signer's BTC public key (hex), compressed or x-only.
|
|
25
|
+
* @param inputIndex - Index of the single input to sign.
|
|
26
|
+
* @param address - Signer's BTC address. A wallet derives a key-path address
|
|
27
|
+
* from `publicKey` and compares it with the input's address, so `publicKey`
|
|
28
|
+
* alone cannot sign an input that sits at a different address — every
|
|
29
|
+
* script-path connector output. UniSat refuses input 1 of the claimer Payout
|
|
30
|
+
* (the Assert connector) on `publicKey` and signs it on `address`. The
|
|
31
|
+
* caller must confirm the address belongs to `publicKey` before passing it;
|
|
32
|
+
* `assembleWatchtowerArtifacts` does that against `depositorPublicKey`.
|
|
33
|
+
*
|
|
34
|
+
* @experimental Added for the delegated claim, which is still under test and
|
|
35
|
+
* is its only caller. This signature can change in a minor
|
|
36
|
+
* release.
|
|
37
|
+
*/
|
|
38
|
+
export declare function createTaprootScriptPathSignOptionsForInput(publicKey: string, inputIndex: number, address?: string): SignPsbtOptions;
|
|
15
39
|
//# sourceMappingURL=signing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signing.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/utils/signing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAE1E;;;;;;;;;;;GAWG;AACH,wBAAgB,kCAAkC,CAChD,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,eAAe,CAajB"}
|
|
1
|
+
{"version":3,"file":"signing.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/utils/signing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAE1E;;;;;;;;;;;GAWG;AACH,wBAAgB,kCAAkC,CAChD,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,eAAe,CAajB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,0CAA0C,CACxD,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,GACf,eAAe,CAiBjB"}
|