@babylonlabs-io/ts-sdk 2.0.2 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PeginManager-CKf7Bjmj.js → PeginManager-D8WGB8eN.js} +2 -2
- package/dist/PeginManager-D8WGB8eN.js.map +1 -0
- package/dist/{PeginManager-Dt2Z5ljw.cjs → PeginManager-IgDHy_eU.cjs} +2 -2
- package/dist/PeginManager-IgDHy_eU.cjs.map +1 -0
- package/dist/{buildAndBroadcastReclaim-B19cyK69.js → buildAndBroadcastReclaim-C55KaRJF.js} +783 -791
- package/dist/buildAndBroadcastReclaim-C55KaRJF.js.map +1 -0
- package/dist/buildAndBroadcastReclaim-CefzR6i_.cjs +2 -0
- package/dist/buildAndBroadcastReclaim-CefzR6i_.cjs.map +1 -0
- package/dist/index-D2mybjXD.js +522 -0
- package/dist/index-D2mybjXD.js.map +1 -0
- package/dist/index-MRdle0fs.cjs +2 -0
- package/dist/index-MRdle0fs.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +215 -214
- package/dist/pegin-registration-client-B0j6ugt9.cjs +2 -0
- package/dist/pegin-registration-client-B0j6ugt9.cjs.map +1 -0
- package/dist/{pegin-registration-client-C5Hktrja.js → pegin-registration-client-ilkV1mLP.js} +103 -88
- package/dist/pegin-registration-client-ilkV1mLP.js.map +1 -0
- package/dist/primeVpAuth-BDWBKYhv.cjs +2 -0
- package/dist/primeVpAuth-BDWBKYhv.cjs.map +1 -0
- package/dist/primeVpAuth-D0ZnsjRi.js +805 -0
- package/dist/primeVpAuth-D0ZnsjRi.js.map +1 -0
- package/dist/state-C4WoNCy1.cjs +2 -0
- package/dist/state-C4WoNCy1.cjs.map +1 -0
- package/dist/{json-rpc-client-CQLbpuKK.js → state-CFn1rT74.js} +136 -88
- package/dist/state-CFn1rT74.js.map +1 -0
- package/dist/tbv/core/clients/eth/index.cjs +1 -1
- package/dist/tbv/core/clients/eth/index.js +2 -2
- package/dist/tbv/core/clients/eth/types.d.ts +12 -5
- package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts +12 -3
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts.map +1 -1
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +52 -51
- package/dist/tbv/core/clients/mempool/index.cjs +1 -1
- package/dist/tbv/core/clients/mempool/index.cjs.map +1 -1
- package/dist/tbv/core/clients/mempool/index.d.ts +1 -1
- package/dist/tbv/core/clients/mempool/index.d.ts.map +1 -1
- package/dist/tbv/core/clients/mempool/index.js +85 -71
- package/dist/tbv/core/clients/mempool/index.js.map +1 -1
- package/dist/tbv/core/clients/mempool/mempoolApi.d.ts +10 -0
- package/dist/tbv/core/clients/mempool/mempoolApi.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/api.d.ts +17 -13
- package/dist/tbv/core/clients/vault-provider/api.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/createAuthenticatedVpClient.d.ts +8 -0
- package/dist/tbv/core/clients/vault-provider/auth/createAuthenticatedVpClient.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/index.d.ts +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/index.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/primeVpAuth.d.ts +8 -0
- package/dist/tbv/core/clients/vault-provider/auth/primeVpAuth.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/tokenProvider.d.ts +18 -2
- package/dist/tbv/core/clients/vault-provider/auth/tokenProvider.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/tokenRegistry.d.ts +26 -6
- package/dist/tbv/core/clients/vault-provider/auth/tokenRegistry.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/batchAttribution.d.ts +17 -15
- package/dist/tbv/core/clients/vault-provider/batchAttribution.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/batchPoll.d.ts +15 -9
- package/dist/tbv/core/clients/vault-provider/batchPoll.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/json-rpc-client.d.ts +3 -2
- package/dist/tbv/core/clients/vault-provider/json-rpc-client.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/status/index.cjs +1 -1
- package/dist/tbv/core/clients/vault-provider/status/index.js +2 -2
- package/dist/tbv/core/clients/vault-provider/types.d.ts +36 -23
- package/dist/tbv/core/clients/vault-provider/types.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/validators.d.ts +12 -4
- package/dist/tbv/core/clients/vault-provider/validators.d.ts.map +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +216 -215
- package/dist/tbv/core/managers/index.cjs +1 -1
- package/dist/tbv/core/managers/index.js +1 -1
- package/dist/tbv/core/services/deposit/interfaces.d.ts +2 -2
- package/dist/tbv/core/services/deposit/interfaces.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/runDepositorPresignFlow.d.ts +3 -1
- package/dist/tbv/core/services/deposit/runDepositorPresignFlow.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/submitWotsPublicKey.d.ts +3 -1
- package/dist/tbv/core/services/deposit/submitWotsPublicKey.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/waitForPeginStatus.d.ts +11 -2
- package/dist/tbv/core/services/deposit/waitForPeginStatus.d.ts.map +1 -1
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +75 -74
- package/dist/tbv/core/services/index.js.map +1 -1
- package/dist/tbv/core/services/pegout/state.d.ts +10 -5
- package/dist/tbv/core/services/pegout/state.d.ts.map +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +216 -215
- package/dist/{toRefundInputs-DIIdhjvu.js → toRefundInputs-10RYIfh1.js} +2 -2
- package/dist/{toRefundInputs-DIIdhjvu.js.map → toRefundInputs-10RYIfh1.js.map} +1 -1
- package/dist/{toRefundInputs-B_GlIXjk.cjs → toRefundInputs-a-0HRyrl.cjs} +2 -2
- package/dist/{toRefundInputs-B_GlIXjk.cjs.map → toRefundInputs-a-0HRyrl.cjs.map} +1 -1
- package/dist/{types-DJxOEU3P.cjs → types-BueQoMjO.cjs} +2 -2
- package/dist/{types-DJxOEU3P.cjs.map → types-BueQoMjO.cjs.map} +1 -1
- package/dist/{types-Dz1kVqn6.js → types-DGkejGZH.js} +2 -2
- package/dist/{types-Dz1kVqn6.js.map → types-DGkejGZH.js.map} +1 -1
- package/package.json +1 -1
- package/dist/PeginManager-CKf7Bjmj.js.map +0 -1
- package/dist/PeginManager-Dt2Z5ljw.cjs.map +0 -1
- package/dist/buildAndBroadcastReclaim-B19cyK69.js.map +0 -1
- package/dist/buildAndBroadcastReclaim-DcbsjJdf.cjs +0 -2
- package/dist/buildAndBroadcastReclaim-DcbsjJdf.cjs.map +0 -1
- package/dist/index-Bnavi_r3.js +0 -521
- package/dist/index-Bnavi_r3.js.map +0 -1
- package/dist/index-CcdCNFLM.cjs +0 -2
- package/dist/index-CcdCNFLM.cjs.map +0 -1
- package/dist/json-rpc-client-CQLbpuKK.js.map +0 -1
- package/dist/json-rpc-client-DbpFfa_o.cjs +0 -2
- package/dist/json-rpc-client-DbpFfa_o.cjs.map +0 -1
- package/dist/pegin-registration-client-BdJ6c7si.cjs +0 -2
- package/dist/pegin-registration-client-BdJ6c7si.cjs.map +0 -1
- package/dist/pegin-registration-client-C5Hktrja.js.map +0 -1
- package/dist/primeVpAuth-D21PXgg2.cjs +0 -2
- package/dist/primeVpAuth-D21PXgg2.cjs.map +0 -1
- package/dist/primeVpAuth-PiUJksAq.js +0 -745
- package/dist/primeVpAuth-PiUJksAq.js.map +0 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var d = (e, t, r) =>
|
|
4
|
-
var
|
|
5
|
-
const
|
|
1
|
+
var f = Object.defineProperty;
|
|
2
|
+
var y = (e, t, r) => t in e ? f(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var d = (e, t, r) => y(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
var w = /* @__PURE__ */ ((e) => (e.PENDING_INGESTION = "PendingIngestion", e.PENDING_DEPOSITOR_WOTS_PK = "PendingDepositorWotsPK", e.PENDING_BABE_SETUP = "PendingBabeSetup", e.PENDING_CHALLENGER_PRESIGNING = "PendingChallengerPresigning", e.PENDING_PEGIN_SIGS_AVAILABILITY = "PendingPeginSigsAvailability", e.PENDING_PRE_PEGIN_CONFIRMATIONS = "PendingPrePegInConfirmations", e.PENDING_DEPOSITOR_SIGNATURES = "PendingDepositorSignatures", e.PENDING_ACKS = "PendingACKs", e.PENDING_ACTIVATION = "PendingActivation", e.ACTIVATED_PENDING_BROADCAST = "ActivatedPendingBroadcast", e.ACTIVATED = "Activated", e.EXPIRED = "Expired", e.INGESTION_REJECTED = "IngestionRejected", e.INVALID_SIG_IN_CONTRACT = "InvalidSigInContract", e.AML_REJECTED = "AmlRejected", e.EXPIRED_CLEANED_UP = "ExpiredCleanedUp", e.EXPIRED_IN_CLAIM = "ExpiredInClaim", e.BABE_SETUP_FAILED = "BabeSetupFailed", e))(w || {});
|
|
5
|
+
const W = [
|
|
6
6
|
"PendingIngestion",
|
|
7
7
|
"PendingBabeSetup",
|
|
8
8
|
"PendingChallengerPresigning",
|
|
9
9
|
"PendingPeginSigsAvailability",
|
|
10
10
|
"PendingPrePegInConfirmations"
|
|
11
11
|
/* PENDING_PRE_PEGIN_CONFIRMATIONS */
|
|
12
|
-
],
|
|
12
|
+
], b = [
|
|
13
13
|
"PendingACKs",
|
|
14
14
|
"PendingActivation",
|
|
15
15
|
"ActivatedPendingBroadcast",
|
|
16
16
|
"Activated"
|
|
17
17
|
/* ACTIVATED */
|
|
18
|
-
],
|
|
18
|
+
], C = /* @__PURE__ */ new Set([
|
|
19
19
|
"PendingBabeSetup",
|
|
20
20
|
"PendingChallengerPresigning",
|
|
21
21
|
"PendingPeginSigsAvailability",
|
|
22
22
|
"PendingPrePegInConfirmations",
|
|
23
|
-
...
|
|
24
|
-
]),
|
|
23
|
+
...b
|
|
24
|
+
]), $ = /* @__PURE__ */ new Set([
|
|
25
25
|
"IngestionRejected",
|
|
26
26
|
"InvalidSigInContract",
|
|
27
27
|
"AmlRejected",
|
|
@@ -29,12 +29,37 @@ const k = [
|
|
|
29
29
|
"ExpiredInClaim",
|
|
30
30
|
"BabeSetupFailed"
|
|
31
31
|
/* BABE_SETUP_FAILED */
|
|
32
|
-
]),
|
|
33
|
-
...
|
|
32
|
+
]), H = /* @__PURE__ */ new Set([
|
|
33
|
+
...C,
|
|
34
34
|
"PendingDepositorSignatures"
|
|
35
35
|
/* PENDING_DEPOSITOR_SIGNATURES */
|
|
36
|
-
]),
|
|
36
|
+
]), K = 50;
|
|
37
37
|
var v = /* @__PURE__ */ ((e) => (e[e.PEGIN_NOT_FOUND = 4001] = "PEGIN_NOT_FOUND", e))(v || {});
|
|
38
|
+
function I(e) {
|
|
39
|
+
return (e.startsWith("0x") ? e.slice(2) : e).toLowerCase();
|
|
40
|
+
}
|
|
41
|
+
function X(e, t) {
|
|
42
|
+
const r = /* @__PURE__ */ new Set();
|
|
43
|
+
for (const s of e)
|
|
44
|
+
r.add(I(s));
|
|
45
|
+
const n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), a = [], i = [];
|
|
46
|
+
for (const s of t) {
|
|
47
|
+
const u = I(s.vault_id);
|
|
48
|
+
if (!r.has(u)) {
|
|
49
|
+
i.push(u);
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if (o.has(u)) {
|
|
53
|
+
a.push(u);
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
o.add(u), n.set(u, { result: s.result, error: s.error });
|
|
57
|
+
}
|
|
58
|
+
const c = [];
|
|
59
|
+
for (const s of r)
|
|
60
|
+
o.has(s) || c.push(s);
|
|
61
|
+
return { byVaultId: n, missing: c, unexpected: i, duplicate: a };
|
|
62
|
+
}
|
|
38
63
|
class l extends Error {
|
|
39
64
|
constructor(t, r, n = "local", o) {
|
|
40
65
|
super(r), this.code = t, this.source = n, this.data = o, this.name = "JsonRpcError";
|
|
@@ -51,9 +76,9 @@ const _ = {
|
|
|
51
76
|
INVALID_RESPONSE: -32700,
|
|
52
77
|
/** SDK client: response body exceeded the configured byte limit */
|
|
53
78
|
RESPONSE_TOO_LARGE: -32701
|
|
54
|
-
},
|
|
79
|
+
}, g = "2.0", L = 3, D = 1e3, U = 2 * 1024 * 1024, B = /* @__PURE__ */ new Set([
|
|
55
80
|
"vaultProvider_requestDepositorClaimerArtifacts"
|
|
56
|
-
]),
|
|
81
|
+
]), m = /* @__PURE__ */ new Set([
|
|
57
82
|
408,
|
|
58
83
|
// Request Timeout
|
|
59
84
|
429,
|
|
@@ -66,20 +91,20 @@ const _ = {
|
|
|
66
91
|
// Service Unavailable
|
|
67
92
|
504
|
|
68
93
|
// Gateway Timeout
|
|
69
|
-
]),
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
94
|
+
]), G = /* @__PURE__ */ new Set([
|
|
95
|
+
"vaultProvider_getPeginStatusByVaultId",
|
|
96
|
+
"vaultProvider_batchGetPeginStatusByVaultId",
|
|
97
|
+
"vaultProvider_batchGetPegoutStatusByVaultId",
|
|
73
98
|
"vaultProvider_requestDepositorPresignTransactions"
|
|
74
99
|
]);
|
|
75
|
-
function G(e) {
|
|
76
|
-
return m.has(e);
|
|
77
|
-
}
|
|
78
|
-
const B = -32001;
|
|
79
100
|
function x(e) {
|
|
80
|
-
return
|
|
101
|
+
return G.has(e);
|
|
81
102
|
}
|
|
82
|
-
|
|
103
|
+
const M = -32001;
|
|
104
|
+
function F(e) {
|
|
105
|
+
return e instanceof l && e.source === "wire" && e.code === M;
|
|
106
|
+
}
|
|
107
|
+
class z {
|
|
83
108
|
constructor(t) {
|
|
84
109
|
d(this, "baseUrl");
|
|
85
110
|
d(this, "timeout");
|
|
@@ -93,9 +118,9 @@ class j {
|
|
|
93
118
|
if (this.baseUrl = t.baseUrl.replace(/\/$/, ""), this.timeout = t.timeout, this.headers = {
|
|
94
119
|
"Content-Type": "application/json",
|
|
95
120
|
...t.headers
|
|
96
|
-
}, this.retries = t.retries ??
|
|
121
|
+
}, this.retries = t.retries ?? L, this.retryDelay = t.retryDelay ?? D, this.maxResponseBytes = t.maxResponseBytes ?? U, !Number.isFinite(this.maxResponseBytes) || this.maxResponseBytes <= 0)
|
|
97
122
|
throw new Error("maxResponseBytes must be a positive finite number");
|
|
98
|
-
this.retryableFor = t.retryableFor ??
|
|
123
|
+
this.retryableFor = t.retryableFor ?? x, this.tokenProvider = t.tokenProvider;
|
|
99
124
|
}
|
|
100
125
|
async buildHeaders(t, r) {
|
|
101
126
|
const n = { ...this.headers };
|
|
@@ -127,44 +152,44 @@ class j {
|
|
|
127
152
|
n,
|
|
128
153
|
o
|
|
129
154
|
);
|
|
130
|
-
} catch (
|
|
131
|
-
if (this.tokenProvider && o.bearerAttached &&
|
|
155
|
+
} catch (a) {
|
|
156
|
+
if (this.tokenProvider && o.bearerAttached && F(a))
|
|
132
157
|
return this.tokenProvider.invalidate(), await this.callOnce(t, r, n);
|
|
133
|
-
throw
|
|
158
|
+
throw a;
|
|
134
159
|
}
|
|
135
160
|
}
|
|
136
161
|
async callOnce(t, r, n, o) {
|
|
137
|
-
const
|
|
162
|
+
const a = await this.fetchWithRetry(
|
|
138
163
|
t,
|
|
139
164
|
r,
|
|
140
165
|
n,
|
|
141
166
|
o
|
|
142
167
|
);
|
|
143
|
-
let
|
|
168
|
+
let i;
|
|
144
169
|
try {
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
} catch (
|
|
148
|
-
throw
|
|
170
|
+
const s = B.has(t) ? await a.text() : await k(a, this.maxResponseBytes);
|
|
171
|
+
i = JSON.parse(s);
|
|
172
|
+
} catch (s) {
|
|
173
|
+
throw s instanceof l ? s : new l(
|
|
149
174
|
_.INVALID_RESPONSE,
|
|
150
175
|
"Invalid JSON-RPC response: body is not valid JSON",
|
|
151
176
|
"local"
|
|
152
177
|
);
|
|
153
178
|
}
|
|
154
|
-
if (
|
|
179
|
+
if (i === null || typeof i != "object" || Array.isArray(i))
|
|
155
180
|
throw new l(
|
|
156
181
|
_.INVALID_RESPONSE,
|
|
157
|
-
`Invalid JSON-RPC response: expected an object, got ${typeof
|
|
182
|
+
`Invalid JSON-RPC response: expected an object, got ${typeof i}`,
|
|
158
183
|
"local"
|
|
159
184
|
);
|
|
160
|
-
const c =
|
|
185
|
+
const c = i;
|
|
161
186
|
if ("error" in c && c.error != null) {
|
|
162
|
-
const
|
|
187
|
+
const s = c.error;
|
|
163
188
|
throw new l(
|
|
164
|
-
|
|
165
|
-
|
|
189
|
+
s.code ?? _.INVALID_RESPONSE,
|
|
190
|
+
s.message ?? "Unknown RPC error",
|
|
166
191
|
"wire",
|
|
167
|
-
|
|
192
|
+
s.data
|
|
168
193
|
);
|
|
169
194
|
}
|
|
170
195
|
if (!("result" in c))
|
|
@@ -189,29 +214,29 @@ class j {
|
|
|
189
214
|
return this.fetchWithRetry(t, r, n);
|
|
190
215
|
}
|
|
191
216
|
async fetchWithRetry(t, r, n, o) {
|
|
192
|
-
const
|
|
193
|
-
jsonrpc:
|
|
217
|
+
const a = ++this.requestId, i = this.retryableFor(t) ? this.retries : 0, s = JSON.stringify({
|
|
218
|
+
jsonrpc: g,
|
|
194
219
|
method: t,
|
|
195
220
|
params: [r],
|
|
196
|
-
id:
|
|
221
|
+
id: a
|
|
197
222
|
});
|
|
198
|
-
let
|
|
199
|
-
for (let T = 0; T <=
|
|
223
|
+
let u = null;
|
|
224
|
+
for (let T = 0; T <= i; T++) {
|
|
200
225
|
const h = new AbortController(), R = setTimeout(
|
|
201
226
|
() => h.abort(),
|
|
202
227
|
this.timeout
|
|
203
|
-
),
|
|
228
|
+
), A = n ? V(n, h.signal) : null, p = A ? A.signal : h.signal;
|
|
204
229
|
try {
|
|
205
230
|
const E = await this.buildHeaders(t, o), P = await fetch(this.baseUrl, {
|
|
206
231
|
method: "POST",
|
|
207
232
|
headers: E,
|
|
208
|
-
body:
|
|
209
|
-
signal:
|
|
233
|
+
body: s,
|
|
234
|
+
signal: p
|
|
210
235
|
});
|
|
211
|
-
if (clearTimeout(R),
|
|
212
|
-
if (T <
|
|
213
|
-
const
|
|
214
|
-
await this.sleep(
|
|
236
|
+
if (clearTimeout(R), A == null || A.cleanup(), !P.ok) {
|
|
237
|
+
if (T < i && m.has(P.status)) {
|
|
238
|
+
const O = this.retryDelay * Math.pow(2, T);
|
|
239
|
+
await this.sleep(O, n);
|
|
215
240
|
continue;
|
|
216
241
|
}
|
|
217
242
|
throw new Error(
|
|
@@ -220,36 +245,36 @@ class j {
|
|
|
220
245
|
}
|
|
221
246
|
return P;
|
|
222
247
|
} catch (E) {
|
|
223
|
-
if (clearTimeout(R),
|
|
248
|
+
if (clearTimeout(R), A == null || A.cleanup(), u = E instanceof Error ? E : new Error(String(E)), n != null && n.aborted)
|
|
224
249
|
throw new Error("Request aborted");
|
|
225
250
|
if (E instanceof Error && E.name === "AbortError") {
|
|
226
|
-
if (T <
|
|
251
|
+
if (T < i) {
|
|
227
252
|
const P = this.retryDelay * Math.pow(2, T);
|
|
228
253
|
await this.sleep(P, n);
|
|
229
254
|
continue;
|
|
230
255
|
}
|
|
231
256
|
throw new l(
|
|
232
257
|
_.TIMEOUT,
|
|
233
|
-
`Request timeout after ${this.timeout}ms (${
|
|
258
|
+
`Request timeout after ${this.timeout}ms (${i + 1} attempts)`,
|
|
234
259
|
"local"
|
|
235
260
|
);
|
|
236
261
|
}
|
|
237
262
|
if (E instanceof TypeError) {
|
|
238
|
-
if (T <
|
|
263
|
+
if (T < i) {
|
|
239
264
|
const P = this.retryDelay * Math.pow(2, T);
|
|
240
265
|
await this.sleep(P, n);
|
|
241
266
|
continue;
|
|
242
267
|
}
|
|
243
268
|
throw new l(
|
|
244
269
|
_.NETWORK,
|
|
245
|
-
`Network error: ${E.message} (${
|
|
270
|
+
`Network error: ${E.message} (${i + 1} attempts)`,
|
|
246
271
|
"local"
|
|
247
272
|
);
|
|
248
273
|
}
|
|
249
274
|
throw E;
|
|
250
275
|
}
|
|
251
276
|
}
|
|
252
|
-
throw
|
|
277
|
+
throw u || new Error("Unknown error after retries");
|
|
253
278
|
}
|
|
254
279
|
sleep(t, r) {
|
|
255
280
|
return new Promise((n, o) => {
|
|
@@ -257,19 +282,19 @@ class j {
|
|
|
257
282
|
o(new Error("Request aborted"));
|
|
258
283
|
return;
|
|
259
284
|
}
|
|
260
|
-
const
|
|
261
|
-
r == null || r.removeEventListener("abort",
|
|
262
|
-
}, t),
|
|
263
|
-
clearTimeout(
|
|
285
|
+
const a = setTimeout(() => {
|
|
286
|
+
r == null || r.removeEventListener("abort", i), n();
|
|
287
|
+
}, t), i = () => {
|
|
288
|
+
clearTimeout(a), o(new Error("Request aborted"));
|
|
264
289
|
};
|
|
265
|
-
r == null || r.addEventListener("abort",
|
|
290
|
+
r == null || r.addEventListener("abort", i, { once: !0 });
|
|
266
291
|
});
|
|
267
292
|
}
|
|
268
293
|
getBaseUrl() {
|
|
269
294
|
return this.baseUrl;
|
|
270
295
|
}
|
|
271
296
|
}
|
|
272
|
-
function
|
|
297
|
+
function V(e, t) {
|
|
273
298
|
if (e.aborted) return { signal: e, cleanup: () => {
|
|
274
299
|
} };
|
|
275
300
|
if (t.aborted) return { signal: t, cleanup: () => {
|
|
@@ -280,56 +305,79 @@ function F(e, t) {
|
|
|
280
305
|
e.removeEventListener("abort", n), r.abort();
|
|
281
306
|
};
|
|
282
307
|
e.addEventListener("abort", n, { once: !0 }), t.addEventListener("abort", o, { once: !0 });
|
|
283
|
-
const
|
|
308
|
+
const a = () => {
|
|
284
309
|
e.removeEventListener("abort", n), t.removeEventListener("abort", o);
|
|
285
310
|
};
|
|
286
|
-
return { signal: r.signal, cleanup:
|
|
311
|
+
return { signal: r.signal, cleanup: a };
|
|
287
312
|
}
|
|
288
|
-
async function
|
|
313
|
+
async function k(e, t) {
|
|
289
314
|
const r = e.headers.get("content-length");
|
|
290
315
|
if (r !== null) {
|
|
291
316
|
const c = Number(r);
|
|
292
317
|
if (Number.isFinite(c) && c > t)
|
|
293
|
-
throw
|
|
318
|
+
throw N(t);
|
|
294
319
|
}
|
|
295
320
|
if (!e.body)
|
|
296
321
|
return "";
|
|
297
322
|
const n = e.body.getReader(), o = new TextDecoder();
|
|
298
|
-
let
|
|
323
|
+
let a = 0, i = "";
|
|
299
324
|
try {
|
|
300
325
|
for (; ; ) {
|
|
301
|
-
const { done: c, value:
|
|
326
|
+
const { done: c, value: s } = await n.read();
|
|
302
327
|
if (c) break;
|
|
303
|
-
if (
|
|
304
|
-
if (
|
|
305
|
-
throw await n.cancel(),
|
|
306
|
-
|
|
328
|
+
if (s) {
|
|
329
|
+
if (a += s.byteLength, a > t)
|
|
330
|
+
throw await n.cancel(), N(t);
|
|
331
|
+
i += o.decode(s, { stream: !0 });
|
|
307
332
|
}
|
|
308
333
|
}
|
|
309
334
|
} finally {
|
|
310
335
|
n.releaseLock();
|
|
311
336
|
}
|
|
312
|
-
return
|
|
337
|
+
return i + o.decode();
|
|
313
338
|
}
|
|
314
|
-
function
|
|
339
|
+
function N(e) {
|
|
315
340
|
return new l(
|
|
316
341
|
_.RESPONSE_TOO_LARGE,
|
|
317
342
|
`JSON-RPC response exceeds maximum size of ${e} bytes`,
|
|
318
343
|
"local"
|
|
319
344
|
);
|
|
320
345
|
}
|
|
346
|
+
var S = /* @__PURE__ */ ((e) => (e.CLAIM_EVENT_RECEIVED = "ClaimEventReceived", e.CLAIM_BROADCAST = "ClaimBroadcast", e.ASSERT_BROADCAST = "AssertBroadcast", e.PAYOUT_CONFIRMED = "PayoutConfirmed", e.PAYOUT_BLOCKED = "PayoutBlocked", e))(S || {});
|
|
347
|
+
const J = "PayoutBroadcast", Y = /* @__PURE__ */ new Set([
|
|
348
|
+
"PayoutConfirmed",
|
|
349
|
+
"PayoutBlocked"
|
|
350
|
+
/* PAYOUT_BLOCKED */
|
|
351
|
+
]);
|
|
352
|
+
function Z(e) {
|
|
353
|
+
return e === J ? "PayoutConfirmed" : e;
|
|
354
|
+
}
|
|
355
|
+
function Q(e) {
|
|
356
|
+
return Object.values(S).includes(
|
|
357
|
+
e
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
function ee(e) {
|
|
361
|
+
return !!e && Y.has(e);
|
|
362
|
+
}
|
|
321
363
|
export {
|
|
322
|
-
|
|
323
|
-
|
|
364
|
+
M as A,
|
|
365
|
+
S as C,
|
|
366
|
+
w as D,
|
|
324
367
|
_ as J,
|
|
325
|
-
|
|
368
|
+
W as P,
|
|
326
369
|
v as R,
|
|
327
|
-
|
|
328
|
-
|
|
370
|
+
C as V,
|
|
371
|
+
z as a,
|
|
329
372
|
l as b,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
373
|
+
$ as c,
|
|
374
|
+
H as d,
|
|
375
|
+
K as e,
|
|
376
|
+
Q as f,
|
|
377
|
+
ee as g,
|
|
378
|
+
X as h,
|
|
379
|
+
F as i,
|
|
380
|
+
Z as n,
|
|
381
|
+
I as v
|
|
334
382
|
};
|
|
335
|
-
//# sourceMappingURL=
|
|
383
|
+
//# sourceMappingURL=state-CFn1rT74.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-CFn1rT74.js","sources":["../src/tbv/core/clients/vault-provider/types.ts","../src/tbv/core/clients/vault-provider/batchAttribution.ts","../src/tbv/core/clients/vault-provider/json-rpc-client.ts","../src/tbv/core/services/pegout/state.ts"],"sourcesContent":["/**\n * Type definitions for Vault Provider JSON-RPC API.\n *\n * These types match the `vaultProvider_*` RPC namespace defined by the\n * btc-vault daemon. They are the SDK's canonical copy of the VP protocol\n * contract, independent of any frontend framework.\n *\n * @see https://github.com/babylonlabs-io/btc-vault/blob/main/docs/pegin.md\n */\n\n// ============================================================================\n// Daemon Status\n// ============================================================================\n\n/**\n * Backend daemon status (vault provider database).\n * Source: btc-vault crates/vaultd/src/workers/claimer/mod.rs PegInStatus enum\n *\n * State flow (happy path):\n * PendingIngestion -> PendingDepositorWotsPK -> PendingBabeSetup -> PendingChallengerPresigning\n * -> PendingPeginSigsAvailability -> PendingPrePegInConfirmations\n * -> PendingDepositorSignatures -> PendingACKs -> PendingActivation\n * -> ActivatedPendingBroadcast -> Activated\n *\n * Branching / terminal states:\n * - IngestionRejected: terminal — ingestion permanently failed (e.g. malformed\n * Pre-PegIn, invalid HTLC outputs); reachable directly from PendingIngestion.\n * - Expired: activation timed out; non-terminal during the grace window\n * (RFC 003) — transitions to ExpiredCleanedUp or ExpiredInClaim.\n * - InvalidSigInContract: terminal — pegin input signature posted on\n * chain failed verification.\n * - AmlRejected: terminal — AML address screening rejected the pegin.\n * - ExpiredCleanedUp: terminal — grace window expired, per-pegin\n * artifacts deleted.\n * - ExpiredInClaim: terminal at the pegin-state-machine level; pegout-side\n * work continues on the pegout_tracking row.\n * - BabeSetupFailed: terminal — a challenger's BaBe decryptor session\n * failed verification, so BaBe setup cannot complete; reachable from\n * PendingBabeSetup.\n */\nexport enum DaemonStatus {\n PENDING_INGESTION = \"PendingIngestion\",\n PENDING_DEPOSITOR_WOTS_PK = \"PendingDepositorWotsPK\",\n PENDING_BABE_SETUP = \"PendingBabeSetup\",\n PENDING_CHALLENGER_PRESIGNING = \"PendingChallengerPresigning\",\n PENDING_PEGIN_SIGS_AVAILABILITY = \"PendingPeginSigsAvailability\",\n PENDING_PRE_PEGIN_CONFIRMATIONS = \"PendingPrePegInConfirmations\",\n PENDING_DEPOSITOR_SIGNATURES = \"PendingDepositorSignatures\",\n PENDING_ACKS = \"PendingACKs\",\n PENDING_ACTIVATION = \"PendingActivation\",\n ACTIVATED_PENDING_BROADCAST = \"ActivatedPendingBroadcast\",\n ACTIVATED = \"Activated\",\n EXPIRED = \"Expired\",\n INGESTION_REJECTED = \"IngestionRejected\",\n INVALID_SIG_IN_CONTRACT = \"InvalidSigInContract\",\n AML_REJECTED = \"AmlRejected\",\n EXPIRED_CLEANED_UP = \"ExpiredCleanedUp\",\n EXPIRED_IN_CLAIM = \"ExpiredInClaim\",\n BABE_SETUP_FAILED = \"BabeSetupFailed\",\n}\n\n// ============================================================================\n// Status Groups\n// ============================================================================\n\n/**\n * States where the VP is still processing (no depositor action needed).\n * Excludes PENDING_DEPOSITOR_WOTS_PK (requires depositor action).\n */\nexport const PRE_DEPOSITOR_SIGNATURES_STATES: readonly DaemonStatus[] = [\n DaemonStatus.PENDING_INGESTION,\n DaemonStatus.PENDING_BABE_SETUP,\n DaemonStatus.PENDING_CHALLENGER_PRESIGNING,\n DaemonStatus.PENDING_PEGIN_SIGS_AVAILABILITY,\n DaemonStatus.PENDING_PRE_PEGIN_CONFIRMATIONS,\n];\n\n/** States after PendingDepositorSignatures where the depositor has no action. */\nconst POST_PAYOUT_SIGNATURE_STATUSES: readonly DaemonStatus[] = [\n DaemonStatus.PENDING_ACKS,\n DaemonStatus.PENDING_ACTIVATION,\n DaemonStatus.ACTIVATED_PENDING_BROADCAST,\n DaemonStatus.ACTIVATED,\n];\n\n/**\n * Statuses where no depositor action is needed (VP processing or already past\n * depositor interaction). Excludes PENDING_INGESTION and PENDING_DEPOSITOR_WOTS_PK.\n */\nexport const VP_TRANSIENT_STATUSES: ReadonlySet<DaemonStatus> = new Set([\n DaemonStatus.PENDING_BABE_SETUP,\n DaemonStatus.PENDING_CHALLENGER_PRESIGNING,\n DaemonStatus.PENDING_PEGIN_SIGS_AVAILABILITY,\n DaemonStatus.PENDING_PRE_PEGIN_CONFIRMATIONS,\n ...POST_PAYOUT_SIGNATURE_STATUSES,\n]);\n\n/**\n * Terminal VP statuses that represent failure outcomes — polling should\n * stop immediately with an error rather than wait for timeout.\n *\n * Mirrors the failure subset of the server-side terminals\n * (`allowed_transitions()` empty, see `PegInStatus` in\n * `btc-vault/crates/vaultd/src/workers/claimer/mod.rs`).\n * `Activated` IS terminal on-chain but is the success outcome, so it is\n * intentionally excluded — a caller polling for an earlier state that\n * races straight to `Activated` should treat that as success-via-overshoot,\n * not failure. `Expired` is also excluded — under RFC 003 it is a\n * grace-window interim that transitions to `ExpiredCleanedUp` or\n * `ExpiredInClaim`. Callers that want to stop polling on any expiry\n * should check `status === DaemonStatus.EXPIRED ||\n * VP_TERMINAL_FAILURE_STATUSES.has(status)`.\n */\nexport const VP_TERMINAL_FAILURE_STATUSES: ReadonlySet<DaemonStatus> = new Set([\n DaemonStatus.INGESTION_REJECTED,\n DaemonStatus.INVALID_SIG_IN_CONTRACT,\n DaemonStatus.AML_REJECTED,\n DaemonStatus.EXPIRED_CLEANED_UP,\n DaemonStatus.EXPIRED_IN_CLAIM,\n DaemonStatus.BABE_SETUP_FAILED,\n]);\n\n/**\n * Statuses that come after WOTS key submission.\n * If the VP is already in one of these states, the WOTS key was already\n * submitted and we can skip.\n */\nexport const POST_WOTS_STATUSES: ReadonlySet<DaemonStatus> = new Set([\n ...VP_TRANSIENT_STATUSES,\n DaemonStatus.PENDING_DEPOSITOR_SIGNATURES,\n]);\n\n// ============================================================================\n// WOTS Types (needed by SubmitDepositorWotsKeyParams)\n// ============================================================================\n\n/**\n * WOTS configuration for a single block.\n * Matches Rust `babe::wots::Config` serde format.\n */\nexport interface WotsConfig {\n /** Digit bit-width (e.g. 4 → base-16 digits). */\n d: number;\n /** Number of message digits in this block. */\n n: number;\n /** Radix used for the checksum computation. */\n checksum_radix: number;\n}\n\n/**\n * A single block of WOTS public keys.\n * Chain values are arrays of byte values (matching Rust `[u8; 20]`).\n */\nexport interface WotsBlockPublicKey {\n config: WotsConfig;\n message_terminals: number[][];\n checksum_major_terminal: number[];\n checksum_minor_terminal: number[];\n}\n\n// ============================================================================\n// Request Parameter Types\n// ============================================================================\n\n/** Params for requesting the payout/claim/assert transactions to pre-sign. */\nexport interface RequestDepositorPresignTransactionsParams {\n pegin_txid: string;\n depositor_pk: string;\n}\n\n/** Params for submitting the depositor's WOTS public key to the VP. */\nexport interface SubmitDepositorWotsKeyParams {\n pegin_txid: string;\n depositor_pk: string;\n wots_public_keys: WotsBlockPublicKey[];\n}\n\n/** Per-challenger signatures for the depositor-as-claimer flow. */\nexport interface DepositorPreSigsPerChallenger {\n nopayout_signature: string;\n}\n\n/** Depositor-as-claimer pre-signatures (payout + per-challenger). */\nexport interface DepositorAsClaimerPresignatures {\n payout_signatures: ClaimerSignatures;\n per_challenger: Record<string, DepositorPreSigsPerChallenger>;\n}\n\n/** Params for submitting depositor pre-signatures including claimer presignatures. */\nexport interface SubmitDepositorPresignaturesParams {\n pegin_txid: string;\n depositor_pk: string;\n signatures: Record<string, ClaimerSignatures>;\n depositor_claimer_presignatures: DepositorAsClaimerPresignatures;\n}\n\n/** Payout signatures per claimer. */\nexport interface ClaimerSignatures {\n payout_signature: string;\n}\n\n/** Params for requesting BaBe DecryptorArtifacts from the VP. */\nexport interface RequestDepositorClaimerArtifactsParams {\n pegin_txid: string;\n depositor_pk: string;\n}\n\n/**\n * Params for `getPeginStatusByVaultId`. A vault is addressed by its\n * depositor-bound `vault_id` (`keccak256(abi.encode(peginTxHash, depositor))`),\n * hex-encoded with or without a `0x` prefix. A `pegin_txid` does not identify\n * a vault — several vaults can share one txid.\n */\nexport interface GetPeginStatusByVaultIdParams {\n vault_id: string;\n}\n\n// ============================================================================\n// Response Types\n// ============================================================================\n\n/** A raw Bitcoin transaction with its hex encoding. */\nexport interface TransactionData {\n tx_hex: string;\n}\n\n/** Set of transactions the depositor must pre-sign for a single claimer. */\nexport interface ClaimerTransactions {\n claimer_pubkey: string;\n claim_tx: TransactionData;\n assert_tx: TransactionData;\n payout_tx: TransactionData;\n payout_psbt: string;\n}\n\n/** Per-segment connector data for ChallengeAssert inputs. */\nexport interface ChallengeAssertConnectorData {\n wots_pks_json: string;\n gc_wots_keys_json: string;\n}\n\n/** Challenger-specific transactions and signing data for the depositor graph. */\nexport interface PresignDataPerChallenger {\n challenger_pubkey: string;\n challenge_assert_x_tx: TransactionData;\n challenge_assert_y_tx: TransactionData;\n nopayout_tx: TransactionData;\n nopayout_psbt: string;\n challenge_assert_connectors: ChallengeAssertConnectorData[];\n output_label_hashes: string[];\n}\n\n/** Depositor-as-claimer TxGraph transactions. */\nexport interface DepositorGraphTransactions {\n claim_tx: TransactionData;\n assert_tx: TransactionData;\n payout_tx: TransactionData;\n payout_psbt: string;\n challenger_presign_data: PresignDataPerChallenger[];\n offchain_params_version: number;\n}\n\n/** Response from `requestDepositorPresignTransactions`. */\nexport interface RequestDepositorPresignTransactionsResponse {\n txs: ClaimerTransactions[];\n depositor_graph: DepositorGraphTransactions;\n}\n\n/** BaBe garbled-circuit session data for a single challenger. */\nexport interface BaBeSessionData {\n decryptor_artifacts_hex: string;\n}\n\n/** Response from `requestDepositorClaimerArtifacts`. */\nexport interface RequestDepositorClaimerArtifactsResponse {\n tx_graph_json: string;\n verifying_key_hex: string;\n babe_sessions: Record<string, BaBeSessionData>;\n}\n\n/** Progress tracker for a multi-challenger operation. */\nexport interface ChallengerProgress {\n total_challengers: number;\n completed_challengers: number;\n completed_challenger_pubkeys: string[];\n pending_challenger_pubkeys: string[];\n}\n\nexport type GcDataProgress = ChallengerProgress;\nexport type AckCollectionProgress = ChallengerProgress;\n\n/** Extended presigning progress with all 3 concurrent phases. */\nexport interface PresigningProgress extends ChallengerProgress {\n depositor_graph_created?: boolean;\n vk_challenger_presigning_completed?: number;\n vk_challenger_presigning_total?: number;\n}\n\n/** Detailed progress breakdown for an in-progress pegin. */\nexport interface PeginProgressDetails {\n gc_data?: GcDataProgress;\n presigning?: PresigningProgress;\n ack_collection?: AckCollectionProgress;\n claimer_graphs?: ClaimerGraphStatus[];\n}\n\n/** Per-claimer graph status (challenger perspective). */\nexport interface ClaimerGraphStatus {\n claimer_pubkey: string;\n presigned: boolean;\n}\n\n/** Response from `getPeginStatusByVaultId`. */\nexport interface GetPeginStatusResponse {\n /**\n * The peg-in txid the server stores for this vault. A mismatch with the\n * caller's txid shows a status for a different peg-in; several vaults can\n * share one txid, so it does not identify a vault.\n */\n pegin_txid: string;\n /** The vault this response describes (`0x`-prefixed hex). */\n vault_id: string;\n status: string;\n progress: PeginProgressDetails;\n health_info: string;\n last_error?: string;\n}\n\n// ============================================================================\n// Pegout Types\n// ============================================================================\n\n/**\n * Claimer-side pegout progress.\n * Source: btc-vault crates/vaultd/src/rpc/server/pegout_status.rs ClaimerPegoutStatus.\n */\nexport interface ClaimerPegoutStatus {\n /** Wire string from PegoutStatus enum. */\n status: string;\n failed: boolean;\n claim_txid: string;\n claimer_pubkey: string;\n assert_txid: string;\n /** Unix epoch seconds. */\n created_at: number;\n /** Unix epoch seconds. */\n updated_at: number;\n}\n\n/**\n * Challenger-side pegout progress.\n * Source: btc-vault crates/vaultd/src/rpc/server/pegout_status.rs ChallengerStatus.\n */\nexport interface ChallengerStatus {\n status: string;\n claim_txid: string;\n claimer_pubkey: string;\n assert_txid: string | null;\n challenge_assert_x_txid: string | null;\n challenge_assert_y_txid: string | null;\n nopayout_txid: string | null;\n created_at: number;\n updated_at: number;\n}\n\n/**\n * Pegout status response. Embedded by `batchGetPegoutStatusByVaultId`\n * per-result envelopes. Mirrors btc-vault `GetPegoutStatusResponse`.\n */\nexport interface GetPegoutStatusResponse {\n pegin_txid: string;\n /** The vault this response describes (`0x`-prefixed hex). */\n vault_id: string;\n found: boolean;\n claimer: ClaimerPegoutStatus | null;\n challengers: ChallengerStatus[];\n}\n\n// ============================================================================\n// Batch Status Types (peginStatus + pegoutStatus)\n// ============================================================================\n\n/** Params for `batchGetPeginStatusByVaultId`. */\nexport interface BatchGetPeginStatusByVaultIdParams {\n /** Up to MAX_BATCH_SIZE (50) vault ids per call (hex, `0x` prefix optional). */\n vault_ids: string[];\n}\n\n/** Per-vault entry in a `batchGetPeginStatusByVaultId` response. */\nexport interface BatchPeginStatusResult {\n /** Echo of the requested vault id, verbatim. */\n vault_id: string;\n result: GetPeginStatusResponse | null;\n error: string | null;\n}\n\n/** Response from `batchGetPeginStatusByVaultId`. Results are returned in request order. */\nexport interface BatchGetPeginStatusResponse {\n results: BatchPeginStatusResult[];\n}\n\n/** Params for `batchGetPegoutStatusByVaultId`. */\nexport interface BatchGetPegoutStatusByVaultIdParams {\n /** Vault ids to query (hex, `0x` prefix optional). */\n vault_ids: string[];\n}\n\n/** Per-vault entry in a `batchGetPegoutStatusByVaultId` response. */\nexport interface BatchPegoutStatusResult {\n /** Echo of the requested vault id, verbatim. */\n vault_id: string;\n result: GetPegoutStatusResponse | null;\n error: string | null;\n}\n\n/** Response from `batchGetPegoutStatusByVaultId`. Results are returned in request order. */\nexport interface BatchGetPegoutStatusResponse {\n results: BatchPegoutStatusResult[];\n}\n\n/**\n * Maximum number of items per batch call. Mirrors the server-side\n * `MAX_BATCH_SIZE` in btc-vault (`crates/vaultd/src/rpc/server/vault_provider.rs:7`).\n * Callers must chunk requests larger than this.\n */\nexport const VP_BATCH_MAX_SIZE = 50;\n\n// ============================================================================\n// Error Codes\n// ============================================================================\n\n/**\n * JSON-RPC error codes returned by the vault provider.\n * Source: btc-vault `crates/vaultd/src/rpc/error.rs::RpcError::error_code`.\n */\nexport enum RpcErrorCode {\n PEGIN_NOT_FOUND = 4001,\n}\n","/**\n * Defensive helper for attributing per-item results in a VP batch RPC\n * response back to the requested vault ids. The server promises 1:1 ordered\n * results, but we don't trust that promise — a server bug could duplicate,\n * skip, or scramble items, and silent attribution-by-array-index would\n * mask the bug.\n *\n * Normalizes vault ids on both sides (strip `0x`, lowercase) to absorb\n * prefix and case mismatch — the server echoes the request string verbatim.\n *\n * @module tbv/core/clients/vault-provider/batchAttribution\n */\n\n/** Per-item entry in a VP batch response. */\nexport interface BatchResultEntry<T> {\n vault_id: string;\n result: T | null;\n error: string | null;\n}\n\n/** Output of {@link attributeBatchResults}. */\nexport interface BatchAttributionResult<T> {\n /** Normalized requested vault id -> per-item envelope. */\n byVaultId: Map<string, { result: T | null; error: string | null }>;\n /** Requested vault ids that did not appear in the response. */\n missing: string[];\n /** Echoed vault ids that were not in the request — logged + dropped. */\n unexpected: string[];\n /** Echoed vault ids that appeared more than once — first kept, rest dropped. */\n duplicate: string[];\n}\n\n/** Normalize a vault id for map keys: strip an optional `0x`, lowercase. */\nexport function vaultIdKey(vaultId: string): string {\n const unprefixed = vaultId.startsWith(\"0x\") ? vaultId.slice(2) : vaultId;\n return unprefixed.toLowerCase();\n}\n\n/**\n * Attribute batch results to requested vault ids defensively.\n *\n * Both `requestedVaultIds` and the echoed `vault_id` field on each result\n * are normalized before lookup. Duplicates and unexpected echoes are\n * surfaced so callers can flag the affected items as errored rather than\n * silently overwriting state.\n *\n * `requestedVaultIds` may contain duplicates; they are de-duplicated for the\n * purposes of map keys (each unique vault id becomes a single map entry).\n */\nexport function attributeBatchResults<T>(\n requestedVaultIds: string[],\n results: ReadonlyArray<BatchResultEntry<T>>,\n): BatchAttributionResult<T> {\n const requestedSet = new Set<string>();\n for (const vaultId of requestedVaultIds) {\n requestedSet.add(vaultIdKey(vaultId));\n }\n\n const byVaultId = new Map<\n string,\n { result: T | null; error: string | null }\n >();\n const seen = new Set<string>();\n const duplicate: string[] = [];\n const unexpected: string[] = [];\n\n for (const entry of results) {\n const normalized = vaultIdKey(entry.vault_id);\n if (!requestedSet.has(normalized)) {\n unexpected.push(normalized);\n continue;\n }\n if (seen.has(normalized)) {\n duplicate.push(normalized);\n continue;\n }\n seen.add(normalized);\n byVaultId.set(normalized, { result: entry.result, error: entry.error });\n }\n\n const missing: string[] = [];\n for (const vaultId of requestedSet) {\n if (!seen.has(vaultId)) missing.push(vaultId);\n }\n\n return { byVaultId, missing, unexpected, duplicate };\n}\n","/**\n * Generic JSON-RPC 2.0 HTTP Client\n *\n * Framework-agnostic client using `fetch()` — works in browsers and Node.js 18+.\n * Includes configurable retry policy and AbortSignal passthrough.\n */\n\nexport interface JsonRpcRequest<T = unknown> {\n jsonrpc: \"2.0\";\n method: string;\n params: T;\n id: number | string;\n}\n\nexport interface JsonRpcSuccessResponse<T = unknown> {\n jsonrpc: \"2.0\";\n result: T;\n id: number | string;\n}\n\nexport interface JsonRpcErrorResponse {\n jsonrpc: \"2.0\";\n error: {\n code: number;\n message: string;\n data?: unknown;\n };\n id: number | string;\n}\n\nexport type JsonRpcResponse<T = unknown> =\n | JsonRpcSuccessResponse<T>\n | JsonRpcErrorResponse;\n\n/**\n * Injects bearer tokens into requests for auth-gated methods, and is\n * notified when the server rejects a bearer so it can invalidate its cache.\n *\n * The `JsonRpcClient` is agnostic to which methods are auth-gated —\n * the provider's `getToken(method)` decides. Returning `null` means\n * \"no auth required for this method\"; the client then sends the\n * request with no `Authorization` header.\n */\nexport interface BearerTokenProvider {\n /**\n * Return the bearer token to inject for `method`, or `null` if the\n * method does not require auth.\n */\n getToken(method: string): Promise<string | null>;\n /**\n * Drop the cached token. Next call to `getToken` must re-acquire.\n * Called by the client on reactive-refresh-trigger responses.\n */\n invalidate(): void;\n}\n\nexport interface JsonRpcClientConfig {\n /** Base URL of the RPC service */\n baseUrl: string;\n /** Timeout in milliseconds per request attempt */\n timeout: number;\n /** Optional custom headers */\n headers?: Record<string, string>;\n /** Number of retry attempts for transient errors (default: 3) */\n retries?: number;\n /** Initial retry delay in milliseconds (default: 1000) */\n retryDelay?: number;\n /**\n * Maximum response body size, in bytes, for typed JSON-RPC calls.\n * `callRaw` intentionally returns the unparsed Response and is not capped here.\n * Default: 2 MiB.\n */\n maxResponseBytes?: number;\n /**\n * Predicate that decides which methods retry on transient errors.\n * Default retries only `getPeginStatusByVaultId`,\n * `batchGetPeginStatusByVaultId`, `batchGetPegoutStatusByVaultId`, and\n * `requestDepositorPresignTransactions`.\n * Write methods are not retried by default.\n */\n retryableFor?: (method: string) => boolean;\n /**\n * Per-request bearer-token source. A non-null return attaches\n * `Authorization: Bearer <token>`; `null` skips auth. `call`\n * additionally retries once when the server rejects the bearer\n * (invalidate + refetch + retry) — see {@link isAuthRejectedError}.\n * `callRaw` skips reactive refresh.\n */\n tokenProvider?: BearerTokenProvider;\n}\n\n// \"wire\" = parsed from a JSON-RPC error envelope; \"local\" = timeout/network/parse failure.\nexport type JsonRpcErrorSource = \"wire\" | \"local\";\n\nexport class JsonRpcError extends Error {\n constructor(\n public code: number,\n message: string,\n /** \"wire\" for server-returned envelopes; \"local\" for SDK-side failures. */\n public source: JsonRpcErrorSource = \"local\",\n /** Structured data from the server `error.data` field, if any. */\n public data?: unknown,\n ) {\n super(message);\n this.name = \"JsonRpcError\";\n }\n}\n\nexport const JSON_RPC_ERROR_CODES = {\n TIMEOUT: -32000,\n NETWORK: -32001,\n /** VP proxy: request timed out at proxy level */\n PROXY_TIMEOUT: -32002,\n /** VP proxy: VP unreachable / DNS failure / response too large */\n PROXY_UNAVAILABLE: -32003,\n /** SDK client: response missing \"result\" field (malformed JSON-RPC) */\n INVALID_RESPONSE: -32700,\n /** SDK client: response body exceeded the configured byte limit */\n RESPONSE_TOO_LARGE: -32701,\n} as const;\n\n/** JSON-RPC protocol version */\nconst JSON_RPC_VERSION = \"2.0\" as const;\n\n/** Default number of retry attempts for transient errors */\nconst DEFAULT_RETRY_ATTEMPTS = 3;\n\n/** Default initial retry delay in milliseconds */\nconst DEFAULT_RETRY_DELAY_MS = 1000;\n\n/** Default maximum JSON-RPC response size for typed calls (2 MiB) */\nconst DEFAULT_MAX_RESPONSE_BYTES = 2 * 1024 * 1024;\n\n/**\n * TODO: Temporary typed-call exceptions for methods that currently return large\n * artifact payloads as JSON-RPC results.\n */\nconst UNCAPPED_TYPED_RESPONSE_METHODS: ReadonlySet<string> = new Set([\n \"vaultProvider_requestDepositorClaimerArtifacts\",\n]);\n\n/** HTTP status codes that indicate transient server errors and are safe to retry */\nconst RETRYABLE_HTTP_STATUS_CODES: ReadonlySet<number> = new Set([\n 408, // Request Timeout\n 429, // Too Many Requests\n 500, // Internal Server Error\n 502, // Bad Gateway\n 503, // Service Unavailable\n 504, // Gateway Timeout\n]);\n\n/** Default retry predicate: only retry read-only / idempotent methods */\nconst DEFAULT_RETRYABLE_METHODS: ReadonlySet<string> = new Set([\n \"vaultProvider_getPeginStatusByVaultId\",\n \"vaultProvider_batchGetPeginStatusByVaultId\",\n \"vaultProvider_batchGetPegoutStatusByVaultId\",\n \"vaultProvider_requestDepositorPresignTransactions\",\n]);\n\nfunction defaultRetryableFor(method: string): boolean {\n return DEFAULT_RETRYABLE_METHODS.has(method);\n}\n\n/**\n * JSON-RPC error code the vault provider returns for every bearer-token\n * rejection: expired, not-yet-valid, missing bearer, invalid signature,\n * invalid claims, invalid structure, subject mismatch, issuer mismatch.\n * All eight variants collapse onto this one code, distinguished only by\n * message text — see btc-vault `crates/btc-auth/src/rpc.rs`\n * (`auth_error_to_rpc_error`). Operationally they all mean the same\n * thing: this bearer is dead, mint a new one.\n *\n * Numerically equal to {@link JSON_RPC_ERROR_CODES.NETWORK}, which this\n * client throws for local network failures. `source` is what separates\n * them — see {@link isAuthRejectedError}.\n */\nexport const AUTH_REJECTED_RPC_CODE = -32001;\n\n/**\n * True when `error` is the vault provider rejecting our bearer token.\n *\n * Classified on the error code, which is the only thing the server\n * guarantees: its auth errors carry `data: null` unconditionally\n * (`rpc_error` passes `None::<()>`), so any predicate keyed on an\n * `error.data` field can never match a real response.\n *\n * `source === \"wire\"` is load-bearing: this client reuses -32001\n * internally as {@link JSON_RPC_ERROR_CODES.NETWORK}, always with\n * source \"local\".\n *\n * Known, bounded collision: the vault-provider proxy reuses -32001 for\n * \"Provider not found\". A call to a deregistered provider therefore\n * costs one wasted token-mint round-trip, which fails against the same\n * registry check and surfaces the same message.\n */\nexport function isAuthRejectedError(error: unknown): boolean {\n return (\n error instanceof JsonRpcError &&\n error.source === \"wire\" &&\n error.code === AUTH_REJECTED_RPC_CODE\n );\n}\n\n/**\n * Per-`call` record of whether a bearer was actually attached to the\n * request. Scoped to one `call` (not client state) so concurrent\n * requests can't observe each other's auth state.\n */\ninterface AttemptAuthState {\n bearerAttached: boolean;\n}\n\n/**\n * Generic JSON-RPC 2.0 HTTP client with safe retry policy.\n */\nexport class JsonRpcClient {\n private baseUrl: string;\n private timeout: number;\n private headers: Record<string, string>;\n private requestId = 0;\n private retries: number;\n private retryDelay: number;\n private maxResponseBytes: number;\n private retryableFor: (method: string) => boolean;\n private tokenProvider?: BearerTokenProvider;\n\n constructor(config: JsonRpcClientConfig) {\n this.baseUrl = config.baseUrl.replace(/\\/$/, \"\");\n this.timeout = config.timeout;\n this.headers = {\n \"Content-Type\": \"application/json\",\n ...config.headers,\n };\n this.retries = config.retries ?? DEFAULT_RETRY_ATTEMPTS;\n this.retryDelay = config.retryDelay ?? DEFAULT_RETRY_DELAY_MS;\n this.maxResponseBytes =\n config.maxResponseBytes ?? DEFAULT_MAX_RESPONSE_BYTES;\n if (!Number.isFinite(this.maxResponseBytes) || this.maxResponseBytes <= 0) {\n throw new Error(\"maxResponseBytes must be a positive finite number\");\n }\n this.retryableFor = config.retryableFor ?? defaultRetryableFor;\n this.tokenProvider = config.tokenProvider;\n }\n\n private async buildHeaders(\n method: string,\n authState?: AttemptAuthState,\n ): Promise<Record<string, string>> {\n const headers: Record<string, string> = { ...this.headers };\n if (this.tokenProvider) {\n const token = await this.tokenProvider.getToken(method);\n if (token) {\n headers.Authorization = `Bearer ${token}`;\n if (authState) authState.bearerAttached = true;\n }\n }\n return headers;\n }\n\n /**\n * Make a JSON-RPC request with optional retry for safe methods.\n *\n * If the server rejects the bearer token and a `tokenProvider` is\n * configured, the client invalidates its cached token and retries the\n * request once with a freshly-acquired bearer.\n *\n * @param method - The RPC method name\n * @param params - The method parameters\n * @param signal - Optional AbortSignal for caller-controlled cancellation\n * @returns The result from the RPC method\n * @throws JsonRpcError if the RPC call fails\n */\n async call<TParams, TResult>(\n method: string,\n params: TParams,\n signal?: AbortSignal,\n ): Promise<TResult> {\n const authState: AttemptAuthState = { bearerAttached: false };\n try {\n return await this.callOnce<TParams, TResult>(\n method,\n params,\n signal,\n authState,\n );\n } catch (error) {\n // The re-auth retry fires for ALL methods, including mutating ones.\n // This is intentional and safe: the server's auth middleware rejects\n // the request BEFORE dispatching to the method handler, so a\n // rejected bearer means the handler never ran and no state was\n // mutated. Confirmed against btc-vault\n // `crates/btc-auth/src/middleware/jsonrpc.rs` — `unauthorized_response`\n // returns without ever calling `service.call(req)`, in both `call`\n // and `batch`. The `retryableFor` guard on HTTP-transient-error\n // retries doesn't apply here because that guard is about retrying\n // after a request the server may have started processing.\n //\n // `bearerAttached` keeps this off methods that sent no token — most\n // importantly the token-issuing calls themselves, which would\n // otherwise burn a round-trip re-minting against the proxy's\n // colliding -32001 \"Provider not found\".\n //\n // Bounded to one retry: the retried call is not wrapped in this\n // handler. If the freshly-minted token is rejected too, the problem\n // is the pinned server key rather than the token, and that surfaces\n // instead of looping.\n if (\n this.tokenProvider &&\n authState.bearerAttached &&\n isAuthRejectedError(error)\n ) {\n this.tokenProvider.invalidate();\n return await this.callOnce<TParams, TResult>(method, params, signal);\n }\n throw error;\n }\n }\n\n private async callOnce<TParams, TResult>(\n method: string,\n params: TParams,\n signal: AbortSignal | undefined,\n authState?: AttemptAuthState,\n ): Promise<TResult> {\n const response = await this.fetchWithRetry(\n method,\n params,\n signal,\n authState,\n );\n\n let jsonResponse: unknown;\n try {\n const responseText = UNCAPPED_TYPED_RESPONSE_METHODS.has(method)\n ? await response.text()\n : await readResponseTextWithLimit(response, this.maxResponseBytes);\n jsonResponse = JSON.parse(responseText);\n } catch (error) {\n if (error instanceof JsonRpcError) {\n throw error;\n }\n throw new JsonRpcError(\n JSON_RPC_ERROR_CODES.INVALID_RESPONSE,\n \"Invalid JSON-RPC response: body is not valid JSON\",\n \"local\",\n );\n }\n\n if (\n jsonResponse === null ||\n typeof jsonResponse !== \"object\" ||\n Array.isArray(jsonResponse)\n ) {\n throw new JsonRpcError(\n JSON_RPC_ERROR_CODES.INVALID_RESPONSE,\n `Invalid JSON-RPC response: expected an object, got ${typeof jsonResponse}`,\n \"local\",\n );\n }\n\n const rpcResponse = jsonResponse as Record<string, unknown>;\n\n if (\"error\" in rpcResponse && rpcResponse.error != null) {\n const err = rpcResponse.error as {\n code?: number;\n message?: string;\n data?: unknown;\n };\n throw new JsonRpcError(\n err.code ?? JSON_RPC_ERROR_CODES.INVALID_RESPONSE,\n err.message ?? \"Unknown RPC error\",\n \"wire\",\n err.data,\n );\n }\n\n if (!(\"result\" in rpcResponse)) {\n throw new JsonRpcError(\n JSON_RPC_ERROR_CODES.INVALID_RESPONSE,\n `Invalid JSON-RPC response: missing \"result\" field`,\n \"local\",\n );\n }\n\n return rpcResponse.result as TResult;\n }\n\n /**\n * Make a JSON-RPC request returning the raw Response (unparsed body).\n *\n * Bearer tokens are injected identically to `call`. **Reactive refresh\n * is NOT performed here** — the response body may be unbounded (e.g.\n * claimer-artifact downloads), so the client refuses to parse it to\n * detect auth errors. Callers relying on token-expired retries for\n * large downloads must read the body themselves and re-invoke\n * `callRaw` after `tokenProvider.invalidate()`.\n */\n async callRaw<TParams>(\n method: string,\n params: TParams,\n signal?: AbortSignal,\n ): Promise<Response> {\n return this.fetchWithRetry(method, params, signal);\n }\n\n private async fetchWithRetry<TParams>(\n method: string,\n params: TParams,\n callerSignal?: AbortSignal,\n authState?: AttemptAuthState,\n ): Promise<Response> {\n const requestId = ++this.requestId;\n const maxRetries = this.retryableFor(method) ? this.retries : 0;\n\n // jsonrpsee (Rust backend) expects params as an array (positional parameters)\n const request: JsonRpcRequest<TParams[]> = {\n jsonrpc: JSON_RPC_VERSION,\n method,\n params: [params],\n id: requestId,\n };\n\n const body = JSON.stringify(request);\n let lastError: Error | null = null;\n\n for (let attempt = 0; attempt <= maxRetries; attempt++) {\n // Merge caller signal with per-request timeout signal\n const timeoutController = new AbortController();\n const timeoutId = setTimeout(\n () => timeoutController.abort(),\n this.timeout,\n );\n\n const merged = callerSignal\n ? mergeAbortSignals(callerSignal, timeoutController.signal)\n : null;\n const signal = merged ? merged.signal : timeoutController.signal;\n\n try {\n // Build headers per-attempt so the token provider can return a\n // freshly-acquired bearer after a prior invalidate() on this\n // request (retry loop path) without plumbing state through.\n const headers = await this.buildHeaders(method, authState);\n\n const response = await fetch(this.baseUrl, {\n method: \"POST\",\n headers,\n body,\n signal,\n });\n\n clearTimeout(timeoutId);\n merged?.cleanup();\n\n if (!response.ok) {\n const shouldRetry =\n attempt < maxRetries &&\n RETRYABLE_HTTP_STATUS_CODES.has(response.status);\n\n if (shouldRetry) {\n const delay = this.retryDelay * Math.pow(2, attempt);\n await this.sleep(delay, callerSignal);\n continue;\n }\n\n throw new Error(\n `HTTP error: ${response.status} ${response.statusText}`,\n );\n }\n\n return response;\n } catch (error) {\n clearTimeout(timeoutId);\n merged?.cleanup();\n lastError = error instanceof Error ? error : new Error(String(error));\n\n // Check if caller aborted (not our timeout)\n if (callerSignal?.aborted) {\n throw new Error(\"Request aborted\");\n }\n\n if (error instanceof Error && error.name === \"AbortError\") {\n if (attempt < maxRetries) {\n const delay = this.retryDelay * Math.pow(2, attempt);\n await this.sleep(delay, callerSignal);\n continue;\n }\n throw new JsonRpcError(\n JSON_RPC_ERROR_CODES.TIMEOUT,\n `Request timeout after ${this.timeout}ms (${maxRetries + 1} attempts)`,\n \"local\",\n );\n }\n\n // Handle network errors (CORS, connection refused, etc.)\n if (error instanceof TypeError) {\n if (attempt < maxRetries) {\n const delay = this.retryDelay * Math.pow(2, attempt);\n await this.sleep(delay, callerSignal);\n continue;\n }\n throw new JsonRpcError(\n JSON_RPC_ERROR_CODES.NETWORK,\n `Network error: ${error.message} (${maxRetries + 1} attempts)`,\n \"local\",\n );\n }\n\n // Don't retry JSON-RPC errors (business logic errors)\n throw error;\n }\n }\n\n throw lastError || new Error(\"Unknown error after retries\");\n }\n\n private sleep(ms: number, signal?: AbortSignal): Promise<void> {\n return new Promise((resolve, reject) => {\n if (signal?.aborted) {\n reject(new Error(\"Request aborted\"));\n return;\n }\n const timeoutId = setTimeout(() => {\n signal?.removeEventListener(\"abort\", onAbort);\n resolve();\n }, ms);\n const onAbort = () => {\n clearTimeout(timeoutId);\n reject(new Error(\"Request aborted\"));\n };\n signal?.addEventListener(\"abort\", onAbort, { once: true });\n });\n }\n\n getBaseUrl(): string {\n return this.baseUrl;\n }\n}\n\ninterface MergedSignal {\n signal: AbortSignal;\n /** Remove listeners from the source signals. Call after the request completes. */\n cleanup: () => void;\n}\n\n/**\n * Merge two AbortSignals — the returned signal aborts if either input aborts.\n * Returns a cleanup function to remove listeners when the request completes\n * normally, preventing listener accumulation in long-lived polling flows.\n */\nfunction mergeAbortSignals(a: AbortSignal, b: AbortSignal): MergedSignal {\n if (a.aborted) return { signal: a, cleanup: () => {} };\n if (b.aborted) return { signal: b, cleanup: () => {} };\n\n const controller = new AbortController();\n const onAbortA = () => {\n b.removeEventListener(\"abort\", onAbortB);\n controller.abort();\n };\n const onAbortB = () => {\n a.removeEventListener(\"abort\", onAbortA);\n controller.abort();\n };\n a.addEventListener(\"abort\", onAbortA, { once: true });\n b.addEventListener(\"abort\", onAbortB, { once: true });\n\n const cleanup = () => {\n a.removeEventListener(\"abort\", onAbortA);\n b.removeEventListener(\"abort\", onAbortB);\n };\n\n return { signal: controller.signal, cleanup };\n}\n\nasync function readResponseTextWithLimit(\n response: Response,\n maxBytes: number,\n): Promise<string> {\n const contentLength = response.headers.get(\"content-length\");\n if (contentLength !== null) {\n const parsedContentLength = Number(contentLength);\n if (\n Number.isFinite(parsedContentLength) &&\n parsedContentLength > maxBytes\n ) {\n throw responseTooLargeError(maxBytes);\n }\n }\n\n if (!response.body) {\n return \"\";\n }\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let totalBytes = 0;\n let responseText = \"\";\n\n try {\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n if (!value) continue;\n\n totalBytes += value.byteLength;\n if (totalBytes > maxBytes) {\n await reader.cancel();\n throw responseTooLargeError(maxBytes);\n }\n responseText += decoder.decode(value, { stream: true });\n }\n } finally {\n reader.releaseLock();\n }\n\n return responseText + decoder.decode();\n}\n\nfunction responseTooLargeError(maxBytes: number): JsonRpcError {\n return new JsonRpcError(\n JSON_RPC_ERROR_CODES.RESPONSE_TOO_LARGE,\n `JSON-RPC response exceeds maximum size of ${maxBytes} bytes`,\n \"local\",\n );\n}\n","/**\n * Pegout state definitions and protocol-level terminal checks.\n *\n * Maps VP-reported pegout statuses from\n * `vaultProvider_batchGetPegoutStatusByVaultId` to protocol lifecycle states.\n *\n * Lifecycle (pegin-level, see btc-vault mod.rs PegoutStatus):\n * ClaimEventReceived -> ClaimBroadcast -> AssertBroadcast ->\n * PayoutConfirmed (success) | PayoutBlocked (NoPayout / CouncilNoPayout)\n */\n\n/** Claimer-side pegout statuses reported by the VP. */\nexport enum ClaimerPegoutStatusValue {\n CLAIM_EVENT_RECEIVED = \"ClaimEventReceived\",\n CLAIM_BROADCAST = \"ClaimBroadcast\",\n ASSERT_BROADCAST = \"AssertBroadcast\",\n PAYOUT_CONFIRMED = \"PayoutConfirmed\",\n PAYOUT_BLOCKED = \"PayoutBlocked\",\n}\n\n/**\n * Wire name of `PayoutConfirmed` before btc-vault v0.7.0 (btc-vault #2294).\n * Vault providers that run an older daemon still send it.\n */\nconst LEGACY_PAYOUT_BROADCAST = \"PayoutBroadcast\";\n\nconst PEGOUT_TERMINAL_STATUSES = new Set<string>([\n ClaimerPegoutStatusValue.PAYOUT_CONFIRMED,\n ClaimerPegoutStatusValue.PAYOUT_BLOCKED,\n]);\n\n/**\n * Replace the pre-v0.7.0 name `PayoutBroadcast` with `PayoutConfirmed`.\n * Other statuses pass through unchanged.\n */\nexport function normalizeClaimerPegoutStatus(status: string): string {\n return status === LEGACY_PAYOUT_BROADCAST\n ? ClaimerPegoutStatusValue.PAYOUT_CONFIRMED\n : status;\n}\n\n/** Whether a claimer status string maps to a known pegout state. */\nexport function isRecognizedPegoutStatus(status: string): boolean {\n return Object.values(ClaimerPegoutStatusValue).includes(\n status as ClaimerPegoutStatusValue,\n );\n}\n\n/**\n * Whether a claimer status is a hard-terminal pegout status\n * (PayoutConfirmed or PayoutBlocked). Soft-terminal conditions (polling\n * thresholds) are a consumer-side concern.\n */\nexport function isPegoutTerminalStatus(\n claimerStatus: string | undefined,\n): boolean {\n return !!claimerStatus && PEGOUT_TERMINAL_STATUSES.has(claimerStatus);\n}\n"],"names":["DaemonStatus","PRE_DEPOSITOR_SIGNATURES_STATES","POST_PAYOUT_SIGNATURE_STATUSES","VP_TRANSIENT_STATUSES","VP_TERMINAL_FAILURE_STATUSES","POST_WOTS_STATUSES","VP_BATCH_MAX_SIZE","RpcErrorCode","vaultIdKey","vaultId","attributeBatchResults","requestedVaultIds","results","requestedSet","byVaultId","seen","duplicate","unexpected","entry","normalized","missing","JsonRpcError","code","message","source","data","JSON_RPC_ERROR_CODES","JSON_RPC_VERSION","DEFAULT_RETRY_ATTEMPTS","DEFAULT_RETRY_DELAY_MS","DEFAULT_MAX_RESPONSE_BYTES","UNCAPPED_TYPED_RESPONSE_METHODS","RETRYABLE_HTTP_STATUS_CODES","DEFAULT_RETRYABLE_METHODS","defaultRetryableFor","method","AUTH_REJECTED_RPC_CODE","isAuthRejectedError","error","JsonRpcClient","config","__publicField","authState","headers","token","params","signal","response","jsonResponse","responseText","readResponseTextWithLimit","rpcResponse","err","callerSignal","requestId","maxRetries","body","lastError","attempt","timeoutController","timeoutId","merged","mergeAbortSignals","delay","ms","resolve","reject","onAbort","a","b","controller","onAbortA","onAbortB","cleanup","maxBytes","contentLength","parsedContentLength","responseTooLargeError","reader","decoder","totalBytes","done","value","ClaimerPegoutStatusValue","LEGACY_PAYOUT_BROADCAST","PEGOUT_TERMINAL_STATUSES","normalizeClaimerPegoutStatus","status","isRecognizedPegoutStatus","isPegoutTerminalStatus","claimerStatus"],"mappings":";;;AAwCO,IAAKA,sBAAAA,OACVA,EAAA,oBAAoB,oBACpBA,EAAA,4BAA4B,0BAC5BA,EAAA,qBAAqB,oBACrBA,EAAA,gCAAgC,+BAChCA,EAAA,kCAAkC,gCAClCA,EAAA,kCAAkC,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B,EAAS,KAAK,UAAA,GACvBgC,IAAU,IAAI,YAAA;AACpB,MAAIC,IAAa,GACb/B,IAAe;AAEnB,MAAI;AACF,eAAS;AACP,YAAM,EAAE,MAAAgC,GAAM,OAAAC,EAAA,IAAU,MAAMJ,EAAO,KAAA;AACrC,UAAIG,EAAM;AACV,UAAKC,GAGL;AAAA,YADAF,KAAcE,EAAM,YAChBF,IAAaN;AACf,sBAAMI,EAAO,OAAA,GACPD,EAAsBH,CAAQ;AAEtC,QAAAzB,KAAgB8B,EAAQ,OAAOG,GAAO,EAAE,QAAQ,IAAM;AAAA;AAAA,IACxD;AAAA,EACF,UAAA;AACE,IAAAJ,EAAO,YAAA;AAAA,EACT;AAEA,SAAO7B,IAAe8B,EAAQ,OAAA;AAChC;AAEA,SAASF,EAAsBH,GAAgC;AAC7D,SAAO,IAAIrD;AAAA,IACTK,EAAqB;AAAA,IACrB,6CAA6CgD,CAAQ;AAAA,IACrD;AAAA,EAAA;AAEJ;ACpmBO,IAAKS,sBAAAA,OACVA,EAAA,uBAAuB,sBACvBA,EAAA,kBAAkB,kBAClBA,EAAA,mBAAmB,mBACnBA,EAAA,mBAAmB,mBACnBA,EAAA,iBAAiB,iBALPA,IAAAA,KAAA,CAAA,CAAA;AAYZ,MAAMC,IAA0B,mBAE1BC,wBAA+B,IAAY;AAAA,EAC/C;AAAA,EACA;AAAA;AACF,CAAC;AAMM,SAASC,EAA6BC,GAAwB;AACnE,SAAOA,MAAWH,IACd,oBACAG;AACN;AAGO,SAASC,EAAyBD,GAAyB;AAChE,SAAO,OAAO,OAAOJ,CAAwB,EAAE;AAAA,IAC7CI;AAAA,EAAA;AAEJ;AAOO,SAASE,GACdC,GACS;AACT,SAAO,CAAC,CAACA,KAAiBL,EAAyB,IAAIK,CAAa;AACtE;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../../types-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../../types-BueQoMjO.cjs"),r=require("../../../../onChainBtcPubkey-BlzxYImF.cjs"),e=require("../../../../pegin-registration-client-B0j6ugt9.cjs"),i=require("../../../../secp256k1-DDHQ1_za.cjs");exports.OnChainBtcVaultStatus=a.OnChainBtcVaultStatus;exports.ViemOperationKeyReader=a.ViemOperationKeyReader;exports.ViemProtocolParamsReader=a.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=a.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=a.ViemVaultKeeperReader;exports.resolveProtocolAddresses=a.resolveProtocolAddresses;exports.assertOnChainBtcPubkey=r.assertOnChainBtcPubkey;exports.calculateBtcTxHash=r.calculateBtcTxHash;exports.derivePeginVaultId=r.derivePeginVaultId;exports.RegistrationLogsUnavailableError=e.RegistrationLogsUnavailableError;exports.ViemPeginRegistrationClient=e.ViemPeginRegistrationClient;exports.ViemVaultRegistryReader=e.ViemVaultRegistryReader;exports.isRegistrationLogsUnavailableError=e.isRegistrationLogsUnavailableError;exports.validateOffchainParams=e.validateOffchainParams;exports.validatePegInConfiguration=e.validatePegInConfiguration;exports.validateTBVProtocolParams=e.validateTBVProtocolParams;exports.assertValidVaultCoreVersion=i.assertValidVaultCoreVersion;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as r, V as s, a as i, b as t, c as o, r as l } from "../../../../types-
|
|
1
|
+
import { O as r, V as s, a as i, b as t, c as o, r as l } from "../../../../types-DGkejGZH.js";
|
|
2
2
|
import { a as V, c as d, d as m } from "../../../../onChainBtcPubkey-CCTdl53s.js";
|
|
3
|
-
import { R as g, V as P, c as R, i as u, v, a as f, b as p } from "../../../../pegin-registration-client-
|
|
3
|
+
import { R as g, V as P, c as R, i as u, v, a as f, b as p } from "../../../../pegin-registration-client-ilkV1mLP.js";
|
|
4
4
|
import { a as b } from "../../../../secp256k1-D-H9jmd7.js";
|
|
5
5
|
export {
|
|
6
6
|
r as OnChainBtcVaultStatus,
|
|
@@ -106,6 +106,12 @@ export interface VaultRegistryReader {
|
|
|
106
106
|
* RFC-006 registry — as does every caller.
|
|
107
107
|
*/
|
|
108
108
|
getVaultProviderGenesisBtcPubKey(vpAddress: Address, blockNumber?: bigint): Promise<OnChainBtcPubkey>;
|
|
109
|
+
/**
|
|
110
|
+
* Read the vault provider operation key selected by an RFC-006 epoch.
|
|
111
|
+
* Existing-vault consumers pass the vault's frozen `vpKeyEpoch` here so a
|
|
112
|
+
* later rotation cannot move the result.
|
|
113
|
+
*/
|
|
114
|
+
getVaultProviderOperationBtcKeyAtEpoch(vpAddress: Address, epoch: bigint, blockNumber?: bigint): Promise<OnChainBtcPubkey>;
|
|
109
115
|
/** Read the protocol pegin fee (in wei) for a given vault provider. */
|
|
110
116
|
getPegInFee(vaultProvider: Address): Promise<bigint>;
|
|
111
117
|
/**
|
|
@@ -131,8 +137,8 @@ export interface VaultRegistryReader {
|
|
|
131
137
|
getVaultKeyEpochsBatch(vaultIds: readonly Hex[]): Promise<KeyEpochs[]>;
|
|
132
138
|
/**
|
|
133
139
|
* Read a vault provider's *current* RFC-006 operation BTC key — the key its
|
|
134
|
-
* server
|
|
135
|
-
* provider has never rotated.
|
|
140
|
+
* server uses for the JSON-RPC token subject. Falls back to the registration
|
|
141
|
+
* key when the provider has never rotated.
|
|
136
142
|
*/
|
|
137
143
|
getCurrentVaultProviderOperationBtcKey(vpAddress: Address): Promise<OnChainBtcPubkey>;
|
|
138
144
|
/**
|
|
@@ -386,9 +392,10 @@ export interface OperationKeyReader {
|
|
|
386
392
|
/**
|
|
387
393
|
* Resolve every participant's *current* operation key.
|
|
388
394
|
*
|
|
389
|
-
* Used for new peg-ins
|
|
390
|
-
*
|
|
391
|
-
*
|
|
395
|
+
* Used for new peg-ins. The VP-only current getter separately supplies the
|
|
396
|
+
* JSON-RPC auth pin. Needs no epoch read at all — each registry's
|
|
397
|
+
* `getCurrentOperationBtcKey` resolves its own genesis fallback, so an
|
|
398
|
+
* operator that never rotated yields its registration key.
|
|
392
399
|
*/
|
|
393
400
|
getCurrentOperationKeys(query: OperationKeyQuery, blockNumber?: bigint): Promise<RawOperationKeys>;
|
|
394
401
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/clients/eth/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAMzC,OAAO,CAAC,MAAM,qBAAqB,EAAE,OAAO,MAAM,CAAC;AAEnD;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG;IACtC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,EAAE,IAAI,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,oBAAY,qBAAqB;IAC/B,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,MAAM,IAAI;IACV,QAAQ,IAAI;IACZ,OAAO,IAAI;CACZ;AAED,kEAAkE;AAClE,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,kBAAkB,EAAE,GAAG,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB,EAAE,OAAO,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IAChC,sBAAsB,EAAE,GAAG,CAAC;IAC5B,2BAA2B,EAAE,MAAM,CAAC;IACpC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,GAAG,CAAC;IACzB,QAAQ,EAAE,GAAG,CAAC;IACd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