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