@latticexyz/cli 2.0.0-alpha.38 → 2.0.0-alpha.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/chunk-6V563IAZ.js +283 -0
- package/dist/{chunk-ATAWDHWC.js → chunk-FPG73MVN.js} +5 -1
- package/dist/chunk-KJTPZOUH.js +3864 -0
- package/dist/{chunk-O6HOO6WA.js → chunk-L4YLJHLJ.js} +1 -9
- package/dist/{chunk-KPBNUPK6.js → chunk-SKNB74MT.js} +155 -159
- package/dist/chunk-VQTZJIFF.js +353 -0
- package/dist/{chunk-MXDV47JM.js → chunk-WZFXLDPK.js} +75 -24
- package/dist/chunk-YL4GJLLL.js +26139 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.js +0 -22
- package/dist/mud.d.ts +1 -1
- package/dist/mud.js +319 -3972
- package/dist/mud2.d.ts +1 -0
- package/dist/mud2.js +25 -0
- package/dist/render-solidity/index.d.ts +3 -3
- package/dist/render-solidity/index.js +3 -4
- package/dist/render-ts/index.d.ts +2 -3
- package/dist/render-ts/index.js +3 -4
- package/dist/utils/deprecated/index.js +3 -3
- package/dist/utils/index.d.ts +9 -19
- package/dist/utils/index.js +7 -18
- package/package.json +19 -20
- package/src/commands/deploy-v2.ts +80 -64
- package/src/commands/deprecated/index.ts +22 -0
- package/src/commands/deprecated/test.ts +1 -1
- package/src/commands/gas-report.ts +54 -55
- package/src/commands/index.ts +2 -17
- package/src/commands/set-version.ts +39 -10
- package/src/commands/tablegen.ts +5 -5
- package/src/commands/test-v2.ts +71 -0
- package/src/commands/tsgen.ts +1 -1
- package/src/commands/worldgen.ts +5 -4
- package/src/contracts/BulkUpload.sol +13 -20
- package/src/contracts/Deploy.sol +3 -3
- package/src/contracts/LibDeploy.sol +1 -1
- package/src/contracts/LibDeployStub.sol +1 -1
- package/src/index.ts +1 -15
- package/src/mud.ts +4 -3
- package/src/mud2.ts +29 -0
- package/src/render-solidity/common.ts +4 -4
- package/src/render-solidity/field.ts +25 -2
- package/src/render-solidity/record.ts +14 -10
- package/src/render-solidity/renderSystemInterface.ts +4 -4
- package/src/render-solidity/renderTableIndex.ts +15 -0
- package/src/render-solidity/renderTypesFromConfig.ts +1 -1
- package/src/render-solidity/tableOptions.ts +2 -2
- package/src/render-solidity/tablegen.ts +13 -1
- package/src/render-solidity/types.ts +2 -1
- package/src/render-solidity/userType.ts +1 -2
- package/src/render-solidity/worldgen.ts +5 -6
- package/src/render-ts/recsV1TableOptions.ts +2 -2
- package/src/render-ts/renderRecsV1Tables.ts +2 -2
- package/src/render-ts/schemaTypesToRecsTypeStrings.ts +136 -136
- package/src/render-ts/tsgen.ts +1 -1
- package/src/render-ts/types.ts +1 -1
- package/src/utils/contractToInterface.ts +5 -3
- package/src/utils/deploy-v2.ts +90 -84
- package/src/utils/errors.ts +3 -34
- package/src/utils/foundry.ts +9 -0
- package/dist/chunk-3FLNCDSC.js +0 -22908
- package/dist/chunk-5NC2OON2.js +0 -164
- package/dist/chunk-7GA2K5A6.js +0 -283
- package/dist/chunk-SLIMIO4Z.js +0 -14358
- package/dist/chunk-UN37BCLQ.js +0 -453
- package/dist/config/index.d.ts +0 -400
- package/dist/config/index.js +0 -85
- package/dist/parseStoreConfig-899f574e.d.ts +0 -369
- package/src/config/commonSchemas.ts +0 -34
- package/src/config/dynamicResolution.ts +0 -49
- package/src/config/index.ts +0 -24
- package/src/config/loadConfig.ts +0 -39
- package/src/config/loadStoreConfig.ts +0 -18
- package/src/config/parseStoreConfig.test-d.ts +0 -40
- package/src/config/parseStoreConfig.ts +0 -314
- package/src/config/validation.ts +0 -163
- package/src/config/world/index.ts +0 -4
- package/src/config/world/loadWorldConfig.test-d.ts +0 -11
- package/src/config/world/loadWorldConfig.ts +0 -26
- package/src/config/world/parseWorldConfig.ts +0 -55
- package/src/config/world/resolveWorldConfig.ts +0 -80
- package/src/config/world/userTypes.ts +0 -72
- package/src/utils/typeUtils.ts +0 -17
|
@@ -0,0 +1,3864 @@
|
|
|
1
|
+
import {
|
|
2
|
+
deploy,
|
|
3
|
+
logError
|
|
4
|
+
} from "./chunk-YL4GJLLL.js";
|
|
5
|
+
import {
|
|
6
|
+
execLog
|
|
7
|
+
} from "./chunk-VQTZJIFF.js";
|
|
8
|
+
import {
|
|
9
|
+
anvil,
|
|
10
|
+
forge,
|
|
11
|
+
getRpcUrl,
|
|
12
|
+
getSrcDirectory
|
|
13
|
+
} from "./chunk-FPG73MVN.js";
|
|
14
|
+
import {
|
|
15
|
+
renderArguments,
|
|
16
|
+
renderImports,
|
|
17
|
+
renderList,
|
|
18
|
+
renderedSolidityHeader,
|
|
19
|
+
tablegen
|
|
20
|
+
} from "./chunk-WZFXLDPK.js";
|
|
21
|
+
import {
|
|
22
|
+
tsgen
|
|
23
|
+
} from "./chunk-6V563IAZ.js";
|
|
24
|
+
import {
|
|
25
|
+
formatAndWriteSolidity
|
|
26
|
+
} from "./chunk-SKNB74MT.js";
|
|
27
|
+
import {
|
|
28
|
+
__commonJS,
|
|
29
|
+
__toESM
|
|
30
|
+
} from "./chunk-L4YLJHLJ.js";
|
|
31
|
+
|
|
32
|
+
// ../../node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js
|
|
33
|
+
var require_aspromise = __commonJS({
|
|
34
|
+
"../../node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js"(exports2, module2) {
|
|
35
|
+
"use strict";
|
|
36
|
+
module2.exports = asPromise;
|
|
37
|
+
function asPromise(fn, ctx) {
|
|
38
|
+
var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true;
|
|
39
|
+
while (index < arguments.length)
|
|
40
|
+
params[offset++] = arguments[index++];
|
|
41
|
+
return new Promise(function executor(resolve, reject) {
|
|
42
|
+
params[offset] = function callback(err) {
|
|
43
|
+
if (pending) {
|
|
44
|
+
pending = false;
|
|
45
|
+
if (err)
|
|
46
|
+
reject(err);
|
|
47
|
+
else {
|
|
48
|
+
var params2 = new Array(arguments.length - 1), offset2 = 0;
|
|
49
|
+
while (offset2 < params2.length)
|
|
50
|
+
params2[offset2++] = arguments[offset2];
|
|
51
|
+
resolve.apply(null, params2);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
try {
|
|
56
|
+
fn.apply(ctx || null, params);
|
|
57
|
+
} catch (err) {
|
|
58
|
+
if (pending) {
|
|
59
|
+
pending = false;
|
|
60
|
+
reject(err);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// ../../node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js
|
|
69
|
+
var require_base64 = __commonJS({
|
|
70
|
+
"../../node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js"(exports2) {
|
|
71
|
+
"use strict";
|
|
72
|
+
var base64 = exports2;
|
|
73
|
+
base64.length = function length(string) {
|
|
74
|
+
var p = string.length;
|
|
75
|
+
if (!p)
|
|
76
|
+
return 0;
|
|
77
|
+
var n = 0;
|
|
78
|
+
while (--p % 4 > 1 && string.charAt(p) === "=")
|
|
79
|
+
++n;
|
|
80
|
+
return Math.ceil(string.length * 3) / 4 - n;
|
|
81
|
+
};
|
|
82
|
+
var b64 = new Array(64);
|
|
83
|
+
var s64 = new Array(123);
|
|
84
|
+
for (i = 0; i < 64; )
|
|
85
|
+
s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;
|
|
86
|
+
var i;
|
|
87
|
+
base64.encode = function encode(buffer, start, end) {
|
|
88
|
+
var parts = null, chunk = [];
|
|
89
|
+
var i2 = 0, j = 0, t;
|
|
90
|
+
while (start < end) {
|
|
91
|
+
var b = buffer[start++];
|
|
92
|
+
switch (j) {
|
|
93
|
+
case 0:
|
|
94
|
+
chunk[i2++] = b64[b >> 2];
|
|
95
|
+
t = (b & 3) << 4;
|
|
96
|
+
j = 1;
|
|
97
|
+
break;
|
|
98
|
+
case 1:
|
|
99
|
+
chunk[i2++] = b64[t | b >> 4];
|
|
100
|
+
t = (b & 15) << 2;
|
|
101
|
+
j = 2;
|
|
102
|
+
break;
|
|
103
|
+
case 2:
|
|
104
|
+
chunk[i2++] = b64[t | b >> 6];
|
|
105
|
+
chunk[i2++] = b64[b & 63];
|
|
106
|
+
j = 0;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
if (i2 > 8191) {
|
|
110
|
+
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
111
|
+
i2 = 0;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (j) {
|
|
115
|
+
chunk[i2++] = b64[t];
|
|
116
|
+
chunk[i2++] = 61;
|
|
117
|
+
if (j === 1)
|
|
118
|
+
chunk[i2++] = 61;
|
|
119
|
+
}
|
|
120
|
+
if (parts) {
|
|
121
|
+
if (i2)
|
|
122
|
+
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i2)));
|
|
123
|
+
return parts.join("");
|
|
124
|
+
}
|
|
125
|
+
return String.fromCharCode.apply(String, chunk.slice(0, i2));
|
|
126
|
+
};
|
|
127
|
+
var invalidEncoding = "invalid encoding";
|
|
128
|
+
base64.decode = function decode(string, buffer, offset) {
|
|
129
|
+
var start = offset;
|
|
130
|
+
var j = 0, t;
|
|
131
|
+
for (var i2 = 0; i2 < string.length; ) {
|
|
132
|
+
var c = string.charCodeAt(i2++);
|
|
133
|
+
if (c === 61 && j > 1)
|
|
134
|
+
break;
|
|
135
|
+
if ((c = s64[c]) === void 0)
|
|
136
|
+
throw Error(invalidEncoding);
|
|
137
|
+
switch (j) {
|
|
138
|
+
case 0:
|
|
139
|
+
t = c;
|
|
140
|
+
j = 1;
|
|
141
|
+
break;
|
|
142
|
+
case 1:
|
|
143
|
+
buffer[offset++] = t << 2 | (c & 48) >> 4;
|
|
144
|
+
t = c;
|
|
145
|
+
j = 2;
|
|
146
|
+
break;
|
|
147
|
+
case 2:
|
|
148
|
+
buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;
|
|
149
|
+
t = c;
|
|
150
|
+
j = 3;
|
|
151
|
+
break;
|
|
152
|
+
case 3:
|
|
153
|
+
buffer[offset++] = (t & 3) << 6 | c;
|
|
154
|
+
j = 0;
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (j === 1)
|
|
159
|
+
throw Error(invalidEncoding);
|
|
160
|
+
return offset - start;
|
|
161
|
+
};
|
|
162
|
+
base64.test = function test(string) {
|
|
163
|
+
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
// ../../node_modules/.pnpm/@protobufjs+eventemitter@1.1.0/node_modules/@protobufjs/eventemitter/index.js
|
|
169
|
+
var require_eventemitter = __commonJS({
|
|
170
|
+
"../../node_modules/.pnpm/@protobufjs+eventemitter@1.1.0/node_modules/@protobufjs/eventemitter/index.js"(exports2, module2) {
|
|
171
|
+
"use strict";
|
|
172
|
+
module2.exports = EventEmitter;
|
|
173
|
+
function EventEmitter() {
|
|
174
|
+
this._listeners = {};
|
|
175
|
+
}
|
|
176
|
+
EventEmitter.prototype.on = function on(evt, fn, ctx) {
|
|
177
|
+
(this._listeners[evt] || (this._listeners[evt] = [])).push({
|
|
178
|
+
fn,
|
|
179
|
+
ctx: ctx || this
|
|
180
|
+
});
|
|
181
|
+
return this;
|
|
182
|
+
};
|
|
183
|
+
EventEmitter.prototype.off = function off(evt, fn) {
|
|
184
|
+
if (evt === void 0)
|
|
185
|
+
this._listeners = {};
|
|
186
|
+
else {
|
|
187
|
+
if (fn === void 0)
|
|
188
|
+
this._listeners[evt] = [];
|
|
189
|
+
else {
|
|
190
|
+
var listeners = this._listeners[evt];
|
|
191
|
+
for (var i = 0; i < listeners.length; )
|
|
192
|
+
if (listeners[i].fn === fn)
|
|
193
|
+
listeners.splice(i, 1);
|
|
194
|
+
else
|
|
195
|
+
++i;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return this;
|
|
199
|
+
};
|
|
200
|
+
EventEmitter.prototype.emit = function emit(evt) {
|
|
201
|
+
var listeners = this._listeners[evt];
|
|
202
|
+
if (listeners) {
|
|
203
|
+
var args = [], i = 1;
|
|
204
|
+
for (; i < arguments.length; )
|
|
205
|
+
args.push(arguments[i++]);
|
|
206
|
+
for (i = 0; i < listeners.length; )
|
|
207
|
+
listeners[i].fn.apply(listeners[i++].ctx, args);
|
|
208
|
+
}
|
|
209
|
+
return this;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
// ../../node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js
|
|
215
|
+
var require_float = __commonJS({
|
|
216
|
+
"../../node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js"(exports2, module2) {
|
|
217
|
+
"use strict";
|
|
218
|
+
module2.exports = factory(factory);
|
|
219
|
+
function factory(exports3) {
|
|
220
|
+
if (typeof Float32Array !== "undefined")
|
|
221
|
+
(function() {
|
|
222
|
+
var f32 = new Float32Array([-0]), f8b = new Uint8Array(f32.buffer), le = f8b[3] === 128;
|
|
223
|
+
function writeFloat_f32_cpy(val, buf, pos) {
|
|
224
|
+
f32[0] = val;
|
|
225
|
+
buf[pos] = f8b[0];
|
|
226
|
+
buf[pos + 1] = f8b[1];
|
|
227
|
+
buf[pos + 2] = f8b[2];
|
|
228
|
+
buf[pos + 3] = f8b[3];
|
|
229
|
+
}
|
|
230
|
+
function writeFloat_f32_rev(val, buf, pos) {
|
|
231
|
+
f32[0] = val;
|
|
232
|
+
buf[pos] = f8b[3];
|
|
233
|
+
buf[pos + 1] = f8b[2];
|
|
234
|
+
buf[pos + 2] = f8b[1];
|
|
235
|
+
buf[pos + 3] = f8b[0];
|
|
236
|
+
}
|
|
237
|
+
exports3.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;
|
|
238
|
+
exports3.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;
|
|
239
|
+
function readFloat_f32_cpy(buf, pos) {
|
|
240
|
+
f8b[0] = buf[pos];
|
|
241
|
+
f8b[1] = buf[pos + 1];
|
|
242
|
+
f8b[2] = buf[pos + 2];
|
|
243
|
+
f8b[3] = buf[pos + 3];
|
|
244
|
+
return f32[0];
|
|
245
|
+
}
|
|
246
|
+
function readFloat_f32_rev(buf, pos) {
|
|
247
|
+
f8b[3] = buf[pos];
|
|
248
|
+
f8b[2] = buf[pos + 1];
|
|
249
|
+
f8b[1] = buf[pos + 2];
|
|
250
|
+
f8b[0] = buf[pos + 3];
|
|
251
|
+
return f32[0];
|
|
252
|
+
}
|
|
253
|
+
exports3.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;
|
|
254
|
+
exports3.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;
|
|
255
|
+
})();
|
|
256
|
+
else
|
|
257
|
+
(function() {
|
|
258
|
+
function writeFloat_ieee754(writeUint, val, buf, pos) {
|
|
259
|
+
var sign = val < 0 ? 1 : 0;
|
|
260
|
+
if (sign)
|
|
261
|
+
val = -val;
|
|
262
|
+
if (val === 0)
|
|
263
|
+
writeUint(1 / val > 0 ? (
|
|
264
|
+
/* positive */
|
|
265
|
+
0
|
|
266
|
+
) : (
|
|
267
|
+
/* negative 0 */
|
|
268
|
+
2147483648
|
|
269
|
+
), buf, pos);
|
|
270
|
+
else if (isNaN(val))
|
|
271
|
+
writeUint(2143289344, buf, pos);
|
|
272
|
+
else if (val > 34028234663852886e22)
|
|
273
|
+
writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);
|
|
274
|
+
else if (val < 11754943508222875e-54)
|
|
275
|
+
writeUint((sign << 31 | Math.round(val / 1401298464324817e-60)) >>> 0, buf, pos);
|
|
276
|
+
else {
|
|
277
|
+
var exponent = Math.floor(Math.log(val) / Math.LN2), mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;
|
|
278
|
+
writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
exports3.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);
|
|
282
|
+
exports3.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);
|
|
283
|
+
function readFloat_ieee754(readUint, buf, pos) {
|
|
284
|
+
var uint = readUint(buf, pos), sign = (uint >> 31) * 2 + 1, exponent = uint >>> 23 & 255, mantissa = uint & 8388607;
|
|
285
|
+
return exponent === 255 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 1401298464324817e-60 * mantissa : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);
|
|
286
|
+
}
|
|
287
|
+
exports3.readFloatLE = readFloat_ieee754.bind(null, readUintLE);
|
|
288
|
+
exports3.readFloatBE = readFloat_ieee754.bind(null, readUintBE);
|
|
289
|
+
})();
|
|
290
|
+
if (typeof Float64Array !== "undefined")
|
|
291
|
+
(function() {
|
|
292
|
+
var f64 = new Float64Array([-0]), f8b = new Uint8Array(f64.buffer), le = f8b[7] === 128;
|
|
293
|
+
function writeDouble_f64_cpy(val, buf, pos) {
|
|
294
|
+
f64[0] = val;
|
|
295
|
+
buf[pos] = f8b[0];
|
|
296
|
+
buf[pos + 1] = f8b[1];
|
|
297
|
+
buf[pos + 2] = f8b[2];
|
|
298
|
+
buf[pos + 3] = f8b[3];
|
|
299
|
+
buf[pos + 4] = f8b[4];
|
|
300
|
+
buf[pos + 5] = f8b[5];
|
|
301
|
+
buf[pos + 6] = f8b[6];
|
|
302
|
+
buf[pos + 7] = f8b[7];
|
|
303
|
+
}
|
|
304
|
+
function writeDouble_f64_rev(val, buf, pos) {
|
|
305
|
+
f64[0] = val;
|
|
306
|
+
buf[pos] = f8b[7];
|
|
307
|
+
buf[pos + 1] = f8b[6];
|
|
308
|
+
buf[pos + 2] = f8b[5];
|
|
309
|
+
buf[pos + 3] = f8b[4];
|
|
310
|
+
buf[pos + 4] = f8b[3];
|
|
311
|
+
buf[pos + 5] = f8b[2];
|
|
312
|
+
buf[pos + 6] = f8b[1];
|
|
313
|
+
buf[pos + 7] = f8b[0];
|
|
314
|
+
}
|
|
315
|
+
exports3.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;
|
|
316
|
+
exports3.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;
|
|
317
|
+
function readDouble_f64_cpy(buf, pos) {
|
|
318
|
+
f8b[0] = buf[pos];
|
|
319
|
+
f8b[1] = buf[pos + 1];
|
|
320
|
+
f8b[2] = buf[pos + 2];
|
|
321
|
+
f8b[3] = buf[pos + 3];
|
|
322
|
+
f8b[4] = buf[pos + 4];
|
|
323
|
+
f8b[5] = buf[pos + 5];
|
|
324
|
+
f8b[6] = buf[pos + 6];
|
|
325
|
+
f8b[7] = buf[pos + 7];
|
|
326
|
+
return f64[0];
|
|
327
|
+
}
|
|
328
|
+
function readDouble_f64_rev(buf, pos) {
|
|
329
|
+
f8b[7] = buf[pos];
|
|
330
|
+
f8b[6] = buf[pos + 1];
|
|
331
|
+
f8b[5] = buf[pos + 2];
|
|
332
|
+
f8b[4] = buf[pos + 3];
|
|
333
|
+
f8b[3] = buf[pos + 4];
|
|
334
|
+
f8b[2] = buf[pos + 5];
|
|
335
|
+
f8b[1] = buf[pos + 6];
|
|
336
|
+
f8b[0] = buf[pos + 7];
|
|
337
|
+
return f64[0];
|
|
338
|
+
}
|
|
339
|
+
exports3.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;
|
|
340
|
+
exports3.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;
|
|
341
|
+
})();
|
|
342
|
+
else
|
|
343
|
+
(function() {
|
|
344
|
+
function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {
|
|
345
|
+
var sign = val < 0 ? 1 : 0;
|
|
346
|
+
if (sign)
|
|
347
|
+
val = -val;
|
|
348
|
+
if (val === 0) {
|
|
349
|
+
writeUint(0, buf, pos + off0);
|
|
350
|
+
writeUint(1 / val > 0 ? (
|
|
351
|
+
/* positive */
|
|
352
|
+
0
|
|
353
|
+
) : (
|
|
354
|
+
/* negative 0 */
|
|
355
|
+
2147483648
|
|
356
|
+
), buf, pos + off1);
|
|
357
|
+
} else if (isNaN(val)) {
|
|
358
|
+
writeUint(0, buf, pos + off0);
|
|
359
|
+
writeUint(2146959360, buf, pos + off1);
|
|
360
|
+
} else if (val > 17976931348623157e292) {
|
|
361
|
+
writeUint(0, buf, pos + off0);
|
|
362
|
+
writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);
|
|
363
|
+
} else {
|
|
364
|
+
var mantissa;
|
|
365
|
+
if (val < 22250738585072014e-324) {
|
|
366
|
+
mantissa = val / 5e-324;
|
|
367
|
+
writeUint(mantissa >>> 0, buf, pos + off0);
|
|
368
|
+
writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);
|
|
369
|
+
} else {
|
|
370
|
+
var exponent = Math.floor(Math.log(val) / Math.LN2);
|
|
371
|
+
if (exponent === 1024)
|
|
372
|
+
exponent = 1023;
|
|
373
|
+
mantissa = val * Math.pow(2, -exponent);
|
|
374
|
+
writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);
|
|
375
|
+
writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
exports3.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);
|
|
380
|
+
exports3.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);
|
|
381
|
+
function readDouble_ieee754(readUint, off0, off1, buf, pos) {
|
|
382
|
+
var lo = readUint(buf, pos + off0), hi = readUint(buf, pos + off1);
|
|
383
|
+
var sign = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo;
|
|
384
|
+
return exponent === 2047 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 5e-324 * mantissa : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);
|
|
385
|
+
}
|
|
386
|
+
exports3.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);
|
|
387
|
+
exports3.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);
|
|
388
|
+
})();
|
|
389
|
+
return exports3;
|
|
390
|
+
}
|
|
391
|
+
function writeUintLE(val, buf, pos) {
|
|
392
|
+
buf[pos] = val & 255;
|
|
393
|
+
buf[pos + 1] = val >>> 8 & 255;
|
|
394
|
+
buf[pos + 2] = val >>> 16 & 255;
|
|
395
|
+
buf[pos + 3] = val >>> 24;
|
|
396
|
+
}
|
|
397
|
+
function writeUintBE(val, buf, pos) {
|
|
398
|
+
buf[pos] = val >>> 24;
|
|
399
|
+
buf[pos + 1] = val >>> 16 & 255;
|
|
400
|
+
buf[pos + 2] = val >>> 8 & 255;
|
|
401
|
+
buf[pos + 3] = val & 255;
|
|
402
|
+
}
|
|
403
|
+
function readUintLE(buf, pos) {
|
|
404
|
+
return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16 | buf[pos + 3] << 24) >>> 0;
|
|
405
|
+
}
|
|
406
|
+
function readUintBE(buf, pos) {
|
|
407
|
+
return (buf[pos] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
// ../../node_modules/.pnpm/@protobufjs+inquire@1.1.0/node_modules/@protobufjs/inquire/index.js
|
|
413
|
+
var require_inquire = __commonJS({
|
|
414
|
+
"../../node_modules/.pnpm/@protobufjs+inquire@1.1.0/node_modules/@protobufjs/inquire/index.js"(exports, module) {
|
|
415
|
+
"use strict";
|
|
416
|
+
module.exports = inquire;
|
|
417
|
+
function inquire(moduleName) {
|
|
418
|
+
try {
|
|
419
|
+
var mod = eval("quire".replace(/^/, "re"))(moduleName);
|
|
420
|
+
if (mod && (mod.length || Object.keys(mod).length))
|
|
421
|
+
return mod;
|
|
422
|
+
} catch (e) {
|
|
423
|
+
}
|
|
424
|
+
return null;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
// ../../node_modules/.pnpm/@protobufjs+utf8@1.1.0/node_modules/@protobufjs/utf8/index.js
|
|
430
|
+
var require_utf8 = __commonJS({
|
|
431
|
+
"../../node_modules/.pnpm/@protobufjs+utf8@1.1.0/node_modules/@protobufjs/utf8/index.js"(exports2) {
|
|
432
|
+
"use strict";
|
|
433
|
+
var utf8 = exports2;
|
|
434
|
+
utf8.length = function utf8_length(string) {
|
|
435
|
+
var len = 0, c = 0;
|
|
436
|
+
for (var i = 0; i < string.length; ++i) {
|
|
437
|
+
c = string.charCodeAt(i);
|
|
438
|
+
if (c < 128)
|
|
439
|
+
len += 1;
|
|
440
|
+
else if (c < 2048)
|
|
441
|
+
len += 2;
|
|
442
|
+
else if ((c & 64512) === 55296 && (string.charCodeAt(i + 1) & 64512) === 56320) {
|
|
443
|
+
++i;
|
|
444
|
+
len += 4;
|
|
445
|
+
} else
|
|
446
|
+
len += 3;
|
|
447
|
+
}
|
|
448
|
+
return len;
|
|
449
|
+
};
|
|
450
|
+
utf8.read = function utf8_read(buffer, start, end) {
|
|
451
|
+
var len = end - start;
|
|
452
|
+
if (len < 1)
|
|
453
|
+
return "";
|
|
454
|
+
var parts = null, chunk = [], i = 0, t;
|
|
455
|
+
while (start < end) {
|
|
456
|
+
t = buffer[start++];
|
|
457
|
+
if (t < 128)
|
|
458
|
+
chunk[i++] = t;
|
|
459
|
+
else if (t > 191 && t < 224)
|
|
460
|
+
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
461
|
+
else if (t > 239 && t < 365) {
|
|
462
|
+
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 65536;
|
|
463
|
+
chunk[i++] = 55296 + (t >> 10);
|
|
464
|
+
chunk[i++] = 56320 + (t & 1023);
|
|
465
|
+
} else
|
|
466
|
+
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
467
|
+
if (i > 8191) {
|
|
468
|
+
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
469
|
+
i = 0;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
if (parts) {
|
|
473
|
+
if (i)
|
|
474
|
+
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
|
475
|
+
return parts.join("");
|
|
476
|
+
}
|
|
477
|
+
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
|
478
|
+
};
|
|
479
|
+
utf8.write = function utf8_write(string, buffer, offset) {
|
|
480
|
+
var start = offset, c1, c2;
|
|
481
|
+
for (var i = 0; i < string.length; ++i) {
|
|
482
|
+
c1 = string.charCodeAt(i);
|
|
483
|
+
if (c1 < 128) {
|
|
484
|
+
buffer[offset++] = c1;
|
|
485
|
+
} else if (c1 < 2048) {
|
|
486
|
+
buffer[offset++] = c1 >> 6 | 192;
|
|
487
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
488
|
+
} else if ((c1 & 64512) === 55296 && ((c2 = string.charCodeAt(i + 1)) & 64512) === 56320) {
|
|
489
|
+
c1 = 65536 + ((c1 & 1023) << 10) + (c2 & 1023);
|
|
490
|
+
++i;
|
|
491
|
+
buffer[offset++] = c1 >> 18 | 240;
|
|
492
|
+
buffer[offset++] = c1 >> 12 & 63 | 128;
|
|
493
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
494
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
495
|
+
} else {
|
|
496
|
+
buffer[offset++] = c1 >> 12 | 224;
|
|
497
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
498
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
return offset - start;
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
// ../../node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js
|
|
507
|
+
var require_pool = __commonJS({
|
|
508
|
+
"../../node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js"(exports2, module2) {
|
|
509
|
+
"use strict";
|
|
510
|
+
module2.exports = pool;
|
|
511
|
+
function pool(alloc, slice, size) {
|
|
512
|
+
var SIZE = size || 8192;
|
|
513
|
+
var MAX = SIZE >>> 1;
|
|
514
|
+
var slab = null;
|
|
515
|
+
var offset = SIZE;
|
|
516
|
+
return function pool_alloc(size2) {
|
|
517
|
+
if (size2 < 1 || size2 > MAX)
|
|
518
|
+
return alloc(size2);
|
|
519
|
+
if (offset + size2 > SIZE) {
|
|
520
|
+
slab = alloc(SIZE);
|
|
521
|
+
offset = 0;
|
|
522
|
+
}
|
|
523
|
+
var buf = slice.call(slab, offset, offset += size2);
|
|
524
|
+
if (offset & 7)
|
|
525
|
+
offset = (offset | 7) + 1;
|
|
526
|
+
return buf;
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/util/longbits.js
|
|
533
|
+
var require_longbits = __commonJS({
|
|
534
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/util/longbits.js"(exports2, module2) {
|
|
535
|
+
"use strict";
|
|
536
|
+
module2.exports = LongBits;
|
|
537
|
+
var util = require_minimal();
|
|
538
|
+
function LongBits(lo, hi) {
|
|
539
|
+
this.lo = lo >>> 0;
|
|
540
|
+
this.hi = hi >>> 0;
|
|
541
|
+
}
|
|
542
|
+
var zero = LongBits.zero = new LongBits(0, 0);
|
|
543
|
+
zero.toNumber = function() {
|
|
544
|
+
return 0;
|
|
545
|
+
};
|
|
546
|
+
zero.zzEncode = zero.zzDecode = function() {
|
|
547
|
+
return this;
|
|
548
|
+
};
|
|
549
|
+
zero.length = function() {
|
|
550
|
+
return 1;
|
|
551
|
+
};
|
|
552
|
+
var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0";
|
|
553
|
+
LongBits.fromNumber = function fromNumber2(value) {
|
|
554
|
+
if (value === 0)
|
|
555
|
+
return zero;
|
|
556
|
+
var sign = value < 0;
|
|
557
|
+
if (sign)
|
|
558
|
+
value = -value;
|
|
559
|
+
var lo = value >>> 0, hi = (value - lo) / 4294967296 >>> 0;
|
|
560
|
+
if (sign) {
|
|
561
|
+
hi = ~hi >>> 0;
|
|
562
|
+
lo = ~lo >>> 0;
|
|
563
|
+
if (++lo > 4294967295) {
|
|
564
|
+
lo = 0;
|
|
565
|
+
if (++hi > 4294967295)
|
|
566
|
+
hi = 0;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
return new LongBits(lo, hi);
|
|
570
|
+
};
|
|
571
|
+
LongBits.from = function from(value) {
|
|
572
|
+
if (typeof value === "number")
|
|
573
|
+
return LongBits.fromNumber(value);
|
|
574
|
+
if (util.isString(value)) {
|
|
575
|
+
if (util.Long)
|
|
576
|
+
value = util.Long.fromString(value);
|
|
577
|
+
else
|
|
578
|
+
return LongBits.fromNumber(parseInt(value, 10));
|
|
579
|
+
}
|
|
580
|
+
return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;
|
|
581
|
+
};
|
|
582
|
+
LongBits.prototype.toNumber = function toNumber2(unsigned) {
|
|
583
|
+
if (!unsigned && this.hi >>> 31) {
|
|
584
|
+
var lo = ~this.lo + 1 >>> 0, hi = ~this.hi >>> 0;
|
|
585
|
+
if (!lo)
|
|
586
|
+
hi = hi + 1 >>> 0;
|
|
587
|
+
return -(lo + hi * 4294967296);
|
|
588
|
+
}
|
|
589
|
+
return this.lo + this.hi * 4294967296;
|
|
590
|
+
};
|
|
591
|
+
LongBits.prototype.toLong = function toLong(unsigned) {
|
|
592
|
+
return util.Long ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };
|
|
593
|
+
};
|
|
594
|
+
var charCodeAt = String.prototype.charCodeAt;
|
|
595
|
+
LongBits.fromHash = function fromHash(hash) {
|
|
596
|
+
if (hash === zeroHash)
|
|
597
|
+
return zero;
|
|
598
|
+
return new LongBits(
|
|
599
|
+
(charCodeAt.call(hash, 0) | charCodeAt.call(hash, 1) << 8 | charCodeAt.call(hash, 2) << 16 | charCodeAt.call(hash, 3) << 24) >>> 0,
|
|
600
|
+
(charCodeAt.call(hash, 4) | charCodeAt.call(hash, 5) << 8 | charCodeAt.call(hash, 6) << 16 | charCodeAt.call(hash, 7) << 24) >>> 0
|
|
601
|
+
);
|
|
602
|
+
};
|
|
603
|
+
LongBits.prototype.toHash = function toHash() {
|
|
604
|
+
return String.fromCharCode(
|
|
605
|
+
this.lo & 255,
|
|
606
|
+
this.lo >>> 8 & 255,
|
|
607
|
+
this.lo >>> 16 & 255,
|
|
608
|
+
this.lo >>> 24,
|
|
609
|
+
this.hi & 255,
|
|
610
|
+
this.hi >>> 8 & 255,
|
|
611
|
+
this.hi >>> 16 & 255,
|
|
612
|
+
this.hi >>> 24
|
|
613
|
+
);
|
|
614
|
+
};
|
|
615
|
+
LongBits.prototype.zzEncode = function zzEncode() {
|
|
616
|
+
var mask = this.hi >> 31;
|
|
617
|
+
this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;
|
|
618
|
+
this.lo = (this.lo << 1 ^ mask) >>> 0;
|
|
619
|
+
return this;
|
|
620
|
+
};
|
|
621
|
+
LongBits.prototype.zzDecode = function zzDecode() {
|
|
622
|
+
var mask = -(this.lo & 1);
|
|
623
|
+
this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;
|
|
624
|
+
this.hi = (this.hi >>> 1 ^ mask) >>> 0;
|
|
625
|
+
return this;
|
|
626
|
+
};
|
|
627
|
+
LongBits.prototype.length = function length() {
|
|
628
|
+
var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24;
|
|
629
|
+
return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10;
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
|
|
634
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/util/minimal.js
|
|
635
|
+
var require_minimal = __commonJS({
|
|
636
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/util/minimal.js"(exports2) {
|
|
637
|
+
"use strict";
|
|
638
|
+
var util = exports2;
|
|
639
|
+
util.asPromise = require_aspromise();
|
|
640
|
+
util.base64 = require_base64();
|
|
641
|
+
util.EventEmitter = require_eventemitter();
|
|
642
|
+
util.float = require_float();
|
|
643
|
+
util.inquire = require_inquire();
|
|
644
|
+
util.utf8 = require_utf8();
|
|
645
|
+
util.pool = require_pool();
|
|
646
|
+
util.LongBits = require_longbits();
|
|
647
|
+
util.isNode = Boolean(typeof global !== "undefined" && global && global.process && global.process.versions && global.process.versions.node);
|
|
648
|
+
util.global = util.isNode && global || typeof window !== "undefined" && window || typeof self !== "undefined" && self || exports2;
|
|
649
|
+
util.emptyArray = Object.freeze ? Object.freeze([]) : (
|
|
650
|
+
/* istanbul ignore next */
|
|
651
|
+
[]
|
|
652
|
+
);
|
|
653
|
+
util.emptyObject = Object.freeze ? Object.freeze({}) : (
|
|
654
|
+
/* istanbul ignore next */
|
|
655
|
+
{}
|
|
656
|
+
);
|
|
657
|
+
util.isInteger = Number.isInteger || /* istanbul ignore next */
|
|
658
|
+
function isInteger(value) {
|
|
659
|
+
return typeof value === "number" && isFinite(value) && Math.floor(value) === value;
|
|
660
|
+
};
|
|
661
|
+
util.isString = function isString(value) {
|
|
662
|
+
return typeof value === "string" || value instanceof String;
|
|
663
|
+
};
|
|
664
|
+
util.isObject = function isObject(value) {
|
|
665
|
+
return value && typeof value === "object";
|
|
666
|
+
};
|
|
667
|
+
util.isset = /**
|
|
668
|
+
* Checks if a property on a message is considered to be present.
|
|
669
|
+
* @param {Object} obj Plain object or message instance
|
|
670
|
+
* @param {string} prop Property name
|
|
671
|
+
* @returns {boolean} `true` if considered to be present, otherwise `false`
|
|
672
|
+
*/
|
|
673
|
+
util.isSet = function isSet(obj, prop) {
|
|
674
|
+
var value = obj[prop];
|
|
675
|
+
if (value != null && obj.hasOwnProperty(prop))
|
|
676
|
+
return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;
|
|
677
|
+
return false;
|
|
678
|
+
};
|
|
679
|
+
util.Buffer = function() {
|
|
680
|
+
try {
|
|
681
|
+
var Buffer = util.inquire("buffer").Buffer;
|
|
682
|
+
return Buffer.prototype.utf8Write ? Buffer : (
|
|
683
|
+
/* istanbul ignore next */
|
|
684
|
+
null
|
|
685
|
+
);
|
|
686
|
+
} catch (e) {
|
|
687
|
+
return null;
|
|
688
|
+
}
|
|
689
|
+
}();
|
|
690
|
+
util._Buffer_from = null;
|
|
691
|
+
util._Buffer_allocUnsafe = null;
|
|
692
|
+
util.newBuffer = function newBuffer(sizeOrArray) {
|
|
693
|
+
return typeof sizeOrArray === "number" ? util.Buffer ? util._Buffer_allocUnsafe(sizeOrArray) : new util.Array(sizeOrArray) : util.Buffer ? util._Buffer_from(sizeOrArray) : typeof Uint8Array === "undefined" ? sizeOrArray : new Uint8Array(sizeOrArray);
|
|
694
|
+
};
|
|
695
|
+
util.Array = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
|
|
696
|
+
util.Long = /* istanbul ignore next */
|
|
697
|
+
util.global.dcodeIO && /* istanbul ignore next */
|
|
698
|
+
util.global.dcodeIO.Long || /* istanbul ignore next */
|
|
699
|
+
util.global.Long || util.inquire("long");
|
|
700
|
+
util.key2Re = /^true|false|0|1$/;
|
|
701
|
+
util.key32Re = /^-?(?:0|[1-9][0-9]*)$/;
|
|
702
|
+
util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;
|
|
703
|
+
util.longToHash = function longToHash(value) {
|
|
704
|
+
return value ? util.LongBits.from(value).toHash() : util.LongBits.zeroHash;
|
|
705
|
+
};
|
|
706
|
+
util.longFromHash = function longFromHash(hash, unsigned) {
|
|
707
|
+
var bits = util.LongBits.fromHash(hash);
|
|
708
|
+
if (util.Long)
|
|
709
|
+
return util.Long.fromBits(bits.lo, bits.hi, unsigned);
|
|
710
|
+
return bits.toNumber(Boolean(unsigned));
|
|
711
|
+
};
|
|
712
|
+
function merge(dst, src, ifNotSet) {
|
|
713
|
+
for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)
|
|
714
|
+
if (dst[keys[i]] === void 0 || !ifNotSet)
|
|
715
|
+
dst[keys[i]] = src[keys[i]];
|
|
716
|
+
return dst;
|
|
717
|
+
}
|
|
718
|
+
util.merge = merge;
|
|
719
|
+
util.lcFirst = function lcFirst(str) {
|
|
720
|
+
return str.charAt(0).toLowerCase() + str.substring(1);
|
|
721
|
+
};
|
|
722
|
+
function newError(name) {
|
|
723
|
+
function CustomError(message, properties) {
|
|
724
|
+
if (!(this instanceof CustomError))
|
|
725
|
+
return new CustomError(message, properties);
|
|
726
|
+
Object.defineProperty(this, "message", { get: function() {
|
|
727
|
+
return message;
|
|
728
|
+
} });
|
|
729
|
+
if (Error.captureStackTrace)
|
|
730
|
+
Error.captureStackTrace(this, CustomError);
|
|
731
|
+
else
|
|
732
|
+
Object.defineProperty(this, "stack", { value: new Error().stack || "" });
|
|
733
|
+
if (properties)
|
|
734
|
+
merge(this, properties);
|
|
735
|
+
}
|
|
736
|
+
CustomError.prototype = Object.create(Error.prototype, {
|
|
737
|
+
constructor: {
|
|
738
|
+
value: CustomError,
|
|
739
|
+
writable: true,
|
|
740
|
+
enumerable: false,
|
|
741
|
+
configurable: true
|
|
742
|
+
},
|
|
743
|
+
name: {
|
|
744
|
+
get: function get() {
|
|
745
|
+
return name;
|
|
746
|
+
},
|
|
747
|
+
set: void 0,
|
|
748
|
+
enumerable: false,
|
|
749
|
+
// configurable: false would accurately preserve the behavior of
|
|
750
|
+
// the original, but I'm guessing that was not intentional.
|
|
751
|
+
// For an actual error subclass, this property would
|
|
752
|
+
// be configurable.
|
|
753
|
+
configurable: true
|
|
754
|
+
},
|
|
755
|
+
toString: {
|
|
756
|
+
value: function value() {
|
|
757
|
+
return this.name + ": " + this.message;
|
|
758
|
+
},
|
|
759
|
+
writable: true,
|
|
760
|
+
enumerable: false,
|
|
761
|
+
configurable: true
|
|
762
|
+
}
|
|
763
|
+
});
|
|
764
|
+
return CustomError;
|
|
765
|
+
}
|
|
766
|
+
util.newError = newError;
|
|
767
|
+
util.ProtocolError = newError("ProtocolError");
|
|
768
|
+
util.oneOfGetter = function getOneOf(fieldNames) {
|
|
769
|
+
var fieldMap = {};
|
|
770
|
+
for (var i = 0; i < fieldNames.length; ++i)
|
|
771
|
+
fieldMap[fieldNames[i]] = 1;
|
|
772
|
+
return function() {
|
|
773
|
+
for (var keys = Object.keys(this), i2 = keys.length - 1; i2 > -1; --i2)
|
|
774
|
+
if (fieldMap[keys[i2]] === 1 && this[keys[i2]] !== void 0 && this[keys[i2]] !== null)
|
|
775
|
+
return keys[i2];
|
|
776
|
+
};
|
|
777
|
+
};
|
|
778
|
+
util.oneOfSetter = function setOneOf(fieldNames) {
|
|
779
|
+
return function(name) {
|
|
780
|
+
for (var i = 0; i < fieldNames.length; ++i)
|
|
781
|
+
if (fieldNames[i] !== name)
|
|
782
|
+
delete this[fieldNames[i]];
|
|
783
|
+
};
|
|
784
|
+
};
|
|
785
|
+
util.toJSONOptions = {
|
|
786
|
+
longs: String,
|
|
787
|
+
enums: String,
|
|
788
|
+
bytes: String,
|
|
789
|
+
json: true
|
|
790
|
+
};
|
|
791
|
+
util._configure = function() {
|
|
792
|
+
var Buffer = util.Buffer;
|
|
793
|
+
if (!Buffer) {
|
|
794
|
+
util._Buffer_from = util._Buffer_allocUnsafe = null;
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || /* istanbul ignore next */
|
|
798
|
+
function Buffer_from(value, encoding) {
|
|
799
|
+
return new Buffer(value, encoding);
|
|
800
|
+
};
|
|
801
|
+
util._Buffer_allocUnsafe = Buffer.allocUnsafe || /* istanbul ignore next */
|
|
802
|
+
function Buffer_allocUnsafe(size) {
|
|
803
|
+
return new Buffer(size);
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
});
|
|
808
|
+
|
|
809
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/writer.js
|
|
810
|
+
var require_writer = __commonJS({
|
|
811
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/writer.js"(exports2, module2) {
|
|
812
|
+
"use strict";
|
|
813
|
+
module2.exports = Writer;
|
|
814
|
+
var util = require_minimal();
|
|
815
|
+
var BufferWriter;
|
|
816
|
+
var LongBits = util.LongBits;
|
|
817
|
+
var base64 = util.base64;
|
|
818
|
+
var utf8 = util.utf8;
|
|
819
|
+
function Op(fn, len, val) {
|
|
820
|
+
this.fn = fn;
|
|
821
|
+
this.len = len;
|
|
822
|
+
this.next = void 0;
|
|
823
|
+
this.val = val;
|
|
824
|
+
}
|
|
825
|
+
function noop() {
|
|
826
|
+
}
|
|
827
|
+
function State(writer) {
|
|
828
|
+
this.head = writer.head;
|
|
829
|
+
this.tail = writer.tail;
|
|
830
|
+
this.len = writer.len;
|
|
831
|
+
this.next = writer.states;
|
|
832
|
+
}
|
|
833
|
+
function Writer() {
|
|
834
|
+
this.len = 0;
|
|
835
|
+
this.head = new Op(noop, 0, 0);
|
|
836
|
+
this.tail = this.head;
|
|
837
|
+
this.states = null;
|
|
838
|
+
}
|
|
839
|
+
var create = function create2() {
|
|
840
|
+
return util.Buffer ? function create_buffer_setup() {
|
|
841
|
+
return (Writer.create = function create_buffer() {
|
|
842
|
+
return new BufferWriter();
|
|
843
|
+
})();
|
|
844
|
+
} : function create_array() {
|
|
845
|
+
return new Writer();
|
|
846
|
+
};
|
|
847
|
+
};
|
|
848
|
+
Writer.create = create();
|
|
849
|
+
Writer.alloc = function alloc(size) {
|
|
850
|
+
return new util.Array(size);
|
|
851
|
+
};
|
|
852
|
+
if (util.Array !== Array)
|
|
853
|
+
Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);
|
|
854
|
+
Writer.prototype._push = function push(fn, len, val) {
|
|
855
|
+
this.tail = this.tail.next = new Op(fn, len, val);
|
|
856
|
+
this.len += len;
|
|
857
|
+
return this;
|
|
858
|
+
};
|
|
859
|
+
function writeByte(val, buf, pos) {
|
|
860
|
+
buf[pos] = val & 255;
|
|
861
|
+
}
|
|
862
|
+
function writeVarint32(val, buf, pos) {
|
|
863
|
+
while (val > 127) {
|
|
864
|
+
buf[pos++] = val & 127 | 128;
|
|
865
|
+
val >>>= 7;
|
|
866
|
+
}
|
|
867
|
+
buf[pos] = val;
|
|
868
|
+
}
|
|
869
|
+
function VarintOp(len, val) {
|
|
870
|
+
this.len = len;
|
|
871
|
+
this.next = void 0;
|
|
872
|
+
this.val = val;
|
|
873
|
+
}
|
|
874
|
+
VarintOp.prototype = Object.create(Op.prototype);
|
|
875
|
+
VarintOp.prototype.fn = writeVarint32;
|
|
876
|
+
Writer.prototype.uint32 = function write_uint32(value) {
|
|
877
|
+
this.len += (this.tail = this.tail.next = new VarintOp(
|
|
878
|
+
(value = value >>> 0) < 128 ? 1 : value < 16384 ? 2 : value < 2097152 ? 3 : value < 268435456 ? 4 : 5,
|
|
879
|
+
value
|
|
880
|
+
)).len;
|
|
881
|
+
return this;
|
|
882
|
+
};
|
|
883
|
+
Writer.prototype.int32 = function write_int32(value) {
|
|
884
|
+
return value < 0 ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) : this.uint32(value);
|
|
885
|
+
};
|
|
886
|
+
Writer.prototype.sint32 = function write_sint32(value) {
|
|
887
|
+
return this.uint32((value << 1 ^ value >> 31) >>> 0);
|
|
888
|
+
};
|
|
889
|
+
function writeVarint64(val, buf, pos) {
|
|
890
|
+
while (val.hi) {
|
|
891
|
+
buf[pos++] = val.lo & 127 | 128;
|
|
892
|
+
val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;
|
|
893
|
+
val.hi >>>= 7;
|
|
894
|
+
}
|
|
895
|
+
while (val.lo > 127) {
|
|
896
|
+
buf[pos++] = val.lo & 127 | 128;
|
|
897
|
+
val.lo = val.lo >>> 7;
|
|
898
|
+
}
|
|
899
|
+
buf[pos++] = val.lo;
|
|
900
|
+
}
|
|
901
|
+
Writer.prototype.uint64 = function write_uint64(value) {
|
|
902
|
+
var bits = LongBits.from(value);
|
|
903
|
+
return this._push(writeVarint64, bits.length(), bits);
|
|
904
|
+
};
|
|
905
|
+
Writer.prototype.int64 = Writer.prototype.uint64;
|
|
906
|
+
Writer.prototype.sint64 = function write_sint64(value) {
|
|
907
|
+
var bits = LongBits.from(value).zzEncode();
|
|
908
|
+
return this._push(writeVarint64, bits.length(), bits);
|
|
909
|
+
};
|
|
910
|
+
Writer.prototype.bool = function write_bool(value) {
|
|
911
|
+
return this._push(writeByte, 1, value ? 1 : 0);
|
|
912
|
+
};
|
|
913
|
+
function writeFixed32(val, buf, pos) {
|
|
914
|
+
buf[pos] = val & 255;
|
|
915
|
+
buf[pos + 1] = val >>> 8 & 255;
|
|
916
|
+
buf[pos + 2] = val >>> 16 & 255;
|
|
917
|
+
buf[pos + 3] = val >>> 24;
|
|
918
|
+
}
|
|
919
|
+
Writer.prototype.fixed32 = function write_fixed32(value) {
|
|
920
|
+
return this._push(writeFixed32, 4, value >>> 0);
|
|
921
|
+
};
|
|
922
|
+
Writer.prototype.sfixed32 = Writer.prototype.fixed32;
|
|
923
|
+
Writer.prototype.fixed64 = function write_fixed64(value) {
|
|
924
|
+
var bits = LongBits.from(value);
|
|
925
|
+
return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);
|
|
926
|
+
};
|
|
927
|
+
Writer.prototype.sfixed64 = Writer.prototype.fixed64;
|
|
928
|
+
Writer.prototype.float = function write_float(value) {
|
|
929
|
+
return this._push(util.float.writeFloatLE, 4, value);
|
|
930
|
+
};
|
|
931
|
+
Writer.prototype.double = function write_double(value) {
|
|
932
|
+
return this._push(util.float.writeDoubleLE, 8, value);
|
|
933
|
+
};
|
|
934
|
+
var writeBytes = util.Array.prototype.set ? function writeBytes_set(val, buf, pos) {
|
|
935
|
+
buf.set(val, pos);
|
|
936
|
+
} : function writeBytes_for(val, buf, pos) {
|
|
937
|
+
for (var i = 0; i < val.length; ++i)
|
|
938
|
+
buf[pos + i] = val[i];
|
|
939
|
+
};
|
|
940
|
+
Writer.prototype.bytes = function write_bytes(value) {
|
|
941
|
+
var len = value.length >>> 0;
|
|
942
|
+
if (!len)
|
|
943
|
+
return this._push(writeByte, 1, 0);
|
|
944
|
+
if (util.isString(value)) {
|
|
945
|
+
var buf = Writer.alloc(len = base64.length(value));
|
|
946
|
+
base64.decode(value, buf, 0);
|
|
947
|
+
value = buf;
|
|
948
|
+
}
|
|
949
|
+
return this.uint32(len)._push(writeBytes, len, value);
|
|
950
|
+
};
|
|
951
|
+
Writer.prototype.string = function write_string(value) {
|
|
952
|
+
var len = utf8.length(value);
|
|
953
|
+
return len ? this.uint32(len)._push(utf8.write, len, value) : this._push(writeByte, 1, 0);
|
|
954
|
+
};
|
|
955
|
+
Writer.prototype.fork = function fork() {
|
|
956
|
+
this.states = new State(this);
|
|
957
|
+
this.head = this.tail = new Op(noop, 0, 0);
|
|
958
|
+
this.len = 0;
|
|
959
|
+
return this;
|
|
960
|
+
};
|
|
961
|
+
Writer.prototype.reset = function reset() {
|
|
962
|
+
if (this.states) {
|
|
963
|
+
this.head = this.states.head;
|
|
964
|
+
this.tail = this.states.tail;
|
|
965
|
+
this.len = this.states.len;
|
|
966
|
+
this.states = this.states.next;
|
|
967
|
+
} else {
|
|
968
|
+
this.head = this.tail = new Op(noop, 0, 0);
|
|
969
|
+
this.len = 0;
|
|
970
|
+
}
|
|
971
|
+
return this;
|
|
972
|
+
};
|
|
973
|
+
Writer.prototype.ldelim = function ldelim() {
|
|
974
|
+
var head = this.head, tail = this.tail, len = this.len;
|
|
975
|
+
this.reset().uint32(len);
|
|
976
|
+
if (len) {
|
|
977
|
+
this.tail.next = head.next;
|
|
978
|
+
this.tail = tail;
|
|
979
|
+
this.len += len;
|
|
980
|
+
}
|
|
981
|
+
return this;
|
|
982
|
+
};
|
|
983
|
+
Writer.prototype.finish = function finish() {
|
|
984
|
+
var head = this.head.next, buf = this.constructor.alloc(this.len), pos = 0;
|
|
985
|
+
while (head) {
|
|
986
|
+
head.fn(head.val, buf, pos);
|
|
987
|
+
pos += head.len;
|
|
988
|
+
head = head.next;
|
|
989
|
+
}
|
|
990
|
+
return buf;
|
|
991
|
+
};
|
|
992
|
+
Writer._configure = function(BufferWriter_) {
|
|
993
|
+
BufferWriter = BufferWriter_;
|
|
994
|
+
Writer.create = create();
|
|
995
|
+
BufferWriter._configure();
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/writer_buffer.js
|
|
1001
|
+
var require_writer_buffer = __commonJS({
|
|
1002
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/writer_buffer.js"(exports2, module2) {
|
|
1003
|
+
"use strict";
|
|
1004
|
+
module2.exports = BufferWriter;
|
|
1005
|
+
var Writer = require_writer();
|
|
1006
|
+
(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;
|
|
1007
|
+
var util = require_minimal();
|
|
1008
|
+
function BufferWriter() {
|
|
1009
|
+
Writer.call(this);
|
|
1010
|
+
}
|
|
1011
|
+
BufferWriter._configure = function() {
|
|
1012
|
+
BufferWriter.alloc = util._Buffer_allocUnsafe;
|
|
1013
|
+
BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val, buf, pos) {
|
|
1014
|
+
buf.set(val, pos);
|
|
1015
|
+
} : function writeBytesBuffer_copy(val, buf, pos) {
|
|
1016
|
+
if (val.copy)
|
|
1017
|
+
val.copy(buf, pos, 0, val.length);
|
|
1018
|
+
else
|
|
1019
|
+
for (var i = 0; i < val.length; )
|
|
1020
|
+
buf[pos++] = val[i++];
|
|
1021
|
+
};
|
|
1022
|
+
};
|
|
1023
|
+
BufferWriter.prototype.bytes = function write_bytes_buffer(value) {
|
|
1024
|
+
if (util.isString(value))
|
|
1025
|
+
value = util._Buffer_from(value, "base64");
|
|
1026
|
+
var len = value.length >>> 0;
|
|
1027
|
+
this.uint32(len);
|
|
1028
|
+
if (len)
|
|
1029
|
+
this._push(BufferWriter.writeBytesBuffer, len, value);
|
|
1030
|
+
return this;
|
|
1031
|
+
};
|
|
1032
|
+
function writeStringBuffer(val, buf, pos) {
|
|
1033
|
+
if (val.length < 40)
|
|
1034
|
+
util.utf8.write(val, buf, pos);
|
|
1035
|
+
else if (buf.utf8Write)
|
|
1036
|
+
buf.utf8Write(val, pos);
|
|
1037
|
+
else
|
|
1038
|
+
buf.write(val, pos);
|
|
1039
|
+
}
|
|
1040
|
+
BufferWriter.prototype.string = function write_string_buffer(value) {
|
|
1041
|
+
var len = util.Buffer.byteLength(value);
|
|
1042
|
+
this.uint32(len);
|
|
1043
|
+
if (len)
|
|
1044
|
+
this._push(writeStringBuffer, len, value);
|
|
1045
|
+
return this;
|
|
1046
|
+
};
|
|
1047
|
+
BufferWriter._configure();
|
|
1048
|
+
}
|
|
1049
|
+
});
|
|
1050
|
+
|
|
1051
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/reader.js
|
|
1052
|
+
var require_reader = __commonJS({
|
|
1053
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/reader.js"(exports2, module2) {
|
|
1054
|
+
"use strict";
|
|
1055
|
+
module2.exports = Reader;
|
|
1056
|
+
var util = require_minimal();
|
|
1057
|
+
var BufferReader;
|
|
1058
|
+
var LongBits = util.LongBits;
|
|
1059
|
+
var utf8 = util.utf8;
|
|
1060
|
+
function indexOutOfRange(reader, writeLength) {
|
|
1061
|
+
return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len);
|
|
1062
|
+
}
|
|
1063
|
+
function Reader(buffer) {
|
|
1064
|
+
this.buf = buffer;
|
|
1065
|
+
this.pos = 0;
|
|
1066
|
+
this.len = buffer.length;
|
|
1067
|
+
}
|
|
1068
|
+
var create_array = typeof Uint8Array !== "undefined" ? function create_typed_array(buffer) {
|
|
1069
|
+
if (buffer instanceof Uint8Array || Array.isArray(buffer))
|
|
1070
|
+
return new Reader(buffer);
|
|
1071
|
+
throw Error("illegal buffer");
|
|
1072
|
+
} : function create_array2(buffer) {
|
|
1073
|
+
if (Array.isArray(buffer))
|
|
1074
|
+
return new Reader(buffer);
|
|
1075
|
+
throw Error("illegal buffer");
|
|
1076
|
+
};
|
|
1077
|
+
var create = function create2() {
|
|
1078
|
+
return util.Buffer ? function create_buffer_setup(buffer) {
|
|
1079
|
+
return (Reader.create = function create_buffer(buffer2) {
|
|
1080
|
+
return util.Buffer.isBuffer(buffer2) ? new BufferReader(buffer2) : create_array(buffer2);
|
|
1081
|
+
})(buffer);
|
|
1082
|
+
} : create_array;
|
|
1083
|
+
};
|
|
1084
|
+
Reader.create = create();
|
|
1085
|
+
Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */
|
|
1086
|
+
util.Array.prototype.slice;
|
|
1087
|
+
Reader.prototype.uint32 = function read_uint32_setup() {
|
|
1088
|
+
var value = 4294967295;
|
|
1089
|
+
return function read_uint32() {
|
|
1090
|
+
value = (this.buf[this.pos] & 127) >>> 0;
|
|
1091
|
+
if (this.buf[this.pos++] < 128)
|
|
1092
|
+
return value;
|
|
1093
|
+
value = (value | (this.buf[this.pos] & 127) << 7) >>> 0;
|
|
1094
|
+
if (this.buf[this.pos++] < 128)
|
|
1095
|
+
return value;
|
|
1096
|
+
value = (value | (this.buf[this.pos] & 127) << 14) >>> 0;
|
|
1097
|
+
if (this.buf[this.pos++] < 128)
|
|
1098
|
+
return value;
|
|
1099
|
+
value = (value | (this.buf[this.pos] & 127) << 21) >>> 0;
|
|
1100
|
+
if (this.buf[this.pos++] < 128)
|
|
1101
|
+
return value;
|
|
1102
|
+
value = (value | (this.buf[this.pos] & 15) << 28) >>> 0;
|
|
1103
|
+
if (this.buf[this.pos++] < 128)
|
|
1104
|
+
return value;
|
|
1105
|
+
if ((this.pos += 5) > this.len) {
|
|
1106
|
+
this.pos = this.len;
|
|
1107
|
+
throw indexOutOfRange(this, 10);
|
|
1108
|
+
}
|
|
1109
|
+
return value;
|
|
1110
|
+
};
|
|
1111
|
+
}();
|
|
1112
|
+
Reader.prototype.int32 = function read_int32() {
|
|
1113
|
+
return this.uint32() | 0;
|
|
1114
|
+
};
|
|
1115
|
+
Reader.prototype.sint32 = function read_sint32() {
|
|
1116
|
+
var value = this.uint32();
|
|
1117
|
+
return value >>> 1 ^ -(value & 1) | 0;
|
|
1118
|
+
};
|
|
1119
|
+
function readLongVarint() {
|
|
1120
|
+
var bits = new LongBits(0, 0);
|
|
1121
|
+
var i = 0;
|
|
1122
|
+
if (this.len - this.pos > 4) {
|
|
1123
|
+
for (; i < 4; ++i) {
|
|
1124
|
+
bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;
|
|
1125
|
+
if (this.buf[this.pos++] < 128)
|
|
1126
|
+
return bits;
|
|
1127
|
+
}
|
|
1128
|
+
bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;
|
|
1129
|
+
bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;
|
|
1130
|
+
if (this.buf[this.pos++] < 128)
|
|
1131
|
+
return bits;
|
|
1132
|
+
i = 0;
|
|
1133
|
+
} else {
|
|
1134
|
+
for (; i < 3; ++i) {
|
|
1135
|
+
if (this.pos >= this.len)
|
|
1136
|
+
throw indexOutOfRange(this);
|
|
1137
|
+
bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;
|
|
1138
|
+
if (this.buf[this.pos++] < 128)
|
|
1139
|
+
return bits;
|
|
1140
|
+
}
|
|
1141
|
+
bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;
|
|
1142
|
+
return bits;
|
|
1143
|
+
}
|
|
1144
|
+
if (this.len - this.pos > 4) {
|
|
1145
|
+
for (; i < 5; ++i) {
|
|
1146
|
+
bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;
|
|
1147
|
+
if (this.buf[this.pos++] < 128)
|
|
1148
|
+
return bits;
|
|
1149
|
+
}
|
|
1150
|
+
} else {
|
|
1151
|
+
for (; i < 5; ++i) {
|
|
1152
|
+
if (this.pos >= this.len)
|
|
1153
|
+
throw indexOutOfRange(this);
|
|
1154
|
+
bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;
|
|
1155
|
+
if (this.buf[this.pos++] < 128)
|
|
1156
|
+
return bits;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
throw Error("invalid varint encoding");
|
|
1160
|
+
}
|
|
1161
|
+
Reader.prototype.bool = function read_bool() {
|
|
1162
|
+
return this.uint32() !== 0;
|
|
1163
|
+
};
|
|
1164
|
+
function readFixed32_end(buf, end) {
|
|
1165
|
+
return (buf[end - 4] | buf[end - 3] << 8 | buf[end - 2] << 16 | buf[end - 1] << 24) >>> 0;
|
|
1166
|
+
}
|
|
1167
|
+
Reader.prototype.fixed32 = function read_fixed32() {
|
|
1168
|
+
if (this.pos + 4 > this.len)
|
|
1169
|
+
throw indexOutOfRange(this, 4);
|
|
1170
|
+
return readFixed32_end(this.buf, this.pos += 4);
|
|
1171
|
+
};
|
|
1172
|
+
Reader.prototype.sfixed32 = function read_sfixed32() {
|
|
1173
|
+
if (this.pos + 4 > this.len)
|
|
1174
|
+
throw indexOutOfRange(this, 4);
|
|
1175
|
+
return readFixed32_end(this.buf, this.pos += 4) | 0;
|
|
1176
|
+
};
|
|
1177
|
+
function readFixed64() {
|
|
1178
|
+
if (this.pos + 8 > this.len)
|
|
1179
|
+
throw indexOutOfRange(this, 8);
|
|
1180
|
+
return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));
|
|
1181
|
+
}
|
|
1182
|
+
Reader.prototype.float = function read_float() {
|
|
1183
|
+
if (this.pos + 4 > this.len)
|
|
1184
|
+
throw indexOutOfRange(this, 4);
|
|
1185
|
+
var value = util.float.readFloatLE(this.buf, this.pos);
|
|
1186
|
+
this.pos += 4;
|
|
1187
|
+
return value;
|
|
1188
|
+
};
|
|
1189
|
+
Reader.prototype.double = function read_double() {
|
|
1190
|
+
if (this.pos + 8 > this.len)
|
|
1191
|
+
throw indexOutOfRange(this, 4);
|
|
1192
|
+
var value = util.float.readDoubleLE(this.buf, this.pos);
|
|
1193
|
+
this.pos += 8;
|
|
1194
|
+
return value;
|
|
1195
|
+
};
|
|
1196
|
+
Reader.prototype.bytes = function read_bytes() {
|
|
1197
|
+
var length = this.uint32(), start = this.pos, end = this.pos + length;
|
|
1198
|
+
if (end > this.len)
|
|
1199
|
+
throw indexOutOfRange(this, length);
|
|
1200
|
+
this.pos += length;
|
|
1201
|
+
if (Array.isArray(this.buf))
|
|
1202
|
+
return this.buf.slice(start, end);
|
|
1203
|
+
return start === end ? new this.buf.constructor(0) : this._slice.call(this.buf, start, end);
|
|
1204
|
+
};
|
|
1205
|
+
Reader.prototype.string = function read_string() {
|
|
1206
|
+
var bytes = this.bytes();
|
|
1207
|
+
return utf8.read(bytes, 0, bytes.length);
|
|
1208
|
+
};
|
|
1209
|
+
Reader.prototype.skip = function skip(length) {
|
|
1210
|
+
if (typeof length === "number") {
|
|
1211
|
+
if (this.pos + length > this.len)
|
|
1212
|
+
throw indexOutOfRange(this, length);
|
|
1213
|
+
this.pos += length;
|
|
1214
|
+
} else {
|
|
1215
|
+
do {
|
|
1216
|
+
if (this.pos >= this.len)
|
|
1217
|
+
throw indexOutOfRange(this);
|
|
1218
|
+
} while (this.buf[this.pos++] & 128);
|
|
1219
|
+
}
|
|
1220
|
+
return this;
|
|
1221
|
+
};
|
|
1222
|
+
Reader.prototype.skipType = function(wireType) {
|
|
1223
|
+
switch (wireType) {
|
|
1224
|
+
case 0:
|
|
1225
|
+
this.skip();
|
|
1226
|
+
break;
|
|
1227
|
+
case 1:
|
|
1228
|
+
this.skip(8);
|
|
1229
|
+
break;
|
|
1230
|
+
case 2:
|
|
1231
|
+
this.skip(this.uint32());
|
|
1232
|
+
break;
|
|
1233
|
+
case 3:
|
|
1234
|
+
while ((wireType = this.uint32() & 7) !== 4) {
|
|
1235
|
+
this.skipType(wireType);
|
|
1236
|
+
}
|
|
1237
|
+
break;
|
|
1238
|
+
case 5:
|
|
1239
|
+
this.skip(4);
|
|
1240
|
+
break;
|
|
1241
|
+
default:
|
|
1242
|
+
throw Error("invalid wire type " + wireType + " at offset " + this.pos);
|
|
1243
|
+
}
|
|
1244
|
+
return this;
|
|
1245
|
+
};
|
|
1246
|
+
Reader._configure = function(BufferReader_) {
|
|
1247
|
+
BufferReader = BufferReader_;
|
|
1248
|
+
Reader.create = create();
|
|
1249
|
+
BufferReader._configure();
|
|
1250
|
+
var fn = util.Long ? "toLong" : (
|
|
1251
|
+
/* istanbul ignore next */
|
|
1252
|
+
"toNumber"
|
|
1253
|
+
);
|
|
1254
|
+
util.merge(Reader.prototype, {
|
|
1255
|
+
int64: function read_int64() {
|
|
1256
|
+
return readLongVarint.call(this)[fn](false);
|
|
1257
|
+
},
|
|
1258
|
+
uint64: function read_uint64() {
|
|
1259
|
+
return readLongVarint.call(this)[fn](true);
|
|
1260
|
+
},
|
|
1261
|
+
sint64: function read_sint64() {
|
|
1262
|
+
return readLongVarint.call(this).zzDecode()[fn](false);
|
|
1263
|
+
},
|
|
1264
|
+
fixed64: function read_fixed64() {
|
|
1265
|
+
return readFixed64.call(this)[fn](true);
|
|
1266
|
+
},
|
|
1267
|
+
sfixed64: function read_sfixed64() {
|
|
1268
|
+
return readFixed64.call(this)[fn](false);
|
|
1269
|
+
}
|
|
1270
|
+
});
|
|
1271
|
+
};
|
|
1272
|
+
}
|
|
1273
|
+
});
|
|
1274
|
+
|
|
1275
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/reader_buffer.js
|
|
1276
|
+
var require_reader_buffer = __commonJS({
|
|
1277
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/reader_buffer.js"(exports2, module2) {
|
|
1278
|
+
"use strict";
|
|
1279
|
+
module2.exports = BufferReader;
|
|
1280
|
+
var Reader = require_reader();
|
|
1281
|
+
(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;
|
|
1282
|
+
var util = require_minimal();
|
|
1283
|
+
function BufferReader(buffer) {
|
|
1284
|
+
Reader.call(this, buffer);
|
|
1285
|
+
}
|
|
1286
|
+
BufferReader._configure = function() {
|
|
1287
|
+
if (util.Buffer)
|
|
1288
|
+
BufferReader.prototype._slice = util.Buffer.prototype.slice;
|
|
1289
|
+
};
|
|
1290
|
+
BufferReader.prototype.string = function read_string_buffer() {
|
|
1291
|
+
var len = this.uint32();
|
|
1292
|
+
return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len));
|
|
1293
|
+
};
|
|
1294
|
+
BufferReader._configure();
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
|
|
1298
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/rpc/service.js
|
|
1299
|
+
var require_service = __commonJS({
|
|
1300
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/rpc/service.js"(exports2, module2) {
|
|
1301
|
+
"use strict";
|
|
1302
|
+
module2.exports = Service;
|
|
1303
|
+
var util = require_minimal();
|
|
1304
|
+
(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;
|
|
1305
|
+
function Service(rpcImpl, requestDelimited, responseDelimited) {
|
|
1306
|
+
if (typeof rpcImpl !== "function")
|
|
1307
|
+
throw TypeError("rpcImpl must be a function");
|
|
1308
|
+
util.EventEmitter.call(this);
|
|
1309
|
+
this.rpcImpl = rpcImpl;
|
|
1310
|
+
this.requestDelimited = Boolean(requestDelimited);
|
|
1311
|
+
this.responseDelimited = Boolean(responseDelimited);
|
|
1312
|
+
}
|
|
1313
|
+
Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {
|
|
1314
|
+
if (!request)
|
|
1315
|
+
throw TypeError("request must be specified");
|
|
1316
|
+
var self2 = this;
|
|
1317
|
+
if (!callback)
|
|
1318
|
+
return util.asPromise(rpcCall, self2, method, requestCtor, responseCtor, request);
|
|
1319
|
+
if (!self2.rpcImpl) {
|
|
1320
|
+
setTimeout(function() {
|
|
1321
|
+
callback(Error("already ended"));
|
|
1322
|
+
}, 0);
|
|
1323
|
+
return void 0;
|
|
1324
|
+
}
|
|
1325
|
+
try {
|
|
1326
|
+
return self2.rpcImpl(
|
|
1327
|
+
method,
|
|
1328
|
+
requestCtor[self2.requestDelimited ? "encodeDelimited" : "encode"](request).finish(),
|
|
1329
|
+
function rpcCallback(err, response) {
|
|
1330
|
+
if (err) {
|
|
1331
|
+
self2.emit("error", err, method);
|
|
1332
|
+
return callback(err);
|
|
1333
|
+
}
|
|
1334
|
+
if (response === null) {
|
|
1335
|
+
self2.end(
|
|
1336
|
+
/* endedByRPC */
|
|
1337
|
+
true
|
|
1338
|
+
);
|
|
1339
|
+
return void 0;
|
|
1340
|
+
}
|
|
1341
|
+
if (!(response instanceof responseCtor)) {
|
|
1342
|
+
try {
|
|
1343
|
+
response = responseCtor[self2.responseDelimited ? "decodeDelimited" : "decode"](response);
|
|
1344
|
+
} catch (err2) {
|
|
1345
|
+
self2.emit("error", err2, method);
|
|
1346
|
+
return callback(err2);
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
self2.emit("data", response, method);
|
|
1350
|
+
return callback(null, response);
|
|
1351
|
+
}
|
|
1352
|
+
);
|
|
1353
|
+
} catch (err) {
|
|
1354
|
+
self2.emit("error", err, method);
|
|
1355
|
+
setTimeout(function() {
|
|
1356
|
+
callback(err);
|
|
1357
|
+
}, 0);
|
|
1358
|
+
return void 0;
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
Service.prototype.end = function end(endedByRPC) {
|
|
1362
|
+
if (this.rpcImpl) {
|
|
1363
|
+
if (!endedByRPC)
|
|
1364
|
+
this.rpcImpl(null, null, null);
|
|
1365
|
+
this.rpcImpl = null;
|
|
1366
|
+
this.emit("end").off();
|
|
1367
|
+
}
|
|
1368
|
+
return this;
|
|
1369
|
+
};
|
|
1370
|
+
}
|
|
1371
|
+
});
|
|
1372
|
+
|
|
1373
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/rpc.js
|
|
1374
|
+
var require_rpc = __commonJS({
|
|
1375
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/rpc.js"(exports2) {
|
|
1376
|
+
"use strict";
|
|
1377
|
+
var rpc = exports2;
|
|
1378
|
+
rpc.Service = require_service();
|
|
1379
|
+
}
|
|
1380
|
+
});
|
|
1381
|
+
|
|
1382
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/roots.js
|
|
1383
|
+
var require_roots = __commonJS({
|
|
1384
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/roots.js"(exports2, module2) {
|
|
1385
|
+
"use strict";
|
|
1386
|
+
module2.exports = {};
|
|
1387
|
+
}
|
|
1388
|
+
});
|
|
1389
|
+
|
|
1390
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/index-minimal.js
|
|
1391
|
+
var require_index_minimal = __commonJS({
|
|
1392
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/index-minimal.js"(exports2) {
|
|
1393
|
+
"use strict";
|
|
1394
|
+
var protobuf = exports2;
|
|
1395
|
+
protobuf.build = "minimal";
|
|
1396
|
+
protobuf.Writer = require_writer();
|
|
1397
|
+
protobuf.BufferWriter = require_writer_buffer();
|
|
1398
|
+
protobuf.Reader = require_reader();
|
|
1399
|
+
protobuf.BufferReader = require_reader_buffer();
|
|
1400
|
+
protobuf.util = require_minimal();
|
|
1401
|
+
protobuf.rpc = require_rpc();
|
|
1402
|
+
protobuf.roots = require_roots();
|
|
1403
|
+
protobuf.configure = configure;
|
|
1404
|
+
function configure() {
|
|
1405
|
+
protobuf.util._configure();
|
|
1406
|
+
protobuf.Writer._configure(protobuf.BufferWriter);
|
|
1407
|
+
protobuf.Reader._configure(protobuf.BufferReader);
|
|
1408
|
+
}
|
|
1409
|
+
configure();
|
|
1410
|
+
}
|
|
1411
|
+
});
|
|
1412
|
+
|
|
1413
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/minimal.js
|
|
1414
|
+
var require_minimal2 = __commonJS({
|
|
1415
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/minimal.js"(exports2, module2) {
|
|
1416
|
+
"use strict";
|
|
1417
|
+
module2.exports = require_index_minimal();
|
|
1418
|
+
}
|
|
1419
|
+
});
|
|
1420
|
+
|
|
1421
|
+
// src/commands/devnode.ts
|
|
1422
|
+
import { rmSync } from "fs";
|
|
1423
|
+
import { homedir } from "os";
|
|
1424
|
+
import path from "path";
|
|
1425
|
+
var commandModule = {
|
|
1426
|
+
command: "devnode",
|
|
1427
|
+
describe: "Start a local Ethereum node for development",
|
|
1428
|
+
builder(yargs) {
|
|
1429
|
+
return yargs.options({
|
|
1430
|
+
blocktime: { type: "number", default: 1, decs: "Interval in which new blocks are produced" }
|
|
1431
|
+
});
|
|
1432
|
+
},
|
|
1433
|
+
async handler({ blocktime }) {
|
|
1434
|
+
console.log("Clearing devnode history");
|
|
1435
|
+
const userHomeDir = homedir();
|
|
1436
|
+
rmSync(path.join(userHomeDir, ".foundry", "anvil", "tmp"), { recursive: true, force: true });
|
|
1437
|
+
const child = execLog("anvil", ["-b", String(blocktime), "--block-base-fee-per-gas", "0"]);
|
|
1438
|
+
process.on("SIGINT", () => {
|
|
1439
|
+
console.log("\ngracefully shutting down from SIGINT (Crtl-C)");
|
|
1440
|
+
child.kill();
|
|
1441
|
+
process.exit();
|
|
1442
|
+
});
|
|
1443
|
+
await child;
|
|
1444
|
+
}
|
|
1445
|
+
};
|
|
1446
|
+
var devnode_default = commandModule;
|
|
1447
|
+
|
|
1448
|
+
// ../../node_modules/.pnpm/long@5.2.1/node_modules/long/index.js
|
|
1449
|
+
var wasm = null;
|
|
1450
|
+
try {
|
|
1451
|
+
wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([
|
|
1452
|
+
0,
|
|
1453
|
+
97,
|
|
1454
|
+
115,
|
|
1455
|
+
109,
|
|
1456
|
+
1,
|
|
1457
|
+
0,
|
|
1458
|
+
0,
|
|
1459
|
+
0,
|
|
1460
|
+
1,
|
|
1461
|
+
13,
|
|
1462
|
+
2,
|
|
1463
|
+
96,
|
|
1464
|
+
0,
|
|
1465
|
+
1,
|
|
1466
|
+
127,
|
|
1467
|
+
96,
|
|
1468
|
+
4,
|
|
1469
|
+
127,
|
|
1470
|
+
127,
|
|
1471
|
+
127,
|
|
1472
|
+
127,
|
|
1473
|
+
1,
|
|
1474
|
+
127,
|
|
1475
|
+
3,
|
|
1476
|
+
7,
|
|
1477
|
+
6,
|
|
1478
|
+
0,
|
|
1479
|
+
1,
|
|
1480
|
+
1,
|
|
1481
|
+
1,
|
|
1482
|
+
1,
|
|
1483
|
+
1,
|
|
1484
|
+
6,
|
|
1485
|
+
6,
|
|
1486
|
+
1,
|
|
1487
|
+
127,
|
|
1488
|
+
1,
|
|
1489
|
+
65,
|
|
1490
|
+
0,
|
|
1491
|
+
11,
|
|
1492
|
+
7,
|
|
1493
|
+
50,
|
|
1494
|
+
6,
|
|
1495
|
+
3,
|
|
1496
|
+
109,
|
|
1497
|
+
117,
|
|
1498
|
+
108,
|
|
1499
|
+
0,
|
|
1500
|
+
1,
|
|
1501
|
+
5,
|
|
1502
|
+
100,
|
|
1503
|
+
105,
|
|
1504
|
+
118,
|
|
1505
|
+
95,
|
|
1506
|
+
115,
|
|
1507
|
+
0,
|
|
1508
|
+
2,
|
|
1509
|
+
5,
|
|
1510
|
+
100,
|
|
1511
|
+
105,
|
|
1512
|
+
118,
|
|
1513
|
+
95,
|
|
1514
|
+
117,
|
|
1515
|
+
0,
|
|
1516
|
+
3,
|
|
1517
|
+
5,
|
|
1518
|
+
114,
|
|
1519
|
+
101,
|
|
1520
|
+
109,
|
|
1521
|
+
95,
|
|
1522
|
+
115,
|
|
1523
|
+
0,
|
|
1524
|
+
4,
|
|
1525
|
+
5,
|
|
1526
|
+
114,
|
|
1527
|
+
101,
|
|
1528
|
+
109,
|
|
1529
|
+
95,
|
|
1530
|
+
117,
|
|
1531
|
+
0,
|
|
1532
|
+
5,
|
|
1533
|
+
8,
|
|
1534
|
+
103,
|
|
1535
|
+
101,
|
|
1536
|
+
116,
|
|
1537
|
+
95,
|
|
1538
|
+
104,
|
|
1539
|
+
105,
|
|
1540
|
+
103,
|
|
1541
|
+
104,
|
|
1542
|
+
0,
|
|
1543
|
+
0,
|
|
1544
|
+
10,
|
|
1545
|
+
191,
|
|
1546
|
+
1,
|
|
1547
|
+
6,
|
|
1548
|
+
4,
|
|
1549
|
+
0,
|
|
1550
|
+
35,
|
|
1551
|
+
0,
|
|
1552
|
+
11,
|
|
1553
|
+
36,
|
|
1554
|
+
1,
|
|
1555
|
+
1,
|
|
1556
|
+
126,
|
|
1557
|
+
32,
|
|
1558
|
+
0,
|
|
1559
|
+
173,
|
|
1560
|
+
32,
|
|
1561
|
+
1,
|
|
1562
|
+
173,
|
|
1563
|
+
66,
|
|
1564
|
+
32,
|
|
1565
|
+
134,
|
|
1566
|
+
132,
|
|
1567
|
+
32,
|
|
1568
|
+
2,
|
|
1569
|
+
173,
|
|
1570
|
+
32,
|
|
1571
|
+
3,
|
|
1572
|
+
173,
|
|
1573
|
+
66,
|
|
1574
|
+
32,
|
|
1575
|
+
134,
|
|
1576
|
+
132,
|
|
1577
|
+
126,
|
|
1578
|
+
34,
|
|
1579
|
+
4,
|
|
1580
|
+
66,
|
|
1581
|
+
32,
|
|
1582
|
+
135,
|
|
1583
|
+
167,
|
|
1584
|
+
36,
|
|
1585
|
+
0,
|
|
1586
|
+
32,
|
|
1587
|
+
4,
|
|
1588
|
+
167,
|
|
1589
|
+
11,
|
|
1590
|
+
36,
|
|
1591
|
+
1,
|
|
1592
|
+
1,
|
|
1593
|
+
126,
|
|
1594
|
+
32,
|
|
1595
|
+
0,
|
|
1596
|
+
173,
|
|
1597
|
+
32,
|
|
1598
|
+
1,
|
|
1599
|
+
173,
|
|
1600
|
+
66,
|
|
1601
|
+
32,
|
|
1602
|
+
134,
|
|
1603
|
+
132,
|
|
1604
|
+
32,
|
|
1605
|
+
2,
|
|
1606
|
+
173,
|
|
1607
|
+
32,
|
|
1608
|
+
3,
|
|
1609
|
+
173,
|
|
1610
|
+
66,
|
|
1611
|
+
32,
|
|
1612
|
+
134,
|
|
1613
|
+
132,
|
|
1614
|
+
127,
|
|
1615
|
+
34,
|
|
1616
|
+
4,
|
|
1617
|
+
66,
|
|
1618
|
+
32,
|
|
1619
|
+
135,
|
|
1620
|
+
167,
|
|
1621
|
+
36,
|
|
1622
|
+
0,
|
|
1623
|
+
32,
|
|
1624
|
+
4,
|
|
1625
|
+
167,
|
|
1626
|
+
11,
|
|
1627
|
+
36,
|
|
1628
|
+
1,
|
|
1629
|
+
1,
|
|
1630
|
+
126,
|
|
1631
|
+
32,
|
|
1632
|
+
0,
|
|
1633
|
+
173,
|
|
1634
|
+
32,
|
|
1635
|
+
1,
|
|
1636
|
+
173,
|
|
1637
|
+
66,
|
|
1638
|
+
32,
|
|
1639
|
+
134,
|
|
1640
|
+
132,
|
|
1641
|
+
32,
|
|
1642
|
+
2,
|
|
1643
|
+
173,
|
|
1644
|
+
32,
|
|
1645
|
+
3,
|
|
1646
|
+
173,
|
|
1647
|
+
66,
|
|
1648
|
+
32,
|
|
1649
|
+
134,
|
|
1650
|
+
132,
|
|
1651
|
+
128,
|
|
1652
|
+
34,
|
|
1653
|
+
4,
|
|
1654
|
+
66,
|
|
1655
|
+
32,
|
|
1656
|
+
135,
|
|
1657
|
+
167,
|
|
1658
|
+
36,
|
|
1659
|
+
0,
|
|
1660
|
+
32,
|
|
1661
|
+
4,
|
|
1662
|
+
167,
|
|
1663
|
+
11,
|
|
1664
|
+
36,
|
|
1665
|
+
1,
|
|
1666
|
+
1,
|
|
1667
|
+
126,
|
|
1668
|
+
32,
|
|
1669
|
+
0,
|
|
1670
|
+
173,
|
|
1671
|
+
32,
|
|
1672
|
+
1,
|
|
1673
|
+
173,
|
|
1674
|
+
66,
|
|
1675
|
+
32,
|
|
1676
|
+
134,
|
|
1677
|
+
132,
|
|
1678
|
+
32,
|
|
1679
|
+
2,
|
|
1680
|
+
173,
|
|
1681
|
+
32,
|
|
1682
|
+
3,
|
|
1683
|
+
173,
|
|
1684
|
+
66,
|
|
1685
|
+
32,
|
|
1686
|
+
134,
|
|
1687
|
+
132,
|
|
1688
|
+
129,
|
|
1689
|
+
34,
|
|
1690
|
+
4,
|
|
1691
|
+
66,
|
|
1692
|
+
32,
|
|
1693
|
+
135,
|
|
1694
|
+
167,
|
|
1695
|
+
36,
|
|
1696
|
+
0,
|
|
1697
|
+
32,
|
|
1698
|
+
4,
|
|
1699
|
+
167,
|
|
1700
|
+
11,
|
|
1701
|
+
36,
|
|
1702
|
+
1,
|
|
1703
|
+
1,
|
|
1704
|
+
126,
|
|
1705
|
+
32,
|
|
1706
|
+
0,
|
|
1707
|
+
173,
|
|
1708
|
+
32,
|
|
1709
|
+
1,
|
|
1710
|
+
173,
|
|
1711
|
+
66,
|
|
1712
|
+
32,
|
|
1713
|
+
134,
|
|
1714
|
+
132,
|
|
1715
|
+
32,
|
|
1716
|
+
2,
|
|
1717
|
+
173,
|
|
1718
|
+
32,
|
|
1719
|
+
3,
|
|
1720
|
+
173,
|
|
1721
|
+
66,
|
|
1722
|
+
32,
|
|
1723
|
+
134,
|
|
1724
|
+
132,
|
|
1725
|
+
130,
|
|
1726
|
+
34,
|
|
1727
|
+
4,
|
|
1728
|
+
66,
|
|
1729
|
+
32,
|
|
1730
|
+
135,
|
|
1731
|
+
167,
|
|
1732
|
+
36,
|
|
1733
|
+
0,
|
|
1734
|
+
32,
|
|
1735
|
+
4,
|
|
1736
|
+
167,
|
|
1737
|
+
11
|
|
1738
|
+
])), {}).exports;
|
|
1739
|
+
} catch (e) {
|
|
1740
|
+
}
|
|
1741
|
+
function Long(low, high, unsigned) {
|
|
1742
|
+
this.low = low | 0;
|
|
1743
|
+
this.high = high | 0;
|
|
1744
|
+
this.unsigned = !!unsigned;
|
|
1745
|
+
}
|
|
1746
|
+
Long.prototype.__isLong__;
|
|
1747
|
+
Object.defineProperty(Long.prototype, "__isLong__", { value: true });
|
|
1748
|
+
function isLong(obj) {
|
|
1749
|
+
return (obj && obj["__isLong__"]) === true;
|
|
1750
|
+
}
|
|
1751
|
+
function ctz32(value) {
|
|
1752
|
+
var c = Math.clz32(value & -value);
|
|
1753
|
+
return value ? 31 - c : c;
|
|
1754
|
+
}
|
|
1755
|
+
Long.isLong = isLong;
|
|
1756
|
+
var INT_CACHE = {};
|
|
1757
|
+
var UINT_CACHE = {};
|
|
1758
|
+
function fromInt(value, unsigned) {
|
|
1759
|
+
var obj, cachedObj, cache;
|
|
1760
|
+
if (unsigned) {
|
|
1761
|
+
value >>>= 0;
|
|
1762
|
+
if (cache = 0 <= value && value < 256) {
|
|
1763
|
+
cachedObj = UINT_CACHE[value];
|
|
1764
|
+
if (cachedObj)
|
|
1765
|
+
return cachedObj;
|
|
1766
|
+
}
|
|
1767
|
+
obj = fromBits(value, 0, true);
|
|
1768
|
+
if (cache)
|
|
1769
|
+
UINT_CACHE[value] = obj;
|
|
1770
|
+
return obj;
|
|
1771
|
+
} else {
|
|
1772
|
+
value |= 0;
|
|
1773
|
+
if (cache = -128 <= value && value < 128) {
|
|
1774
|
+
cachedObj = INT_CACHE[value];
|
|
1775
|
+
if (cachedObj)
|
|
1776
|
+
return cachedObj;
|
|
1777
|
+
}
|
|
1778
|
+
obj = fromBits(value, value < 0 ? -1 : 0, false);
|
|
1779
|
+
if (cache)
|
|
1780
|
+
INT_CACHE[value] = obj;
|
|
1781
|
+
return obj;
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
Long.fromInt = fromInt;
|
|
1785
|
+
function fromNumber(value, unsigned) {
|
|
1786
|
+
if (isNaN(value))
|
|
1787
|
+
return unsigned ? UZERO : ZERO;
|
|
1788
|
+
if (unsigned) {
|
|
1789
|
+
if (value < 0)
|
|
1790
|
+
return UZERO;
|
|
1791
|
+
if (value >= TWO_PWR_64_DBL)
|
|
1792
|
+
return MAX_UNSIGNED_VALUE;
|
|
1793
|
+
} else {
|
|
1794
|
+
if (value <= -TWO_PWR_63_DBL)
|
|
1795
|
+
return MIN_VALUE;
|
|
1796
|
+
if (value + 1 >= TWO_PWR_63_DBL)
|
|
1797
|
+
return MAX_VALUE;
|
|
1798
|
+
}
|
|
1799
|
+
if (value < 0)
|
|
1800
|
+
return fromNumber(-value, unsigned).neg();
|
|
1801
|
+
return fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned);
|
|
1802
|
+
}
|
|
1803
|
+
Long.fromNumber = fromNumber;
|
|
1804
|
+
function fromBits(lowBits, highBits, unsigned) {
|
|
1805
|
+
return new Long(lowBits, highBits, unsigned);
|
|
1806
|
+
}
|
|
1807
|
+
Long.fromBits = fromBits;
|
|
1808
|
+
var pow_dbl = Math.pow;
|
|
1809
|
+
function fromString(str, unsigned, radix) {
|
|
1810
|
+
if (str.length === 0)
|
|
1811
|
+
throw Error("empty string");
|
|
1812
|
+
if (typeof unsigned === "number") {
|
|
1813
|
+
radix = unsigned;
|
|
1814
|
+
unsigned = false;
|
|
1815
|
+
} else {
|
|
1816
|
+
unsigned = !!unsigned;
|
|
1817
|
+
}
|
|
1818
|
+
if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity")
|
|
1819
|
+
return unsigned ? UZERO : ZERO;
|
|
1820
|
+
radix = radix || 10;
|
|
1821
|
+
if (radix < 2 || 36 < radix)
|
|
1822
|
+
throw RangeError("radix");
|
|
1823
|
+
var p;
|
|
1824
|
+
if ((p = str.indexOf("-")) > 0)
|
|
1825
|
+
throw Error("interior hyphen");
|
|
1826
|
+
else if (p === 0) {
|
|
1827
|
+
return fromString(str.substring(1), unsigned, radix).neg();
|
|
1828
|
+
}
|
|
1829
|
+
var radixToPower = fromNumber(pow_dbl(radix, 8));
|
|
1830
|
+
var result = ZERO;
|
|
1831
|
+
for (var i = 0; i < str.length; i += 8) {
|
|
1832
|
+
var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix);
|
|
1833
|
+
if (size < 8) {
|
|
1834
|
+
var power = fromNumber(pow_dbl(radix, size));
|
|
1835
|
+
result = result.mul(power).add(fromNumber(value));
|
|
1836
|
+
} else {
|
|
1837
|
+
result = result.mul(radixToPower);
|
|
1838
|
+
result = result.add(fromNumber(value));
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
result.unsigned = unsigned;
|
|
1842
|
+
return result;
|
|
1843
|
+
}
|
|
1844
|
+
Long.fromString = fromString;
|
|
1845
|
+
function fromValue(val, unsigned) {
|
|
1846
|
+
if (typeof val === "number")
|
|
1847
|
+
return fromNumber(val, unsigned);
|
|
1848
|
+
if (typeof val === "string")
|
|
1849
|
+
return fromString(val, unsigned);
|
|
1850
|
+
return fromBits(val.low, val.high, typeof unsigned === "boolean" ? unsigned : val.unsigned);
|
|
1851
|
+
}
|
|
1852
|
+
Long.fromValue = fromValue;
|
|
1853
|
+
var TWO_PWR_16_DBL = 1 << 16;
|
|
1854
|
+
var TWO_PWR_24_DBL = 1 << 24;
|
|
1855
|
+
var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;
|
|
1856
|
+
var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;
|
|
1857
|
+
var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;
|
|
1858
|
+
var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);
|
|
1859
|
+
var ZERO = fromInt(0);
|
|
1860
|
+
Long.ZERO = ZERO;
|
|
1861
|
+
var UZERO = fromInt(0, true);
|
|
1862
|
+
Long.UZERO = UZERO;
|
|
1863
|
+
var ONE = fromInt(1);
|
|
1864
|
+
Long.ONE = ONE;
|
|
1865
|
+
var UONE = fromInt(1, true);
|
|
1866
|
+
Long.UONE = UONE;
|
|
1867
|
+
var NEG_ONE = fromInt(-1);
|
|
1868
|
+
Long.NEG_ONE = NEG_ONE;
|
|
1869
|
+
var MAX_VALUE = fromBits(4294967295 | 0, 2147483647 | 0, false);
|
|
1870
|
+
Long.MAX_VALUE = MAX_VALUE;
|
|
1871
|
+
var MAX_UNSIGNED_VALUE = fromBits(4294967295 | 0, 4294967295 | 0, true);
|
|
1872
|
+
Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;
|
|
1873
|
+
var MIN_VALUE = fromBits(0, 2147483648 | 0, false);
|
|
1874
|
+
Long.MIN_VALUE = MIN_VALUE;
|
|
1875
|
+
var LongPrototype = Long.prototype;
|
|
1876
|
+
LongPrototype.toInt = function toInt() {
|
|
1877
|
+
return this.unsigned ? this.low >>> 0 : this.low;
|
|
1878
|
+
};
|
|
1879
|
+
LongPrototype.toNumber = function toNumber() {
|
|
1880
|
+
if (this.unsigned)
|
|
1881
|
+
return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0);
|
|
1882
|
+
return this.high * TWO_PWR_32_DBL + (this.low >>> 0);
|
|
1883
|
+
};
|
|
1884
|
+
LongPrototype.toString = function toString(radix) {
|
|
1885
|
+
radix = radix || 10;
|
|
1886
|
+
if (radix < 2 || 36 < radix)
|
|
1887
|
+
throw RangeError("radix");
|
|
1888
|
+
if (this.isZero())
|
|
1889
|
+
return "0";
|
|
1890
|
+
if (this.isNegative()) {
|
|
1891
|
+
if (this.eq(MIN_VALUE)) {
|
|
1892
|
+
var radixLong = fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this);
|
|
1893
|
+
return div.toString(radix) + rem1.toInt().toString(radix);
|
|
1894
|
+
} else
|
|
1895
|
+
return "-" + this.neg().toString(radix);
|
|
1896
|
+
}
|
|
1897
|
+
var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this;
|
|
1898
|
+
var result = "";
|
|
1899
|
+
while (true) {
|
|
1900
|
+
var remDiv = rem.div(radixToPower), intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, digits = intval.toString(radix);
|
|
1901
|
+
rem = remDiv;
|
|
1902
|
+
if (rem.isZero())
|
|
1903
|
+
return digits + result;
|
|
1904
|
+
else {
|
|
1905
|
+
while (digits.length < 6)
|
|
1906
|
+
digits = "0" + digits;
|
|
1907
|
+
result = "" + digits + result;
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
};
|
|
1911
|
+
LongPrototype.getHighBits = function getHighBits() {
|
|
1912
|
+
return this.high;
|
|
1913
|
+
};
|
|
1914
|
+
LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {
|
|
1915
|
+
return this.high >>> 0;
|
|
1916
|
+
};
|
|
1917
|
+
LongPrototype.getLowBits = function getLowBits() {
|
|
1918
|
+
return this.low;
|
|
1919
|
+
};
|
|
1920
|
+
LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {
|
|
1921
|
+
return this.low >>> 0;
|
|
1922
|
+
};
|
|
1923
|
+
LongPrototype.getNumBitsAbs = function getNumBitsAbs() {
|
|
1924
|
+
if (this.isNegative())
|
|
1925
|
+
return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();
|
|
1926
|
+
var val = this.high != 0 ? this.high : this.low;
|
|
1927
|
+
for (var bit = 31; bit > 0; bit--)
|
|
1928
|
+
if ((val & 1 << bit) != 0)
|
|
1929
|
+
break;
|
|
1930
|
+
return this.high != 0 ? bit + 33 : bit + 1;
|
|
1931
|
+
};
|
|
1932
|
+
LongPrototype.isZero = function isZero() {
|
|
1933
|
+
return this.high === 0 && this.low === 0;
|
|
1934
|
+
};
|
|
1935
|
+
LongPrototype.eqz = LongPrototype.isZero;
|
|
1936
|
+
LongPrototype.isNegative = function isNegative() {
|
|
1937
|
+
return !this.unsigned && this.high < 0;
|
|
1938
|
+
};
|
|
1939
|
+
LongPrototype.isPositive = function isPositive() {
|
|
1940
|
+
return this.unsigned || this.high >= 0;
|
|
1941
|
+
};
|
|
1942
|
+
LongPrototype.isOdd = function isOdd() {
|
|
1943
|
+
return (this.low & 1) === 1;
|
|
1944
|
+
};
|
|
1945
|
+
LongPrototype.isEven = function isEven() {
|
|
1946
|
+
return (this.low & 1) === 0;
|
|
1947
|
+
};
|
|
1948
|
+
LongPrototype.equals = function equals(other) {
|
|
1949
|
+
if (!isLong(other))
|
|
1950
|
+
other = fromValue(other);
|
|
1951
|
+
if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1)
|
|
1952
|
+
return false;
|
|
1953
|
+
return this.high === other.high && this.low === other.low;
|
|
1954
|
+
};
|
|
1955
|
+
LongPrototype.eq = LongPrototype.equals;
|
|
1956
|
+
LongPrototype.notEquals = function notEquals(other) {
|
|
1957
|
+
return !this.eq(
|
|
1958
|
+
/* validates */
|
|
1959
|
+
other
|
|
1960
|
+
);
|
|
1961
|
+
};
|
|
1962
|
+
LongPrototype.neq = LongPrototype.notEquals;
|
|
1963
|
+
LongPrototype.ne = LongPrototype.notEquals;
|
|
1964
|
+
LongPrototype.lessThan = function lessThan(other) {
|
|
1965
|
+
return this.comp(
|
|
1966
|
+
/* validates */
|
|
1967
|
+
other
|
|
1968
|
+
) < 0;
|
|
1969
|
+
};
|
|
1970
|
+
LongPrototype.lt = LongPrototype.lessThan;
|
|
1971
|
+
LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {
|
|
1972
|
+
return this.comp(
|
|
1973
|
+
/* validates */
|
|
1974
|
+
other
|
|
1975
|
+
) <= 0;
|
|
1976
|
+
};
|
|
1977
|
+
LongPrototype.lte = LongPrototype.lessThanOrEqual;
|
|
1978
|
+
LongPrototype.le = LongPrototype.lessThanOrEqual;
|
|
1979
|
+
LongPrototype.greaterThan = function greaterThan(other) {
|
|
1980
|
+
return this.comp(
|
|
1981
|
+
/* validates */
|
|
1982
|
+
other
|
|
1983
|
+
) > 0;
|
|
1984
|
+
};
|
|
1985
|
+
LongPrototype.gt = LongPrototype.greaterThan;
|
|
1986
|
+
LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {
|
|
1987
|
+
return this.comp(
|
|
1988
|
+
/* validates */
|
|
1989
|
+
other
|
|
1990
|
+
) >= 0;
|
|
1991
|
+
};
|
|
1992
|
+
LongPrototype.gte = LongPrototype.greaterThanOrEqual;
|
|
1993
|
+
LongPrototype.ge = LongPrototype.greaterThanOrEqual;
|
|
1994
|
+
LongPrototype.compare = function compare(other) {
|
|
1995
|
+
if (!isLong(other))
|
|
1996
|
+
other = fromValue(other);
|
|
1997
|
+
if (this.eq(other))
|
|
1998
|
+
return 0;
|
|
1999
|
+
var thisNeg = this.isNegative(), otherNeg = other.isNegative();
|
|
2000
|
+
if (thisNeg && !otherNeg)
|
|
2001
|
+
return -1;
|
|
2002
|
+
if (!thisNeg && otherNeg)
|
|
2003
|
+
return 1;
|
|
2004
|
+
if (!this.unsigned)
|
|
2005
|
+
return this.sub(other).isNegative() ? -1 : 1;
|
|
2006
|
+
return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1;
|
|
2007
|
+
};
|
|
2008
|
+
LongPrototype.comp = LongPrototype.compare;
|
|
2009
|
+
LongPrototype.negate = function negate() {
|
|
2010
|
+
if (!this.unsigned && this.eq(MIN_VALUE))
|
|
2011
|
+
return MIN_VALUE;
|
|
2012
|
+
return this.not().add(ONE);
|
|
2013
|
+
};
|
|
2014
|
+
LongPrototype.neg = LongPrototype.negate;
|
|
2015
|
+
LongPrototype.add = function add(addend) {
|
|
2016
|
+
if (!isLong(addend))
|
|
2017
|
+
addend = fromValue(addend);
|
|
2018
|
+
var a48 = this.high >>> 16;
|
|
2019
|
+
var a32 = this.high & 65535;
|
|
2020
|
+
var a16 = this.low >>> 16;
|
|
2021
|
+
var a00 = this.low & 65535;
|
|
2022
|
+
var b48 = addend.high >>> 16;
|
|
2023
|
+
var b32 = addend.high & 65535;
|
|
2024
|
+
var b16 = addend.low >>> 16;
|
|
2025
|
+
var b00 = addend.low & 65535;
|
|
2026
|
+
var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
|
|
2027
|
+
c00 += a00 + b00;
|
|
2028
|
+
c16 += c00 >>> 16;
|
|
2029
|
+
c00 &= 65535;
|
|
2030
|
+
c16 += a16 + b16;
|
|
2031
|
+
c32 += c16 >>> 16;
|
|
2032
|
+
c16 &= 65535;
|
|
2033
|
+
c32 += a32 + b32;
|
|
2034
|
+
c48 += c32 >>> 16;
|
|
2035
|
+
c32 &= 65535;
|
|
2036
|
+
c48 += a48 + b48;
|
|
2037
|
+
c48 &= 65535;
|
|
2038
|
+
return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned);
|
|
2039
|
+
};
|
|
2040
|
+
LongPrototype.subtract = function subtract(subtrahend) {
|
|
2041
|
+
if (!isLong(subtrahend))
|
|
2042
|
+
subtrahend = fromValue(subtrahend);
|
|
2043
|
+
return this.add(subtrahend.neg());
|
|
2044
|
+
};
|
|
2045
|
+
LongPrototype.sub = LongPrototype.subtract;
|
|
2046
|
+
LongPrototype.multiply = function multiply(multiplier) {
|
|
2047
|
+
if (this.isZero())
|
|
2048
|
+
return this;
|
|
2049
|
+
if (!isLong(multiplier))
|
|
2050
|
+
multiplier = fromValue(multiplier);
|
|
2051
|
+
if (wasm) {
|
|
2052
|
+
var low = wasm["mul"](
|
|
2053
|
+
this.low,
|
|
2054
|
+
this.high,
|
|
2055
|
+
multiplier.low,
|
|
2056
|
+
multiplier.high
|
|
2057
|
+
);
|
|
2058
|
+
return fromBits(low, wasm["get_high"](), this.unsigned);
|
|
2059
|
+
}
|
|
2060
|
+
if (multiplier.isZero())
|
|
2061
|
+
return this.unsigned ? UZERO : ZERO;
|
|
2062
|
+
if (this.eq(MIN_VALUE))
|
|
2063
|
+
return multiplier.isOdd() ? MIN_VALUE : ZERO;
|
|
2064
|
+
if (multiplier.eq(MIN_VALUE))
|
|
2065
|
+
return this.isOdd() ? MIN_VALUE : ZERO;
|
|
2066
|
+
if (this.isNegative()) {
|
|
2067
|
+
if (multiplier.isNegative())
|
|
2068
|
+
return this.neg().mul(multiplier.neg());
|
|
2069
|
+
else
|
|
2070
|
+
return this.neg().mul(multiplier).neg();
|
|
2071
|
+
} else if (multiplier.isNegative())
|
|
2072
|
+
return this.mul(multiplier.neg()).neg();
|
|
2073
|
+
if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))
|
|
2074
|
+
return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);
|
|
2075
|
+
var a48 = this.high >>> 16;
|
|
2076
|
+
var a32 = this.high & 65535;
|
|
2077
|
+
var a16 = this.low >>> 16;
|
|
2078
|
+
var a00 = this.low & 65535;
|
|
2079
|
+
var b48 = multiplier.high >>> 16;
|
|
2080
|
+
var b32 = multiplier.high & 65535;
|
|
2081
|
+
var b16 = multiplier.low >>> 16;
|
|
2082
|
+
var b00 = multiplier.low & 65535;
|
|
2083
|
+
var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
|
|
2084
|
+
c00 += a00 * b00;
|
|
2085
|
+
c16 += c00 >>> 16;
|
|
2086
|
+
c00 &= 65535;
|
|
2087
|
+
c16 += a16 * b00;
|
|
2088
|
+
c32 += c16 >>> 16;
|
|
2089
|
+
c16 &= 65535;
|
|
2090
|
+
c16 += a00 * b16;
|
|
2091
|
+
c32 += c16 >>> 16;
|
|
2092
|
+
c16 &= 65535;
|
|
2093
|
+
c32 += a32 * b00;
|
|
2094
|
+
c48 += c32 >>> 16;
|
|
2095
|
+
c32 &= 65535;
|
|
2096
|
+
c32 += a16 * b16;
|
|
2097
|
+
c48 += c32 >>> 16;
|
|
2098
|
+
c32 &= 65535;
|
|
2099
|
+
c32 += a00 * b32;
|
|
2100
|
+
c48 += c32 >>> 16;
|
|
2101
|
+
c32 &= 65535;
|
|
2102
|
+
c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
|
|
2103
|
+
c48 &= 65535;
|
|
2104
|
+
return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned);
|
|
2105
|
+
};
|
|
2106
|
+
LongPrototype.mul = LongPrototype.multiply;
|
|
2107
|
+
LongPrototype.divide = function divide(divisor) {
|
|
2108
|
+
if (!isLong(divisor))
|
|
2109
|
+
divisor = fromValue(divisor);
|
|
2110
|
+
if (divisor.isZero())
|
|
2111
|
+
throw Error("division by zero");
|
|
2112
|
+
if (wasm) {
|
|
2113
|
+
if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) {
|
|
2114
|
+
return this;
|
|
2115
|
+
}
|
|
2116
|
+
var low = (this.unsigned ? wasm["div_u"] : wasm["div_s"])(
|
|
2117
|
+
this.low,
|
|
2118
|
+
this.high,
|
|
2119
|
+
divisor.low,
|
|
2120
|
+
divisor.high
|
|
2121
|
+
);
|
|
2122
|
+
return fromBits(low, wasm["get_high"](), this.unsigned);
|
|
2123
|
+
}
|
|
2124
|
+
if (this.isZero())
|
|
2125
|
+
return this.unsigned ? UZERO : ZERO;
|
|
2126
|
+
var approx, rem, res;
|
|
2127
|
+
if (!this.unsigned) {
|
|
2128
|
+
if (this.eq(MIN_VALUE)) {
|
|
2129
|
+
if (divisor.eq(ONE) || divisor.eq(NEG_ONE))
|
|
2130
|
+
return MIN_VALUE;
|
|
2131
|
+
else if (divisor.eq(MIN_VALUE))
|
|
2132
|
+
return ONE;
|
|
2133
|
+
else {
|
|
2134
|
+
var halfThis = this.shr(1);
|
|
2135
|
+
approx = halfThis.div(divisor).shl(1);
|
|
2136
|
+
if (approx.eq(ZERO)) {
|
|
2137
|
+
return divisor.isNegative() ? ONE : NEG_ONE;
|
|
2138
|
+
} else {
|
|
2139
|
+
rem = this.sub(divisor.mul(approx));
|
|
2140
|
+
res = approx.add(rem.div(divisor));
|
|
2141
|
+
return res;
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
} else if (divisor.eq(MIN_VALUE))
|
|
2145
|
+
return this.unsigned ? UZERO : ZERO;
|
|
2146
|
+
if (this.isNegative()) {
|
|
2147
|
+
if (divisor.isNegative())
|
|
2148
|
+
return this.neg().div(divisor.neg());
|
|
2149
|
+
return this.neg().div(divisor).neg();
|
|
2150
|
+
} else if (divisor.isNegative())
|
|
2151
|
+
return this.div(divisor.neg()).neg();
|
|
2152
|
+
res = ZERO;
|
|
2153
|
+
} else {
|
|
2154
|
+
if (!divisor.unsigned)
|
|
2155
|
+
divisor = divisor.toUnsigned();
|
|
2156
|
+
if (divisor.gt(this))
|
|
2157
|
+
return UZERO;
|
|
2158
|
+
if (divisor.gt(this.shru(1)))
|
|
2159
|
+
return UONE;
|
|
2160
|
+
res = UZERO;
|
|
2161
|
+
}
|
|
2162
|
+
rem = this;
|
|
2163
|
+
while (rem.gte(divisor)) {
|
|
2164
|
+
approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));
|
|
2165
|
+
var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor);
|
|
2166
|
+
while (approxRem.isNegative() || approxRem.gt(rem)) {
|
|
2167
|
+
approx -= delta;
|
|
2168
|
+
approxRes = fromNumber(approx, this.unsigned);
|
|
2169
|
+
approxRem = approxRes.mul(divisor);
|
|
2170
|
+
}
|
|
2171
|
+
if (approxRes.isZero())
|
|
2172
|
+
approxRes = ONE;
|
|
2173
|
+
res = res.add(approxRes);
|
|
2174
|
+
rem = rem.sub(approxRem);
|
|
2175
|
+
}
|
|
2176
|
+
return res;
|
|
2177
|
+
};
|
|
2178
|
+
LongPrototype.div = LongPrototype.divide;
|
|
2179
|
+
LongPrototype.modulo = function modulo(divisor) {
|
|
2180
|
+
if (!isLong(divisor))
|
|
2181
|
+
divisor = fromValue(divisor);
|
|
2182
|
+
if (wasm) {
|
|
2183
|
+
var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])(
|
|
2184
|
+
this.low,
|
|
2185
|
+
this.high,
|
|
2186
|
+
divisor.low,
|
|
2187
|
+
divisor.high
|
|
2188
|
+
);
|
|
2189
|
+
return fromBits(low, wasm["get_high"](), this.unsigned);
|
|
2190
|
+
}
|
|
2191
|
+
return this.sub(this.div(divisor).mul(divisor));
|
|
2192
|
+
};
|
|
2193
|
+
LongPrototype.mod = LongPrototype.modulo;
|
|
2194
|
+
LongPrototype.rem = LongPrototype.modulo;
|
|
2195
|
+
LongPrototype.not = function not() {
|
|
2196
|
+
return fromBits(~this.low, ~this.high, this.unsigned);
|
|
2197
|
+
};
|
|
2198
|
+
LongPrototype.countLeadingZeros = function countLeadingZeros() {
|
|
2199
|
+
return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32;
|
|
2200
|
+
};
|
|
2201
|
+
LongPrototype.clz = LongPrototype.countLeadingZeros;
|
|
2202
|
+
LongPrototype.countTrailingZeros = function countTrailingZeros() {
|
|
2203
|
+
return this.low ? ctz32(this.low) : ctz32(this.high) + 32;
|
|
2204
|
+
};
|
|
2205
|
+
LongPrototype.ctz = LongPrototype.countTrailingZeros;
|
|
2206
|
+
LongPrototype.and = function and(other) {
|
|
2207
|
+
if (!isLong(other))
|
|
2208
|
+
other = fromValue(other);
|
|
2209
|
+
return fromBits(this.low & other.low, this.high & other.high, this.unsigned);
|
|
2210
|
+
};
|
|
2211
|
+
LongPrototype.or = function or(other) {
|
|
2212
|
+
if (!isLong(other))
|
|
2213
|
+
other = fromValue(other);
|
|
2214
|
+
return fromBits(this.low | other.low, this.high | other.high, this.unsigned);
|
|
2215
|
+
};
|
|
2216
|
+
LongPrototype.xor = function xor(other) {
|
|
2217
|
+
if (!isLong(other))
|
|
2218
|
+
other = fromValue(other);
|
|
2219
|
+
return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);
|
|
2220
|
+
};
|
|
2221
|
+
LongPrototype.shiftLeft = function shiftLeft(numBits) {
|
|
2222
|
+
if (isLong(numBits))
|
|
2223
|
+
numBits = numBits.toInt();
|
|
2224
|
+
if ((numBits &= 63) === 0)
|
|
2225
|
+
return this;
|
|
2226
|
+
else if (numBits < 32)
|
|
2227
|
+
return fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned);
|
|
2228
|
+
else
|
|
2229
|
+
return fromBits(0, this.low << numBits - 32, this.unsigned);
|
|
2230
|
+
};
|
|
2231
|
+
LongPrototype.shl = LongPrototype.shiftLeft;
|
|
2232
|
+
LongPrototype.shiftRight = function shiftRight(numBits) {
|
|
2233
|
+
if (isLong(numBits))
|
|
2234
|
+
numBits = numBits.toInt();
|
|
2235
|
+
if ((numBits &= 63) === 0)
|
|
2236
|
+
return this;
|
|
2237
|
+
else if (numBits < 32)
|
|
2238
|
+
return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned);
|
|
2239
|
+
else
|
|
2240
|
+
return fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned);
|
|
2241
|
+
};
|
|
2242
|
+
LongPrototype.shr = LongPrototype.shiftRight;
|
|
2243
|
+
LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {
|
|
2244
|
+
if (isLong(numBits))
|
|
2245
|
+
numBits = numBits.toInt();
|
|
2246
|
+
if ((numBits &= 63) === 0)
|
|
2247
|
+
return this;
|
|
2248
|
+
if (numBits < 32)
|
|
2249
|
+
return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >>> numBits, this.unsigned);
|
|
2250
|
+
if (numBits === 32)
|
|
2251
|
+
return fromBits(this.high, 0, this.unsigned);
|
|
2252
|
+
return fromBits(this.high >>> numBits - 32, 0, this.unsigned);
|
|
2253
|
+
};
|
|
2254
|
+
LongPrototype.shru = LongPrototype.shiftRightUnsigned;
|
|
2255
|
+
LongPrototype.shr_u = LongPrototype.shiftRightUnsigned;
|
|
2256
|
+
LongPrototype.rotateLeft = function rotateLeft(numBits) {
|
|
2257
|
+
var b;
|
|
2258
|
+
if (isLong(numBits))
|
|
2259
|
+
numBits = numBits.toInt();
|
|
2260
|
+
if ((numBits &= 63) === 0)
|
|
2261
|
+
return this;
|
|
2262
|
+
if (numBits === 32)
|
|
2263
|
+
return fromBits(this.high, this.low, this.unsigned);
|
|
2264
|
+
if (numBits < 32) {
|
|
2265
|
+
b = 32 - numBits;
|
|
2266
|
+
return fromBits(this.low << numBits | this.high >>> b, this.high << numBits | this.low >>> b, this.unsigned);
|
|
2267
|
+
}
|
|
2268
|
+
numBits -= 32;
|
|
2269
|
+
b = 32 - numBits;
|
|
2270
|
+
return fromBits(this.high << numBits | this.low >>> b, this.low << numBits | this.high >>> b, this.unsigned);
|
|
2271
|
+
};
|
|
2272
|
+
LongPrototype.rotl = LongPrototype.rotateLeft;
|
|
2273
|
+
LongPrototype.rotateRight = function rotateRight(numBits) {
|
|
2274
|
+
var b;
|
|
2275
|
+
if (isLong(numBits))
|
|
2276
|
+
numBits = numBits.toInt();
|
|
2277
|
+
if ((numBits &= 63) === 0)
|
|
2278
|
+
return this;
|
|
2279
|
+
if (numBits === 32)
|
|
2280
|
+
return fromBits(this.high, this.low, this.unsigned);
|
|
2281
|
+
if (numBits < 32) {
|
|
2282
|
+
b = 32 - numBits;
|
|
2283
|
+
return fromBits(this.high << b | this.low >>> numBits, this.low << b | this.high >>> numBits, this.unsigned);
|
|
2284
|
+
}
|
|
2285
|
+
numBits -= 32;
|
|
2286
|
+
b = 32 - numBits;
|
|
2287
|
+
return fromBits(this.low << b | this.high >>> numBits, this.high << b | this.low >>> numBits, this.unsigned);
|
|
2288
|
+
};
|
|
2289
|
+
LongPrototype.rotr = LongPrototype.rotateRight;
|
|
2290
|
+
LongPrototype.toSigned = function toSigned() {
|
|
2291
|
+
if (!this.unsigned)
|
|
2292
|
+
return this;
|
|
2293
|
+
return fromBits(this.low, this.high, false);
|
|
2294
|
+
};
|
|
2295
|
+
LongPrototype.toUnsigned = function toUnsigned() {
|
|
2296
|
+
if (this.unsigned)
|
|
2297
|
+
return this;
|
|
2298
|
+
return fromBits(this.low, this.high, true);
|
|
2299
|
+
};
|
|
2300
|
+
LongPrototype.toBytes = function toBytes(le) {
|
|
2301
|
+
return le ? this.toBytesLE() : this.toBytesBE();
|
|
2302
|
+
};
|
|
2303
|
+
LongPrototype.toBytesLE = function toBytesLE() {
|
|
2304
|
+
var hi = this.high, lo = this.low;
|
|
2305
|
+
return [
|
|
2306
|
+
lo & 255,
|
|
2307
|
+
lo >>> 8 & 255,
|
|
2308
|
+
lo >>> 16 & 255,
|
|
2309
|
+
lo >>> 24,
|
|
2310
|
+
hi & 255,
|
|
2311
|
+
hi >>> 8 & 255,
|
|
2312
|
+
hi >>> 16 & 255,
|
|
2313
|
+
hi >>> 24
|
|
2314
|
+
];
|
|
2315
|
+
};
|
|
2316
|
+
LongPrototype.toBytesBE = function toBytesBE() {
|
|
2317
|
+
var hi = this.high, lo = this.low;
|
|
2318
|
+
return [
|
|
2319
|
+
hi >>> 24,
|
|
2320
|
+
hi >>> 16 & 255,
|
|
2321
|
+
hi >>> 8 & 255,
|
|
2322
|
+
hi & 255,
|
|
2323
|
+
lo >>> 24,
|
|
2324
|
+
lo >>> 16 & 255,
|
|
2325
|
+
lo >>> 8 & 255,
|
|
2326
|
+
lo & 255
|
|
2327
|
+
];
|
|
2328
|
+
};
|
|
2329
|
+
Long.fromBytes = function fromBytes(bytes, unsigned, le) {
|
|
2330
|
+
return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);
|
|
2331
|
+
};
|
|
2332
|
+
Long.fromBytesLE = function fromBytesLE(bytes, unsigned) {
|
|
2333
|
+
return new Long(
|
|
2334
|
+
bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24,
|
|
2335
|
+
bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24,
|
|
2336
|
+
unsigned
|
|
2337
|
+
);
|
|
2338
|
+
};
|
|
2339
|
+
Long.fromBytesBE = function fromBytesBE(bytes, unsigned) {
|
|
2340
|
+
return new Long(
|
|
2341
|
+
bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7],
|
|
2342
|
+
bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3],
|
|
2343
|
+
unsigned
|
|
2344
|
+
);
|
|
2345
|
+
};
|
|
2346
|
+
var long_default = Long;
|
|
2347
|
+
|
|
2348
|
+
// ../services/protobuf/ts/faucet/faucet.ts
|
|
2349
|
+
var import_minimal = __toESM(require_minimal2(), 1);
|
|
2350
|
+
function createBaseLinkedTwitterPair() {
|
|
2351
|
+
return { username: "", address: "" };
|
|
2352
|
+
}
|
|
2353
|
+
var LinkedTwitterPair = {
|
|
2354
|
+
encode(message, writer = import_minimal.default.Writer.create()) {
|
|
2355
|
+
if (message.username !== "") {
|
|
2356
|
+
writer.uint32(10).string(message.username);
|
|
2357
|
+
}
|
|
2358
|
+
if (message.address !== "") {
|
|
2359
|
+
writer.uint32(18).string(message.address);
|
|
2360
|
+
}
|
|
2361
|
+
return writer;
|
|
2362
|
+
},
|
|
2363
|
+
decode(input, length) {
|
|
2364
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2365
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2366
|
+
const message = createBaseLinkedTwitterPair();
|
|
2367
|
+
while (reader.pos < end) {
|
|
2368
|
+
const tag = reader.uint32();
|
|
2369
|
+
switch (tag >>> 3) {
|
|
2370
|
+
case 1:
|
|
2371
|
+
if (tag != 10) {
|
|
2372
|
+
break;
|
|
2373
|
+
}
|
|
2374
|
+
message.username = reader.string();
|
|
2375
|
+
continue;
|
|
2376
|
+
case 2:
|
|
2377
|
+
if (tag != 18) {
|
|
2378
|
+
break;
|
|
2379
|
+
}
|
|
2380
|
+
message.address = reader.string();
|
|
2381
|
+
continue;
|
|
2382
|
+
}
|
|
2383
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2384
|
+
break;
|
|
2385
|
+
}
|
|
2386
|
+
reader.skipType(tag & 7);
|
|
2387
|
+
}
|
|
2388
|
+
return message;
|
|
2389
|
+
},
|
|
2390
|
+
create(base) {
|
|
2391
|
+
return LinkedTwitterPair.fromPartial(base ?? {});
|
|
2392
|
+
},
|
|
2393
|
+
fromPartial(object) {
|
|
2394
|
+
const message = createBaseLinkedTwitterPair();
|
|
2395
|
+
message.username = object.username ?? "";
|
|
2396
|
+
message.address = object.address ?? "";
|
|
2397
|
+
return message;
|
|
2398
|
+
}
|
|
2399
|
+
};
|
|
2400
|
+
function createBaseDripRequest() {
|
|
2401
|
+
return { username: "", address: "" };
|
|
2402
|
+
}
|
|
2403
|
+
var DripRequest = {
|
|
2404
|
+
encode(message, writer = import_minimal.default.Writer.create()) {
|
|
2405
|
+
if (message.username !== "") {
|
|
2406
|
+
writer.uint32(10).string(message.username);
|
|
2407
|
+
}
|
|
2408
|
+
if (message.address !== "") {
|
|
2409
|
+
writer.uint32(18).string(message.address);
|
|
2410
|
+
}
|
|
2411
|
+
return writer;
|
|
2412
|
+
},
|
|
2413
|
+
decode(input, length) {
|
|
2414
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2415
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2416
|
+
const message = createBaseDripRequest();
|
|
2417
|
+
while (reader.pos < end) {
|
|
2418
|
+
const tag = reader.uint32();
|
|
2419
|
+
switch (tag >>> 3) {
|
|
2420
|
+
case 1:
|
|
2421
|
+
if (tag != 10) {
|
|
2422
|
+
break;
|
|
2423
|
+
}
|
|
2424
|
+
message.username = reader.string();
|
|
2425
|
+
continue;
|
|
2426
|
+
case 2:
|
|
2427
|
+
if (tag != 18) {
|
|
2428
|
+
break;
|
|
2429
|
+
}
|
|
2430
|
+
message.address = reader.string();
|
|
2431
|
+
continue;
|
|
2432
|
+
}
|
|
2433
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2434
|
+
break;
|
|
2435
|
+
}
|
|
2436
|
+
reader.skipType(tag & 7);
|
|
2437
|
+
}
|
|
2438
|
+
return message;
|
|
2439
|
+
},
|
|
2440
|
+
create(base) {
|
|
2441
|
+
return DripRequest.fromPartial(base ?? {});
|
|
2442
|
+
},
|
|
2443
|
+
fromPartial(object) {
|
|
2444
|
+
const message = createBaseDripRequest();
|
|
2445
|
+
message.username = object.username ?? "";
|
|
2446
|
+
message.address = object.address ?? "";
|
|
2447
|
+
return message;
|
|
2448
|
+
}
|
|
2449
|
+
};
|
|
2450
|
+
function createBaseDripDevRequest() {
|
|
2451
|
+
return { address: "" };
|
|
2452
|
+
}
|
|
2453
|
+
var DripDevRequest = {
|
|
2454
|
+
encode(message, writer = import_minimal.default.Writer.create()) {
|
|
2455
|
+
if (message.address !== "") {
|
|
2456
|
+
writer.uint32(10).string(message.address);
|
|
2457
|
+
}
|
|
2458
|
+
return writer;
|
|
2459
|
+
},
|
|
2460
|
+
decode(input, length) {
|
|
2461
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2462
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2463
|
+
const message = createBaseDripDevRequest();
|
|
2464
|
+
while (reader.pos < end) {
|
|
2465
|
+
const tag = reader.uint32();
|
|
2466
|
+
switch (tag >>> 3) {
|
|
2467
|
+
case 1:
|
|
2468
|
+
if (tag != 10) {
|
|
2469
|
+
break;
|
|
2470
|
+
}
|
|
2471
|
+
message.address = reader.string();
|
|
2472
|
+
continue;
|
|
2473
|
+
}
|
|
2474
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2475
|
+
break;
|
|
2476
|
+
}
|
|
2477
|
+
reader.skipType(tag & 7);
|
|
2478
|
+
}
|
|
2479
|
+
return message;
|
|
2480
|
+
},
|
|
2481
|
+
create(base) {
|
|
2482
|
+
return DripDevRequest.fromPartial(base ?? {});
|
|
2483
|
+
},
|
|
2484
|
+
fromPartial(object) {
|
|
2485
|
+
const message = createBaseDripDevRequest();
|
|
2486
|
+
message.address = object.address ?? "";
|
|
2487
|
+
return message;
|
|
2488
|
+
}
|
|
2489
|
+
};
|
|
2490
|
+
function createBaseDripResponse() {
|
|
2491
|
+
return { dripTxHash: "", ecsTxHash: "" };
|
|
2492
|
+
}
|
|
2493
|
+
var DripResponse = {
|
|
2494
|
+
encode(message, writer = import_minimal.default.Writer.create()) {
|
|
2495
|
+
if (message.dripTxHash !== "") {
|
|
2496
|
+
writer.uint32(10).string(message.dripTxHash);
|
|
2497
|
+
}
|
|
2498
|
+
if (message.ecsTxHash !== "") {
|
|
2499
|
+
writer.uint32(18).string(message.ecsTxHash);
|
|
2500
|
+
}
|
|
2501
|
+
return writer;
|
|
2502
|
+
},
|
|
2503
|
+
decode(input, length) {
|
|
2504
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2505
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2506
|
+
const message = createBaseDripResponse();
|
|
2507
|
+
while (reader.pos < end) {
|
|
2508
|
+
const tag = reader.uint32();
|
|
2509
|
+
switch (tag >>> 3) {
|
|
2510
|
+
case 1:
|
|
2511
|
+
if (tag != 10) {
|
|
2512
|
+
break;
|
|
2513
|
+
}
|
|
2514
|
+
message.dripTxHash = reader.string();
|
|
2515
|
+
continue;
|
|
2516
|
+
case 2:
|
|
2517
|
+
if (tag != 18) {
|
|
2518
|
+
break;
|
|
2519
|
+
}
|
|
2520
|
+
message.ecsTxHash = reader.string();
|
|
2521
|
+
continue;
|
|
2522
|
+
}
|
|
2523
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2524
|
+
break;
|
|
2525
|
+
}
|
|
2526
|
+
reader.skipType(tag & 7);
|
|
2527
|
+
}
|
|
2528
|
+
return message;
|
|
2529
|
+
},
|
|
2530
|
+
create(base) {
|
|
2531
|
+
return DripResponse.fromPartial(base ?? {});
|
|
2532
|
+
},
|
|
2533
|
+
fromPartial(object) {
|
|
2534
|
+
const message = createBaseDripResponse();
|
|
2535
|
+
message.dripTxHash = object.dripTxHash ?? "";
|
|
2536
|
+
message.ecsTxHash = object.ecsTxHash ?? "";
|
|
2537
|
+
return message;
|
|
2538
|
+
}
|
|
2539
|
+
};
|
|
2540
|
+
function createBaseTimeUntilDripResponse() {
|
|
2541
|
+
return { timeUntilDripMinutes: 0, timeUntilDripSeconds: 0 };
|
|
2542
|
+
}
|
|
2543
|
+
var TimeUntilDripResponse = {
|
|
2544
|
+
encode(message, writer = import_minimal.default.Writer.create()) {
|
|
2545
|
+
if (message.timeUntilDripMinutes !== 0) {
|
|
2546
|
+
writer.uint32(9).double(message.timeUntilDripMinutes);
|
|
2547
|
+
}
|
|
2548
|
+
if (message.timeUntilDripSeconds !== 0) {
|
|
2549
|
+
writer.uint32(17).double(message.timeUntilDripSeconds);
|
|
2550
|
+
}
|
|
2551
|
+
return writer;
|
|
2552
|
+
},
|
|
2553
|
+
decode(input, length) {
|
|
2554
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2555
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2556
|
+
const message = createBaseTimeUntilDripResponse();
|
|
2557
|
+
while (reader.pos < end) {
|
|
2558
|
+
const tag = reader.uint32();
|
|
2559
|
+
switch (tag >>> 3) {
|
|
2560
|
+
case 1:
|
|
2561
|
+
if (tag != 9) {
|
|
2562
|
+
break;
|
|
2563
|
+
}
|
|
2564
|
+
message.timeUntilDripMinutes = reader.double();
|
|
2565
|
+
continue;
|
|
2566
|
+
case 2:
|
|
2567
|
+
if (tag != 17) {
|
|
2568
|
+
break;
|
|
2569
|
+
}
|
|
2570
|
+
message.timeUntilDripSeconds = reader.double();
|
|
2571
|
+
continue;
|
|
2572
|
+
}
|
|
2573
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2574
|
+
break;
|
|
2575
|
+
}
|
|
2576
|
+
reader.skipType(tag & 7);
|
|
2577
|
+
}
|
|
2578
|
+
return message;
|
|
2579
|
+
},
|
|
2580
|
+
create(base) {
|
|
2581
|
+
return TimeUntilDripResponse.fromPartial(base ?? {});
|
|
2582
|
+
},
|
|
2583
|
+
fromPartial(object) {
|
|
2584
|
+
const message = createBaseTimeUntilDripResponse();
|
|
2585
|
+
message.timeUntilDripMinutes = object.timeUntilDripMinutes ?? 0;
|
|
2586
|
+
message.timeUntilDripSeconds = object.timeUntilDripSeconds ?? 0;
|
|
2587
|
+
return message;
|
|
2588
|
+
}
|
|
2589
|
+
};
|
|
2590
|
+
function createBaseGetLinkedTwittersRequest() {
|
|
2591
|
+
return {};
|
|
2592
|
+
}
|
|
2593
|
+
var GetLinkedTwittersRequest = {
|
|
2594
|
+
encode(_, writer = import_minimal.default.Writer.create()) {
|
|
2595
|
+
return writer;
|
|
2596
|
+
},
|
|
2597
|
+
decode(input, length) {
|
|
2598
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2599
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2600
|
+
const message = createBaseGetLinkedTwittersRequest();
|
|
2601
|
+
while (reader.pos < end) {
|
|
2602
|
+
const tag = reader.uint32();
|
|
2603
|
+
switch (tag >>> 3) {
|
|
2604
|
+
}
|
|
2605
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2606
|
+
break;
|
|
2607
|
+
}
|
|
2608
|
+
reader.skipType(tag & 7);
|
|
2609
|
+
}
|
|
2610
|
+
return message;
|
|
2611
|
+
},
|
|
2612
|
+
create(base) {
|
|
2613
|
+
return GetLinkedTwittersRequest.fromPartial(base ?? {});
|
|
2614
|
+
},
|
|
2615
|
+
fromPartial(_) {
|
|
2616
|
+
const message = createBaseGetLinkedTwittersRequest();
|
|
2617
|
+
return message;
|
|
2618
|
+
}
|
|
2619
|
+
};
|
|
2620
|
+
function createBaseGetLinkedTwittersResponse() {
|
|
2621
|
+
return { linkedTwitters: [] };
|
|
2622
|
+
}
|
|
2623
|
+
var GetLinkedTwittersResponse = {
|
|
2624
|
+
encode(message, writer = import_minimal.default.Writer.create()) {
|
|
2625
|
+
for (const v of message.linkedTwitters) {
|
|
2626
|
+
LinkedTwitterPair.encode(v, writer.uint32(10).fork()).ldelim();
|
|
2627
|
+
}
|
|
2628
|
+
return writer;
|
|
2629
|
+
},
|
|
2630
|
+
decode(input, length) {
|
|
2631
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2632
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2633
|
+
const message = createBaseGetLinkedTwittersResponse();
|
|
2634
|
+
while (reader.pos < end) {
|
|
2635
|
+
const tag = reader.uint32();
|
|
2636
|
+
switch (tag >>> 3) {
|
|
2637
|
+
case 1:
|
|
2638
|
+
if (tag != 10) {
|
|
2639
|
+
break;
|
|
2640
|
+
}
|
|
2641
|
+
message.linkedTwitters.push(LinkedTwitterPair.decode(reader, reader.uint32()));
|
|
2642
|
+
continue;
|
|
2643
|
+
}
|
|
2644
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2645
|
+
break;
|
|
2646
|
+
}
|
|
2647
|
+
reader.skipType(tag & 7);
|
|
2648
|
+
}
|
|
2649
|
+
return message;
|
|
2650
|
+
},
|
|
2651
|
+
create(base) {
|
|
2652
|
+
return GetLinkedTwittersResponse.fromPartial(base ?? {});
|
|
2653
|
+
},
|
|
2654
|
+
fromPartial(object) {
|
|
2655
|
+
const message = createBaseGetLinkedTwittersResponse();
|
|
2656
|
+
message.linkedTwitters = object.linkedTwitters?.map((e) => LinkedTwitterPair.fromPartial(e)) || [];
|
|
2657
|
+
return message;
|
|
2658
|
+
}
|
|
2659
|
+
};
|
|
2660
|
+
function createBaseLinkedTwitterForAddressRequest() {
|
|
2661
|
+
return { address: "" };
|
|
2662
|
+
}
|
|
2663
|
+
var LinkedTwitterForAddressRequest = {
|
|
2664
|
+
encode(message, writer = import_minimal.default.Writer.create()) {
|
|
2665
|
+
if (message.address !== "") {
|
|
2666
|
+
writer.uint32(10).string(message.address);
|
|
2667
|
+
}
|
|
2668
|
+
return writer;
|
|
2669
|
+
},
|
|
2670
|
+
decode(input, length) {
|
|
2671
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2672
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2673
|
+
const message = createBaseLinkedTwitterForAddressRequest();
|
|
2674
|
+
while (reader.pos < end) {
|
|
2675
|
+
const tag = reader.uint32();
|
|
2676
|
+
switch (tag >>> 3) {
|
|
2677
|
+
case 1:
|
|
2678
|
+
if (tag != 10) {
|
|
2679
|
+
break;
|
|
2680
|
+
}
|
|
2681
|
+
message.address = reader.string();
|
|
2682
|
+
continue;
|
|
2683
|
+
}
|
|
2684
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2685
|
+
break;
|
|
2686
|
+
}
|
|
2687
|
+
reader.skipType(tag & 7);
|
|
2688
|
+
}
|
|
2689
|
+
return message;
|
|
2690
|
+
},
|
|
2691
|
+
create(base) {
|
|
2692
|
+
return LinkedTwitterForAddressRequest.fromPartial(base ?? {});
|
|
2693
|
+
},
|
|
2694
|
+
fromPartial(object) {
|
|
2695
|
+
const message = createBaseLinkedTwitterForAddressRequest();
|
|
2696
|
+
message.address = object.address ?? "";
|
|
2697
|
+
return message;
|
|
2698
|
+
}
|
|
2699
|
+
};
|
|
2700
|
+
function createBaseLinkedTwitterForAddressResponse() {
|
|
2701
|
+
return { username: "" };
|
|
2702
|
+
}
|
|
2703
|
+
var LinkedTwitterForAddressResponse = {
|
|
2704
|
+
encode(message, writer = import_minimal.default.Writer.create()) {
|
|
2705
|
+
if (message.username !== "") {
|
|
2706
|
+
writer.uint32(10).string(message.username);
|
|
2707
|
+
}
|
|
2708
|
+
return writer;
|
|
2709
|
+
},
|
|
2710
|
+
decode(input, length) {
|
|
2711
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2712
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2713
|
+
const message = createBaseLinkedTwitterForAddressResponse();
|
|
2714
|
+
while (reader.pos < end) {
|
|
2715
|
+
const tag = reader.uint32();
|
|
2716
|
+
switch (tag >>> 3) {
|
|
2717
|
+
case 1:
|
|
2718
|
+
if (tag != 10) {
|
|
2719
|
+
break;
|
|
2720
|
+
}
|
|
2721
|
+
message.username = reader.string();
|
|
2722
|
+
continue;
|
|
2723
|
+
}
|
|
2724
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2725
|
+
break;
|
|
2726
|
+
}
|
|
2727
|
+
reader.skipType(tag & 7);
|
|
2728
|
+
}
|
|
2729
|
+
return message;
|
|
2730
|
+
},
|
|
2731
|
+
create(base) {
|
|
2732
|
+
return LinkedTwitterForAddressResponse.fromPartial(base ?? {});
|
|
2733
|
+
},
|
|
2734
|
+
fromPartial(object) {
|
|
2735
|
+
const message = createBaseLinkedTwitterForAddressResponse();
|
|
2736
|
+
message.username = object.username ?? "";
|
|
2737
|
+
return message;
|
|
2738
|
+
}
|
|
2739
|
+
};
|
|
2740
|
+
function createBaseLinkedAddressForTwitterRequest() {
|
|
2741
|
+
return { username: "" };
|
|
2742
|
+
}
|
|
2743
|
+
var LinkedAddressForTwitterRequest = {
|
|
2744
|
+
encode(message, writer = import_minimal.default.Writer.create()) {
|
|
2745
|
+
if (message.username !== "") {
|
|
2746
|
+
writer.uint32(10).string(message.username);
|
|
2747
|
+
}
|
|
2748
|
+
return writer;
|
|
2749
|
+
},
|
|
2750
|
+
decode(input, length) {
|
|
2751
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2752
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2753
|
+
const message = createBaseLinkedAddressForTwitterRequest();
|
|
2754
|
+
while (reader.pos < end) {
|
|
2755
|
+
const tag = reader.uint32();
|
|
2756
|
+
switch (tag >>> 3) {
|
|
2757
|
+
case 1:
|
|
2758
|
+
if (tag != 10) {
|
|
2759
|
+
break;
|
|
2760
|
+
}
|
|
2761
|
+
message.username = reader.string();
|
|
2762
|
+
continue;
|
|
2763
|
+
}
|
|
2764
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2765
|
+
break;
|
|
2766
|
+
}
|
|
2767
|
+
reader.skipType(tag & 7);
|
|
2768
|
+
}
|
|
2769
|
+
return message;
|
|
2770
|
+
},
|
|
2771
|
+
create(base) {
|
|
2772
|
+
return LinkedAddressForTwitterRequest.fromPartial(base ?? {});
|
|
2773
|
+
},
|
|
2774
|
+
fromPartial(object) {
|
|
2775
|
+
const message = createBaseLinkedAddressForTwitterRequest();
|
|
2776
|
+
message.username = object.username ?? "";
|
|
2777
|
+
return message;
|
|
2778
|
+
}
|
|
2779
|
+
};
|
|
2780
|
+
function createBaseLinkedAddressForTwitterResponse() {
|
|
2781
|
+
return { address: "" };
|
|
2782
|
+
}
|
|
2783
|
+
var LinkedAddressForTwitterResponse = {
|
|
2784
|
+
encode(message, writer = import_minimal.default.Writer.create()) {
|
|
2785
|
+
if (message.address !== "") {
|
|
2786
|
+
writer.uint32(10).string(message.address);
|
|
2787
|
+
}
|
|
2788
|
+
return writer;
|
|
2789
|
+
},
|
|
2790
|
+
decode(input, length) {
|
|
2791
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2792
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2793
|
+
const message = createBaseLinkedAddressForTwitterResponse();
|
|
2794
|
+
while (reader.pos < end) {
|
|
2795
|
+
const tag = reader.uint32();
|
|
2796
|
+
switch (tag >>> 3) {
|
|
2797
|
+
case 1:
|
|
2798
|
+
if (tag != 10) {
|
|
2799
|
+
break;
|
|
2800
|
+
}
|
|
2801
|
+
message.address = reader.string();
|
|
2802
|
+
continue;
|
|
2803
|
+
}
|
|
2804
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2805
|
+
break;
|
|
2806
|
+
}
|
|
2807
|
+
reader.skipType(tag & 7);
|
|
2808
|
+
}
|
|
2809
|
+
return message;
|
|
2810
|
+
},
|
|
2811
|
+
create(base) {
|
|
2812
|
+
return LinkedAddressForTwitterResponse.fromPartial(base ?? {});
|
|
2813
|
+
},
|
|
2814
|
+
fromPartial(object) {
|
|
2815
|
+
const message = createBaseLinkedAddressForTwitterResponse();
|
|
2816
|
+
message.address = object.address ?? "";
|
|
2817
|
+
return message;
|
|
2818
|
+
}
|
|
2819
|
+
};
|
|
2820
|
+
function createBaseSetLinkedTwitterRequest() {
|
|
2821
|
+
return { address: "", username: "", signature: "" };
|
|
2822
|
+
}
|
|
2823
|
+
var SetLinkedTwitterRequest = {
|
|
2824
|
+
encode(message, writer = import_minimal.default.Writer.create()) {
|
|
2825
|
+
if (message.address !== "") {
|
|
2826
|
+
writer.uint32(10).string(message.address);
|
|
2827
|
+
}
|
|
2828
|
+
if (message.username !== "") {
|
|
2829
|
+
writer.uint32(18).string(message.username);
|
|
2830
|
+
}
|
|
2831
|
+
if (message.signature !== "") {
|
|
2832
|
+
writer.uint32(26).string(message.signature);
|
|
2833
|
+
}
|
|
2834
|
+
return writer;
|
|
2835
|
+
},
|
|
2836
|
+
decode(input, length) {
|
|
2837
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2838
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2839
|
+
const message = createBaseSetLinkedTwitterRequest();
|
|
2840
|
+
while (reader.pos < end) {
|
|
2841
|
+
const tag = reader.uint32();
|
|
2842
|
+
switch (tag >>> 3) {
|
|
2843
|
+
case 1:
|
|
2844
|
+
if (tag != 10) {
|
|
2845
|
+
break;
|
|
2846
|
+
}
|
|
2847
|
+
message.address = reader.string();
|
|
2848
|
+
continue;
|
|
2849
|
+
case 2:
|
|
2850
|
+
if (tag != 18) {
|
|
2851
|
+
break;
|
|
2852
|
+
}
|
|
2853
|
+
message.username = reader.string();
|
|
2854
|
+
continue;
|
|
2855
|
+
case 3:
|
|
2856
|
+
if (tag != 26) {
|
|
2857
|
+
break;
|
|
2858
|
+
}
|
|
2859
|
+
message.signature = reader.string();
|
|
2860
|
+
continue;
|
|
2861
|
+
}
|
|
2862
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2863
|
+
break;
|
|
2864
|
+
}
|
|
2865
|
+
reader.skipType(tag & 7);
|
|
2866
|
+
}
|
|
2867
|
+
return message;
|
|
2868
|
+
},
|
|
2869
|
+
create(base) {
|
|
2870
|
+
return SetLinkedTwitterRequest.fromPartial(base ?? {});
|
|
2871
|
+
},
|
|
2872
|
+
fromPartial(object) {
|
|
2873
|
+
const message = createBaseSetLinkedTwitterRequest();
|
|
2874
|
+
message.address = object.address ?? "";
|
|
2875
|
+
message.username = object.username ?? "";
|
|
2876
|
+
message.signature = object.signature ?? "";
|
|
2877
|
+
return message;
|
|
2878
|
+
}
|
|
2879
|
+
};
|
|
2880
|
+
function createBaseSetLinkedTwitterResponse() {
|
|
2881
|
+
return {};
|
|
2882
|
+
}
|
|
2883
|
+
var SetLinkedTwitterResponse = {
|
|
2884
|
+
encode(_, writer = import_minimal.default.Writer.create()) {
|
|
2885
|
+
return writer;
|
|
2886
|
+
},
|
|
2887
|
+
decode(input, length) {
|
|
2888
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2889
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2890
|
+
const message = createBaseSetLinkedTwitterResponse();
|
|
2891
|
+
while (reader.pos < end) {
|
|
2892
|
+
const tag = reader.uint32();
|
|
2893
|
+
switch (tag >>> 3) {
|
|
2894
|
+
}
|
|
2895
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2896
|
+
break;
|
|
2897
|
+
}
|
|
2898
|
+
reader.skipType(tag & 7);
|
|
2899
|
+
}
|
|
2900
|
+
return message;
|
|
2901
|
+
},
|
|
2902
|
+
create(base) {
|
|
2903
|
+
return SetLinkedTwitterResponse.fromPartial(base ?? {});
|
|
2904
|
+
},
|
|
2905
|
+
fromPartial(_) {
|
|
2906
|
+
const message = createBaseSetLinkedTwitterResponse();
|
|
2907
|
+
return message;
|
|
2908
|
+
}
|
|
2909
|
+
};
|
|
2910
|
+
var FaucetServiceDefinition = {
|
|
2911
|
+
name: "FaucetService",
|
|
2912
|
+
fullName: "faucet.FaucetService",
|
|
2913
|
+
methods: {
|
|
2914
|
+
drip: {
|
|
2915
|
+
name: "Drip",
|
|
2916
|
+
requestType: DripRequest,
|
|
2917
|
+
requestStream: false,
|
|
2918
|
+
responseType: DripResponse,
|
|
2919
|
+
responseStream: false,
|
|
2920
|
+
options: {}
|
|
2921
|
+
},
|
|
2922
|
+
dripDev: {
|
|
2923
|
+
name: "DripDev",
|
|
2924
|
+
requestType: DripDevRequest,
|
|
2925
|
+
requestStream: false,
|
|
2926
|
+
responseType: DripResponse,
|
|
2927
|
+
responseStream: false,
|
|
2928
|
+
options: {}
|
|
2929
|
+
},
|
|
2930
|
+
dripVerifyTweet: {
|
|
2931
|
+
name: "DripVerifyTweet",
|
|
2932
|
+
requestType: DripRequest,
|
|
2933
|
+
requestStream: false,
|
|
2934
|
+
responseType: DripResponse,
|
|
2935
|
+
responseStream: false,
|
|
2936
|
+
options: {}
|
|
2937
|
+
},
|
|
2938
|
+
timeUntilDrip: {
|
|
2939
|
+
name: "TimeUntilDrip",
|
|
2940
|
+
requestType: DripRequest,
|
|
2941
|
+
requestStream: false,
|
|
2942
|
+
responseType: TimeUntilDripResponse,
|
|
2943
|
+
responseStream: false,
|
|
2944
|
+
options: {}
|
|
2945
|
+
},
|
|
2946
|
+
getLinkedTwitters: {
|
|
2947
|
+
name: "GetLinkedTwitters",
|
|
2948
|
+
requestType: GetLinkedTwittersRequest,
|
|
2949
|
+
requestStream: false,
|
|
2950
|
+
responseType: GetLinkedTwittersResponse,
|
|
2951
|
+
responseStream: false,
|
|
2952
|
+
options: {}
|
|
2953
|
+
},
|
|
2954
|
+
getLinkedTwitterForAddress: {
|
|
2955
|
+
name: "GetLinkedTwitterForAddress",
|
|
2956
|
+
requestType: LinkedTwitterForAddressRequest,
|
|
2957
|
+
requestStream: false,
|
|
2958
|
+
responseType: LinkedTwitterForAddressResponse,
|
|
2959
|
+
responseStream: false,
|
|
2960
|
+
options: {}
|
|
2961
|
+
},
|
|
2962
|
+
getLinkedAddressForTwitter: {
|
|
2963
|
+
name: "GetLinkedAddressForTwitter",
|
|
2964
|
+
requestType: LinkedAddressForTwitterRequest,
|
|
2965
|
+
requestStream: false,
|
|
2966
|
+
responseType: LinkedAddressForTwitterResponse,
|
|
2967
|
+
responseStream: false,
|
|
2968
|
+
options: {}
|
|
2969
|
+
},
|
|
2970
|
+
/** Admin utility endpoints for modifying state. Requires a signature with faucet private key. */
|
|
2971
|
+
setLinkedTwitter: {
|
|
2972
|
+
name: "SetLinkedTwitter",
|
|
2973
|
+
requestType: SetLinkedTwitterRequest,
|
|
2974
|
+
requestStream: false,
|
|
2975
|
+
responseType: SetLinkedTwitterResponse,
|
|
2976
|
+
responseStream: false,
|
|
2977
|
+
options: {}
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
};
|
|
2981
|
+
var tsProtoGlobalThis = (() => {
|
|
2982
|
+
if (typeof globalThis !== "undefined") {
|
|
2983
|
+
return globalThis;
|
|
2984
|
+
}
|
|
2985
|
+
if (typeof self !== "undefined") {
|
|
2986
|
+
return self;
|
|
2987
|
+
}
|
|
2988
|
+
if (typeof window !== "undefined") {
|
|
2989
|
+
return window;
|
|
2990
|
+
}
|
|
2991
|
+
if (typeof global !== "undefined") {
|
|
2992
|
+
return global;
|
|
2993
|
+
}
|
|
2994
|
+
throw "Unable to locate global object";
|
|
2995
|
+
})();
|
|
2996
|
+
if (import_minimal.default.util.Long !== long_default) {
|
|
2997
|
+
import_minimal.default.util.Long = long_default;
|
|
2998
|
+
import_minimal.default.configure();
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
// src/commands/faucet.ts
|
|
3002
|
+
import { createChannel, createClient } from "nice-grpc-web";
|
|
3003
|
+
import chalk from "chalk";
|
|
3004
|
+
import { NodeHttpTransport } from "@improbable-eng/grpc-web-node-http-transport";
|
|
3005
|
+
function createFaucetService(url) {
|
|
3006
|
+
return createClient(FaucetServiceDefinition, createChannel(url, NodeHttpTransport()));
|
|
3007
|
+
}
|
|
3008
|
+
var commandModule2 = {
|
|
3009
|
+
command: "faucet",
|
|
3010
|
+
describe: "Interact with a MUD faucet",
|
|
3011
|
+
builder(yargs) {
|
|
3012
|
+
return yargs.options({
|
|
3013
|
+
dripDev: {
|
|
3014
|
+
type: "boolean",
|
|
3015
|
+
desc: "Request a drip from the dev endpoint (requires faucet to have dev mode enabled)",
|
|
3016
|
+
default: true
|
|
3017
|
+
},
|
|
3018
|
+
faucetUrl: {
|
|
3019
|
+
type: "string",
|
|
3020
|
+
desc: "URL of the MUD faucet",
|
|
3021
|
+
default: "https://faucet.testnet-mud-services.linfra.xyz"
|
|
3022
|
+
},
|
|
3023
|
+
address: {
|
|
3024
|
+
type: "string",
|
|
3025
|
+
desc: "Ethereum address to fund",
|
|
3026
|
+
required: true
|
|
3027
|
+
}
|
|
3028
|
+
});
|
|
3029
|
+
},
|
|
3030
|
+
async handler({ dripDev, faucetUrl, address }) {
|
|
3031
|
+
const faucet = createFaucetService(faucetUrl);
|
|
3032
|
+
if (dripDev) {
|
|
3033
|
+
console.log(chalk.yellow("Dripping to", address));
|
|
3034
|
+
await faucet.dripDev({ address });
|
|
3035
|
+
console.log(chalk.yellow("Success"));
|
|
3036
|
+
}
|
|
3037
|
+
process.exit(0);
|
|
3038
|
+
}
|
|
3039
|
+
};
|
|
3040
|
+
var faucet_default = commandModule2;
|
|
3041
|
+
|
|
3042
|
+
// src/commands/gas-report.ts
|
|
3043
|
+
import { readFileSync, writeFileSync, rmSync as rmSync2 } from "fs";
|
|
3044
|
+
import { execa } from "execa";
|
|
3045
|
+
import chalk2 from "chalk";
|
|
3046
|
+
import { table, getBorderCharacters } from "table";
|
|
3047
|
+
var tempFileSuffix = "MudGasReport";
|
|
3048
|
+
var commandModule3 = {
|
|
3049
|
+
command: "gas-report",
|
|
3050
|
+
describe: "Create a gas report",
|
|
3051
|
+
builder(yargs) {
|
|
3052
|
+
return yargs.options({
|
|
3053
|
+
path: { type: "array", string: true, default: ["Gas.t.sol"], desc: "File containing the gas tests" },
|
|
3054
|
+
save: { type: "string", desc: "Save the gas report to a file" },
|
|
3055
|
+
compare: { type: "string", desc: "Compare to an existing gas report" }
|
|
3056
|
+
});
|
|
3057
|
+
},
|
|
3058
|
+
async handler({ path: files, save, compare: compare2 }) {
|
|
3059
|
+
const validFiles = files.filter((file) => file.endsWith(".t.sol"));
|
|
3060
|
+
const tempFiles = await Promise.all(validFiles.map((file) => createGasReport(file)));
|
|
3061
|
+
process.once("SIGINT", () => {
|
|
3062
|
+
console.log("caught sigint, deleting temp files");
|
|
3063
|
+
tempFiles.forEach((file) => rmSync2(file));
|
|
3064
|
+
});
|
|
3065
|
+
let gasReport;
|
|
3066
|
+
try {
|
|
3067
|
+
gasReport = await runGasReport();
|
|
3068
|
+
} catch {
|
|
3069
|
+
setTimeout(() => process.exit());
|
|
3070
|
+
return;
|
|
3071
|
+
} finally {
|
|
3072
|
+
tempFiles.forEach((file) => rmSync2(file));
|
|
3073
|
+
}
|
|
3074
|
+
if (compare2) {
|
|
3075
|
+
try {
|
|
3076
|
+
const compareGasReport = JSON.parse(readFileSync(compare2, "utf8"));
|
|
3077
|
+
gasReport = gasReport.map((entry) => {
|
|
3078
|
+
const prevEntry = compareGasReport.find(
|
|
3079
|
+
(e) => e.name === entry.name && e.functionCall === entry.functionCall
|
|
3080
|
+
);
|
|
3081
|
+
return { ...entry, prevGasUsed: prevEntry?.gasUsed };
|
|
3082
|
+
});
|
|
3083
|
+
} catch {
|
|
3084
|
+
console.log(chalk2.red(`Gas report to compare not found: ${compare2}`));
|
|
3085
|
+
compare2 = void 0;
|
|
3086
|
+
}
|
|
3087
|
+
}
|
|
3088
|
+
printGasReport(gasReport, compare2);
|
|
3089
|
+
if (save)
|
|
3090
|
+
saveGasReport(gasReport, save);
|
|
3091
|
+
process.exit(0);
|
|
3092
|
+
}
|
|
3093
|
+
};
|
|
3094
|
+
var gas_report_default = commandModule3;
|
|
3095
|
+
async function createGasReport(filename) {
|
|
3096
|
+
console.log("Creating gas report for", chalk2.bold(filename));
|
|
3097
|
+
const fileContents = readFileSync(filename, "utf8");
|
|
3098
|
+
let newFile = fileContents;
|
|
3099
|
+
const functionRegex = new RegExp(/function (.*){/g);
|
|
3100
|
+
let functionMatch;
|
|
3101
|
+
while ((functionMatch = functionRegex.exec(fileContents)) !== null) {
|
|
3102
|
+
const functionSignature = functionMatch[0];
|
|
3103
|
+
newFile = newFile.replace(functionSignature, `${functionSignature}
|
|
3104
|
+
uint256 _gasreport;`);
|
|
3105
|
+
}
|
|
3106
|
+
const regex = new RegExp(/\/\/ !gasreport (.*)\n(.*)/g);
|
|
3107
|
+
let match;
|
|
3108
|
+
while ((match = regex.exec(fileContents)) !== null) {
|
|
3109
|
+
const name = match[1];
|
|
3110
|
+
const functionCall = match[2].trim();
|
|
3111
|
+
newFile = newFile.replace(
|
|
3112
|
+
match[0],
|
|
3113
|
+
`
|
|
3114
|
+
_gasreport = gasleft();
|
|
3115
|
+
${functionCall}
|
|
3116
|
+
_gasreport = _gasreport - gasleft();
|
|
3117
|
+
console.log("GAS REPORT(${filename}): ${name} [${functionCall.replaceAll('"', '\\"')}]:", _gasreport);`
|
|
3118
|
+
);
|
|
3119
|
+
}
|
|
3120
|
+
newFile = newFile.replace(/pure/g, "view");
|
|
3121
|
+
const tempFileName = filename.replace(/\.t\.sol$/, `${tempFileSuffix}.t.sol`);
|
|
3122
|
+
writeFileSync(tempFileName, newFile);
|
|
3123
|
+
return tempFileName;
|
|
3124
|
+
}
|
|
3125
|
+
async function runGasReport() {
|
|
3126
|
+
console.log("Running gas report");
|
|
3127
|
+
const gasReport = [];
|
|
3128
|
+
let logs = "";
|
|
3129
|
+
try {
|
|
3130
|
+
const child = execa("forge", ["test", "--match-path", `*${tempFileSuffix}*`, "-vvv"], {
|
|
3131
|
+
stdio: ["inherit", "pipe", "inherit"]
|
|
3132
|
+
});
|
|
3133
|
+
logs = (await child).stdout;
|
|
3134
|
+
} catch (error) {
|
|
3135
|
+
console.log(error.stdout ?? error);
|
|
3136
|
+
console.log(chalk2.red("\n-----------\nError while running the gas report (see above)"));
|
|
3137
|
+
throw error;
|
|
3138
|
+
}
|
|
3139
|
+
const gasReportRegex = new RegExp(/GAS REPORT\((.*)\): (.*) \[(.*)\]: (.*)/g);
|
|
3140
|
+
let gasReportMatch;
|
|
3141
|
+
while ((gasReportMatch = gasReportRegex.exec(logs)) !== null) {
|
|
3142
|
+
const source = gasReportMatch[1];
|
|
3143
|
+
const name = gasReportMatch[2];
|
|
3144
|
+
const functionCall = gasReportMatch[3].replace(";", "");
|
|
3145
|
+
const gasUsed = parseInt(gasReportMatch[4]);
|
|
3146
|
+
gasReport.push({ source, name, functionCall, gasUsed });
|
|
3147
|
+
}
|
|
3148
|
+
gasReport.sort((a, b) => a.source.localeCompare(b.source));
|
|
3149
|
+
return gasReport;
|
|
3150
|
+
}
|
|
3151
|
+
function printGasReport(gasReport, compare2) {
|
|
3152
|
+
if (compare2)
|
|
3153
|
+
console.log(chalk2.bold(`Gas report compared to ${compare2}`));
|
|
3154
|
+
const headers = [
|
|
3155
|
+
chalk2.bold("Source"),
|
|
3156
|
+
chalk2.bold("Name"),
|
|
3157
|
+
chalk2.bold("Function call"),
|
|
3158
|
+
chalk2.bold("Gas used"),
|
|
3159
|
+
...compare2 ? [chalk2.bold("Prev gas used"), chalk2.bold("Difference")] : []
|
|
3160
|
+
];
|
|
3161
|
+
const values = gasReport.map((entry) => {
|
|
3162
|
+
const diff = entry.prevGasUsed ? entry.gasUsed - entry.prevGasUsed : 0;
|
|
3163
|
+
const diffEntry = diff > 0 ? chalk2.red(`+${diff}`) : diff < 0 ? chalk2.green(`${diff}`) : diff;
|
|
3164
|
+
const compareColumns = compare2 ? [entry.prevGasUsed ?? "n/a", diffEntry] : [];
|
|
3165
|
+
const gasUsedEntry = diff > 0 ? chalk2.red(entry.gasUsed) : diff < 0 ? chalk2.green(entry.gasUsed) : entry.gasUsed;
|
|
3166
|
+
return [entry.source, entry.name, entry.functionCall, gasUsedEntry, ...compareColumns];
|
|
3167
|
+
});
|
|
3168
|
+
const rows = [headers, ...values];
|
|
3169
|
+
console.log(table(rows, { border: getBorderCharacters("norc") }));
|
|
3170
|
+
}
|
|
3171
|
+
function saveGasReport(gasReport, path7) {
|
|
3172
|
+
console.log(chalk2.bold(`Saving gas report to ${path7}`));
|
|
3173
|
+
writeFileSync(path7, `${JSON.stringify(gasReport, null, 2)}
|
|
3174
|
+
`);
|
|
3175
|
+
}
|
|
3176
|
+
|
|
3177
|
+
// src/commands/hello.ts
|
|
3178
|
+
var commandModule4 = {
|
|
3179
|
+
command: "hello <name>",
|
|
3180
|
+
describe: "Greet <name> with Hello",
|
|
3181
|
+
builder(yargs) {
|
|
3182
|
+
return yargs.options({
|
|
3183
|
+
upper: { type: "boolean" }
|
|
3184
|
+
}).positional("name", { type: "string", demandOption: true });
|
|
3185
|
+
},
|
|
3186
|
+
handler({ name }) {
|
|
3187
|
+
const greeting = `Gm, ${name}!`;
|
|
3188
|
+
console.log(greeting);
|
|
3189
|
+
process.exit(0);
|
|
3190
|
+
}
|
|
3191
|
+
};
|
|
3192
|
+
var hello_default = commandModule4;
|
|
3193
|
+
|
|
3194
|
+
// src/commands/tablegen.ts
|
|
3195
|
+
import path2 from "path";
|
|
3196
|
+
import { loadStoreConfig } from "@latticexyz/config";
|
|
3197
|
+
var commandModule5 = {
|
|
3198
|
+
command: "tablegen",
|
|
3199
|
+
describe: "Autogenerate MUD Store table libraries based on the config file",
|
|
3200
|
+
builder(yargs) {
|
|
3201
|
+
return yargs.options({
|
|
3202
|
+
configPath: { type: "string", desc: "Path to the config file" }
|
|
3203
|
+
});
|
|
3204
|
+
},
|
|
3205
|
+
async handler({ configPath }) {
|
|
3206
|
+
const config = await loadStoreConfig(configPath);
|
|
3207
|
+
const srcDir = await getSrcDirectory();
|
|
3208
|
+
await tablegen(config, path2.join(srcDir, config.codegenDirectory));
|
|
3209
|
+
process.exit(0);
|
|
3210
|
+
}
|
|
3211
|
+
};
|
|
3212
|
+
var tablegen_default = commandModule5;
|
|
3213
|
+
|
|
3214
|
+
// src/commands/tsgen.ts
|
|
3215
|
+
import { loadStoreConfig as loadStoreConfig2 } from "@latticexyz/config";
|
|
3216
|
+
var commandModule6 = {
|
|
3217
|
+
command: "tsgen",
|
|
3218
|
+
describe: "Autogenerate MUD typescript definitions based on the config file",
|
|
3219
|
+
builder(yargs) {
|
|
3220
|
+
return yargs.options({
|
|
3221
|
+
configPath: { type: "string", demandOption: true, desc: "Path to the config file" },
|
|
3222
|
+
out: { type: "string", demandOption: true, desc: "Directory to output MUD typescript definition files" }
|
|
3223
|
+
});
|
|
3224
|
+
},
|
|
3225
|
+
async handler(args) {
|
|
3226
|
+
const { configPath, out } = args;
|
|
3227
|
+
const config = await loadStoreConfig2(configPath);
|
|
3228
|
+
await tsgen(config, out);
|
|
3229
|
+
process.exit(0);
|
|
3230
|
+
}
|
|
3231
|
+
};
|
|
3232
|
+
var tsgen_default = commandModule6;
|
|
3233
|
+
|
|
3234
|
+
// src/commands/deploy-v2.ts
|
|
3235
|
+
import chalk3 from "chalk";
|
|
3236
|
+
import glob from "glob";
|
|
3237
|
+
import path3, { basename } from "path";
|
|
3238
|
+
import { loadStoreConfig as loadStoreConfig3, loadWorldConfig } from "@latticexyz/config";
|
|
3239
|
+
import { MUDError } from "@latticexyz/config";
|
|
3240
|
+
import { mkdirSync, writeFileSync as writeFileSync2 } from "fs";
|
|
3241
|
+
|
|
3242
|
+
// src/utils/getChainId.ts
|
|
3243
|
+
import { ethers } from "ethers";
|
|
3244
|
+
async function getChainId(rpc) {
|
|
3245
|
+
const { result: chainId } = await ethers.utils.fetchJson(
|
|
3246
|
+
rpc,
|
|
3247
|
+
'{ "id": 42, "jsonrpc": "2.0", "method": "eth_chainId", "params": [ ] }'
|
|
3248
|
+
);
|
|
3249
|
+
return Number(chainId);
|
|
3250
|
+
}
|
|
3251
|
+
|
|
3252
|
+
// src/commands/deploy-v2.ts
|
|
3253
|
+
var yDeployOptions = {
|
|
3254
|
+
configPath: { type: "string", desc: "Path to the config file" },
|
|
3255
|
+
clean: { type: "boolean", desc: "Remove the build forge artifacts and cache directories before building" },
|
|
3256
|
+
printConfig: { type: "boolean", desc: "Print the resolved config" },
|
|
3257
|
+
profile: { type: "string", desc: "The foundry profile to use" },
|
|
3258
|
+
debug: { type: "boolean", desc: "Print debug logs, like full error messages" },
|
|
3259
|
+
priorityFeeMultiplier: {
|
|
3260
|
+
type: "number",
|
|
3261
|
+
desc: "Multiply the estimated priority fee by the provided factor",
|
|
3262
|
+
default: 1
|
|
3263
|
+
},
|
|
3264
|
+
saveDeployment: { type: "boolean", desc: "Save the deployment info to a file", default: true },
|
|
3265
|
+
rpc: { type: "string", desc: "The RPC URL to use. Defaults to the RPC url from the local foundry.toml" },
|
|
3266
|
+
worldAddress: { type: "string", desc: "Deploy to an existing World at the given address" },
|
|
3267
|
+
srcDir: { type: "string", desc: "Source directory. Defaults to foundry src directory." }
|
|
3268
|
+
};
|
|
3269
|
+
async function deployHandler(args) {
|
|
3270
|
+
args.profile = args.profile ?? process.env.FOUNDRY_PROFILE;
|
|
3271
|
+
const { configPath, printConfig, profile, clean } = args;
|
|
3272
|
+
const rpc = args.rpc ?? await getRpcUrl(profile);
|
|
3273
|
+
console.log(
|
|
3274
|
+
chalk3.bgBlue(
|
|
3275
|
+
chalk3.whiteBright(`
|
|
3276
|
+
Deploying MUD v2 contracts${profile ? " with profile " + profile : ""} to RPC ${rpc}
|
|
3277
|
+
`)
|
|
3278
|
+
)
|
|
3279
|
+
);
|
|
3280
|
+
if (clean)
|
|
3281
|
+
await forge(["clean"], { profile });
|
|
3282
|
+
await forge(["build"], { profile });
|
|
3283
|
+
const srcDir = args?.srcDir ?? await getSrcDirectory();
|
|
3284
|
+
const existingContracts = glob.sync(`${srcDir}/**/*.sol`).map((path7) => basename(path7, ".sol"));
|
|
3285
|
+
const worldConfig = await loadWorldConfig(configPath, existingContracts);
|
|
3286
|
+
const storeConfig = await loadStoreConfig3(configPath);
|
|
3287
|
+
const mudConfig = { ...worldConfig, ...storeConfig };
|
|
3288
|
+
if (printConfig)
|
|
3289
|
+
console.log(chalk3.green("\nResolved config:\n"), JSON.stringify(mudConfig, null, 2));
|
|
3290
|
+
try {
|
|
3291
|
+
const privateKey = process.env.PRIVATE_KEY;
|
|
3292
|
+
if (!privateKey)
|
|
3293
|
+
throw new MUDError("Missing PRIVATE_KEY environment variable");
|
|
3294
|
+
const deploymentInfo = await deploy(mudConfig, { ...args, rpc, privateKey });
|
|
3295
|
+
if (args.saveDeployment) {
|
|
3296
|
+
const chainId = await getChainId(rpc);
|
|
3297
|
+
const outputDir = path3.join(mudConfig.deploysDirectory, chainId.toString());
|
|
3298
|
+
mkdirSync(outputDir, { recursive: true });
|
|
3299
|
+
writeFileSync2(path3.join(outputDir, "latest.json"), JSON.stringify(deploymentInfo, null, 2));
|
|
3300
|
+
writeFileSync2(path3.join(outputDir, Date.now() + ".json"), JSON.stringify(deploymentInfo, null, 2));
|
|
3301
|
+
console.log(chalk3.bgGreen(chalk3.whiteBright(`
|
|
3302
|
+
Deployment result (written to ${outputDir}):
|
|
3303
|
+
`)));
|
|
3304
|
+
}
|
|
3305
|
+
console.log(deploymentInfo);
|
|
3306
|
+
return deploymentInfo;
|
|
3307
|
+
} catch (error) {
|
|
3308
|
+
logError(error);
|
|
3309
|
+
process.exit(1);
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
var commandModule7 = {
|
|
3313
|
+
command: "deploy-v2",
|
|
3314
|
+
describe: "Deploy MUD v2 contracts",
|
|
3315
|
+
builder(yargs) {
|
|
3316
|
+
return yargs.options(yDeployOptions);
|
|
3317
|
+
},
|
|
3318
|
+
async handler(args) {
|
|
3319
|
+
await deployHandler(args);
|
|
3320
|
+
process.exit(0);
|
|
3321
|
+
}
|
|
3322
|
+
};
|
|
3323
|
+
var deploy_v2_default = commandModule7;
|
|
3324
|
+
|
|
3325
|
+
// src/commands/worldgen.ts
|
|
3326
|
+
import { loadStoreConfig as loadStoreConfig4, loadWorldConfig as loadWorldConfig2 } from "@latticexyz/config";
|
|
3327
|
+
import glob2 from "glob";
|
|
3328
|
+
import path5, { basename as basename2 } from "path";
|
|
3329
|
+
|
|
3330
|
+
// src/render-solidity/worldgen.ts
|
|
3331
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
3332
|
+
import path4 from "path";
|
|
3333
|
+
|
|
3334
|
+
// src/utils/contractToInterface.ts
|
|
3335
|
+
import { parse, visit } from "@solidity-parser/parser";
|
|
3336
|
+
import { MUDError as MUDError2 } from "@latticexyz/config";
|
|
3337
|
+
function contractToInterface(data, contractName) {
|
|
3338
|
+
const ast = parse(data);
|
|
3339
|
+
let withContract = false;
|
|
3340
|
+
let symbols = [];
|
|
3341
|
+
const functions = [];
|
|
3342
|
+
visit(ast, {
|
|
3343
|
+
ContractDefinition({ name }) {
|
|
3344
|
+
if (name === contractName) {
|
|
3345
|
+
withContract = true;
|
|
3346
|
+
}
|
|
3347
|
+
},
|
|
3348
|
+
FunctionDefinition({ name, visibility, parameters, stateMutability, returnParameters, isConstructor, isFallback, isReceiveEther }, parent) {
|
|
3349
|
+
if (parent !== void 0 && parent.type === "ContractDefinition" && parent.name === contractName) {
|
|
3350
|
+
try {
|
|
3351
|
+
if (isConstructor || isFallback || isReceiveEther)
|
|
3352
|
+
return;
|
|
3353
|
+
if (visibility === "default")
|
|
3354
|
+
throw new MUDError2(`Visibility is not specified`);
|
|
3355
|
+
if (visibility === "external" || visibility === "public") {
|
|
3356
|
+
functions.push({
|
|
3357
|
+
name: name === null ? "" : name,
|
|
3358
|
+
parameters: parameters.map(parseParameter),
|
|
3359
|
+
stateMutability: stateMutability || "",
|
|
3360
|
+
returnParameters: returnParameters === null ? [] : returnParameters.map(parseParameter)
|
|
3361
|
+
});
|
|
3362
|
+
for (const { typeName } of parameters.concat(returnParameters ?? [])) {
|
|
3363
|
+
symbols = symbols.concat(typeNameToExternalSymbols(typeName));
|
|
3364
|
+
}
|
|
3365
|
+
}
|
|
3366
|
+
} catch (error) {
|
|
3367
|
+
if (error instanceof MUDError2) {
|
|
3368
|
+
error.message = `Function "${name}" in contract "${contractName}": ${error.message}`;
|
|
3369
|
+
}
|
|
3370
|
+
throw error;
|
|
3371
|
+
}
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
});
|
|
3375
|
+
if (!withContract) {
|
|
3376
|
+
throw new MUDError2(`Contract not found: ${contractName}`);
|
|
3377
|
+
}
|
|
3378
|
+
return {
|
|
3379
|
+
functions,
|
|
3380
|
+
symbols
|
|
3381
|
+
};
|
|
3382
|
+
}
|
|
3383
|
+
function parseParameter({ name, typeName, storageLocation }) {
|
|
3384
|
+
let typedNameWithLocation = "";
|
|
3385
|
+
const { name: flattenedTypeName, stateMutability } = flattenTypeName(typeName);
|
|
3386
|
+
typedNameWithLocation += flattenedTypeName;
|
|
3387
|
+
if (stateMutability !== null) {
|
|
3388
|
+
typedNameWithLocation += ` ${stateMutability}`;
|
|
3389
|
+
}
|
|
3390
|
+
if (storageLocation !== null) {
|
|
3391
|
+
typedNameWithLocation += ` ${storageLocation}`;
|
|
3392
|
+
}
|
|
3393
|
+
if (name !== null) {
|
|
3394
|
+
typedNameWithLocation += ` ${name}`;
|
|
3395
|
+
}
|
|
3396
|
+
return typedNameWithLocation;
|
|
3397
|
+
}
|
|
3398
|
+
function flattenTypeName(typeName) {
|
|
3399
|
+
if (typeName === null) {
|
|
3400
|
+
return {
|
|
3401
|
+
name: "",
|
|
3402
|
+
stateMutability: null
|
|
3403
|
+
};
|
|
3404
|
+
}
|
|
3405
|
+
if (typeName.type === "ElementaryTypeName") {
|
|
3406
|
+
return {
|
|
3407
|
+
name: typeName.name,
|
|
3408
|
+
stateMutability: typeName.stateMutability
|
|
3409
|
+
};
|
|
3410
|
+
} else if (typeName.type === "UserDefinedTypeName") {
|
|
3411
|
+
return {
|
|
3412
|
+
name: typeName.namePath,
|
|
3413
|
+
stateMutability: null
|
|
3414
|
+
};
|
|
3415
|
+
} else if (typeName.type === "ArrayTypeName") {
|
|
3416
|
+
const length = typeName.length?.type === "NumberLiteral" ? typeName.length.number : "";
|
|
3417
|
+
const { name, stateMutability } = flattenTypeName(typeName.baseTypeName);
|
|
3418
|
+
return {
|
|
3419
|
+
name: `${name}[${length}]`,
|
|
3420
|
+
stateMutability
|
|
3421
|
+
};
|
|
3422
|
+
} else {
|
|
3423
|
+
throw new MUDError2(`Invalid typeName.type ${typeName.type}`);
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
function typeNameToExternalSymbols(typeName) {
|
|
3427
|
+
if (typeName?.type === "UserDefinedTypeName") {
|
|
3428
|
+
const symbol = typeName.namePath.split(".")[0];
|
|
3429
|
+
return [symbol];
|
|
3430
|
+
} else if (typeName?.type === "ArrayTypeName") {
|
|
3431
|
+
return typeNameToExternalSymbols(typeName.baseTypeName);
|
|
3432
|
+
} else {
|
|
3433
|
+
return [];
|
|
3434
|
+
}
|
|
3435
|
+
}
|
|
3436
|
+
|
|
3437
|
+
// src/render-solidity/renderSystemInterface.ts
|
|
3438
|
+
function renderSystemInterface(options) {
|
|
3439
|
+
const { imports, name, functionPrefix, functions } = options;
|
|
3440
|
+
return `${renderedSolidityHeader}
|
|
3441
|
+
|
|
3442
|
+
${renderImports(imports)}
|
|
3443
|
+
|
|
3444
|
+
interface ${name} {
|
|
3445
|
+
${renderList(
|
|
3446
|
+
functions,
|
|
3447
|
+
({ name: name2, parameters, stateMutability, returnParameters }) => `
|
|
3448
|
+
function ${functionPrefix}${name2}(
|
|
3449
|
+
${renderArguments(parameters)}
|
|
3450
|
+
) external ${stateMutability} ${renderReturnParameters(returnParameters)};
|
|
3451
|
+
`
|
|
3452
|
+
)}
|
|
3453
|
+
}
|
|
3454
|
+
|
|
3455
|
+
`;
|
|
3456
|
+
}
|
|
3457
|
+
function renderReturnParameters(returnParameters) {
|
|
3458
|
+
if (returnParameters.length > 0) {
|
|
3459
|
+
return `returns (${renderArguments(returnParameters)})`;
|
|
3460
|
+
} else {
|
|
3461
|
+
return "";
|
|
3462
|
+
}
|
|
3463
|
+
}
|
|
3464
|
+
|
|
3465
|
+
// src/render-solidity/renderWorld.ts
|
|
3466
|
+
function renderWorld(options) {
|
|
3467
|
+
const { interfaceName, storeImportPath, worldImportPath, imports } = options;
|
|
3468
|
+
return `${renderedSolidityHeader}
|
|
3469
|
+
|
|
3470
|
+
import { IStore } from "${storeImportPath}IStore.sol";
|
|
3471
|
+
|
|
3472
|
+
import { IWorldCore } from "${worldImportPath}interfaces/IWorldCore.sol";
|
|
3473
|
+
|
|
3474
|
+
${renderImports(imports)}
|
|
3475
|
+
|
|
3476
|
+
/**
|
|
3477
|
+
* The ${interfaceName} interface includes all systems dynamically added to the World
|
|
3478
|
+
* during the deploy process.
|
|
3479
|
+
*/
|
|
3480
|
+
interface ${interfaceName} is ${renderArguments(["IStore", "IWorldCore", ...imports.map(({ symbol }) => symbol)])} {
|
|
3481
|
+
|
|
3482
|
+
}
|
|
3483
|
+
|
|
3484
|
+
`;
|
|
3485
|
+
}
|
|
3486
|
+
|
|
3487
|
+
// src/render-solidity/worldgen.ts
|
|
3488
|
+
async function worldgen(config, existingContracts, outputBaseDirectory) {
|
|
3489
|
+
const worldgenBaseDirectory = path4.join(outputBaseDirectory, config.worldgenDirectory);
|
|
3490
|
+
const systems = existingContracts.filter(({ basename: basename3 }) => Object.keys(config.systems).includes(basename3));
|
|
3491
|
+
const systemInterfaceImports = [];
|
|
3492
|
+
for (const system of systems) {
|
|
3493
|
+
const data = readFileSync2(system.path, "utf8");
|
|
3494
|
+
const { functions, symbols } = contractToInterface(data, system.basename);
|
|
3495
|
+
const imports = symbols.map((symbol) => ({
|
|
3496
|
+
symbol,
|
|
3497
|
+
fromPath: system.path,
|
|
3498
|
+
usedInPath: worldgenBaseDirectory
|
|
3499
|
+
}));
|
|
3500
|
+
const systemInterfaceName = `I${system.basename}`;
|
|
3501
|
+
const { name } = config.systems[system.basename];
|
|
3502
|
+
const output2 = renderSystemInterface({
|
|
3503
|
+
name: systemInterfaceName,
|
|
3504
|
+
functionPrefix: config.namespace === "" ? "" : `${config.namespace}_${name}_`,
|
|
3505
|
+
functions,
|
|
3506
|
+
imports
|
|
3507
|
+
});
|
|
3508
|
+
const fullOutputPath2 = path4.join(worldgenBaseDirectory, systemInterfaceName + ".sol");
|
|
3509
|
+
await formatAndWriteSolidity(output2, fullOutputPath2, "Generated system interface");
|
|
3510
|
+
systemInterfaceImports.push({
|
|
3511
|
+
symbol: systemInterfaceName,
|
|
3512
|
+
fromPath: `${systemInterfaceName}.sol`,
|
|
3513
|
+
usedInPath: "./"
|
|
3514
|
+
});
|
|
3515
|
+
}
|
|
3516
|
+
const output = renderWorld({
|
|
3517
|
+
interfaceName: config.worldInterfaceName,
|
|
3518
|
+
imports: systemInterfaceImports,
|
|
3519
|
+
storeImportPath: config.storeImportPath,
|
|
3520
|
+
worldImportPath: config.worldImportPath
|
|
3521
|
+
});
|
|
3522
|
+
const fullOutputPath = path4.join(worldgenBaseDirectory, config.worldInterfaceName + ".sol");
|
|
3523
|
+
await formatAndWriteSolidity(output, fullOutputPath, "Generated system interface");
|
|
3524
|
+
}
|
|
3525
|
+
|
|
3526
|
+
// src/commands/worldgen.ts
|
|
3527
|
+
import { rmSync as rmSync3 } from "fs";
|
|
3528
|
+
var commandModule8 = {
|
|
3529
|
+
command: "worldgen",
|
|
3530
|
+
describe: "Autogenerate interfaces for Systems and World based on existing contracts and the config file",
|
|
3531
|
+
builder(yargs) {
|
|
3532
|
+
return yargs.options({
|
|
3533
|
+
configPath: { type: "string", desc: "Path to the config file" },
|
|
3534
|
+
clean: { type: "boolean", desc: "Clear the worldgen directory before generating new interfaces" }
|
|
3535
|
+
});
|
|
3536
|
+
},
|
|
3537
|
+
async handler(args) {
|
|
3538
|
+
const { configPath, clean } = args;
|
|
3539
|
+
const srcDir = await getSrcDirectory();
|
|
3540
|
+
const existingContracts = glob2.sync(`${srcDir}/**/*.sol`).map((path7) => ({
|
|
3541
|
+
path: path7,
|
|
3542
|
+
basename: basename2(path7, ".sol")
|
|
3543
|
+
}));
|
|
3544
|
+
const worldConfig = await loadWorldConfig2(
|
|
3545
|
+
configPath,
|
|
3546
|
+
existingContracts.map(({ basename: basename3 }) => basename3)
|
|
3547
|
+
);
|
|
3548
|
+
const storeConfig = await loadStoreConfig4(configPath);
|
|
3549
|
+
const mudConfig = { ...worldConfig, ...storeConfig };
|
|
3550
|
+
const outputBaseDirectory = path5.join(srcDir, mudConfig.codegenDirectory);
|
|
3551
|
+
if (clean)
|
|
3552
|
+
rmSync3(path5.join(outputBaseDirectory, mudConfig.worldgenDirectory), { recursive: true, force: true });
|
|
3553
|
+
await worldgen(mudConfig, existingContracts, outputBaseDirectory);
|
|
3554
|
+
process.exit(0);
|
|
3555
|
+
}
|
|
3556
|
+
};
|
|
3557
|
+
var worldgen_default = commandModule8;
|
|
3558
|
+
|
|
3559
|
+
// src/commands/set-version.ts
|
|
3560
|
+
import chalk4 from "chalk";
|
|
3561
|
+
import { existsSync, readFileSync as readFileSync3, rmSync as rmSync4, writeFileSync as writeFileSync3 } from "fs";
|
|
3562
|
+
import path6 from "path";
|
|
3563
|
+
import { MUDError as MUDError3 } from "@latticexyz/config";
|
|
3564
|
+
|
|
3565
|
+
// package.json
|
|
3566
|
+
var package_default = {
|
|
3567
|
+
name: "@latticexyz/cli",
|
|
3568
|
+
version: "1.42.0",
|
|
3569
|
+
description: "Command line interface for mud",
|
|
3570
|
+
main: "dist/index.js",
|
|
3571
|
+
types: "dist/index.d.ts",
|
|
3572
|
+
type: "module",
|
|
3573
|
+
license: "MIT",
|
|
3574
|
+
bin: {
|
|
3575
|
+
mud: "./dist/mud.js",
|
|
3576
|
+
mud2: "./dist/mud2.js"
|
|
3577
|
+
},
|
|
3578
|
+
repository: {
|
|
3579
|
+
type: "git",
|
|
3580
|
+
url: "https://github.com/latticexyz/mud.git",
|
|
3581
|
+
directory: "packages/cli"
|
|
3582
|
+
},
|
|
3583
|
+
scripts: {
|
|
3584
|
+
codegen: "tsx ./scripts/codegen.ts",
|
|
3585
|
+
lint: "eslint . --ext .ts",
|
|
3586
|
+
dev: "tsup --watch",
|
|
3587
|
+
build: "tsup",
|
|
3588
|
+
test: "tsc --noEmit && pnpm test:contracts",
|
|
3589
|
+
"test:contracts": "pnpm codegen && forge test",
|
|
3590
|
+
release: "npm publish --access=public"
|
|
3591
|
+
},
|
|
3592
|
+
devDependencies: {
|
|
3593
|
+
"@types/ejs": "^3.1.1",
|
|
3594
|
+
"@types/glob": "^7.2.0",
|
|
3595
|
+
"@types/node": "^17.0.34",
|
|
3596
|
+
"@types/openurl": "^1.0.0",
|
|
3597
|
+
"@types/yargs": "^17.0.10",
|
|
3598
|
+
tsup: "^6.6.3",
|
|
3599
|
+
tsx: "^3.12.6",
|
|
3600
|
+
vitest: "^0.29.8"
|
|
3601
|
+
},
|
|
3602
|
+
dependencies: {
|
|
3603
|
+
"@ethersproject/abi": "^5.7.0",
|
|
3604
|
+
"@ethersproject/providers": "^5.7.2",
|
|
3605
|
+
"@improbable-eng/grpc-web": "^0.15.0",
|
|
3606
|
+
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
|
3607
|
+
"@latticexyz/config": "workspace:*",
|
|
3608
|
+
"@latticexyz/schema-type": "workspace:*",
|
|
3609
|
+
"@latticexyz/services": "workspace:*",
|
|
3610
|
+
"@latticexyz/solecs": "workspace:*",
|
|
3611
|
+
"@latticexyz/std-contracts": "workspace:*",
|
|
3612
|
+
"@latticexyz/store": "workspace:*",
|
|
3613
|
+
"@latticexyz/world": "workspace:*",
|
|
3614
|
+
"@solidity-parser/parser": "^0.16.0",
|
|
3615
|
+
"@typechain/ethers-v5": "^10.2.0",
|
|
3616
|
+
chalk: "^5.0.1",
|
|
3617
|
+
chokidar: "^3.5.3",
|
|
3618
|
+
dotenv: "^16.0.3",
|
|
3619
|
+
"ds-test": "https://github.com/dapphub/ds-test.git#c9ce3f25bde29fc5eb9901842bf02850dfd2d084",
|
|
3620
|
+
ejs: "^3.1.8",
|
|
3621
|
+
ethers: "^5.7.2",
|
|
3622
|
+
execa: "^7.0.0",
|
|
3623
|
+
"forge-std": "https://github.com/foundry-rs/forge-std.git#b4f121555729b3afb3c5ffccb62ff4b6e2818fd3",
|
|
3624
|
+
glob: "^8.0.3",
|
|
3625
|
+
"nice-grpc-web": "^2.0.1",
|
|
3626
|
+
openurl: "^1.1.1",
|
|
3627
|
+
path: "^0.12.7",
|
|
3628
|
+
prettier: "^2.8.4",
|
|
3629
|
+
"prettier-plugin-solidity": "^1.1.2",
|
|
3630
|
+
table: "^6.8.1",
|
|
3631
|
+
typechain: "^8.1.1",
|
|
3632
|
+
typescript: "^4.9.5",
|
|
3633
|
+
yargs: "^17.7.1",
|
|
3634
|
+
zod: "^3.21.4",
|
|
3635
|
+
"zod-validation-error": "^1.3.0"
|
|
3636
|
+
},
|
|
3637
|
+
gitHead: "914a1e0ae4a573d685841ca2ea921435057deb8f"
|
|
3638
|
+
};
|
|
3639
|
+
|
|
3640
|
+
// src/commands/set-version.ts
|
|
3641
|
+
var BACKUP_FILE = ".mudbackup";
|
|
3642
|
+
var MUD_PREFIX = "@latticexyz";
|
|
3643
|
+
var commandModule9 = {
|
|
3644
|
+
command: "set-version",
|
|
3645
|
+
describe: "Install a custom MUD version and optionally backup the previously installed version",
|
|
3646
|
+
builder(yargs) {
|
|
3647
|
+
return yargs.options({
|
|
3648
|
+
backup: { type: "boolean", description: `Back up the current MUD versions to "${BACKUP_FILE}"` },
|
|
3649
|
+
force: {
|
|
3650
|
+
type: "boolean",
|
|
3651
|
+
description: `Backup fails if a "${BACKUP_FILE}" file is found, unless --force is provided`
|
|
3652
|
+
},
|
|
3653
|
+
restore: { type: "boolean", description: `Restore the previous MUD versions from "${BACKUP_FILE}"` },
|
|
3654
|
+
mudVersion: { alias: "v", type: "string", description: "The MUD version to install" },
|
|
3655
|
+
link: { alias: "l", type: "string", description: "Relative path to the local MUD root directory to link" }
|
|
3656
|
+
});
|
|
3657
|
+
},
|
|
3658
|
+
async handler(options) {
|
|
3659
|
+
try {
|
|
3660
|
+
if (!options.mudVersion && !options.link && !options.restore) {
|
|
3661
|
+
throw new MUDError3("`--mudVersion` or `--link` is required unless --restore is provided.");
|
|
3662
|
+
}
|
|
3663
|
+
if (options.link && options.mudVersion) {
|
|
3664
|
+
throw new MUDError3("Options `--link` and `--mudVersion` are mutually exclusive");
|
|
3665
|
+
}
|
|
3666
|
+
options.mudVersion = options.mudVersion === "canary" ? await getCanaryVersion(package_default.name) : options.mudVersion;
|
|
3667
|
+
const rootPath = "./package.json";
|
|
3668
|
+
const { workspaces } = updatePackageJson(rootPath, options);
|
|
3669
|
+
if (workspaces) {
|
|
3670
|
+
for (const workspace of workspaces) {
|
|
3671
|
+
const filePath = path6.join(workspace, "/package.json");
|
|
3672
|
+
updatePackageJson(filePath, options);
|
|
3673
|
+
}
|
|
3674
|
+
}
|
|
3675
|
+
} catch (e) {
|
|
3676
|
+
logError(e);
|
|
3677
|
+
} finally {
|
|
3678
|
+
process.exit(0);
|
|
3679
|
+
}
|
|
3680
|
+
}
|
|
3681
|
+
};
|
|
3682
|
+
function updatePackageJson(filePath, options) {
|
|
3683
|
+
const { restore, force, link } = options;
|
|
3684
|
+
let { backup, mudVersion } = options;
|
|
3685
|
+
const backupFilePath = path6.join(path6.dirname(filePath), BACKUP_FILE);
|
|
3686
|
+
const backupFileExists = existsSync(backupFilePath);
|
|
3687
|
+
if (link && !backupFileExists)
|
|
3688
|
+
backup = true;
|
|
3689
|
+
if (backup && !force && backupFileExists) {
|
|
3690
|
+
throw new MUDError3(
|
|
3691
|
+
`A backup file already exists at ${backupFilePath}.
|
|
3692
|
+
Use --force to overwrite it or --restore to restore it.`
|
|
3693
|
+
);
|
|
3694
|
+
}
|
|
3695
|
+
const packageJson = readPackageJson(filePath);
|
|
3696
|
+
const backupJson = restore ? readPackageJson(backupFilePath) : void 0;
|
|
3697
|
+
const mudDependencies = {};
|
|
3698
|
+
for (const key in packageJson.dependencies) {
|
|
3699
|
+
if (key.startsWith(MUD_PREFIX)) {
|
|
3700
|
+
mudDependencies[key] = packageJson.dependencies[key];
|
|
3701
|
+
}
|
|
3702
|
+
}
|
|
3703
|
+
const mudDevDependencies = {};
|
|
3704
|
+
for (const key in packageJson.devDependencies) {
|
|
3705
|
+
if (key.startsWith(MUD_PREFIX)) {
|
|
3706
|
+
mudDevDependencies[key] = packageJson.devDependencies[key];
|
|
3707
|
+
}
|
|
3708
|
+
}
|
|
3709
|
+
if (backup) {
|
|
3710
|
+
writeFileSync3(
|
|
3711
|
+
backupFilePath,
|
|
3712
|
+
JSON.stringify({ dependencies: mudDependencies, devDependencies: mudDevDependencies }, null, 2)
|
|
3713
|
+
);
|
|
3714
|
+
console.log(chalk4.green(`Backed up MUD dependencies from ${filePath} to ${backupFilePath}`));
|
|
3715
|
+
}
|
|
3716
|
+
for (const key in packageJson.dependencies) {
|
|
3717
|
+
if (key.startsWith(MUD_PREFIX)) {
|
|
3718
|
+
packageJson.dependencies[key] = resolveMudVersion(key, "dependencies");
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3721
|
+
for (const key in packageJson.devDependencies) {
|
|
3722
|
+
if (key.startsWith(MUD_PREFIX)) {
|
|
3723
|
+
packageJson.devDependencies[key] = resolveMudVersion(key, "devDependencies");
|
|
3724
|
+
}
|
|
3725
|
+
}
|
|
3726
|
+
writeFileSync3(filePath, JSON.stringify(packageJson, null, 2) + "\n");
|
|
3727
|
+
console.log(`Updating ${filePath}`);
|
|
3728
|
+
logComparison(mudDependencies, packageJson.dependencies);
|
|
3729
|
+
logComparison(mudDevDependencies, packageJson.devDependencies);
|
|
3730
|
+
if (restore && !backup) {
|
|
3731
|
+
rmSync4(backupFilePath);
|
|
3732
|
+
console.log(chalk4.green(`Cleaned up ${backupFilePath}`));
|
|
3733
|
+
}
|
|
3734
|
+
return packageJson;
|
|
3735
|
+
function resolveMudVersion(key, type) {
|
|
3736
|
+
if (restore && backupJson)
|
|
3737
|
+
return backupJson[type][key];
|
|
3738
|
+
if (link)
|
|
3739
|
+
mudVersion = resolveLinkPath(filePath, link, key);
|
|
3740
|
+
if (!mudVersion)
|
|
3741
|
+
return packageJson[type][key];
|
|
3742
|
+
return mudVersion;
|
|
3743
|
+
}
|
|
3744
|
+
}
|
|
3745
|
+
function readPackageJson(path7) {
|
|
3746
|
+
try {
|
|
3747
|
+
const jsonString = readFileSync3(path7, "utf8");
|
|
3748
|
+
return JSON.parse(jsonString);
|
|
3749
|
+
} catch {
|
|
3750
|
+
throw new MUDError3("Could not read JSON at " + path7);
|
|
3751
|
+
}
|
|
3752
|
+
}
|
|
3753
|
+
async function getCanaryVersion(pkg) {
|
|
3754
|
+
try {
|
|
3755
|
+
console.log(chalk4.blue("fetching MUD canary version..."));
|
|
3756
|
+
const result = await (await fetch(`https://registry.npmjs.org/${pkg}`)).json();
|
|
3757
|
+
const canary = result["dist-tags"].canary;
|
|
3758
|
+
console.log(chalk4.green("MUD canary version:", canary));
|
|
3759
|
+
return canary;
|
|
3760
|
+
} catch (e) {
|
|
3761
|
+
throw new MUDError3(`Could not fetch canary version of ${pkg}`);
|
|
3762
|
+
}
|
|
3763
|
+
}
|
|
3764
|
+
function logComparison(prev, curr) {
|
|
3765
|
+
for (const key in prev) {
|
|
3766
|
+
if (prev[key] !== curr[key]) {
|
|
3767
|
+
console.log(`${key}: ${chalk4.red(prev[key])} -> ${chalk4.green(curr[key])}`);
|
|
3768
|
+
}
|
|
3769
|
+
}
|
|
3770
|
+
}
|
|
3771
|
+
function resolveLinkPath(packageJsonPath, mudLinkPath, pkg) {
|
|
3772
|
+
const pkgName = pkg.replace(MUD_PREFIX, "");
|
|
3773
|
+
const packageJsonToRootPath = path6.relative(path6.dirname(packageJsonPath), process.cwd());
|
|
3774
|
+
const linkPath = path6.join(packageJsonToRootPath, mudLinkPath, "packages", pkgName);
|
|
3775
|
+
return "link:" + linkPath;
|
|
3776
|
+
}
|
|
3777
|
+
var set_version_default = commandModule9;
|
|
3778
|
+
|
|
3779
|
+
// src/commands/test-v2.ts
|
|
3780
|
+
import chalk5 from "chalk";
|
|
3781
|
+
import { rmSync as rmSync5, writeFileSync as writeFileSync4 } from "fs";
|
|
3782
|
+
var WORLD_ADDRESS_FILE = ".mudtest";
|
|
3783
|
+
var commandModule10 = {
|
|
3784
|
+
command: "test-v2",
|
|
3785
|
+
describe: "Run tests in MUD v2 contracts",
|
|
3786
|
+
builder(yargs) {
|
|
3787
|
+
return yargs.options({
|
|
3788
|
+
...yDeployOptions,
|
|
3789
|
+
port: { type: "number", description: "Port to run internal node for fork testing on", default: 4242 },
|
|
3790
|
+
worldAddress: {
|
|
3791
|
+
type: "string",
|
|
3792
|
+
description: "Address of an existing world contract. If provided, deployment is skipped and the RPC provided in the foundry.toml is used for fork testing."
|
|
3793
|
+
},
|
|
3794
|
+
forgeOptions: { type: "string", description: "Options to pass to forge test" }
|
|
3795
|
+
});
|
|
3796
|
+
},
|
|
3797
|
+
async handler(args) {
|
|
3798
|
+
if (!args.worldAddress) {
|
|
3799
|
+
const anvilArgs = ["--block-base-fee-per-gas", "0", "--port", String(args.port)];
|
|
3800
|
+
anvil(anvilArgs);
|
|
3801
|
+
}
|
|
3802
|
+
const forkRpc = args.worldAddress ? await getRpcUrl(args.profile) : `http://127.0.0.1:${args.port}`;
|
|
3803
|
+
const worldAddress = args.worldAddress ?? (await deployHandler({
|
|
3804
|
+
...args,
|
|
3805
|
+
saveDeployment: false,
|
|
3806
|
+
rpc: forkRpc
|
|
3807
|
+
})).worldAddress;
|
|
3808
|
+
console.log(chalk5.blue("World address", worldAddress));
|
|
3809
|
+
writeFileSync4(WORLD_ADDRESS_FILE, worldAddress);
|
|
3810
|
+
const userOptions = args.forgeOptions?.replaceAll("\\", "").split(" ") ?? [];
|
|
3811
|
+
try {
|
|
3812
|
+
const testResult = await forge(["test", "--fork-url", forkRpc, ...userOptions], {
|
|
3813
|
+
profile: args.profile
|
|
3814
|
+
});
|
|
3815
|
+
console.log(testResult);
|
|
3816
|
+
} catch (e) {
|
|
3817
|
+
console.error(e);
|
|
3818
|
+
}
|
|
3819
|
+
rmSync5(WORLD_ADDRESS_FILE);
|
|
3820
|
+
process.exit(0);
|
|
3821
|
+
}
|
|
3822
|
+
};
|
|
3823
|
+
var test_v2_default = commandModule10;
|
|
3824
|
+
|
|
3825
|
+
// src/commands/index.ts
|
|
3826
|
+
var commands = [
|
|
3827
|
+
deploy_v2_default,
|
|
3828
|
+
devnode_default,
|
|
3829
|
+
faucet_default,
|
|
3830
|
+
gas_report_default,
|
|
3831
|
+
hello_default,
|
|
3832
|
+
tablegen_default,
|
|
3833
|
+
tsgen_default,
|
|
3834
|
+
worldgen_default,
|
|
3835
|
+
set_version_default,
|
|
3836
|
+
test_v2_default
|
|
3837
|
+
];
|
|
3838
|
+
|
|
3839
|
+
export {
|
|
3840
|
+
commands
|
|
3841
|
+
};
|
|
3842
|
+
/*! Bundled license information:
|
|
3843
|
+
|
|
3844
|
+
long/index.js:
|
|
3845
|
+
(**
|
|
3846
|
+
* @license
|
|
3847
|
+
* Copyright 2009 The Closure Library Authors
|
|
3848
|
+
* Copyright 2020 Daniel Wirtz / The long.js Authors.
|
|
3849
|
+
*
|
|
3850
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3851
|
+
* you may not use this file except in compliance with the License.
|
|
3852
|
+
* You may obtain a copy of the License at
|
|
3853
|
+
*
|
|
3854
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3855
|
+
*
|
|
3856
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3857
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3858
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3859
|
+
* See the License for the specific language governing permissions and
|
|
3860
|
+
* limitations under the License.
|
|
3861
|
+
*
|
|
3862
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3863
|
+
*)
|
|
3864
|
+
*/
|