@hashgraphonline/standards-sdk 0.0.97 → 0.0.98

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 (274) hide show
  1. package/dist/es/hcs-10/base-client.d.ts +3 -14
  2. package/dist/es/hcs-10/base-client.d.ts.map +1 -1
  3. package/dist/es/hcs-10/connections-manager.d.ts +0 -51
  4. package/dist/es/hcs-10/connections-manager.d.ts.map +1 -1
  5. package/dist/es/hcs-10/sdk.d.ts +1 -38
  6. package/dist/es/hcs-10/sdk.d.ts.map +1 -1
  7. package/dist/es/hcs-10/types.d.ts +3 -9
  8. package/dist/es/hcs-10/types.d.ts.map +1 -1
  9. package/dist/es/inscribe/inscriber.d.ts +0 -2
  10. package/dist/es/inscribe/inscriber.d.ts.map +1 -1
  11. package/dist/es/services/index.d.ts +0 -1
  12. package/dist/es/services/index.d.ts.map +1 -1
  13. package/dist/es/services/mirror-node.d.ts +1 -17
  14. package/dist/es/services/mirror-node.d.ts.map +1 -1
  15. package/dist/es/services/types.d.ts +0 -24
  16. package/dist/es/services/types.d.ts.map +1 -1
  17. package/dist/es/standards-sdk.es.js +5 -8
  18. package/dist/es/standards-sdk.es.js.map +1 -1
  19. package/dist/es/standards-sdk.es10.js +0 -66
  20. package/dist/es/standards-sdk.es10.js.map +1 -1
  21. package/dist/es/standards-sdk.es100.js +13 -4
  22. package/dist/es/standards-sdk.es100.js.map +1 -1
  23. package/dist/es/standards-sdk.es101.js +13 -4
  24. package/dist/es/standards-sdk.es101.js.map +1 -1
  25. package/dist/es/standards-sdk.es102.js +31 -15
  26. package/dist/es/standards-sdk.es102.js.map +1 -1
  27. package/dist/es/standards-sdk.es103.js +14 -4
  28. package/dist/es/standards-sdk.es103.js.map +1 -1
  29. package/dist/es/standards-sdk.es104.js +4 -39
  30. package/dist/es/standards-sdk.es104.js.map +1 -1
  31. package/dist/es/standards-sdk.es105.js +4 -40
  32. package/dist/es/standards-sdk.es105.js.map +1 -1
  33. package/dist/es/standards-sdk.es106.js +15 -36
  34. package/dist/es/standards-sdk.es106.js.map +1 -1
  35. package/dist/es/standards-sdk.es107.js +5 -78
  36. package/dist/es/standards-sdk.es107.js.map +1 -1
  37. package/dist/es/standards-sdk.es108.js +39 -4
  38. package/dist/es/standards-sdk.es108.js.map +1 -1
  39. package/dist/es/standards-sdk.es109.js +38 -32
  40. package/dist/es/standards-sdk.es109.js.map +1 -1
  41. package/dist/es/standards-sdk.es110.js +35 -31
  42. package/dist/es/standards-sdk.es110.js.map +1 -1
  43. package/dist/es/standards-sdk.es111.js +78 -9
  44. package/dist/es/standards-sdk.es111.js.map +1 -1
  45. package/dist/es/standards-sdk.es112.js +3 -34
  46. package/dist/es/standards-sdk.es112.js.map +1 -1
  47. package/dist/es/standards-sdk.es113.js +2 -3
  48. package/dist/es/standards-sdk.es113.js.map +1 -1
  49. package/dist/es/standards-sdk.es114.js +2 -2
  50. package/dist/es/standards-sdk.es114.js.map +1 -1
  51. package/dist/es/standards-sdk.es115.js +34 -2
  52. package/dist/es/standards-sdk.es115.js.map +1 -1
  53. package/dist/es/standards-sdk.es116.js +29 -97
  54. package/dist/es/standards-sdk.es116.js.map +1 -1
  55. package/dist/es/standards-sdk.es117.js +9 -2
  56. package/dist/es/standards-sdk.es117.js.map +1 -1
  57. package/dist/es/standards-sdk.es118.js +34 -16
  58. package/dist/es/standards-sdk.es118.js.map +1 -1
  59. package/dist/es/standards-sdk.es13.js +5 -5
  60. package/dist/es/standards-sdk.es15.js +1 -1
  61. package/dist/es/standards-sdk.es16.js +1 -1
  62. package/dist/es/standards-sdk.es18.js +2 -2
  63. package/dist/es/standards-sdk.es19.js +386 -393
  64. package/dist/es/standards-sdk.es19.js.map +1 -1
  65. package/dist/es/standards-sdk.es20.js +315 -386
  66. package/dist/es/standards-sdk.es20.js.map +1 -1
  67. package/dist/es/standards-sdk.es21.js +128 -357
  68. package/dist/es/standards-sdk.es21.js.map +1 -1
  69. package/dist/es/standards-sdk.es22.js +7 -155
  70. package/dist/es/standards-sdk.es22.js.map +1 -1
  71. package/dist/es/standards-sdk.es23.js +1041 -7
  72. package/dist/es/standards-sdk.es23.js.map +1 -1
  73. package/dist/es/standards-sdk.es24.js +1692 -966
  74. package/dist/es/standards-sdk.es24.js.map +1 -1
  75. package/dist/es/standards-sdk.es25.js +3 -1769
  76. package/dist/es/standards-sdk.es25.js.map +1 -1
  77. package/dist/es/standards-sdk.es26.js +3843 -6866
  78. package/dist/es/standards-sdk.es26.js.map +1 -1
  79. package/dist/es/standards-sdk.es27.js +7190 -3
  80. package/dist/es/standards-sdk.es27.js.map +1 -1
  81. package/dist/es/standards-sdk.es28.js +2 -9
  82. package/dist/es/standards-sdk.es28.js.map +1 -1
  83. package/dist/es/standards-sdk.es29.js +36 -2
  84. package/dist/es/standards-sdk.es29.js.map +1 -1
  85. package/dist/es/standards-sdk.es30.js +48 -5
  86. package/dist/es/standards-sdk.es30.js.map +1 -1
  87. package/dist/es/standards-sdk.es31.js +5 -36
  88. package/dist/es/standards-sdk.es31.js.map +1 -1
  89. package/dist/es/standards-sdk.es32.js +100 -47
  90. package/dist/es/standards-sdk.es32.js.map +1 -1
  91. package/dist/es/standards-sdk.es33.js +2 -10
  92. package/dist/es/standards-sdk.es33.js.map +1 -1
  93. package/dist/es/standards-sdk.es34.js +15 -4166
  94. package/dist/es/standards-sdk.es34.js.map +1 -1
  95. package/dist/es/standards-sdk.es35.js +409 -2
  96. package/dist/es/standards-sdk.es35.js.map +1 -1
  97. package/dist/es/standards-sdk.es36.js +2 -364
  98. package/dist/es/standards-sdk.es36.js.map +1 -1
  99. package/dist/es/standards-sdk.es37.js +2282 -6
  100. package/dist/es/standards-sdk.es37.js.map +1 -1
  101. package/dist/es/standards-sdk.es38.js +152 -167
  102. package/dist/es/standards-sdk.es38.js.map +1 -1
  103. package/dist/es/standards-sdk.es39.js +188 -74
  104. package/dist/es/standards-sdk.es39.js.map +1 -1
  105. package/dist/es/standards-sdk.es4.js +1 -1
  106. package/dist/es/standards-sdk.es40.js +423 -99
  107. package/dist/es/standards-sdk.es40.js.map +1 -1
  108. package/dist/es/standards-sdk.es41.js +20 -47
  109. package/dist/es/standards-sdk.es41.js.map +1 -1
  110. package/dist/es/standards-sdk.es42.js +138 -9
  111. package/dist/es/standards-sdk.es42.js.map +1 -1
  112. package/dist/es/standards-sdk.es43.js +13 -92
  113. package/dist/es/standards-sdk.es43.js.map +1 -1
  114. package/dist/es/standards-sdk.es44.js +28 -3
  115. package/dist/es/standards-sdk.es44.js.map +1 -1
  116. package/dist/es/standards-sdk.es45.js +29 -2
  117. package/dist/es/standards-sdk.es45.js.map +1 -1
  118. package/dist/es/standards-sdk.es46.js +15 -107
  119. package/dist/es/standards-sdk.es46.js.map +1 -1
  120. package/dist/es/standards-sdk.es47.js +41 -71
  121. package/dist/es/standards-sdk.es47.js.map +1 -1
  122. package/dist/es/standards-sdk.es48.js +17 -5
  123. package/dist/es/standards-sdk.es48.js.map +1 -1
  124. package/dist/es/standards-sdk.es49.js +60 -4
  125. package/dist/es/standards-sdk.es49.js.map +1 -1
  126. package/dist/es/standards-sdk.es5.js +9 -32
  127. package/dist/es/standards-sdk.es5.js.map +1 -1
  128. package/dist/es/standards-sdk.es50.js +1259 -191
  129. package/dist/es/standards-sdk.es50.js.map +1 -1
  130. package/dist/es/standards-sdk.es51.js +142 -52
  131. package/dist/es/standards-sdk.es51.js.map +1 -1
  132. package/dist/es/standards-sdk.es52.js +91 -69
  133. package/dist/es/standards-sdk.es52.js.map +1 -1
  134. package/dist/es/standards-sdk.es53.js +79 -414
  135. package/dist/es/standards-sdk.es53.js.map +1 -1
  136. package/dist/es/standards-sdk.es54.js +32 -2
  137. package/dist/es/standards-sdk.es54.js.map +1 -1
  138. package/dist/es/standards-sdk.es55.js +5 -119
  139. package/dist/es/standards-sdk.es55.js.map +1 -1
  140. package/dist/es/standards-sdk.es56.js +147 -183
  141. package/dist/es/standards-sdk.es56.js.map +1 -1
  142. package/dist/es/standards-sdk.es57.js +18 -433
  143. package/dist/es/standards-sdk.es57.js.map +1 -1
  144. package/dist/es/standards-sdk.es58.js +788 -20
  145. package/dist/es/standards-sdk.es58.js.map +1 -1
  146. package/dist/es/standards-sdk.es59.js +161 -126
  147. package/dist/es/standards-sdk.es59.js.map +1 -1
  148. package/dist/es/standards-sdk.es60.js +138 -13
  149. package/dist/es/standards-sdk.es60.js.map +1 -1
  150. package/dist/es/standards-sdk.es61.js +13 -21
  151. package/dist/es/standards-sdk.es61.js.map +1 -1
  152. package/dist/es/standards-sdk.es62.js +25 -27
  153. package/dist/es/standards-sdk.es62.js.map +1 -1
  154. package/dist/es/standards-sdk.es63.js +24 -19
  155. package/dist/es/standards-sdk.es63.js.map +1 -1
  156. package/dist/es/standards-sdk.es64.js +36 -42
  157. package/dist/es/standards-sdk.es64.js.map +1 -1
  158. package/dist/es/standards-sdk.es65.js +3 -18
  159. package/dist/es/standards-sdk.es65.js.map +1 -1
  160. package/dist/es/standards-sdk.es66.js +3 -60
  161. package/dist/es/standards-sdk.es66.js.map +1 -1
  162. package/dist/es/standards-sdk.es67.js +7060 -1213
  163. package/dist/es/standards-sdk.es67.js.map +1 -1
  164. package/dist/es/standards-sdk.es68.js +402 -131
  165. package/dist/es/standards-sdk.es68.js.map +1 -1
  166. package/dist/es/standards-sdk.es69.js +2 -91
  167. package/dist/es/standards-sdk.es69.js.map +1 -1
  168. package/dist/es/standards-sdk.es7.js +5 -106
  169. package/dist/es/standards-sdk.es7.js.map +1 -1
  170. package/dist/es/standards-sdk.es70.js +113 -77
  171. package/dist/es/standards-sdk.es70.js.map +1 -1
  172. package/dist/es/standards-sdk.es71.js +360 -28
  173. package/dist/es/standards-sdk.es71.js.map +1 -1
  174. package/dist/es/standards-sdk.es72.js +5 -5
  175. package/dist/es/standards-sdk.es72.js.map +1 -1
  176. package/dist/es/standards-sdk.es73.js +167 -147
  177. package/dist/es/standards-sdk.es73.js.map +1 -1
  178. package/dist/es/standards-sdk.es74.js +80 -22
  179. package/dist/es/standards-sdk.es74.js.map +1 -1
  180. package/dist/es/standards-sdk.es75.js +102 -781
  181. package/dist/es/standards-sdk.es75.js.map +1 -1
  182. package/dist/es/standards-sdk.es76.js +44 -166
  183. package/dist/es/standards-sdk.es76.js.map +1 -1
  184. package/dist/es/standards-sdk.es77.js +9 -142
  185. package/dist/es/standards-sdk.es77.js.map +1 -1
  186. package/dist/es/standards-sdk.es78.js +97 -3
  187. package/dist/es/standards-sdk.es78.js.map +1 -1
  188. package/dist/es/standards-sdk.es79.js +3 -163
  189. package/dist/es/standards-sdk.es79.js.map +1 -1
  190. package/dist/es/standards-sdk.es8.js +4 -4
  191. package/dist/es/standards-sdk.es80.js +2 -32
  192. package/dist/es/standards-sdk.es80.js.map +1 -1
  193. package/dist/es/standards-sdk.es81.js +103 -53
  194. package/dist/es/standards-sdk.es81.js.map +1 -1
  195. package/dist/es/standards-sdk.es82.js +69 -45
  196. package/dist/es/standards-sdk.es82.js.map +1 -1
  197. package/dist/es/standards-sdk.es83.js +5 -9
  198. package/dist/es/standards-sdk.es83.js.map +1 -1
  199. package/dist/es/standards-sdk.es84.js +4 -64
  200. package/dist/es/standards-sdk.es84.js.map +1 -1
  201. package/dist/es/standards-sdk.es85.js +221 -6
  202. package/dist/es/standards-sdk.es85.js.map +1 -1
  203. package/dist/es/standards-sdk.es86.js +56 -13
  204. package/dist/es/standards-sdk.es86.js.map +1 -1
  205. package/dist/es/standards-sdk.es87.js +68 -6
  206. package/dist/es/standards-sdk.es87.js.map +1 -1
  207. package/dist/es/standards-sdk.es88.js +31 -44
  208. package/dist/es/standards-sdk.es88.js.map +1 -1
  209. package/dist/es/standards-sdk.es89.js +63 -2
  210. package/dist/es/standards-sdk.es89.js.map +1 -1
  211. package/dist/es/standards-sdk.es9.js +1 -1
  212. package/dist/es/standards-sdk.es90.js +47 -133
  213. package/dist/es/standards-sdk.es90.js.map +1 -1
  214. package/dist/es/standards-sdk.es91.js +10 -172
  215. package/dist/es/standards-sdk.es91.js.map +1 -1
  216. package/dist/es/standards-sdk.es92.js +61 -17
  217. package/dist/es/standards-sdk.es92.js.map +1 -1
  218. package/dist/es/standards-sdk.es93.js +6 -27
  219. package/dist/es/standards-sdk.es93.js.map +1 -1
  220. package/dist/es/standards-sdk.es94.js +14 -25
  221. package/dist/es/standards-sdk.es94.js.map +1 -1
  222. package/dist/es/standards-sdk.es95.js +7 -38
  223. package/dist/es/standards-sdk.es95.js.map +1 -1
  224. package/dist/es/standards-sdk.es96.js +44 -12
  225. package/dist/es/standards-sdk.es96.js.map +1 -1
  226. package/dist/es/standards-sdk.es97.js +2 -13
  227. package/dist/es/standards-sdk.es97.js.map +1 -1
  228. package/dist/es/standards-sdk.es98.js +134 -30
  229. package/dist/es/standards-sdk.es98.js.map +1 -1
  230. package/dist/es/standards-sdk.es99.js +171 -14
  231. package/dist/es/standards-sdk.es99.js.map +1 -1
  232. package/dist/es/utils/index.d.ts +0 -1
  233. package/dist/es/utils/index.d.ts.map +1 -1
  234. package/dist/umd/hcs-10/base-client.d.ts +3 -14
  235. package/dist/umd/hcs-10/base-client.d.ts.map +1 -1
  236. package/dist/umd/hcs-10/connections-manager.d.ts +0 -51
  237. package/dist/umd/hcs-10/connections-manager.d.ts.map +1 -1
  238. package/dist/umd/hcs-10/sdk.d.ts +1 -38
  239. package/dist/umd/hcs-10/sdk.d.ts.map +1 -1
  240. package/dist/umd/hcs-10/types.d.ts +3 -9
  241. package/dist/umd/hcs-10/types.d.ts.map +1 -1
  242. package/dist/umd/inscribe/inscriber.d.ts +0 -2
  243. package/dist/umd/inscribe/inscriber.d.ts.map +1 -1
  244. package/dist/umd/services/index.d.ts +0 -1
  245. package/dist/umd/services/index.d.ts.map +1 -1
  246. package/dist/umd/services/mirror-node.d.ts +1 -17
  247. package/dist/umd/services/mirror-node.d.ts.map +1 -1
  248. package/dist/umd/services/types.d.ts +0 -24
  249. package/dist/umd/services/types.d.ts.map +1 -1
  250. package/dist/umd/standards-sdk.umd.js +22 -22
  251. package/dist/umd/standards-sdk.umd.js.map +1 -1
  252. package/dist/umd/utils/index.d.ts +0 -1
  253. package/dist/umd/utils/index.d.ts.map +1 -1
  254. package/package.json +8 -12
  255. package/dist/es/standards-sdk.es119.js +0 -412
  256. package/dist/es/standards-sdk.es119.js.map +0 -1
  257. package/dist/es/standards-sdk.es120.js +0 -2285
  258. package/dist/es/standards-sdk.es120.js.map +0 -1
  259. package/dist/es/standards-sdk.es121.js +0 -7139
  260. package/dist/es/standards-sdk.es121.js.map +0 -1
  261. package/dist/es/standards-sdk.es122.js +0 -13
  262. package/dist/es/standards-sdk.es122.js.map +0 -1
  263. package/dist/es/standards-sdk.es123.js +0 -14
  264. package/dist/es/standards-sdk.es123.js.map +0 -1
  265. package/dist/es/standards-sdk.es124.js +0 -21
  266. package/dist/es/standards-sdk.es124.js.map +0 -1
  267. package/dist/es/standards-sdk.es125.js +0 -9
  268. package/dist/es/standards-sdk.es125.js.map +0 -1
  269. package/dist/es/standards-sdk.es126.js +0 -12
  270. package/dist/es/standards-sdk.es126.js.map +0 -1
  271. package/dist/es/utils/transaction-parser.d.ts +0 -103
  272. package/dist/es/utils/transaction-parser.d.ts.map +0 -1
  273. package/dist/umd/utils/transaction-parser.d.ts +0 -103
  274. package/dist/umd/utils/transaction-parser.d.ts.map +0 -1
@@ -1,87 +1,123 @@
1
- import { keccak256 } from "./standards-sdk.es74.js";
2
- import { assertArgument } from "./standards-sdk.es68.js";
3
- import { getBytes } from "./standards-sdk.es69.js";
4
- const BN_0 = BigInt(0);
5
- const BN_36 = BigInt(36);
6
- function getChecksumAddress(address) {
7
- address = address.toLowerCase();
8
- const chars = address.substring(2).split("");
9
- const expanded = new Uint8Array(40);
10
- for (let i = 0; i < 40; i++) {
11
- expanded[i] = chars[i].charCodeAt(0);
1
+ var quickFormatUnescaped;
2
+ var hasRequiredQuickFormatUnescaped;
3
+ function requireQuickFormatUnescaped() {
4
+ if (hasRequiredQuickFormatUnescaped) return quickFormatUnescaped;
5
+ hasRequiredQuickFormatUnescaped = 1;
6
+ function tryStringify(o) {
7
+ try {
8
+ return JSON.stringify(o);
9
+ } catch (e) {
10
+ return '"[Circular]"';
11
+ }
12
12
  }
13
- const hashed = getBytes(keccak256(expanded));
14
- for (let i = 0; i < 40; i += 2) {
15
- if (hashed[i >> 1] >> 4 >= 8) {
16
- chars[i] = chars[i].toUpperCase();
13
+ quickFormatUnescaped = format;
14
+ function format(f, args, opts) {
15
+ var ss = opts && opts.stringify || tryStringify;
16
+ var offset = 1;
17
+ if (typeof f === "object" && f !== null) {
18
+ var len = args.length + offset;
19
+ if (len === 1) return f;
20
+ var objects = new Array(len);
21
+ objects[0] = ss(f);
22
+ for (var index = 1; index < len; index++) {
23
+ objects[index] = ss(args[index]);
24
+ }
25
+ return objects.join(" ");
17
26
  }
18
- if ((hashed[i >> 1] & 15) >= 8) {
19
- chars[i + 1] = chars[i + 1].toUpperCase();
27
+ if (typeof f !== "string") {
28
+ return f;
20
29
  }
21
- }
22
- return "0x" + chars.join("");
23
- }
24
- const ibanLookup = {};
25
- for (let i = 0; i < 10; i++) {
26
- ibanLookup[String(i)] = String(i);
27
- }
28
- for (let i = 0; i < 26; i++) {
29
- ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
30
- }
31
- const safeDigits = 15;
32
- function ibanChecksum(address) {
33
- address = address.toUpperCase();
34
- address = address.substring(4) + address.substring(0, 2) + "00";
35
- let expanded = address.split("").map((c) => {
36
- return ibanLookup[c];
37
- }).join("");
38
- while (expanded.length >= safeDigits) {
39
- let block = expanded.substring(0, safeDigits);
40
- expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
41
- }
42
- let checksum = String(98 - parseInt(expanded, 10) % 97);
43
- while (checksum.length < 2) {
44
- checksum = "0" + checksum;
45
- }
46
- return checksum;
47
- }
48
- const Base36 = function() {
49
- const result = {};
50
- for (let i = 0; i < 36; i++) {
51
- const key = "0123456789abcdefghijklmnopqrstuvwxyz"[i];
52
- result[key] = BigInt(i);
53
- }
54
- return result;
55
- }();
56
- function fromBase36(value) {
57
- value = value.toLowerCase();
58
- let result = BN_0;
59
- for (let i = 0; i < value.length; i++) {
60
- result = result * BN_36 + Base36[value[i]];
61
- }
62
- return result;
63
- }
64
- function getAddress(address) {
65
- assertArgument(typeof address === "string", "invalid address", "address", address);
66
- if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
67
- if (!address.startsWith("0x")) {
68
- address = "0x" + address;
30
+ var argLen = args.length;
31
+ if (argLen === 0) return f;
32
+ var str = "";
33
+ var a = 1 - offset;
34
+ var lastPos = -1;
35
+ var flen = f && f.length || 0;
36
+ for (var i = 0; i < flen; ) {
37
+ if (f.charCodeAt(i) === 37 && i + 1 < flen) {
38
+ lastPos = lastPos > -1 ? lastPos : 0;
39
+ switch (f.charCodeAt(i + 1)) {
40
+ case 100:
41
+ // 'd'
42
+ case 102:
43
+ if (a >= argLen)
44
+ break;
45
+ if (args[a] == null) break;
46
+ if (lastPos < i)
47
+ str += f.slice(lastPos, i);
48
+ str += Number(args[a]);
49
+ lastPos = i + 2;
50
+ i++;
51
+ break;
52
+ case 105:
53
+ if (a >= argLen)
54
+ break;
55
+ if (args[a] == null) break;
56
+ if (lastPos < i)
57
+ str += f.slice(lastPos, i);
58
+ str += Math.floor(Number(args[a]));
59
+ lastPos = i + 2;
60
+ i++;
61
+ break;
62
+ case 79:
63
+ // 'O'
64
+ case 111:
65
+ // 'o'
66
+ case 106:
67
+ if (a >= argLen)
68
+ break;
69
+ if (args[a] === void 0) break;
70
+ if (lastPos < i)
71
+ str += f.slice(lastPos, i);
72
+ var type = typeof args[a];
73
+ if (type === "string") {
74
+ str += "'" + args[a] + "'";
75
+ lastPos = i + 2;
76
+ i++;
77
+ break;
78
+ }
79
+ if (type === "function") {
80
+ str += args[a].name || "<anonymous>";
81
+ lastPos = i + 2;
82
+ i++;
83
+ break;
84
+ }
85
+ str += ss(args[a]);
86
+ lastPos = i + 2;
87
+ i++;
88
+ break;
89
+ case 115:
90
+ if (a >= argLen)
91
+ break;
92
+ if (lastPos < i)
93
+ str += f.slice(lastPos, i);
94
+ str += String(args[a]);
95
+ lastPos = i + 2;
96
+ i++;
97
+ break;
98
+ case 37:
99
+ if (lastPos < i)
100
+ str += f.slice(lastPos, i);
101
+ str += "%";
102
+ lastPos = i + 2;
103
+ i++;
104
+ a--;
105
+ break;
106
+ }
107
+ ++a;
108
+ }
109
+ ++i;
69
110
  }
70
- const result = getChecksumAddress(address);
71
- assertArgument(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, "bad address checksum", "address", address);
72
- return result;
73
- }
74
- if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
75
- assertArgument(address.substring(2, 4) === ibanChecksum(address), "bad icap checksum", "address", address);
76
- let result = fromBase36(address.substring(4)).toString(16);
77
- while (result.length < 40) {
78
- result = "0" + result;
111
+ if (lastPos === -1)
112
+ return f;
113
+ else if (lastPos < flen) {
114
+ str += f.slice(lastPos);
79
115
  }
80
- return getChecksumAddress("0x" + result);
116
+ return str;
81
117
  }
82
- assertArgument(false, "invalid address", "address", address);
118
+ return quickFormatUnescaped;
83
119
  }
84
120
  export {
85
- getAddress
121
+ requireQuickFormatUnescaped as __require
86
122
  };
87
123
  //# sourceMappingURL=standards-sdk.es70.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es70.js","sources":["../../node_modules/ethers/lib.esm/address/address.js"],"sourcesContent":["import { keccak256 } from \"../crypto/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\nconst BN_36 = BigInt(36);\nfunction getChecksumAddress(address) {\n // if (!isHexString(address, 20)) {\n // logger.throwArgumentError(\"invalid address\", \"address\", address);\n // }\n address = address.toLowerCase();\n const chars = address.substring(2).split(\"\");\n const expanded = new Uint8Array(40);\n for (let i = 0; i < 40; i++) {\n expanded[i] = chars[i].charCodeAt(0);\n }\n const hashed = getBytes(keccak256(expanded));\n for (let i = 0; i < 40; i += 2) {\n if ((hashed[i >> 1] >> 4) >= 8) {\n chars[i] = chars[i].toUpperCase();\n }\n if ((hashed[i >> 1] & 0x0f) >= 8) {\n chars[i + 1] = chars[i + 1].toUpperCase();\n }\n }\n return \"0x\" + chars.join(\"\");\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\n// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER));\nconst safeDigits = 15;\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address.split(\"\").map((c) => { return ibanLookup[c]; }).join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n;\nconst Base36 = (function () {\n ;\n const result = {};\n for (let i = 0; i < 36; i++) {\n const key = \"0123456789abcdefghijklmnopqrstuvwxyz\"[i];\n result[key] = BigInt(i);\n }\n return result;\n})();\nfunction fromBase36(value) {\n value = value.toLowerCase();\n let result = BN_0;\n for (let i = 0; i < value.length; i++) {\n result = result * BN_36 + Base36[value[i]];\n }\n return result;\n}\n/**\n * Returns a normalized and checksumed address for %%address%%.\n * This accepts non-checksum addresses, checksum addresses and\n * [[getIcapAddress]] formats.\n *\n * The checksum in Ethereum uses the capitalization (upper-case\n * vs lower-case) of the characters within an address to encode\n * its checksum, which offers, on average, a checksum of 15-bits.\n *\n * If %%address%% contains both upper-case and lower-case, it is\n * assumed to already be a checksum address and its checksum is\n * validated, and if the address fails its expected checksum an\n * error is thrown.\n *\n * If you wish the checksum of %%address%% to be ignore, it should\n * be converted to lower-case (i.e. ``.toLowercase()``) before\n * being passed in. This should be a very rare situation though,\n * that you wish to bypass the safegaurds in place to protect\n * against an address that has been incorrectly copied from another\n * source.\n *\n * @example:\n * // Adds the checksum (via upper-casing specific letters)\n * getAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\")\n * //_result:\n *\n * // Converts ICAP address and adds checksum\n * getAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if an address contains mixed case,\n * // but the checksum fails\n * getAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_error:\n */\nexport function getAddress(address) {\n assertArgument(typeof (address) === \"string\", \"invalid address\", \"address\", address);\n if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {\n // Missing the 0x prefix\n if (!address.startsWith(\"0x\")) {\n address = \"0x\" + address;\n }\n const result = getChecksumAddress(address);\n // It is a checksummed address with a bad checksum\n assertArgument(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, \"bad address checksum\", \"address\", address);\n return result;\n }\n // Maybe ICAP? (we only support direct mode)\n if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {\n // It is an ICAP address with a bad checksum\n assertArgument(address.substring(2, 4) === ibanChecksum(address), \"bad icap checksum\", \"address\", address);\n let result = fromBase36(address.substring(4)).toString(16);\n while (result.length < 40) {\n result = \"0\" + result;\n }\n return getChecksumAddress(\"0x\" + result);\n }\n assertArgument(false, \"invalid address\", \"address\", address);\n}\n/**\n * The [ICAP Address format](link-icap) format is an early checksum\n * format which attempts to be compatible with the banking\n * industry [IBAN format](link-wiki-iban) for bank accounts.\n *\n * It is no longer common or a recommended format.\n *\n * @example:\n * getIcapAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\");\n * //_result:\n *\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if the ICAP checksum is wrong\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\");\n * //_error:\n */\nexport function getIcapAddress(address) {\n //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n let base36 = BigInt(getAddress(address)).toString(36).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\n//# sourceMappingURL=address.js.map"],"names":[],"mappings":"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","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es70.js","sources":["../../node_modules/quick-format-unescaped/index.js"],"sourcesContent":["'use strict'\nfunction tryStringify (o) {\n try { return JSON.stringify(o) } catch(e) { return '\"[Circular]\"' }\n}\n\nmodule.exports = format\n\nfunction format(f, args, opts) {\n var ss = (opts && opts.stringify) || tryStringify\n var offset = 1\n if (typeof f === 'object' && f !== null) {\n var len = args.length + offset\n if (len === 1) return f\n var objects = new Array(len)\n objects[0] = ss(f)\n for (var index = 1; index < len; index++) {\n objects[index] = ss(args[index])\n }\n return objects.join(' ')\n }\n if (typeof f !== 'string') {\n return f\n }\n var argLen = args.length\n if (argLen === 0) return f\n var str = ''\n var a = 1 - offset\n var lastPos = -1\n var flen = (f && f.length) || 0\n for (var i = 0; i < flen;) {\n if (f.charCodeAt(i) === 37 && i + 1 < flen) {\n lastPos = lastPos > -1 ? lastPos : 0\n switch (f.charCodeAt(i + 1)) {\n case 100: // 'd'\n case 102: // 'f'\n if (a >= argLen)\n break\n if (args[a] == null) break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += Number(args[a])\n lastPos = i + 2\n i++\n break\n case 105: // 'i'\n if (a >= argLen)\n break\n if (args[a] == null) break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += Math.floor(Number(args[a]))\n lastPos = i + 2\n i++\n break\n case 79: // 'O'\n case 111: // 'o'\n case 106: // 'j'\n if (a >= argLen)\n break\n if (args[a] === undefined) break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n var type = typeof args[a]\n if (type === 'string') {\n str += '\\'' + args[a] + '\\''\n lastPos = i + 2\n i++\n break\n }\n if (type === 'function') {\n str += args[a].name || '<anonymous>'\n lastPos = i + 2\n i++\n break\n }\n str += ss(args[a])\n lastPos = i + 2\n i++\n break\n case 115: // 's'\n if (a >= argLen)\n break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += String(args[a])\n lastPos = i + 2\n i++\n break\n case 37: // '%'\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += '%'\n lastPos = i + 2\n i++\n a--\n break\n }\n ++a\n }\n ++i\n }\n if (lastPos === -1)\n return f\n else if (lastPos < flen) {\n str += f.slice(lastPos)\n }\n\n return str\n}\n"],"names":[],"mappings":"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","x_google_ignoreList":[0]}
@@ -1,35 +1,367 @@
1
- function checkType(value, type, name) {
2
- const types = type.split("|").map((t) => t.trim());
3
- for (let i = 0; i < types.length; i++) {
4
- switch (type) {
5
- case "any":
6
- return;
7
- case "bigint":
8
- case "boolean":
9
- case "number":
10
- case "string":
11
- if (typeof value === type) {
12
- return;
13
- }
14
- }
15
- }
16
- const error = new Error(`invalid value for type ${type}`);
17
- error.code = "INVALID_ARGUMENT";
18
- error.argument = `value.${name}`;
19
- error.value = value;
20
- throw error;
1
+ import global from "./standards-sdk.es65.js";
2
+ import process$1 from "./standards-sdk.es38.js";
3
+ import bind from "./standards-sdk.es72.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;
13
+ };
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);
19
+ }
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);
27
+ }
28
+ return result;
29
+ }
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;
38
+ }
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;
58
+ }
59
+ let i;
60
+ let l;
61
+ if (typeof obj !== "object") {
62
+ obj = [obj];
63
+ }
64
+ if (isArray(obj)) {
65
+ for (i = 0, l = obj.length; i < l; i++) {
66
+ fn.call(null, obj[i], i, obj);
67
+ }
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);
75
+ }
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;
87
+ }
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;
109
+ }
110
+ };
111
+ for (let i = 0, l = arguments.length; i < l; i++) {
112
+ arguments[i] && forEach(arguments[i], assignValue);
113
+ }
114
+ return result;
21
115
  }
22
- function defineProperties(target, values, types) {
23
- for (let key in values) {
24
- let value = values[key];
25
- const type = types ? types[key] : null;
26
- if (type) {
27
- checkType(value, type, key);
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;
122
+ }
123
+ }, { allOwnKeys });
124
+ return a;
125
+ };
126
+ const stripBOM = (content) => {
127
+ if (content.charCodeAt(0) === 65279) {
128
+ content = content.slice(1);
129
+ }
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;
155
+ }
28
156
  }
29
- Object.defineProperty(target, key, { enumerable: true, value, writable: false });
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;
165
+ }
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];
178
+ }
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]);
193
+ }
194
+ };
195
+ const matchAll = (regExp, str) => {
196
+ let matches;
197
+ const arr = [];
198
+ while ((matches = regExp.exec(str)) !== null) {
199
+ arr.push(matches);
30
200
  }
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;
209
+ }
210
+ );
211
+ };
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);
224
+ };
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
+ };
241
+ }
242
+ });
243
+ };
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]);
31
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
+ }
279
+ }
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
+ }
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
363
+ };
32
364
  export {
33
- defineProperties
365
+ utils as default
34
366
  };
35
367
  //# sourceMappingURL=standards-sdk.es71.js.map