envio 2.22.0 → 2.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -6
- package/src/Address.res.js +30 -0
- package/src/ChainMap.res.js +77 -0
- package/src/Envio.res.js +16 -0
- package/src/ErrorHandling.res.js +56 -0
- package/src/EventUtils.res.js +75 -0
- package/src/EvmTypes.res.js +16 -0
- package/src/FetchState.res.js +969 -0
- package/src/Hasura.res.js +245 -0
- package/src/Internal.res.js +50 -0
- package/src/LazyLoader.res.js +117 -0
- package/src/LoadManager.res.js +124 -0
- package/src/LogSelection.res.js +203 -0
- package/src/Logging.res.js +247 -0
- package/src/Persistence.res.js +90 -0
- package/src/PgStorage.res.js +125 -0
- package/src/Prometheus.res.js +750 -0
- package/src/ReorgDetection.res.js +223 -0
- package/src/Throttler.res.js +60 -0
- package/src/Time.res.js +41 -0
- package/src/TopicFilter.res.js +86 -0
- package/src/Utils.res.js +527 -0
- package/src/bindings/BigDecimal.res.js +41 -0
- package/src/bindings/BigInt.res.js +138 -0
- package/src/bindings/Ethers.res.js +109 -0
- package/src/bindings/Express.res.js +2 -0
- package/src/bindings/Hrtime.res.js +66 -0
- package/src/bindings/NodeJs.res.js +29 -0
- package/src/bindings/Pino.res.js +95 -0
- package/src/bindings/Postgres.res.js +16 -0
- package/src/bindings/PromClient.res.js +17 -0
- package/src/bindings/Promise.res.js +25 -0
- package/src/bindings/SDSL.res.js +8 -0
- package/src/bindings/Viem.res.js +45 -0
- package/src/db/EntityHistory.res.js +307 -0
- package/src/db/Schema.res.js +54 -0
- package/src/db/Table.res.js +365 -0
- package/src/sources/Fuel.res.js +28 -0
- package/src/sources/HyperFuel.res.js +193 -0
- package/src/sources/HyperFuelClient.res.js +19 -0
- package/src/sources/HyperSync.res.js +301 -0
- package/src/sources/HyperSyncClient.res.js +99 -0
- package/src/sources/HyperSyncJsonApi.res.js +259 -0
- package/src/sources/Rpc.res.js +198 -0
- package/src/sources/Source.res.js +9 -0
- package/src/sources/SourceManager.res.js +366 -0
- package/src/vendored/Rest.res.js +574 -0
package/src/Utils.res.js
ADDED
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var $$Array = require("rescript/lib/js/array.js");
|
|
5
|
+
var Js_exn = require("rescript/lib/js/js_exn.js");
|
|
6
|
+
var Caml_obj = require("rescript/lib/js/caml_obj.js");
|
|
7
|
+
var Belt_Array = require("rescript/lib/js/belt_Array.js");
|
|
8
|
+
var Caml_array = require("rescript/lib/js/caml_array.js");
|
|
9
|
+
var Belt_Option = require("rescript/lib/js/belt_Option.js");
|
|
10
|
+
var Caml_option = require("rescript/lib/js/caml_option.js");
|
|
11
|
+
var Caml_splice_call = require("rescript/lib/js/caml_splice_call.js");
|
|
12
|
+
var S$RescriptSchema = require("rescript-schema/src/S.res.js");
|
|
13
|
+
|
|
14
|
+
function delay(milliseconds) {
|
|
15
|
+
return new Promise((function (resolve, param) {
|
|
16
|
+
setTimeout((function () {
|
|
17
|
+
resolve();
|
|
18
|
+
}), milliseconds);
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var $$Object = {};
|
|
23
|
+
|
|
24
|
+
var $$Error = {};
|
|
25
|
+
|
|
26
|
+
function mapNone(opt, val) {
|
|
27
|
+
if (opt !== undefined) {
|
|
28
|
+
return ;
|
|
29
|
+
} else {
|
|
30
|
+
return Caml_option.some(val);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function catchToNone(unsafeFunc) {
|
|
35
|
+
try {
|
|
36
|
+
return Caml_option.some(unsafeFunc());
|
|
37
|
+
}
|
|
38
|
+
catch (exn){
|
|
39
|
+
return ;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function flatten(opt) {
|
|
44
|
+
if (opt !== undefined) {
|
|
45
|
+
return Caml_option.valFromOption(opt);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function getExn(opt, message) {
|
|
51
|
+
if (opt !== undefined) {
|
|
52
|
+
return Caml_option.valFromOption(opt);
|
|
53
|
+
} else {
|
|
54
|
+
return Js_exn.raiseError(message);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var $$Option = {
|
|
59
|
+
mapNone: mapNone,
|
|
60
|
+
catchToNone: catchToNone,
|
|
61
|
+
flatten: flatten,
|
|
62
|
+
getExn: getExn
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
function get(tuple, index) {
|
|
66
|
+
return (tuple[index]);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var Tuple = {
|
|
70
|
+
get: get
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
var has = ((dict, key) => key in dict);
|
|
74
|
+
|
|
75
|
+
function push(dict, key, value) {
|
|
76
|
+
var arr = dict[key];
|
|
77
|
+
if (arr !== undefined) {
|
|
78
|
+
arr.push(value);
|
|
79
|
+
} else {
|
|
80
|
+
dict[key] = [value];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function pushMany(dict, key, values) {
|
|
85
|
+
var arr = dict[key];
|
|
86
|
+
if (arr !== undefined) {
|
|
87
|
+
Caml_splice_call.spliceObjApply(arr, "push", [values]);
|
|
88
|
+
} else {
|
|
89
|
+
dict[key] = values;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
var merge = ((dictA, dictB) => ({...dictA, ...dictB}));
|
|
94
|
+
|
|
95
|
+
function map(dict, fn) {
|
|
96
|
+
var newDict = {};
|
|
97
|
+
var keys = Object.keys(dict);
|
|
98
|
+
for(var idx = 0 ,idx_finish = keys.length; idx < idx_finish; ++idx){
|
|
99
|
+
var key = keys[idx];
|
|
100
|
+
newDict[key] = fn(dict[key]);
|
|
101
|
+
}
|
|
102
|
+
return newDict;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function forEach(dict, fn) {
|
|
106
|
+
var keys = Object.keys(dict);
|
|
107
|
+
for(var idx = 0 ,idx_finish = keys.length; idx < idx_finish; ++idx){
|
|
108
|
+
fn(dict[keys[idx]]);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function forEachWithKey(dict, fn) {
|
|
113
|
+
var keys = Object.keys(dict);
|
|
114
|
+
for(var idx = 0 ,idx_finish = keys.length; idx < idx_finish; ++idx){
|
|
115
|
+
var key = keys[idx];
|
|
116
|
+
fn(key, dict[key]);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
var deleteInPlace = ((dict, key) => {
|
|
121
|
+
delete dict[key];
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
var updateImmutable = ((dict, key, value) => ({...dict, [key]: value}));
|
|
125
|
+
|
|
126
|
+
var shallowCopy = ((dict) => ({...dict}));
|
|
127
|
+
|
|
128
|
+
function size(dict) {
|
|
129
|
+
return Object.keys(dict).length;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
var Dict = {
|
|
133
|
+
has: has,
|
|
134
|
+
push: push,
|
|
135
|
+
pushMany: pushMany,
|
|
136
|
+
merge: merge,
|
|
137
|
+
map: map,
|
|
138
|
+
forEach: forEach,
|
|
139
|
+
forEachWithKey: forEachWithKey,
|
|
140
|
+
deleteInPlace: deleteInPlace,
|
|
141
|
+
updateImmutable: updateImmutable,
|
|
142
|
+
shallowCopy: shallowCopy,
|
|
143
|
+
size: size
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
function minOptInt(a, b) {
|
|
147
|
+
if (a === undefined) {
|
|
148
|
+
if (b !== undefined) {
|
|
149
|
+
return Caml_option.some(Caml_option.valFromOption(b));
|
|
150
|
+
} else {
|
|
151
|
+
return ;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
var a$1 = Caml_option.valFromOption(a);
|
|
155
|
+
if (b !== undefined) {
|
|
156
|
+
return Caml_option.some(Caml_obj.min(a$1, Caml_option.valFromOption(b)));
|
|
157
|
+
} else {
|
|
158
|
+
return Caml_option.some(a$1);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
var $$Math = {
|
|
163
|
+
minOptInt: minOptInt
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
function mergeSorted(f, xs, ys) {
|
|
167
|
+
if (xs.length === 0) {
|
|
168
|
+
return ys;
|
|
169
|
+
}
|
|
170
|
+
if (ys.length === 0) {
|
|
171
|
+
return xs;
|
|
172
|
+
}
|
|
173
|
+
var n = xs.length + ys.length | 0;
|
|
174
|
+
var result = Array(n);
|
|
175
|
+
var loop = function (_i, _j, _k) {
|
|
176
|
+
while(true) {
|
|
177
|
+
var k = _k;
|
|
178
|
+
var j = _j;
|
|
179
|
+
var i = _i;
|
|
180
|
+
if (i < xs.length && j < ys.length) {
|
|
181
|
+
if (f(Caml_array.get(xs, i), Caml_array.get(ys, j))) {
|
|
182
|
+
Caml_array.set(result, k, Caml_array.get(xs, i));
|
|
183
|
+
_k = k + 1 | 0;
|
|
184
|
+
_i = i + 1 | 0;
|
|
185
|
+
continue ;
|
|
186
|
+
}
|
|
187
|
+
Caml_array.set(result, k, Caml_array.get(ys, j));
|
|
188
|
+
_k = k + 1 | 0;
|
|
189
|
+
_j = j + 1 | 0;
|
|
190
|
+
continue ;
|
|
191
|
+
}
|
|
192
|
+
if (i < xs.length) {
|
|
193
|
+
Caml_array.set(result, k, Caml_array.get(xs, i));
|
|
194
|
+
_k = k + 1 | 0;
|
|
195
|
+
_i = i + 1 | 0;
|
|
196
|
+
continue ;
|
|
197
|
+
}
|
|
198
|
+
if (j >= ys.length) {
|
|
199
|
+
return ;
|
|
200
|
+
}
|
|
201
|
+
Caml_array.set(result, k, Caml_array.get(ys, j));
|
|
202
|
+
_k = k + 1 | 0;
|
|
203
|
+
_j = j + 1 | 0;
|
|
204
|
+
continue ;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
loop(0, 0, 0);
|
|
208
|
+
return result;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function setIndexImmutable(arr, index, value) {
|
|
212
|
+
var shallowCopy = arr.slice(0);
|
|
213
|
+
shallowCopy[index] = value;
|
|
214
|
+
return shallowCopy;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function transposeResults(results) {
|
|
218
|
+
var _index = 0;
|
|
219
|
+
var output = new Array(results.length);
|
|
220
|
+
while(true) {
|
|
221
|
+
var index = _index;
|
|
222
|
+
if (index >= results.length) {
|
|
223
|
+
return {
|
|
224
|
+
TAG: "Ok",
|
|
225
|
+
_0: output
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
var value = results[index];
|
|
229
|
+
if (value.TAG !== "Ok") {
|
|
230
|
+
return value;
|
|
231
|
+
}
|
|
232
|
+
Caml_array.set(output, index, value._0);
|
|
233
|
+
_index = index + 1 | 0;
|
|
234
|
+
continue ;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function includes(arr, val) {
|
|
239
|
+
return Belt_Option.isSome(Caml_option.undefined_to_opt(arr.find(function (item) {
|
|
240
|
+
return Caml_obj.equal(item, val);
|
|
241
|
+
})));
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function isEmpty(arr) {
|
|
245
|
+
return arr.length === 0;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function notEmpty(arr) {
|
|
249
|
+
return arr.length !== 0;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
async function awaitEach(arr, fn) {
|
|
253
|
+
for(var i = 0 ,i_finish = arr.length; i < i_finish; ++i){
|
|
254
|
+
var item = Caml_array.get(arr, i);
|
|
255
|
+
await fn(item);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function removeAtIndex(array, index) {
|
|
260
|
+
if (index < 0) {
|
|
261
|
+
return $$Array.copy(array);
|
|
262
|
+
} else {
|
|
263
|
+
return array.slice(0, index).concat(array.slice(index + 1 | 0));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function last(arr) {
|
|
268
|
+
return Belt_Array.get(arr, arr.length - 1 | 0);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function findReverseWithIndex(arr, fn) {
|
|
272
|
+
var _index = arr.length - 1 | 0;
|
|
273
|
+
while(true) {
|
|
274
|
+
var index = _index;
|
|
275
|
+
if (index < 0) {
|
|
276
|
+
return ;
|
|
277
|
+
}
|
|
278
|
+
var item = Caml_array.get(arr, index);
|
|
279
|
+
if (fn(item)) {
|
|
280
|
+
return [
|
|
281
|
+
item,
|
|
282
|
+
index
|
|
283
|
+
];
|
|
284
|
+
}
|
|
285
|
+
_index = index - 1 | 0;
|
|
286
|
+
continue ;
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function interleave(arr, separator) {
|
|
291
|
+
var interleaved = [];
|
|
292
|
+
arr.forEach(function (v, i) {
|
|
293
|
+
interleaved.push(v);
|
|
294
|
+
if (i < (arr.length - 1 | 0)) {
|
|
295
|
+
interleaved.push(separator);
|
|
296
|
+
return ;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
});
|
|
300
|
+
return interleaved;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
var $$Array$1 = {
|
|
304
|
+
mergeSorted: mergeSorted,
|
|
305
|
+
setIndexImmutable: setIndexImmutable,
|
|
306
|
+
transposeResults: transposeResults,
|
|
307
|
+
includes: includes,
|
|
308
|
+
isEmpty: isEmpty,
|
|
309
|
+
notEmpty: notEmpty,
|
|
310
|
+
awaitEach: awaitEach,
|
|
311
|
+
removeAtIndex: removeAtIndex,
|
|
312
|
+
last: last,
|
|
313
|
+
findReverseWithIndex: findReverseWithIndex,
|
|
314
|
+
interleave: interleave
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
function capitalize(str) {
|
|
318
|
+
return str.slice(0, 1).toUpperCase() + str.slice(1);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
var $$String = {
|
|
322
|
+
capitalize: capitalize
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
function forEach$1(result, fn) {
|
|
326
|
+
if (result.TAG === "Ok") {
|
|
327
|
+
fn(result._0);
|
|
328
|
+
}
|
|
329
|
+
return result;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
var Result = {
|
|
333
|
+
forEach: forEach$1
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
function unwrapResultExn(res) {
|
|
337
|
+
if (res.TAG === "Ok") {
|
|
338
|
+
return res._0;
|
|
339
|
+
}
|
|
340
|
+
throw res._0;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
var variantTag = S$RescriptSchema.union([
|
|
344
|
+
S$RescriptSchema.string,
|
|
345
|
+
S$RescriptSchema.object(function (s) {
|
|
346
|
+
return s.f("TAG", S$RescriptSchema.string);
|
|
347
|
+
})
|
|
348
|
+
]);
|
|
349
|
+
|
|
350
|
+
function getNonOptionalFieldNames(schema) {
|
|
351
|
+
var acc = [];
|
|
352
|
+
var match = schema.t;
|
|
353
|
+
if (typeof match === "object" && match.TAG === "object") {
|
|
354
|
+
match.items.forEach(function (item) {
|
|
355
|
+
var match = item.schema.t;
|
|
356
|
+
if (typeof match !== "object") {
|
|
357
|
+
acc.push(item.location);
|
|
358
|
+
return ;
|
|
359
|
+
}
|
|
360
|
+
switch (match.TAG) {
|
|
361
|
+
case "option" :
|
|
362
|
+
case "null" :
|
|
363
|
+
return ;
|
|
364
|
+
default:
|
|
365
|
+
acc.push(item.location);
|
|
366
|
+
return ;
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
return acc;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function getCapitalizedFieldNames(schema) {
|
|
374
|
+
var match = schema.t;
|
|
375
|
+
if (typeof match !== "object") {
|
|
376
|
+
return [];
|
|
377
|
+
} else if (match.TAG === "object") {
|
|
378
|
+
return match.items.map(function (item) {
|
|
379
|
+
return capitalize(item.location);
|
|
380
|
+
});
|
|
381
|
+
} else {
|
|
382
|
+
return [];
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
var dbDate = S$RescriptSchema.preprocess(S$RescriptSchema.json(false), (function (param) {
|
|
387
|
+
return {
|
|
388
|
+
s: (function (date) {
|
|
389
|
+
return date.toISOString();
|
|
390
|
+
})
|
|
391
|
+
};
|
|
392
|
+
}));
|
|
393
|
+
|
|
394
|
+
function coerceToJsonPgType(schema) {
|
|
395
|
+
return S$RescriptSchema.preprocess(schema, (function (s) {
|
|
396
|
+
var match = s.schema.t;
|
|
397
|
+
if (typeof match === "object") {
|
|
398
|
+
return {};
|
|
399
|
+
}
|
|
400
|
+
switch (match) {
|
|
401
|
+
case "unknown" :
|
|
402
|
+
return {
|
|
403
|
+
s: (function (param) {
|
|
404
|
+
return "null";
|
|
405
|
+
})
|
|
406
|
+
};
|
|
407
|
+
case "boolean" :
|
|
408
|
+
return {
|
|
409
|
+
s: (function (unknown) {
|
|
410
|
+
if (unknown === false) {
|
|
411
|
+
return "false";
|
|
412
|
+
} else if (unknown === true) {
|
|
413
|
+
return "true";
|
|
414
|
+
} else {
|
|
415
|
+
return unknown;
|
|
416
|
+
}
|
|
417
|
+
})
|
|
418
|
+
};
|
|
419
|
+
default:
|
|
420
|
+
return {};
|
|
421
|
+
}
|
|
422
|
+
}));
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
var Schema = {
|
|
426
|
+
variantTag: variantTag,
|
|
427
|
+
getNonOptionalFieldNames: getNonOptionalFieldNames,
|
|
428
|
+
getCapitalizedFieldNames: getCapitalizedFieldNames,
|
|
429
|
+
dbDate: dbDate,
|
|
430
|
+
coerceToJsonPgType: coerceToJsonPgType
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
function getVariantsTags(variants) {
|
|
434
|
+
return variants.map(function (variant) {
|
|
435
|
+
return S$RescriptSchema.parseOrThrow(variant, variantTag);
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function addMany(set, values) {
|
|
440
|
+
values.forEach(function (value) {
|
|
441
|
+
set.add(value);
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
var $$Set = {
|
|
446
|
+
addMany: addMany
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
var $$WeakMap = {};
|
|
450
|
+
|
|
451
|
+
var $$Map = {};
|
|
452
|
+
|
|
453
|
+
var $$Proxy = {};
|
|
454
|
+
|
|
455
|
+
function makeOrThrow(any) {
|
|
456
|
+
var $$typeof = typeof any;
|
|
457
|
+
switch ($$typeof) {
|
|
458
|
+
case "boolean" :
|
|
459
|
+
if (any) {
|
|
460
|
+
return "true";
|
|
461
|
+
} else {
|
|
462
|
+
return "false";
|
|
463
|
+
}
|
|
464
|
+
case "bigint" :
|
|
465
|
+
case "number" :
|
|
466
|
+
return any.toString();
|
|
467
|
+
case "object" :
|
|
468
|
+
if (any === null) {
|
|
469
|
+
return "null";
|
|
470
|
+
}
|
|
471
|
+
if (Array.isArray(any)) {
|
|
472
|
+
var hash = "[";
|
|
473
|
+
for(var i = 0 ,i_finish = any.length; i < i_finish; ++i){
|
|
474
|
+
hash = hash + makeOrThrow(any[i]) + ",";
|
|
475
|
+
}
|
|
476
|
+
return hash + "]";
|
|
477
|
+
}
|
|
478
|
+
var constructor = any["constructor"];
|
|
479
|
+
if (constructor !== Object) {
|
|
480
|
+
if (constructor.name === "BigNumber") {
|
|
481
|
+
return any.toString();
|
|
482
|
+
} else {
|
|
483
|
+
return Js_exn.raiseError("Don't know how to serialize " + constructor.name);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
var hash$1 = "{";
|
|
487
|
+
var keys = Object.keys(any).sort();
|
|
488
|
+
for(var i$1 = 0 ,i_finish$1 = keys.length; i$1 < i_finish$1; ++i$1){
|
|
489
|
+
var key = keys[i$1];
|
|
490
|
+
hash$1 = hash$1 + key + ":" + makeOrThrow(any[key]) + ",";
|
|
491
|
+
}
|
|
492
|
+
return hash$1 + "}";
|
|
493
|
+
case "string" :
|
|
494
|
+
return any;
|
|
495
|
+
case "function" :
|
|
496
|
+
case "symbol" :
|
|
497
|
+
return any.toString();
|
|
498
|
+
case "undefined" :
|
|
499
|
+
return "undefined";
|
|
500
|
+
default:
|
|
501
|
+
return Js_exn.raiseError("Don't know how to serialize " + $$typeof);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
var Hash = {
|
|
506
|
+
makeOrThrow: makeOrThrow
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
exports.delay = delay;
|
|
510
|
+
exports.$$Object = $$Object;
|
|
511
|
+
exports.$$Error = $$Error;
|
|
512
|
+
exports.$$Option = $$Option;
|
|
513
|
+
exports.Tuple = Tuple;
|
|
514
|
+
exports.Dict = Dict;
|
|
515
|
+
exports.$$Math = $$Math;
|
|
516
|
+
exports.$$Array = $$Array$1;
|
|
517
|
+
exports.$$String = $$String;
|
|
518
|
+
exports.Result = Result;
|
|
519
|
+
exports.unwrapResultExn = unwrapResultExn;
|
|
520
|
+
exports.Schema = Schema;
|
|
521
|
+
exports.getVariantsTags = getVariantsTags;
|
|
522
|
+
exports.$$Set = $$Set;
|
|
523
|
+
exports.$$WeakMap = $$WeakMap;
|
|
524
|
+
exports.$$Map = $$Map;
|
|
525
|
+
exports.$$Proxy = $$Proxy;
|
|
526
|
+
exports.Hash = Hash;
|
|
527
|
+
/* variantTag Not a pure module */
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var Belt_Int = require("rescript/lib/js/belt_Int.js");
|
|
5
|
+
var BignumberJs = require("bignumber.js");
|
|
6
|
+
var S$RescriptSchema = require("rescript-schema/src/S.res.js");
|
|
7
|
+
|
|
8
|
+
function toInt(b) {
|
|
9
|
+
return Belt_Int.fromString(b.toString());
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function notEquals(a, b) {
|
|
13
|
+
return !a.isEqualTo(b);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var zero = new BignumberJs(0);
|
|
17
|
+
|
|
18
|
+
var one = new BignumberJs(1);
|
|
19
|
+
|
|
20
|
+
var schema = S$RescriptSchema.transform(S$RescriptSchema.setName(S$RescriptSchema.string, "BigDecimal"), (function (s) {
|
|
21
|
+
return {
|
|
22
|
+
p: (function (string) {
|
|
23
|
+
var bigDecimal = new BignumberJs(string);
|
|
24
|
+
if (bigDecimal !== undefined) {
|
|
25
|
+
return bigDecimal;
|
|
26
|
+
} else {
|
|
27
|
+
return s.fail("The string is not valid BigDecimal", undefined);
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
s: (function (bigDecimal) {
|
|
31
|
+
return bigDecimal.toString();
|
|
32
|
+
})
|
|
33
|
+
};
|
|
34
|
+
}));
|
|
35
|
+
|
|
36
|
+
exports.toInt = toInt;
|
|
37
|
+
exports.notEquals = notEquals;
|
|
38
|
+
exports.zero = zero;
|
|
39
|
+
exports.one = one;
|
|
40
|
+
exports.schema = schema;
|
|
41
|
+
/* zero Not a pure module */
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var Js_exn = require("rescript/lib/js/js_exn.js");
|
|
5
|
+
var Belt_Int = require("rescript/lib/js/belt_Int.js");
|
|
6
|
+
var Caml_option = require("rescript/lib/js/caml_option.js");
|
|
7
|
+
var S$RescriptSchema = require("rescript-schema/src/S.res.js");
|
|
8
|
+
var Caml_js_exceptions = require("rescript/lib/js/caml_js_exceptions.js");
|
|
9
|
+
|
|
10
|
+
function fromString(str) {
|
|
11
|
+
try {
|
|
12
|
+
return Caml_option.some((function () {
|
|
13
|
+
return BigInt(str);
|
|
14
|
+
})());
|
|
15
|
+
}
|
|
16
|
+
catch (raw__obj){
|
|
17
|
+
var _obj = Caml_js_exceptions.internalToOCamlException(raw__obj);
|
|
18
|
+
if (_obj.RE_EXN_ID === Js_exn.$$Error) {
|
|
19
|
+
return ;
|
|
20
|
+
}
|
|
21
|
+
throw _obj;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function toInt(b) {
|
|
26
|
+
return Belt_Int.fromString(b.toString());
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function add(a, b) {
|
|
30
|
+
return (a + b);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function sub(a, b) {
|
|
34
|
+
return (a - b);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function mul(a, b) {
|
|
38
|
+
return (a * b);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function div(a, b) {
|
|
42
|
+
return (b > 0n ? a / b : 0n);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function pow(a, b) {
|
|
46
|
+
return (a ** b);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function mod(a, b) {
|
|
50
|
+
return (b > 0n ? a % b : 0n);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function eq(a, b) {
|
|
54
|
+
return (a === b);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function neq(a, b) {
|
|
58
|
+
return (a !== b);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function gt(a, b) {
|
|
62
|
+
return (a > b);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function gte(a, b) {
|
|
66
|
+
return (a >= b);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function lt(a, b) {
|
|
70
|
+
return (a < b);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function lte(a, b) {
|
|
74
|
+
return (a <= b);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function shift_left(a, b) {
|
|
78
|
+
return (a << b);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function shift_right(a, b) {
|
|
82
|
+
return (a >> b);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function logor(a, b) {
|
|
86
|
+
return (a | b);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function logand(a, b) {
|
|
90
|
+
return (a & b);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
var Bitwise = {
|
|
94
|
+
shift_left: shift_left,
|
|
95
|
+
shift_right: shift_right,
|
|
96
|
+
logor: logor,
|
|
97
|
+
logand: logand
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
var zero = BigInt(0);
|
|
101
|
+
|
|
102
|
+
var schema = S$RescriptSchema.transform(S$RescriptSchema.setName(S$RescriptSchema.string, "BigInt"), (function (s) {
|
|
103
|
+
return {
|
|
104
|
+
p: (function (string) {
|
|
105
|
+
var bigInt = fromString(string);
|
|
106
|
+
if (bigInt !== undefined) {
|
|
107
|
+
return bigInt;
|
|
108
|
+
} else {
|
|
109
|
+
return s.fail("The string is not valid BigInt", undefined);
|
|
110
|
+
}
|
|
111
|
+
}),
|
|
112
|
+
s: (function (bigint) {
|
|
113
|
+
return bigint.toString();
|
|
114
|
+
})
|
|
115
|
+
};
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
var nativeSchema = S$RescriptSchema.bigint;
|
|
119
|
+
|
|
120
|
+
exports.fromString = fromString;
|
|
121
|
+
exports.toInt = toInt;
|
|
122
|
+
exports.add = add;
|
|
123
|
+
exports.sub = sub;
|
|
124
|
+
exports.mul = mul;
|
|
125
|
+
exports.div = div;
|
|
126
|
+
exports.pow = pow;
|
|
127
|
+
exports.mod = mod;
|
|
128
|
+
exports.eq = eq;
|
|
129
|
+
exports.neq = neq;
|
|
130
|
+
exports.gt = gt;
|
|
131
|
+
exports.gte = gte;
|
|
132
|
+
exports.lt = lt;
|
|
133
|
+
exports.lte = lte;
|
|
134
|
+
exports.Bitwise = Bitwise;
|
|
135
|
+
exports.zero = zero;
|
|
136
|
+
exports.schema = schema;
|
|
137
|
+
exports.nativeSchema = nativeSchema;
|
|
138
|
+
/* zero Not a pure module */
|