@hashgraphonline/standards-sdk 0.0.80 → 0.0.81

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 (184) hide show
  1. package/dist/es/standards-sdk.es100.js +15 -2
  2. package/dist/es/standards-sdk.es100.js.map +1 -1
  3. package/dist/es/standards-sdk.es101.js +3 -15
  4. package/dist/es/standards-sdk.es101.js.map +1 -1
  5. package/dist/es/standards-sdk.es102.js +3 -408
  6. package/dist/es/standards-sdk.es102.js.map +1 -1
  7. package/dist/es/standards-sdk.es103.js +14 -172
  8. package/dist/es/standards-sdk.es103.js.map +1 -1
  9. package/dist/es/standards-sdk.es104.js +4 -142
  10. package/dist/es/standards-sdk.es104.js.map +1 -1
  11. package/dist/es/standards-sdk.es105.js +39 -3
  12. package/dist/es/standards-sdk.es105.js.map +1 -1
  13. package/dist/es/standards-sdk.es106.js +40 -2
  14. package/dist/es/standards-sdk.es106.js.map +1 -1
  15. package/dist/es/standards-sdk.es107.js +37 -2
  16. package/dist/es/standards-sdk.es107.js.map +1 -1
  17. package/dist/es/standards-sdk.es108.js +75 -31
  18. package/dist/es/standards-sdk.es108.js.map +1 -1
  19. package/dist/es/standards-sdk.es109.js +3 -32
  20. package/dist/es/standards-sdk.es109.js.map +1 -1
  21. package/dist/es/standards-sdk.es110.js +3 -9
  22. package/dist/es/standards-sdk.es110.js.map +1 -1
  23. package/dist/es/standards-sdk.es111.js +2 -34
  24. package/dist/es/standards-sdk.es111.js.map +1 -1
  25. package/dist/es/standards-sdk.es112.js +2 -2282
  26. package/dist/es/standards-sdk.es112.js.map +1 -1
  27. package/dist/es/standards-sdk.es113.js +33 -20
  28. package/dist/es/standards-sdk.es113.js.map +1 -1
  29. package/dist/es/standards-sdk.es114.js +32 -26
  30. package/dist/es/standards-sdk.es114.js.map +1 -1
  31. package/dist/es/standards-sdk.es115.js +9 -26
  32. package/dist/es/standards-sdk.es115.js.map +1 -1
  33. package/dist/es/standards-sdk.es116.js +33 -37
  34. package/dist/es/standards-sdk.es116.js.map +1 -1
  35. package/dist/es/standards-sdk.es21.js +10 -10
  36. package/dist/es/standards-sdk.es24.js +17 -17
  37. package/dist/es/standards-sdk.es25.js +1 -1
  38. package/dist/es/standards-sdk.es26.js +1 -1
  39. package/dist/es/standards-sdk.es29.js +2 -2
  40. package/dist/es/standards-sdk.es30.js +2 -419
  41. package/dist/es/standards-sdk.es30.js.map +1 -1
  42. package/dist/es/standards-sdk.es31.js +6 -2
  43. package/dist/es/standards-sdk.es31.js.map +1 -1
  44. package/dist/es/standards-sdk.es32.js +22 -119
  45. package/dist/es/standards-sdk.es32.js.map +1 -1
  46. package/dist/es/standards-sdk.es33.js +125 -346
  47. package/dist/es/standards-sdk.es33.js.map +1 -1
  48. package/dist/es/standards-sdk.es34.js +193 -4
  49. package/dist/es/standards-sdk.es34.js.map +1 -1
  50. package/dist/es/standards-sdk.es35.js +417 -158
  51. package/dist/es/standards-sdk.es35.js.map +1 -1
  52. package/dist/es/standards-sdk.es36.js +19 -75
  53. package/dist/es/standards-sdk.es36.js.map +1 -1
  54. package/dist/es/standards-sdk.es37.js +128 -103
  55. package/dist/es/standards-sdk.es37.js.map +1 -1
  56. package/dist/es/standards-sdk.es38.js +14 -48
  57. package/dist/es/standards-sdk.es38.js.map +1 -1
  58. package/dist/es/standards-sdk.es39.js +28 -9
  59. package/dist/es/standards-sdk.es39.js.map +1 -1
  60. package/dist/es/standards-sdk.es40.js +23 -91
  61. package/dist/es/standards-sdk.es40.js.map +1 -1
  62. package/dist/es/standards-sdk.es41.js +20 -3
  63. package/dist/es/standards-sdk.es41.js.map +1 -1
  64. package/dist/es/standards-sdk.es42.js +44 -2
  65. package/dist/es/standards-sdk.es42.js.map +1 -1
  66. package/dist/es/standards-sdk.es43.js +13 -108
  67. package/dist/es/standards-sdk.es43.js.map +1 -1
  68. package/dist/es/standards-sdk.es44.js +58 -71
  69. package/dist/es/standards-sdk.es44.js.map +1 -1
  70. package/dist/es/standards-sdk.es45.js +1287 -4
  71. package/dist/es/standards-sdk.es45.js.map +1 -1
  72. package/dist/es/standards-sdk.es46.js +147 -4
  73. package/dist/es/standards-sdk.es46.js.map +1 -1
  74. package/dist/es/standards-sdk.es47.js +78 -208
  75. package/dist/es/standards-sdk.es47.js.map +1 -1
  76. package/dist/es/standards-sdk.es48.js +81 -55
  77. package/dist/es/standards-sdk.es48.js.map +1 -1
  78. package/dist/es/standards-sdk.es49.js +32 -69
  79. package/dist/es/standards-sdk.es49.js.map +1 -1
  80. package/dist/es/standards-sdk.es50.js +158 -3
  81. package/dist/es/standards-sdk.es50.js.map +1 -1
  82. package/dist/es/standards-sdk.es51.js +793 -3
  83. package/dist/es/standards-sdk.es51.js.map +1 -1
  84. package/dist/es/standards-sdk.es52.js +156 -146
  85. package/dist/es/standards-sdk.es52.js.map +1 -1
  86. package/dist/es/standards-sdk.es53.js +99 -30
  87. package/dist/es/standards-sdk.es53.js.map +1 -1
  88. package/dist/es/standards-sdk.es54.js +2 -63
  89. package/dist/es/standards-sdk.es54.js.map +1 -1
  90. package/dist/es/standards-sdk.es55.js +15 -49
  91. package/dist/es/standards-sdk.es55.js.map +1 -1
  92. package/dist/es/standards-sdk.es56.js +407 -8
  93. package/dist/es/standards-sdk.es56.js.map +1 -1
  94. package/dist/es/standards-sdk.es57.js +352 -53
  95. package/dist/es/standards-sdk.es57.js.map +1 -1
  96. package/dist/es/standards-sdk.es58.js +6 -6
  97. package/dist/es/standards-sdk.es58.js.map +1 -1
  98. package/dist/es/standards-sdk.es59.js +176 -12
  99. package/dist/es/standards-sdk.es59.js.map +1 -1
  100. package/dist/es/standards-sdk.es60.js +81 -7
  101. package/dist/es/standards-sdk.es60.js.map +1 -1
  102. package/dist/es/standards-sdk.es61.js +111 -42
  103. package/dist/es/standards-sdk.es61.js.map +1 -1
  104. package/dist/es/standards-sdk.es62.js +52 -2
  105. package/dist/es/standards-sdk.es62.js.map +1 -1
  106. package/dist/es/standards-sdk.es63.js +10 -136
  107. package/dist/es/standards-sdk.es63.js.map +1 -1
  108. package/dist/es/standards-sdk.es64.js +87 -162
  109. package/dist/es/standards-sdk.es64.js.map +1 -1
  110. package/dist/es/standards-sdk.es65.js +4 -2
  111. package/dist/es/standards-sdk.es65.js.map +1 -1
  112. package/dist/es/standards-sdk.es66.js +2 -13
  113. package/dist/es/standards-sdk.es66.js.map +1 -1
  114. package/dist/es/standards-sdk.es67.js +113 -13
  115. package/dist/es/standards-sdk.es67.js.map +1 -1
  116. package/dist/es/standards-sdk.es68.js +69 -7131
  117. package/dist/es/standards-sdk.es68.js.map +1 -1
  118. package/dist/es/standards-sdk.es69.js +4 -30
  119. package/dist/es/standards-sdk.es69.js.map +1 -1
  120. package/dist/es/standards-sdk.es70.js +4 -14
  121. package/dist/es/standards-sdk.es70.js.map +1 -1
  122. package/dist/es/standards-sdk.es71.js +220 -3
  123. package/dist/es/standards-sdk.es71.js.map +1 -1
  124. package/dist/es/standards-sdk.es72.js +58 -4
  125. package/dist/es/standards-sdk.es72.js.map +1 -1
  126. package/dist/es/standards-sdk.es73.js +69 -16
  127. package/dist/es/standards-sdk.es73.js.map +1 -1
  128. package/dist/es/standards-sdk.es74.js +20 -4
  129. package/dist/es/standards-sdk.es74.js.map +1 -1
  130. package/dist/es/standards-sdk.es75.js +27 -39
  131. package/dist/es/standards-sdk.es75.js.map +1 -1
  132. package/dist/es/standards-sdk.es76.js +25 -39
  133. package/dist/es/standards-sdk.es76.js.map +1 -1
  134. package/dist/es/standards-sdk.es77.js +37 -36
  135. package/dist/es/standards-sdk.es77.js.map +1 -1
  136. package/dist/es/standards-sdk.es78.js +408 -67
  137. package/dist/es/standards-sdk.es78.js.map +1 -1
  138. package/dist/es/standards-sdk.es79.js +2 -195
  139. package/dist/es/standards-sdk.es79.js.map +1 -1
  140. package/dist/es/standards-sdk.es8.js +3 -3
  141. package/dist/es/standards-sdk.es8.js.map +1 -1
  142. package/dist/es/standards-sdk.es80.js +111 -429
  143. package/dist/es/standards-sdk.es80.js.map +1 -1
  144. package/dist/es/standards-sdk.es81.js +2282 -25
  145. package/dist/es/standards-sdk.es81.js.map +1 -1
  146. package/dist/es/standards-sdk.es82.js +150 -125
  147. package/dist/es/standards-sdk.es82.js.map +1 -1
  148. package/dist/es/standards-sdk.es83.js +3 -18
  149. package/dist/es/standards-sdk.es83.js.map +1 -1
  150. package/dist/es/standards-sdk.es84.js +27 -24
  151. package/dist/es/standards-sdk.es84.js.map +1 -1
  152. package/dist/es/standards-sdk.es85.js +57 -23
  153. package/dist/es/standards-sdk.es85.js.map +1 -1
  154. package/dist/es/standards-sdk.es86.js +46 -17
  155. package/dist/es/standards-sdk.es86.js.map +1 -1
  156. package/dist/es/standards-sdk.es87.js +9 -43
  157. package/dist/es/standards-sdk.es87.js.map +1 -1
  158. package/dist/es/standards-sdk.es88.js +61 -14
  159. package/dist/es/standards-sdk.es88.js.map +1 -1
  160. package/dist/es/standards-sdk.es89.js +6 -61
  161. package/dist/es/standards-sdk.es89.js.map +1 -1
  162. package/dist/es/standards-sdk.es90.js +12 -1286
  163. package/dist/es/standards-sdk.es90.js.map +1 -1
  164. package/dist/es/standards-sdk.es91.js +7 -148
  165. package/dist/es/standards-sdk.es91.js.map +1 -1
  166. package/dist/es/standards-sdk.es92.js +42 -88
  167. package/dist/es/standards-sdk.es92.js.map +1 -1
  168. package/dist/es/standards-sdk.es93.js +2 -84
  169. package/dist/es/standards-sdk.es93.js.map +1 -1
  170. package/dist/es/standards-sdk.es94.js +132 -28
  171. package/dist/es/standards-sdk.es94.js.map +1 -1
  172. package/dist/es/standards-sdk.es95.js +172 -6
  173. package/dist/es/standards-sdk.es95.js.map +1 -1
  174. package/dist/es/standards-sdk.es96.js +7117 -140
  175. package/dist/es/standards-sdk.es96.js.map +1 -1
  176. package/dist/es/standards-sdk.es97.js +12 -22
  177. package/dist/es/standards-sdk.es97.js.map +1 -1
  178. package/dist/es/standards-sdk.es98.js +13 -793
  179. package/dist/es/standards-sdk.es98.js.map +1 -1
  180. package/dist/es/standards-sdk.es99.js +31 -100
  181. package/dist/es/standards-sdk.es99.js.map +1 -1
  182. package/dist/umd/standards-sdk.umd.js +1 -1
  183. package/dist/umd/standards-sdk.umd.js.map +1 -1
  184. package/package.json +1 -1
@@ -1,182 +1,441 @@
1
- import utils from "./standards-sdk.es33.js";
2
- import buildURL from "./standards-sdk.es53.js";
3
- import InterceptorManager from "./standards-sdk.es54.js";
4
- import dispatchRequest from "./standards-sdk.es55.js";
5
- import mergeConfig from "./standards-sdk.es36.js";
6
- import buildFullPath from "./standards-sdk.es56.js";
7
- import validator from "./standards-sdk.es57.js";
8
- import AxiosHeaders from "./standards-sdk.es47.js";
9
- const validators = validator.validators;
10
- class Axios {
11
- constructor(instanceConfig) {
12
- this.defaults = instanceConfig;
13
- this.interceptors = {
14
- request: new InterceptorManager(),
15
- response: new InterceptorManager()
16
- };
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.es50.js";
14
+ import { assert, assertArgument } from "./standards-sdk.es46.js";
15
+ import { concat, getBytesCopy, hexlify } from "./standards-sdk.es47.js";
16
+ import { defineProperties } from "./standards-sdk.es49.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;
40
+ });
17
41
  }
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
+ }, {});
52
+ }
53
+ const _Result = class _Result extends Array {
18
54
  /**
19
- * Dispatch a request
20
- *
21
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
22
- * @param {?Object} config
23
- *
24
- * @returns {Promise} The Promise to be fulfilled
55
+ * @private
25
56
  */
26
- async request(configOrUrl, config) {
27
- try {
28
- return await this._request(configOrUrl, config);
29
- } catch (err) {
30
- if (err instanceof Error) {
31
- let dummy = {};
32
- Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
33
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
34
- try {
35
- if (!err.stack) {
36
- err.stack = stack;
37
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
38
- err.stack += "\n" + stack;
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]);
39
120
  }
40
- } catch (e) {
41
121
  }
122
+ return Reflect.get(target, prop, receiver);
42
123
  }
43
- throw err;
44
- }
124
+ });
125
+ setNames(proxy, getNames(this));
126
+ return proxy;
45
127
  }
46
- _request(configOrUrl, config) {
47
- if (typeof configOrUrl === "string") {
48
- config = config || {};
49
- config.url = configOrUrl;
50
- } else {
51
- config = configOrUrl || {};
52
- }
53
- config = mergeConfig(this.defaults, config);
54
- const { transitional, paramsSerializer, headers } = config;
55
- if (transitional !== void 0) {
56
- validator.assertOptions(transitional, {
57
- silentJSONParsing: validators.transitional(validators.boolean),
58
- forcedJSONParsing: validators.transitional(validators.boolean),
59
- clarifyTimeoutError: validators.transitional(validators.boolean)
60
- }, false);
61
- }
62
- if (paramsSerializer != null) {
63
- if (utils.isFunction(paramsSerializer)) {
64
- config.paramsSerializer = {
65
- serialize: paramsSerializer
66
- };
67
- } else {
68
- validator.assertOptions(paramsSerializer, {
69
- encode: validators.function,
70
- serialize: validators.function
71
- }, true);
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);
72
140
  }
141
+ if (deep && item instanceof _Result) {
142
+ item = item.toArray(deep);
143
+ }
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()"
161
+ });
162
+ return toObject(names, this, deep);
163
+ }, {});
164
+ }
165
+ /**
166
+ * @_ignore
167
+ */
168
+ slice(start, end) {
169
+ if (start == null) {
170
+ start = 0;
73
171
  }
74
- if (config.allowAbsoluteUrls !== void 0) ;
75
- else if (this.defaults.allowAbsoluteUrls !== void 0) {
76
- config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
77
- } else {
78
- config.allowAbsoluteUrls = true;
79
- }
80
- validator.assertOptions(config, {
81
- baseUrl: validators.spelling("baseURL"),
82
- withXsrfToken: validators.spelling("withXSRFToken")
83
- }, true);
84
- config.method = (config.method || this.defaults.method || "get").toLowerCase();
85
- let contextHeaders = headers && utils.merge(
86
- headers.common,
87
- headers[config.method]
88
- );
89
- headers && utils.forEach(
90
- ["delete", "get", "head", "post", "put", "patch", "common"],
91
- (method) => {
92
- delete headers[method];
172
+ if (start < 0) {
173
+ start += this.length;
174
+ if (start < 0) {
175
+ start = 0;
93
176
  }
94
- );
95
- config.headers = AxiosHeaders.concat(contextHeaders, headers);
96
- const requestInterceptorChain = [];
97
- let synchronousRequestInterceptors = true;
98
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
99
- if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
100
- return;
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;
101
185
  }
102
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
103
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
104
- });
105
- const responseInterceptorChain = [];
106
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
107
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
108
- });
109
- let promise;
110
- let i = 0;
111
- let len;
112
- if (!synchronousRequestInterceptors) {
113
- const chain = [dispatchRequest.bind(this), void 0];
114
- chain.unshift.apply(chain, requestInterceptorChain);
115
- chain.push.apply(chain, responseInterceptorChain);
116
- len = chain.length;
117
- promise = Promise.resolve(config);
118
- while (i < len) {
119
- promise = promise.then(chain[i++], chain[i++]);
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);
120
208
  }
121
- return promise;
122
- }
123
- len = requestInterceptorChain.length;
124
- let newConfig = config;
125
- i = 0;
126
- while (i < len) {
127
- const onFulfilled = requestInterceptorChain[i++];
128
- const onRejected = requestInterceptorChain[i++];
129
- try {
130
- newConfig = onFulfilled(newConfig);
131
- } catch (error) {
132
- onRejected.call(this, error);
133
- break;
209
+ if (callback.call(thisArg, item, i, this)) {
210
+ result.push(item);
211
+ names.push(_names2[i]);
134
212
  }
135
213
  }
136
- try {
137
- promise = dispatchRequest.call(this, newConfig);
138
- } catch (error) {
139
- return Promise.reject(error);
214
+ return new _Result(_guard, result, names);
215
+ }
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);
225
+ }
226
+ result.push(callback.call(thisArg, item, i, this));
140
227
  }
141
- i = 0;
142
- len = responseInterceptorChain.length;
143
- while (i < len) {
144
- promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
228
+ return result;
229
+ }
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;
145
242
  }
146
- return promise;
243
+ const value = this[index];
244
+ if (value instanceof Error) {
245
+ throwError(`property ${JSON.stringify(name)}`, value.error);
246
+ }
247
+ return value;
248
+ }
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);
147
255
  }
148
- getUri(config) {
149
- config = mergeConfig(this.defaults, config);
150
- const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
151
- return buildURL(fullPath, config.params, config.paramsSerializer);
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]));
152
264
  }
265
+ return bytes;
153
266
  }
154
- utils.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
155
- Axios.prototype[method] = function(url, config) {
156
- return this.request(mergeConfig(config || {}, {
157
- method,
158
- url,
159
- data: (config || {}).data
160
- }));
161
- };
162
- });
163
- utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
164
- function generateHTTPMethod(isForm) {
165
- return function httpMethod(url, data, config) {
166
- return this.request(mergeConfig(config || {}, {
167
- method,
168
- headers: isForm ? {
169
- "Content-Type": "multipart/form-data"
170
- } : {},
171
- url,
172
- data
173
- }));
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)]));
317
+ }
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);
174
332
  };
175
333
  }
176
- Axios.prototype[method] = generateHTTPMethod();
177
- Axios.prototype[method + "Form"] = generateHTTPMethod(true);
178
- });
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;
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
+ }
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);
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
415
+ }
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
428
+ });
429
+ }
430
+ }
431
+ return __privateGet(this, _data2).slice(__privateGet(this, _offset), __privateGet(this, _offset) + alignedLength);
432
+ };
433
+ let Reader = _Reader;
179
434
  export {
180
- Axios as default
435
+ Coder,
436
+ Reader,
437
+ Result,
438
+ WordSize,
439
+ Writer
181
440
  };
182
441
  //# sourceMappingURL=standards-sdk.es35.js.map