@hashgraphonline/standards-sdk 0.0.50 → 0.0.52

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.
Files changed (183) hide show
  1. package/dist/es/hcs-10/base-client.d.ts +56 -1
  2. package/dist/es/hcs-10/base-client.d.ts.map +1 -1
  3. package/dist/es/hcs-10/browser.d.ts +9 -20
  4. package/dist/es/hcs-10/browser.d.ts.map +1 -1
  5. package/dist/es/hcs-10/sdk.d.ts +7 -79
  6. package/dist/es/hcs-10/sdk.d.ts.map +1 -1
  7. package/dist/es/hcs-10/types.d.ts +7 -0
  8. package/dist/es/hcs-10/types.d.ts.map +1 -1
  9. package/dist/es/hcs-11/index.d.ts +1 -1
  10. package/dist/es/hcs-11/index.d.ts.map +1 -1
  11. package/dist/es/inscribe/types.d.ts +1 -1
  12. package/dist/es/inscribe/types.d.ts.map +1 -1
  13. package/dist/es/services/mirror-node.d.ts.map +1 -1
  14. package/dist/es/standards-sdk.es10.js +122 -115
  15. package/dist/es/standards-sdk.es10.js.map +1 -1
  16. package/dist/es/standards-sdk.es101.js +1 -1
  17. package/dist/es/standards-sdk.es102.js +6 -6
  18. package/dist/es/standards-sdk.es103.js +3 -3
  19. package/dist/es/standards-sdk.es110.js +1 -1
  20. package/dist/es/standards-sdk.es111.js +2 -2
  21. package/dist/es/standards-sdk.es12.js.map +1 -1
  22. package/dist/es/standards-sdk.es13.js +1 -1
  23. package/dist/es/standards-sdk.es16.js +7 -7
  24. package/dist/es/standards-sdk.es16.js.map +1 -1
  25. package/dist/es/standards-sdk.es17.js +3 -5
  26. package/dist/es/standards-sdk.es17.js.map +1 -1
  27. package/dist/es/standards-sdk.es18.js.map +1 -1
  28. package/dist/es/standards-sdk.es21.js +10 -10
  29. package/dist/es/standards-sdk.es22.js +36 -6624
  30. package/dist/es/standards-sdk.es22.js.map +1 -1
  31. package/dist/es/standards-sdk.es23.js +48 -36
  32. package/dist/es/standards-sdk.es23.js.map +1 -1
  33. package/dist/es/standards-sdk.es24.js +6597 -21
  34. package/dist/es/standards-sdk.es24.js.map +1 -1
  35. package/dist/es/standards-sdk.es25.js +5 -2
  36. package/dist/es/standards-sdk.es25.js.map +1 -1
  37. package/dist/es/standards-sdk.es26.js +2 -5
  38. package/dist/es/standards-sdk.es26.js.map +1 -1
  39. package/dist/es/standards-sdk.es30.js +1 -1
  40. package/dist/es/standards-sdk.es33.js +419 -2
  41. package/dist/es/standards-sdk.es33.js.map +1 -1
  42. package/dist/es/standards-sdk.es34.js +2 -195
  43. package/dist/es/standards-sdk.es34.js.map +1 -1
  44. package/dist/es/standards-sdk.es35.js +111 -429
  45. package/dist/es/standards-sdk.es35.js.map +1 -1
  46. package/dist/es/standards-sdk.es36.js +2 -25
  47. package/dist/es/standards-sdk.es36.js.map +1 -1
  48. package/dist/es/standards-sdk.es37.js +24 -134
  49. package/dist/es/standards-sdk.es37.js.map +1 -1
  50. package/dist/es/standards-sdk.es38.js +356 -12
  51. package/dist/es/standards-sdk.es38.js.map +1 -1
  52. package/dist/es/standards-sdk.es39.js +5 -28
  53. package/dist/es/standards-sdk.es39.js.map +1 -1
  54. package/dist/es/standards-sdk.es40.js +173 -23
  55. package/dist/es/standards-sdk.es40.js.map +1 -1
  56. package/dist/es/standards-sdk.es41.js +75 -15
  57. package/dist/es/standards-sdk.es41.js.map +1 -1
  58. package/dist/es/standards-sdk.es42.js +109 -39
  59. package/dist/es/standards-sdk.es42.js.map +1 -1
  60. package/dist/es/standards-sdk.es43.js +48 -14
  61. package/dist/es/standards-sdk.es43.js.map +1 -1
  62. package/dist/es/standards-sdk.es44.js +9 -60
  63. package/dist/es/standards-sdk.es44.js.map +1 -1
  64. package/dist/es/standards-sdk.es45.js +73 -1265
  65. package/dist/es/standards-sdk.es45.js.map +1 -1
  66. package/dist/es/standards-sdk.es46.js +3 -147
  67. package/dist/es/standards-sdk.es46.js.map +1 -1
  68. package/dist/es/standards-sdk.es47.js +2 -91
  69. package/dist/es/standards-sdk.es47.js.map +1 -1
  70. package/dist/es/standards-sdk.es48.js +101 -73
  71. package/dist/es/standards-sdk.es48.js.map +1 -1
  72. package/dist/es/standards-sdk.es49.js +71 -29
  73. package/dist/es/standards-sdk.es49.js.map +1 -1
  74. package/dist/es/standards-sdk.es5.js +112 -444
  75. package/dist/es/standards-sdk.es5.js.map +1 -1
  76. package/dist/es/standards-sdk.es50.js +5 -5
  77. package/dist/es/standards-sdk.es50.js.map +1 -1
  78. package/dist/es/standards-sdk.es51.js +4 -158
  79. package/dist/es/standards-sdk.es51.js.map +1 -1
  80. package/dist/es/standards-sdk.es52.js +219 -21
  81. package/dist/es/standards-sdk.es52.js.map +1 -1
  82. package/dist/es/standards-sdk.es53.js +53 -788
  83. package/dist/es/standards-sdk.es53.js.map +1 -1
  84. package/dist/es/standards-sdk.es54.js +68 -142
  85. package/dist/es/standards-sdk.es54.js.map +1 -1
  86. package/dist/es/standards-sdk.es55.js +179 -158
  87. package/dist/es/standards-sdk.es55.js.map +1 -1
  88. package/dist/es/standards-sdk.es56.js +395 -376
  89. package/dist/es/standards-sdk.es56.js.map +1 -1
  90. package/dist/es/standards-sdk.es57.js +25 -2
  91. package/dist/es/standards-sdk.es57.js.map +1 -1
  92. package/dist/es/standards-sdk.es58.js +131 -112
  93. package/dist/es/standards-sdk.es58.js.map +1 -1
  94. package/dist/es/standards-sdk.es59.js +11 -14
  95. package/dist/es/standards-sdk.es59.js.map +1 -1
  96. package/dist/es/standards-sdk.es60.js +26 -24
  97. package/dist/es/standards-sdk.es60.js.map +1 -1
  98. package/dist/es/standards-sdk.es61.js +27 -24
  99. package/dist/es/standards-sdk.es61.js.map +1 -1
  100. package/dist/es/standards-sdk.es62.js +19 -36
  101. package/dist/es/standards-sdk.es62.js.map +1 -1
  102. package/dist/es/standards-sdk.es63.js +42 -27
  103. package/dist/es/standards-sdk.es63.js.map +1 -1
  104. package/dist/es/standards-sdk.es64.js +13 -357
  105. package/dist/es/standards-sdk.es64.js.map +1 -1
  106. package/dist/es/standards-sdk.es65.js +60 -5
  107. package/dist/es/standards-sdk.es65.js.map +1 -1
  108. package/dist/es/standards-sdk.es66.js +1270 -160
  109. package/dist/es/standards-sdk.es66.js.map +1 -1
  110. package/dist/es/standards-sdk.es67.js +137 -70
  111. package/dist/es/standards-sdk.es67.js.map +1 -1
  112. package/dist/es/standards-sdk.es68.js +87 -110
  113. package/dist/es/standards-sdk.es68.js.map +1 -1
  114. package/dist/es/standards-sdk.es69.js +78 -46
  115. package/dist/es/standards-sdk.es69.js.map +1 -1
  116. package/dist/es/standards-sdk.es70.js +31 -9
  117. package/dist/es/standards-sdk.es70.js.map +1 -1
  118. package/dist/es/standards-sdk.es71.js +5 -96
  119. package/dist/es/standards-sdk.es71.js.map +1 -1
  120. package/dist/es/standards-sdk.es72.js +158 -3
  121. package/dist/es/standards-sdk.es72.js.map +1 -1
  122. package/dist/es/standards-sdk.es73.js +23 -2
  123. package/dist/es/standards-sdk.es73.js.map +1 -1
  124. package/dist/es/standards-sdk.es74.js +782 -101
  125. package/dist/es/standards-sdk.es74.js.map +1 -1
  126. package/dist/es/standards-sdk.es75.js +138 -69
  127. package/dist/es/standards-sdk.es75.js.map +1 -1
  128. package/dist/es/standards-sdk.es76.js +173 -5
  129. package/dist/es/standards-sdk.es76.js.map +1 -1
  130. package/dist/es/standards-sdk.es77.js +31 -4
  131. package/dist/es/standards-sdk.es77.js.map +1 -1
  132. package/dist/es/standards-sdk.es78.js +54 -212
  133. package/dist/es/standards-sdk.es78.js.map +1 -1
  134. package/dist/es/standards-sdk.es79.js +47 -55
  135. package/dist/es/standards-sdk.es79.js.map +1 -1
  136. package/dist/es/standards-sdk.es8.js +169 -2
  137. package/dist/es/standards-sdk.es8.js.map +1 -1
  138. package/dist/es/standards-sdk.es80.js +10 -69
  139. package/dist/es/standards-sdk.es80.js.map +1 -1
  140. package/dist/es/standards-sdk.es81.js +60 -27
  141. package/dist/es/standards-sdk.es81.js.map +1 -1
  142. package/dist/es/standards-sdk.es82.js +6 -63
  143. package/dist/es/standards-sdk.es82.js.map +1 -1
  144. package/dist/es/standards-sdk.es83.js +12 -47
  145. package/dist/es/standards-sdk.es83.js.map +1 -1
  146. package/dist/es/standards-sdk.es84.js +7 -10
  147. package/dist/es/standards-sdk.es84.js.map +1 -1
  148. package/dist/es/standards-sdk.es85.js +41 -61
  149. package/dist/es/standards-sdk.es85.js.map +1 -1
  150. package/dist/es/standards-sdk.es86.js +2 -6
  151. package/dist/es/standards-sdk.es86.js.map +1 -1
  152. package/dist/es/standards-sdk.es87.js +134 -13
  153. package/dist/es/standards-sdk.es87.js.map +1 -1
  154. package/dist/es/standards-sdk.es88.js +171 -6
  155. package/dist/es/standards-sdk.es88.js.map +1 -1
  156. package/dist/es/standards-sdk.es89.js +21 -45
  157. package/dist/es/standards-sdk.es89.js.map +1 -1
  158. package/dist/es/standards-sdk.es9.js +1 -1
  159. package/dist/es/standards-sdk.es90.js +27 -2
  160. package/dist/es/standards-sdk.es90.js.map +1 -1
  161. package/dist/es/standards-sdk.es91.js +26 -136
  162. package/dist/es/standards-sdk.es91.js.map +1 -1
  163. package/dist/es/standards-sdk.es92.js +38 -172
  164. package/dist/es/standards-sdk.es92.js.map +1 -1
  165. package/dist/es/standards-sdk.es93.js +1 -1
  166. package/dist/es/standards-sdk.es94.js +3 -3
  167. package/dist/es/standards-sdk.es99.js +1 -1
  168. package/dist/umd/hcs-10/base-client.d.ts +56 -1
  169. package/dist/umd/hcs-10/base-client.d.ts.map +1 -1
  170. package/dist/umd/hcs-10/browser.d.ts +9 -20
  171. package/dist/umd/hcs-10/browser.d.ts.map +1 -1
  172. package/dist/umd/hcs-10/sdk.d.ts +7 -79
  173. package/dist/umd/hcs-10/sdk.d.ts.map +1 -1
  174. package/dist/umd/hcs-10/types.d.ts +7 -0
  175. package/dist/umd/hcs-10/types.d.ts.map +1 -1
  176. package/dist/umd/hcs-11/index.d.ts +1 -1
  177. package/dist/umd/hcs-11/index.d.ts.map +1 -1
  178. package/dist/umd/inscribe/types.d.ts +1 -1
  179. package/dist/umd/inscribe/types.d.ts.map +1 -1
  180. package/dist/umd/services/mirror-node.d.ts.map +1 -1
  181. package/dist/umd/standards-sdk.umd.js +2 -2
  182. package/dist/umd/standards-sdk.umd.js.map +1 -1
  183. package/package.json +1 -1
@@ -1,422 +1,441 @@
1
- import { __module as browser } from "./standards-sdk.es57.js";
2
- import { __require as requireQuickFormatUnescaped } from "./standards-sdk.es58.js";
3
- var hasRequiredBrowser;
4
- function requireBrowser() {
5
- if (hasRequiredBrowser) return browser.exports;
6
- hasRequiredBrowser = 1;
7
- const format = requireQuickFormatUnescaped();
8
- browser.exports = pino;
9
- const _console = pfGlobalThisOrFallback().console || {};
10
- const stdSerializers = {
11
- mapHttpRequest: mock,
12
- mapHttpResponse: mock,
13
- wrapRequestSerializer: passthrough,
14
- wrapResponseSerializer: passthrough,
15
- wrapErrorSerializer: passthrough,
16
- req: mock,
17
- res: mock,
18
- err: asErrValue,
19
- errWithCause: asErrValue
20
- };
21
- function levelToValue(level, logger) {
22
- return level === "silent" ? Infinity : logger.levels.values[level];
23
- }
24
- const baseLogFunctionSymbol = Symbol("pino.logFuncs");
25
- const hierarchySymbol = Symbol("pino.hierarchy");
26
- const logFallbackMap = {
27
- error: "log",
28
- fatal: "error",
29
- warn: "error",
30
- info: "log",
31
- debug: "log",
32
- trace: "log"
33
- };
34
- function appendChildLogger(parentLogger, childLogger) {
35
- const newEntry = {
36
- logger: childLogger,
37
- parent: parentLogger[hierarchySymbol]
38
- };
39
- childLogger[hierarchySymbol] = newEntry;
40
- }
41
- function setupBaseLogFunctions(logger, levels, proto) {
42
- const logFunctions = {};
43
- levels.forEach((level) => {
44
- logFunctions[level] = proto[level] ? proto[level] : _console[level] || _console[logFallbackMap[level] || "log"] || noop;
1
+ var __defProp = Object.defineProperty;
2
+ var __typeError = (msg) => {
3
+ throw TypeError(msg);
4
+ };
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
8
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
9
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
12
+ var _names, _data, _dataLength, _Writer_instances, writeData_fn, _data2, _offset, _bytesRead, _parent, _maxInflation, _Reader_instances, incrementBytesRead_fn, peekBytes_fn;
13
+ import { getNumber, toBigInt, toNumber, toBeArray } from "./standards-sdk.es72.js";
14
+ import { assert, assertArgument } from "./standards-sdk.es67.js";
15
+ import { concat, getBytesCopy, hexlify } from "./standards-sdk.es68.js";
16
+ import { defineProperties } from "./standards-sdk.es70.js";
17
+ const WordSize = 32;
18
+ const Padding = new Uint8Array(WordSize);
19
+ const passProperties = ["then"];
20
+ const _guard = {};
21
+ const resultNames = /* @__PURE__ */ new WeakMap();
22
+ function getNames(result) {
23
+ return resultNames.get(result);
24
+ }
25
+ function setNames(result, names) {
26
+ resultNames.set(result, names);
27
+ }
28
+ function throwError(name, error) {
29
+ const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`);
30
+ wrapped.error = error;
31
+ throw wrapped;
32
+ }
33
+ function toObject(names, items, deep) {
34
+ if (names.indexOf(null) >= 0) {
35
+ return items.map((item, index) => {
36
+ if (item instanceof Result) {
37
+ return toObject(getNames(item), item, deep);
38
+ }
39
+ return item;
45
40
  });
46
- logger[baseLogFunctionSymbol] = logFunctions;
47
- }
48
- function shouldSerialize(serialize, serializers) {
49
- if (Array.isArray(serialize)) {
50
- const hasToFilter = serialize.filter(function(k) {
51
- return k !== "!stdSerializers.err";
52
- });
53
- return hasToFilter;
54
- } else if (serialize === true) {
55
- return Object.keys(serializers);
56
- }
57
- return false;
58
41
  }
59
- function pino(opts) {
60
- opts = opts || {};
61
- opts.browser = opts.browser || {};
62
- const transmit2 = opts.browser.transmit;
63
- if (transmit2 && typeof transmit2.send !== "function") {
64
- throw Error("pino: transmit option must have a send function");
42
+ return names.reduce((accum, name, index) => {
43
+ let item = items.getValue(name);
44
+ if (!(name in accum)) {
45
+ if (deep && item instanceof Result) {
46
+ item = toObject(getNames(item), item, deep);
47
+ }
48
+ accum[name] = item;
65
49
  }
66
- const proto = opts.browser.write || _console;
67
- if (opts.browser.write) opts.browser.asObject = true;
68
- const serializers = opts.serializers || {};
69
- const serialize = shouldSerialize(opts.browser.serialize, serializers);
70
- let stdErrSerialize = opts.browser.serialize;
71
- if (Array.isArray(opts.browser.serialize) && opts.browser.serialize.indexOf("!stdSerializers.err") > -1) stdErrSerialize = false;
72
- const customLevels = Object.keys(opts.customLevels || {});
73
- const levels = ["error", "fatal", "warn", "info", "debug", "trace"].concat(customLevels);
74
- if (typeof proto === "function") {
75
- levels.forEach(function(level2) {
76
- proto[level2] = proto;
77
- });
50
+ return accum;
51
+ }, {});
52
+ }
53
+ const _Result = class _Result extends Array {
54
+ /**
55
+ * @private
56
+ */
57
+ constructor(...args) {
58
+ const guard = args[0];
59
+ let items = args[1];
60
+ let names = (args[2] || []).slice();
61
+ let wrap = true;
62
+ if (guard !== _guard) {
63
+ items = args;
64
+ names = [];
65
+ wrap = false;
78
66
  }
79
- if (opts.enabled === false || opts.browser.disabled) opts.level = "silent";
80
- const level = opts.level || "info";
81
- const logger = Object.create(proto);
82
- if (!logger.log) logger.log = noop;
83
- setupBaseLogFunctions(logger, levels, proto);
84
- appendChildLogger({}, logger);
85
- Object.defineProperty(logger, "levelVal", {
86
- get: getLevelVal
67
+ super(items.length);
68
+ // No longer used; but cannot be removed as it will remove the
69
+ // #private field from the .d.ts which may break backwards
70
+ // compatibility
71
+ __privateAdd(this, _names);
72
+ items.forEach((item, index) => {
73
+ this[index] = item;
87
74
  });
88
- Object.defineProperty(logger, "level", {
89
- get: getLevel,
90
- set: setLevel
91
- });
92
- const setOpts = {
93
- transmit: transmit2,
94
- serialize,
95
- asObject: opts.browser.asObject,
96
- formatters: opts.browser.formatters,
97
- levels,
98
- timestamp: getTimeFunction(opts),
99
- messageKey: opts.messageKey || "msg",
100
- onChild: opts.onChild || noop
101
- };
102
- logger.levels = getLevels(opts);
103
- logger.level = level;
104
- 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 = noop;
105
- logger.serializers = serializers;
106
- logger._serialize = serialize;
107
- logger._stdErrSerialize = stdErrSerialize;
108
- logger.child = function(...args) {
109
- return child.call(this, setOpts, ...args);
110
- };
111
- if (transmit2) logger._logEvent = createLogEventShape();
112
- function getLevelVal() {
113
- return levelToValue(this.level, this);
75
+ const nameCounts = names.reduce((accum, name) => {
76
+ if (typeof name === "string") {
77
+ accum.set(name, (accum.get(name) || 0) + 1);
78
+ }
79
+ return accum;
80
+ }, /* @__PURE__ */ new Map());
81
+ setNames(this, Object.freeze(items.map((item, index) => {
82
+ const name = names[index];
83
+ if (name != null && nameCounts.get(name) === 1) {
84
+ return name;
85
+ }
86
+ return null;
87
+ })));
88
+ __privateSet(this, _names, []);
89
+ if (__privateGet(this, _names) == null) {
90
+ void __privateGet(this, _names);
114
91
  }
115
- function getLevel() {
116
- return this._level;
92
+ if (!wrap) {
93
+ return;
117
94
  }
118
- function setLevel(level2) {
119
- if (level2 !== "silent" && !this.levels.values[level2]) {
120
- throw Error("unknown level " + level2);
95
+ Object.freeze(this);
96
+ const proxy = new Proxy(this, {
97
+ get: (target, prop, receiver) => {
98
+ if (typeof prop === "string") {
99
+ if (prop.match(/^[0-9]+$/)) {
100
+ const index = getNumber(prop, "%index");
101
+ if (index < 0 || index >= this.length) {
102
+ throw new RangeError("out of result range");
103
+ }
104
+ const item = target[index];
105
+ if (item instanceof Error) {
106
+ throwError(`index ${index}`, item);
107
+ }
108
+ return item;
109
+ }
110
+ if (passProperties.indexOf(prop) >= 0) {
111
+ return Reflect.get(target, prop, receiver);
112
+ }
113
+ const value = target[prop];
114
+ if (value instanceof Function) {
115
+ return function(...args2) {
116
+ return value.apply(this === receiver ? target : this, args2);
117
+ };
118
+ } else if (!(prop in target)) {
119
+ return target.getValue.apply(this === receiver ? target : this, [prop]);
120
+ }
121
+ }
122
+ return Reflect.get(target, prop, receiver);
123
+ }
124
+ });
125
+ setNames(proxy, getNames(this));
126
+ return proxy;
127
+ }
128
+ /**
129
+ * Returns the Result as a normal Array. If %%deep%%, any children
130
+ * which are Result objects are also converted to a normal Array.
131
+ *
132
+ * This will throw if there are any outstanding deferred
133
+ * errors.
134
+ */
135
+ toArray(deep) {
136
+ const result = [];
137
+ this.forEach((item, index) => {
138
+ if (item instanceof Error) {
139
+ throwError(`index ${index}`, item);
140
+ }
141
+ if (deep && item instanceof _Result) {
142
+ item = item.toArray(deep);
121
143
  }
122
- this._level = level2;
123
- set(this, setOpts, logger, "error");
124
- set(this, setOpts, logger, "fatal");
125
- set(this, setOpts, logger, "warn");
126
- set(this, setOpts, logger, "info");
127
- set(this, setOpts, logger, "debug");
128
- set(this, setOpts, logger, "trace");
129
- customLevels.forEach((level3) => {
130
- set(this, setOpts, logger, level3);
144
+ result.push(item);
145
+ });
146
+ return result;
147
+ }
148
+ /**
149
+ * Returns the Result as an Object with each name-value pair. If
150
+ * %%deep%%, any children which are Result objects are also
151
+ * converted to an Object.
152
+ *
153
+ * This will throw if any value is unnamed, or if there are
154
+ * any outstanding deferred errors.
155
+ */
156
+ toObject(deep) {
157
+ const names = getNames(this);
158
+ return names.reduce((accum, name, index) => {
159
+ assert(name != null, `value at index ${index} unnamed`, "UNSUPPORTED_OPERATION", {
160
+ operation: "toObject()"
131
161
  });
162
+ return toObject(names, this, deep);
163
+ }, {});
164
+ }
165
+ /**
166
+ * @_ignore
167
+ */
168
+ slice(start, end) {
169
+ if (start == null) {
170
+ start = 0;
132
171
  }
133
- function child(setOpts2, bindings, childOptions) {
134
- if (!bindings) {
135
- throw new Error("missing bindings for child Pino");
172
+ if (start < 0) {
173
+ start += this.length;
174
+ if (start < 0) {
175
+ start = 0;
136
176
  }
137
- childOptions = childOptions || {};
138
- if (serialize && bindings.serializers) {
139
- childOptions.serializers = bindings.serializers;
177
+ }
178
+ if (end == null) {
179
+ end = this.length;
180
+ }
181
+ if (end < 0) {
182
+ end += this.length;
183
+ if (end < 0) {
184
+ end = 0;
140
185
  }
141
- const childOptionsSerializers = childOptions.serializers;
142
- if (serialize && childOptionsSerializers) {
143
- var childSerializers = Object.assign({}, serializers, childOptionsSerializers);
144
- var childSerialize = opts.browser.serialize === true ? Object.keys(childSerializers) : serialize;
145
- delete bindings.serializers;
146
- applySerializers([bindings], childSerialize, childSerializers, this._stdErrSerialize);
186
+ }
187
+ if (end > this.length) {
188
+ end = this.length;
189
+ }
190
+ const _names2 = getNames(this);
191
+ const result = [], names = [];
192
+ for (let i = start; i < end; i++) {
193
+ result.push(this[i]);
194
+ names.push(_names2[i]);
195
+ }
196
+ return new _Result(_guard, result, names);
197
+ }
198
+ /**
199
+ * @_ignore
200
+ */
201
+ filter(callback, thisArg) {
202
+ const _names2 = getNames(this);
203
+ const result = [], names = [];
204
+ for (let i = 0; i < this.length; i++) {
205
+ const item = this[i];
206
+ if (item instanceof Error) {
207
+ throwError(`index ${i}`, item);
147
208
  }
148
- function Child(parent) {
149
- this._childLevel = (parent._childLevel | 0) + 1;
150
- this.bindings = bindings;
151
- if (childSerializers) {
152
- this.serializers = childSerializers;
153
- this._serialize = childSerialize;
154
- }
155
- if (transmit2) {
156
- this._logEvent = createLogEventShape(
157
- [].concat(parent._logEvent.bindings, bindings)
158
- );
159
- }
209
+ if (callback.call(thisArg, item, i, this)) {
210
+ result.push(item);
211
+ names.push(_names2[i]);
160
212
  }
161
- Child.prototype = this;
162
- const newLogger = new Child(this);
163
- appendChildLogger(this, newLogger);
164
- newLogger.child = function(...args) {
165
- return child.call(this, setOpts2, ...args);
166
- };
167
- newLogger.level = childOptions.level || this.level;
168
- setOpts2.onChild(newLogger);
169
- return newLogger;
170
213
  }
171
- return logger;
172
- }
173
- function getLevels(opts) {
174
- const customLevels = opts.customLevels || {};
175
- const values = Object.assign({}, pino.levels.values, customLevels);
176
- const labels = Object.assign({}, pino.levels.labels, invertObject(customLevels));
177
- return {
178
- values,
179
- labels
180
- };
214
+ return new _Result(_guard, result, names);
181
215
  }
182
- function invertObject(obj) {
183
- const inverted = {};
184
- Object.keys(obj).forEach(function(key) {
185
- inverted[obj[key]] = key;
186
- });
187
- return inverted;
188
- }
189
- pino.levels = {
190
- values: {
191
- fatal: 60,
192
- error: 50,
193
- warn: 40,
194
- info: 30,
195
- debug: 20,
196
- trace: 10
197
- },
198
- labels: {
199
- 10: "trace",
200
- 20: "debug",
201
- 30: "info",
202
- 40: "warn",
203
- 50: "error",
204
- 60: "fatal"
205
- }
206
- };
207
- pino.stdSerializers = stdSerializers;
208
- pino.stdTimeFunctions = Object.assign({}, { nullTime, epochTime, unixTime, isoTime });
209
- function getBindingChain(logger) {
210
- const bindings = [];
211
- if (logger.bindings) {
212
- bindings.push(logger.bindings);
213
- }
214
- let hierarchy = logger[hierarchySymbol];
215
- while (hierarchy.parent) {
216
- hierarchy = hierarchy.parent;
217
- if (hierarchy.logger.bindings) {
218
- bindings.push(hierarchy.logger.bindings);
216
+ /**
217
+ * @_ignore
218
+ */
219
+ map(callback, thisArg) {
220
+ const result = [];
221
+ for (let i = 0; i < this.length; i++) {
222
+ const item = this[i];
223
+ if (item instanceof Error) {
224
+ throwError(`index ${i}`, item);
219
225
  }
226
+ result.push(callback.call(thisArg, item, i, this));
220
227
  }
221
- return bindings.reverse();
228
+ return result;
222
229
  }
223
- function set(self2, opts, rootLogger, level) {
224
- Object.defineProperty(self2, level, {
225
- value: levelToValue(self2.level, rootLogger) > levelToValue(level, rootLogger) ? noop : rootLogger[baseLogFunctionSymbol][level],
226
- writable: true,
227
- enumerable: true,
228
- configurable: true
229
- });
230
- if (self2[level] === noop) {
231
- if (!opts.transmit) return;
232
- const transmitLevel = opts.transmit.level || self2.level;
233
- const transmitValue = levelToValue(transmitLevel, rootLogger);
234
- const methodValue = levelToValue(level, rootLogger);
235
- if (methodValue < transmitValue) return;
230
+ /**
231
+ * Returns the value for %%name%%.
232
+ *
233
+ * Since it is possible to have a key whose name conflicts with
234
+ * a method on a [[Result]] or its superclass Array, or any
235
+ * JavaScript keyword, this ensures all named values are still
236
+ * accessible by name.
237
+ */
238
+ getValue(name) {
239
+ const index = getNames(this).indexOf(name);
240
+ if (index === -1) {
241
+ return void 0;
236
242
  }
237
- self2[level] = createWrap(self2, opts, rootLogger, level);
238
- const bindings = getBindingChain(self2);
239
- if (bindings.length === 0) {
240
- return;
243
+ const value = this[index];
244
+ if (value instanceof Error) {
245
+ throwError(`property ${JSON.stringify(name)}`, value.error);
241
246
  }
242
- self2[level] = prependBindingsInArguments(bindings, self2[level]);
247
+ return value;
243
248
  }
244
- function prependBindingsInArguments(bindings, logFunc) {
245
- return function() {
246
- return logFunc.apply(this, [...bindings, ...arguments]);
247
- };
249
+ /**
250
+ * Creates a new [[Result]] for %%items%% with each entry
251
+ * also accessible by its corresponding name in %%keys%%.
252
+ */
253
+ static fromItems(items, keys) {
254
+ return new _Result(_guard, items, keys);
248
255
  }
249
- function createWrap(self2, opts, rootLogger, level) {
250
- return /* @__PURE__ */ function(write) {
251
- return function LOG() {
252
- const ts = opts.timestamp();
253
- const args = new Array(arguments.length);
254
- const proto = Object.getPrototypeOf && Object.getPrototypeOf(this) === _console ? _console : this;
255
- for (var i = 0; i < args.length; i++) args[i] = arguments[i];
256
- var argsIsSerialized = false;
257
- if (opts.serialize) {
258
- applySerializers(args, this._serialize, this.serializers, this._stdErrSerialize);
259
- argsIsSerialized = true;
260
- }
261
- if (opts.asObject || opts.formatters) {
262
- write.call(proto, asObject(this, level, args, ts, opts));
263
- } else write.apply(proto, args);
264
- if (opts.transmit) {
265
- const transmitLevel = opts.transmit.level || self2._level;
266
- const transmitValue = levelToValue(transmitLevel, rootLogger);
267
- const methodValue = levelToValue(level, rootLogger);
268
- if (methodValue < transmitValue) return;
269
- transmit(this, {
270
- ts,
271
- methodLevel: level,
272
- methodValue,
273
- transmitValue: rootLogger.levels.values[opts.transmit.level || self2._level],
274
- send: opts.transmit.send,
275
- val: levelToValue(self2._level, rootLogger)
276
- }, args, argsIsSerialized);
277
- }
278
- };
279
- }(self2[baseLogFunctionSymbol][level]);
256
+ };
257
+ _names = new WeakMap();
258
+ let Result = _Result;
259
+ function getValue(value) {
260
+ let bytes = toBeArray(value);
261
+ assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: bytes, length: WordSize, offset: bytes.length });
262
+ if (bytes.length !== WordSize) {
263
+ bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes]));
280
264
  }
281
- function asObject(logger, level, args, ts, opts) {
282
- const {
283
- level: levelFormatter,
284
- log: logObjectFormatter = (obj) => obj
285
- } = opts.formatters || {};
286
- const argsCloned = args.slice();
287
- let msg = argsCloned[0];
288
- const logObject = {};
289
- if (ts) {
290
- logObject.time = ts;
291
- }
292
- if (levelFormatter) {
293
- const formattedLevel = levelFormatter(level, logger.levels.values[level]);
294
- Object.assign(logObject, formattedLevel);
295
- } else {
296
- logObject.level = logger.levels.values[level];
297
- }
298
- let lvl = (logger._childLevel | 0) + 1;
299
- if (lvl < 1) lvl = 1;
300
- if (msg !== null && typeof msg === "object") {
301
- while (lvl-- && typeof argsCloned[0] === "object") {
302
- Object.assign(logObject, argsCloned.shift());
303
- }
304
- msg = argsCloned.length ? format(argsCloned.shift(), argsCloned) : void 0;
305
- } else if (typeof msg === "string") msg = format(argsCloned.shift(), argsCloned);
306
- if (msg !== void 0) logObject[opts.messageKey] = msg;
307
- const formattedLogObject = logObjectFormatter(logObject);
308
- return formattedLogObject;
265
+ return bytes;
266
+ }
267
+ class Coder {
268
+ constructor(name, type, localName, dynamic) {
269
+ // The coder name:
270
+ // - address, uint256, tuple, array, etc.
271
+ __publicField(this, "name");
272
+ // The fully expanded type, including composite types:
273
+ // - address, uint256, tuple(address,bytes), uint256[3][4][], etc.
274
+ __publicField(this, "type");
275
+ // The localName bound in the signature, in this example it is "baz":
276
+ // - tuple(address foo, uint bar) baz
277
+ __publicField(this, "localName");
278
+ // Whether this type is dynamic:
279
+ // - Dynamic: bytes, string, address[], tuple(boolean[]), etc.
280
+ // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)
281
+ __publicField(this, "dynamic");
282
+ defineProperties(this, { name, type, localName, dynamic }, {
283
+ name: "string",
284
+ type: "string",
285
+ localName: "string",
286
+ dynamic: "boolean"
287
+ });
309
288
  }
310
- function applySerializers(args, serialize, serializers, stdErrSerialize) {
311
- for (const i in args) {
312
- if (stdErrSerialize && args[i] instanceof Error) {
313
- args[i] = pino.stdSerializers.err(args[i]);
314
- } else if (typeof args[i] === "object" && !Array.isArray(args[i]) && serialize) {
315
- for (const k in args[i]) {
316
- if (serialize.indexOf(k) > -1 && k in serializers) {
317
- args[i][k] = serializers[k](args[i][k]);
318
- }
319
- }
320
- }
321
- }
289
+ _throwError(message, value) {
290
+ assertArgument(false, message, this.localName, value);
322
291
  }
323
- function transmit(logger, opts, args, argsIsSerialized = false) {
324
- const send = opts.send;
325
- const ts = opts.ts;
326
- const methodLevel = opts.methodLevel;
327
- const methodValue = opts.methodValue;
328
- const val = opts.val;
329
- const bindings = logger._logEvent.bindings;
330
- if (!argsIsSerialized) {
331
- applySerializers(
332
- args,
333
- logger._serialize || Object.keys(logger.serializers),
334
- logger.serializers,
335
- logger._stdErrSerialize === void 0 ? true : logger._stdErrSerialize
336
- );
292
+ }
293
+ class Writer {
294
+ constructor() {
295
+ __privateAdd(this, _Writer_instances);
296
+ // An array of WordSize lengthed objects to concatenation
297
+ __privateAdd(this, _data);
298
+ __privateAdd(this, _dataLength);
299
+ __privateSet(this, _data, []);
300
+ __privateSet(this, _dataLength, 0);
301
+ }
302
+ get data() {
303
+ return concat(__privateGet(this, _data));
304
+ }
305
+ get length() {
306
+ return __privateGet(this, _dataLength);
307
+ }
308
+ appendWriter(writer) {
309
+ return __privateMethod(this, _Writer_instances, writeData_fn).call(this, getBytesCopy(writer.data));
310
+ }
311
+ // Arrayish item; pad on the right to *nearest* WordSize
312
+ writeBytes(value) {
313
+ let bytes = getBytesCopy(value);
314
+ const paddingOffset = bytes.length % WordSize;
315
+ if (paddingOffset) {
316
+ bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)]));
337
317
  }
338
- logger._logEvent.ts = ts;
339
- logger._logEvent.messages = args.filter(function(arg) {
340
- return bindings.indexOf(arg) === -1;
341
- });
342
- logger._logEvent.level.label = methodLevel;
343
- logger._logEvent.level.value = methodValue;
344
- send(methodLevel, logger._logEvent, val);
345
- logger._logEvent = createLogEventShape(bindings);
318
+ return __privateMethod(this, _Writer_instances, writeData_fn).call(this, bytes);
346
319
  }
347
- function createLogEventShape(bindings) {
348
- return {
349
- ts: 0,
350
- messages: [],
351
- bindings: bindings || [],
352
- level: { label: "", value: 0 }
353
- };
320
+ // Numeric item; pad on the left *to* WordSize
321
+ writeValue(value) {
322
+ return __privateMethod(this, _Writer_instances, writeData_fn).call(this, getValue(value));
354
323
  }
355
- function asErrValue(err) {
356
- const obj = {
357
- type: err.constructor.name,
358
- msg: err.message,
359
- stack: err.stack
324
+ // Inserts a numeric place-holder, returning a callback that can
325
+ // be used to asjust the value later
326
+ writeUpdatableValue() {
327
+ const offset = __privateGet(this, _data).length;
328
+ __privateGet(this, _data).push(Padding);
329
+ __privateSet(this, _dataLength, __privateGet(this, _dataLength) + WordSize);
330
+ return (value) => {
331
+ __privateGet(this, _data)[offset] = getValue(value);
360
332
  };
361
- for (const key in err) {
362
- if (obj[key] === void 0) {
363
- obj[key] = err[key];
364
- }
365
- }
366
- return obj;
367
333
  }
368
- function getTimeFunction(opts) {
369
- if (typeof opts.timestamp === "function") {
370
- return opts.timestamp;
371
- }
372
- if (opts.timestamp === false) {
373
- return nullTime;
374
- }
375
- return epochTime;
334
+ }
335
+ _data = new WeakMap();
336
+ _dataLength = new WeakMap();
337
+ _Writer_instances = new WeakSet();
338
+ writeData_fn = function(data) {
339
+ __privateGet(this, _data).push(data);
340
+ __privateSet(this, _dataLength, __privateGet(this, _dataLength) + data.length);
341
+ return data.length;
342
+ };
343
+ const _Reader = class _Reader {
344
+ constructor(data, allowLoose, maxInflation) {
345
+ __privateAdd(this, _Reader_instances);
346
+ // Allows incomplete unpadded data to be read; otherwise an error
347
+ // is raised if attempting to overrun the buffer. This is required
348
+ // to deal with an old Solidity bug, in which event data for
349
+ // external (not public thoguh) was tightly packed.
350
+ __publicField(this, "allowLoose");
351
+ __privateAdd(this, _data2);
352
+ __privateAdd(this, _offset);
353
+ __privateAdd(this, _bytesRead);
354
+ __privateAdd(this, _parent);
355
+ __privateAdd(this, _maxInflation);
356
+ defineProperties(this, { allowLoose: !!allowLoose });
357
+ __privateSet(this, _data2, getBytesCopy(data));
358
+ __privateSet(this, _bytesRead, 0);
359
+ __privateSet(this, _parent, null);
360
+ __privateSet(this, _maxInflation, maxInflation != null ? maxInflation : 1024);
361
+ __privateSet(this, _offset, 0);
362
+ }
363
+ get data() {
364
+ return hexlify(__privateGet(this, _data2));
365
+ }
366
+ get dataLength() {
367
+ return __privateGet(this, _data2).length;
376
368
  }
377
- function mock() {
378
- return {};
369
+ get consumed() {
370
+ return __privateGet(this, _offset);
379
371
  }
380
- function passthrough(a) {
381
- return a;
372
+ get bytes() {
373
+ return new Uint8Array(__privateGet(this, _data2));
382
374
  }
383
- function noop() {
375
+ // Create a sub-reader with the same underlying data, but offset
376
+ subReader(offset) {
377
+ const reader = new _Reader(__privateGet(this, _data2).slice(__privateGet(this, _offset) + offset), this.allowLoose, __privateGet(this, _maxInflation));
378
+ __privateSet(reader, _parent, this);
379
+ return reader;
384
380
  }
385
- function nullTime() {
386
- return false;
381
+ // Read bytes
382
+ readBytes(length, loose) {
383
+ let bytes = __privateMethod(this, _Reader_instances, peekBytes_fn).call(this, 0, length, !!loose);
384
+ __privateMethod(this, _Reader_instances, incrementBytesRead_fn).call(this, length);
385
+ __privateSet(this, _offset, __privateGet(this, _offset) + bytes.length);
386
+ return bytes.slice(0, length);
387
387
  }
388
- function epochTime() {
389
- return Date.now();
388
+ // Read a numeric values
389
+ readValue() {
390
+ return toBigInt(this.readBytes(WordSize));
390
391
  }
391
- function unixTime() {
392
- return Math.round(Date.now() / 1e3);
392
+ readIndex() {
393
+ return toNumber(this.readBytes(WordSize));
393
394
  }
394
- function isoTime() {
395
- return new Date(Date.now()).toISOString();
395
+ };
396
+ _data2 = new WeakMap();
397
+ _offset = new WeakMap();
398
+ _bytesRead = new WeakMap();
399
+ _parent = new WeakMap();
400
+ _maxInflation = new WeakMap();
401
+ _Reader_instances = new WeakSet();
402
+ incrementBytesRead_fn = function(count) {
403
+ var _a;
404
+ if (__privateGet(this, _parent)) {
405
+ return __privateMethod(_a = __privateGet(this, _parent), _Reader_instances, incrementBytesRead_fn).call(_a, count);
396
406
  }
397
- function pfGlobalThisOrFallback() {
398
- function defd(o) {
399
- return typeof o !== "undefined" && o;
407
+ __privateSet(this, _bytesRead, __privateGet(this, _bytesRead) + count);
408
+ 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", {
409
+ buffer: getBytesCopy(__privateGet(this, _data2)),
410
+ offset: __privateGet(this, _offset),
411
+ length: count,
412
+ info: {
413
+ bytesRead: __privateGet(this, _bytesRead),
414
+ dataLength: this.dataLength
400
415
  }
401
- try {
402
- if (typeof globalThis !== "undefined") return globalThis;
403
- Object.defineProperty(Object.prototype, "globalThis", {
404
- get: function() {
405
- delete Object.prototype.globalThis;
406
- return this.globalThis = this;
407
- },
408
- configurable: true
416
+ });
417
+ };
418
+ peekBytes_fn = function(offset, length, loose) {
419
+ let alignedLength = Math.ceil(length / WordSize) * WordSize;
420
+ if (__privateGet(this, _offset) + alignedLength > __privateGet(this, _data2).length) {
421
+ if (this.allowLoose && loose && __privateGet(this, _offset) + length <= __privateGet(this, _data2).length) {
422
+ alignedLength = length;
423
+ } else {
424
+ assert(false, "data out-of-bounds", "BUFFER_OVERRUN", {
425
+ buffer: getBytesCopy(__privateGet(this, _data2)),
426
+ length: __privateGet(this, _data2).length,
427
+ offset: __privateGet(this, _offset) + alignedLength
409
428
  });
410
- return globalThis;
411
- } catch (e) {
412
- return defd(self) || defd(window) || defd(this) || {};
413
429
  }
414
430
  }
415
- browser.exports.default = pino;
416
- browser.exports.pino = pino;
417
- return browser.exports;
418
- }
431
+ return __privateGet(this, _data2).slice(__privateGet(this, _offset), __privateGet(this, _offset) + alignedLength);
432
+ };
433
+ let Reader = _Reader;
419
434
  export {
420
- requireBrowser as __require
435
+ Coder,
436
+ Reader,
437
+ Result,
438
+ WordSize,
439
+ Writer
421
440
  };
422
441
  //# sourceMappingURL=standards-sdk.es56.js.map