@hashgraphonline/standards-sdk 0.0.42 → 0.0.44
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/LICENSE +189 -0
- package/README.md +81 -208
- 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 +683 -154
- package/dist/es/standards-sdk.es.js.map +1 -1
- package/dist/es/utils/logger.d.ts +4 -17
- package/dist/es/utils/sleep.d.ts +1 -0
- 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 +5 -5
- package/dist/umd/standards-sdk.umd.js.map +1 -1
- package/dist/umd/utils/logger.d.ts +4 -17
- package/dist/umd/utils/sleep.d.ts +1 -0
- package/package.json +3 -1
|
@@ -17,93 +17,640 @@ 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
|
-
|
|
78
|
-
|
|
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;
|
|
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;
|
|
79
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
|
-
};
|
|
106
|
-
const sleep = (ms2) => {
|
|
652
|
+
}, _a.instances = /* @__PURE__ */ new Map(), _a);
|
|
653
|
+
const sleep$1 = (ms2) => {
|
|
107
654
|
return new Promise((resolve) => setTimeout(resolve, ms2));
|
|
108
655
|
};
|
|
109
656
|
class HCS {
|
|
@@ -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(
|
|
@@ -15768,7 +16315,7 @@ async function waitForInscriptionConfirmation(sdk, transactionId, maxAttempts =
|
|
|
15768
16315
|
intervalMs
|
|
15769
16316
|
});
|
|
15770
16317
|
try {
|
|
15771
|
-
const waitMethod = sdk.waitForInscription;
|
|
16318
|
+
const waitMethod = sdk.waitForInscription.bind(sdk);
|
|
15772
16319
|
const wrappedCallback = (data) => {
|
|
15773
16320
|
const stage = data.stage || "confirming";
|
|
15774
16321
|
const message = data.message || "Processing inscription";
|
|
@@ -15777,7 +16324,7 @@ async function waitForInscriptionConfirmation(sdk, transactionId, maxAttempts =
|
|
|
15777
16324
|
stage,
|
|
15778
16325
|
message,
|
|
15779
16326
|
progressPercent: percent,
|
|
15780
|
-
details:
|
|
16327
|
+
details: {}
|
|
15781
16328
|
});
|
|
15782
16329
|
};
|
|
15783
16330
|
return await waitMethod(
|
|
@@ -15788,6 +16335,7 @@ async function waitForInscriptionConfirmation(sdk, transactionId, maxAttempts =
|
|
|
15788
16335
|
wrappedCallback
|
|
15789
16336
|
);
|
|
15790
16337
|
} catch (e) {
|
|
16338
|
+
console.log(e);
|
|
15791
16339
|
logger.debug("Falling back to standard waitForInscription method", {
|
|
15792
16340
|
error: e
|
|
15793
16341
|
});
|
|
@@ -15815,30 +16363,6 @@ async function waitForInscriptionConfirmation(sdk, transactionId, maxAttempts =
|
|
|
15815
16363
|
throw error;
|
|
15816
16364
|
}
|
|
15817
16365
|
}
|
|
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
16366
|
var mimeTypes = {};
|
|
15843
16367
|
const require$$0 = {
|
|
15844
16368
|
"application/1d-interleaved-parityfec": { "source": "iana" },
|
|
@@ -18764,13 +19288,13 @@ function processCreateParams(params) {
|
|
|
18764
19288
|
if (errorMap2)
|
|
18765
19289
|
return { errorMap: errorMap2, description };
|
|
18766
19290
|
const customMap = (iss, ctx) => {
|
|
18767
|
-
var
|
|
19291
|
+
var _a3, _b2;
|
|
18768
19292
|
const { message } = params;
|
|
18769
19293
|
if (iss.code === "invalid_enum_value") {
|
|
18770
19294
|
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
|
18771
19295
|
}
|
|
18772
19296
|
if (typeof ctx.data === "undefined") {
|
|
18773
|
-
return { message: (
|
|
19297
|
+
return { message: (_a3 = message !== null && message !== void 0 ? message : required_error) !== null && _a3 !== void 0 ? _a3 : ctx.defaultError };
|
|
18774
19298
|
}
|
|
18775
19299
|
if (iss.code !== "invalid_type")
|
|
18776
19300
|
return { message: ctx.defaultError };
|
|
@@ -18826,11 +19350,11 @@ class ZodType {
|
|
|
18826
19350
|
throw result.error;
|
|
18827
19351
|
}
|
|
18828
19352
|
safeParse(data, params) {
|
|
18829
|
-
var
|
|
19353
|
+
var _a3;
|
|
18830
19354
|
const ctx = {
|
|
18831
19355
|
common: {
|
|
18832
19356
|
issues: [],
|
|
18833
|
-
async: (
|
|
19357
|
+
async: (_a3 = params === null || params === void 0 ? void 0 : params.async) !== null && _a3 !== void 0 ? _a3 : false,
|
|
18834
19358
|
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
|
|
18835
19359
|
},
|
|
18836
19360
|
path: (params === null || params === void 0 ? void 0 : params.path) || [],
|
|
@@ -18843,7 +19367,7 @@ class ZodType {
|
|
|
18843
19367
|
return handleResult(ctx, result);
|
|
18844
19368
|
}
|
|
18845
19369
|
"~validate"(data) {
|
|
18846
|
-
var
|
|
19370
|
+
var _a3, _b2;
|
|
18847
19371
|
const ctx = {
|
|
18848
19372
|
common: {
|
|
18849
19373
|
issues: [],
|
|
@@ -18864,7 +19388,7 @@ class ZodType {
|
|
|
18864
19388
|
issues: ctx.common.issues
|
|
18865
19389
|
};
|
|
18866
19390
|
} catch (err2) {
|
|
18867
|
-
if ((_b2 = (
|
|
19391
|
+
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
19392
|
this["~standard"].async = true;
|
|
18869
19393
|
}
|
|
18870
19394
|
ctx.common = {
|
|
@@ -19125,7 +19649,7 @@ function isValidJWT(jwt, alg) {
|
|
|
19125
19649
|
if (alg && decoded.alg !== alg)
|
|
19126
19650
|
return false;
|
|
19127
19651
|
return true;
|
|
19128
|
-
} catch (
|
|
19652
|
+
} catch (_a3) {
|
|
19129
19653
|
return false;
|
|
19130
19654
|
}
|
|
19131
19655
|
}
|
|
@@ -19284,7 +19808,7 @@ class ZodString extends ZodType {
|
|
|
19284
19808
|
} else if (check.kind === "url") {
|
|
19285
19809
|
try {
|
|
19286
19810
|
new URL(input.data);
|
|
19287
|
-
} catch (
|
|
19811
|
+
} catch (_a3) {
|
|
19288
19812
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
19289
19813
|
addIssueToContext(ctx, {
|
|
19290
19814
|
validation: "url",
|
|
@@ -19496,7 +20020,7 @@ class ZodString extends ZodType {
|
|
|
19496
20020
|
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
19497
20021
|
}
|
|
19498
20022
|
datetime(options) {
|
|
19499
|
-
var
|
|
20023
|
+
var _a3, _b2;
|
|
19500
20024
|
if (typeof options === "string") {
|
|
19501
20025
|
return this._addCheck({
|
|
19502
20026
|
kind: "datetime",
|
|
@@ -19509,7 +20033,7 @@ class ZodString extends ZodType {
|
|
|
19509
20033
|
return this._addCheck({
|
|
19510
20034
|
kind: "datetime",
|
|
19511
20035
|
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
19512
|
-
offset: (
|
|
20036
|
+
offset: (_a3 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a3 !== void 0 ? _a3 : false,
|
|
19513
20037
|
local: (_b2 = options === null || options === void 0 ? void 0 : options.local) !== null && _b2 !== void 0 ? _b2 : false,
|
|
19514
20038
|
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
19515
20039
|
});
|
|
@@ -19678,11 +20202,11 @@ class ZodString extends ZodType {
|
|
|
19678
20202
|
}
|
|
19679
20203
|
}
|
|
19680
20204
|
ZodString.create = (params) => {
|
|
19681
|
-
var
|
|
20205
|
+
var _a3;
|
|
19682
20206
|
return new ZodString({
|
|
19683
20207
|
checks: [],
|
|
19684
20208
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
19685
|
-
coerce: (
|
|
20209
|
+
coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
|
|
19686
20210
|
...processCreateParams(params)
|
|
19687
20211
|
});
|
|
19688
20212
|
};
|
|
@@ -19935,7 +20459,7 @@ class ZodBigInt extends ZodType {
|
|
|
19935
20459
|
if (this._def.coerce) {
|
|
19936
20460
|
try {
|
|
19937
20461
|
input.data = BigInt(input.data);
|
|
19938
|
-
} catch (
|
|
20462
|
+
} catch (_a3) {
|
|
19939
20463
|
return this._getInvalidInput(input);
|
|
19940
20464
|
}
|
|
19941
20465
|
}
|
|
@@ -20090,11 +20614,11 @@ class ZodBigInt extends ZodType {
|
|
|
20090
20614
|
}
|
|
20091
20615
|
}
|
|
20092
20616
|
ZodBigInt.create = (params) => {
|
|
20093
|
-
var
|
|
20617
|
+
var _a3;
|
|
20094
20618
|
return new ZodBigInt({
|
|
20095
20619
|
checks: [],
|
|
20096
20620
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
20097
|
-
coerce: (
|
|
20621
|
+
coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
|
|
20098
20622
|
...processCreateParams(params)
|
|
20099
20623
|
});
|
|
20100
20624
|
};
|
|
@@ -20600,8 +21124,8 @@ class ZodObject extends ZodType {
|
|
|
20600
21124
|
unknownKeys: "strict",
|
|
20601
21125
|
...message !== void 0 ? {
|
|
20602
21126
|
errorMap: (issue, ctx) => {
|
|
20603
|
-
var
|
|
20604
|
-
const defaultError = (_c = (_b2 = (
|
|
21127
|
+
var _a3, _b2, _c, _d;
|
|
21128
|
+
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
21129
|
if (issue.code === "unrecognized_keys")
|
|
20606
21130
|
return {
|
|
20607
21131
|
message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
|
|
@@ -22067,21 +22591,21 @@ function cleanParams(params, data) {
|
|
|
22067
22591
|
function custom(check, _params = {}, fatal) {
|
|
22068
22592
|
if (check)
|
|
22069
22593
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
22070
|
-
var
|
|
22594
|
+
var _a3, _b2;
|
|
22071
22595
|
const r = check(data);
|
|
22072
22596
|
if (r instanceof Promise) {
|
|
22073
22597
|
return r.then((r2) => {
|
|
22074
|
-
var
|
|
22598
|
+
var _a4, _b3;
|
|
22075
22599
|
if (!r2) {
|
|
22076
22600
|
const params = cleanParams(_params, data);
|
|
22077
|
-
const _fatal = (_b3 = (
|
|
22601
|
+
const _fatal = (_b3 = (_a4 = params.fatal) !== null && _a4 !== void 0 ? _a4 : fatal) !== null && _b3 !== void 0 ? _b3 : true;
|
|
22078
22602
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
22079
22603
|
}
|
|
22080
22604
|
});
|
|
22081
22605
|
}
|
|
22082
22606
|
if (!r) {
|
|
22083
22607
|
const params = cleanParams(_params, data);
|
|
22084
|
-
const _fatal = (_b2 = (
|
|
22608
|
+
const _fatal = (_b2 = (_a3 = params.fatal) !== null && _a3 !== void 0 ? _a3 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
|
|
22085
22609
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
22086
22610
|
}
|
|
22087
22611
|
return;
|
|
@@ -22598,8 +23122,8 @@ class HCS11Client {
|
|
|
22598
23122
|
{
|
|
22599
23123
|
network: this.network,
|
|
22600
23124
|
waitForConfirmation,
|
|
22601
|
-
waitMaxAttempts:
|
|
22602
|
-
waitIntervalMs:
|
|
23125
|
+
waitMaxAttempts: 150,
|
|
23126
|
+
waitIntervalMs: 4e3,
|
|
22603
23127
|
logging: {
|
|
22604
23128
|
level: "debug"
|
|
22605
23129
|
},
|
|
@@ -22641,7 +23165,7 @@ class HCS11Client {
|
|
|
22641
23165
|
},
|
|
22642
23166
|
{
|
|
22643
23167
|
waitForConfirmation,
|
|
22644
|
-
waitMaxAttempts:
|
|
23168
|
+
waitMaxAttempts: 150,
|
|
22645
23169
|
waitIntervalMs: 2e3,
|
|
22646
23170
|
logging: {
|
|
22647
23171
|
level: "debug"
|
|
@@ -22729,8 +23253,8 @@ class HCS11Client {
|
|
|
22729
23253
|
waitMaxAttempts: 100,
|
|
22730
23254
|
waitIntervalMs: 2e3,
|
|
22731
23255
|
progressCallback: (data) => {
|
|
22732
|
-
const adjustedPercent = 20 + (data
|
|
22733
|
-
progressReporter
|
|
23256
|
+
const adjustedPercent = 20 + Number(data?.progressPercent || 0) * 0.75;
|
|
23257
|
+
progressReporter?.report({
|
|
22734
23258
|
stage: data.stage,
|
|
22735
23259
|
message: data.message,
|
|
22736
23260
|
progressPercent: adjustedPercent,
|
|
@@ -22833,9 +23357,9 @@ class HCS11Client {
|
|
|
22833
23357
|
});
|
|
22834
23358
|
}
|
|
22835
23359
|
});
|
|
22836
|
-
if (!inscriptionResult
|
|
23360
|
+
if (!inscriptionResult?.success) {
|
|
22837
23361
|
progressReporter.failed("Profile inscription failed", {
|
|
22838
|
-
error: inscriptionResult
|
|
23362
|
+
error: inscriptionResult?.error
|
|
22839
23363
|
});
|
|
22840
23364
|
return inscriptionResult;
|
|
22841
23365
|
}
|
|
@@ -22847,12 +23371,12 @@ class HCS11Client {
|
|
|
22847
23371
|
);
|
|
22848
23372
|
if (!memoResult.success) {
|
|
22849
23373
|
progressReporter.failed("Failed to update account memo", {
|
|
22850
|
-
error: memoResult
|
|
23374
|
+
error: memoResult?.error
|
|
22851
23375
|
});
|
|
22852
23376
|
return {
|
|
22853
23377
|
...inscriptionResult,
|
|
22854
23378
|
success: false,
|
|
22855
|
-
error: memoResult
|
|
23379
|
+
error: memoResult?.error
|
|
22856
23380
|
};
|
|
22857
23381
|
}
|
|
22858
23382
|
}
|
|
@@ -23021,6 +23545,7 @@ class HCS11Client {
|
|
|
23021
23545
|
}
|
|
23022
23546
|
}
|
|
23023
23547
|
}
|
|
23548
|
+
const sleep = (ms2) => new Promise((resolve) => setTimeout(resolve, ms2));
|
|
23024
23549
|
class Registration {
|
|
23025
23550
|
/**
|
|
23026
23551
|
* Checks the status of a registration request.
|
|
@@ -23126,22 +23651,22 @@ class Registration {
|
|
|
23126
23651
|
auth: { operatorId: "0.0.0" }
|
|
23127
23652
|
});
|
|
23128
23653
|
logger?.info(
|
|
23129
|
-
|
|
23130
|
-
`${accountId}-${network}`
|
|
23654
|
+
`Fetching profile by account ID ${accountId} on ${network}`
|
|
23131
23655
|
);
|
|
23656
|
+
await sleep(5e3);
|
|
23132
23657
|
const profileResult = await hcs11Client.fetchProfileByAccountId(
|
|
23133
23658
|
accountId,
|
|
23134
23659
|
network
|
|
23135
23660
|
);
|
|
23136
23661
|
logger?.info("Profile fetched", profileResult);
|
|
23137
|
-
if (profileResult
|
|
23662
|
+
if (profileResult?.error) {
|
|
23138
23663
|
logger?.error("Error fetching profile", profileResult.error);
|
|
23139
23664
|
return {
|
|
23140
23665
|
error: profileResult.error,
|
|
23141
23666
|
success: false
|
|
23142
23667
|
};
|
|
23143
23668
|
}
|
|
23144
|
-
if (!profileResult
|
|
23669
|
+
if (!profileResult?.success || !profileResult?.profile) {
|
|
23145
23670
|
if (logger) {
|
|
23146
23671
|
logger.error("Profile not found for agent registration");
|
|
23147
23672
|
}
|
|
@@ -23291,7 +23816,8 @@ class HCS10BaseClient extends Registration {
|
|
|
23291
23816
|
this.network = config.network;
|
|
23292
23817
|
this.logger = Logger$1.getInstance({
|
|
23293
23818
|
level: config.logLevel || "info",
|
|
23294
|
-
module: "HCS10-BaseClient"
|
|
23819
|
+
module: "HCS10-BaseClient",
|
|
23820
|
+
prettyPrint: config.prettyPrint
|
|
23295
23821
|
});
|
|
23296
23822
|
this.mirrorNode = new HederaMirrorNode(
|
|
23297
23823
|
config.network,
|
|
@@ -23371,10 +23897,10 @@ class HCS10BaseClient extends Registration {
|
|
|
23371
23897
|
}
|
|
23372
23898
|
const profile = profileResult.profile;
|
|
23373
23899
|
let topicInfo = null;
|
|
23374
|
-
if (profileResult.topicInfo?.
|
|
23900
|
+
if (profileResult.topicInfo?.inboundTopic && profileResult.topicInfo?.outboundTopic && profileResult.topicInfo?.profileTopicId) {
|
|
23375
23901
|
topicInfo = {
|
|
23376
|
-
inboundTopic: profileResult.topicInfo.
|
|
23377
|
-
outboundTopic: profileResult.topicInfo.
|
|
23902
|
+
inboundTopic: profileResult.topicInfo.inboundTopic,
|
|
23903
|
+
outboundTopic: profileResult.topicInfo.outboundTopic,
|
|
23378
23904
|
profileTopicId: profileResult.topicInfo.profileTopicId
|
|
23379
23905
|
};
|
|
23380
23906
|
const cacheKey = `${accountId}-${this.network}`;
|
|
@@ -23645,7 +24171,8 @@ class HCS10Client extends HCS10BaseClient {
|
|
|
23645
24171
|
constructor(config) {
|
|
23646
24172
|
super({
|
|
23647
24173
|
network: config.network,
|
|
23648
|
-
logLevel: config.logLevel
|
|
24174
|
+
logLevel: config.logLevel,
|
|
24175
|
+
prettyPrint: config.prettyPrint
|
|
23649
24176
|
});
|
|
23650
24177
|
this.client = config.network === "mainnet" ? Client.forMainnet() : Client.forTestnet();
|
|
23651
24178
|
this.operatorPrivateKey = PrivateKey.fromString(config.operatorPrivateKey);
|
|
@@ -23791,7 +24318,7 @@ class HCS10Client extends HCS10BaseClient {
|
|
|
23791
24318
|
`Failed to inscribe profile picture: ${imageResult.error}`
|
|
23792
24319
|
);
|
|
23793
24320
|
throw new Error(
|
|
23794
|
-
imageResult
|
|
24321
|
+
imageResult?.error || "Failed to inscribe profile picture"
|
|
23795
24322
|
);
|
|
23796
24323
|
}
|
|
23797
24324
|
this.logger.info(
|
|
@@ -24792,14 +25319,16 @@ class BrowserHCSClient extends HCS10BaseClient {
|
|
|
24792
25319
|
constructor(config) {
|
|
24793
25320
|
super({
|
|
24794
25321
|
network: config.network,
|
|
24795
|
-
logLevel: config.logLevel
|
|
25322
|
+
logLevel: config.logLevel,
|
|
25323
|
+
prettyPrint: config.prettyPrint
|
|
24796
25324
|
});
|
|
24797
25325
|
this.hcs11Client = null;
|
|
24798
25326
|
this.hwc = config.hwc;
|
|
24799
25327
|
this.guardedRegistryBaseUrl = config.guardedRegistryBaseUrl || "https://moonscape.tech";
|
|
24800
25328
|
this.logger = Logger$1.getInstance({
|
|
24801
25329
|
level: config.logLevel || "info",
|
|
24802
|
-
module: "HCS-Browser"
|
|
25330
|
+
module: "HCS-Browser",
|
|
25331
|
+
prettyPrint: config.prettyPrint
|
|
24803
25332
|
});
|
|
24804
25333
|
if (isBrowser) {
|
|
24805
25334
|
try {
|
|
@@ -25862,6 +26391,6 @@ export {
|
|
|
25862
26391
|
inscribe,
|
|
25863
26392
|
inscribeWithSigner,
|
|
25864
26393
|
retrieveInscription,
|
|
25865
|
-
sleep
|
|
26394
|
+
sleep$1 as sleep
|
|
25866
26395
|
};
|
|
25867
26396
|
//# sourceMappingURL=standards-sdk.es.js.map
|