@babylonlabs-io/ts-sdk 0.48.0 → 0.48.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PayoutManager-BbemBIo9.js → PayoutManager-D02AePm4.js} +78 -65
- package/dist/PayoutManager-D02AePm4.js.map +1 -0
- package/dist/PayoutManager-DD1audlx.cjs +2 -0
- package/dist/PayoutManager-DD1audlx.cjs.map +1 -0
- package/dist/{PeginManager-BMO6R9I9.js → PeginManager-6seoi9mV.js} +217 -198
- package/dist/PeginManager-6seoi9mV.js.map +1 -0
- package/dist/PeginManager-CHZieoEQ.cjs +2 -0
- package/dist/PeginManager-CHZieoEQ.cjs.map +1 -0
- package/dist/buildAndBroadcastRefund-Bi07LxuY.cjs +2 -0
- package/dist/buildAndBroadcastRefund-Bi07LxuY.cjs.map +1 -0
- package/dist/{buildAndBroadcastRefund-sfl7Aac9.js → buildAndBroadcastRefund-DXHs6unL.js} +412 -362
- package/dist/buildAndBroadcastRefund-DXHs6unL.js.map +1 -0
- package/dist/{challengeAssert-1fy_EzAi.js → challengeAssert-ChvLypwc.js} +7 -7
- package/dist/{challengeAssert-1fy_EzAi.js.map → challengeAssert-ChvLypwc.js.map} +1 -1
- package/dist/challengeAssert-Culc7DoS.cjs +2 -0
- package/dist/{challengeAssert-DEw-z3n9.cjs.map → challengeAssert-Culc7DoS.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +170 -169
- package/dist/noPayout-CA4-x5vZ.js +174 -0
- package/dist/noPayout-CA4-x5vZ.js.map +1 -0
- package/dist/noPayout-CJ_Acpl_.cjs +2 -0
- package/dist/noPayout-CJ_Acpl_.cjs.map +1 -0
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +168 -167
- package/dist/tbv/core/managers/PayoutManager.d.ts.map +1 -1
- package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
- package/dist/tbv/core/managers/index.cjs +1 -1
- package/dist/tbv/core/managers/index.js +2 -2
- package/dist/tbv/core/primitives/index.cjs +1 -1
- package/dist/tbv/core/primitives/index.d.ts +8 -7
- package/dist/tbv/core/primitives/index.d.ts.map +1 -1
- package/dist/tbv/core/primitives/index.js +30 -29
- package/dist/tbv/core/primitives/psbt/__tests__/verifyScriptPathSchnorrSignature.test.d.ts +14 -0
- package/dist/tbv/core/primitives/psbt/__tests__/verifyScriptPathSchnorrSignature.test.d.ts.map +1 -0
- package/dist/tbv/core/primitives/psbt/refund.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/verifyScriptPathSchnorrSignature.d.ts +53 -0
- package/dist/tbv/core/primitives/psbt/verifyScriptPathSchnorrSignature.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts.map +1 -1
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +2 -2
- package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts +20 -0
- package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts.map +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +168 -167
- package/dist/tbv/integrations/aave/clients/__tests__/hub.test.d.ts +2 -0
- package/dist/tbv/integrations/aave/clients/__tests__/hub.test.d.ts.map +1 -0
- package/dist/tbv/integrations/aave/clients/abis/AaveHub.abi.json.d.ts +24 -0
- package/dist/tbv/integrations/aave/clients/hub.d.ts +28 -0
- package/dist/tbv/integrations/aave/clients/hub.d.ts.map +1 -0
- package/dist/tbv/integrations/aave/clients/index.d.ts +1 -0
- package/dist/tbv/integrations/aave/clients/index.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/index.cjs +1 -1
- package/dist/tbv/integrations/aave/index.cjs.map +1 -1
- package/dist/tbv/integrations/aave/index.d.ts +1 -1
- package/dist/tbv/integrations/aave/index.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/index.js +246 -193
- package/dist/tbv/integrations/aave/index.js.map +1 -1
- package/dist/verifyScriptPathSchnorrSignature-D43cncKJ.cjs +2 -0
- package/dist/verifyScriptPathSchnorrSignature-D43cncKJ.cjs.map +1 -0
- package/dist/verifyScriptPathSchnorrSignature-DFJAEleY.js +563 -0
- package/dist/verifyScriptPathSchnorrSignature-DFJAEleY.js.map +1 -0
- package/package.json +3 -3
- package/dist/PayoutManager-BLpgkfOS.cjs +0 -2
- package/dist/PayoutManager-BLpgkfOS.cjs.map +0 -1
- package/dist/PayoutManager-BbemBIo9.js.map +0 -1
- package/dist/PeginManager-BMO6R9I9.js.map +0 -1
- package/dist/PeginManager-CfkjDMy7.cjs +0 -2
- package/dist/PeginManager-CfkjDMy7.cjs.map +0 -1
- package/dist/assertPsbtUnsignedTxMatches-BHyBdtxs.js +0 -481
- package/dist/assertPsbtUnsignedTxMatches-BHyBdtxs.js.map +0 -1
- package/dist/assertPsbtUnsignedTxMatches-s9H0Qqkl.cjs +0 -2
- package/dist/assertPsbtUnsignedTxMatches-s9H0Qqkl.cjs.map +0 -1
- package/dist/buildAndBroadcastRefund-sfl7Aac9.js.map +0 -1
- package/dist/buildAndBroadcastRefund-tR9sGPwy.cjs +0 -2
- package/dist/buildAndBroadcastRefund-tR9sGPwy.cjs.map +0 -1
- package/dist/challengeAssert-DEw-z3n9.cjs +0 -2
- package/dist/noPayout-5-wtWQ_f.js +0 -154
- package/dist/noPayout-5-wtWQ_f.js.map +0 -1
- package/dist/noPayout-DNevEzJR.cjs +0 -2
- package/dist/noPayout-DNevEzJR.cjs.map +0 -1
|
@@ -1,99 +1,100 @@
|
|
|
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
|
-
|
|
13
|
-
|
|
1
|
+
var Z = Object.defineProperty;
|
|
2
|
+
var ee = (e, t, r) => t in e ? Z(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var $ = (e, t, r) => ee(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { B as te } from "./BTCVaultRegistry.abi-Chs4AFBj.js";
|
|
5
|
+
import { e as re, v as ne, s as p, u as X, p as A, f as T } from "./bitcoin-B5aNKtsk.js";
|
|
6
|
+
import { v as oe, P as ae, f as se } from "./PayoutManager-D02AePm4.js";
|
|
7
|
+
import { D as w, c as ie, a as ue, R as le, d as z } from "./types-CQDRQvV-.js";
|
|
8
|
+
import { Transaction as S, Psbt as ce } from "bitcoinjs-lib";
|
|
9
|
+
import { c as he, d as V, e as N, f as H } from "./verifyScriptPathSchnorrSignature-DFJAEleY.js";
|
|
10
|
+
import { c as de, a as pe, b as ge } from "./noPayout-CA4-x5vZ.js";
|
|
11
|
+
import { c as O } from "./signing-DaLvGwQe.js";
|
|
12
|
+
import { computeMinClaimValue as fe, computeMinPeginFee as me } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
13
|
+
const Pe = /^0x[0-9a-fA-F]{64}$/, be = /^0x[0-9a-fA-F]{40}$/, ye = /^0x([0-9a-fA-F]{2})*$/;
|
|
14
|
+
function R(e, t) {
|
|
14
15
|
if (e.length !== 66)
|
|
15
16
|
throw new Error(
|
|
16
17
|
`${t} must be 32 bytes (66 hex chars with 0x prefix), got length ${e.length}`
|
|
17
18
|
);
|
|
18
|
-
if (!
|
|
19
|
+
if (!Pe.test(e))
|
|
19
20
|
throw new Error(
|
|
20
21
|
`${t} must contain only hex characters after the 0x prefix`
|
|
21
22
|
);
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
if (!
|
|
24
|
+
function we(e, t) {
|
|
25
|
+
if (!be.test(e))
|
|
25
26
|
throw new Error(
|
|
26
27
|
`${t} must be a 20-byte 0x-prefixed hex address (42 chars)`
|
|
27
28
|
);
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
-
if (!
|
|
30
|
+
function xe(e, t) {
|
|
31
|
+
if (!ye.test(e))
|
|
31
32
|
throw new Error(
|
|
32
33
|
`${t} must be a 0x-prefixed hex string with an even number of hex chars`
|
|
33
34
|
);
|
|
34
35
|
}
|
|
35
|
-
async function
|
|
36
|
+
async function ht(e) {
|
|
36
37
|
const {
|
|
37
38
|
btcVaultRegistryAddress: t,
|
|
38
39
|
vaultId: r,
|
|
39
40
|
hashlock: n,
|
|
40
|
-
activationMetadata:
|
|
41
|
+
activationMetadata: i,
|
|
41
42
|
writeContract: u,
|
|
42
43
|
signal: s
|
|
43
44
|
} = e;
|
|
44
|
-
s == null || s.throwIfAborted(),
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
45
|
+
s == null || s.throwIfAborted(), we(t, "btcVaultRegistryAddress"), R(r, "vaultId");
|
|
46
|
+
const o = re(e.secret);
|
|
47
|
+
if (R(o, "secret"), n !== void 0 && (R(n, "hashlock"), !oe(o, n)))
|
|
47
48
|
throw new Error(
|
|
48
49
|
"Invalid secret: SHA256(secret) does not match the provided hashlock"
|
|
49
50
|
);
|
|
50
|
-
return
|
|
51
|
+
return xe(i, "activationMetadata"), u({
|
|
51
52
|
address: t,
|
|
52
|
-
abi:
|
|
53
|
+
abi: te,
|
|
53
54
|
functionName: "activateVaultWithSecret",
|
|
54
|
-
args: [r,
|
|
55
|
+
args: [r, o, i]
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
|
-
const
|
|
58
|
-
async function
|
|
58
|
+
const ve = 1e4;
|
|
59
|
+
async function G(e) {
|
|
59
60
|
const {
|
|
60
61
|
statusReader: t,
|
|
61
62
|
peginTxid: r,
|
|
62
63
|
targetStatuses: n,
|
|
63
|
-
timeoutMs:
|
|
64
|
-
pollIntervalMs: u =
|
|
64
|
+
timeoutMs: i,
|
|
65
|
+
pollIntervalMs: u = ve,
|
|
65
66
|
signal: s
|
|
66
|
-
} = e,
|
|
67
|
+
} = e, o = Date.now();
|
|
67
68
|
for (; ; ) {
|
|
68
69
|
if (s != null && s.aborted)
|
|
69
70
|
throw new Error(
|
|
70
71
|
`Polling aborted for pegin ${r.slice(0, 8)}… (target: ${[...n].join(", ")})`
|
|
71
72
|
);
|
|
72
|
-
if (Date.now() -
|
|
73
|
+
if (Date.now() - o >= i)
|
|
73
74
|
throw new Error(
|
|
74
|
-
`Polling timeout after ${
|
|
75
|
+
`Polling timeout after ${i}ms for pegin ${r.slice(0, 8)}… (target: ${[...n].join(", ")})`
|
|
75
76
|
);
|
|
76
77
|
try {
|
|
77
|
-
const
|
|
78
|
+
const a = await t.getPeginStatus(
|
|
78
79
|
{ pegin_txid: r },
|
|
79
80
|
s
|
|
80
81
|
);
|
|
81
|
-
if (
|
|
82
|
+
if (a.pegin_txid.toLowerCase() !== r.toLowerCase())
|
|
82
83
|
throw new Error(
|
|
83
|
-
`getPeginStatus returned status for pegin ${
|
|
84
|
+
`getPeginStatus returned status for pegin ${a.pegin_txid.slice(0, 8)}…, requested ${r.slice(0, 8)}…`
|
|
84
85
|
);
|
|
85
|
-
const l =
|
|
86
|
-
if (n.has(l) || l ===
|
|
86
|
+
const l = a.status;
|
|
87
|
+
if (n.has(l) || l === w.ACTIVATED)
|
|
87
88
|
return l;
|
|
88
|
-
if (l ===
|
|
89
|
+
if (l === w.EXPIRED || ie.has(l))
|
|
89
90
|
throw new Error(
|
|
90
91
|
`Pegin ${r.slice(0, 8)}… reached terminal status "${l}" while waiting for ${[...n].join(", ")}`
|
|
91
92
|
);
|
|
92
|
-
} catch (
|
|
93
|
-
if (!(
|
|
94
|
-
throw
|
|
93
|
+
} catch (a) {
|
|
94
|
+
if (!(a instanceof ue && a.code === le.PEGIN_NOT_FOUND))
|
|
95
|
+
throw a;
|
|
95
96
|
}
|
|
96
|
-
await new Promise((
|
|
97
|
+
await new Promise((a, l) => {
|
|
97
98
|
const h = () => {
|
|
98
99
|
clearTimeout(c), l(
|
|
99
100
|
new Error(
|
|
@@ -101,104 +102,104 @@ async function X(e) {
|
|
|
101
102
|
)
|
|
102
103
|
);
|
|
103
104
|
}, c = setTimeout(() => {
|
|
104
|
-
s == null || s.removeEventListener("abort", h),
|
|
105
|
+
s == null || s.removeEventListener("abort", h), a();
|
|
105
106
|
}, u);
|
|
106
107
|
s == null || s.addEventListener("abort", h, { once: !0 });
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
...
|
|
111
|
+
const Ee = 300 * 1e3, Te = /* @__PURE__ */ new Set([
|
|
112
|
+
w.PENDING_DEPOSITOR_WOTS_PK,
|
|
113
|
+
...z
|
|
113
114
|
]);
|
|
114
|
-
async function
|
|
115
|
+
async function dt(e) {
|
|
115
116
|
const {
|
|
116
117
|
statusReader: t,
|
|
117
118
|
wotsSubmitter: r,
|
|
118
119
|
peginTxid: n,
|
|
119
|
-
depositorPk:
|
|
120
|
+
depositorPk: i,
|
|
120
121
|
wotsPublicKeys: u,
|
|
121
|
-
timeoutMs: s =
|
|
122
|
-
signal:
|
|
122
|
+
timeoutMs: s = Ee,
|
|
123
|
+
signal: o
|
|
123
124
|
} = e;
|
|
124
|
-
|
|
125
|
-
const
|
|
125
|
+
o == null || o.throwIfAborted();
|
|
126
|
+
const a = await G({
|
|
126
127
|
statusReader: t,
|
|
127
128
|
peginTxid: n,
|
|
128
|
-
targetStatuses:
|
|
129
|
+
targetStatuses: Te,
|
|
129
130
|
timeoutMs: s,
|
|
130
|
-
signal:
|
|
131
|
+
signal: o
|
|
131
132
|
});
|
|
132
|
-
|
|
133
|
+
z.has(a) || (o == null || o.throwIfAborted(), await r.submitDepositorWotsKey(
|
|
133
134
|
{
|
|
134
135
|
pegin_txid: n,
|
|
135
|
-
depositor_pk:
|
|
136
|
+
depositor_pk: i,
|
|
136
137
|
wots_public_keys: u
|
|
137
138
|
},
|
|
138
|
-
|
|
139
|
+
o
|
|
139
140
|
));
|
|
140
141
|
}
|
|
141
|
-
const
|
|
142
|
-
function
|
|
143
|
-
const r = p(t).toLowerCase(),
|
|
144
|
-
if (
|
|
142
|
+
const K = 1, ke = 1;
|
|
143
|
+
function _e(e, t) {
|
|
144
|
+
const r = p(t).toLowerCase(), i = e.map((u) => p(u).toLowerCase()).filter((u) => u !== r);
|
|
145
|
+
if (i.length === 0)
|
|
145
146
|
throw new Error(
|
|
146
147
|
"Cannot derive localChallengers: vault keeper set is empty (or contains only the depositor)"
|
|
147
148
|
);
|
|
148
|
-
if (new Set(
|
|
149
|
+
if (new Set(i).size !== i.length)
|
|
149
150
|
throw new Error(
|
|
150
151
|
"Cannot derive localChallengers: duplicate vaultKeeper key — signing context is misconfigured"
|
|
151
152
|
);
|
|
152
|
-
return
|
|
153
|
+
return i;
|
|
153
154
|
}
|
|
154
|
-
function
|
|
155
|
+
function Se(e, t, r) {
|
|
155
156
|
const n = r.map(
|
|
156
157
|
(c) => p(c).toLowerCase()
|
|
157
|
-
),
|
|
158
|
-
if (
|
|
158
|
+
), i = t.filter((c) => n.includes(c));
|
|
159
|
+
if (i.length > 0)
|
|
159
160
|
throw new Error(
|
|
160
|
-
`Cannot validate challenger set: vault keepers and universal challengers overlap (${
|
|
161
|
+
`Cannot validate challenger set: vault keepers and universal challengers overlap (${i.join(", ")})`
|
|
161
162
|
);
|
|
162
163
|
const u = [...t, ...n], s = e.map(
|
|
163
164
|
(c) => p(c.challenger_pubkey).toLowerCase()
|
|
164
|
-
),
|
|
165
|
-
if (
|
|
165
|
+
), o = new Set(s);
|
|
166
|
+
if (o.size !== s.length)
|
|
166
167
|
throw new Error(
|
|
167
168
|
"Depositor graph contains duplicate challenger entries in challenger_presign_data"
|
|
168
169
|
);
|
|
169
|
-
const
|
|
170
|
+
const a = new Set(u), l = u.filter((c) => !o.has(c)), h = s.filter((c) => !a.has(c));
|
|
170
171
|
if (l.length > 0 || h.length > 0)
|
|
171
172
|
throw new Error(
|
|
172
173
|
"Depositor graph challenger set does not match expected (local ∪ universal)" + (l.length > 0 ? ` (missing: ${l.join(", ")})` : "") + (h.length > 0 ? ` (unexpected: ${h.join(", ")})` : "")
|
|
173
174
|
);
|
|
174
175
|
}
|
|
175
|
-
function
|
|
176
|
+
function Ce(e, t) {
|
|
176
177
|
const r = e.ins[t];
|
|
177
|
-
return
|
|
178
|
+
return X(new Uint8Array(r.hash).slice().reverse());
|
|
178
179
|
}
|
|
179
|
-
function B(e, t, r, n,
|
|
180
|
+
function B(e, t, r, n, i) {
|
|
180
181
|
const u = e.ins[t];
|
|
181
182
|
if (u.index !== 0)
|
|
182
183
|
throw new Error(
|
|
183
|
-
`NoPayout (challenger ${
|
|
184
|
+
`NoPayout (challenger ${i}) input ${t} expected to spend ${n} vout 0, got vout ${u.index}`
|
|
184
185
|
);
|
|
185
|
-
const s = r.getId(),
|
|
186
|
-
if (
|
|
186
|
+
const s = r.getId(), o = Ce(e, t);
|
|
187
|
+
if (o !== s)
|
|
187
188
|
throw new Error(
|
|
188
|
-
`NoPayout (challenger ${
|
|
189
|
+
`NoPayout (challenger ${i}) input ${t} does not reference ${n} (expected txid ${s}, got ${o})`
|
|
189
190
|
);
|
|
190
191
|
}
|
|
191
|
-
async function
|
|
192
|
-
const n = [],
|
|
192
|
+
async function Ae(e, t, r) {
|
|
193
|
+
const n = [], i = [], u = [], s = _e(
|
|
193
194
|
r.vaultKeeperBtcPubkeys,
|
|
194
195
|
r.depositorBtcPubkey
|
|
195
196
|
);
|
|
196
|
-
|
|
197
|
+
Se(
|
|
197
198
|
e.challenger_presign_data,
|
|
198
199
|
s,
|
|
199
200
|
r.universalChallengerBtcPubkeys
|
|
200
201
|
);
|
|
201
|
-
const
|
|
202
|
+
const o = await he({
|
|
202
203
|
payoutTxHex: e.payout_tx.tx_hex,
|
|
203
204
|
peginTxHex: r.peginTxHex,
|
|
204
205
|
assertTxHex: e.assert_tx.tx_hex,
|
|
@@ -210,77 +211,77 @@ async function Te(e, t, r) {
|
|
|
210
211
|
network: r.network,
|
|
211
212
|
claimerBtcPubkey: r.depositorBtcPubkey,
|
|
212
213
|
registeredPayoutScriptPubKey: r.registeredPayoutScriptPubKey,
|
|
213
|
-
commissionBps:
|
|
214
|
+
commissionBps: ke
|
|
214
215
|
});
|
|
215
|
-
n.push(
|
|
216
|
-
|
|
216
|
+
n.push(o.psbtHex), i.push(
|
|
217
|
+
O(
|
|
217
218
|
t,
|
|
218
|
-
|
|
219
|
+
K
|
|
219
220
|
)
|
|
220
221
|
);
|
|
221
|
-
const
|
|
222
|
+
const a = p(r.depositorBtcPubkey), l = S.fromHex(
|
|
222
223
|
p(e.assert_tx.tx_hex)
|
|
223
224
|
);
|
|
224
225
|
for (const h of e.challenger_presign_data) {
|
|
225
|
-
const c = p(h.challenger_pubkey),
|
|
226
|
+
const c = p(h.challenger_pubkey), d = n.length, P = await $e({
|
|
226
227
|
challenger: h,
|
|
227
228
|
challengerPubkey: c,
|
|
228
|
-
claimerPubkey:
|
|
229
|
+
claimerPubkey: a,
|
|
229
230
|
localChallengers: s,
|
|
230
231
|
assertTxParsed: l,
|
|
231
232
|
ctx: r
|
|
232
233
|
});
|
|
233
|
-
n.push(
|
|
234
|
-
|
|
234
|
+
n.push(P), i.push(
|
|
235
|
+
O(
|
|
235
236
|
t,
|
|
236
|
-
|
|
237
|
+
K
|
|
237
238
|
)
|
|
238
239
|
), u.push({
|
|
239
240
|
challengerPubkey: c,
|
|
240
|
-
noPayoutIdx:
|
|
241
|
+
noPayoutIdx: d
|
|
241
242
|
});
|
|
242
243
|
}
|
|
243
|
-
return { psbtHexes: n, signOptions:
|
|
244
|
+
return { psbtHexes: n, signOptions: i, challengerEntries: u };
|
|
244
245
|
}
|
|
245
|
-
async function
|
|
246
|
+
async function $e(e) {
|
|
246
247
|
const {
|
|
247
248
|
challenger: t,
|
|
248
249
|
challengerPubkey: r,
|
|
249
250
|
claimerPubkey: n,
|
|
250
|
-
localChallengers:
|
|
251
|
+
localChallengers: i,
|
|
251
252
|
assertTxParsed: u,
|
|
252
253
|
ctx: s
|
|
253
254
|
} = e;
|
|
254
|
-
|
|
255
|
+
de(
|
|
255
256
|
t.nopayout_tx.tx_hex,
|
|
256
257
|
r,
|
|
257
258
|
s.network
|
|
258
259
|
);
|
|
259
|
-
const
|
|
260
|
+
const o = S.fromHex(
|
|
260
261
|
p(t.nopayout_tx.tx_hex)
|
|
261
|
-
),
|
|
262
|
+
), a = S.fromHex(
|
|
262
263
|
p(t.challenge_assert_x_tx.tx_hex)
|
|
263
|
-
), l =
|
|
264
|
+
), l = S.fromHex(
|
|
264
265
|
p(t.challenge_assert_y_tx.tx_hex)
|
|
265
266
|
);
|
|
266
|
-
if (
|
|
267
|
+
if (o.ins.length !== 3)
|
|
267
268
|
throw new Error(
|
|
268
|
-
`NoPayout (challenger ${r}) must have exactly 3 inputs, got ${
|
|
269
|
+
`NoPayout (challenger ${r}) must have exactly 3 inputs, got ${o.ins.length}`
|
|
269
270
|
);
|
|
270
271
|
B(
|
|
271
|
-
|
|
272
|
+
o,
|
|
272
273
|
0,
|
|
273
274
|
u,
|
|
274
275
|
"Assert",
|
|
275
276
|
r
|
|
276
277
|
), B(
|
|
277
|
-
i,
|
|
278
|
-
1,
|
|
279
278
|
o,
|
|
279
|
+
1,
|
|
280
|
+
a,
|
|
280
281
|
"ChallengeAssertX",
|
|
281
282
|
r
|
|
282
283
|
), B(
|
|
283
|
-
|
|
284
|
+
o,
|
|
284
285
|
2,
|
|
285
286
|
l,
|
|
286
287
|
"ChallengeAssertY",
|
|
@@ -288,19 +289,19 @@ async function ke(e) {
|
|
|
288
289
|
);
|
|
289
290
|
const h = [
|
|
290
291
|
u.outs[0],
|
|
291
|
-
|
|
292
|
+
a.outs[0],
|
|
292
293
|
l.outs[0]
|
|
293
294
|
].map((c) => ({
|
|
294
|
-
script_pubkey:
|
|
295
|
+
script_pubkey: X(new Uint8Array(c.script)),
|
|
295
296
|
value: c.value
|
|
296
297
|
}));
|
|
297
|
-
return
|
|
298
|
+
return pe({
|
|
298
299
|
noPayoutTxHex: t.nopayout_tx.tx_hex,
|
|
299
300
|
challengerPubkey: r,
|
|
300
301
|
prevouts: h,
|
|
301
302
|
connectorParams: {
|
|
302
303
|
claimer: n,
|
|
303
|
-
localChallengers:
|
|
304
|
+
localChallengers: i,
|
|
304
305
|
universalChallengers: s.universalChallengerBtcPubkeys,
|
|
305
306
|
timelockAssert: s.timelockAssert,
|
|
306
307
|
councilMembers: s.councilMembers,
|
|
@@ -308,107 +309,122 @@ async function ke(e) {
|
|
|
308
309
|
}
|
|
309
310
|
});
|
|
310
311
|
}
|
|
311
|
-
function
|
|
312
|
+
function Re(e, t, r) {
|
|
312
313
|
V(e[0]);
|
|
313
|
-
const
|
|
314
|
+
const i = N(
|
|
314
315
|
e[0].returnedPsbtHex,
|
|
315
316
|
r
|
|
316
|
-
)
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
317
|
+
);
|
|
318
|
+
H({
|
|
319
|
+
requestedPsbtHex: e[0].requestedPsbtHex,
|
|
320
|
+
signatureHex: i,
|
|
321
|
+
signerXOnlyPubkeyHex: r,
|
|
322
|
+
inputIndex: 0
|
|
323
|
+
});
|
|
324
|
+
const u = {};
|
|
325
|
+
for (const s of t) {
|
|
326
|
+
V(e[s.noPayoutIdx]);
|
|
327
|
+
const o = N(
|
|
328
|
+
e[s.noPayoutIdx].returnedPsbtHex,
|
|
329
|
+
r
|
|
330
|
+
);
|
|
331
|
+
H({
|
|
332
|
+
requestedPsbtHex: e[s.noPayoutIdx].requestedPsbtHex,
|
|
333
|
+
signatureHex: o,
|
|
334
|
+
signerXOnlyPubkeyHex: r,
|
|
335
|
+
inputIndex: 0
|
|
336
|
+
}), u[s.challengerPubkey] = {
|
|
337
|
+
nopayout_signature: o
|
|
323
338
|
};
|
|
339
|
+
}
|
|
324
340
|
return {
|
|
325
341
|
payout_signatures: {
|
|
326
|
-
payout_signature:
|
|
342
|
+
payout_signature: i
|
|
327
343
|
},
|
|
328
|
-
per_challenger:
|
|
344
|
+
per_challenger: u
|
|
329
345
|
};
|
|
330
346
|
}
|
|
331
|
-
async function
|
|
347
|
+
async function Be(e, t, r) {
|
|
332
348
|
if (typeof e.signPsbts == "function")
|
|
333
349
|
return e.signPsbts(t, r);
|
|
334
350
|
const n = [];
|
|
335
|
-
for (let
|
|
336
|
-
n.push(await e.signPsbt(t[
|
|
351
|
+
for (let i = 0; i < t.length; i++)
|
|
352
|
+
n.push(await e.signPsbt(t[i], r == null ? void 0 : r[i]));
|
|
337
353
|
return n;
|
|
338
354
|
}
|
|
339
|
-
async function
|
|
340
|
-
const { depositorGraph: t, btcWallet: r, signingContext: n } = e,
|
|
341
|
-
|
|
355
|
+
async function Ie(e) {
|
|
356
|
+
const { depositorGraph: t, btcWallet: r, signingContext: n } = e, i = await r.getPublicKeyHex(), { depositorPubkey: u } = ne(
|
|
357
|
+
i,
|
|
342
358
|
p(n.depositorBtcPubkey)
|
|
343
|
-
), { psbtHexes: s, signOptions:
|
|
359
|
+
), { psbtHexes: s, signOptions: o, challengerEntries: a } = await Ae(
|
|
344
360
|
t,
|
|
345
|
-
|
|
361
|
+
i,
|
|
346
362
|
n
|
|
347
|
-
), l = await
|
|
363
|
+
), l = await Be(
|
|
348
364
|
r,
|
|
349
365
|
s,
|
|
350
|
-
|
|
366
|
+
o
|
|
351
367
|
);
|
|
352
368
|
if (l.length !== s.length)
|
|
353
369
|
throw new Error(
|
|
354
370
|
`Wallet returned ${l.length} signed PSBTs, expected ${s.length}`
|
|
355
371
|
);
|
|
356
|
-
const h = s.map((c,
|
|
372
|
+
const h = s.map((c, d) => ({
|
|
357
373
|
requestedPsbtHex: c,
|
|
358
|
-
returnedPsbtHex: l[
|
|
374
|
+
returnedPsbtHex: l[d]
|
|
359
375
|
}));
|
|
360
|
-
return
|
|
376
|
+
return Re(
|
|
361
377
|
h,
|
|
362
|
-
|
|
378
|
+
a,
|
|
363
379
|
u
|
|
364
380
|
);
|
|
365
381
|
}
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
]),
|
|
372
|
-
|
|
373
|
-
...
|
|
382
|
+
const Ve = 1200 * 1e3, q = /* @__PURE__ */ new Set([
|
|
383
|
+
w.PENDING_ACKS,
|
|
384
|
+
w.PENDING_ACTIVATION,
|
|
385
|
+
w.ACTIVATED_PENDING_BROADCAST,
|
|
386
|
+
w.ACTIVATED
|
|
387
|
+
]), Ne = /* @__PURE__ */ new Set([
|
|
388
|
+
w.PENDING_DEPOSITOR_SIGNATURES,
|
|
389
|
+
...q
|
|
374
390
|
]);
|
|
375
|
-
function
|
|
391
|
+
function He(e) {
|
|
376
392
|
return e.map((t) => ({
|
|
377
|
-
claimerPubkeyXOnly:
|
|
393
|
+
claimerPubkeyXOnly: A(t.claimer_pubkey),
|
|
378
394
|
payoutTxHex: t.payout_tx.tx_hex,
|
|
379
395
|
assertTxHex: t.assert_tx.tx_hex
|
|
380
396
|
}));
|
|
381
397
|
}
|
|
382
|
-
function
|
|
383
|
-
return
|
|
398
|
+
function k(e) {
|
|
399
|
+
return A(e).toLowerCase();
|
|
384
400
|
}
|
|
385
|
-
function
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
...r.map(
|
|
401
|
+
function Oe(e, t, r, n) {
|
|
402
|
+
const i = k(n), u = [
|
|
403
|
+
k(t),
|
|
404
|
+
...r.map(k)
|
|
389
405
|
], s = new Set(u);
|
|
390
406
|
if (s.size !== u.length)
|
|
391
407
|
throw new Error(
|
|
392
408
|
"Cannot validate claimer set: signing context contains duplicate vault provider or vault keeper key"
|
|
393
409
|
);
|
|
394
|
-
if (s.has(
|
|
410
|
+
if (s.has(i))
|
|
395
411
|
throw new Error(
|
|
396
412
|
"Cannot validate claimer set: depositor key overlaps with vault provider or vault keeper set"
|
|
397
413
|
);
|
|
398
|
-
const
|
|
399
|
-
(
|
|
414
|
+
const o = e.map(
|
|
415
|
+
(d) => k(d.claimer_pubkey)
|
|
400
416
|
);
|
|
401
|
-
if (new Set(
|
|
417
|
+
if (new Set(o).size !== o.length)
|
|
402
418
|
throw new Error(
|
|
403
419
|
"Presign response contains duplicate claimer entries"
|
|
404
420
|
);
|
|
405
|
-
const
|
|
421
|
+
const a = o.filter((d) => d !== i), l = new Set(a), h = u.filter((d) => !l.has(d)), c = a.filter((d) => !s.has(d));
|
|
406
422
|
if (h.length > 0 || c.length > 0)
|
|
407
423
|
throw new Error(
|
|
408
424
|
"Presign response claimer set does not match expected (vault provider ∪ vault keepers)" + (h.length > 0 ? ` (missing: ${h.join(", ")})` : "") + (c.length > 0 ? ` (unexpected: ${c.join(", ")})` : "")
|
|
409
425
|
);
|
|
410
426
|
}
|
|
411
|
-
function
|
|
427
|
+
function F(e, t) {
|
|
412
428
|
return {
|
|
413
429
|
payoutTxHex: e.payoutTxHex,
|
|
414
430
|
peginTxHex: t.peginTxHex,
|
|
@@ -423,80 +439,80 @@ function K(e, t) {
|
|
|
423
439
|
commissionBps: t.commissionBps
|
|
424
440
|
};
|
|
425
441
|
}
|
|
426
|
-
async function
|
|
427
|
-
const
|
|
442
|
+
async function De(e, t, r, n) {
|
|
443
|
+
const i = new ae({
|
|
428
444
|
network: t.network,
|
|
429
445
|
btcWallet: e
|
|
430
446
|
}), u = r.length;
|
|
431
447
|
n == null || n(0, u);
|
|
432
448
|
let s;
|
|
433
|
-
if (
|
|
434
|
-
s = (await
|
|
435
|
-
r.map((l) =>
|
|
449
|
+
if (i.supportsBatchSigning())
|
|
450
|
+
s = (await i.signPayoutTransactionsBatch(
|
|
451
|
+
r.map((l) => F(l, t))
|
|
436
452
|
)).map((l) => l.payoutSignature);
|
|
437
453
|
else {
|
|
438
454
|
s = [];
|
|
439
|
-
for (let
|
|
440
|
-
n == null || n(
|
|
441
|
-
const l = await
|
|
442
|
-
|
|
455
|
+
for (let a = 0; a < r.length; a++) {
|
|
456
|
+
n == null || n(a, u);
|
|
457
|
+
const l = await i.signPayoutTransaction(
|
|
458
|
+
F(r[a], t)
|
|
443
459
|
);
|
|
444
460
|
s.push(l.signature);
|
|
445
461
|
}
|
|
446
462
|
}
|
|
447
|
-
const
|
|
448
|
-
for (let
|
|
449
|
-
|
|
450
|
-
payout_signature: s[
|
|
463
|
+
const o = {};
|
|
464
|
+
for (let a = 0; a < r.length; a++)
|
|
465
|
+
o[r[a].claimerPubkeyXOnly] = {
|
|
466
|
+
payout_signature: s[a]
|
|
451
467
|
};
|
|
452
|
-
return n == null || n(u, u),
|
|
468
|
+
return n == null || n(u, u), o;
|
|
453
469
|
}
|
|
454
|
-
async function
|
|
470
|
+
async function pt(e) {
|
|
455
471
|
const {
|
|
456
472
|
statusReader: t,
|
|
457
473
|
presignClient: r,
|
|
458
474
|
btcWallet: n,
|
|
459
|
-
peginTxid:
|
|
475
|
+
peginTxid: i,
|
|
460
476
|
depositorPk: u,
|
|
461
477
|
signingContext: s,
|
|
462
|
-
timeoutMs:
|
|
463
|
-
signal:
|
|
478
|
+
timeoutMs: o = Ve,
|
|
479
|
+
signal: a,
|
|
464
480
|
onProgress: l
|
|
465
|
-
} = e, h = await
|
|
481
|
+
} = e, h = await G({
|
|
466
482
|
statusReader: t,
|
|
467
|
-
peginTxid:
|
|
468
|
-
targetStatuses:
|
|
469
|
-
timeoutMs:
|
|
470
|
-
signal:
|
|
483
|
+
peginTxid: i,
|
|
484
|
+
targetStatuses: Ne,
|
|
485
|
+
timeoutMs: o,
|
|
486
|
+
signal: a
|
|
471
487
|
});
|
|
472
|
-
if (
|
|
488
|
+
if (q.has(h))
|
|
473
489
|
return;
|
|
474
|
-
|
|
490
|
+
a == null || a.throwIfAborted();
|
|
475
491
|
const c = await r.requestDepositorPresignTransactions(
|
|
476
492
|
{
|
|
477
|
-
pegin_txid:
|
|
493
|
+
pegin_txid: i,
|
|
478
494
|
depositor_pk: u
|
|
479
495
|
},
|
|
480
|
-
|
|
496
|
+
a
|
|
481
497
|
);
|
|
482
|
-
|
|
483
|
-
const
|
|
484
|
-
|
|
498
|
+
a == null || a.throwIfAborted();
|
|
499
|
+
const d = k(u);
|
|
500
|
+
Oe(
|
|
485
501
|
c.txs,
|
|
486
502
|
s.vaultProviderBtcPubkey,
|
|
487
503
|
s.vaultKeeperBtcPubkeys,
|
|
488
504
|
u
|
|
489
505
|
);
|
|
490
|
-
const
|
|
491
|
-
(
|
|
492
|
-
), f =
|
|
506
|
+
const P = c.txs.filter(
|
|
507
|
+
(b) => k(b.claimer_pubkey) !== d
|
|
508
|
+
), f = He(P), y = await De(
|
|
493
509
|
n,
|
|
494
510
|
s,
|
|
495
511
|
f,
|
|
496
512
|
l
|
|
497
513
|
);
|
|
498
|
-
|
|
499
|
-
const
|
|
514
|
+
a == null || a.throwIfAborted();
|
|
515
|
+
const x = await Ie({
|
|
500
516
|
depositorGraph: c.depositor_graph,
|
|
501
517
|
btcWallet: n,
|
|
502
518
|
signingContext: {
|
|
@@ -513,159 +529,159 @@ async function st(e) {
|
|
|
513
529
|
registeredPayoutScriptPubKey: s.registeredPayoutScriptPubKey
|
|
514
530
|
}
|
|
515
531
|
});
|
|
516
|
-
|
|
517
|
-
const
|
|
518
|
-
|
|
532
|
+
a == null || a.throwIfAborted();
|
|
533
|
+
const v = { ...y };
|
|
534
|
+
v[p(u)] = x.payout_signatures, await r.submitDepositorPresignatures(
|
|
519
535
|
{
|
|
520
|
-
pegin_txid:
|
|
536
|
+
pegin_txid: i,
|
|
521
537
|
depositor_pk: u,
|
|
522
|
-
signatures:
|
|
523
|
-
depositor_claimer_presignatures:
|
|
538
|
+
signatures: v,
|
|
539
|
+
depositor_claimer_presignatures: x
|
|
524
540
|
},
|
|
525
|
-
|
|
541
|
+
a
|
|
526
542
|
);
|
|
527
543
|
}
|
|
528
|
-
function
|
|
544
|
+
function Ke(e) {
|
|
529
545
|
return /^[0-9a-fA-F]{64}$/.test(e);
|
|
530
546
|
}
|
|
531
|
-
function
|
|
547
|
+
function gt(e) {
|
|
532
548
|
const {
|
|
533
549
|
amountSats: t,
|
|
534
550
|
minDeposit: r,
|
|
535
551
|
maxDeposit: n,
|
|
536
|
-
btcBalance:
|
|
552
|
+
btcBalance: i,
|
|
537
553
|
estimatedFeeSats: u,
|
|
538
554
|
depositorClaimValue: s
|
|
539
555
|
} = e;
|
|
540
|
-
return !(t <= 0n || t < r || n && n > 0n && t > n || u == null || s == null || t + u + s >
|
|
556
|
+
return !(t <= 0n || t < r || n && n > 0n && t > n || u == null || s == null || t + u + s > i);
|
|
541
557
|
}
|
|
542
|
-
function
|
|
558
|
+
function ft(e, t, r) {
|
|
543
559
|
return e <= 0n ? {
|
|
544
560
|
valid: !1,
|
|
545
561
|
error: "Deposit amount must be greater than zero"
|
|
546
562
|
} : e < t ? {
|
|
547
563
|
valid: !1,
|
|
548
|
-
error: `Minimum deposit is ${
|
|
564
|
+
error: `Minimum deposit is ${T(t)} BTC`
|
|
549
565
|
} : r && r > 0n && e > r ? {
|
|
550
566
|
valid: !1,
|
|
551
|
-
error: `Maximum deposit is ${
|
|
567
|
+
error: `Maximum deposit is ${T(r)} BTC`
|
|
552
568
|
} : { valid: !0 };
|
|
553
569
|
}
|
|
554
|
-
function
|
|
570
|
+
function mt(e) {
|
|
555
571
|
const { amount: t, effectiveRemaining: r } = e;
|
|
556
572
|
return r === null ? { valid: !0 } : r === 0n ? {
|
|
557
573
|
valid: !1,
|
|
558
574
|
error: "Supply cap reached — deposits temporarily paused"
|
|
559
575
|
} : t > r ? {
|
|
560
576
|
valid: !1,
|
|
561
|
-
error: `Vault size exceeds remaining capacity (${
|
|
577
|
+
error: `Vault size exceeds remaining capacity (${T(r)} BTC)`
|
|
562
578
|
} : { valid: !0 };
|
|
563
579
|
}
|
|
564
|
-
function
|
|
580
|
+
function Pt(e, t) {
|
|
565
581
|
if (!e || e.length === 0)
|
|
566
582
|
return {
|
|
567
583
|
valid: !1,
|
|
568
584
|
error: "At least one vault provider must be selected"
|
|
569
585
|
};
|
|
570
586
|
const r = t.map(
|
|
571
|
-
(
|
|
587
|
+
(i) => i.toLowerCase()
|
|
572
588
|
);
|
|
573
589
|
return e.filter(
|
|
574
|
-
(
|
|
590
|
+
(i) => !r.includes(i.toLowerCase())
|
|
575
591
|
).length > 0 ? {
|
|
576
592
|
valid: !1,
|
|
577
593
|
error: "Invalid vault provider selected"
|
|
578
594
|
} : { valid: !0 };
|
|
579
595
|
}
|
|
580
|
-
function
|
|
596
|
+
function Fe(e, t, r) {
|
|
581
597
|
if (!e || e.length === 0)
|
|
582
598
|
return {
|
|
583
599
|
valid: !1,
|
|
584
600
|
error: "At least one vault amount required"
|
|
585
601
|
};
|
|
586
602
|
for (let n = 0; n < e.length; n++) {
|
|
587
|
-
const
|
|
588
|
-
if (
|
|
603
|
+
const i = e[n];
|
|
604
|
+
if (i <= 0n)
|
|
589
605
|
return {
|
|
590
606
|
valid: !1,
|
|
591
607
|
error: `Vault ${n + 1} amount must be positive`
|
|
592
608
|
};
|
|
593
|
-
if (t &&
|
|
609
|
+
if (t && i < t)
|
|
594
610
|
return {
|
|
595
611
|
valid: !1,
|
|
596
|
-
error: `Vault ${n + 1} amount ${
|
|
612
|
+
error: `Vault ${n + 1} amount ${T(i)} BTC is below minimum deposit ${T(t)} BTC`
|
|
597
613
|
};
|
|
598
|
-
if (r &&
|
|
614
|
+
if (r && i > r)
|
|
599
615
|
return {
|
|
600
616
|
valid: !1,
|
|
601
|
-
error: `Vault ${n + 1} amount ${
|
|
617
|
+
error: `Vault ${n + 1} amount ${T(i)} BTC exceeds maximum deposit ${T(r)} BTC`
|
|
602
618
|
};
|
|
603
619
|
}
|
|
604
620
|
return { valid: !0 };
|
|
605
621
|
}
|
|
606
|
-
function
|
|
622
|
+
function Ue(e) {
|
|
607
623
|
const t = p(e);
|
|
608
|
-
return
|
|
624
|
+
return Ke(t) ? { valid: !0 } : {
|
|
609
625
|
valid: !1,
|
|
610
626
|
error: "Invalid pubkey format: must be 64 hex characters (32-byte x-only public key, no 0x prefix)"
|
|
611
627
|
};
|
|
612
628
|
}
|
|
613
|
-
function
|
|
629
|
+
function Me(e) {
|
|
614
630
|
if (!e || e.length === 0)
|
|
615
631
|
throw new Error(
|
|
616
632
|
"No vault keepers available. The system requires at least one vault keeper to create a deposit."
|
|
617
633
|
);
|
|
618
634
|
}
|
|
619
|
-
function
|
|
635
|
+
function Le(e) {
|
|
620
636
|
if (!e || e.length === 0)
|
|
621
637
|
throw new Error(
|
|
622
638
|
"No universal challengers available. The system requires at least one universal challenger to create a deposit."
|
|
623
639
|
);
|
|
624
640
|
}
|
|
625
|
-
function
|
|
641
|
+
function Xe(e) {
|
|
626
642
|
if (e.length === 0)
|
|
627
643
|
throw new Error("No spendable UTXOs available");
|
|
628
644
|
}
|
|
629
|
-
function
|
|
645
|
+
function bt(e) {
|
|
630
646
|
const {
|
|
631
647
|
vaultAmounts: t,
|
|
632
648
|
confirmedUTXOs: r,
|
|
633
649
|
vaultProviderBtcPubkey: n,
|
|
634
|
-
vaultKeeperBtcPubkeys:
|
|
650
|
+
vaultKeeperBtcPubkeys: i,
|
|
635
651
|
universalChallengerBtcPubkeys: u,
|
|
636
652
|
minDeposit: s,
|
|
637
|
-
maxDeposit:
|
|
638
|
-
} = e,
|
|
653
|
+
maxDeposit: o
|
|
654
|
+
} = e, a = Fe(
|
|
639
655
|
t,
|
|
640
656
|
s,
|
|
641
|
-
|
|
657
|
+
o
|
|
642
658
|
);
|
|
643
|
-
if (!
|
|
644
|
-
throw new Error(
|
|
645
|
-
const l =
|
|
659
|
+
if (!a.valid)
|
|
660
|
+
throw new Error(a.error);
|
|
661
|
+
const l = Ue(n);
|
|
646
662
|
if (!l.valid)
|
|
647
663
|
throw new Error(l.error);
|
|
648
|
-
|
|
664
|
+
Me(i), Le(u), Xe(r);
|
|
649
665
|
}
|
|
650
|
-
async function
|
|
666
|
+
async function yt(e) {
|
|
651
667
|
const {
|
|
652
668
|
vaultRegistryReader: t,
|
|
653
669
|
vaultKeeperReader: r,
|
|
654
670
|
universalChallengerReader: n,
|
|
655
|
-
vaultProviderEthAddress:
|
|
671
|
+
vaultProviderEthAddress: i,
|
|
656
672
|
applicationEntryPoint: u,
|
|
657
673
|
expectedVaultProviderBtcPubkey: s,
|
|
658
|
-
expectedVaultKeeperBtcPubkeys:
|
|
659
|
-
expectedUniversalChallengerBtcPubkeys:
|
|
674
|
+
expectedVaultKeeperBtcPubkeys: o,
|
|
675
|
+
expectedUniversalChallengerBtcPubkeys: a
|
|
660
676
|
} = e, [
|
|
661
677
|
l,
|
|
662
678
|
h,
|
|
663
679
|
c
|
|
664
680
|
] = await Promise.all([
|
|
665
|
-
t.getVaultProviderBtcPubKey(
|
|
681
|
+
t.getVaultProviderBtcPubKey(i),
|
|
666
682
|
r.getCurrentVaultKeepersVersion(u),
|
|
667
683
|
n.getLatestUniversalChallengersVersion()
|
|
668
|
-
]), [
|
|
684
|
+
]), [d, P] = await Promise.all([
|
|
669
685
|
r.getVaultKeepersByVersion(
|
|
670
686
|
u,
|
|
671
687
|
h
|
|
@@ -673,110 +689,110 @@ async function dt(e) {
|
|
|
673
689
|
n.getUniversalChallengersByVersion(
|
|
674
690
|
c
|
|
675
691
|
)
|
|
676
|
-
]), f = (
|
|
692
|
+
]), f = (g) => A(g).toLowerCase(), y = (g) => g.map(f).sort();
|
|
677
693
|
if (f(s) !== l)
|
|
678
694
|
throw new Error(
|
|
679
|
-
`Vault provider BTC pubkey indexer hint does not match BTCVaultRegistry for ${
|
|
695
|
+
`Vault provider BTC pubkey indexer hint does not match BTCVaultRegistry for ${i}. Refresh and try again.`
|
|
680
696
|
);
|
|
681
|
-
const
|
|
682
|
-
|
|
697
|
+
const v = y(o), b = y(
|
|
698
|
+
d.map((g) => g.btcPubKey)
|
|
683
699
|
);
|
|
684
|
-
if (
|
|
700
|
+
if (v.length !== b.length || v.some((g, _) => g !== b[_]))
|
|
685
701
|
throw new Error(
|
|
686
702
|
`Vault keeper BTC pubkeys (v${h}) indexer set does not match ApplicationRegistry on-chain set. Refresh and try again.`
|
|
687
703
|
);
|
|
688
|
-
const
|
|
689
|
-
|
|
704
|
+
const C = y(a), E = y(
|
|
705
|
+
P.map((g) => g.btcPubKey)
|
|
690
706
|
);
|
|
691
|
-
if (
|
|
707
|
+
if (C.length !== E.length || C.some((g, _) => g !== E[_]))
|
|
692
708
|
throw new Error(
|
|
693
709
|
`Universal challenger BTC pubkeys (v${c}) indexer set does not match ProtocolParams on-chain set. Refresh and try again.`
|
|
694
710
|
);
|
|
695
711
|
return {
|
|
696
712
|
vaultProviderBtcPubkeyXOnly: l,
|
|
697
|
-
vaultKeeperBtcPubkeysSorted:
|
|
698
|
-
universalChallengerBtcPubkeysSorted:
|
|
713
|
+
vaultKeeperBtcPubkeysSorted: b,
|
|
714
|
+
universalChallengerBtcPubkeysSorted: E,
|
|
699
715
|
expectedAppVaultKeepersVersion: h,
|
|
700
716
|
expectedUniversalChallengersVersion: c
|
|
701
717
|
};
|
|
702
718
|
}
|
|
703
|
-
class
|
|
719
|
+
class j extends Error {
|
|
704
720
|
constructor(t) {
|
|
705
721
|
super(t), this.name = "RegisteredVaultVersionMismatchError";
|
|
706
722
|
}
|
|
707
723
|
}
|
|
708
|
-
function
|
|
709
|
-
return e instanceof
|
|
724
|
+
function wt(e) {
|
|
725
|
+
return e instanceof j || e instanceof Error && e.name === "RegisteredVaultVersionMismatchError";
|
|
710
726
|
}
|
|
711
|
-
async function
|
|
727
|
+
async function xt(e) {
|
|
712
728
|
const {
|
|
713
729
|
vaultRegistryReader: t,
|
|
714
730
|
vaultIds: r,
|
|
715
731
|
expectedOffchainParamsVersion: n,
|
|
716
|
-
expectedAppVaultKeepersVersion:
|
|
732
|
+
expectedAppVaultKeepersVersion: i,
|
|
717
733
|
expectedUniversalChallengersVersion: u
|
|
718
|
-
} = e, s = await t.getProtocolInfoBatch(r),
|
|
719
|
-
if (s.forEach((
|
|
734
|
+
} = e, s = await t.getProtocolInfoBatch(r), o = [];
|
|
735
|
+
if (s.forEach((a, l) => {
|
|
720
736
|
const h = r[l];
|
|
721
|
-
|
|
722
|
-
`vault ${h}: offchainParams expected v${n}, got v${
|
|
723
|
-
),
|
|
724
|
-
`vault ${h}: appVaultKeepers expected v${
|
|
725
|
-
),
|
|
726
|
-
`vault ${h}: universalChallengers expected v${u}, got v${
|
|
737
|
+
a.offchainParamsVersion !== n && o.push(
|
|
738
|
+
`vault ${h}: offchainParams expected v${n}, got v${a.offchainParamsVersion}`
|
|
739
|
+
), a.appVaultKeepersVersion !== i && o.push(
|
|
740
|
+
`vault ${h}: appVaultKeepers expected v${i}, got v${a.appVaultKeepersVersion}`
|
|
741
|
+
), a.universalChallengersVersion !== u && o.push(
|
|
742
|
+
`vault ${h}: universalChallengers expected v${u}, got v${a.universalChallengersVersion}`
|
|
727
743
|
);
|
|
728
|
-
}),
|
|
729
|
-
throw new
|
|
730
|
-
`Aborting BTC broadcast: signer-set or offchain-params versions changed during registration (${
|
|
744
|
+
}), o.length > 0)
|
|
745
|
+
throw new j(
|
|
746
|
+
`Aborting BTC broadcast: signer-set or offchain-params versions changed during registration (${o.join("; ")}). The Pre-PegIn was not broadcast; the registered ETH vault will time out per protocol rules.`
|
|
731
747
|
);
|
|
732
748
|
}
|
|
733
|
-
var
|
|
734
|
-
const
|
|
749
|
+
var Q = /* @__PURE__ */ ((e) => (e.CLAIM_EVENT_RECEIVED = "ClaimEventReceived", e.CLAIM_BROADCAST = "ClaimBroadcast", e.ASSERT_BROADCAST = "AssertBroadcast", e.PAYOUT_BROADCAST = "PayoutBroadcast", e.PAYOUT_BLOCKED = "PayoutBlocked", e))(Q || {});
|
|
750
|
+
const ze = /* @__PURE__ */ new Set([
|
|
735
751
|
"PayoutBroadcast",
|
|
736
752
|
"PayoutBlocked"
|
|
737
753
|
/* PAYOUT_BLOCKED */
|
|
738
754
|
]);
|
|
739
|
-
function
|
|
740
|
-
return Object.values(
|
|
755
|
+
function vt(e) {
|
|
756
|
+
return Object.values(Q).includes(
|
|
741
757
|
e
|
|
742
758
|
);
|
|
743
759
|
}
|
|
744
|
-
function
|
|
745
|
-
return !!e &&
|
|
760
|
+
function Et(e) {
|
|
761
|
+
return !!e && ze.has(e);
|
|
746
762
|
}
|
|
747
|
-
class
|
|
763
|
+
class Ge extends Error {
|
|
748
764
|
constructor(r, n) {
|
|
749
765
|
super(`Refund not yet mature (BIP68 not final): ${n.message}`);
|
|
750
|
-
|
|
751
|
-
|
|
766
|
+
$(this, "vaultId");
|
|
767
|
+
$(this, "cause");
|
|
752
768
|
this.name = "BIP68NotMatureError", this.vaultId = r, this.cause = n;
|
|
753
769
|
}
|
|
754
770
|
}
|
|
755
|
-
const
|
|
756
|
-
function
|
|
771
|
+
const qe = /^0x[0-9a-fA-F]{64}$/, je = /^(?:0x)?(?:[0-9a-fA-F]{2})+$/, W = /^(?:0x)?(?:[0-9a-fA-F]{64}|[0-9a-fA-F]{66})$/, Y = 160, U = 2e3, M = 10n, L = 100n;
|
|
772
|
+
function Tt(e) {
|
|
757
773
|
if (!Number.isFinite(e) || e <= 0)
|
|
758
774
|
throw new Error(
|
|
759
775
|
`feeRateSatsVb must be a positive finite number, got ${e}`
|
|
760
776
|
);
|
|
761
|
-
return BigInt(Math.ceil(e *
|
|
777
|
+
return BigInt(Math.ceil(e * Y));
|
|
762
778
|
}
|
|
763
|
-
const
|
|
764
|
-
function
|
|
779
|
+
const Qe = 1, We = /non-BIP68-final/i;
|
|
780
|
+
function D(e, t) {
|
|
765
781
|
if (e.length !== 66)
|
|
766
782
|
throw new Error(
|
|
767
783
|
`${t} must be 32 bytes (66 hex chars with 0x prefix), got length ${e.length}`
|
|
768
784
|
);
|
|
769
|
-
if (!
|
|
785
|
+
if (!qe.test(e))
|
|
770
786
|
throw new Error(
|
|
771
787
|
`${t} must contain only hex characters after the 0x prefix`
|
|
772
788
|
);
|
|
773
789
|
}
|
|
774
|
-
function
|
|
790
|
+
function I(e, t) {
|
|
775
791
|
if (!Number.isInteger(e) || e < 0)
|
|
776
792
|
throw new Error(`${t} must be a non-negative integer, got ${e}`);
|
|
777
793
|
}
|
|
778
|
-
function
|
|
779
|
-
if (
|
|
794
|
+
function Ye(e) {
|
|
795
|
+
if (D(e.hashlock, "hashlock"), !Number.isInteger(e.htlcVout) || e.htlcVout < 0)
|
|
780
796
|
throw new Error(
|
|
781
797
|
`htlcVout must be a non-negative integer, got ${e.htlcVout}`
|
|
782
798
|
);
|
|
@@ -788,7 +804,7 @@ function Ge(e) {
|
|
|
788
804
|
);
|
|
789
805
|
for (let r = 0; r < e.batch.length; r++) {
|
|
790
806
|
const n = e.batch[r];
|
|
791
|
-
if (
|
|
807
|
+
if (D(n.hashlock, `batch[${r}].hashlock`), !Number.isInteger(n.htlcVout) || n.htlcVout !== r)
|
|
792
808
|
throw new Error(
|
|
793
809
|
`batch[${r}].htlcVout must equal ${r} (contiguous vout-ordered vector), got ${n.htlcVout}`
|
|
794
810
|
);
|
|
@@ -806,24 +822,24 @@ function Ge(e) {
|
|
|
806
822
|
throw new Error(
|
|
807
823
|
`batch[${e.htlcVout}].amount (${t.amount}) does not match target amount (${e.amount})`
|
|
808
824
|
);
|
|
809
|
-
if (
|
|
825
|
+
if (I(e.offchainParamsVersion, "offchainParamsVersion"), I(e.appVaultKeepersVersion, "appVaultKeepersVersion"), I(
|
|
810
826
|
e.universalChallengersVersion,
|
|
811
827
|
"universalChallengersVersion"
|
|
812
828
|
), typeof e.unsignedPrePeginTxHex != "string" || e.unsignedPrePeginTxHex.length === 0)
|
|
813
829
|
throw new Error("unsignedPrePeginTxHex must be a non-empty hex string");
|
|
814
|
-
if (!
|
|
830
|
+
if (!je.test(e.unsignedPrePeginTxHex))
|
|
815
831
|
throw new Error(
|
|
816
832
|
"unsignedPrePeginTxHex must be a hex byte string (optional 0x prefix, even length)"
|
|
817
833
|
);
|
|
818
|
-
if (!e.depositorBtcPubkey || !
|
|
834
|
+
if (!e.depositorBtcPubkey || !W.test(e.depositorBtcPubkey))
|
|
819
835
|
throw new Error(
|
|
820
836
|
"depositorBtcPubkey must be 32 or 33 bytes of hex (optional 0x prefix)"
|
|
821
837
|
);
|
|
822
838
|
if (typeof e.amount != "bigint" || e.amount <= 0n)
|
|
823
839
|
throw new Error(`amount must be a positive bigint, got ${e.amount}`);
|
|
824
840
|
}
|
|
825
|
-
function
|
|
826
|
-
if (!e.vaultProviderPubkey || !
|
|
841
|
+
function Je(e) {
|
|
842
|
+
if (!e.vaultProviderPubkey || !W.test(e.vaultProviderPubkey))
|
|
827
843
|
throw new Error("vaultProviderPubkey must be 32 or 33 bytes of hex");
|
|
828
844
|
if (e.vaultKeeperPubkeys.length === 0)
|
|
829
845
|
throw new Error("vaultKeeperPubkeys must be non-empty");
|
|
@@ -848,8 +864,29 @@ function je(e) {
|
|
|
848
864
|
`councilQuorum (${e.councilQuorum}) must be in [1, councilSize=${e.councilSize}]`
|
|
849
865
|
);
|
|
850
866
|
}
|
|
851
|
-
function
|
|
852
|
-
const
|
|
867
|
+
async function Ze(e, t) {
|
|
868
|
+
const r = await fe(
|
|
869
|
+
t.numLocalChallengers,
|
|
870
|
+
t.universalChallengerPubkeys.length,
|
|
871
|
+
t.councilQuorum,
|
|
872
|
+
t.councilSize,
|
|
873
|
+
t.feeRate
|
|
874
|
+
), n = await me(
|
|
875
|
+
t.vaultKeeperPubkeys.length,
|
|
876
|
+
t.universalChallengerPubkeys.length,
|
|
877
|
+
t.minPeginFeeRate
|
|
878
|
+
), i = r + n;
|
|
879
|
+
return e.map((u, s) => {
|
|
880
|
+
const o = u.amount - i;
|
|
881
|
+
if (o <= 0n)
|
|
882
|
+
throw new Error(
|
|
883
|
+
`Re-derived peginAmount for batch[${s}] is non-positive (${o}): HTLC value ${u.amount} does not exceed depositorClaimValue ${r} + minPeginFee ${n}. Refusing to build a refund from an inconsistent (amount, protocol params) pair.`
|
|
884
|
+
);
|
|
885
|
+
return o;
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
function et(e) {
|
|
889
|
+
const t = ce.fromHex(e);
|
|
853
890
|
try {
|
|
854
891
|
t.finalizeAllInputs();
|
|
855
892
|
} catch (r) {
|
|
@@ -859,121 +896,134 @@ function qe(e) {
|
|
|
859
896
|
}
|
|
860
897
|
return t.extractTransaction().toHex();
|
|
861
898
|
}
|
|
862
|
-
async function
|
|
899
|
+
async function kt(e) {
|
|
863
900
|
const {
|
|
864
901
|
vaultId: t,
|
|
865
902
|
readVault: r,
|
|
866
903
|
readPrePeginContext: n,
|
|
867
|
-
feeRate:
|
|
904
|
+
feeRate: i,
|
|
868
905
|
signPsbt: u,
|
|
869
906
|
broadcastTx: s,
|
|
870
|
-
signal:
|
|
907
|
+
signal: o
|
|
871
908
|
} = e;
|
|
872
|
-
|
|
873
|
-
const
|
|
874
|
-
|
|
875
|
-
const l = await n(
|
|
876
|
-
if (
|
|
877
|
-
throw new Error(`feeRate must be a positive number, got ${
|
|
878
|
-
if (
|
|
909
|
+
o == null || o.throwIfAborted(), D(t, "vaultId");
|
|
910
|
+
const a = await r();
|
|
911
|
+
Ye(a), o == null || o.throwIfAborted();
|
|
912
|
+
const l = await n(a);
|
|
913
|
+
if (Je(l), o == null || o.throwIfAborted(), !Number.isFinite(i) || i <= 0)
|
|
914
|
+
throw new Error(`feeRate must be a positive number, got ${i}`);
|
|
915
|
+
if (i > U)
|
|
879
916
|
throw new Error(
|
|
880
|
-
`feeRate ${
|
|
917
|
+
`feeRate ${i} sat/vB exceeds refund safety cap ${U} sat/vB; refusing to sign refund.`
|
|
881
918
|
);
|
|
882
|
-
const h = BigInt(Math.ceil(
|
|
919
|
+
const h = BigInt(Math.ceil(i * Y)), c = a.amount * M / L;
|
|
883
920
|
if (h > c)
|
|
884
921
|
throw new Error(
|
|
885
|
-
`Refund fee ${h} sats exceeds the per-vault safety cap of ${c} sats (${
|
|
922
|
+
`Refund fee ${h} sats exceeds the per-vault safety cap of ${c} sats (${M}/${L} of vault.amount=${a.amount}); refusing to sign refund.`
|
|
886
923
|
);
|
|
887
|
-
|
|
888
|
-
const
|
|
889
|
-
|
|
890
|
-
),
|
|
891
|
-
if (f !== void 0 && f.vout !==
|
|
924
|
+
o == null || o.throwIfAborted();
|
|
925
|
+
const d = A(
|
|
926
|
+
a.depositorBtcPubkey
|
|
927
|
+
), P = p(a.unsignedPrePeginTxHex), f = se(P);
|
|
928
|
+
if (f !== void 0 && f.vout !== a.batch.length)
|
|
892
929
|
throw new Error(
|
|
893
|
-
`Auth-anchor OP_RETURN at vout ${f.vout} does not match batch size (${
|
|
930
|
+
`Auth-anchor OP_RETURN at vout ${f.vout} does not match batch size (${a.batch.length} HTLC outputs expect the anchor at vout ${a.batch.length}). Refund refused — sibling HTLC vector is incomplete.`
|
|
894
931
|
);
|
|
895
|
-
const
|
|
896
|
-
let
|
|
932
|
+
const y = f == null ? void 0 : f.hash;
|
|
933
|
+
let x;
|
|
897
934
|
try {
|
|
898
|
-
|
|
899
|
-
} catch (
|
|
935
|
+
x = S.fromHex(P);
|
|
936
|
+
} catch (m) {
|
|
900
937
|
throw new Error(
|
|
901
|
-
`Failed to parse funded Pre-PegIn transaction hex: ${
|
|
938
|
+
`Failed to parse funded Pre-PegIn transaction hex: ${m instanceof Error ? m.message : String(m)}`
|
|
902
939
|
);
|
|
903
940
|
}
|
|
904
|
-
if (
|
|
941
|
+
if (x.outs.length < a.batch.length)
|
|
905
942
|
throw new Error(
|
|
906
|
-
`Funded Pre-PegIn tx has ${
|
|
943
|
+
`Funded Pre-PegIn tx has ${x.outs.length} outputs but batch requires at least ${a.batch.length} HTLC outputs. Refund refused — funded tx shape disagrees with sibling vector.`
|
|
907
944
|
);
|
|
908
|
-
const
|
|
945
|
+
const v = await Ze(a.batch, l);
|
|
946
|
+
o == null || o.throwIfAborted();
|
|
947
|
+
const { psbtHex: b } = await ge({
|
|
909
948
|
prePeginParams: {
|
|
910
|
-
depositorPubkey:
|
|
949
|
+
depositorPubkey: d,
|
|
911
950
|
vaultProviderPubkey: p(l.vaultProviderPubkey),
|
|
912
951
|
vaultKeeperPubkeys: l.vaultKeeperPubkeys.map(p),
|
|
913
952
|
universalChallengerPubkeys: l.universalChallengerPubkeys.map(p),
|
|
914
|
-
hashlocks:
|
|
953
|
+
hashlocks: a.batch.map((m) => p(m.hashlock)),
|
|
915
954
|
timelockRefund: l.timelockRefund,
|
|
916
|
-
pegInAmounts:
|
|
955
|
+
pegInAmounts: v,
|
|
917
956
|
feeRate: l.feeRate,
|
|
918
957
|
minPeginFeeRate: l.minPeginFeeRate,
|
|
919
958
|
numLocalChallengers: l.numLocalChallengers,
|
|
920
959
|
councilQuorum: l.councilQuorum,
|
|
921
960
|
councilSize: l.councilSize,
|
|
922
961
|
network: l.network,
|
|
923
|
-
authAnchorHash:
|
|
962
|
+
authAnchorHash: y
|
|
924
963
|
},
|
|
925
|
-
fundedPrePeginTxHex:
|
|
926
|
-
htlcVout:
|
|
964
|
+
fundedPrePeginTxHex: P,
|
|
965
|
+
htlcVout: a.htlcVout,
|
|
927
966
|
refundFee: h,
|
|
928
967
|
// buildRefundPsbt's top-level `hashlock` param is documented as "no 0x
|
|
929
968
|
// prefix" and flows into the WASM HTLC connector derivation; a prefixed
|
|
930
969
|
// value would derive the wrong refund script leaf and yield an
|
|
931
970
|
// unspendable PSBT. Match the `hashlocks` array handling above.
|
|
932
|
-
hashlock: p(
|
|
971
|
+
hashlock: p(a.hashlock)
|
|
933
972
|
});
|
|
934
|
-
|
|
935
|
-
const
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
),
|
|
973
|
+
o == null || o.throwIfAborted();
|
|
974
|
+
const C = O(
|
|
975
|
+
a.depositorBtcPubkey,
|
|
976
|
+
Qe
|
|
977
|
+
), E = await u(b, C);
|
|
939
978
|
V({
|
|
940
979
|
requestedPsbtHex: b,
|
|
941
|
-
returnedPsbtHex:
|
|
980
|
+
returnedPsbtHex: E
|
|
942
981
|
});
|
|
943
|
-
const
|
|
944
|
-
|
|
982
|
+
const g = 0, _ = N(
|
|
983
|
+
E,
|
|
984
|
+
d,
|
|
985
|
+
g
|
|
986
|
+
);
|
|
987
|
+
H({
|
|
988
|
+
requestedPsbtHex: b,
|
|
989
|
+
signatureHex: _,
|
|
990
|
+
signerXOnlyPubkeyHex: d,
|
|
991
|
+
inputIndex: g
|
|
992
|
+
});
|
|
993
|
+
const J = et(E);
|
|
994
|
+
o == null || o.throwIfAborted();
|
|
945
995
|
try {
|
|
946
|
-
return await s(
|
|
947
|
-
} catch (
|
|
948
|
-
throw
|
|
996
|
+
return await s(J);
|
|
997
|
+
} catch (m) {
|
|
998
|
+
throw m instanceof Error && We.test(m.message) ? new Ge(t, m) : m;
|
|
949
999
|
}
|
|
950
1000
|
}
|
|
951
1001
|
export {
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
1002
|
+
Ge as B,
|
|
1003
|
+
Q as C,
|
|
1004
|
+
j as R,
|
|
1005
|
+
ht as a,
|
|
1006
|
+
Ie as b,
|
|
1007
|
+
mt as c,
|
|
1008
|
+
Pt as d,
|
|
1009
|
+
Fe as e,
|
|
1010
|
+
Ue as f,
|
|
1011
|
+
bt as g,
|
|
1012
|
+
yt as h,
|
|
1013
|
+
gt as i,
|
|
1014
|
+
wt as j,
|
|
1015
|
+
xt as k,
|
|
1016
|
+
vt as l,
|
|
1017
|
+
Et as m,
|
|
1018
|
+
kt as n,
|
|
1019
|
+
Tt as o,
|
|
1020
|
+
L as p,
|
|
1021
|
+
M as q,
|
|
1022
|
+
pt as r,
|
|
1023
|
+
dt as s,
|
|
1024
|
+
U as t,
|
|
1025
|
+
Y as u,
|
|
1026
|
+
ft as v,
|
|
1027
|
+
G as w
|
|
978
1028
|
};
|
|
979
|
-
//# sourceMappingURL=buildAndBroadcastRefund-
|
|
1029
|
+
//# sourceMappingURL=buildAndBroadcastRefund-DXHs6unL.js.map
|