@babylonlabs-io/ts-sdk 0.57.1 → 0.58.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-CnX3uFb0.js → PeginManager-C8ixWlUM.js} +319 -298
- package/dist/PeginManager-C8ixWlUM.js.map +1 -0
- package/dist/PeginManager-CogqZaa2.cjs +2 -0
- package/dist/PeginManager-CogqZaa2.cjs.map +1 -0
- package/dist/{batchPoll-DTYXoTEc.js → batchPoll-B0VxT62K.js} +4 -4
- package/dist/{batchPoll-DTYXoTEc.js.map → batchPoll-B0VxT62K.js.map} +1 -1
- package/dist/{batchPoll-BXIy3R7h.cjs → batchPoll-D5IDDOa8.cjs} +2 -2
- package/dist/{batchPoll-BXIy3R7h.cjs.map → batchPoll-D5IDDOa8.cjs.map} +1 -1
- package/dist/{bitcoin-B5aNKtsk.js → bitcoin-d9eaaZB_.js} +49 -46
- package/dist/bitcoin-d9eaaZB_.js.map +1 -0
- package/dist/bitcoin-m84N5a8o.cjs +2 -0
- package/dist/bitcoin-m84N5a8o.cjs.map +1 -0
- package/dist/buildAndBroadcastRefund-BL8u-Ti4.cjs +2 -0
- package/dist/buildAndBroadcastRefund-BL8u-Ti4.cjs.map +1 -0
- package/dist/{buildAndBroadcastRefund-Bo3AlqCk.js → buildAndBroadcastRefund-DBA-Mp4I.js} +557 -484
- package/dist/buildAndBroadcastRefund-DBA-Mp4I.js.map +1 -0
- package/dist/{challengeAssert-Cu-PtJ1g.cjs → challengeAssert-BFRE2DM-.cjs} +2 -2
- package/dist/{challengeAssert-Cu-PtJ1g.cjs.map → challengeAssert-BFRE2DM-.cjs.map} +1 -1
- package/dist/{challengeAssert-BVQq50su.js → challengeAssert-C7PzyJ7g.js} +2 -2
- package/dist/{challengeAssert-BVQq50su.js.map → challengeAssert-C7PzyJ7g.js.map} +1 -1
- package/dist/constants-DU5CGcqO.cjs +2 -0
- package/dist/{constants-BqU1Uz15.cjs.map → constants-DU5CGcqO.cjs.map} +1 -1
- package/dist/constants-GjWXdaqV.js +23 -0
- package/dist/{constants-CDQE812z.js.map → constants-GjWXdaqV.js.map} +1 -1
- package/dist/{deriveVaultRoot-B_gEOTD6.js → deriveVaultRoot-D0RY5GJc.js} +2 -2
- package/dist/{deriveVaultRoot-B_gEOTD6.js.map → deriveVaultRoot-D0RY5GJc.js.map} +1 -1
- package/dist/{deriveVaultRoot-CebLadyJ.cjs → deriveVaultRoot-p4uGsM7w.cjs} +2 -2
- package/dist/{deriveVaultRoot-CebLadyJ.cjs.map → deriveVaultRoot-p4uGsM7w.cjs.map} +1 -1
- package/dist/errors-2aF9oRwM.cjs +2 -0
- package/dist/errors-2aF9oRwM.cjs.map +1 -0
- package/dist/errors-kXGQXKxZ.js +28 -0
- package/dist/errors-kXGQXKxZ.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +188 -180
- package/dist/{mempoolApi-C0olk43O.js → mempoolApi-CMHEz4ez.js} +3 -3
- package/dist/{mempoolApi-C0olk43O.js.map → mempoolApi-CMHEz4ez.js.map} +1 -1
- package/dist/{mempoolApi-Dsm2VPXp.cjs → mempoolApi-DfD3_Y6v.cjs} +2 -2
- package/dist/{mempoolApi-Dsm2VPXp.cjs.map → mempoolApi-DfD3_Y6v.cjs.map} +1 -1
- package/dist/{noPayout-CI4l1qu2.js → noPayout-DuE-UyhQ.js} +5 -5
- package/dist/{noPayout-CI4l1qu2.js.map → noPayout-DuE-UyhQ.js.map} +1 -1
- package/dist/{noPayout-Djrv31V5.cjs → noPayout-qUEtRKc_.cjs} +2 -2
- package/dist/{noPayout-Djrv31V5.cjs.map → noPayout-qUEtRKc_.cjs.map} +1 -1
- package/dist/{onChainBtcPubkey-Cd9kpz-S.cjs → onChainBtcPubkey-C_a2L3kL.cjs} +2 -2
- package/dist/{onChainBtcPubkey-Cd9kpz-S.cjs.map → onChainBtcPubkey-C_a2L3kL.cjs.map} +1 -1
- package/dist/{onChainBtcPubkey-aPY5ib3Q.js → onChainBtcPubkey-DeF4cKoO.js} +2 -2
- package/dist/{onChainBtcPubkey-aPY5ib3Q.js.map → onChainBtcPubkey-DeF4cKoO.js.map} +1 -1
- package/dist/peginInput-Ci921gTl.cjs +2 -0
- package/dist/peginInput-Ci921gTl.cjs.map +1 -0
- package/dist/peginInput-HQPWZfly.js +123 -0
- package/dist/peginInput-HQPWZfly.js.map +1 -0
- package/dist/{reservation-cHDRn4DA.js → reservation-CbAXa7VG.js} +2 -2
- package/dist/{reservation-cHDRn4DA.js.map → reservation-CbAXa7VG.js.map} +1 -1
- package/dist/{reservation-ClEs2X0H.cjs → reservation-RGKvg2x6.cjs} +2 -2
- package/dist/{reservation-ClEs2X0H.cjs.map → reservation-RGKvg2x6.cjs.map} +1 -1
- package/dist/signPsbtsWithFallback-Xs4jZw5z.cjs +2 -0
- package/dist/signPsbtsWithFallback-Xs4jZw5z.cjs.map +1 -0
- package/dist/{signPsbtsWithFallback-CzZFZf0I.js → signPsbtsWithFallback-eY1YgV13.js} +69 -67
- package/dist/signPsbtsWithFallback-eY1YgV13.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/deposit-terms/__tests__/depositTermsErrors.test.d.ts +2 -0
- package/dist/tbv/core/deposit-terms/__tests__/depositTermsErrors.test.d.ts.map +1 -0
- package/dist/tbv/core/deposit-terms/buildDepositTerms.d.ts.map +1 -1
- package/dist/tbv/core/deposit-terms/depositTerms.d.ts +72 -25
- package/dist/tbv/core/deposit-terms/depositTerms.d.ts.map +1 -1
- package/dist/tbv/core/deposit-terms/depositTermsErrors.d.ts +24 -0
- package/dist/tbv/core/deposit-terms/depositTermsErrors.d.ts.map +1 -0
- package/dist/tbv/core/deposit-terms/index.d.ts +2 -1
- package/dist/tbv/core/deposit-terms/index.d.ts.map +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +179 -171
- package/dist/tbv/core/managers/PayoutManager.d.ts +2 -0
- package/dist/tbv/core/managers/PayoutManager.d.ts.map +1 -1
- package/dist/tbv/core/managers/PeginManager.d.ts +16 -3
- package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
- package/dist/tbv/core/managers/index.cjs +1 -1
- package/dist/tbv/core/managers/index.js +2 -2
- package/dist/tbv/core/primitives/index.cjs +1 -1
- package/dist/tbv/core/primitives/index.d.ts +1 -1
- package/dist/tbv/core/primitives/index.d.ts.map +1 -1
- package/dist/tbv/core/primitives/index.js +16 -15
- package/dist/tbv/core/primitives/psbt/assertPayoutFeeBand.d.ts +14 -32
- package/dist/tbv/core/primitives/psbt/assertPayoutFeeBand.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/constants.d.ts +10 -1
- package/dist/tbv/core/primitives/psbt/constants.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/payout.d.ts +8 -2
- package/dist/tbv/core/primitives/psbt/payout.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/peginInput.d.ts.map +1 -1
- package/dist/tbv/core/primitives/utils/bitcoin.d.ts +25 -1
- package/dist/tbv/core/primitives/utils/bitcoin.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/runDepositorPresignFlow.d.ts +1 -1
- package/dist/tbv/core/services/deposit/runDepositorPresignFlow.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts +1 -1
- package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/validateOnChainParticipantKeys.d.ts.map +1 -1
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +35 -31
- package/dist/tbv/core/services/participants/__tests__/indexerKeyHint.test.d.ts +9 -0
- package/dist/tbv/core/services/participants/__tests__/indexerKeyHint.test.d.ts.map +1 -0
- package/dist/tbv/core/services/participants/index.d.ts +2 -0
- package/dist/tbv/core/services/participants/index.d.ts.map +1 -1
- package/dist/tbv/core/services/participants/indexerKeyHint.d.ts +61 -0
- package/dist/tbv/core/services/participants/indexerKeyHint.d.ts.map +1 -0
- package/dist/tbv/core/utils/index.cjs +1 -1
- package/dist/tbv/core/utils/index.js +3 -3
- package/dist/tbv/core/vault-secrets/index.cjs +1 -1
- package/dist/tbv/core/vault-secrets/index.js +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +179 -171
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/{verifyScriptPathSchnorrSignature-Xoo9DOHW.js → verifyScriptPathSchnorrSignature-Bav08_7R.js} +268 -240
- package/dist/verifyScriptPathSchnorrSignature-Bav08_7R.js.map +1 -0
- package/dist/verifyScriptPathSchnorrSignature-CYjK4IP_.cjs +2 -0
- package/dist/verifyScriptPathSchnorrSignature-CYjK4IP_.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/PeginManager-CnX3uFb0.js.map +0 -1
- package/dist/PeginManager-iDbqXsKD.cjs +0 -2
- package/dist/PeginManager-iDbqXsKD.cjs.map +0 -1
- package/dist/bitcoin-B5aNKtsk.js.map +0 -1
- package/dist/bitcoin-CHfKAhcI.cjs +0 -2
- package/dist/bitcoin-CHfKAhcI.cjs.map +0 -1
- package/dist/buildAndBroadcastRefund-4uAl7OIk.cjs +0 -2
- package/dist/buildAndBroadcastRefund-4uAl7OIk.cjs.map +0 -1
- package/dist/buildAndBroadcastRefund-Bo3AlqCk.js.map +0 -1
- package/dist/constants-BqU1Uz15.cjs +0 -2
- package/dist/constants-CDQE812z.js +0 -21
- package/dist/errors-B-H0seUG.js +0 -8
- package/dist/errors-B-H0seUG.js.map +0 -1
- package/dist/errors-Bfjxg_iJ.cjs +0 -2
- package/dist/errors-Bfjxg_iJ.cjs.map +0 -1
- package/dist/peginInput-BKD_b3gq.js +0 -105
- package/dist/peginInput-BKD_b3gq.js.map +0 -1
- package/dist/peginInput-CAiiDZeO.cjs +0 -2
- package/dist/peginInput-CAiiDZeO.cjs.map +0 -1
- package/dist/signPsbtsWithFallback-C01N6Kdo.cjs +0 -2
- package/dist/signPsbtsWithFallback-C01N6Kdo.cjs.map +0 -1
- package/dist/signPsbtsWithFallback-CzZFZf0I.js.map +0 -1
- package/dist/verifyScriptPathSchnorrSignature-C-84KJ6U.cjs +0 -2
- package/dist/verifyScriptPathSchnorrSignature-C-84KJ6U.cjs.map +0 -1
- package/dist/verifyScriptPathSchnorrSignature-Xoo9DOHW.js.map +0 -1
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { B as
|
|
5
|
-
import { e as
|
|
6
|
-
import { v as
|
|
7
|
-
import { D as
|
|
8
|
-
import { Transaction as
|
|
9
|
-
import { c as
|
|
10
|
-
import { c as
|
|
11
|
-
import { c as
|
|
12
|
-
import { a as
|
|
13
|
-
import { a as
|
|
14
|
-
const
|
|
15
|
-
function
|
|
1
|
+
var he = Object.defineProperty;
|
|
2
|
+
var de = (e, t, r) => t in e ? he(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var A = (e, t, r) => de(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { B as ge } from "./BTCVaultRegistry.abi-CixOlp3B.js";
|
|
5
|
+
import { e as fe, v as ye, s as d, u as te, p as L, c as k, f as C } from "./bitcoin-d9eaaZB_.js";
|
|
6
|
+
import { v as ve, b as Pe, s as me, P as be, d as we } from "./signPsbtsWithFallback-eY1YgV13.js";
|
|
7
|
+
import { D as E, c as ke, b as xe, R as Ee, d as re } from "./json-rpc-client-DuUARJvV.js";
|
|
8
|
+
import { Transaction as $, Psbt as Ce } from "bitcoinjs-lib";
|
|
9
|
+
import { c as Te, d as N, e as D, f as F } from "./verifyScriptPathSchnorrSignature-Bav08_7R.js";
|
|
10
|
+
import { c as Se, a as $e, b as _e } from "./noPayout-DuE-UyhQ.js";
|
|
11
|
+
import { c as M } from "./signing-DaLvGwQe.js";
|
|
12
|
+
import { a as X } from "./onChainBtcPubkey-DeF4cKoO.js";
|
|
13
|
+
import { a as Be } from "./constants-GjWXdaqV.js";
|
|
14
|
+
const Ae = /^0x[0-9a-fA-F]{64}$/, Re = /^0x[0-9a-fA-F]{40}$/, Ke = /^0x([0-9a-fA-F]{2})*$/;
|
|
15
|
+
function R(e, t) {
|
|
16
16
|
if (e.length !== 66)
|
|
17
17
|
throw new Error(
|
|
18
18
|
`${t} must be 32 bytes (66 hex chars with 0x prefix), got length ${e.length}`
|
|
19
19
|
);
|
|
20
|
-
if (!
|
|
20
|
+
if (!Ae.test(e))
|
|
21
21
|
throw new Error(
|
|
22
22
|
`${t} must contain only hex characters after the 0x prefix`
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
if (!
|
|
25
|
+
function Ve(e, t) {
|
|
26
|
+
if (!Re.test(e))
|
|
27
27
|
throw new Error(
|
|
28
28
|
`${t} must be a 20-byte 0x-prefixed hex address (42 chars)`
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
if (!
|
|
31
|
+
function Ie(e, t) {
|
|
32
|
+
if (!Ke.test(e))
|
|
33
33
|
throw new Error(
|
|
34
34
|
`${t} must be a 0x-prefixed hex string with an even number of hex chars`
|
|
35
35
|
);
|
|
@@ -38,91 +38,92 @@ async function _t(e) {
|
|
|
38
38
|
const {
|
|
39
39
|
btcVaultRegistryAddress: t,
|
|
40
40
|
vaultId: r,
|
|
41
|
-
hashlock:
|
|
42
|
-
activationMetadata:
|
|
41
|
+
hashlock: n,
|
|
42
|
+
activationMetadata: s,
|
|
43
43
|
writeContract: l,
|
|
44
|
-
signal:
|
|
44
|
+
signal: o
|
|
45
45
|
} = e;
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
46
|
+
o == null || o.throwIfAborted(), Ve(t, "btcVaultRegistryAddress"), R(r, "vaultId");
|
|
47
|
+
const a = fe(e.secret);
|
|
48
|
+
if (R(a, "secret"), n !== void 0 && (R(n, "hashlock"), !ve(a, n)))
|
|
49
49
|
throw new Error(
|
|
50
50
|
"Invalid secret: SHA256(secret) does not match the provided hashlock"
|
|
51
51
|
);
|
|
52
|
-
return
|
|
52
|
+
return Ie(s, "activationMetadata"), l({
|
|
53
53
|
address: t,
|
|
54
|
-
abi:
|
|
54
|
+
abi: ge,
|
|
55
55
|
functionName: "activateVaultWithSecret",
|
|
56
|
-
args: [r,
|
|
56
|
+
args: [r, a, s]
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
const
|
|
59
|
+
const G = 1, Oe = 1;
|
|
60
60
|
function He(e, t) {
|
|
61
|
-
const r = d(t).toLowerCase(),
|
|
62
|
-
if (
|
|
61
|
+
const r = d(t).toLowerCase(), s = e.map((l) => d(l).toLowerCase()).filter((l) => l !== r);
|
|
62
|
+
if (s.length === 0)
|
|
63
63
|
throw new Error(
|
|
64
64
|
"Cannot derive localChallengers: vault keeper set is empty (or contains only the depositor)"
|
|
65
65
|
);
|
|
66
|
-
if (new Set(
|
|
66
|
+
if (new Set(s).size !== s.length)
|
|
67
67
|
throw new Error(
|
|
68
68
|
"Cannot derive localChallengers: duplicate vaultKeeper key — signing context is misconfigured"
|
|
69
69
|
);
|
|
70
|
-
return
|
|
70
|
+
return s;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
const
|
|
72
|
+
function Ne(e, t, r) {
|
|
73
|
+
const n = r.map(
|
|
74
74
|
(c) => d(c).toLowerCase()
|
|
75
|
-
),
|
|
76
|
-
if (
|
|
75
|
+
), s = t.filter((c) => n.includes(c));
|
|
76
|
+
if (s.length > 0)
|
|
77
77
|
throw new Error(
|
|
78
|
-
`Cannot validate challenger set: vault keepers and universal challengers overlap (${
|
|
78
|
+
`Cannot validate challenger set: vault keepers and universal challengers overlap (${s.join(", ")})`
|
|
79
79
|
);
|
|
80
|
-
const l = [...t, ...
|
|
80
|
+
const l = [...t, ...n], o = e.map(
|
|
81
81
|
(c) => d(c.challenger_pubkey).toLowerCase()
|
|
82
|
-
),
|
|
83
|
-
if (
|
|
82
|
+
), a = new Set(o);
|
|
83
|
+
if (a.size !== o.length)
|
|
84
84
|
throw new Error(
|
|
85
85
|
"Depositor graph contains duplicate challenger entries in challenger_presign_data"
|
|
86
86
|
);
|
|
87
|
-
const u = new Set(l), i = l.filter((c) => !
|
|
87
|
+
const u = new Set(l), i = l.filter((c) => !a.has(c)), p = o.filter((c) => !u.has(c));
|
|
88
88
|
if (i.length > 0 || p.length > 0)
|
|
89
89
|
throw new Error(
|
|
90
90
|
"Depositor graph challenger set does not match expected (local ∪ universal)" + (i.length > 0 ? ` (missing: ${i.join(", ")})` : "") + (p.length > 0 ? ` (unexpected: ${p.join(", ")})` : "")
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function De(e, t) {
|
|
94
94
|
const r = e.ins[t];
|
|
95
|
-
return
|
|
95
|
+
return te(new Uint8Array(r.hash).slice().reverse());
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function K(e, t, r, n, s) {
|
|
98
98
|
const l = e.ins[t];
|
|
99
99
|
if (l.index !== 0)
|
|
100
100
|
throw new Error(
|
|
101
|
-
`NoPayout (challenger ${
|
|
101
|
+
`NoPayout (challenger ${s}) input ${t} expected to spend ${n} vout 0, got vout ${l.index}`
|
|
102
102
|
);
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
103
|
+
const o = r.getId(), a = De(e, t);
|
|
104
|
+
if (a !== o)
|
|
105
105
|
throw new Error(
|
|
106
|
-
`NoPayout (challenger ${
|
|
106
|
+
`NoPayout (challenger ${s}) input ${t} does not reference ${n} (expected txid ${o}, got ${a})`
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
|
-
async function
|
|
110
|
-
const
|
|
109
|
+
async function Fe(e, t, r) {
|
|
110
|
+
const n = [], s = [], l = [], o = He(
|
|
111
111
|
r.vaultKeeperBtcPubkeys,
|
|
112
112
|
r.depositorBtcPubkey
|
|
113
113
|
);
|
|
114
|
-
|
|
114
|
+
Ne(
|
|
115
115
|
e.challenger_presign_data,
|
|
116
|
-
|
|
116
|
+
o,
|
|
117
117
|
r.universalChallengerBtcPubkeys
|
|
118
118
|
);
|
|
119
|
-
const
|
|
119
|
+
const a = await Te({
|
|
120
120
|
vaultCoreVersion: r.vaultCoreVersion,
|
|
121
121
|
vkClaimerPayoutScriptPubKeys: r.vkClaimerPayoutScriptPubKeys,
|
|
122
122
|
vpCommissionScriptPubKey: r.vpCommissionScriptPubKey,
|
|
123
123
|
payoutTxHex: e.payout_tx.tx_hex,
|
|
124
124
|
peginTxHex: r.peginTxHex,
|
|
125
125
|
assertTxHex: e.assert_tx.tx_hex,
|
|
126
|
+
timelockAssert: r.timelockAssert,
|
|
126
127
|
depositorBtcPubkey: r.depositorBtcPubkey,
|
|
127
128
|
vaultProviderBtcPubkey: r.vaultProviderBtcPubkey,
|
|
128
129
|
vaultKeeperBtcPubkeys: r.vaultKeeperBtcPubkeys,
|
|
@@ -131,79 +132,79 @@ async function Me(e, t, r) {
|
|
|
131
132
|
network: r.network,
|
|
132
133
|
claimerBtcPubkey: r.depositorBtcPubkey,
|
|
133
134
|
registeredPayoutScriptPubKey: r.registeredPayoutScriptPubKey,
|
|
134
|
-
commissionBps:
|
|
135
|
+
commissionBps: Oe,
|
|
135
136
|
protocolFeeRate: r.protocolFeeRate,
|
|
136
137
|
councilSize: r.councilMembers.length
|
|
137
138
|
});
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
n.push(a.psbtHex), s.push(
|
|
140
|
+
M(
|
|
140
141
|
t,
|
|
141
|
-
|
|
142
|
+
G
|
|
142
143
|
)
|
|
143
144
|
);
|
|
144
|
-
const u = d(r.depositorBtcPubkey), i =
|
|
145
|
+
const u = d(r.depositorBtcPubkey), i = $.fromHex(
|
|
145
146
|
d(e.assert_tx.tx_hex)
|
|
146
147
|
);
|
|
147
148
|
for (const p of e.challenger_presign_data) {
|
|
148
|
-
const c = d(p.challenger_pubkey), h =
|
|
149
|
+
const c = d(p.challenger_pubkey), h = n.length, f = await Me({
|
|
149
150
|
challenger: p,
|
|
150
151
|
challengerPubkey: c,
|
|
151
152
|
claimerPubkey: u,
|
|
152
|
-
localChallengers:
|
|
153
|
+
localChallengers: o,
|
|
153
154
|
assertTxParsed: i,
|
|
154
155
|
ctx: r
|
|
155
156
|
});
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
n.push(f), s.push(
|
|
158
|
+
M(
|
|
158
159
|
t,
|
|
159
|
-
|
|
160
|
+
G
|
|
160
161
|
)
|
|
161
162
|
), l.push({
|
|
162
163
|
challengerPubkey: c,
|
|
163
164
|
noPayoutIdx: h
|
|
164
165
|
});
|
|
165
166
|
}
|
|
166
|
-
return { psbtHexes:
|
|
167
|
+
return { psbtHexes: n, signOptions: s, challengerEntries: l };
|
|
167
168
|
}
|
|
168
|
-
async function
|
|
169
|
+
async function Me(e) {
|
|
169
170
|
const {
|
|
170
171
|
challenger: t,
|
|
171
172
|
challengerPubkey: r,
|
|
172
|
-
claimerPubkey:
|
|
173
|
-
localChallengers:
|
|
173
|
+
claimerPubkey: n,
|
|
174
|
+
localChallengers: s,
|
|
174
175
|
assertTxParsed: l,
|
|
175
|
-
ctx:
|
|
176
|
+
ctx: o
|
|
176
177
|
} = e;
|
|
177
|
-
|
|
178
|
+
Se(
|
|
178
179
|
t.nopayout_tx.tx_hex,
|
|
179
180
|
r,
|
|
180
|
-
|
|
181
|
+
o.network
|
|
181
182
|
);
|
|
182
|
-
const
|
|
183
|
+
const a = $.fromHex(
|
|
183
184
|
d(t.nopayout_tx.tx_hex)
|
|
184
|
-
), u =
|
|
185
|
+
), u = $.fromHex(
|
|
185
186
|
d(t.challenge_assert_x_tx.tx_hex)
|
|
186
|
-
), i =
|
|
187
|
+
), i = $.fromHex(
|
|
187
188
|
d(t.challenge_assert_y_tx.tx_hex)
|
|
188
189
|
);
|
|
189
|
-
if (
|
|
190
|
+
if (a.ins.length !== 3)
|
|
190
191
|
throw new Error(
|
|
191
|
-
`NoPayout (challenger ${r}) must have exactly 3 inputs, got ${
|
|
192
|
+
`NoPayout (challenger ${r}) must have exactly 3 inputs, got ${a.ins.length}`
|
|
192
193
|
);
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
K(
|
|
195
|
+
a,
|
|
195
196
|
0,
|
|
196
197
|
l,
|
|
197
198
|
"Assert",
|
|
198
199
|
r
|
|
199
|
-
),
|
|
200
|
-
|
|
200
|
+
), K(
|
|
201
|
+
a,
|
|
201
202
|
1,
|
|
202
203
|
u,
|
|
203
204
|
"ChallengeAssertX",
|
|
204
205
|
r
|
|
205
|
-
),
|
|
206
|
-
|
|
206
|
+
), K(
|
|
207
|
+
a,
|
|
207
208
|
2,
|
|
208
209
|
i,
|
|
209
210
|
"ChallengeAssertY",
|
|
@@ -214,7 +215,7 @@ async function Ue(e) {
|
|
|
214
215
|
u.outs[0],
|
|
215
216
|
i.outs[0]
|
|
216
217
|
].map((c) => ({
|
|
217
|
-
script_pubkey:
|
|
218
|
+
script_pubkey: te(new Uint8Array(c.script)),
|
|
218
219
|
value: c.value
|
|
219
220
|
}));
|
|
220
221
|
return $e({
|
|
@@ -222,68 +223,68 @@ async function Ue(e) {
|
|
|
222
223
|
challengerPubkey: r,
|
|
223
224
|
prevouts: p,
|
|
224
225
|
connectorParams: {
|
|
225
|
-
txGraphVersion:
|
|
226
|
-
claimer:
|
|
227
|
-
localChallengers:
|
|
228
|
-
universalChallengers:
|
|
229
|
-
timelockAssert:
|
|
230
|
-
councilMembers:
|
|
231
|
-
councilQuorum:
|
|
226
|
+
txGraphVersion: o.vaultCoreVersion,
|
|
227
|
+
claimer: n,
|
|
228
|
+
localChallengers: s,
|
|
229
|
+
universalChallengers: o.universalChallengerBtcPubkeys,
|
|
230
|
+
timelockAssert: o.timelockAssert,
|
|
231
|
+
councilMembers: o.councilMembers,
|
|
232
|
+
councilQuorum: o.councilQuorum
|
|
232
233
|
}
|
|
233
234
|
});
|
|
234
235
|
}
|
|
235
|
-
function
|
|
236
|
-
|
|
237
|
-
const
|
|
236
|
+
function Ue(e, t, r) {
|
|
237
|
+
N(e[0]);
|
|
238
|
+
const s = D(
|
|
238
239
|
e[0].returnedPsbtHex,
|
|
239
240
|
r
|
|
240
241
|
);
|
|
241
|
-
|
|
242
|
+
F({
|
|
242
243
|
requestedPsbtHex: e[0].requestedPsbtHex,
|
|
243
|
-
signatureHex:
|
|
244
|
+
signatureHex: s,
|
|
244
245
|
signerXOnlyPubkeyHex: r,
|
|
245
246
|
inputIndex: 0
|
|
246
247
|
});
|
|
247
248
|
const l = {};
|
|
248
|
-
for (const
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
e[
|
|
249
|
+
for (const o of t) {
|
|
250
|
+
N(e[o.noPayoutIdx]);
|
|
251
|
+
const a = D(
|
|
252
|
+
e[o.noPayoutIdx].returnedPsbtHex,
|
|
252
253
|
r
|
|
253
254
|
);
|
|
254
|
-
|
|
255
|
-
requestedPsbtHex: e[
|
|
256
|
-
signatureHex:
|
|
255
|
+
F({
|
|
256
|
+
requestedPsbtHex: e[o.noPayoutIdx].requestedPsbtHex,
|
|
257
|
+
signatureHex: a,
|
|
257
258
|
signerXOnlyPubkeyHex: r,
|
|
258
259
|
inputIndex: 0
|
|
259
|
-
}), l[
|
|
260
|
-
nopayout_signature:
|
|
260
|
+
}), l[o.challengerPubkey] = {
|
|
261
|
+
nopayout_signature: a
|
|
261
262
|
};
|
|
262
263
|
}
|
|
263
264
|
return {
|
|
264
265
|
payout_signatures: {
|
|
265
|
-
payout_signature:
|
|
266
|
+
payout_signature: s
|
|
266
267
|
},
|
|
267
268
|
per_challenger: l
|
|
268
269
|
};
|
|
269
270
|
}
|
|
270
|
-
async function
|
|
271
|
-
const { depositorGraph: t, btcWallet: r, signingContext:
|
|
272
|
-
|
|
273
|
-
d(
|
|
274
|
-
), { psbtHexes:
|
|
271
|
+
async function Le(e) {
|
|
272
|
+
const { depositorGraph: t, btcWallet: r, signingContext: n } = e, s = await r.getPublicKeyHex(), { depositorPubkey: l } = ye(
|
|
273
|
+
s,
|
|
274
|
+
d(n.depositorBtcPubkey)
|
|
275
|
+
), { psbtHexes: o, signOptions: a, challengerEntries: u } = await Fe(
|
|
275
276
|
t,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
), i = await
|
|
277
|
+
s,
|
|
278
|
+
n
|
|
279
|
+
), i = await Pe(
|
|
279
280
|
r,
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
), p =
|
|
281
|
+
o,
|
|
282
|
+
a
|
|
283
|
+
), p = o.map((c, h) => ({
|
|
283
284
|
requestedPsbtHex: c,
|
|
284
285
|
returnedPsbtHex: i[h]
|
|
285
286
|
}));
|
|
286
|
-
return
|
|
287
|
+
return Ue(
|
|
287
288
|
p,
|
|
288
289
|
u,
|
|
289
290
|
l
|
|
@@ -294,98 +295,130 @@ async function ne(e) {
|
|
|
294
295
|
const {
|
|
295
296
|
statusReader: t,
|
|
296
297
|
peginTxid: r,
|
|
297
|
-
targetStatuses:
|
|
298
|
-
timeoutMs:
|
|
298
|
+
targetStatuses: n,
|
|
299
|
+
timeoutMs: s,
|
|
299
300
|
pollIntervalMs: l = ze,
|
|
300
|
-
signal:
|
|
301
|
-
} = e,
|
|
301
|
+
signal: o
|
|
302
|
+
} = e, a = Date.now();
|
|
302
303
|
for (; ; ) {
|
|
303
|
-
if (
|
|
304
|
+
if (o != null && o.aborted)
|
|
304
305
|
throw new Error(
|
|
305
|
-
`Polling aborted for pegin ${r.slice(0, 8)}… (target: ${[...
|
|
306
|
+
`Polling aborted for pegin ${r.slice(0, 8)}… (target: ${[...n].join(", ")})`
|
|
306
307
|
);
|
|
307
|
-
if (Date.now() -
|
|
308
|
+
if (Date.now() - a >= s)
|
|
308
309
|
throw new Error(
|
|
309
|
-
`Polling timeout after ${
|
|
310
|
+
`Polling timeout after ${s}ms for pegin ${r.slice(0, 8)}… (target: ${[...n].join(", ")})`
|
|
310
311
|
);
|
|
311
312
|
try {
|
|
312
313
|
const u = await t.getPeginStatus(
|
|
313
314
|
{ pegin_txid: r },
|
|
314
|
-
|
|
315
|
+
o
|
|
315
316
|
);
|
|
316
317
|
if (u.pegin_txid.toLowerCase() !== r.toLowerCase())
|
|
317
318
|
throw new Error(
|
|
318
319
|
`getPeginStatus returned status for pegin ${u.pegin_txid.slice(0, 8)}…, requested ${r.slice(0, 8)}…`
|
|
319
320
|
);
|
|
320
321
|
const i = u.status;
|
|
321
|
-
if (
|
|
322
|
+
if (n.has(i) || i === E.ACTIVATED)
|
|
322
323
|
return i;
|
|
323
|
-
if (i ===
|
|
324
|
+
if (i === E.EXPIRED || ke.has(i))
|
|
324
325
|
throw new Error(
|
|
325
|
-
`Pegin ${r.slice(0, 8)}… reached terminal status "${i}" while waiting for ${[...
|
|
326
|
+
`Pegin ${r.slice(0, 8)}… reached terminal status "${i}" while waiting for ${[...n].join(", ")}`
|
|
326
327
|
);
|
|
327
328
|
} catch (u) {
|
|
328
|
-
if (!(u instanceof
|
|
329
|
+
if (!(u instanceof xe && u.code === Ee.PEGIN_NOT_FOUND))
|
|
329
330
|
throw u;
|
|
330
331
|
}
|
|
331
332
|
await new Promise((u, i) => {
|
|
332
333
|
const p = () => {
|
|
333
334
|
clearTimeout(c), i(
|
|
334
335
|
new Error(
|
|
335
|
-
`Polling aborted for pegin ${r.slice(0, 8)}… (target: ${[...
|
|
336
|
+
`Polling aborted for pegin ${r.slice(0, 8)}… (target: ${[...n].join(", ")})`
|
|
336
337
|
)
|
|
337
338
|
);
|
|
338
339
|
}, c = setTimeout(() => {
|
|
339
|
-
|
|
340
|
+
o == null || o.removeEventListener("abort", p), u();
|
|
340
341
|
}, l);
|
|
341
|
-
|
|
342
|
+
o == null || o.addEventListener("abort", p, { once: !0 });
|
|
342
343
|
});
|
|
343
344
|
}
|
|
344
345
|
}
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
]),
|
|
351
|
-
|
|
352
|
-
...
|
|
346
|
+
const Xe = 1200 * 1e3, oe = /* @__PURE__ */ new Set([
|
|
347
|
+
E.PENDING_ACKS,
|
|
348
|
+
E.PENDING_ACTIVATION,
|
|
349
|
+
E.ACTIVATED_PENDING_BROADCAST,
|
|
350
|
+
E.ACTIVATED
|
|
351
|
+
]), Ge = /* @__PURE__ */ new Set([
|
|
352
|
+
E.PENDING_DEPOSITOR_SIGNATURES,
|
|
353
|
+
...oe
|
|
353
354
|
]);
|
|
354
355
|
function je(e) {
|
|
355
356
|
return e.map((t) => ({
|
|
356
|
-
claimerPubkeyXOnly:
|
|
357
|
+
claimerPubkeyXOnly: L(t.claimer_pubkey),
|
|
357
358
|
payoutTxHex: t.payout_tx.tx_hex,
|
|
358
359
|
assertTxHex: t.assert_tx.tx_hex
|
|
359
360
|
}));
|
|
360
361
|
}
|
|
361
|
-
function
|
|
362
|
-
return
|
|
362
|
+
function w(e) {
|
|
363
|
+
return L(e).toLowerCase();
|
|
364
|
+
}
|
|
365
|
+
function qe(e, t) {
|
|
366
|
+
const r = (a, u, i) => {
|
|
367
|
+
throw new Error(
|
|
368
|
+
`Deposit terms ${a} (${String(u)}) does not match the vault's version-locked signing context (${String(i)}); refusing to sign payouts against terms that describe a different graph.`
|
|
369
|
+
);
|
|
370
|
+
};
|
|
371
|
+
e.protocolFeeRate !== t.protocolFeeRate && r("protocolFeeRate", e.protocolFeeRate, t.protocolFeeRate);
|
|
372
|
+
const n = (a) => a.map(w).sort(), s = (a, u) => {
|
|
373
|
+
const i = n(a), p = n(u);
|
|
374
|
+
return i.length === p.length && i.every((c, h) => c === p[h]);
|
|
375
|
+
};
|
|
376
|
+
s(e.vaultKeeperBtcPubkeys, t.vaultKeeperBtcPubkeys) || r(
|
|
377
|
+
"vaultKeeperBtcPubkeys",
|
|
378
|
+
e.vaultKeeperBtcPubkeys.join(","),
|
|
379
|
+
t.vaultKeeperBtcPubkeys.join(",")
|
|
380
|
+
), s(
|
|
381
|
+
e.universalChallengerBtcPubkeys,
|
|
382
|
+
t.universalChallengerBtcPubkeys
|
|
383
|
+
) || r(
|
|
384
|
+
"universalChallengerBtcPubkeys",
|
|
385
|
+
e.universalChallengerBtcPubkeys.join(","),
|
|
386
|
+
t.universalChallengerBtcPubkeys.join(",")
|
|
387
|
+
);
|
|
388
|
+
const l = w(t.vaultProviderBtcPubkey), o = e.vaults.map(
|
|
389
|
+
(a) => w(a.vaultProviderBtcPubkey)
|
|
390
|
+
);
|
|
391
|
+
o.includes(l) || r(
|
|
392
|
+
"vaults[].vaultProviderBtcPubkey",
|
|
393
|
+
o.join(",") || "<no vaults>",
|
|
394
|
+
t.vaultProviderBtcPubkey
|
|
395
|
+
);
|
|
363
396
|
}
|
|
364
|
-
function Qe(e, t, r,
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
...r.map(
|
|
368
|
-
],
|
|
369
|
-
if (
|
|
397
|
+
function Qe(e, t, r, n) {
|
|
398
|
+
const s = w(n), l = [
|
|
399
|
+
w(t),
|
|
400
|
+
...r.map(w)
|
|
401
|
+
], o = new Set(l);
|
|
402
|
+
if (o.size !== l.length)
|
|
370
403
|
throw new Error(
|
|
371
404
|
"Cannot validate claimer set: signing context contains duplicate vault provider or vault keeper key"
|
|
372
405
|
);
|
|
373
|
-
if (
|
|
406
|
+
if (o.has(s))
|
|
374
407
|
throw new Error(
|
|
375
408
|
"Cannot validate claimer set: depositor key overlaps with vault provider or vault keeper set"
|
|
376
409
|
);
|
|
377
|
-
const
|
|
378
|
-
(h) =>
|
|
410
|
+
const a = e.map(
|
|
411
|
+
(h) => w(h.claimer_pubkey)
|
|
379
412
|
);
|
|
380
|
-
if (new Set(
|
|
413
|
+
if (new Set(a).size !== a.length)
|
|
381
414
|
throw new Error("Presign response contains duplicate claimer entries");
|
|
382
|
-
const u =
|
|
415
|
+
const u = a.filter((h) => h !== s), i = new Set(u), p = l.filter((h) => !i.has(h)), c = u.filter((h) => !o.has(h));
|
|
383
416
|
if (p.length > 0 || c.length > 0)
|
|
384
417
|
throw new Error(
|
|
385
418
|
"Presign response claimer set does not match expected (vault provider ∪ vault keepers)" + (p.length > 0 ? ` (missing: ${p.join(", ")})` : "") + (c.length > 0 ? ` (unexpected: ${c.join(", ")})` : "")
|
|
386
419
|
);
|
|
387
420
|
}
|
|
388
|
-
function
|
|
421
|
+
function j(e, t) {
|
|
389
422
|
return {
|
|
390
423
|
vaultCoreVersion: t.vaultCoreVersion,
|
|
391
424
|
payoutTxHex: e.payoutTxHex,
|
|
@@ -396,6 +429,7 @@ function W(e, t) {
|
|
|
396
429
|
universalChallengerBtcPubkeys: t.universalChallengerBtcPubkeys,
|
|
397
430
|
depositorBtcPubkey: t.depositorBtcPubkey,
|
|
398
431
|
timelockPegin: t.timelockPegin,
|
|
432
|
+
timelockAssert: t.timelockAssert,
|
|
399
433
|
registeredPayoutScriptPubKey: t.registeredPayoutScriptPubKey,
|
|
400
434
|
claimerBtcPubkey: e.claimerPubkeyXOnly,
|
|
401
435
|
commissionBps: t.commissionBps,
|
|
@@ -405,116 +439,112 @@ function W(e, t) {
|
|
|
405
439
|
vpCommissionScriptPubKey: t.vpCommissionScriptPubKey
|
|
406
440
|
};
|
|
407
441
|
}
|
|
408
|
-
async function Ye(e, t, r,
|
|
409
|
-
const
|
|
442
|
+
async function Ye(e, t, r, n) {
|
|
443
|
+
const s = new be({
|
|
410
444
|
network: t.network,
|
|
411
445
|
btcWallet: e
|
|
412
446
|
}), l = r.length;
|
|
413
|
-
|
|
414
|
-
let
|
|
415
|
-
if (
|
|
416
|
-
|
|
417
|
-
r.map((i) =>
|
|
447
|
+
n == null || n(0, l);
|
|
448
|
+
let o;
|
|
449
|
+
if (s.supportsBatchSigning())
|
|
450
|
+
o = (await s.signPayoutTransactionsBatch(
|
|
451
|
+
r.map((i) => j(i, t))
|
|
418
452
|
)).map((i) => i.payoutSignature);
|
|
419
453
|
else {
|
|
420
|
-
|
|
454
|
+
o = [];
|
|
421
455
|
for (let u = 0; u < r.length; u++) {
|
|
422
|
-
|
|
423
|
-
const i = await
|
|
424
|
-
|
|
456
|
+
n == null || n(u, l);
|
|
457
|
+
const i = await s.signPayoutTransaction(
|
|
458
|
+
j(r[u], t)
|
|
425
459
|
);
|
|
426
|
-
|
|
460
|
+
o.push(i.signature);
|
|
427
461
|
}
|
|
428
462
|
}
|
|
429
|
-
const
|
|
463
|
+
const a = {};
|
|
430
464
|
for (let u = 0; u < r.length; u++)
|
|
431
|
-
|
|
432
|
-
payout_signature:
|
|
465
|
+
a[r[u].claimerPubkeyXOnly] = {
|
|
466
|
+
payout_signature: o[u]
|
|
433
467
|
};
|
|
434
|
-
return
|
|
468
|
+
return n == null || n(l, l), a;
|
|
435
469
|
}
|
|
436
|
-
async function
|
|
470
|
+
async function Bt(e) {
|
|
437
471
|
const {
|
|
438
472
|
statusReader: t,
|
|
439
473
|
presignClient: r,
|
|
440
|
-
btcWallet:
|
|
441
|
-
peginTxid:
|
|
474
|
+
btcWallet: n,
|
|
475
|
+
peginTxid: s,
|
|
442
476
|
depositorPk: l,
|
|
443
|
-
signingContext:
|
|
444
|
-
depositTerms:
|
|
445
|
-
timeoutMs: u =
|
|
477
|
+
signingContext: o,
|
|
478
|
+
depositTerms: a,
|
|
479
|
+
timeoutMs: u = Xe,
|
|
446
480
|
signal: i,
|
|
447
481
|
onProgress: p
|
|
448
482
|
} = e, c = await ne({
|
|
449
483
|
statusReader: t,
|
|
450
|
-
peginTxid:
|
|
451
|
-
targetStatuses:
|
|
484
|
+
peginTxid: s,
|
|
485
|
+
targetStatuses: Ge,
|
|
452
486
|
timeoutMs: u,
|
|
453
487
|
signal: i
|
|
454
488
|
});
|
|
455
|
-
if (
|
|
489
|
+
if (oe.has(c))
|
|
456
490
|
return;
|
|
457
|
-
if (i == null || i.throwIfAborted(),
|
|
458
|
-
|
|
459
|
-
`Deposit terms baseFeeRate (${s.baseFeeRate} sat/vB) does not match the vault's version-locked protocolFeeRate (${n.protocolFeeRate} sat/vB); refusing to sign payouts against terms built from a different params version.`
|
|
460
|
-
);
|
|
461
|
-
if (be(o)) {
|
|
462
|
-
if (!s)
|
|
491
|
+
if (i == null || i.throwIfAborted(), a !== void 0 && qe(a, o), me(n)) {
|
|
492
|
+
if (!a)
|
|
463
493
|
throw new Error(
|
|
464
494
|
"runDepositorPresignFlow: this wallet requires approved deposit terms but none were provided. Fresh deposits must pass PreparePeginResult.depositTerms; resume-path rebuild is not wired yet."
|
|
465
495
|
);
|
|
466
|
-
await
|
|
496
|
+
await n.approveDepositTerms(a);
|
|
467
497
|
}
|
|
468
498
|
const h = await r.requestDepositorPresignTransactions(
|
|
469
499
|
{
|
|
470
|
-
pegin_txid:
|
|
500
|
+
pegin_txid: s,
|
|
471
501
|
depositor_pk: l
|
|
472
502
|
},
|
|
473
503
|
i
|
|
474
504
|
);
|
|
475
505
|
i == null || i.throwIfAborted();
|
|
476
|
-
const
|
|
506
|
+
const f = w(l);
|
|
477
507
|
Qe(
|
|
478
508
|
h.txs,
|
|
479
|
-
|
|
480
|
-
|
|
509
|
+
o.vaultProviderBtcPubkey,
|
|
510
|
+
o.vaultKeeperBtcPubkeys,
|
|
481
511
|
l
|
|
482
512
|
);
|
|
483
513
|
const y = h.txs.filter(
|
|
484
|
-
(
|
|
485
|
-
),
|
|
486
|
-
o,
|
|
514
|
+
(v) => w(v.claimer_pubkey) !== f
|
|
515
|
+
), T = je(y), x = await Ye(
|
|
487
516
|
n,
|
|
488
|
-
|
|
517
|
+
o,
|
|
518
|
+
T,
|
|
489
519
|
p
|
|
490
520
|
);
|
|
491
521
|
i == null || i.throwIfAborted();
|
|
492
|
-
const m = await
|
|
522
|
+
const m = await Le({
|
|
493
523
|
depositorGraph: h.depositor_graph,
|
|
494
|
-
btcWallet:
|
|
524
|
+
btcWallet: n,
|
|
495
525
|
signingContext: {
|
|
496
|
-
vaultCoreVersion:
|
|
497
|
-
peginTxHex:
|
|
526
|
+
vaultCoreVersion: o.vaultCoreVersion,
|
|
527
|
+
peginTxHex: o.peginTxHex,
|
|
498
528
|
depositorBtcPubkey: l,
|
|
499
|
-
vaultProviderBtcPubkey:
|
|
500
|
-
vaultKeeperBtcPubkeys:
|
|
501
|
-
universalChallengerBtcPubkeys:
|
|
502
|
-
timelockPegin:
|
|
503
|
-
timelockAssert:
|
|
504
|
-
councilMembers:
|
|
505
|
-
councilQuorum:
|
|
506
|
-
network:
|
|
507
|
-
registeredPayoutScriptPubKey:
|
|
508
|
-
protocolFeeRate:
|
|
509
|
-
vkClaimerPayoutScriptPubKeys:
|
|
510
|
-
vpCommissionScriptPubKey:
|
|
529
|
+
vaultProviderBtcPubkey: o.vaultProviderBtcPubkey,
|
|
530
|
+
vaultKeeperBtcPubkeys: o.vaultKeeperBtcPubkeys,
|
|
531
|
+
universalChallengerBtcPubkeys: o.universalChallengerBtcPubkeys,
|
|
532
|
+
timelockPegin: o.timelockPegin,
|
|
533
|
+
timelockAssert: o.timelockAssert,
|
|
534
|
+
councilMembers: o.councilMembers,
|
|
535
|
+
councilQuorum: o.councilQuorum,
|
|
536
|
+
network: o.network,
|
|
537
|
+
registeredPayoutScriptPubKey: o.registeredPayoutScriptPubKey,
|
|
538
|
+
protocolFeeRate: o.protocolFeeRate,
|
|
539
|
+
vkClaimerPayoutScriptPubKeys: o.vkClaimerPayoutScriptPubKeys,
|
|
540
|
+
vpCommissionScriptPubKey: o.vpCommissionScriptPubKey
|
|
511
541
|
}
|
|
512
542
|
});
|
|
513
543
|
i == null || i.throwIfAborted();
|
|
514
|
-
const b = { ...
|
|
544
|
+
const b = { ...x };
|
|
515
545
|
b[d(l)] = m.payout_signatures, await r.submitDepositorPresignatures(
|
|
516
546
|
{
|
|
517
|
-
pegin_txid:
|
|
547
|
+
pegin_txid: s,
|
|
518
548
|
depositor_pk: l,
|
|
519
549
|
signatures: b,
|
|
520
550
|
depositor_claimer_presignatures: m
|
|
@@ -523,248 +553,287 @@ async function $t(e) {
|
|
|
523
553
|
);
|
|
524
554
|
}
|
|
525
555
|
const We = 300 * 1e3, Je = /* @__PURE__ */ new Set([
|
|
526
|
-
|
|
527
|
-
...
|
|
556
|
+
E.PENDING_DEPOSITOR_WOTS_PK,
|
|
557
|
+
...re
|
|
528
558
|
]);
|
|
529
|
-
async function
|
|
559
|
+
async function At(e) {
|
|
530
560
|
const {
|
|
531
561
|
statusReader: t,
|
|
532
562
|
wotsSubmitter: r,
|
|
533
|
-
peginTxid:
|
|
534
|
-
depositorPk:
|
|
563
|
+
peginTxid: n,
|
|
564
|
+
depositorPk: s,
|
|
535
565
|
wotsPublicKeys: l,
|
|
536
|
-
timeoutMs:
|
|
537
|
-
signal:
|
|
566
|
+
timeoutMs: o = We,
|
|
567
|
+
signal: a
|
|
538
568
|
} = e;
|
|
539
|
-
|
|
569
|
+
a == null || a.throwIfAborted();
|
|
540
570
|
const u = await ne({
|
|
541
571
|
statusReader: t,
|
|
542
|
-
peginTxid:
|
|
572
|
+
peginTxid: n,
|
|
543
573
|
targetStatuses: Je,
|
|
544
|
-
timeoutMs:
|
|
545
|
-
signal:
|
|
574
|
+
timeoutMs: o,
|
|
575
|
+
signal: a
|
|
546
576
|
});
|
|
547
|
-
|
|
577
|
+
re.has(u) || (a == null || a.throwIfAborted(), await r.submitDepositorWotsKey(
|
|
548
578
|
{
|
|
549
|
-
pegin_txid:
|
|
550
|
-
depositor_pk:
|
|
579
|
+
pegin_txid: n,
|
|
580
|
+
depositor_pk: s,
|
|
551
581
|
wots_public_keys: l
|
|
552
582
|
},
|
|
553
|
-
|
|
583
|
+
a
|
|
554
584
|
));
|
|
555
585
|
}
|
|
556
|
-
function
|
|
557
|
-
|
|
586
|
+
function V(e) {
|
|
587
|
+
return e.registration || e.operation;
|
|
588
|
+
}
|
|
589
|
+
function Ze(e, t, r) {
|
|
590
|
+
const n = k(e);
|
|
591
|
+
return {
|
|
592
|
+
registration: n === k(t),
|
|
593
|
+
operation: n === k(r)
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
function q(e, t, r) {
|
|
597
|
+
const n = I(e);
|
|
598
|
+
return {
|
|
599
|
+
registration: Q(n, I(t)),
|
|
600
|
+
operation: Q(n, I(r))
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
function I(e) {
|
|
604
|
+
return e.map(k).sort();
|
|
605
|
+
}
|
|
606
|
+
function Q(e, t) {
|
|
607
|
+
return e.length === t.length && e.every((r, n) => r === t[n]);
|
|
608
|
+
}
|
|
609
|
+
async function Rt(e) {
|
|
610
|
+
const {
|
|
611
|
+
vaultProviderEthAddress: t,
|
|
612
|
+
hintBtcPubkey: r,
|
|
613
|
+
registrationBtcPubkey: n,
|
|
614
|
+
readCurrentOperationBtcPubkey: s,
|
|
615
|
+
context: l
|
|
616
|
+
} = e;
|
|
617
|
+
if (!r) return;
|
|
618
|
+
const o = k(r);
|
|
619
|
+
if (o === k(n)) return;
|
|
620
|
+
const a = k(
|
|
621
|
+
await s()
|
|
622
|
+
);
|
|
623
|
+
if (o !== a)
|
|
624
|
+
throw new Error(
|
|
625
|
+
`Vault provider BTC pubkey mismatch for ${t}: indexer hint matches neither the registration key nor the current operation key on-chain.${l ? ` ${l}` : ""}`
|
|
626
|
+
);
|
|
627
|
+
}
|
|
628
|
+
function O(e, t, r) {
|
|
629
|
+
const n = `${e} operation key (admin=${t.ethAddress})`, s = X(
|
|
558
630
|
t.btcPubKey,
|
|
559
631
|
`${e} roster key (admin=${t.ethAddress})`
|
|
560
|
-
), l =
|
|
632
|
+
), l = X(r, n);
|
|
561
633
|
return {
|
|
562
634
|
adminAddress: t.ethAddress,
|
|
563
|
-
genesisBtcPubkey:
|
|
635
|
+
genesisBtcPubkey: s,
|
|
564
636
|
operationBtcPubkey: l,
|
|
565
|
-
rotated: l !==
|
|
637
|
+
rotated: l !== s
|
|
566
638
|
};
|
|
567
639
|
}
|
|
568
|
-
function
|
|
640
|
+
function et(e) {
|
|
569
641
|
const t = /* @__PURE__ */ new Map();
|
|
570
642
|
for (const r of e) {
|
|
571
|
-
const
|
|
572
|
-
if (
|
|
643
|
+
const n = t.get(r.operationBtcPubkey);
|
|
644
|
+
if (n)
|
|
573
645
|
throw new Error(
|
|
574
|
-
`Participant operation key collision: ${
|
|
646
|
+
`Participant operation key collision: ${n} and ${r.adminAddress} both resolve to operation key ${r.operationBtcPubkey}`
|
|
575
647
|
);
|
|
576
648
|
t.set(r.operationBtcPubkey, r.adminAddress);
|
|
577
649
|
}
|
|
578
650
|
}
|
|
579
|
-
function
|
|
651
|
+
function ae(e, t, r) {
|
|
580
652
|
if (t.vaultKeepers.length !== e.vaultKeepers.length || t.universalChallengers.length !== e.universalChallengers.length)
|
|
581
653
|
throw new Error(
|
|
582
654
|
`Operation-key resolution returned ${t.vaultKeepers.length} keeper and ${t.universalChallengers.length} challenger keys for a roster of ${e.vaultKeepers.length} keepers and ${e.universalChallengers.length} challengers`
|
|
583
655
|
);
|
|
584
|
-
const
|
|
656
|
+
const n = O(
|
|
585
657
|
"vault provider",
|
|
586
658
|
{
|
|
587
659
|
ethAddress: e.vaultProviderEthAddress,
|
|
588
660
|
btcPubKey: e.vaultProviderGenesisBtcPubkey
|
|
589
661
|
},
|
|
590
662
|
t.vaultProvider
|
|
591
|
-
),
|
|
592
|
-
(
|
|
663
|
+
), s = e.vaultKeepers.map(
|
|
664
|
+
(o, a) => O("vault keeper", o, t.vaultKeepers[a])
|
|
593
665
|
), l = e.universalChallengers.map(
|
|
594
|
-
(
|
|
666
|
+
(o, a) => O("universal challenger", o, t.universalChallengers[a])
|
|
595
667
|
);
|
|
596
|
-
return
|
|
597
|
-
|
|
598
|
-
...
|
|
668
|
+
return et([
|
|
669
|
+
n,
|
|
670
|
+
...s,
|
|
599
671
|
...l
|
|
600
672
|
]), {
|
|
601
|
-
vaultProvider:
|
|
602
|
-
vaultKeepers:
|
|
673
|
+
vaultProvider: n,
|
|
674
|
+
vaultKeepers: s,
|
|
603
675
|
universalChallengers: l,
|
|
604
676
|
// Derived from the pairs, never the reverse — see ParticipantKeySet.
|
|
605
|
-
vaultKeeperOperationKeysSorted:
|
|
606
|
-
universalChallengerOperationKeysSorted: l.map((
|
|
677
|
+
vaultKeeperOperationKeysSorted: s.map((o) => o.operationBtcPubkey).sort(),
|
|
678
|
+
universalChallengerOperationKeysSorted: l.map((o) => o.operationBtcPubkey).sort(),
|
|
607
679
|
resolvedAt: r,
|
|
608
680
|
query: e
|
|
609
681
|
};
|
|
610
682
|
}
|
|
611
|
-
async function
|
|
683
|
+
async function tt(e) {
|
|
612
684
|
const t = await e.operationKeyReader.getCurrentOperationKeys(
|
|
613
685
|
e.query
|
|
614
686
|
);
|
|
615
|
-
return
|
|
687
|
+
return ae(e.query, t, { mode: "current" });
|
|
616
688
|
}
|
|
617
|
-
async function
|
|
689
|
+
async function rt(e) {
|
|
618
690
|
const t = await e.operationKeyReader.getOperationKeysAtEpochs(
|
|
619
691
|
e.query,
|
|
620
692
|
e.epochs
|
|
621
693
|
);
|
|
622
|
-
return
|
|
694
|
+
return ae(e.query, t, {
|
|
623
695
|
mode: "epochs",
|
|
624
696
|
epochs: e.epochs
|
|
625
697
|
});
|
|
626
698
|
}
|
|
627
|
-
const
|
|
628
|
-
function
|
|
629
|
-
return e.length === t.length && e.every((r, o) => r === t[o]);
|
|
630
|
-
}
|
|
631
|
-
async function At(e) {
|
|
699
|
+
const Y = (e) => e.map(k).sort();
|
|
700
|
+
async function Kt(e) {
|
|
632
701
|
const {
|
|
633
702
|
vaultRegistryReader: t,
|
|
634
703
|
vaultKeeperReader: r,
|
|
635
|
-
universalChallengerReader:
|
|
636
|
-
vaultProviderEthAddress:
|
|
704
|
+
universalChallengerReader: n,
|
|
705
|
+
vaultProviderEthAddress: s,
|
|
637
706
|
applicationEntryPoint: l,
|
|
638
|
-
expectedVaultProviderBtcPubkey:
|
|
639
|
-
expectedVaultKeeperBtcPubkeys:
|
|
707
|
+
expectedVaultProviderBtcPubkey: o,
|
|
708
|
+
expectedVaultKeeperBtcPubkeys: a,
|
|
640
709
|
expectedUniversalChallengerBtcPubkeys: u,
|
|
641
710
|
operationKeyReader: i,
|
|
642
711
|
onIndexerServingOperationKeys: p,
|
|
643
712
|
onIndexerHintsInconsistent: c
|
|
644
713
|
} = e, [
|
|
645
714
|
h,
|
|
646
|
-
|
|
715
|
+
f,
|
|
647
716
|
y
|
|
648
717
|
] = await Promise.all([
|
|
649
|
-
t.getVaultProviderBtcPubKey(
|
|
718
|
+
t.getVaultProviderBtcPubKey(s),
|
|
650
719
|
r.getCurrentVaultKeepersVersion(l),
|
|
651
|
-
|
|
652
|
-
]), [
|
|
720
|
+
n.getLatestUniversalChallengersVersion()
|
|
721
|
+
]), [T, x] = await Promise.all([
|
|
653
722
|
r.getVaultKeepersByVersion(
|
|
654
723
|
l,
|
|
655
|
-
|
|
724
|
+
f
|
|
656
725
|
),
|
|
657
|
-
|
|
726
|
+
n.getUniversalChallengersByVersion(
|
|
658
727
|
y
|
|
659
728
|
)
|
|
660
729
|
]), m = {
|
|
661
|
-
vaultProvider:
|
|
662
|
-
vaultKeepers:
|
|
663
|
-
universalChallengers:
|
|
664
|
-
}, b = await
|
|
730
|
+
vaultProvider: k(h),
|
|
731
|
+
vaultKeepers: Y(T.map((P) => P.btcPubKey)),
|
|
732
|
+
universalChallengers: Y(x.map((P) => P.btcPubKey))
|
|
733
|
+
}, b = await tt({
|
|
665
734
|
operationKeyReader: i,
|
|
666
735
|
query: {
|
|
667
|
-
vaultProviderEthAddress:
|
|
736
|
+
vaultProviderEthAddress: s,
|
|
668
737
|
vaultProviderGenesisBtcPubkey: `0x${h}`,
|
|
669
738
|
applicationEntryPoint: l,
|
|
670
|
-
vaultKeepers:
|
|
671
|
-
universalChallengers:
|
|
739
|
+
vaultKeepers: T,
|
|
740
|
+
universalChallengers: x
|
|
672
741
|
}
|
|
673
|
-
}),
|
|
742
|
+
}), v = {
|
|
674
743
|
vaultProvider: b.vaultProvider.operationBtcPubkey,
|
|
675
744
|
vaultKeepers: [...b.vaultKeeperOperationKeysSorted],
|
|
676
745
|
universalChallengers: [
|
|
677
746
|
...b.universalChallengerOperationKeysSorted
|
|
678
747
|
]
|
|
679
|
-
},
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
if (!V(
|
|
748
|
+
}, S = Ze(
|
|
749
|
+
o,
|
|
750
|
+
m.vaultProvider,
|
|
751
|
+
v.vaultProvider
|
|
752
|
+
), _ = q(
|
|
753
|
+
a,
|
|
754
|
+
m.vaultKeepers,
|
|
755
|
+
v.vaultKeepers
|
|
756
|
+
), B = q(
|
|
757
|
+
u,
|
|
758
|
+
m.universalChallengers,
|
|
759
|
+
v.universalChallengers
|
|
760
|
+
);
|
|
761
|
+
if (!V(S))
|
|
693
762
|
throw new Error(
|
|
694
|
-
`Vault provider BTC pubkey indexer hint does not match BTCVaultRegistry for ${
|
|
763
|
+
`Vault provider BTC pubkey indexer hint does not match BTCVaultRegistry for ${s}. Refresh and try again.`
|
|
695
764
|
);
|
|
696
|
-
if (!V(
|
|
765
|
+
if (!V(_))
|
|
697
766
|
throw new Error(
|
|
698
|
-
`Vault keeper BTC pubkeys (v${
|
|
767
|
+
`Vault keeper BTC pubkeys (v${f}) indexer set does not match ApplicationRegistry on-chain set. Refresh and try again.`
|
|
699
768
|
);
|
|
700
|
-
if (!V(
|
|
769
|
+
if (!V(B))
|
|
701
770
|
throw new Error(
|
|
702
771
|
`Universal challenger BTC pubkeys (v${y}) indexer set does not match ProtocolParams on-chain set. Refresh and try again.`
|
|
703
772
|
);
|
|
704
|
-
const
|
|
705
|
-
if (
|
|
706
|
-
const
|
|
707
|
-
throw c == null || c(
|
|
773
|
+
const g = [S, _, B], pe = g.some((P) => P.registration && !P.operation), z = g.some((P) => P.operation && !P.registration);
|
|
774
|
+
if (pe && z) {
|
|
775
|
+
const P = `Indexer participant hints are internally inconsistent for vault provider ${s}: some roles match the registration keys while others match the rotated operation keys.`;
|
|
776
|
+
throw c == null || c(P), new Error(`${P} Refresh and try again.`);
|
|
708
777
|
}
|
|
709
|
-
return
|
|
710
|
-
`Indexer is serving rotated operation keys for vault provider ${
|
|
778
|
+
return z && (p == null || p(
|
|
779
|
+
`Indexer is serving rotated operation keys for vault provider ${s}`
|
|
711
780
|
)), {
|
|
712
|
-
vaultProviderBtcPubkeyXOnly:
|
|
713
|
-
vaultKeeperBtcPubkeysSorted:
|
|
714
|
-
universalChallengerBtcPubkeysSorted:
|
|
715
|
-
expectedAppVaultKeepersVersion:
|
|
781
|
+
vaultProviderBtcPubkeyXOnly: v.vaultProvider,
|
|
782
|
+
vaultKeeperBtcPubkeysSorted: v.vaultKeepers,
|
|
783
|
+
universalChallengerBtcPubkeysSorted: v.universalChallengers,
|
|
784
|
+
expectedAppVaultKeepersVersion: f,
|
|
716
785
|
expectedUniversalChallengersVersion: y,
|
|
717
786
|
registrationKeys: m,
|
|
718
787
|
participantKeys: b
|
|
719
788
|
};
|
|
720
789
|
}
|
|
721
|
-
function
|
|
790
|
+
function nt(e) {
|
|
722
791
|
return /^[0-9a-fA-F]{64}$/.test(e);
|
|
723
792
|
}
|
|
724
|
-
function
|
|
793
|
+
function Vt(e) {
|
|
725
794
|
const {
|
|
726
795
|
amountSats: t,
|
|
727
796
|
minDeposit: r,
|
|
728
|
-
maxDeposit:
|
|
729
|
-
btcBalance:
|
|
797
|
+
maxDeposit: n,
|
|
798
|
+
btcBalance: s,
|
|
730
799
|
estimatedFeeSats: l,
|
|
731
|
-
depositorClaimValue:
|
|
800
|
+
depositorClaimValue: o
|
|
732
801
|
} = e;
|
|
733
|
-
return !(t <= 0n || t < r ||
|
|
802
|
+
return !(t <= 0n || t < r || n && n > 0n && t > n || l == null || o == null || t + l + o > s);
|
|
734
803
|
}
|
|
735
|
-
function
|
|
804
|
+
function It(e, t, r) {
|
|
736
805
|
return e <= 0n ? {
|
|
737
806
|
valid: !1,
|
|
738
807
|
error: "Deposit amount must be greater than zero"
|
|
739
808
|
} : e < t ? {
|
|
740
809
|
valid: !1,
|
|
741
|
-
error: `Minimum deposit is ${
|
|
810
|
+
error: `Minimum deposit is ${C(t)} BTC`
|
|
742
811
|
} : r && r > 0n && e > r ? {
|
|
743
812
|
valid: !1,
|
|
744
|
-
error: `Maximum deposit is ${
|
|
813
|
+
error: `Maximum deposit is ${C(r)} BTC`
|
|
745
814
|
} : { valid: !0 };
|
|
746
815
|
}
|
|
747
|
-
function
|
|
816
|
+
function Ot(e) {
|
|
748
817
|
const { amount: t, effectiveRemaining: r } = e;
|
|
749
818
|
return r === null ? { valid: !0 } : r === 0n ? {
|
|
750
819
|
valid: !1,
|
|
751
820
|
error: "Supply cap reached — deposits temporarily paused"
|
|
752
821
|
} : t > r ? {
|
|
753
822
|
valid: !1,
|
|
754
|
-
error: `Vault size exceeds remaining capacity (${
|
|
823
|
+
error: `Vault size exceeds remaining capacity (${C(r)} BTC)`
|
|
755
824
|
} : { valid: !0 };
|
|
756
825
|
}
|
|
757
|
-
function
|
|
826
|
+
function Ht(e, t) {
|
|
758
827
|
if (!e || e.length === 0)
|
|
759
828
|
return {
|
|
760
829
|
valid: !1,
|
|
761
830
|
error: "At least one vault provider must be selected"
|
|
762
831
|
};
|
|
763
832
|
const r = t.map(
|
|
764
|
-
(
|
|
833
|
+
(s) => s.toLowerCase()
|
|
765
834
|
);
|
|
766
835
|
return e.filter(
|
|
767
|
-
(
|
|
836
|
+
(s) => !r.includes(s.toLowerCase())
|
|
768
837
|
).length > 0 ? {
|
|
769
838
|
valid: !1,
|
|
770
839
|
error: "Invalid vault provider selected"
|
|
@@ -776,191 +845,191 @@ function ot(e, t, r) {
|
|
|
776
845
|
valid: !1,
|
|
777
846
|
error: "At least one vault amount required"
|
|
778
847
|
};
|
|
779
|
-
for (let
|
|
780
|
-
const
|
|
781
|
-
if (
|
|
848
|
+
for (let n = 0; n < e.length; n++) {
|
|
849
|
+
const s = e[n];
|
|
850
|
+
if (s <= 0n)
|
|
782
851
|
return {
|
|
783
852
|
valid: !1,
|
|
784
|
-
error: `Vault ${
|
|
853
|
+
error: `Vault ${n + 1} amount must be positive`
|
|
785
854
|
};
|
|
786
|
-
if (t &&
|
|
855
|
+
if (t && s < t)
|
|
787
856
|
return {
|
|
788
857
|
valid: !1,
|
|
789
|
-
error: `Vault ${
|
|
858
|
+
error: `Vault ${n + 1} amount ${C(s)} BTC is below minimum deposit ${C(t)} BTC`
|
|
790
859
|
};
|
|
791
|
-
if (r &&
|
|
860
|
+
if (r && s > r)
|
|
792
861
|
return {
|
|
793
862
|
valid: !1,
|
|
794
|
-
error: `Vault ${
|
|
863
|
+
error: `Vault ${n + 1} amount ${C(s)} BTC exceeds maximum deposit ${C(r)} BTC`
|
|
795
864
|
};
|
|
796
865
|
}
|
|
797
866
|
return { valid: !0 };
|
|
798
867
|
}
|
|
799
|
-
function
|
|
868
|
+
function at(e) {
|
|
800
869
|
const t = d(e);
|
|
801
|
-
return
|
|
870
|
+
return nt(t) ? { valid: !0 } : {
|
|
802
871
|
valid: !1,
|
|
803
872
|
error: "Invalid pubkey format: must be 64 hex characters (32-byte x-only public key, no 0x prefix)"
|
|
804
873
|
};
|
|
805
874
|
}
|
|
806
|
-
function
|
|
875
|
+
function st(e) {
|
|
807
876
|
if (!e || e.length === 0)
|
|
808
877
|
throw new Error(
|
|
809
878
|
"No vault keepers available. The system requires at least one vault keeper to create a deposit."
|
|
810
879
|
);
|
|
811
880
|
}
|
|
812
|
-
function
|
|
881
|
+
function it(e) {
|
|
813
882
|
if (!e || e.length === 0)
|
|
814
883
|
throw new Error(
|
|
815
884
|
"No universal challengers available. The system requires at least one universal challenger to create a deposit."
|
|
816
885
|
);
|
|
817
886
|
}
|
|
818
|
-
function
|
|
887
|
+
function ut(e) {
|
|
819
888
|
if (e.length === 0)
|
|
820
889
|
throw new Error("No spendable UTXOs available");
|
|
821
890
|
}
|
|
822
|
-
function
|
|
891
|
+
function Nt(e) {
|
|
823
892
|
const {
|
|
824
893
|
vaultAmounts: t,
|
|
825
894
|
confirmedUTXOs: r,
|
|
826
|
-
vaultProviderBtcPubkey:
|
|
827
|
-
vaultKeeperBtcPubkeys:
|
|
895
|
+
vaultProviderBtcPubkey: n,
|
|
896
|
+
vaultKeeperBtcPubkeys: s,
|
|
828
897
|
universalChallengerBtcPubkeys: l,
|
|
829
|
-
minDeposit:
|
|
830
|
-
maxDeposit:
|
|
898
|
+
minDeposit: o,
|
|
899
|
+
maxDeposit: a
|
|
831
900
|
} = e, u = ot(
|
|
832
901
|
t,
|
|
833
|
-
|
|
834
|
-
|
|
902
|
+
o,
|
|
903
|
+
a
|
|
835
904
|
);
|
|
836
905
|
if (!u.valid)
|
|
837
906
|
throw new Error(u.error);
|
|
838
|
-
const i =
|
|
907
|
+
const i = at(n);
|
|
839
908
|
if (!i.valid)
|
|
840
909
|
throw new Error(i.error);
|
|
841
|
-
|
|
910
|
+
st(s), it(l), ut(r);
|
|
842
911
|
}
|
|
843
|
-
class
|
|
912
|
+
class se extends Error {
|
|
844
913
|
constructor(t) {
|
|
845
914
|
super(t), this.name = "ParticipantKeyDriftError";
|
|
846
915
|
}
|
|
847
916
|
}
|
|
848
|
-
function
|
|
849
|
-
return e instanceof
|
|
917
|
+
function Dt(e) {
|
|
918
|
+
return e instanceof se || e instanceof Error && e.name === "ParticipantKeyDriftError";
|
|
850
919
|
}
|
|
851
|
-
function
|
|
852
|
-
return t.length === r.length && t.every((
|
|
920
|
+
function W(e, t, r) {
|
|
921
|
+
return t.length === r.length && t.every((n, s) => n === r[s]) ? null : `${e} expected [${t.join(", ")}], got [${r.join(", ")}]`;
|
|
853
922
|
}
|
|
854
|
-
async function
|
|
855
|
-
const { vaultRegistryReader: t, operationKeyReader: r, vaultIds:
|
|
856
|
-
if (
|
|
857
|
-
const
|
|
858
|
-
for (const [u, i] of
|
|
859
|
-
const p =
|
|
923
|
+
async function Ft(e) {
|
|
924
|
+
const { vaultRegistryReader: t, operationKeyReader: r, vaultIds: n, expected: s } = e, l = s.query;
|
|
925
|
+
if (n.length === 0) return;
|
|
926
|
+
const o = await t.getVaultKeyEpochsBatch(n), a = [];
|
|
927
|
+
for (const [u, i] of o.entries()) {
|
|
928
|
+
const p = n[u];
|
|
860
929
|
let c;
|
|
861
930
|
try {
|
|
862
|
-
c = await
|
|
931
|
+
c = await rt({
|
|
863
932
|
operationKeyReader: r,
|
|
864
933
|
query: l,
|
|
865
934
|
epochs: i
|
|
866
935
|
});
|
|
867
936
|
} catch (y) {
|
|
868
|
-
|
|
937
|
+
a.push(
|
|
869
938
|
`vault ${p}: could not resolve participants at frozen epochs (vp=${i.vpKeyEpoch}, keeper=${i.appKeeperKeyEpoch}, uc=${i.ucKeyEpoch}): ${y.message}`
|
|
870
939
|
);
|
|
871
940
|
continue;
|
|
872
941
|
}
|
|
873
|
-
c.vaultProvider.operationBtcPubkey !==
|
|
874
|
-
`vault ${p}: vault provider key expected ${
|
|
942
|
+
c.vaultProvider.operationBtcPubkey !== s.vaultProvider.operationBtcPubkey && a.push(
|
|
943
|
+
`vault ${p}: vault provider key expected ${s.vaultProvider.operationBtcPubkey}, got ${c.vaultProvider.operationBtcPubkey}`
|
|
875
944
|
);
|
|
876
|
-
const h =
|
|
945
|
+
const h = W(
|
|
877
946
|
`vault ${p}: vault keeper keys`,
|
|
878
|
-
|
|
947
|
+
s.vaultKeeperOperationKeysSorted,
|
|
879
948
|
c.vaultKeeperOperationKeysSorted
|
|
880
949
|
);
|
|
881
|
-
h &&
|
|
882
|
-
const
|
|
950
|
+
h && a.push(h);
|
|
951
|
+
const f = W(
|
|
883
952
|
`vault ${p}: universal challenger keys`,
|
|
884
|
-
|
|
953
|
+
s.universalChallengerOperationKeysSorted,
|
|
885
954
|
c.universalChallengerOperationKeysSorted
|
|
886
955
|
);
|
|
887
|
-
|
|
956
|
+
f && a.push(f);
|
|
888
957
|
}
|
|
889
|
-
if (
|
|
890
|
-
throw new
|
|
891
|
-
`Aborting BTC broadcast: participant operation keys changed during registration (${
|
|
958
|
+
if (a.length > 0)
|
|
959
|
+
throw new se(
|
|
960
|
+
`Aborting BTC broadcast: participant operation keys changed during registration (${a.join("; ")}). The Pre-PegIn was not broadcast; the registered ETH vault will time out per protocol rules.`
|
|
892
961
|
);
|
|
893
962
|
}
|
|
894
|
-
class
|
|
963
|
+
class ie extends Error {
|
|
895
964
|
constructor(t) {
|
|
896
965
|
super(t), this.name = "RegisteredVaultVersionMismatchError";
|
|
897
966
|
}
|
|
898
967
|
}
|
|
899
|
-
function
|
|
900
|
-
return e instanceof
|
|
968
|
+
function Mt(e) {
|
|
969
|
+
return e instanceof ie || e instanceof Error && e.name === "RegisteredVaultVersionMismatchError";
|
|
901
970
|
}
|
|
902
|
-
async function
|
|
971
|
+
async function Ut(e) {
|
|
903
972
|
const {
|
|
904
973
|
vaultRegistryReader: t,
|
|
905
974
|
vaultIds: r,
|
|
906
|
-
expectedOffchainParamsVersion:
|
|
907
|
-
expectedAppVaultKeepersVersion:
|
|
975
|
+
expectedOffchainParamsVersion: n,
|
|
976
|
+
expectedAppVaultKeepersVersion: s,
|
|
908
977
|
expectedUniversalChallengersVersion: l,
|
|
909
|
-
expectedVaultCoreVersion:
|
|
910
|
-
} = e,
|
|
911
|
-
if (
|
|
978
|
+
expectedVaultCoreVersion: o
|
|
979
|
+
} = e, a = await t.getProtocolInfoBatch(r), u = [];
|
|
980
|
+
if (a.forEach((i, p) => {
|
|
912
981
|
const c = r[p];
|
|
913
|
-
i.offchainParamsVersion !==
|
|
914
|
-
`vault ${c}: offchainParams expected v${
|
|
915
|
-
), i.appVaultKeepersVersion !==
|
|
916
|
-
`vault ${c}: appVaultKeepers expected v${
|
|
982
|
+
i.offchainParamsVersion !== n && u.push(
|
|
983
|
+
`vault ${c}: offchainParams expected v${n}, got v${i.offchainParamsVersion}`
|
|
984
|
+
), i.appVaultKeepersVersion !== s && u.push(
|
|
985
|
+
`vault ${c}: appVaultKeepers expected v${s}, got v${i.appVaultKeepersVersion}`
|
|
917
986
|
), i.universalChallengersVersion !== l && u.push(
|
|
918
987
|
`vault ${c}: universalChallengers expected v${l}, got v${i.universalChallengersVersion}`
|
|
919
|
-
), i.vaultCoreVersion !==
|
|
920
|
-
`vault ${c}: vaultCoreVersion expected v${
|
|
988
|
+
), i.vaultCoreVersion !== o && u.push(
|
|
989
|
+
`vault ${c}: vaultCoreVersion expected v${o} (build-time active), got v${i.vaultCoreVersion}`
|
|
921
990
|
);
|
|
922
991
|
}), u.length > 0)
|
|
923
|
-
throw new
|
|
992
|
+
throw new ie(
|
|
924
993
|
`Aborting BTC broadcast: signer-set or offchain-params versions changed during registration (${u.join("; ")}). The Pre-PegIn was not broadcast; the registered ETH vault will time out per protocol rules.`
|
|
925
994
|
);
|
|
926
995
|
}
|
|
927
|
-
var
|
|
928
|
-
const
|
|
996
|
+
var ue = /* @__PURE__ */ ((e) => (e.CLAIM_EVENT_RECEIVED = "ClaimEventReceived", e.CLAIM_BROADCAST = "ClaimBroadcast", e.ASSERT_BROADCAST = "AssertBroadcast", e.PAYOUT_BROADCAST = "PayoutBroadcast", e.PAYOUT_BLOCKED = "PayoutBlocked", e))(ue || {});
|
|
997
|
+
const lt = /* @__PURE__ */ new Set([
|
|
929
998
|
"PayoutBroadcast",
|
|
930
999
|
"PayoutBlocked"
|
|
931
1000
|
/* PAYOUT_BLOCKED */
|
|
932
1001
|
]);
|
|
933
|
-
function
|
|
934
|
-
return Object.values(
|
|
1002
|
+
function Lt(e) {
|
|
1003
|
+
return Object.values(ue).includes(
|
|
935
1004
|
e
|
|
936
1005
|
);
|
|
937
1006
|
}
|
|
938
|
-
function
|
|
939
|
-
return !!e &&
|
|
1007
|
+
function zt(e) {
|
|
1008
|
+
return !!e && lt.has(e);
|
|
940
1009
|
}
|
|
941
|
-
class
|
|
942
|
-
constructor(r,
|
|
943
|
-
super(`Refund not yet mature (BIP68 not final): ${
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
this.name = "BIP68NotMatureError", this.vaultId = r, this.cause =
|
|
1010
|
+
class ct extends Error {
|
|
1011
|
+
constructor(r, n) {
|
|
1012
|
+
super(`Refund not yet mature (BIP68 not final): ${n.message}`);
|
|
1013
|
+
A(this, "vaultId");
|
|
1014
|
+
A(this, "cause");
|
|
1015
|
+
this.name = "BIP68NotMatureError", this.vaultId = r, this.cause = n;
|
|
947
1016
|
}
|
|
948
1017
|
}
|
|
949
|
-
const
|
|
950
|
-
function
|
|
1018
|
+
const pt = /^0x[0-9a-fA-F]{64}$/, ht = /^(?:0x)?(?:[0-9a-fA-F]{2})+$/, le = /^(?:0x)?(?:[0-9a-fA-F]{64}|[0-9a-fA-F]{66})$/, ce = 160, J = 2e3, Z = 10n, ee = 100n;
|
|
1019
|
+
function Xt(e) {
|
|
951
1020
|
if (!Number.isFinite(e) || e <= 0)
|
|
952
1021
|
throw new Error(
|
|
953
1022
|
`feeRateSatsVb must be a positive finite number, got ${e}`
|
|
954
1023
|
);
|
|
955
|
-
return BigInt(Math.ceil(e *
|
|
1024
|
+
return BigInt(Math.ceil(e * ce));
|
|
956
1025
|
}
|
|
957
|
-
const
|
|
958
|
-
function
|
|
1026
|
+
const dt = 1, gt = /non-BIP68-final/i;
|
|
1027
|
+
function U(e, t) {
|
|
959
1028
|
if (e.length !== 66)
|
|
960
1029
|
throw new Error(
|
|
961
1030
|
`${t} must be 32 bytes (66 hex chars with 0x prefix), got length ${e.length}`
|
|
962
1031
|
);
|
|
963
|
-
if (!
|
|
1032
|
+
if (!pt.test(e))
|
|
964
1033
|
throw new Error(
|
|
965
1034
|
`${t} must contain only hex characters after the 0x prefix`
|
|
966
1035
|
);
|
|
@@ -969,8 +1038,8 @@ function H(e, t) {
|
|
|
969
1038
|
if (!Number.isInteger(e) || e < 0)
|
|
970
1039
|
throw new Error(`${t} must be a non-negative integer, got ${e}`);
|
|
971
1040
|
}
|
|
972
|
-
function
|
|
973
|
-
if (
|
|
1041
|
+
function ft(e) {
|
|
1042
|
+
if (U(e.hashlock, "hashlock"), !Number.isInteger(e.htlcVout) || e.htlcVout < 0)
|
|
974
1043
|
throw new Error(
|
|
975
1044
|
`htlcVout must be a non-negative integer, got ${e.htlcVout}`
|
|
976
1045
|
);
|
|
@@ -981,14 +1050,14 @@ function gt(e) {
|
|
|
981
1050
|
`htlcVout ${e.htlcVout} is out of range for batch of size ${e.batch.length}`
|
|
982
1051
|
);
|
|
983
1052
|
for (let r = 0; r < e.batch.length; r++) {
|
|
984
|
-
const
|
|
985
|
-
if (
|
|
1053
|
+
const n = e.batch[r];
|
|
1054
|
+
if (U(n.hashlock, `batch[${r}].hashlock`), !Number.isInteger(n.htlcVout) || n.htlcVout !== r)
|
|
986
1055
|
throw new Error(
|
|
987
|
-
`batch[${r}].htlcVout must equal ${r} (contiguous vout-ordered vector), got ${
|
|
1056
|
+
`batch[${r}].htlcVout must equal ${r} (contiguous vout-ordered vector), got ${n.htlcVout}`
|
|
988
1057
|
);
|
|
989
|
-
if (typeof
|
|
1058
|
+
if (typeof n.amount != "bigint" || n.amount <= 0n)
|
|
990
1059
|
throw new Error(
|
|
991
|
-
`batch[${r}].amount must be a positive bigint, got ${
|
|
1060
|
+
`batch[${r}].amount must be a positive bigint, got ${n.amount}`
|
|
992
1061
|
);
|
|
993
1062
|
}
|
|
994
1063
|
const t = e.batch[e.htlcVout];
|
|
@@ -1003,24 +1072,24 @@ function gt(e) {
|
|
|
1003
1072
|
if (H(e.offchainParamsVersion, "offchainParamsVersion"), H(e.appVaultKeepersVersion, "appVaultKeepersVersion"), H(
|
|
1004
1073
|
e.universalChallengersVersion,
|
|
1005
1074
|
"universalChallengersVersion"
|
|
1006
|
-
),
|
|
1075
|
+
), Be(
|
|
1007
1076
|
e.vaultCoreVersion,
|
|
1008
1077
|
"VaultRefundData.vaultCoreVersion"
|
|
1009
1078
|
), typeof e.unsignedPrePeginTxHex != "string" || e.unsignedPrePeginTxHex.length === 0)
|
|
1010
1079
|
throw new Error("unsignedPrePeginTxHex must be a non-empty hex string");
|
|
1011
|
-
if (!
|
|
1080
|
+
if (!ht.test(e.unsignedPrePeginTxHex))
|
|
1012
1081
|
throw new Error(
|
|
1013
1082
|
"unsignedPrePeginTxHex must be a hex byte string (optional 0x prefix, even length)"
|
|
1014
1083
|
);
|
|
1015
|
-
if (!e.depositorBtcPubkey || !
|
|
1084
|
+
if (!e.depositorBtcPubkey || !le.test(e.depositorBtcPubkey))
|
|
1016
1085
|
throw new Error(
|
|
1017
1086
|
"depositorBtcPubkey must be 32 or 33 bytes of hex (optional 0x prefix)"
|
|
1018
1087
|
);
|
|
1019
1088
|
if (typeof e.amount != "bigint" || e.amount <= 0n)
|
|
1020
1089
|
throw new Error(`amount must be a positive bigint, got ${e.amount}`);
|
|
1021
1090
|
}
|
|
1022
|
-
function
|
|
1023
|
-
if (!e.vaultProviderPubkey || !
|
|
1091
|
+
function yt(e) {
|
|
1092
|
+
if (!e.vaultProviderPubkey || !le.test(e.vaultProviderPubkey))
|
|
1024
1093
|
throw new Error("vaultProviderPubkey must be 32 or 33 bytes of hex");
|
|
1025
1094
|
if (e.vaultKeeperPubkeys.length === 0)
|
|
1026
1095
|
throw new Error("vaultKeeperPubkeys must be non-empty");
|
|
@@ -1050,59 +1119,59 @@ function vt(e) {
|
|
|
1050
1119
|
try {
|
|
1051
1120
|
t.finalizeAllInputs();
|
|
1052
1121
|
} catch (r) {
|
|
1053
|
-
const
|
|
1054
|
-
if (!
|
|
1055
|
-
throw new Error(`Failed to finalize refund PSBT: ${
|
|
1122
|
+
const n = r instanceof Error ? r.message : String(r);
|
|
1123
|
+
if (!n.includes("already finalized"))
|
|
1124
|
+
throw new Error(`Failed to finalize refund PSBT: ${n}`);
|
|
1056
1125
|
}
|
|
1057
1126
|
return t.extractTransaction().toHex();
|
|
1058
1127
|
}
|
|
1059
|
-
async function
|
|
1128
|
+
async function Gt(e) {
|
|
1060
1129
|
const {
|
|
1061
1130
|
vaultId: t,
|
|
1062
1131
|
readVault: r,
|
|
1063
|
-
readPrePeginContext:
|
|
1064
|
-
feeRate:
|
|
1132
|
+
readPrePeginContext: n,
|
|
1133
|
+
feeRate: s,
|
|
1065
1134
|
signPsbt: l,
|
|
1066
|
-
broadcastTx:
|
|
1067
|
-
signal:
|
|
1135
|
+
broadcastTx: o,
|
|
1136
|
+
signal: a
|
|
1068
1137
|
} = e;
|
|
1069
|
-
|
|
1138
|
+
a == null || a.throwIfAborted(), U(t, "vaultId");
|
|
1070
1139
|
const u = await r();
|
|
1071
|
-
|
|
1072
|
-
const i = await
|
|
1073
|
-
if (
|
|
1074
|
-
throw new Error(`feeRate must be a positive number, got ${
|
|
1075
|
-
if (
|
|
1140
|
+
ft(u), a == null || a.throwIfAborted();
|
|
1141
|
+
const i = await n(u);
|
|
1142
|
+
if (yt(i), a == null || a.throwIfAborted(), !Number.isFinite(s) || s <= 0)
|
|
1143
|
+
throw new Error(`feeRate must be a positive number, got ${s}`);
|
|
1144
|
+
if (s > J)
|
|
1076
1145
|
throw new Error(
|
|
1077
|
-
`feeRate ${
|
|
1146
|
+
`feeRate ${s} sat/vB exceeds refund safety cap ${J} sat/vB; refusing to sign refund.`
|
|
1078
1147
|
);
|
|
1079
|
-
const p = BigInt(Math.ceil(
|
|
1148
|
+
const p = BigInt(Math.ceil(s * ce)), c = u.amount * Z / ee;
|
|
1080
1149
|
if (p > c)
|
|
1081
1150
|
throw new Error(
|
|
1082
|
-
`Refund fee ${p} sats exceeds the per-vault safety cap of ${c} sats (${
|
|
1151
|
+
`Refund fee ${p} sats exceeds the per-vault safety cap of ${c} sats (${Z}/${ee} of vault.amount=${u.amount}); refusing to sign refund.`
|
|
1083
1152
|
);
|
|
1084
|
-
|
|
1085
|
-
const h =
|
|
1153
|
+
a == null || a.throwIfAborted();
|
|
1154
|
+
const h = L(
|
|
1086
1155
|
u.depositorBtcPubkey
|
|
1087
|
-
),
|
|
1156
|
+
), f = d(u.unsignedPrePeginTxHex), y = we(f);
|
|
1088
1157
|
if (y !== void 0 && y.vout !== u.batch.length)
|
|
1089
1158
|
throw new Error(
|
|
1090
1159
|
`Auth-anchor OP_RETURN at vout ${y.vout} does not match batch size (${u.batch.length} HTLC outputs expect the anchor at vout ${u.batch.length}). Refund refused — sibling HTLC vector is incomplete.`
|
|
1091
1160
|
);
|
|
1092
|
-
const
|
|
1093
|
-
let
|
|
1161
|
+
const T = y == null ? void 0 : y.hash;
|
|
1162
|
+
let x;
|
|
1094
1163
|
try {
|
|
1095
|
-
|
|
1164
|
+
x = $.fromHex(f);
|
|
1096
1165
|
} catch (g) {
|
|
1097
1166
|
throw new Error(
|
|
1098
1167
|
`Failed to parse funded Pre-PegIn transaction hex: ${g instanceof Error ? g.message : String(g)}`
|
|
1099
1168
|
);
|
|
1100
1169
|
}
|
|
1101
|
-
if (
|
|
1170
|
+
if (x.outs.length < u.batch.length)
|
|
1102
1171
|
throw new Error(
|
|
1103
|
-
`Funded Pre-PegIn tx has ${
|
|
1172
|
+
`Funded Pre-PegIn tx has ${x.outs.length} outputs but batch requires at least ${u.batch.length} HTLC outputs. Refund refused — funded tx shape disagrees with sibling vector.`
|
|
1104
1173
|
);
|
|
1105
|
-
const { psbtHex: m } = await
|
|
1174
|
+
const { psbtHex: m } = await _e({
|
|
1106
1175
|
prePeginParams: {
|
|
1107
1176
|
vaultCoreVersion: u.vaultCoreVersion,
|
|
1108
1177
|
depositorPubkey: h,
|
|
@@ -1124,9 +1193,9 @@ async function Xt(e) {
|
|
|
1124
1193
|
councilQuorum: i.councilQuorum,
|
|
1125
1194
|
councilSize: i.councilSize,
|
|
1126
1195
|
network: i.network,
|
|
1127
|
-
authAnchorHash:
|
|
1196
|
+
authAnchorHash: T
|
|
1128
1197
|
},
|
|
1129
|
-
fundedPrePeginTxHex:
|
|
1198
|
+
fundedPrePeginTxHex: f,
|
|
1130
1199
|
htlcVout: u.htlcVout,
|
|
1131
1200
|
refundFee: p,
|
|
1132
1201
|
// buildRefundPsbt's top-level `hashlock` param is documented as "no 0x
|
|
@@ -1135,65 +1204,69 @@ async function Xt(e) {
|
|
|
1135
1204
|
// unspendable PSBT. Match the `hashlocks` array handling above.
|
|
1136
1205
|
hashlock: d(u.hashlock)
|
|
1137
1206
|
});
|
|
1138
|
-
|
|
1139
|
-
const b =
|
|
1207
|
+
a == null || a.throwIfAborted();
|
|
1208
|
+
const b = M(
|
|
1140
1209
|
u.depositorBtcPubkey,
|
|
1141
|
-
|
|
1142
|
-
),
|
|
1143
|
-
|
|
1210
|
+
dt
|
|
1211
|
+
), v = await l(m, b);
|
|
1212
|
+
N({
|
|
1144
1213
|
requestedPsbtHex: m,
|
|
1145
|
-
returnedPsbtHex:
|
|
1214
|
+
returnedPsbtHex: v
|
|
1146
1215
|
});
|
|
1147
|
-
const
|
|
1148
|
-
|
|
1216
|
+
const S = 0, _ = D(
|
|
1217
|
+
v,
|
|
1149
1218
|
h,
|
|
1150
|
-
|
|
1219
|
+
S
|
|
1151
1220
|
);
|
|
1152
|
-
|
|
1221
|
+
F({
|
|
1153
1222
|
requestedPsbtHex: m,
|
|
1154
1223
|
signatureHex: _,
|
|
1155
1224
|
signerXOnlyPubkeyHex: h,
|
|
1156
|
-
inputIndex:
|
|
1225
|
+
inputIndex: S
|
|
1157
1226
|
});
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1227
|
+
const B = vt(v);
|
|
1228
|
+
a == null || a.throwIfAborted();
|
|
1160
1229
|
try {
|
|
1161
|
-
return await
|
|
1230
|
+
return await o(B);
|
|
1162
1231
|
} catch (g) {
|
|
1163
|
-
throw g instanceof Error &&
|
|
1232
|
+
throw g instanceof Error && gt.test(g.message) ? new ct(t, g) : g;
|
|
1164
1233
|
}
|
|
1165
1234
|
}
|
|
1166
1235
|
export {
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1236
|
+
Xt as A,
|
|
1237
|
+
ct as B,
|
|
1238
|
+
ue as C,
|
|
1239
|
+
ee as D,
|
|
1240
|
+
Z as E,
|
|
1241
|
+
J as F,
|
|
1242
|
+
ce as G,
|
|
1243
|
+
se as P,
|
|
1244
|
+
ie as R,
|
|
1172
1245
|
_t as a,
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1246
|
+
At as b,
|
|
1247
|
+
It as c,
|
|
1248
|
+
Nt as d,
|
|
1249
|
+
Ht as e,
|
|
1250
|
+
Ot as f,
|
|
1178
1251
|
ot as g,
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1252
|
+
at as h,
|
|
1253
|
+
Vt as i,
|
|
1254
|
+
Dt as j,
|
|
1255
|
+
Ft as k,
|
|
1256
|
+
Mt as l,
|
|
1257
|
+
Ut as m,
|
|
1258
|
+
Rt as n,
|
|
1259
|
+
V as o,
|
|
1260
|
+
Ze as p,
|
|
1261
|
+
q,
|
|
1262
|
+
Bt as r,
|
|
1263
|
+
Le as s,
|
|
1264
|
+
tt as t,
|
|
1265
|
+
rt as u,
|
|
1266
|
+
Kt as v,
|
|
1194
1267
|
ne as w,
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1268
|
+
Lt as x,
|
|
1269
|
+
zt as y,
|
|
1270
|
+
Gt as z
|
|
1198
1271
|
};
|
|
1199
|
-
//# sourceMappingURL=buildAndBroadcastRefund-
|
|
1272
|
+
//# sourceMappingURL=buildAndBroadcastRefund-DBA-Mp4I.js.map
|