@hashgraphonline/standards-sdk 0.0.42 → 0.0.43
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/es/hcs-10/base-client.d.ts +3 -1
- package/dist/es/hcs-10/browser.d.ts +2 -1
- package/dist/es/standards-sdk.es.js +663 -136
- package/dist/es/standards-sdk.es.js.map +1 -1
- package/dist/es/utils/logger.d.ts +4 -17
- package/dist/umd/hcs-10/base-client.d.ts +3 -1
- package/dist/umd/hcs-10/browser.d.ts +2 -1
- package/dist/umd/standards-sdk.umd.js +4 -4
- package/dist/umd/standards-sdk.umd.js.map +1 -1
- package/dist/umd/utils/logger.d.ts +4 -17
- package/package.json +3 -1
|
@@ -17,92 +17,639 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
17
17
|
return __privateGet(obj, member, getter);
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
var _names, _data, _dataLength, _Writer_instances, writeData_fn, _data2, _offset, _bytesRead, _parent, _maxInflation, _Reader_instances, incrementBytesRead_fn, peekBytes_fn, _options, _offset2, _tokens, _TokenString_instances, subTokenString_fn, _ParamType_instances, walkAsync_fn, _AbiCoder_instances, getCoder_fn, _errors, _events, _functions, _abiCoder, _Interface_instances, getFunction_fn, getEvent_fn;
|
|
20
|
+
var _a, _names, _data, _dataLength, _Writer_instances, writeData_fn, _data2, _offset, _bytesRead, _parent, _maxInflation, _Reader_instances, incrementBytesRead_fn, peekBytes_fn, _options, _offset2, _tokens, _TokenString_instances, subTokenString_fn, _ParamType_instances, walkAsync_fn, _AbiCoder_instances, getCoder_fn, _errors, _events, _functions, _abiCoder, _Interface_instances, getFunction_fn, getEvent_fn;
|
|
21
21
|
import { ContractId, AccountId, Client, PrivateKey, Transaction, PublicKey, Timestamp, Status, AccountUpdateTransaction, AccountCreateTransaction, Hbar, CustomFixedFee, KeyList, TopicCreateTransaction, TopicMessageSubmitTransaction, TopicId } from "@hashgraph/sdk";
|
|
22
22
|
import { proto } from "@hashgraph/proto";
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
function getDefaultExportFromCjs$1(x) {
|
|
24
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
25
|
+
}
|
|
26
|
+
function getAugmentedNamespace(n2) {
|
|
27
|
+
if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2;
|
|
28
|
+
var f = n2.default;
|
|
29
|
+
if (typeof f == "function") {
|
|
30
|
+
var a = function a2() {
|
|
31
|
+
if (this instanceof a2) {
|
|
32
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
33
|
+
}
|
|
34
|
+
return f.apply(this, arguments);
|
|
35
|
+
};
|
|
36
|
+
a.prototype = f.prototype;
|
|
37
|
+
} else a = {};
|
|
38
|
+
Object.defineProperty(a, "__esModule", { value: true });
|
|
39
|
+
Object.keys(n2).forEach(function(k) {
|
|
40
|
+
var d = Object.getOwnPropertyDescriptor(n2, k);
|
|
41
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function() {
|
|
44
|
+
return n2[k];
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
return a;
|
|
49
|
+
}
|
|
50
|
+
var browser$1 = { exports: {} };
|
|
51
|
+
var quickFormatUnescaped;
|
|
52
|
+
var hasRequiredQuickFormatUnescaped;
|
|
53
|
+
function requireQuickFormatUnescaped() {
|
|
54
|
+
if (hasRequiredQuickFormatUnescaped) return quickFormatUnescaped;
|
|
55
|
+
hasRequiredQuickFormatUnescaped = 1;
|
|
56
|
+
function tryStringify(o) {
|
|
57
|
+
try {
|
|
58
|
+
return JSON.stringify(o);
|
|
59
|
+
} catch (e) {
|
|
60
|
+
return '"[Circular]"';
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
quickFormatUnescaped = format;
|
|
64
|
+
function format(f, args, opts) {
|
|
65
|
+
var ss = opts && opts.stringify || tryStringify;
|
|
66
|
+
var offset = 1;
|
|
67
|
+
if (typeof f === "object" && f !== null) {
|
|
68
|
+
var len = args.length + offset;
|
|
69
|
+
if (len === 1) return f;
|
|
70
|
+
var objects = new Array(len);
|
|
71
|
+
objects[0] = ss(f);
|
|
72
|
+
for (var index = 1; index < len; index++) {
|
|
73
|
+
objects[index] = ss(args[index]);
|
|
74
|
+
}
|
|
75
|
+
return objects.join(" ");
|
|
76
|
+
}
|
|
77
|
+
if (typeof f !== "string") {
|
|
78
|
+
return f;
|
|
79
|
+
}
|
|
80
|
+
var argLen = args.length;
|
|
81
|
+
if (argLen === 0) return f;
|
|
82
|
+
var str = "";
|
|
83
|
+
var a = 1 - offset;
|
|
84
|
+
var lastPos = -1;
|
|
85
|
+
var flen = f && f.length || 0;
|
|
86
|
+
for (var i = 0; i < flen; ) {
|
|
87
|
+
if (f.charCodeAt(i) === 37 && i + 1 < flen) {
|
|
88
|
+
lastPos = lastPos > -1 ? lastPos : 0;
|
|
89
|
+
switch (f.charCodeAt(i + 1)) {
|
|
90
|
+
case 100:
|
|
91
|
+
// 'd'
|
|
92
|
+
case 102:
|
|
93
|
+
if (a >= argLen)
|
|
94
|
+
break;
|
|
95
|
+
if (args[a] == null) break;
|
|
96
|
+
if (lastPos < i)
|
|
97
|
+
str += f.slice(lastPos, i);
|
|
98
|
+
str += Number(args[a]);
|
|
99
|
+
lastPos = i + 2;
|
|
100
|
+
i++;
|
|
101
|
+
break;
|
|
102
|
+
case 105:
|
|
103
|
+
if (a >= argLen)
|
|
104
|
+
break;
|
|
105
|
+
if (args[a] == null) break;
|
|
106
|
+
if (lastPos < i)
|
|
107
|
+
str += f.slice(lastPos, i);
|
|
108
|
+
str += Math.floor(Number(args[a]));
|
|
109
|
+
lastPos = i + 2;
|
|
110
|
+
i++;
|
|
111
|
+
break;
|
|
112
|
+
case 79:
|
|
113
|
+
// 'O'
|
|
114
|
+
case 111:
|
|
115
|
+
// 'o'
|
|
116
|
+
case 106:
|
|
117
|
+
if (a >= argLen)
|
|
118
|
+
break;
|
|
119
|
+
if (args[a] === void 0) break;
|
|
120
|
+
if (lastPos < i)
|
|
121
|
+
str += f.slice(lastPos, i);
|
|
122
|
+
var type = typeof args[a];
|
|
123
|
+
if (type === "string") {
|
|
124
|
+
str += "'" + args[a] + "'";
|
|
125
|
+
lastPos = i + 2;
|
|
126
|
+
i++;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
if (type === "function") {
|
|
130
|
+
str += args[a].name || "<anonymous>";
|
|
131
|
+
lastPos = i + 2;
|
|
132
|
+
i++;
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
str += ss(args[a]);
|
|
136
|
+
lastPos = i + 2;
|
|
137
|
+
i++;
|
|
138
|
+
break;
|
|
139
|
+
case 115:
|
|
140
|
+
if (a >= argLen)
|
|
141
|
+
break;
|
|
142
|
+
if (lastPos < i)
|
|
143
|
+
str += f.slice(lastPos, i);
|
|
144
|
+
str += String(args[a]);
|
|
145
|
+
lastPos = i + 2;
|
|
146
|
+
i++;
|
|
147
|
+
break;
|
|
148
|
+
case 37:
|
|
149
|
+
if (lastPos < i)
|
|
150
|
+
str += f.slice(lastPos, i);
|
|
151
|
+
str += "%";
|
|
152
|
+
lastPos = i + 2;
|
|
153
|
+
i++;
|
|
154
|
+
a--;
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
++a;
|
|
158
|
+
}
|
|
159
|
+
++i;
|
|
160
|
+
}
|
|
161
|
+
if (lastPos === -1)
|
|
162
|
+
return f;
|
|
163
|
+
else if (lastPos < flen) {
|
|
164
|
+
str += f.slice(lastPos);
|
|
165
|
+
}
|
|
166
|
+
return str;
|
|
167
|
+
}
|
|
168
|
+
return quickFormatUnescaped;
|
|
169
|
+
}
|
|
170
|
+
var hasRequiredBrowser$1;
|
|
171
|
+
function requireBrowser$1() {
|
|
172
|
+
if (hasRequiredBrowser$1) return browser$1.exports;
|
|
173
|
+
hasRequiredBrowser$1 = 1;
|
|
174
|
+
const format = requireQuickFormatUnescaped();
|
|
175
|
+
browser$1.exports = pino2;
|
|
176
|
+
const _console = pfGlobalThisOrFallback().console || {};
|
|
177
|
+
const stdSerializers = {
|
|
178
|
+
mapHttpRequest: mock,
|
|
179
|
+
mapHttpResponse: mock,
|
|
180
|
+
wrapRequestSerializer: passthrough,
|
|
181
|
+
wrapResponseSerializer: passthrough,
|
|
182
|
+
wrapErrorSerializer: passthrough,
|
|
183
|
+
req: mock,
|
|
184
|
+
res: mock,
|
|
185
|
+
err: asErrValue,
|
|
186
|
+
errWithCause: asErrValue
|
|
187
|
+
};
|
|
188
|
+
function levelToValue(level, logger) {
|
|
189
|
+
return level === "silent" ? Infinity : logger.levels.values[level];
|
|
190
|
+
}
|
|
191
|
+
const baseLogFunctionSymbol = Symbol("pino.logFuncs");
|
|
192
|
+
const hierarchySymbol = Symbol("pino.hierarchy");
|
|
193
|
+
const logFallbackMap = {
|
|
194
|
+
error: "log",
|
|
195
|
+
fatal: "error",
|
|
196
|
+
warn: "error",
|
|
197
|
+
info: "log",
|
|
198
|
+
debug: "log",
|
|
199
|
+
trace: "log"
|
|
200
|
+
};
|
|
201
|
+
function appendChildLogger(parentLogger, childLogger) {
|
|
202
|
+
const newEntry = {
|
|
203
|
+
logger: childLogger,
|
|
204
|
+
parent: parentLogger[hierarchySymbol]
|
|
205
|
+
};
|
|
206
|
+
childLogger[hierarchySymbol] = newEntry;
|
|
29
207
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
208
|
+
function setupBaseLogFunctions(logger, levels, proto2) {
|
|
209
|
+
const logFunctions = {};
|
|
210
|
+
levels.forEach((level) => {
|
|
211
|
+
logFunctions[level] = proto2[level] ? proto2[level] : _console[level] || _console[logFallbackMap[level] || "log"] || noop2;
|
|
212
|
+
});
|
|
213
|
+
logger[baseLogFunctionSymbol] = logFunctions;
|
|
214
|
+
}
|
|
215
|
+
function shouldSerialize(serialize, serializers) {
|
|
216
|
+
if (Array.isArray(serialize)) {
|
|
217
|
+
const hasToFilter = serialize.filter(function(k) {
|
|
218
|
+
return k !== "!stdSerializers.err";
|
|
219
|
+
});
|
|
220
|
+
return hasToFilter;
|
|
221
|
+
} else if (serialize === true) {
|
|
222
|
+
return Object.keys(serializers);
|
|
33
223
|
}
|
|
34
|
-
return
|
|
224
|
+
return false;
|
|
35
225
|
}
|
|
36
|
-
|
|
37
|
-
|
|
226
|
+
function pino2(opts) {
|
|
227
|
+
opts = opts || {};
|
|
228
|
+
opts.browser = opts.browser || {};
|
|
229
|
+
const transmit2 = opts.browser.transmit;
|
|
230
|
+
if (transmit2 && typeof transmit2.send !== "function") {
|
|
231
|
+
throw Error("pino: transmit option must have a send function");
|
|
232
|
+
}
|
|
233
|
+
const proto2 = opts.browser.write || _console;
|
|
234
|
+
if (opts.browser.write) opts.browser.asObject = true;
|
|
235
|
+
const serializers = opts.serializers || {};
|
|
236
|
+
const serialize = shouldSerialize(opts.browser.serialize, serializers);
|
|
237
|
+
let stdErrSerialize = opts.browser.serialize;
|
|
238
|
+
if (Array.isArray(opts.browser.serialize) && opts.browser.serialize.indexOf("!stdSerializers.err") > -1) stdErrSerialize = false;
|
|
239
|
+
const customLevels = Object.keys(opts.customLevels || {});
|
|
240
|
+
const levels = ["error", "fatal", "warn", "info", "debug", "trace"].concat(customLevels);
|
|
241
|
+
if (typeof proto2 === "function") {
|
|
242
|
+
levels.forEach(function(level2) {
|
|
243
|
+
proto2[level2] = proto2;
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
if (opts.enabled === false || opts.browser.disabled) opts.level = "silent";
|
|
247
|
+
const level = opts.level || "info";
|
|
248
|
+
const logger = Object.create(proto2);
|
|
249
|
+
if (!logger.log) logger.log = noop2;
|
|
250
|
+
setupBaseLogFunctions(logger, levels, proto2);
|
|
251
|
+
appendChildLogger({}, logger);
|
|
252
|
+
Object.defineProperty(logger, "levelVal", {
|
|
253
|
+
get: getLevelVal
|
|
254
|
+
});
|
|
255
|
+
Object.defineProperty(logger, "level", {
|
|
256
|
+
get: getLevel,
|
|
257
|
+
set: setLevel
|
|
258
|
+
});
|
|
259
|
+
const setOpts = {
|
|
260
|
+
transmit: transmit2,
|
|
261
|
+
serialize,
|
|
262
|
+
asObject: opts.browser.asObject,
|
|
263
|
+
formatters: opts.browser.formatters,
|
|
264
|
+
levels,
|
|
265
|
+
timestamp: getTimeFunction(opts),
|
|
266
|
+
messageKey: opts.messageKey || "msg",
|
|
267
|
+
onChild: opts.onChild || noop2
|
|
268
|
+
};
|
|
269
|
+
logger.levels = getLevels(opts);
|
|
270
|
+
logger.level = level;
|
|
271
|
+
logger.setMaxListeners = logger.getMaxListeners = logger.emit = logger.addListener = logger.on = logger.prependListener = logger.once = logger.prependOnceListener = logger.removeListener = logger.removeAllListeners = logger.listeners = logger.listenerCount = logger.eventNames = logger.write = logger.flush = noop2;
|
|
272
|
+
logger.serializers = serializers;
|
|
273
|
+
logger._serialize = serialize;
|
|
274
|
+
logger._stdErrSerialize = stdErrSerialize;
|
|
275
|
+
logger.child = function(...args) {
|
|
276
|
+
return child.call(this, setOpts, ...args);
|
|
277
|
+
};
|
|
278
|
+
if (transmit2) logger._logEvent = createLogEventShape();
|
|
279
|
+
function getLevelVal() {
|
|
280
|
+
return levelToValue(this.level, this);
|
|
281
|
+
}
|
|
282
|
+
function getLevel() {
|
|
283
|
+
return this._level;
|
|
284
|
+
}
|
|
285
|
+
function setLevel(level2) {
|
|
286
|
+
if (level2 !== "silent" && !this.levels.values[level2]) {
|
|
287
|
+
throw Error("unknown level " + level2);
|
|
288
|
+
}
|
|
289
|
+
this._level = level2;
|
|
290
|
+
set(this, setOpts, logger, "error");
|
|
291
|
+
set(this, setOpts, logger, "fatal");
|
|
292
|
+
set(this, setOpts, logger, "warn");
|
|
293
|
+
set(this, setOpts, logger, "info");
|
|
294
|
+
set(this, setOpts, logger, "debug");
|
|
295
|
+
set(this, setOpts, logger, "trace");
|
|
296
|
+
customLevels.forEach((level3) => {
|
|
297
|
+
set(this, setOpts, logger, level3);
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
function child(setOpts2, bindings, childOptions) {
|
|
301
|
+
if (!bindings) {
|
|
302
|
+
throw new Error("missing bindings for child Pino");
|
|
303
|
+
}
|
|
304
|
+
childOptions = childOptions || {};
|
|
305
|
+
if (serialize && bindings.serializers) {
|
|
306
|
+
childOptions.serializers = bindings.serializers;
|
|
307
|
+
}
|
|
308
|
+
const childOptionsSerializers = childOptions.serializers;
|
|
309
|
+
if (serialize && childOptionsSerializers) {
|
|
310
|
+
var childSerializers = Object.assign({}, serializers, childOptionsSerializers);
|
|
311
|
+
var childSerialize = opts.browser.serialize === true ? Object.keys(childSerializers) : serialize;
|
|
312
|
+
delete bindings.serializers;
|
|
313
|
+
applySerializers([bindings], childSerialize, childSerializers, this._stdErrSerialize);
|
|
314
|
+
}
|
|
315
|
+
function Child(parent) {
|
|
316
|
+
this._childLevel = (parent._childLevel | 0) + 1;
|
|
317
|
+
this.bindings = bindings;
|
|
318
|
+
if (childSerializers) {
|
|
319
|
+
this.serializers = childSerializers;
|
|
320
|
+
this._serialize = childSerialize;
|
|
321
|
+
}
|
|
322
|
+
if (transmit2) {
|
|
323
|
+
this._logEvent = createLogEventShape(
|
|
324
|
+
[].concat(parent._logEvent.bindings, bindings)
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
Child.prototype = this;
|
|
329
|
+
const newLogger = new Child(this);
|
|
330
|
+
appendChildLogger(this, newLogger);
|
|
331
|
+
newLogger.child = function(...args) {
|
|
332
|
+
return child.call(this, setOpts2, ...args);
|
|
333
|
+
};
|
|
334
|
+
newLogger.level = childOptions.level || this.level;
|
|
335
|
+
setOpts2.onChild(newLogger);
|
|
336
|
+
return newLogger;
|
|
337
|
+
}
|
|
338
|
+
return logger;
|
|
38
339
|
}
|
|
39
|
-
|
|
40
|
-
|
|
340
|
+
function getLevels(opts) {
|
|
341
|
+
const customLevels = opts.customLevels || {};
|
|
342
|
+
const values = Object.assign({}, pino2.levels.values, customLevels);
|
|
343
|
+
const labels = Object.assign({}, pino2.levels.labels, invertObject(customLevels));
|
|
344
|
+
return {
|
|
345
|
+
values,
|
|
346
|
+
labels
|
|
347
|
+
};
|
|
41
348
|
}
|
|
42
|
-
|
|
43
|
-
|
|
349
|
+
function invertObject(obj) {
|
|
350
|
+
const inverted = {};
|
|
351
|
+
Object.keys(obj).forEach(function(key) {
|
|
352
|
+
inverted[obj[key]] = key;
|
|
353
|
+
});
|
|
354
|
+
return inverted;
|
|
355
|
+
}
|
|
356
|
+
pino2.levels = {
|
|
357
|
+
values: {
|
|
358
|
+
fatal: 60,
|
|
359
|
+
error: 50,
|
|
360
|
+
warn: 40,
|
|
361
|
+
info: 30,
|
|
362
|
+
debug: 20,
|
|
363
|
+
trace: 10
|
|
364
|
+
},
|
|
365
|
+
labels: {
|
|
366
|
+
10: "trace",
|
|
367
|
+
20: "debug",
|
|
368
|
+
30: "info",
|
|
369
|
+
40: "warn",
|
|
370
|
+
50: "error",
|
|
371
|
+
60: "fatal"
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
pino2.stdSerializers = stdSerializers;
|
|
375
|
+
pino2.stdTimeFunctions = Object.assign({}, { nullTime, epochTime, unixTime, isoTime });
|
|
376
|
+
function getBindingChain(logger) {
|
|
377
|
+
const bindings = [];
|
|
378
|
+
if (logger.bindings) {
|
|
379
|
+
bindings.push(logger.bindings);
|
|
380
|
+
}
|
|
381
|
+
let hierarchy = logger[hierarchySymbol];
|
|
382
|
+
while (hierarchy.parent) {
|
|
383
|
+
hierarchy = hierarchy.parent;
|
|
384
|
+
if (hierarchy.logger.bindings) {
|
|
385
|
+
bindings.push(hierarchy.logger.bindings);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
return bindings.reverse();
|
|
389
|
+
}
|
|
390
|
+
function set(self2, opts, rootLogger, level) {
|
|
391
|
+
Object.defineProperty(self2, level, {
|
|
392
|
+
value: levelToValue(self2.level, rootLogger) > levelToValue(level, rootLogger) ? noop2 : rootLogger[baseLogFunctionSymbol][level],
|
|
393
|
+
writable: true,
|
|
394
|
+
enumerable: true,
|
|
395
|
+
configurable: true
|
|
396
|
+
});
|
|
397
|
+
if (self2[level] === noop2) {
|
|
398
|
+
if (!opts.transmit) return;
|
|
399
|
+
const transmitLevel = opts.transmit.level || self2.level;
|
|
400
|
+
const transmitValue = levelToValue(transmitLevel, rootLogger);
|
|
401
|
+
const methodValue = levelToValue(level, rootLogger);
|
|
402
|
+
if (methodValue < transmitValue) return;
|
|
403
|
+
}
|
|
404
|
+
self2[level] = createWrap(self2, opts, rootLogger, level);
|
|
405
|
+
const bindings = getBindingChain(self2);
|
|
406
|
+
if (bindings.length === 0) {
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
self2[level] = prependBindingsInArguments(bindings, self2[level]);
|
|
44
410
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
411
|
+
function prependBindingsInArguments(bindings, logFunc) {
|
|
412
|
+
return function() {
|
|
413
|
+
return logFunc.apply(this, [...bindings, ...arguments]);
|
|
414
|
+
};
|
|
49
415
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
416
|
+
function createWrap(self2, opts, rootLogger, level) {
|
|
417
|
+
return /* @__PURE__ */ function(write) {
|
|
418
|
+
return function LOG() {
|
|
419
|
+
const ts = opts.timestamp();
|
|
420
|
+
const args = new Array(arguments.length);
|
|
421
|
+
const proto2 = Object.getPrototypeOf && Object.getPrototypeOf(this) === _console ? _console : this;
|
|
422
|
+
for (var i = 0; i < args.length; i++) args[i] = arguments[i];
|
|
423
|
+
var argsIsSerialized = false;
|
|
424
|
+
if (opts.serialize) {
|
|
425
|
+
applySerializers(args, this._serialize, this.serializers, this._stdErrSerialize);
|
|
426
|
+
argsIsSerialized = true;
|
|
427
|
+
}
|
|
428
|
+
if (opts.asObject || opts.formatters) {
|
|
429
|
+
write.call(proto2, asObject(this, level, args, ts, opts));
|
|
430
|
+
} else write.apply(proto2, args);
|
|
431
|
+
if (opts.transmit) {
|
|
432
|
+
const transmitLevel = opts.transmit.level || self2._level;
|
|
433
|
+
const transmitValue = levelToValue(transmitLevel, rootLogger);
|
|
434
|
+
const methodValue = levelToValue(level, rootLogger);
|
|
435
|
+
if (methodValue < transmitValue) return;
|
|
436
|
+
transmit(this, {
|
|
437
|
+
ts,
|
|
438
|
+
methodLevel: level,
|
|
439
|
+
methodValue,
|
|
440
|
+
transmitValue: rootLogger.levels.values[opts.transmit.level || self2._level],
|
|
441
|
+
send: opts.transmit.send,
|
|
442
|
+
val: levelToValue(self2._level, rootLogger)
|
|
443
|
+
}, args, argsIsSerialized);
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
}(self2[baseLogFunctionSymbol][level]);
|
|
447
|
+
}
|
|
448
|
+
function asObject(logger, level, args, ts, opts) {
|
|
449
|
+
const {
|
|
450
|
+
level: levelFormatter,
|
|
451
|
+
log: logObjectFormatter = (obj) => obj
|
|
452
|
+
} = opts.formatters || {};
|
|
453
|
+
const argsCloned = args.slice();
|
|
454
|
+
let msg = argsCloned[0];
|
|
455
|
+
const logObject = {};
|
|
456
|
+
if (ts) {
|
|
457
|
+
logObject.time = ts;
|
|
458
|
+
}
|
|
459
|
+
if (levelFormatter) {
|
|
460
|
+
const formattedLevel = levelFormatter(level, logger.levels.values[level]);
|
|
461
|
+
Object.assign(logObject, formattedLevel);
|
|
462
|
+
} else {
|
|
463
|
+
logObject.level = logger.levels.values[level];
|
|
464
|
+
}
|
|
465
|
+
let lvl = (logger._childLevel | 0) + 1;
|
|
466
|
+
if (lvl < 1) lvl = 1;
|
|
467
|
+
if (msg !== null && typeof msg === "object") {
|
|
468
|
+
while (lvl-- && typeof argsCloned[0] === "object") {
|
|
469
|
+
Object.assign(logObject, argsCloned.shift());
|
|
470
|
+
}
|
|
471
|
+
msg = argsCloned.length ? format(argsCloned.shift(), argsCloned) : void 0;
|
|
472
|
+
} else if (typeof msg === "string") msg = format(argsCloned.shift(), argsCloned);
|
|
473
|
+
if (msg !== void 0) logObject[opts.messageKey] = msg;
|
|
474
|
+
const formattedLogObject = logObjectFormatter(logObject);
|
|
475
|
+
return formattedLogObject;
|
|
476
|
+
}
|
|
477
|
+
function applySerializers(args, serialize, serializers, stdErrSerialize) {
|
|
478
|
+
for (const i in args) {
|
|
479
|
+
if (stdErrSerialize && args[i] instanceof Error) {
|
|
480
|
+
args[i] = pino2.stdSerializers.err(args[i]);
|
|
481
|
+
} else if (typeof args[i] === "object" && !Array.isArray(args[i]) && serialize) {
|
|
482
|
+
for (const k in args[i]) {
|
|
483
|
+
if (serialize.indexOf(k) > -1 && k in serializers) {
|
|
484
|
+
args[i][k] = serializers[k](args[i][k]);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
function transmit(logger, opts, args, argsIsSerialized = false) {
|
|
491
|
+
const send = opts.send;
|
|
492
|
+
const ts = opts.ts;
|
|
493
|
+
const methodLevel = opts.methodLevel;
|
|
494
|
+
const methodValue = opts.methodValue;
|
|
495
|
+
const val = opts.val;
|
|
496
|
+
const bindings = logger._logEvent.bindings;
|
|
497
|
+
if (!argsIsSerialized) {
|
|
498
|
+
applySerializers(
|
|
499
|
+
args,
|
|
500
|
+
logger._serialize || Object.keys(logger.serializers),
|
|
501
|
+
logger.serializers,
|
|
502
|
+
logger._stdErrSerialize === void 0 ? true : logger._stdErrSerialize
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
logger._logEvent.ts = ts;
|
|
506
|
+
logger._logEvent.messages = args.filter(function(arg) {
|
|
507
|
+
return bindings.indexOf(arg) === -1;
|
|
508
|
+
});
|
|
509
|
+
logger._logEvent.level.label = methodLevel;
|
|
510
|
+
logger._logEvent.level.value = methodValue;
|
|
511
|
+
send(methodLevel, logger._logEvent, val);
|
|
512
|
+
logger._logEvent = createLogEventShape(bindings);
|
|
513
|
+
}
|
|
514
|
+
function createLogEventShape(bindings) {
|
|
515
|
+
return {
|
|
516
|
+
ts: 0,
|
|
517
|
+
messages: [],
|
|
518
|
+
bindings: bindings || [],
|
|
519
|
+
level: { label: "", value: 0 }
|
|
56
520
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
console.error(formattedMessage, data ? data : "");
|
|
78
|
-
break;
|
|
521
|
+
}
|
|
522
|
+
function asErrValue(err2) {
|
|
523
|
+
const obj = {
|
|
524
|
+
type: err2.constructor.name,
|
|
525
|
+
msg: err2.message,
|
|
526
|
+
stack: err2.stack
|
|
527
|
+
};
|
|
528
|
+
for (const key in err2) {
|
|
529
|
+
if (obj[key] === void 0) {
|
|
530
|
+
obj[key] = err2[key];
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
return obj;
|
|
534
|
+
}
|
|
535
|
+
function getTimeFunction(opts) {
|
|
536
|
+
if (typeof opts.timestamp === "function") {
|
|
537
|
+
return opts.timestamp;
|
|
538
|
+
}
|
|
539
|
+
if (opts.timestamp === false) {
|
|
540
|
+
return nullTime;
|
|
79
541
|
}
|
|
542
|
+
return epochTime;
|
|
543
|
+
}
|
|
544
|
+
function mock() {
|
|
545
|
+
return {};
|
|
546
|
+
}
|
|
547
|
+
function passthrough(a) {
|
|
548
|
+
return a;
|
|
549
|
+
}
|
|
550
|
+
function noop2() {
|
|
551
|
+
}
|
|
552
|
+
function nullTime() {
|
|
553
|
+
return false;
|
|
554
|
+
}
|
|
555
|
+
function epochTime() {
|
|
556
|
+
return Date.now();
|
|
557
|
+
}
|
|
558
|
+
function unixTime() {
|
|
559
|
+
return Math.round(Date.now() / 1e3);
|
|
560
|
+
}
|
|
561
|
+
function isoTime() {
|
|
562
|
+
return new Date(Date.now()).toISOString();
|
|
563
|
+
}
|
|
564
|
+
function pfGlobalThisOrFallback() {
|
|
565
|
+
function defd(o) {
|
|
566
|
+
return typeof o !== "undefined" && o;
|
|
567
|
+
}
|
|
568
|
+
try {
|
|
569
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
570
|
+
Object.defineProperty(Object.prototype, "globalThis", {
|
|
571
|
+
get: function() {
|
|
572
|
+
delete Object.prototype.globalThis;
|
|
573
|
+
return this.globalThis = this;
|
|
574
|
+
},
|
|
575
|
+
configurable: true
|
|
576
|
+
});
|
|
577
|
+
return globalThis;
|
|
578
|
+
} catch (e) {
|
|
579
|
+
return defd(self) || defd(window) || defd(this) || {};
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
browser$1.exports.default = pino2;
|
|
583
|
+
browser$1.exports.pino = pino2;
|
|
584
|
+
return browser$1.exports;
|
|
585
|
+
}
|
|
586
|
+
var browserExports$1 = requireBrowser$1();
|
|
587
|
+
const pino = /* @__PURE__ */ getDefaultExportFromCjs$1(browserExports$1);
|
|
588
|
+
let Logger$1 = (_a = class {
|
|
589
|
+
constructor(options = {}) {
|
|
590
|
+
const level = options.level || "info";
|
|
591
|
+
this.moduleContext = options.module || "app";
|
|
592
|
+
const pinoOptions = {
|
|
593
|
+
level,
|
|
594
|
+
enabled: !options.silent,
|
|
595
|
+
transport: options.prettyPrint !== false ? {
|
|
596
|
+
target: "pino-pretty",
|
|
597
|
+
options: {
|
|
598
|
+
colorize: true,
|
|
599
|
+
translateTime: "SYS:standard",
|
|
600
|
+
ignore: "pid,hostname"
|
|
601
|
+
}
|
|
602
|
+
} : void 0
|
|
603
|
+
};
|
|
604
|
+
this.logger = pino(pinoOptions);
|
|
80
605
|
}
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
|
|
606
|
+
static getInstance(options = {}) {
|
|
607
|
+
const moduleKey = options.module || "default";
|
|
608
|
+
if (!_a.instances.has(moduleKey)) {
|
|
609
|
+
_a.instances.set(moduleKey, new _a(options));
|
|
85
610
|
}
|
|
86
|
-
|
|
87
|
-
|
|
611
|
+
return _a.instances.get(moduleKey);
|
|
612
|
+
}
|
|
613
|
+
setLogLevel(level) {
|
|
614
|
+
this.logger.level = level;
|
|
615
|
+
}
|
|
616
|
+
setSilent(silent) {
|
|
617
|
+
if (silent) {
|
|
618
|
+
this.logger.level = "silent";
|
|
88
619
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
620
|
+
}
|
|
621
|
+
setModule(module) {
|
|
622
|
+
this.moduleContext = module;
|
|
92
623
|
}
|
|
93
624
|
debug(message, data) {
|
|
94
|
-
|
|
625
|
+
if (data) {
|
|
626
|
+
this.logger.debug({ module: this.moduleContext, ...data }, message);
|
|
627
|
+
} else {
|
|
628
|
+
this.logger.debug({ module: this.moduleContext }, message);
|
|
629
|
+
}
|
|
95
630
|
}
|
|
96
631
|
info(message, data) {
|
|
97
|
-
|
|
632
|
+
if (data) {
|
|
633
|
+
this.logger.info({ module: this.moduleContext, ...data }, message);
|
|
634
|
+
} else {
|
|
635
|
+
this.logger.info({ module: this.moduleContext }, message);
|
|
636
|
+
}
|
|
98
637
|
}
|
|
99
638
|
warn(message, data) {
|
|
100
|
-
|
|
639
|
+
if (data) {
|
|
640
|
+
this.logger.warn({ module: this.moduleContext, ...data }, message);
|
|
641
|
+
} else {
|
|
642
|
+
this.logger.warn({ module: this.moduleContext }, message);
|
|
643
|
+
}
|
|
101
644
|
}
|
|
102
645
|
error(message, data) {
|
|
103
|
-
|
|
646
|
+
if (data) {
|
|
647
|
+
this.logger.error({ module: this.moduleContext, ...data }, message);
|
|
648
|
+
} else {
|
|
649
|
+
this.logger.error({ module: this.moduleContext }, message);
|
|
650
|
+
}
|
|
104
651
|
}
|
|
105
|
-
};
|
|
652
|
+
}, _a.instances = /* @__PURE__ */ new Map(), _a);
|
|
106
653
|
const sleep = (ms2) => {
|
|
107
654
|
return new Promise((resolve) => setTimeout(resolve, ms2));
|
|
108
655
|
};
|
|
@@ -1911,9 +2458,9 @@ _parent = new WeakMap();
|
|
|
1911
2458
|
_maxInflation = new WeakMap();
|
|
1912
2459
|
_Reader_instances = new WeakSet();
|
|
1913
2460
|
incrementBytesRead_fn = function(count) {
|
|
1914
|
-
var
|
|
2461
|
+
var _a3;
|
|
1915
2462
|
if (__privateGet(this, _parent)) {
|
|
1916
|
-
return __privateMethod(
|
|
2463
|
+
return __privateMethod(_a3 = __privateGet(this, _parent), _Reader_instances, incrementBytesRead_fn).call(_a3, count);
|
|
1917
2464
|
}
|
|
1918
2465
|
__privateSet(this, _bytesRead, __privateGet(this, _bytesRead) + count);
|
|
1919
2466
|
assert(__privateGet(this, _maxInflation) < 1 || __privateGet(this, _bytesRead) <= __privateGet(this, _maxInflation) * this.dataLength, `compressed ABI data exceeds inflation ratio of ${__privateGet(this, _maxInflation)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`, "BUFFER_OVERRUN", {
|
|
@@ -4036,8 +4583,8 @@ walkAsync_fn = function(promises, value, process2, setValue) {
|
|
|
4036
4583
|
const childType = this.arrayChildren;
|
|
4037
4584
|
const result2 = value.slice();
|
|
4038
4585
|
result2.forEach((value2, index) => {
|
|
4039
|
-
var
|
|
4040
|
-
__privateMethod(
|
|
4586
|
+
var _a3;
|
|
4587
|
+
__privateMethod(_a3 = childType, _ParamType_instances, walkAsync_fn).call(_a3, promises, value2, process2, (value3) => {
|
|
4041
4588
|
result2[index] = value3;
|
|
4042
4589
|
});
|
|
4043
4590
|
});
|
|
@@ -4067,8 +4614,8 @@ walkAsync_fn = function(promises, value, process2, setValue) {
|
|
|
4067
4614
|
throw new Error("array is wrong length");
|
|
4068
4615
|
}
|
|
4069
4616
|
result2.forEach((value2, index) => {
|
|
4070
|
-
var
|
|
4071
|
-
__privateMethod(
|
|
4617
|
+
var _a3;
|
|
4618
|
+
__privateMethod(_a3 = components[index], _ParamType_instances, walkAsync_fn).call(_a3, promises, value2, process2, (value3) => {
|
|
4072
4619
|
result2[index] = value3;
|
|
4073
4620
|
});
|
|
4074
4621
|
});
|
|
@@ -8433,7 +8980,7 @@ const _Logger = class _Logger2 {
|
|
|
8433
8980
|
}
|
|
8434
8981
|
};
|
|
8435
8982
|
__publicField2(_Logger, "instance");
|
|
8436
|
-
let
|
|
8983
|
+
let Logger = _Logger;
|
|
8437
8984
|
class ValidationError extends Error {
|
|
8438
8985
|
constructor(message) {
|
|
8439
8986
|
super(message);
|
|
@@ -8452,7 +8999,7 @@ class Auth {
|
|
|
8452
8999
|
this.baseUrl = config.baseUrl || "https://kiloscribe.com";
|
|
8453
9000
|
}
|
|
8454
9001
|
async authenticate() {
|
|
8455
|
-
var
|
|
9002
|
+
var _a22, _b2, _c;
|
|
8456
9003
|
const requestSignatureResponse = await axios$1.get(
|
|
8457
9004
|
`${this.baseUrl}/api/auth/request-signature`,
|
|
8458
9005
|
{
|
|
@@ -8461,7 +9008,7 @@ class Auth {
|
|
|
8461
9008
|
}
|
|
8462
9009
|
}
|
|
8463
9010
|
);
|
|
8464
|
-
if (!((
|
|
9011
|
+
if (!((_a22 = requestSignatureResponse.data) == null ? void 0 : _a22.message)) {
|
|
8465
9012
|
throw new Error("Failed to get signature message");
|
|
8466
9013
|
}
|
|
8467
9014
|
const message = requestSignatureResponse.data.message;
|
|
@@ -8505,7 +9052,7 @@ class ClientAuth {
|
|
|
8505
9052
|
this.logger = config.logger;
|
|
8506
9053
|
}
|
|
8507
9054
|
async authenticate() {
|
|
8508
|
-
var
|
|
9055
|
+
var _a22, _b2, _c;
|
|
8509
9056
|
const requestSignatureResponse = await axios$1.get(
|
|
8510
9057
|
`${this.baseUrl}/api/auth/request-signature`,
|
|
8511
9058
|
{
|
|
@@ -8514,7 +9061,7 @@ class ClientAuth {
|
|
|
8514
9061
|
}
|
|
8515
9062
|
}
|
|
8516
9063
|
);
|
|
8517
|
-
if (!((
|
|
9064
|
+
if (!((_a22 = requestSignatureResponse.data) == null ? void 0 : _a22.message)) {
|
|
8518
9065
|
throw new Error("Failed to get signature message");
|
|
8519
9066
|
}
|
|
8520
9067
|
const message = requestSignatureResponse.data.message;
|
|
@@ -8898,9 +9445,9 @@ class AbstractTokenizer {
|
|
|
8898
9445
|
return length;
|
|
8899
9446
|
}
|
|
8900
9447
|
async close() {
|
|
8901
|
-
var
|
|
9448
|
+
var _a22;
|
|
8902
9449
|
await this.abort();
|
|
8903
|
-
await ((
|
|
9450
|
+
await ((_a22 = this.onClose) == null ? void 0 : _a22.call(this));
|
|
8904
9451
|
}
|
|
8905
9452
|
normalizeOptions(uint8Array, options) {
|
|
8906
9453
|
if (!this.supportsRandomAccess() && options && options.position !== void 0 && options.position < this.position) {
|
|
@@ -9169,7 +9716,7 @@ var freb = function(eb, start) {
|
|
|
9169
9716
|
}
|
|
9170
9717
|
return { b: b2, r };
|
|
9171
9718
|
};
|
|
9172
|
-
var
|
|
9719
|
+
var _a2 = freb(fleb, 2), fl = _a2.b, revfl = _a2.r;
|
|
9173
9720
|
fl[28] = 258, revfl[258] = 28;
|
|
9174
9721
|
var _b = freb(fdeb, 0), fd = _b.b;
|
|
9175
9722
|
var rev = new u16(32768);
|
|
@@ -12033,7 +12580,7 @@ const _InscriptionSDK = class _InscriptionSDK2 {
|
|
|
12033
12580
|
constructor(config) {
|
|
12034
12581
|
__publicField2(this, "client");
|
|
12035
12582
|
__publicField2(this, "config");
|
|
12036
|
-
__publicField2(this, "logger",
|
|
12583
|
+
__publicField2(this, "logger", Logger.getInstance());
|
|
12037
12584
|
this.config = config;
|
|
12038
12585
|
if (!config.apiKey) {
|
|
12039
12586
|
throw new ValidationError("API key is required");
|
|
@@ -12049,7 +12596,7 @@ const _InscriptionSDK = class _InscriptionSDK2 {
|
|
|
12049
12596
|
baseURL: "https://v2-api.tier.bot/api",
|
|
12050
12597
|
headers
|
|
12051
12598
|
});
|
|
12052
|
-
this.logger =
|
|
12599
|
+
this.logger = Logger.getInstance();
|
|
12053
12600
|
}
|
|
12054
12601
|
async getFileMetadata(url) {
|
|
12055
12602
|
try {
|
|
@@ -12190,7 +12737,7 @@ const _InscriptionSDK = class _InscriptionSDK2 {
|
|
|
12190
12737
|
* @throws Error if the inscription fails
|
|
12191
12738
|
*/
|
|
12192
12739
|
async startInscription(request) {
|
|
12193
|
-
var
|
|
12740
|
+
var _a22, _b2;
|
|
12194
12741
|
try {
|
|
12195
12742
|
this.validateRequest(request);
|
|
12196
12743
|
let mimeType = request.file.mimeType;
|
|
@@ -12248,7 +12795,7 @@ const _InscriptionSDK = class _InscriptionSDK2 {
|
|
|
12248
12795
|
}
|
|
12249
12796
|
if (axios$1.isAxiosError(error)) {
|
|
12250
12797
|
throw new Error(
|
|
12251
|
-
((_b2 = (
|
|
12798
|
+
((_b2 = (_a22 = error.response) == null ? void 0 : _a22.data) == null ? void 0 : _b2.message) || "Failed to start inscription"
|
|
12252
12799
|
);
|
|
12253
12800
|
}
|
|
12254
12801
|
throw error;
|
|
@@ -12444,7 +12991,7 @@ const _InscriptionSDK = class _InscriptionSDK2 {
|
|
|
12444
12991
|
static async createWithAuth(config) {
|
|
12445
12992
|
const auth = config.type === "client" ? new ClientAuth({
|
|
12446
12993
|
...config,
|
|
12447
|
-
logger:
|
|
12994
|
+
logger: Logger.getInstance()
|
|
12448
12995
|
}) : new Auth(config);
|
|
12449
12996
|
const { apiKey } = await auth.authenticate();
|
|
12450
12997
|
return new _InscriptionSDK2({
|
|
@@ -12453,7 +13000,7 @@ const _InscriptionSDK = class _InscriptionSDK2 {
|
|
|
12453
13000
|
});
|
|
12454
13001
|
}
|
|
12455
13002
|
async waitForInscription(txId, maxAttempts = 30, intervalMs = 4e3, checkCompletion = false, progressCallback) {
|
|
12456
|
-
var
|
|
13003
|
+
var _a22;
|
|
12457
13004
|
let attempts = 0;
|
|
12458
13005
|
let highestPercentSoFar = 0;
|
|
12459
13006
|
const reportProgress = (stage, message, percent, details) => {
|
|
@@ -12520,7 +13067,7 @@ const _InscriptionSDK = class _InscriptionSDK2 {
|
|
|
12520
13067
|
}
|
|
12521
13068
|
);
|
|
12522
13069
|
const isHashinal = result.mode === "hashinal";
|
|
12523
|
-
const isDynamic = ((
|
|
13070
|
+
const isDynamic = ((_a22 = result.fileStandard) == null ? void 0 : _a22.toString()) === "6";
|
|
12524
13071
|
if (isHashinal && result.topic_id && result.jsonTopicId) {
|
|
12525
13072
|
if (!checkCompletion || result.completed) {
|
|
12526
13073
|
reportProgress(
|
|
@@ -15815,30 +16362,6 @@ async function waitForInscriptionConfirmation(sdk, transactionId, maxAttempts =
|
|
|
15815
16362
|
throw error;
|
|
15816
16363
|
}
|
|
15817
16364
|
}
|
|
15818
|
-
function getAugmentedNamespace(n2) {
|
|
15819
|
-
if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2;
|
|
15820
|
-
var f = n2.default;
|
|
15821
|
-
if (typeof f == "function") {
|
|
15822
|
-
var a = function a2() {
|
|
15823
|
-
if (this instanceof a2) {
|
|
15824
|
-
return Reflect.construct(f, arguments, this.constructor);
|
|
15825
|
-
}
|
|
15826
|
-
return f.apply(this, arguments);
|
|
15827
|
-
};
|
|
15828
|
-
a.prototype = f.prototype;
|
|
15829
|
-
} else a = {};
|
|
15830
|
-
Object.defineProperty(a, "__esModule", { value: true });
|
|
15831
|
-
Object.keys(n2).forEach(function(k) {
|
|
15832
|
-
var d = Object.getOwnPropertyDescriptor(n2, k);
|
|
15833
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
15834
|
-
enumerable: true,
|
|
15835
|
-
get: function() {
|
|
15836
|
-
return n2[k];
|
|
15837
|
-
}
|
|
15838
|
-
});
|
|
15839
|
-
});
|
|
15840
|
-
return a;
|
|
15841
|
-
}
|
|
15842
16365
|
var mimeTypes = {};
|
|
15843
16366
|
const require$$0 = {
|
|
15844
16367
|
"application/1d-interleaved-parityfec": { "source": "iana" },
|
|
@@ -18764,13 +19287,13 @@ function processCreateParams(params) {
|
|
|
18764
19287
|
if (errorMap2)
|
|
18765
19288
|
return { errorMap: errorMap2, description };
|
|
18766
19289
|
const customMap = (iss, ctx) => {
|
|
18767
|
-
var
|
|
19290
|
+
var _a3, _b2;
|
|
18768
19291
|
const { message } = params;
|
|
18769
19292
|
if (iss.code === "invalid_enum_value") {
|
|
18770
19293
|
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
|
18771
19294
|
}
|
|
18772
19295
|
if (typeof ctx.data === "undefined") {
|
|
18773
|
-
return { message: (
|
|
19296
|
+
return { message: (_a3 = message !== null && message !== void 0 ? message : required_error) !== null && _a3 !== void 0 ? _a3 : ctx.defaultError };
|
|
18774
19297
|
}
|
|
18775
19298
|
if (iss.code !== "invalid_type")
|
|
18776
19299
|
return { message: ctx.defaultError };
|
|
@@ -18826,11 +19349,11 @@ class ZodType {
|
|
|
18826
19349
|
throw result.error;
|
|
18827
19350
|
}
|
|
18828
19351
|
safeParse(data, params) {
|
|
18829
|
-
var
|
|
19352
|
+
var _a3;
|
|
18830
19353
|
const ctx = {
|
|
18831
19354
|
common: {
|
|
18832
19355
|
issues: [],
|
|
18833
|
-
async: (
|
|
19356
|
+
async: (_a3 = params === null || params === void 0 ? void 0 : params.async) !== null && _a3 !== void 0 ? _a3 : false,
|
|
18834
19357
|
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
|
|
18835
19358
|
},
|
|
18836
19359
|
path: (params === null || params === void 0 ? void 0 : params.path) || [],
|
|
@@ -18843,7 +19366,7 @@ class ZodType {
|
|
|
18843
19366
|
return handleResult(ctx, result);
|
|
18844
19367
|
}
|
|
18845
19368
|
"~validate"(data) {
|
|
18846
|
-
var
|
|
19369
|
+
var _a3, _b2;
|
|
18847
19370
|
const ctx = {
|
|
18848
19371
|
common: {
|
|
18849
19372
|
issues: [],
|
|
@@ -18864,7 +19387,7 @@ class ZodType {
|
|
|
18864
19387
|
issues: ctx.common.issues
|
|
18865
19388
|
};
|
|
18866
19389
|
} catch (err2) {
|
|
18867
|
-
if ((_b2 = (
|
|
19390
|
+
if ((_b2 = (_a3 = err2 === null || err2 === void 0 ? void 0 : err2.message) === null || _a3 === void 0 ? void 0 : _a3.toLowerCase()) === null || _b2 === void 0 ? void 0 : _b2.includes("encountered")) {
|
|
18868
19391
|
this["~standard"].async = true;
|
|
18869
19392
|
}
|
|
18870
19393
|
ctx.common = {
|
|
@@ -19125,7 +19648,7 @@ function isValidJWT(jwt, alg) {
|
|
|
19125
19648
|
if (alg && decoded.alg !== alg)
|
|
19126
19649
|
return false;
|
|
19127
19650
|
return true;
|
|
19128
|
-
} catch (
|
|
19651
|
+
} catch (_a3) {
|
|
19129
19652
|
return false;
|
|
19130
19653
|
}
|
|
19131
19654
|
}
|
|
@@ -19284,7 +19807,7 @@ class ZodString extends ZodType {
|
|
|
19284
19807
|
} else if (check.kind === "url") {
|
|
19285
19808
|
try {
|
|
19286
19809
|
new URL(input.data);
|
|
19287
|
-
} catch (
|
|
19810
|
+
} catch (_a3) {
|
|
19288
19811
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
19289
19812
|
addIssueToContext(ctx, {
|
|
19290
19813
|
validation: "url",
|
|
@@ -19496,7 +20019,7 @@ class ZodString extends ZodType {
|
|
|
19496
20019
|
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
19497
20020
|
}
|
|
19498
20021
|
datetime(options) {
|
|
19499
|
-
var
|
|
20022
|
+
var _a3, _b2;
|
|
19500
20023
|
if (typeof options === "string") {
|
|
19501
20024
|
return this._addCheck({
|
|
19502
20025
|
kind: "datetime",
|
|
@@ -19509,7 +20032,7 @@ class ZodString extends ZodType {
|
|
|
19509
20032
|
return this._addCheck({
|
|
19510
20033
|
kind: "datetime",
|
|
19511
20034
|
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
19512
|
-
offset: (
|
|
20035
|
+
offset: (_a3 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a3 !== void 0 ? _a3 : false,
|
|
19513
20036
|
local: (_b2 = options === null || options === void 0 ? void 0 : options.local) !== null && _b2 !== void 0 ? _b2 : false,
|
|
19514
20037
|
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
19515
20038
|
});
|
|
@@ -19678,11 +20201,11 @@ class ZodString extends ZodType {
|
|
|
19678
20201
|
}
|
|
19679
20202
|
}
|
|
19680
20203
|
ZodString.create = (params) => {
|
|
19681
|
-
var
|
|
20204
|
+
var _a3;
|
|
19682
20205
|
return new ZodString({
|
|
19683
20206
|
checks: [],
|
|
19684
20207
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
19685
|
-
coerce: (
|
|
20208
|
+
coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
|
|
19686
20209
|
...processCreateParams(params)
|
|
19687
20210
|
});
|
|
19688
20211
|
};
|
|
@@ -19935,7 +20458,7 @@ class ZodBigInt extends ZodType {
|
|
|
19935
20458
|
if (this._def.coerce) {
|
|
19936
20459
|
try {
|
|
19937
20460
|
input.data = BigInt(input.data);
|
|
19938
|
-
} catch (
|
|
20461
|
+
} catch (_a3) {
|
|
19939
20462
|
return this._getInvalidInput(input);
|
|
19940
20463
|
}
|
|
19941
20464
|
}
|
|
@@ -20090,11 +20613,11 @@ class ZodBigInt extends ZodType {
|
|
|
20090
20613
|
}
|
|
20091
20614
|
}
|
|
20092
20615
|
ZodBigInt.create = (params) => {
|
|
20093
|
-
var
|
|
20616
|
+
var _a3;
|
|
20094
20617
|
return new ZodBigInt({
|
|
20095
20618
|
checks: [],
|
|
20096
20619
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
20097
|
-
coerce: (
|
|
20620
|
+
coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
|
|
20098
20621
|
...processCreateParams(params)
|
|
20099
20622
|
});
|
|
20100
20623
|
};
|
|
@@ -20600,8 +21123,8 @@ class ZodObject extends ZodType {
|
|
|
20600
21123
|
unknownKeys: "strict",
|
|
20601
21124
|
...message !== void 0 ? {
|
|
20602
21125
|
errorMap: (issue, ctx) => {
|
|
20603
|
-
var
|
|
20604
|
-
const defaultError = (_c = (_b2 = (
|
|
21126
|
+
var _a3, _b2, _c, _d;
|
|
21127
|
+
const defaultError = (_c = (_b2 = (_a3 = this._def).errorMap) === null || _b2 === void 0 ? void 0 : _b2.call(_a3, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
|
|
20605
21128
|
if (issue.code === "unrecognized_keys")
|
|
20606
21129
|
return {
|
|
20607
21130
|
message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
|
|
@@ -22067,21 +22590,21 @@ function cleanParams(params, data) {
|
|
|
22067
22590
|
function custom(check, _params = {}, fatal) {
|
|
22068
22591
|
if (check)
|
|
22069
22592
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
22070
|
-
var
|
|
22593
|
+
var _a3, _b2;
|
|
22071
22594
|
const r = check(data);
|
|
22072
22595
|
if (r instanceof Promise) {
|
|
22073
22596
|
return r.then((r2) => {
|
|
22074
|
-
var
|
|
22597
|
+
var _a4, _b3;
|
|
22075
22598
|
if (!r2) {
|
|
22076
22599
|
const params = cleanParams(_params, data);
|
|
22077
|
-
const _fatal = (_b3 = (
|
|
22600
|
+
const _fatal = (_b3 = (_a4 = params.fatal) !== null && _a4 !== void 0 ? _a4 : fatal) !== null && _b3 !== void 0 ? _b3 : true;
|
|
22078
22601
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
22079
22602
|
}
|
|
22080
22603
|
});
|
|
22081
22604
|
}
|
|
22082
22605
|
if (!r) {
|
|
22083
22606
|
const params = cleanParams(_params, data);
|
|
22084
|
-
const _fatal = (_b2 = (
|
|
22607
|
+
const _fatal = (_b2 = (_a3 = params.fatal) !== null && _a3 !== void 0 ? _a3 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
|
|
22085
22608
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
22086
22609
|
}
|
|
22087
22610
|
return;
|
|
@@ -23291,7 +23814,8 @@ class HCS10BaseClient extends Registration {
|
|
|
23291
23814
|
this.network = config.network;
|
|
23292
23815
|
this.logger = Logger$1.getInstance({
|
|
23293
23816
|
level: config.logLevel || "info",
|
|
23294
|
-
module: "HCS10-BaseClient"
|
|
23817
|
+
module: "HCS10-BaseClient",
|
|
23818
|
+
prettyPrint: config.prettyPrint
|
|
23295
23819
|
});
|
|
23296
23820
|
this.mirrorNode = new HederaMirrorNode(
|
|
23297
23821
|
config.network,
|
|
@@ -23371,10 +23895,10 @@ class HCS10BaseClient extends Registration {
|
|
|
23371
23895
|
}
|
|
23372
23896
|
const profile = profileResult.profile;
|
|
23373
23897
|
let topicInfo = null;
|
|
23374
|
-
if (profileResult.topicInfo?.
|
|
23898
|
+
if (profileResult.topicInfo?.inboundTopic && profileResult.topicInfo?.outboundTopic && profileResult.topicInfo?.profileTopicId) {
|
|
23375
23899
|
topicInfo = {
|
|
23376
|
-
inboundTopic: profileResult.topicInfo.
|
|
23377
|
-
outboundTopic: profileResult.topicInfo.
|
|
23900
|
+
inboundTopic: profileResult.topicInfo.inboundTopic,
|
|
23901
|
+
outboundTopic: profileResult.topicInfo.outboundTopic,
|
|
23378
23902
|
profileTopicId: profileResult.topicInfo.profileTopicId
|
|
23379
23903
|
};
|
|
23380
23904
|
const cacheKey = `${accountId}-${this.network}`;
|
|
@@ -23645,7 +24169,8 @@ class HCS10Client extends HCS10BaseClient {
|
|
|
23645
24169
|
constructor(config) {
|
|
23646
24170
|
super({
|
|
23647
24171
|
network: config.network,
|
|
23648
|
-
logLevel: config.logLevel
|
|
24172
|
+
logLevel: config.logLevel,
|
|
24173
|
+
prettyPrint: config.prettyPrint
|
|
23649
24174
|
});
|
|
23650
24175
|
this.client = config.network === "mainnet" ? Client.forMainnet() : Client.forTestnet();
|
|
23651
24176
|
this.operatorPrivateKey = PrivateKey.fromString(config.operatorPrivateKey);
|
|
@@ -24792,14 +25317,16 @@ class BrowserHCSClient extends HCS10BaseClient {
|
|
|
24792
25317
|
constructor(config) {
|
|
24793
25318
|
super({
|
|
24794
25319
|
network: config.network,
|
|
24795
|
-
logLevel: config.logLevel
|
|
25320
|
+
logLevel: config.logLevel,
|
|
25321
|
+
prettyPrint: config.prettyPrint
|
|
24796
25322
|
});
|
|
24797
25323
|
this.hcs11Client = null;
|
|
24798
25324
|
this.hwc = config.hwc;
|
|
24799
25325
|
this.guardedRegistryBaseUrl = config.guardedRegistryBaseUrl || "https://moonscape.tech";
|
|
24800
25326
|
this.logger = Logger$1.getInstance({
|
|
24801
25327
|
level: config.logLevel || "info",
|
|
24802
|
-
module: "HCS-Browser"
|
|
25328
|
+
module: "HCS-Browser",
|
|
25329
|
+
prettyPrint: config.prettyPrint
|
|
24803
25330
|
});
|
|
24804
25331
|
if (isBrowser) {
|
|
24805
25332
|
try {
|