zeldhash-miner 0.2.3 → 0.2.4
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/index.js +266 -413
- package/dist/index.js.map +1 -1
- package/dist/nonce.js +158 -0
- package/dist/nonce.js.map +1 -0
- package/dist/worker.d.ts +1 -0
- package/dist/worker.js +206 -0
- package/dist/worker.js.map +1 -0
- package/package.json +1 -1
- package/wasm/zeldhash_miner_wasm_bg.wasm +0 -0
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
class
|
|
1
|
+
import { Z as I, l as H, c as F, n as K, s as v, a as f } from "./nonce.js";
|
|
2
|
+
const S = (o) => o instanceof Error ? o.message : String(o);
|
|
3
|
+
class N extends Error {
|
|
4
4
|
code;
|
|
5
5
|
details;
|
|
6
|
-
constructor(t, e,
|
|
7
|
-
super(e), this.name = "ZeldMinerError", this.code = t, this.details =
|
|
6
|
+
constructor(t, e, s) {
|
|
7
|
+
super(e), this.name = "ZeldMinerError", this.code = t, this.details = s;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
12
|
-
return
|
|
13
|
-
const
|
|
14
|
-
return new
|
|
15
|
-
},
|
|
10
|
+
const Y = (o, t = I.WORKER_ERROR, e) => {
|
|
11
|
+
if (o instanceof N)
|
|
12
|
+
return o;
|
|
13
|
+
const s = S(o);
|
|
14
|
+
return new N(t, s, e);
|
|
15
|
+
}, i = (o, t, e) => new N(o, t, e), B = (o) => {
|
|
16
16
|
const t = BigInt(Number.MAX_SAFE_INTEGER);
|
|
17
|
-
return
|
|
17
|
+
return o > t ? Number.MAX_SAFE_INTEGER : o < -t ? -Number.MAX_SAFE_INTEGER : Number(o);
|
|
18
18
|
};
|
|
19
|
-
class
|
|
19
|
+
class T {
|
|
20
20
|
mode;
|
|
21
21
|
batchSize;
|
|
22
22
|
workerCount;
|
|
@@ -57,7 +57,7 @@ class O {
|
|
|
57
57
|
this.listeners[t].delete(e);
|
|
58
58
|
}
|
|
59
59
|
emit(t, e) {
|
|
60
|
-
this.listeners[t].forEach((
|
|
60
|
+
this.listeners[t].forEach((s) => s(e));
|
|
61
61
|
}
|
|
62
62
|
resolveWorkerUrl() {
|
|
63
63
|
const t = typeof location < "u" && location.origin ? location.origin : typeof self < "u" && self.location?.origin ? self.location.origin : void 0;
|
|
@@ -65,31 +65,31 @@ class O {
|
|
|
65
65
|
}
|
|
66
66
|
async spawnWorkers() {
|
|
67
67
|
const t = [], e = this.resolveWorkerUrl();
|
|
68
|
-
for (let
|
|
69
|
-
const
|
|
68
|
+
for (let s = 0; s < this.workerCount; s += 1) {
|
|
69
|
+
const g = new Worker(e, {
|
|
70
70
|
type: "module",
|
|
71
71
|
/* @vite-ignore */
|
|
72
|
-
name: `zeldminer-worker-${
|
|
73
|
-
}),
|
|
74
|
-
worker:
|
|
72
|
+
name: `zeldminer-worker-${s}`
|
|
73
|
+
}), n = {
|
|
74
|
+
worker: g,
|
|
75
75
|
hashesProcessed: 0n,
|
|
76
76
|
hashRate: 0,
|
|
77
77
|
nextNonce: 0n,
|
|
78
78
|
processedBase: 0n
|
|
79
79
|
};
|
|
80
|
-
this.workers.push(
|
|
81
|
-
new Promise((
|
|
82
|
-
const
|
|
83
|
-
|
|
80
|
+
this.workers.push(n), t.push(
|
|
81
|
+
new Promise((C) => {
|
|
82
|
+
const c = (d) => {
|
|
83
|
+
d.data.type === "ready" && (g.removeEventListener("message", c), C());
|
|
84
84
|
};
|
|
85
|
-
|
|
85
|
+
g.addEventListener("message", c);
|
|
86
86
|
})
|
|
87
|
-
),
|
|
87
|
+
), g.addEventListener(
|
|
88
88
|
"message",
|
|
89
|
-
(
|
|
89
|
+
(C) => this.handleWorkerMessage(n, C.data)
|
|
90
90
|
);
|
|
91
|
-
const
|
|
92
|
-
|
|
91
|
+
const r = { type: "init", mode: this.mode };
|
|
92
|
+
g.postMessage(r);
|
|
93
93
|
}
|
|
94
94
|
await Promise.all(t), this.emit("ready", void 0);
|
|
95
95
|
}
|
|
@@ -105,22 +105,22 @@ class O {
|
|
|
105
105
|
break;
|
|
106
106
|
case "found":
|
|
107
107
|
t.hashesProcessed = t.processedBase + (e.hashesProcessed ?? t.hashesProcessed), t.hashRate = e.hashRate ?? t.hashRate, t.lastNonce = e.lastNonce ?? t.lastNonce;
|
|
108
|
-
const
|
|
109
|
-
(
|
|
108
|
+
const s = this.workers.reduce(
|
|
109
|
+
(C, c) => C + c.hashesProcessed,
|
|
110
110
|
0n
|
|
111
|
-
),
|
|
111
|
+
), g = this.startedAt ? performance.now() - this.startedAt : 0, n = g > 0 ? B(s) / (g / 1e3) : 0, r = {
|
|
112
112
|
...e.result,
|
|
113
|
-
attempts:
|
|
114
|
-
duration:
|
|
115
|
-
hashRate:
|
|
113
|
+
attempts: s,
|
|
114
|
+
duration: g,
|
|
115
|
+
hashRate: n
|
|
116
116
|
};
|
|
117
|
-
this.running = !1, this.paused = !1, this.terminateWorkers(), this.cleanupExternalAbort(), this.emit("found",
|
|
117
|
+
this.running = !1, this.paused = !1, this.terminateWorkers(), this.cleanupExternalAbort(), this.emit("found", r);
|
|
118
118
|
break;
|
|
119
119
|
case "error":
|
|
120
120
|
this.running = !1, this.paused = !1, this.terminateWorkers(), this.cleanupExternalAbort(), this.emit(
|
|
121
121
|
"error",
|
|
122
|
-
new
|
|
123
|
-
e.code ??
|
|
122
|
+
new N(
|
|
123
|
+
e.code ?? I.WORKER_ERROR,
|
|
124
124
|
e.message,
|
|
125
125
|
{
|
|
126
126
|
workerId: e.workerId,
|
|
@@ -134,14 +134,14 @@ class O {
|
|
|
134
134
|
emitProgress() {
|
|
135
135
|
if (!this.running) return;
|
|
136
136
|
const t = this.workers.reduce(
|
|
137
|
-
(
|
|
137
|
+
(n, r) => n + r.hashesProcessed,
|
|
138
138
|
0n
|
|
139
|
-
), e = this.startedAt ? performance.now() - this.startedAt : 0,
|
|
139
|
+
), e = this.startedAt ? performance.now() - this.startedAt : 0, s = e > 0 ? B(t) / (e / 1e3) : 0, g = {
|
|
140
140
|
hashesProcessed: t,
|
|
141
|
-
hashRate:
|
|
141
|
+
hashRate: s,
|
|
142
142
|
elapsedMs: e
|
|
143
143
|
};
|
|
144
|
-
this.emit("progress",
|
|
144
|
+
this.emit("progress", g);
|
|
145
145
|
}
|
|
146
146
|
computeNextNonce(t) {
|
|
147
147
|
const e = this.stride - BigInt(this.batchSize);
|
|
@@ -163,25 +163,25 @@ class O {
|
|
|
163
163
|
async start(t) {
|
|
164
164
|
if (await this.readyPromise, this.stopWorkers(), this.running = !0, this.paused = !1, this.startedAt = performance.now(), this.txInputs = t.inputs, this.txOutputs = t.outputs, this.txNetwork = t.network === "signet" ? "testnet" : t.network, this.satsPerVbyte = t.satsPerVbyte, this.template = t.template, this.targetZeros = t.targetZeros, this.startNonce = t.startNonce ?? 0n, this.txDistribution = t.distribution, this.externalAbort && this.externalAbort !== t.signal && this.cleanupExternalAbort(), t.signal && (this.externalAbort = t.signal, t.signal.addEventListener("abort", this.abortHandler, { once: !0 })), !this.template || !this.txInputs || !this.txOutputs || this.targetZeros === void 0 || this.satsPerVbyte === void 0 || !this.txNetwork)
|
|
165
165
|
throw new Error("Mining parameters are missing");
|
|
166
|
-
const e = this.txInputs,
|
|
167
|
-
this.workers.forEach((
|
|
168
|
-
|
|
166
|
+
const e = this.txInputs, s = this.txOutputs, g = this.txNetwork, n = this.satsPerVbyte, r = this.template, C = this.targetZeros, c = this.txDistribution, d = this.stride;
|
|
167
|
+
this.workers.forEach((A, l) => {
|
|
168
|
+
A.processedBase = 0n, A.hashesProcessed = 0n, A.hashRate = 0, A.lastNonce = void 0;
|
|
169
169
|
const u = this.startNonce + BigInt(l) * BigInt(this.batchSize);
|
|
170
|
-
|
|
170
|
+
A.nextNonce = u;
|
|
171
171
|
const h = {
|
|
172
172
|
type: "mine",
|
|
173
173
|
inputs: e,
|
|
174
|
-
outputs:
|
|
175
|
-
network:
|
|
176
|
-
satsPerVbyte:
|
|
177
|
-
template:
|
|
174
|
+
outputs: s,
|
|
175
|
+
network: g,
|
|
176
|
+
satsPerVbyte: n,
|
|
177
|
+
template: r,
|
|
178
178
|
startNonce: u,
|
|
179
179
|
batchSize: this.batchSize,
|
|
180
|
-
targetZeros:
|
|
181
|
-
nonceStep:
|
|
182
|
-
distribution:
|
|
180
|
+
targetZeros: C,
|
|
181
|
+
nonceStep: d,
|
|
182
|
+
distribution: c
|
|
183
183
|
};
|
|
184
|
-
|
|
184
|
+
A.worker.postMessage(h);
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
pause() {
|
|
@@ -191,236 +191,89 @@ class O {
|
|
|
191
191
|
if (!this.paused || !this.template || !this.txInputs || !this.txOutputs || this.targetZeros === void 0 || this.satsPerVbyte === void 0 || !this.txNetwork)
|
|
192
192
|
return;
|
|
193
193
|
await this.readyPromise, this.running = !0, this.paused = !1, this.startedAt || (this.startedAt = performance.now());
|
|
194
|
-
const t = this.txInputs, e = this.txOutputs,
|
|
195
|
-
this.workers.forEach((
|
|
196
|
-
|
|
197
|
-
const l =
|
|
194
|
+
const t = this.txInputs, e = this.txOutputs, s = this.txNetwork, g = this.satsPerVbyte, n = this.template, r = this.targetZeros, C = this.txDistribution, c = this.stride;
|
|
195
|
+
this.workers.forEach((d, A) => {
|
|
196
|
+
d.processedBase = d.hashesProcessed, d.hashRate = 0;
|
|
197
|
+
const l = d.nextNonce || this.startNonce + BigInt(A) * BigInt(this.batchSize), u = {
|
|
198
198
|
type: "mine",
|
|
199
199
|
inputs: t,
|
|
200
200
|
outputs: e,
|
|
201
|
-
network:
|
|
202
|
-
satsPerVbyte:
|
|
203
|
-
template:
|
|
201
|
+
network: s,
|
|
202
|
+
satsPerVbyte: g,
|
|
203
|
+
template: n,
|
|
204
204
|
startNonce: l,
|
|
205
205
|
batchSize: this.batchSize,
|
|
206
|
-
targetZeros:
|
|
207
|
-
nonceStep:
|
|
208
|
-
distribution:
|
|
206
|
+
targetZeros: r,
|
|
207
|
+
nonceStep: c,
|
|
208
|
+
distribution: C
|
|
209
209
|
};
|
|
210
|
-
|
|
210
|
+
d.worker.postMessage(u);
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
stop() {
|
|
214
214
|
!this.running && !this.paused || (this.running = !1, this.paused = !1, this.terminateWorkers(), this.cleanupExternalAbort(), this.emit("stopped", void 0));
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
globalThis.__ZELDMINER_WASM_BASE__ = new URL("/wasm/", s).href;
|
|
222
|
-
} catch {
|
|
223
|
-
globalThis.__ZELDMINER_WASM_BASE__ = "/wasm/";
|
|
224
|
-
}
|
|
225
|
-
let B = null, N = null, Y = !1;
|
|
226
|
-
const D = () => {
|
|
227
|
-
if (Y) return;
|
|
228
|
-
Y = !0;
|
|
229
|
-
const s = globalThis.GPUAdapter?.prototype, t = s?.requestDevice;
|
|
230
|
-
!s || typeof t != "function" || (s.requestDevice = function(n) {
|
|
231
|
-
if (n?.requiredLimits && typeof this.limits == "object") {
|
|
232
|
-
const i = n.requiredLimits, g = this.limits;
|
|
233
|
-
for (const I of Object.keys(i))
|
|
234
|
-
(!(I in g) || g[I] === void 0) && delete i[I];
|
|
235
|
-
}
|
|
236
|
-
return t.call(this, n);
|
|
237
|
-
});
|
|
238
|
-
}, R = (s) => s.endsWith("/") ? s : `${s}/`, p = (s) => {
|
|
239
|
-
const t = s.trim();
|
|
240
|
-
return t && (typeof window < "u" && typeof window.location?.origin == "string" ? R(new URL(t, window.location.origin).href) : R(new URL(t, import.meta.url).href));
|
|
241
|
-
}, Q = () => {
|
|
242
|
-
const s = globalThis.__ZELDMINER_WASM_BASE__;
|
|
243
|
-
if (typeof s == "string" && s.trim())
|
|
244
|
-
return p(s);
|
|
245
|
-
const t = L?.VITE_ZELDMINER_WASM_BASE;
|
|
246
|
-
if (typeof t == "string" && t.trim())
|
|
247
|
-
return p(t);
|
|
248
|
-
const e = "./";
|
|
249
|
-
return e.trim() ? p(`${R(e.trim())}wasm/`) : p("/wasm/");
|
|
250
|
-
}, K = Q(), S = `${K}zeldhash_miner_wasm.js`, _ = `${K}zeldhash_miner_wasm_bg.wasm`, x = async (s) => (0, eval)("s => import(s)")(s), T = (s) => s instanceof Error ? s.message : String(s), j = async () => {
|
|
251
|
-
D();
|
|
252
|
-
let s;
|
|
253
|
-
try {
|
|
254
|
-
s = await x(
|
|
255
|
-
/* @vite-ignore */
|
|
256
|
-
S
|
|
257
|
-
);
|
|
258
|
-
} catch (n) {
|
|
259
|
-
throw new Error(
|
|
260
|
-
`Failed to import WASM bundle (${S}). Did you run ./scripts/build-wasm.sh? (${T(n)})`
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
const t = s.default;
|
|
264
|
-
if (typeof t != "function")
|
|
265
|
-
throw new Error("WASM init function is missing from the bundle.");
|
|
266
|
-
try {
|
|
267
|
-
const n = new URL(_, import.meta.url);
|
|
268
|
-
await t({ module_or_path: n });
|
|
269
|
-
} catch (n) {
|
|
270
|
-
throw new Error(
|
|
271
|
-
`Failed to initialize WASM bundle: ${T(n)}`
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
const e = s;
|
|
275
|
-
try {
|
|
276
|
-
e.init_panic_hook?.();
|
|
277
|
-
} catch {
|
|
278
|
-
}
|
|
279
|
-
return e;
|
|
280
|
-
}, M = async () => B || (N || (N = j().then((s) => (B = s, s)).catch((s) => {
|
|
281
|
-
throw N = null, s;
|
|
282
|
-
})), N), W = (1n << 64n) - 1n, k = (s) => {
|
|
283
|
-
if (s < 0n)
|
|
284
|
-
throw new Error("nonce must be non-negative");
|
|
285
|
-
if (s === 0n) return 1;
|
|
286
|
-
let t = 0, e = s;
|
|
287
|
-
for (; e > 0n; )
|
|
288
|
-
t += 1, e >>= 8n;
|
|
289
|
-
return t;
|
|
290
|
-
}, z = (s) => {
|
|
291
|
-
if (s < 0n)
|
|
292
|
-
throw new Error("nonce must be non-negative");
|
|
293
|
-
if (s <= 23n) return 1;
|
|
294
|
-
if (s <= 0xffn) return 2;
|
|
295
|
-
if (s <= 0xffffn) return 3;
|
|
296
|
-
if (s <= 0xffffffffn) return 5;
|
|
297
|
-
if (s <= W) return 9;
|
|
298
|
-
throw new Error("nonce range exceeds u64");
|
|
299
|
-
}, $ = (s) => {
|
|
300
|
-
if (!Number.isInteger(s) || s <= 0 || s > 8)
|
|
301
|
-
throw new Error("nonceLength must be between 1 and 8");
|
|
302
|
-
return (1n << BigInt(s * 8)) - 1n;
|
|
303
|
-
}, q = (s) => {
|
|
304
|
-
switch (s) {
|
|
305
|
-
case 1:
|
|
306
|
-
return 23n;
|
|
307
|
-
case 2:
|
|
308
|
-
return 0xffn;
|
|
309
|
-
case 3:
|
|
310
|
-
return 0xffffn;
|
|
311
|
-
case 5:
|
|
312
|
-
return 0xffffffffn;
|
|
313
|
-
case 9:
|
|
314
|
-
return W;
|
|
315
|
-
default:
|
|
316
|
-
throw new Error("cbor nonceLength must be one of 1, 2, 3, 5, 9");
|
|
317
|
-
}
|
|
318
|
-
}, tt = (s, t) => {
|
|
319
|
-
if (s < 0n)
|
|
320
|
-
throw new Error("startNonce must be non-negative");
|
|
321
|
-
if (!Number.isInteger(t) || t <= 0)
|
|
322
|
-
throw new Error("batchSize must be a positive integer");
|
|
323
|
-
const e = s + BigInt(t - 1);
|
|
324
|
-
if (e > W)
|
|
325
|
-
throw new Error("nonce range exceeds u64");
|
|
326
|
-
const n = [];
|
|
327
|
-
let i = s;
|
|
328
|
-
for (; i <= e; ) {
|
|
329
|
-
const g = k(i), I = $(g), c = e < I ? e : I, a = c - i + 1n;
|
|
330
|
-
if (a > BigInt(Number.MAX_SAFE_INTEGER))
|
|
331
|
-
throw new Error("segment size exceeds safe integer range");
|
|
332
|
-
if (n.push({
|
|
333
|
-
start: i,
|
|
334
|
-
size: Number(a),
|
|
335
|
-
nonceLength: g
|
|
336
|
-
}), c === e)
|
|
337
|
-
break;
|
|
338
|
-
i = c + 1n;
|
|
339
|
-
}
|
|
340
|
-
return n;
|
|
341
|
-
}, et = (s, t) => {
|
|
342
|
-
if (s < 0n)
|
|
343
|
-
throw new Error("startNonce must be non-negative");
|
|
344
|
-
if (!Number.isInteger(t) || t <= 0)
|
|
345
|
-
throw new Error("batchSize must be a positive integer");
|
|
346
|
-
const e = s + BigInt(t - 1);
|
|
347
|
-
if (e > W)
|
|
348
|
-
throw new Error("nonce range exceeds u64");
|
|
349
|
-
const n = [];
|
|
350
|
-
let i = s;
|
|
351
|
-
for (; i <= e; ) {
|
|
352
|
-
const g = z(i), I = q(g), c = e < I ? e : I, a = c - i + 1n;
|
|
353
|
-
if (a > BigInt(Number.MAX_SAFE_INTEGER))
|
|
354
|
-
throw new Error("segment size exceeds safe integer range");
|
|
355
|
-
if (n.push({
|
|
356
|
-
start: i,
|
|
357
|
-
size: Number(a),
|
|
358
|
-
nonceLength: g
|
|
359
|
-
}), c === e)
|
|
360
|
-
break;
|
|
361
|
-
i = c + 1n;
|
|
362
|
-
}
|
|
363
|
-
return n;
|
|
364
|
-
}, st = /^[0-9a-fA-F]{64}$/, nt = /^[0-9a-fA-F]+$/, G = (1n << 64n) - 1n, it = 4294967295, gt = (s) => s === "p2tr" ? 330 : s === "p2wpkh" ? 310 : 546, ot = (s) => s instanceof Error ? s.message : String(s), F = (s, t) => t.some((e) => s.includes(e)), J = (s, t, e) => {
|
|
365
|
-
const n = ot(s), i = n.toLowerCase();
|
|
366
|
-
throw F(i, ["insufficient funds", "insufficient_funds"]) ? r(
|
|
367
|
-
o.INSUFFICIENT_FUNDS,
|
|
217
|
+
const U = /^[0-9a-fA-F]{64}$/, k = /^[0-9a-fA-F]+$/, p = (1n << 64n) - 1n, z = 4294967295, P = (o) => o === "p2tr" ? 330 : o === "p2wpkh" ? 310 : 546, Q = (o) => o instanceof Error ? o.message : String(o), R = (o, t) => t.some((e) => o.includes(e)), w = (o, t, e) => {
|
|
218
|
+
const s = Q(o), g = s.toLowerCase();
|
|
219
|
+
throw R(g, ["insufficient funds", "insufficient_funds"]) ? i(
|
|
220
|
+
I.INSUFFICIENT_FUNDS,
|
|
368
221
|
"Insufficient funds for outputs and fee",
|
|
369
|
-
{ ...e, cause:
|
|
370
|
-
) :
|
|
371
|
-
|
|
222
|
+
{ ...e, cause: s }
|
|
223
|
+
) : R(g, ["change would be dust", "output amount below dust limit", "dust"]) ? i(
|
|
224
|
+
I.DUST_OUTPUT,
|
|
372
225
|
"Change would be dust",
|
|
373
|
-
{ ...e, cause:
|
|
374
|
-
) :
|
|
226
|
+
{ ...e, cause: s }
|
|
227
|
+
) : Y(o, I.WORKER_ERROR, {
|
|
375
228
|
...e,
|
|
376
229
|
context: t
|
|
377
230
|
});
|
|
378
|
-
},
|
|
379
|
-
class
|
|
231
|
+
}, W = (o) => o === "signet" ? "testnet" : o;
|
|
232
|
+
class O {
|
|
380
233
|
network;
|
|
381
234
|
satsPerVbyte;
|
|
382
235
|
constructor(t, e) {
|
|
383
236
|
if (!Number.isFinite(e) || e <= 0)
|
|
384
|
-
throw
|
|
385
|
-
|
|
237
|
+
throw i(
|
|
238
|
+
I.INVALID_INPUT,
|
|
386
239
|
"satsPerVbyte must be a positive number",
|
|
387
240
|
{ field: "satsPerVbyte" }
|
|
388
241
|
);
|
|
389
242
|
this.network = t, this.satsPerVbyte = e;
|
|
390
243
|
}
|
|
391
244
|
async getWasm() {
|
|
392
|
-
return
|
|
245
|
+
return H();
|
|
393
246
|
}
|
|
394
|
-
assertNonceRange(t, e,
|
|
395
|
-
if (t < 0n || t >
|
|
396
|
-
throw
|
|
397
|
-
|
|
247
|
+
assertNonceRange(t, e, s) {
|
|
248
|
+
if (t < 0n || t > p)
|
|
249
|
+
throw i(
|
|
250
|
+
I.INVALID_INPUT,
|
|
398
251
|
"startNonce must be between 0 and 2^64 - 1",
|
|
399
252
|
{ startNonce: t }
|
|
400
253
|
);
|
|
401
|
-
if (!Number.isInteger(e) || e <= 0 || e >
|
|
402
|
-
throw
|
|
403
|
-
|
|
254
|
+
if (!Number.isInteger(e) || e <= 0 || e > z)
|
|
255
|
+
throw i(
|
|
256
|
+
I.INVALID_INPUT,
|
|
404
257
|
"batchSize must be a positive 32-bit integer",
|
|
405
258
|
{ batchSize: e }
|
|
406
259
|
);
|
|
407
|
-
const
|
|
408
|
-
if (
|
|
409
|
-
throw
|
|
410
|
-
|
|
260
|
+
const g = t + BigInt(e - 1);
|
|
261
|
+
if (g > p)
|
|
262
|
+
throw i(
|
|
263
|
+
I.INVALID_INPUT,
|
|
411
264
|
"nonce range exceeds u64",
|
|
412
265
|
{ startNonce: t, batchSize: e }
|
|
413
266
|
);
|
|
414
|
-
const
|
|
415
|
-
if (
|
|
416
|
-
const
|
|
417
|
-
throw
|
|
418
|
-
|
|
419
|
-
`nonce range crosses ${
|
|
267
|
+
const n = s ? F : K, r = n(t), C = n(g);
|
|
268
|
+
if (r !== C) {
|
|
269
|
+
const c = s ? "CBOR length" : "byte-length";
|
|
270
|
+
throw i(
|
|
271
|
+
I.INVALID_INPUT,
|
|
272
|
+
`nonce range crosses ${c} boundary; reduce batch size`,
|
|
420
273
|
{ startNonce: t, batchSize: e }
|
|
421
274
|
);
|
|
422
275
|
}
|
|
423
|
-
return
|
|
276
|
+
return r;
|
|
424
277
|
}
|
|
425
278
|
cloneInputs(t) {
|
|
426
279
|
return t.map((e) => ({ ...e }));
|
|
@@ -430,180 +283,180 @@ class It {
|
|
|
430
283
|
}
|
|
431
284
|
validateInputs(t) {
|
|
432
285
|
if (!Array.isArray(t) || t.length === 0)
|
|
433
|
-
throw
|
|
434
|
-
|
|
286
|
+
throw i(
|
|
287
|
+
I.INVALID_INPUT,
|
|
435
288
|
"At least one input is required"
|
|
436
289
|
);
|
|
437
|
-
t.forEach((e,
|
|
438
|
-
if (!
|
|
439
|
-
throw
|
|
440
|
-
|
|
441
|
-
`inputs[${
|
|
442
|
-
{ index:
|
|
290
|
+
t.forEach((e, s) => {
|
|
291
|
+
if (!U.test(e.txid))
|
|
292
|
+
throw i(
|
|
293
|
+
I.INVALID_INPUT,
|
|
294
|
+
`inputs[${s}].txid must be a 64-character hex`,
|
|
295
|
+
{ index: s }
|
|
443
296
|
);
|
|
444
297
|
if (!Number.isInteger(e.vout) || e.vout < 0)
|
|
445
|
-
throw
|
|
446
|
-
|
|
447
|
-
`inputs[${
|
|
448
|
-
{ index:
|
|
298
|
+
throw i(
|
|
299
|
+
I.INVALID_INPUT,
|
|
300
|
+
`inputs[${s}].vout must be a non-negative integer`,
|
|
301
|
+
{ index: s }
|
|
449
302
|
);
|
|
450
303
|
if (!Number.isInteger(e.amount) || e.amount <= 0)
|
|
451
|
-
throw
|
|
452
|
-
|
|
453
|
-
`inputs[${
|
|
454
|
-
{ index:
|
|
304
|
+
throw i(
|
|
305
|
+
I.INVALID_INPUT,
|
|
306
|
+
`inputs[${s}].amount must be a positive integer`,
|
|
307
|
+
{ index: s }
|
|
455
308
|
);
|
|
456
|
-
if (typeof e.scriptPubKey != "string" || e.scriptPubKey.length === 0 || e.scriptPubKey.length % 2 !== 0 || !
|
|
457
|
-
throw
|
|
458
|
-
|
|
459
|
-
`inputs[${
|
|
460
|
-
{ index:
|
|
309
|
+
if (typeof e.scriptPubKey != "string" || e.scriptPubKey.length === 0 || e.scriptPubKey.length % 2 !== 0 || !k.test(e.scriptPubKey))
|
|
310
|
+
throw i(
|
|
311
|
+
I.INVALID_INPUT,
|
|
312
|
+
`inputs[${s}].scriptPubKey must be valid hex`,
|
|
313
|
+
{ index: s }
|
|
461
314
|
);
|
|
462
315
|
});
|
|
463
316
|
}
|
|
464
|
-
validateAddressResult(t, e,
|
|
317
|
+
validateAddressResult(t, e, s) {
|
|
465
318
|
if (!t.ok) {
|
|
466
|
-
const
|
|
467
|
-
throw
|
|
468
|
-
|
|
469
|
-
`outputs[${e}].address is invalid (${
|
|
319
|
+
const g = t.error ?? "invalid address", r = g.toLowerCase().includes("unsupported") ? I.UNSUPPORTED_ADDRESS_TYPE : I.INVALID_ADDRESS;
|
|
320
|
+
throw i(
|
|
321
|
+
r,
|
|
322
|
+
`outputs[${e}].address is invalid (${g})`,
|
|
470
323
|
{ index: e }
|
|
471
324
|
);
|
|
472
325
|
}
|
|
473
|
-
if (t.network && t.network !==
|
|
474
|
-
throw
|
|
475
|
-
|
|
326
|
+
if (t.network && t.network !== s && !(t.network === "testnet" && s === "signet"))
|
|
327
|
+
throw i(
|
|
328
|
+
I.INVALID_ADDRESS,
|
|
476
329
|
`outputs[${e}].address network mismatch`,
|
|
477
330
|
{ index: e }
|
|
478
331
|
);
|
|
479
332
|
if (t.addressType && t.addressType !== "p2tr" && t.addressType !== "p2wpkh")
|
|
480
|
-
throw
|
|
481
|
-
|
|
333
|
+
throw i(
|
|
334
|
+
I.UNSUPPORTED_ADDRESS_TYPE,
|
|
482
335
|
`outputs[${e}].address uses an unsupported type`,
|
|
483
336
|
{ index: e, addressType: t.addressType }
|
|
484
337
|
);
|
|
485
338
|
}
|
|
486
339
|
async validateOutputs(t) {
|
|
487
340
|
if (!Array.isArray(t) || t.length === 0)
|
|
488
|
-
throw
|
|
489
|
-
|
|
341
|
+
throw i(
|
|
342
|
+
I.INVALID_INPUT,
|
|
490
343
|
"At least one output is required"
|
|
491
344
|
);
|
|
492
|
-
const e = t.filter((
|
|
345
|
+
const e = t.filter((n) => n.change).length;
|
|
493
346
|
if (e !== 1) {
|
|
494
|
-
const
|
|
495
|
-
throw
|
|
496
|
-
|
|
347
|
+
const n = e === 0 ? I.NO_CHANGE_OUTPUT : I.MULTIPLE_CHANGE_OUTPUTS;
|
|
348
|
+
throw i(
|
|
349
|
+
n,
|
|
497
350
|
"Exactly one change output is required",
|
|
498
351
|
{ changeCount: e }
|
|
499
352
|
);
|
|
500
353
|
}
|
|
501
|
-
const
|
|
502
|
-
t.forEach((
|
|
503
|
-
const
|
|
504
|
-
this.validateAddressResult(
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
507
|
-
if (
|
|
508
|
-
throw
|
|
509
|
-
|
|
510
|
-
`outputs[${
|
|
511
|
-
{ index:
|
|
354
|
+
const s = await this.getWasm(), g = W(this.network);
|
|
355
|
+
t.forEach((n, r) => {
|
|
356
|
+
const C = s.validate_address(n.address, g);
|
|
357
|
+
this.validateAddressResult(C, r, g);
|
|
358
|
+
const c = P(C.addressType);
|
|
359
|
+
if (n.change) {
|
|
360
|
+
if (n.amount !== void 0 && (!Number.isInteger(n.amount) || n.amount < 0))
|
|
361
|
+
throw i(
|
|
362
|
+
I.INVALID_INPUT,
|
|
363
|
+
`outputs[${r}].amount must be a non-negative integer when provided`,
|
|
364
|
+
{ index: r }
|
|
512
365
|
);
|
|
513
|
-
} else if (!Number.isInteger(
|
|
514
|
-
throw
|
|
515
|
-
|
|
516
|
-
`outputs[${
|
|
517
|
-
{ index:
|
|
366
|
+
} else if (!Number.isInteger(n.amount) || n.amount < c)
|
|
367
|
+
throw i(
|
|
368
|
+
I.DUST_OUTPUT,
|
|
369
|
+
`outputs[${r}].amount must be at least ${c} sats`,
|
|
370
|
+
{ index: r, addressType: C.addressType }
|
|
518
371
|
);
|
|
519
372
|
});
|
|
520
373
|
}
|
|
521
374
|
validateDistribution(t, e) {
|
|
522
375
|
if (e !== void 0) {
|
|
523
376
|
if (!Array.isArray(e))
|
|
524
|
-
throw
|
|
525
|
-
|
|
377
|
+
throw i(
|
|
378
|
+
I.INVALID_INPUT,
|
|
526
379
|
"distribution must be an array of bigint values"
|
|
527
380
|
);
|
|
528
381
|
if (e.length !== t.length)
|
|
529
|
-
throw
|
|
530
|
-
|
|
382
|
+
throw i(
|
|
383
|
+
I.INVALID_INPUT,
|
|
531
384
|
"distribution length must match number of outputs",
|
|
532
385
|
{ expected: t.length, actual: e.length }
|
|
533
386
|
);
|
|
534
|
-
return e.map((
|
|
535
|
-
if (typeof
|
|
536
|
-
throw
|
|
537
|
-
|
|
387
|
+
return e.map((s, g) => {
|
|
388
|
+
if (typeof s != "bigint")
|
|
389
|
+
throw i(
|
|
390
|
+
I.INVALID_INPUT,
|
|
538
391
|
"distribution values must be bigint",
|
|
539
|
-
{ index:
|
|
392
|
+
{ index: g }
|
|
540
393
|
);
|
|
541
|
-
if (
|
|
542
|
-
throw
|
|
543
|
-
|
|
394
|
+
if (s < 0n)
|
|
395
|
+
throw i(
|
|
396
|
+
I.INVALID_INPUT,
|
|
544
397
|
"distribution values must be non-negative",
|
|
545
|
-
{ index:
|
|
398
|
+
{ index: g }
|
|
546
399
|
);
|
|
547
|
-
return
|
|
400
|
+
return s;
|
|
548
401
|
});
|
|
549
402
|
}
|
|
550
403
|
}
|
|
551
404
|
async buildMiningTemplate(t) {
|
|
552
|
-
const { inputs: e, outputs:
|
|
553
|
-
this.validateInputs(e), await this.validateOutputs(
|
|
554
|
-
const
|
|
405
|
+
const { inputs: e, outputs: s, startNonce: g, batchSize: n, distribution: r } = t;
|
|
406
|
+
this.validateInputs(e), await this.validateOutputs(s);
|
|
407
|
+
const C = this.validateDistribution(s, r), c = Array.isArray(C), d = this.assertNonceRange(g, n, c), A = await this.getWasm();
|
|
555
408
|
try {
|
|
556
|
-
const l =
|
|
409
|
+
const l = A.build_mining_template(
|
|
557
410
|
this.cloneInputs(e),
|
|
558
|
-
this.cloneOutputs(
|
|
559
|
-
|
|
411
|
+
this.cloneOutputs(s),
|
|
412
|
+
W(this.network),
|
|
560
413
|
BigInt(this.satsPerVbyte),
|
|
561
|
-
i,
|
|
562
414
|
g,
|
|
563
|
-
|
|
415
|
+
n,
|
|
416
|
+
C ?? null
|
|
564
417
|
);
|
|
565
418
|
if (!l || !(l.prefix instanceof Uint8Array) || !(l.suffix instanceof Uint8Array))
|
|
566
|
-
throw
|
|
567
|
-
|
|
419
|
+
throw i(
|
|
420
|
+
I.WORKER_ERROR,
|
|
568
421
|
"WASM returned an invalid mining template"
|
|
569
422
|
);
|
|
570
|
-
const u = l.useCborNonce ??
|
|
571
|
-
return { ...l, nonceLength:
|
|
423
|
+
const u = l.useCborNonce ?? c;
|
|
424
|
+
return { ...l, nonceLength: d, useCborNonce: u };
|
|
572
425
|
} catch (l) {
|
|
573
|
-
throw
|
|
574
|
-
startNonce:
|
|
575
|
-
batchSize:
|
|
576
|
-
distribution:
|
|
426
|
+
throw w(l, "build_mining_template", {
|
|
427
|
+
startNonce: g,
|
|
428
|
+
batchSize: n,
|
|
429
|
+
distribution: C
|
|
577
430
|
});
|
|
578
431
|
}
|
|
579
432
|
}
|
|
580
433
|
async buildPsbt(t) {
|
|
581
|
-
const { inputs: e, outputs:
|
|
582
|
-
this.validateInputs(e), await this.validateOutputs(
|
|
583
|
-
const
|
|
584
|
-
if (
|
|
585
|
-
throw
|
|
586
|
-
|
|
434
|
+
const { inputs: e, outputs: s, nonce: g, distribution: n } = t;
|
|
435
|
+
this.validateInputs(e), await this.validateOutputs(s);
|
|
436
|
+
const r = this.validateDistribution(s, n);
|
|
437
|
+
if (g < 0n || g > p)
|
|
438
|
+
throw i(
|
|
439
|
+
I.INVALID_INPUT,
|
|
587
440
|
"nonce must be between 0 and 2^64 - 1",
|
|
588
|
-
{ nonce:
|
|
441
|
+
{ nonce: g }
|
|
589
442
|
);
|
|
590
|
-
const
|
|
443
|
+
const C = await this.getWasm();
|
|
591
444
|
try {
|
|
592
|
-
return
|
|
445
|
+
return C.build_psbt(
|
|
593
446
|
this.cloneInputs(e),
|
|
594
|
-
this.cloneOutputs(
|
|
595
|
-
|
|
447
|
+
this.cloneOutputs(s),
|
|
448
|
+
W(this.network),
|
|
596
449
|
BigInt(this.satsPerVbyte),
|
|
597
|
-
|
|
598
|
-
|
|
450
|
+
g,
|
|
451
|
+
r ?? null
|
|
599
452
|
);
|
|
600
|
-
} catch (
|
|
601
|
-
throw
|
|
453
|
+
} catch (c) {
|
|
454
|
+
throw w(c, "build_psbt", { nonce: g, distribution: r });
|
|
602
455
|
}
|
|
603
456
|
}
|
|
604
457
|
}
|
|
605
|
-
const
|
|
606
|
-
class
|
|
458
|
+
const X = 1, y = 32;
|
|
459
|
+
class E {
|
|
607
460
|
options;
|
|
608
461
|
builder;
|
|
609
462
|
coordinator = null;
|
|
@@ -611,7 +464,7 @@ class rt {
|
|
|
611
464
|
state = "idle";
|
|
612
465
|
stopRequested = !1;
|
|
613
466
|
constructor(t) {
|
|
614
|
-
this.options = this.validateOptions(t), this.builder = new
|
|
467
|
+
this.options = this.validateOptions(t), this.builder = new O(t.network, t.satsPerVbyte), this.listeners = {
|
|
615
468
|
progress: /* @__PURE__ */ new Set(),
|
|
616
469
|
found: /* @__PURE__ */ new Set(),
|
|
617
470
|
error: /* @__PURE__ */ new Set(),
|
|
@@ -625,24 +478,24 @@ class rt {
|
|
|
625
478
|
this.listeners[t].delete(e);
|
|
626
479
|
}
|
|
627
480
|
emit(t, e) {
|
|
628
|
-
this.listeners[t].forEach((
|
|
481
|
+
this.listeners[t].forEach((s) => s(e));
|
|
629
482
|
}
|
|
630
483
|
validateOptions(t) {
|
|
631
484
|
if (!Number.isInteger(t.batchSize) || t.batchSize <= 0)
|
|
632
|
-
throw
|
|
633
|
-
|
|
485
|
+
throw i(
|
|
486
|
+
I.INVALID_INPUT,
|
|
634
487
|
"batchSize must be a positive integer",
|
|
635
488
|
{ field: "batchSize" }
|
|
636
489
|
);
|
|
637
490
|
if (!Number.isInteger(t.workerThreads) || t.workerThreads <= 0)
|
|
638
|
-
throw
|
|
639
|
-
|
|
491
|
+
throw i(
|
|
492
|
+
I.INVALID_INPUT,
|
|
640
493
|
"workerThreads must be a positive integer",
|
|
641
494
|
{ field: "workerThreads" }
|
|
642
495
|
);
|
|
643
496
|
if (!Number.isFinite(t.satsPerVbyte) || t.satsPerVbyte <= 0)
|
|
644
|
-
throw
|
|
645
|
-
|
|
497
|
+
throw i(
|
|
498
|
+
I.INVALID_INPUT,
|
|
646
499
|
"satsPerVbyte must be a positive number",
|
|
647
500
|
{ field: "satsPerVbyte" }
|
|
648
501
|
);
|
|
@@ -658,105 +511,105 @@ class rt {
|
|
|
658
511
|
}
|
|
659
512
|
async mineTransaction(t) {
|
|
660
513
|
if (this.state === "running")
|
|
661
|
-
throw
|
|
662
|
-
|
|
514
|
+
throw i(
|
|
515
|
+
I.INVALID_INPUT,
|
|
663
516
|
"Mining is already in progress"
|
|
664
517
|
);
|
|
665
|
-
if (!Number.isInteger(t.targetZeros) || t.targetZeros <
|
|
666
|
-
throw
|
|
667
|
-
|
|
668
|
-
`targetZeros must be an integer between ${
|
|
518
|
+
if (!Number.isInteger(t.targetZeros) || t.targetZeros < X || t.targetZeros > y)
|
|
519
|
+
throw i(
|
|
520
|
+
I.INVALID_INPUT,
|
|
521
|
+
`targetZeros must be an integer between ${X} and ${y}`,
|
|
669
522
|
{ targetZeros: t.targetZeros }
|
|
670
523
|
);
|
|
671
|
-
const e = t.startNonce ?? 0n,
|
|
672
|
-
if (!Number.isInteger(
|
|
673
|
-
throw
|
|
674
|
-
|
|
524
|
+
const e = t.startNonce ?? 0n, s = t.batchSize ?? this.options.batchSize;
|
|
525
|
+
if (!Number.isInteger(s) || s <= 0)
|
|
526
|
+
throw i(
|
|
527
|
+
I.INVALID_INPUT,
|
|
675
528
|
"batchSize must be a positive integer",
|
|
676
|
-
{ batchSize:
|
|
529
|
+
{ batchSize: s }
|
|
677
530
|
);
|
|
678
531
|
if (t.signal?.aborted)
|
|
679
|
-
throw
|
|
680
|
-
|
|
532
|
+
throw i(
|
|
533
|
+
I.MINING_ABORTED,
|
|
681
534
|
"Abort signal already triggered"
|
|
682
535
|
);
|
|
683
|
-
const
|
|
684
|
-
let
|
|
536
|
+
const g = t.distribution, n = !!(g && g.length > 0);
|
|
537
|
+
let r = s;
|
|
685
538
|
try {
|
|
686
|
-
const [l] =
|
|
539
|
+
const [l] = n ? v(e, s) : f(e, s);
|
|
687
540
|
if (!l)
|
|
688
|
-
throw
|
|
689
|
-
|
|
541
|
+
throw i(
|
|
542
|
+
I.INVALID_INPUT,
|
|
690
543
|
"Failed to compute nonce segments",
|
|
691
|
-
{ startNonce: e, batchSize:
|
|
544
|
+
{ startNonce: e, batchSize: s }
|
|
692
545
|
);
|
|
693
|
-
|
|
546
|
+
r = l.size;
|
|
694
547
|
} catch (l) {
|
|
695
|
-
throw
|
|
696
|
-
|
|
548
|
+
throw i(
|
|
549
|
+
I.INVALID_INPUT,
|
|
697
550
|
l instanceof Error ? l.message : String(l),
|
|
698
|
-
{ startNonce: e, batchSize:
|
|
551
|
+
{ startNonce: e, batchSize: s }
|
|
699
552
|
);
|
|
700
553
|
}
|
|
701
|
-
const
|
|
554
|
+
const C = await this.selectBackend(), c = await this.builder.buildMiningTemplate({
|
|
702
555
|
inputs: t.inputs,
|
|
703
556
|
outputs: t.outputs,
|
|
704
557
|
startNonce: e,
|
|
705
|
-
batchSize:
|
|
706
|
-
distribution:
|
|
707
|
-
}),
|
|
708
|
-
mode:
|
|
709
|
-
batchSize:
|
|
558
|
+
batchSize: r,
|
|
559
|
+
distribution: g
|
|
560
|
+
}), d = this.options.network === "signet" ? "testnet" : this.options.network, A = new T({
|
|
561
|
+
mode: C,
|
|
562
|
+
batchSize: s,
|
|
710
563
|
workerThreads: this.options.workerThreads
|
|
711
564
|
});
|
|
712
|
-
return this.coordinator =
|
|
565
|
+
return this.coordinator = A, this.state = "running", this.stopRequested = !1, new Promise((l, u) => {
|
|
713
566
|
let h = !1;
|
|
714
|
-
const
|
|
715
|
-
this.clearCoordinatorHandlers(
|
|
716
|
-
},
|
|
717
|
-
h || (h = !0,
|
|
718
|
-
}, Z = (
|
|
567
|
+
const G = () => {
|
|
568
|
+
this.clearCoordinatorHandlers(A, b), this.coordinator === A && (this.coordinator = null), this.state = "idle", this.stopRequested = !1;
|
|
569
|
+
}, J = (a) => {
|
|
570
|
+
h || (h = !0, G(), l(a));
|
|
571
|
+
}, Z = (a) => {
|
|
719
572
|
if (h) return;
|
|
720
573
|
h = !0;
|
|
721
|
-
const m =
|
|
722
|
-
|
|
574
|
+
const m = Y(a);
|
|
575
|
+
G(), this.emit("error", m), u(m);
|
|
723
576
|
}, b = {};
|
|
724
|
-
b.progress = (
|
|
725
|
-
this.emit("progress",
|
|
726
|
-
}, b.found = async (
|
|
577
|
+
b.progress = (a) => {
|
|
578
|
+
this.emit("progress", a);
|
|
579
|
+
}, b.found = async (a) => {
|
|
727
580
|
try {
|
|
728
581
|
const m = await this.builder.buildPsbt({
|
|
729
582
|
inputs: t.inputs,
|
|
730
583
|
outputs: t.outputs,
|
|
731
|
-
nonce:
|
|
732
|
-
distribution:
|
|
733
|
-
}),
|
|
734
|
-
this.emit("found",
|
|
584
|
+
nonce: a.nonce,
|
|
585
|
+
distribution: g
|
|
586
|
+
}), V = { ...a, psbt: m };
|
|
587
|
+
this.emit("found", V), J(V);
|
|
735
588
|
} catch (m) {
|
|
736
589
|
Z(m);
|
|
737
590
|
}
|
|
738
|
-
}, b.error = (
|
|
739
|
-
Z(
|
|
591
|
+
}, b.error = (a) => {
|
|
592
|
+
Z(a);
|
|
740
593
|
}, b.stopped = () => {
|
|
741
594
|
if (h) return;
|
|
742
|
-
const
|
|
743
|
-
|
|
595
|
+
const a = this.stopRequested ? i(
|
|
596
|
+
I.MINING_ABORTED,
|
|
744
597
|
"Mining stopped by caller"
|
|
745
|
-
) :
|
|
746
|
-
|
|
598
|
+
) : i(
|
|
599
|
+
I.MINING_ABORTED,
|
|
747
600
|
"Mining halted"
|
|
748
601
|
);
|
|
749
|
-
this.emit("stopped", void 0), Z(
|
|
750
|
-
},
|
|
602
|
+
this.emit("stopped", void 0), Z(a);
|
|
603
|
+
}, A.on("progress", b.progress), A.on("found", b.found), A.on("error", b.error), A.on("stopped", b.stopped), A.start({
|
|
751
604
|
inputs: t.inputs,
|
|
752
605
|
outputs: t.outputs,
|
|
753
|
-
network:
|
|
606
|
+
network: d,
|
|
754
607
|
satsPerVbyte: this.options.satsPerVbyte,
|
|
755
|
-
template:
|
|
608
|
+
template: c,
|
|
756
609
|
targetZeros: t.targetZeros,
|
|
757
610
|
startNonce: e,
|
|
758
611
|
signal: t.signal,
|
|
759
|
-
distribution:
|
|
612
|
+
distribution: g
|
|
760
613
|
}).catch(Z);
|
|
761
614
|
});
|
|
762
615
|
}
|
|
@@ -771,12 +624,12 @@ class rt {
|
|
|
771
624
|
}
|
|
772
625
|
}
|
|
773
626
|
export {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
627
|
+
T as MiningCoordinator,
|
|
628
|
+
O as TransactionBuilder,
|
|
629
|
+
E as ZeldMiner,
|
|
630
|
+
N as ZeldMinerError,
|
|
631
|
+
I as ZeldMinerErrorCode,
|
|
632
|
+
i as createMinerError,
|
|
633
|
+
Y as toZeldMinerError
|
|
781
634
|
};
|
|
782
635
|
//# sourceMappingURL=index.js.map
|