@hashgraphonline/standards-sdk 0.0.73 → 0.0.75

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 (198) hide show
  1. package/dist/es/standards-sdk.es100.js +3 -14
  2. package/dist/es/standards-sdk.es100.js.map +1 -1
  3. package/dist/es/standards-sdk.es101.js +3 -3
  4. package/dist/es/standards-sdk.es101.js.map +1 -1
  5. package/dist/es/standards-sdk.es102.js +13 -4
  6. package/dist/es/standards-sdk.es102.js.map +1 -1
  7. package/dist/es/standards-sdk.es103.js +13 -16
  8. package/dist/es/standards-sdk.es103.js.map +1 -1
  9. package/dist/es/standards-sdk.es104.js +15 -4
  10. package/dist/es/standards-sdk.es104.js.map +1 -1
  11. package/dist/es/standards-sdk.es105.js +5 -39
  12. package/dist/es/standards-sdk.es105.js.map +1 -1
  13. package/dist/es/standards-sdk.es106.js +38 -39
  14. package/dist/es/standards-sdk.es106.js.map +1 -1
  15. package/dist/es/standards-sdk.es107.js +37 -34
  16. package/dist/es/standards-sdk.es107.js.map +1 -1
  17. package/dist/es/standards-sdk.es108.js +34 -75
  18. package/dist/es/standards-sdk.es108.js.map +1 -1
  19. package/dist/es/standards-sdk.es109.js +78 -3
  20. package/dist/es/standards-sdk.es109.js.map +1 -1
  21. package/dist/es/standards-sdk.es110.js +3 -2
  22. package/dist/es/standards-sdk.es110.js.map +1 -1
  23. package/dist/es/standards-sdk.es111.js +2 -2
  24. package/dist/es/standards-sdk.es111.js.map +1 -1
  25. package/dist/es/standards-sdk.es112.js +2 -34
  26. package/dist/es/standards-sdk.es112.js.map +1 -1
  27. package/dist/es/standards-sdk.es113.js +30 -29
  28. package/dist/es/standards-sdk.es113.js.map +1 -1
  29. package/dist/es/standards-sdk.es114.js +33 -9
  30. package/dist/es/standards-sdk.es114.js.map +1 -1
  31. package/dist/es/standards-sdk.es115.js +9 -34
  32. package/dist/es/standards-sdk.es115.js.map +1 -1
  33. package/dist/es/standards-sdk.es116.js +37 -0
  34. package/dist/es/standards-sdk.es116.js.map +1 -0
  35. package/dist/es/standards-sdk.es12.js +3 -3
  36. package/dist/es/standards-sdk.es14.js +1 -1
  37. package/dist/es/standards-sdk.es17.js +2 -2
  38. package/dist/es/standards-sdk.es18.js +3 -3
  39. package/dist/es/standards-sdk.es21.js +966 -1692
  40. package/dist/es/standards-sdk.es21.js.map +1 -1
  41. package/dist/es/standards-sdk.es22.js +5 -36
  42. package/dist/es/standards-sdk.es22.js.map +1 -1
  43. package/dist/es/standards-sdk.es23.js +1766 -47
  44. package/dist/es/standards-sdk.es23.js.map +1 -1
  45. package/dist/es/standards-sdk.es24.js +5667 -5104
  46. package/dist/es/standards-sdk.es24.js.map +1 -1
  47. package/dist/es/standards-sdk.es25.js +36 -3
  48. package/dist/es/standards-sdk.es25.js.map +1 -1
  49. package/dist/es/standards-sdk.es26.js +48 -2
  50. package/dist/es/standards-sdk.es26.js.map +1 -1
  51. package/dist/es/standards-sdk.es27.js +3 -4167
  52. package/dist/es/standards-sdk.es27.js.map +1 -1
  53. package/dist/es/standards-sdk.es28.js +2 -5
  54. package/dist/es/standards-sdk.es28.js.map +1 -1
  55. package/dist/es/standards-sdk.es29.js +4086 -960
  56. package/dist/es/standards-sdk.es29.js.map +1 -1
  57. package/dist/es/standards-sdk.es33.js +2 -4
  58. package/dist/es/standards-sdk.es33.js.map +1 -1
  59. package/dist/es/standards-sdk.es34.js +4 -3
  60. package/dist/es/standards-sdk.es34.js.map +1 -1
  61. package/dist/es/standards-sdk.es35.js +68 -148
  62. package/dist/es/standards-sdk.es35.js.map +1 -1
  63. package/dist/es/standards-sdk.es36.js +23 -2
  64. package/dist/es/standards-sdk.es36.js.map +1 -1
  65. package/dist/es/standards-sdk.es37.js +139 -92
  66. package/dist/es/standards-sdk.es37.js.map +1 -1
  67. package/dist/es/standards-sdk.es38.js +91 -2
  68. package/dist/es/standards-sdk.es38.js.map +1 -1
  69. package/dist/es/standards-sdk.es39.js +7135 -15
  70. package/dist/es/standards-sdk.es39.js.map +1 -1
  71. package/dist/es/standards-sdk.es4.js +1 -1
  72. package/dist/es/standards-sdk.es40.js +190 -404
  73. package/dist/es/standards-sdk.es40.js.map +1 -1
  74. package/dist/es/standards-sdk.es41.js +408 -334
  75. package/dist/es/standards-sdk.es41.js.map +1 -1
  76. package/dist/es/standards-sdk.es42.js +24 -5
  77. package/dist/es/standards-sdk.es42.js.map +1 -1
  78. package/dist/es/standards-sdk.es43.js +125 -165
  79. package/dist/es/standards-sdk.es43.js.map +1 -1
  80. package/dist/es/standards-sdk.es44.js +13 -76
  81. package/dist/es/standards-sdk.es44.js.map +1 -1
  82. package/dist/es/standards-sdk.es45.js +26 -111
  83. package/dist/es/standards-sdk.es45.js.map +1 -1
  84. package/dist/es/standards-sdk.es46.js +24 -47
  85. package/dist/es/standards-sdk.es46.js.map +1 -1
  86. package/dist/es/standards-sdk.es47.js +20 -9
  87. package/dist/es/standards-sdk.es47.js.map +1 -1
  88. package/dist/es/standards-sdk.es48.js +37 -90
  89. package/dist/es/standards-sdk.es48.js.map +1 -1
  90. package/dist/es/standards-sdk.es49.js +17 -3
  91. package/dist/es/standards-sdk.es49.js.map +1 -1
  92. package/dist/es/standards-sdk.es5.js +3 -3
  93. package/dist/es/standards-sdk.es50.js +61 -2
  94. package/dist/es/standards-sdk.es50.js.map +1 -1
  95. package/dist/es/standards-sdk.es51.js +1283 -107
  96. package/dist/es/standards-sdk.es51.js.map +1 -1
  97. package/dist/es/standards-sdk.es52.js +29 -71
  98. package/dist/es/standards-sdk.es52.js.map +1 -1
  99. package/dist/es/standards-sdk.es53.js +5 -5
  100. package/dist/es/standards-sdk.es53.js.map +1 -1
  101. package/dist/es/standards-sdk.es54.js +158 -4
  102. package/dist/es/standards-sdk.es54.js.map +1 -1
  103. package/dist/es/standards-sdk.es55.js +778 -206
  104. package/dist/es/standards-sdk.es55.js.map +1 -1
  105. package/dist/es/standards-sdk.es56.js +171 -55
  106. package/dist/es/standards-sdk.es56.js.map +1 -1
  107. package/dist/es/standards-sdk.es57.js +142 -68
  108. package/dist/es/standards-sdk.es57.js.map +1 -1
  109. package/dist/es/standards-sdk.es58.js +3 -195
  110. package/dist/es/standards-sdk.es58.js.map +1 -1
  111. package/dist/es/standards-sdk.es59.js +13 -430
  112. package/dist/es/standards-sdk.es59.js.map +1 -1
  113. package/dist/es/standards-sdk.es60.js +25 -23
  114. package/dist/es/standards-sdk.es60.js.map +1 -1
  115. package/dist/es/standards-sdk.es61.js +23 -136
  116. package/dist/es/standards-sdk.es61.js.map +1 -1
  117. package/dist/es/standards-sdk.es62.js +36 -16
  118. package/dist/es/standards-sdk.es62.js.map +1 -1
  119. package/dist/es/standards-sdk.es63.js +100 -28
  120. package/dist/es/standards-sdk.es63.js.map +1 -1
  121. package/dist/es/standards-sdk.es64.js +2 -29
  122. package/dist/es/standards-sdk.es64.js.map +1 -1
  123. package/dist/es/standards-sdk.es65.js +15 -20
  124. package/dist/es/standards-sdk.es65.js.map +1 -1
  125. package/dist/es/standards-sdk.es66.js +403 -38
  126. package/dist/es/standards-sdk.es66.js.map +1 -1
  127. package/dist/es/standards-sdk.es67.js +359 -13
  128. package/dist/es/standards-sdk.es67.js.map +1 -1
  129. package/dist/es/standards-sdk.es68.js +5 -60
  130. package/dist/es/standards-sdk.es68.js.map +1 -1
  131. package/dist/es/standards-sdk.es69.js +160 -1270
  132. package/dist/es/standards-sdk.es69.js.map +1 -1
  133. package/dist/es/standards-sdk.es7.js +3 -3
  134. package/dist/es/standards-sdk.es70.js +70 -137
  135. package/dist/es/standards-sdk.es70.js.map +1 -1
  136. package/dist/es/standards-sdk.es71.js +110 -87
  137. package/dist/es/standards-sdk.es71.js.map +1 -1
  138. package/dist/es/standards-sdk.es72.js +46 -78
  139. package/dist/es/standards-sdk.es72.js.map +1 -1
  140. package/dist/es/standards-sdk.es73.js +9 -31
  141. package/dist/es/standards-sdk.es73.js.map +1 -1
  142. package/dist/es/standards-sdk.es74.js +96 -5
  143. package/dist/es/standards-sdk.es74.js.map +1 -1
  144. package/dist/es/standards-sdk.es75.js +3 -158
  145. package/dist/es/standards-sdk.es75.js.map +1 -1
  146. package/dist/es/standards-sdk.es76.js +2 -23
  147. package/dist/es/standards-sdk.es76.js.map +1 -1
  148. package/dist/es/standards-sdk.es77.js +102 -782
  149. package/dist/es/standards-sdk.es77.js.map +1 -1
  150. package/dist/es/standards-sdk.es78.js +70 -170
  151. package/dist/es/standards-sdk.es78.js.map +1 -1
  152. package/dist/es/standards-sdk.es79.js +5 -142
  153. package/dist/es/standards-sdk.es79.js.map +1 -1
  154. package/dist/es/standards-sdk.es8.js +3 -3
  155. package/dist/es/standards-sdk.es80.js +5 -2282
  156. package/dist/es/standards-sdk.es80.js.map +1 -1
  157. package/dist/es/standards-sdk.es81.js +215 -26
  158. package/dist/es/standards-sdk.es81.js.map +1 -1
  159. package/dist/es/standards-sdk.es82.js +55 -60
  160. package/dist/es/standards-sdk.es82.js.map +1 -1
  161. package/dist/es/standards-sdk.es83.js +69 -50
  162. package/dist/es/standards-sdk.es83.js.map +1 -1
  163. package/dist/es/standards-sdk.es84.js +2282 -10
  164. package/dist/es/standards-sdk.es84.js.map +1 -1
  165. package/dist/es/standards-sdk.es85.js +154 -55
  166. package/dist/es/standards-sdk.es85.js.map +1 -1
  167. package/dist/es/standards-sdk.es86.js +32 -6
  168. package/dist/es/standards-sdk.es86.js.map +1 -1
  169. package/dist/es/standards-sdk.es87.js +61 -13
  170. package/dist/es/standards-sdk.es87.js.map +1 -1
  171. package/dist/es/standards-sdk.es88.js +50 -7
  172. package/dist/es/standards-sdk.es88.js.map +1 -1
  173. package/dist/es/standards-sdk.es89.js +10 -45
  174. package/dist/es/standards-sdk.es89.js.map +1 -1
  175. package/dist/es/standards-sdk.es9.js +1 -1
  176. package/dist/es/standards-sdk.es90.js +65 -2
  177. package/dist/es/standards-sdk.es90.js.map +1 -1
  178. package/dist/es/standards-sdk.es91.js +5 -135
  179. package/dist/es/standards-sdk.es91.js.map +1 -1
  180. package/dist/es/standards-sdk.es92.js +13 -170
  181. package/dist/es/standards-sdk.es92.js.map +1 -1
  182. package/dist/es/standards-sdk.es93.js +7 -21
  183. package/dist/es/standards-sdk.es93.js.map +1 -1
  184. package/dist/es/standards-sdk.es94.js +45 -27
  185. package/dist/es/standards-sdk.es94.js.map +1 -1
  186. package/dist/es/standards-sdk.es95.js +2 -26
  187. package/dist/es/standards-sdk.es95.js.map +1 -1
  188. package/dist/es/standards-sdk.es96.js +136 -38
  189. package/dist/es/standards-sdk.es96.js.map +1 -1
  190. package/dist/es/standards-sdk.es97.js +171 -12
  191. package/dist/es/standards-sdk.es97.js.map +1 -1
  192. package/dist/es/standards-sdk.es98.js +32 -13
  193. package/dist/es/standards-sdk.es98.js.map +1 -1
  194. package/dist/es/standards-sdk.es99.js +13 -30
  195. package/dist/es/standards-sdk.es99.js.map +1 -1
  196. package/dist/umd/standards-sdk.umd.js +37 -12
  197. package/dist/umd/standards-sdk.umd.js.map +1 -1
  198. package/package.json +3 -3
@@ -1,367 +1,441 @@
1
- import global from "./standards-sdk.es34.js";
2
- import process$1 from "./standards-sdk.es35.js";
3
- import bind from "./standards-sdk.es42.js";
4
- const { toString } = Object.prototype;
5
- const { getPrototypeOf } = Object;
6
- const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
7
- const str = toString.call(thing);
8
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
9
- })(/* @__PURE__ */ Object.create(null));
10
- const kindOfTest = (type) => {
11
- type = type.toLowerCase();
12
- return (thing) => kindOf(thing) === type;
1
+ var __defProp = Object.defineProperty;
2
+ var __typeError = (msg) => {
3
+ throw TypeError(msg);
13
4
  };
14
- const typeOfTest = (type) => (thing) => typeof thing === type;
15
- const { isArray } = Array;
16
- const isUndefined = typeOfTest("undefined");
17
- function isBuffer(val) {
18
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
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.es54.js";
14
+ import { assert, assertArgument } from "./standards-sdk.es37.js";
15
+ import { concat, getBytesCopy, hexlify } from "./standards-sdk.es38.js";
16
+ import { defineProperties } from "./standards-sdk.es52.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);
19
24
  }
20
- const isArrayBuffer = kindOfTest("ArrayBuffer");
21
- function isArrayBufferView(val) {
22
- let result;
23
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
24
- result = ArrayBuffer.isView(val);
25
- } else {
26
- result = val && val.buffer && isArrayBuffer(val.buffer);
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;
40
+ });
27
41
  }
28
- return result;
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;
49
+ }
50
+ return accum;
51
+ }, {});
29
52
  }
30
- const isString = typeOfTest("string");
31
- const isFunction = typeOfTest("function");
32
- const isNumber = typeOfTest("number");
33
- const isObject = (thing) => thing !== null && typeof thing === "object";
34
- const isBoolean = (thing) => thing === true || thing === false;
35
- const isPlainObject = (val) => {
36
- if (kindOf(val) !== "object") {
37
- return false;
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;
66
+ }
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;
74
+ });
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);
91
+ }
92
+ if (!wrap) {
93
+ return;
94
+ }
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;
38
127
  }
39
- const prototype = getPrototypeOf(val);
40
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
41
- };
42
- const isDate = kindOfTest("Date");
43
- const isFile = kindOfTest("File");
44
- const isBlob = kindOfTest("Blob");
45
- const isFileList = kindOfTest("FileList");
46
- const isStream = (val) => isObject(val) && isFunction(val.pipe);
47
- const isFormData = (thing) => {
48
- let kind;
49
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
50
- kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
51
- };
52
- const isURLSearchParams = kindOfTest("URLSearchParams");
53
- const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
54
- const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
55
- function forEach(obj, fn, { allOwnKeys = false } = {}) {
56
- if (obj === null || typeof obj === "undefined") {
57
- return;
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);
143
+ }
144
+ result.push(item);
145
+ });
146
+ return result;
58
147
  }
59
- let i;
60
- let l;
61
- if (typeof obj !== "object") {
62
- obj = [obj];
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()"
161
+ });
162
+ return toObject(names, this, deep);
163
+ }, {});
63
164
  }
64
- if (isArray(obj)) {
65
- for (i = 0, l = obj.length; i < l; i++) {
66
- fn.call(null, obj[i], i, obj);
165
+ /**
166
+ * @_ignore
167
+ */
168
+ slice(start, end) {
169
+ if (start == null) {
170
+ start = 0;
171
+ }
172
+ if (start < 0) {
173
+ start += this.length;
174
+ if (start < 0) {
175
+ start = 0;
176
+ }
67
177
  }
68
- } else {
69
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
70
- const len = keys.length;
71
- let key;
72
- for (i = 0; i < len; i++) {
73
- key = keys[i];
74
- fn.call(null, obj[key], key, obj);
178
+ if (end == null) {
179
+ end = this.length;
75
180
  }
76
- }
77
- }
78
- function findKey(obj, key) {
79
- key = key.toLowerCase();
80
- const keys = Object.keys(obj);
81
- let i = keys.length;
82
- let _key;
83
- while (i-- > 0) {
84
- _key = keys[i];
85
- if (key === _key.toLowerCase()) {
86
- return _key;
181
+ if (end < 0) {
182
+ end += this.length;
183
+ if (end < 0) {
184
+ end = 0;
185
+ }
87
186
  }
88
- }
89
- return null;
90
- }
91
- const _global = (() => {
92
- if (typeof globalThis !== "undefined") return globalThis;
93
- return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
94
- })();
95
- const isContextDefined = (context) => !isUndefined(context) && context !== _global;
96
- function merge() {
97
- const { caseless } = isContextDefined(this) && this || {};
98
- const result = {};
99
- const assignValue = (val, key) => {
100
- const targetKey = caseless && findKey(result, key) || key;
101
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
102
- result[targetKey] = merge(result[targetKey], val);
103
- } else if (isPlainObject(val)) {
104
- result[targetKey] = merge({}, val);
105
- } else if (isArray(val)) {
106
- result[targetKey] = val.slice();
107
- } else {
108
- result[targetKey] = val;
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]);
109
195
  }
110
- };
111
- for (let i = 0, l = arguments.length; i < l; i++) {
112
- arguments[i] && forEach(arguments[i], assignValue);
196
+ return new _Result(_guard, result, names);
113
197
  }
114
- return result;
115
- }
116
- const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
117
- forEach(b, (val, key) => {
118
- if (thisArg && isFunction(val)) {
119
- a[key] = bind(val, thisArg);
120
- } else {
121
- a[key] = val;
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);
208
+ }
209
+ if (callback.call(thisArg, item, i, this)) {
210
+ result.push(item);
211
+ names.push(_names2[i]);
212
+ }
122
213
  }
123
- }, { allOwnKeys });
124
- return a;
125
- };
126
- const stripBOM = (content) => {
127
- if (content.charCodeAt(0) === 65279) {
128
- content = content.slice(1);
214
+ return new _Result(_guard, result, names);
129
215
  }
130
- return content;
131
- };
132
- const inherits = (constructor, superConstructor, props, descriptors) => {
133
- constructor.prototype = Object.create(superConstructor.prototype, descriptors);
134
- constructor.prototype.constructor = constructor;
135
- Object.defineProperty(constructor, "super", {
136
- value: superConstructor.prototype
137
- });
138
- props && Object.assign(constructor.prototype, props);
139
- };
140
- const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
141
- let props;
142
- let i;
143
- let prop;
144
- const merged = {};
145
- destObj = destObj || {};
146
- if (sourceObj == null) return destObj;
147
- do {
148
- props = Object.getOwnPropertyNames(sourceObj);
149
- i = props.length;
150
- while (i-- > 0) {
151
- prop = props[i];
152
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
153
- destObj[prop] = sourceObj[prop];
154
- merged[prop] = true;
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);
155
225
  }
226
+ result.push(callback.call(thisArg, item, i, this));
156
227
  }
157
- sourceObj = filter !== false && getPrototypeOf(sourceObj);
158
- } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
159
- return destObj;
160
- };
161
- const endsWith = (str, searchString, position) => {
162
- str = String(str);
163
- if (position === void 0 || position > str.length) {
164
- position = str.length;
228
+ return result;
165
229
  }
166
- position -= searchString.length;
167
- const lastIndex = str.indexOf(searchString, position);
168
- return lastIndex !== -1 && lastIndex === position;
169
- };
170
- const toArray = (thing) => {
171
- if (!thing) return null;
172
- if (isArray(thing)) return thing;
173
- let i = thing.length;
174
- if (!isNumber(i)) return null;
175
- const arr = new Array(i);
176
- while (i-- > 0) {
177
- arr[i] = thing[i];
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;
242
+ }
243
+ const value = this[index];
244
+ if (value instanceof Error) {
245
+ throwError(`property ${JSON.stringify(name)}`, value.error);
246
+ }
247
+ return value;
178
248
  }
179
- return arr;
180
- };
181
- const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
182
- return (thing) => {
183
- return TypedArray && thing instanceof TypedArray;
184
- };
185
- })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
186
- const forEachEntry = (obj, fn) => {
187
- const generator = obj && obj[Symbol.iterator];
188
- const iterator = generator.call(obj);
189
- let result;
190
- while ((result = iterator.next()) && !result.done) {
191
- const pair = result.value;
192
- fn.call(obj, pair[0], pair[1]);
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);
193
255
  }
194
256
  };
195
- const matchAll = (regExp, str) => {
196
- let matches;
197
- const arr = [];
198
- while ((matches = regExp.exec(str)) !== null) {
199
- arr.push(matches);
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]));
200
264
  }
201
- return arr;
202
- };
203
- const isHTMLForm = kindOfTest("HTMLFormElement");
204
- const toCamelCase = (str) => {
205
- return str.toLowerCase().replace(
206
- /[-_\s]([a-z\d])(\w*)/g,
207
- function replacer(m, p1, p2) {
208
- return p1.toUpperCase() + p2;
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
+ });
288
+ }
289
+ _throwError(message, value) {
290
+ assertArgument(false, message, this.localName, value);
291
+ }
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)]));
209
317
  }
210
- );
318
+ return __privateMethod(this, _Writer_instances, writeData_fn).call(this, bytes);
319
+ }
320
+ // Numeric item; pad on the left *to* WordSize
321
+ writeValue(value) {
322
+ return __privateMethod(this, _Writer_instances, writeData_fn).call(this, getValue(value));
323
+ }
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);
332
+ };
333
+ }
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;
211
342
  };
212
- const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
213
- const isRegExp = kindOfTest("RegExp");
214
- const reduceDescriptors = (obj, reducer) => {
215
- const descriptors = Object.getOwnPropertyDescriptors(obj);
216
- const reducedDescriptors = {};
217
- forEach(descriptors, (descriptor, name) => {
218
- let ret;
219
- if ((ret = reducer(descriptor, name, obj)) !== false) {
220
- reducedDescriptors[name] = ret || descriptor;
221
- }
222
- });
223
- Object.defineProperties(obj, reducedDescriptors);
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;
368
+ }
369
+ get consumed() {
370
+ return __privateGet(this, _offset);
371
+ }
372
+ get bytes() {
373
+ return new Uint8Array(__privateGet(this, _data2));
374
+ }
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;
380
+ }
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
+ }
388
+ // Read a numeric values
389
+ readValue() {
390
+ return toBigInt(this.readBytes(WordSize));
391
+ }
392
+ readIndex() {
393
+ return toNumber(this.readBytes(WordSize));
394
+ }
224
395
  };
225
- const freezeMethods = (obj) => {
226
- reduceDescriptors(obj, (descriptor, name) => {
227
- if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
228
- return false;
229
- }
230
- const value = obj[name];
231
- if (!isFunction(value)) return;
232
- descriptor.enumerable = false;
233
- if ("writable" in descriptor) {
234
- descriptor.writable = false;
235
- return;
236
- }
237
- if (!descriptor.set) {
238
- descriptor.set = () => {
239
- throw Error("Can not rewrite read-only method '" + name + "'");
240
- };
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);
406
+ }
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
241
415
  }
242
416
  });
243
417
  };
244
- const toObjectSet = (arrayOrString, delimiter) => {
245
- const obj = {};
246
- const define = (arr) => {
247
- arr.forEach((value) => {
248
- obj[value] = true;
249
- });
250
- };
251
- isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
252
- return obj;
253
- };
254
- const noop = () => {
255
- };
256
- const toFiniteNumber = (value, defaultValue) => {
257
- return value != null && Number.isFinite(value = +value) ? value : defaultValue;
258
- };
259
- function isSpecCompliantForm(thing) {
260
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
261
- }
262
- const toJSONObject = (obj) => {
263
- const stack = new Array(10);
264
- const visit = (source, i) => {
265
- if (isObject(source)) {
266
- if (stack.indexOf(source) >= 0) {
267
- return;
268
- }
269
- if (!("toJSON" in source)) {
270
- stack[i] = source;
271
- const target = isArray(source) ? [] : {};
272
- forEach(source, (value, key) => {
273
- const reducedValue = visit(value, i + 1);
274
- !isUndefined(reducedValue) && (target[key] = reducedValue);
275
- });
276
- stack[i] = void 0;
277
- return target;
278
- }
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
428
+ });
279
429
  }
280
- return source;
281
- };
282
- return visit(obj, 0);
283
- };
284
- const isAsyncFn = kindOfTest("AsyncFunction");
285
- const isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
286
- const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
287
- if (setImmediateSupported) {
288
- return setImmediate;
289
430
  }
290
- return postMessageSupported ? ((token, callbacks) => {
291
- _global.addEventListener("message", ({ source, data }) => {
292
- if (source === _global && data === token) {
293
- callbacks.length && callbacks.shift()();
294
- }
295
- }, false);
296
- return (cb) => {
297
- callbacks.push(cb);
298
- _global.postMessage(token, "*");
299
- };
300
- })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
301
- })(
302
- typeof setImmediate === "function",
303
- isFunction(_global.postMessage)
304
- );
305
- const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process$1 !== "undefined" && process$1.nextTick || _setImmediate;
306
- const utils = {
307
- isArray,
308
- isArrayBuffer,
309
- isBuffer,
310
- isFormData,
311
- isArrayBufferView,
312
- isString,
313
- isNumber,
314
- isBoolean,
315
- isObject,
316
- isPlainObject,
317
- isReadableStream,
318
- isRequest,
319
- isResponse,
320
- isHeaders,
321
- isUndefined,
322
- isDate,
323
- isFile,
324
- isBlob,
325
- isRegExp,
326
- isFunction,
327
- isStream,
328
- isURLSearchParams,
329
- isTypedArray,
330
- isFileList,
331
- forEach,
332
- merge,
333
- extend,
334
- trim,
335
- stripBOM,
336
- inherits,
337
- toFlatObject,
338
- kindOf,
339
- kindOfTest,
340
- endsWith,
341
- toArray,
342
- forEachEntry,
343
- matchAll,
344
- isHTMLForm,
345
- hasOwnProperty,
346
- hasOwnProp: hasOwnProperty,
347
- // an alias to avoid ESLint no-prototype-builtins detection
348
- reduceDescriptors,
349
- freezeMethods,
350
- toObjectSet,
351
- toCamelCase,
352
- noop,
353
- toFiniteNumber,
354
- findKey,
355
- global: _global,
356
- isContextDefined,
357
- isSpecCompliantForm,
358
- toJSONObject,
359
- isAsyncFn,
360
- isThenable,
361
- setImmediate: _setImmediate,
362
- asap
431
+ return __privateGet(this, _data2).slice(__privateGet(this, _offset), __privateGet(this, _offset) + alignedLength);
363
432
  };
433
+ let Reader = _Reader;
364
434
  export {
365
- utils as default
435
+ Coder,
436
+ Reader,
437
+ Result,
438
+ WordSize,
439
+ Writer
366
440
  };
367
441
  //# sourceMappingURL=standards-sdk.es41.js.map