@hashgraphonline/standards-sdk 0.0.50 → 0.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/es/hcs-10/base-client.d.ts +56 -1
  2. package/dist/es/hcs-10/base-client.d.ts.map +1 -1
  3. package/dist/es/hcs-10/browser.d.ts +9 -20
  4. package/dist/es/hcs-10/browser.d.ts.map +1 -1
  5. package/dist/es/hcs-10/sdk.d.ts +7 -79
  6. package/dist/es/hcs-10/sdk.d.ts.map +1 -1
  7. package/dist/es/hcs-10/types.d.ts +7 -0
  8. package/dist/es/hcs-10/types.d.ts.map +1 -1
  9. package/dist/es/hcs-11/index.d.ts +1 -1
  10. package/dist/es/hcs-11/index.d.ts.map +1 -1
  11. package/dist/es/inscribe/types.d.ts +1 -1
  12. package/dist/es/inscribe/types.d.ts.map +1 -1
  13. package/dist/es/services/mirror-node.d.ts.map +1 -1
  14. package/dist/es/standards-sdk.es10.js +122 -115
  15. package/dist/es/standards-sdk.es10.js.map +1 -1
  16. package/dist/es/standards-sdk.es101.js +1 -1
  17. package/dist/es/standards-sdk.es102.js +6 -6
  18. package/dist/es/standards-sdk.es103.js +3 -3
  19. package/dist/es/standards-sdk.es110.js +1 -1
  20. package/dist/es/standards-sdk.es111.js +2 -2
  21. package/dist/es/standards-sdk.es12.js.map +1 -1
  22. package/dist/es/standards-sdk.es13.js +1 -1
  23. package/dist/es/standards-sdk.es16.js +7 -7
  24. package/dist/es/standards-sdk.es16.js.map +1 -1
  25. package/dist/es/standards-sdk.es17.js +3 -5
  26. package/dist/es/standards-sdk.es17.js.map +1 -1
  27. package/dist/es/standards-sdk.es18.js.map +1 -1
  28. package/dist/es/standards-sdk.es21.js +10 -10
  29. package/dist/es/standards-sdk.es22.js +36 -6624
  30. package/dist/es/standards-sdk.es22.js.map +1 -1
  31. package/dist/es/standards-sdk.es23.js +48 -36
  32. package/dist/es/standards-sdk.es23.js.map +1 -1
  33. package/dist/es/standards-sdk.es24.js +6597 -21
  34. package/dist/es/standards-sdk.es24.js.map +1 -1
  35. package/dist/es/standards-sdk.es25.js +5 -2
  36. package/dist/es/standards-sdk.es25.js.map +1 -1
  37. package/dist/es/standards-sdk.es26.js +2 -5
  38. package/dist/es/standards-sdk.es26.js.map +1 -1
  39. package/dist/es/standards-sdk.es30.js +1 -1
  40. package/dist/es/standards-sdk.es33.js +419 -2
  41. package/dist/es/standards-sdk.es33.js.map +1 -1
  42. package/dist/es/standards-sdk.es34.js +2 -195
  43. package/dist/es/standards-sdk.es34.js.map +1 -1
  44. package/dist/es/standards-sdk.es35.js +111 -429
  45. package/dist/es/standards-sdk.es35.js.map +1 -1
  46. package/dist/es/standards-sdk.es36.js +2 -25
  47. package/dist/es/standards-sdk.es36.js.map +1 -1
  48. package/dist/es/standards-sdk.es37.js +24 -134
  49. package/dist/es/standards-sdk.es37.js.map +1 -1
  50. package/dist/es/standards-sdk.es38.js +356 -12
  51. package/dist/es/standards-sdk.es38.js.map +1 -1
  52. package/dist/es/standards-sdk.es39.js +5 -28
  53. package/dist/es/standards-sdk.es39.js.map +1 -1
  54. package/dist/es/standards-sdk.es40.js +173 -23
  55. package/dist/es/standards-sdk.es40.js.map +1 -1
  56. package/dist/es/standards-sdk.es41.js +75 -15
  57. package/dist/es/standards-sdk.es41.js.map +1 -1
  58. package/dist/es/standards-sdk.es42.js +109 -39
  59. package/dist/es/standards-sdk.es42.js.map +1 -1
  60. package/dist/es/standards-sdk.es43.js +48 -14
  61. package/dist/es/standards-sdk.es43.js.map +1 -1
  62. package/dist/es/standards-sdk.es44.js +9 -60
  63. package/dist/es/standards-sdk.es44.js.map +1 -1
  64. package/dist/es/standards-sdk.es45.js +73 -1265
  65. package/dist/es/standards-sdk.es45.js.map +1 -1
  66. package/dist/es/standards-sdk.es46.js +3 -147
  67. package/dist/es/standards-sdk.es46.js.map +1 -1
  68. package/dist/es/standards-sdk.es47.js +2 -91
  69. package/dist/es/standards-sdk.es47.js.map +1 -1
  70. package/dist/es/standards-sdk.es48.js +101 -73
  71. package/dist/es/standards-sdk.es48.js.map +1 -1
  72. package/dist/es/standards-sdk.es49.js +71 -29
  73. package/dist/es/standards-sdk.es49.js.map +1 -1
  74. package/dist/es/standards-sdk.es5.js +112 -444
  75. package/dist/es/standards-sdk.es5.js.map +1 -1
  76. package/dist/es/standards-sdk.es50.js +5 -5
  77. package/dist/es/standards-sdk.es50.js.map +1 -1
  78. package/dist/es/standards-sdk.es51.js +4 -158
  79. package/dist/es/standards-sdk.es51.js.map +1 -1
  80. package/dist/es/standards-sdk.es52.js +219 -21
  81. package/dist/es/standards-sdk.es52.js.map +1 -1
  82. package/dist/es/standards-sdk.es53.js +53 -788
  83. package/dist/es/standards-sdk.es53.js.map +1 -1
  84. package/dist/es/standards-sdk.es54.js +68 -142
  85. package/dist/es/standards-sdk.es54.js.map +1 -1
  86. package/dist/es/standards-sdk.es55.js +179 -158
  87. package/dist/es/standards-sdk.es55.js.map +1 -1
  88. package/dist/es/standards-sdk.es56.js +395 -376
  89. package/dist/es/standards-sdk.es56.js.map +1 -1
  90. package/dist/es/standards-sdk.es57.js +25 -2
  91. package/dist/es/standards-sdk.es57.js.map +1 -1
  92. package/dist/es/standards-sdk.es58.js +131 -112
  93. package/dist/es/standards-sdk.es58.js.map +1 -1
  94. package/dist/es/standards-sdk.es59.js +11 -14
  95. package/dist/es/standards-sdk.es59.js.map +1 -1
  96. package/dist/es/standards-sdk.es60.js +26 -24
  97. package/dist/es/standards-sdk.es60.js.map +1 -1
  98. package/dist/es/standards-sdk.es61.js +27 -24
  99. package/dist/es/standards-sdk.es61.js.map +1 -1
  100. package/dist/es/standards-sdk.es62.js +19 -36
  101. package/dist/es/standards-sdk.es62.js.map +1 -1
  102. package/dist/es/standards-sdk.es63.js +42 -27
  103. package/dist/es/standards-sdk.es63.js.map +1 -1
  104. package/dist/es/standards-sdk.es64.js +13 -357
  105. package/dist/es/standards-sdk.es64.js.map +1 -1
  106. package/dist/es/standards-sdk.es65.js +60 -5
  107. package/dist/es/standards-sdk.es65.js.map +1 -1
  108. package/dist/es/standards-sdk.es66.js +1270 -160
  109. package/dist/es/standards-sdk.es66.js.map +1 -1
  110. package/dist/es/standards-sdk.es67.js +137 -70
  111. package/dist/es/standards-sdk.es67.js.map +1 -1
  112. package/dist/es/standards-sdk.es68.js +87 -110
  113. package/dist/es/standards-sdk.es68.js.map +1 -1
  114. package/dist/es/standards-sdk.es69.js +78 -46
  115. package/dist/es/standards-sdk.es69.js.map +1 -1
  116. package/dist/es/standards-sdk.es70.js +31 -9
  117. package/dist/es/standards-sdk.es70.js.map +1 -1
  118. package/dist/es/standards-sdk.es71.js +5 -96
  119. package/dist/es/standards-sdk.es71.js.map +1 -1
  120. package/dist/es/standards-sdk.es72.js +158 -3
  121. package/dist/es/standards-sdk.es72.js.map +1 -1
  122. package/dist/es/standards-sdk.es73.js +23 -2
  123. package/dist/es/standards-sdk.es73.js.map +1 -1
  124. package/dist/es/standards-sdk.es74.js +782 -101
  125. package/dist/es/standards-sdk.es74.js.map +1 -1
  126. package/dist/es/standards-sdk.es75.js +138 -69
  127. package/dist/es/standards-sdk.es75.js.map +1 -1
  128. package/dist/es/standards-sdk.es76.js +173 -5
  129. package/dist/es/standards-sdk.es76.js.map +1 -1
  130. package/dist/es/standards-sdk.es77.js +31 -4
  131. package/dist/es/standards-sdk.es77.js.map +1 -1
  132. package/dist/es/standards-sdk.es78.js +54 -212
  133. package/dist/es/standards-sdk.es78.js.map +1 -1
  134. package/dist/es/standards-sdk.es79.js +47 -55
  135. package/dist/es/standards-sdk.es79.js.map +1 -1
  136. package/dist/es/standards-sdk.es8.js +169 -2
  137. package/dist/es/standards-sdk.es8.js.map +1 -1
  138. package/dist/es/standards-sdk.es80.js +10 -69
  139. package/dist/es/standards-sdk.es80.js.map +1 -1
  140. package/dist/es/standards-sdk.es81.js +60 -27
  141. package/dist/es/standards-sdk.es81.js.map +1 -1
  142. package/dist/es/standards-sdk.es82.js +6 -63
  143. package/dist/es/standards-sdk.es82.js.map +1 -1
  144. package/dist/es/standards-sdk.es83.js +12 -47
  145. package/dist/es/standards-sdk.es83.js.map +1 -1
  146. package/dist/es/standards-sdk.es84.js +7 -10
  147. package/dist/es/standards-sdk.es84.js.map +1 -1
  148. package/dist/es/standards-sdk.es85.js +41 -61
  149. package/dist/es/standards-sdk.es85.js.map +1 -1
  150. package/dist/es/standards-sdk.es86.js +2 -6
  151. package/dist/es/standards-sdk.es86.js.map +1 -1
  152. package/dist/es/standards-sdk.es87.js +134 -13
  153. package/dist/es/standards-sdk.es87.js.map +1 -1
  154. package/dist/es/standards-sdk.es88.js +171 -6
  155. package/dist/es/standards-sdk.es88.js.map +1 -1
  156. package/dist/es/standards-sdk.es89.js +21 -45
  157. package/dist/es/standards-sdk.es89.js.map +1 -1
  158. package/dist/es/standards-sdk.es9.js +1 -1
  159. package/dist/es/standards-sdk.es90.js +27 -2
  160. package/dist/es/standards-sdk.es90.js.map +1 -1
  161. package/dist/es/standards-sdk.es91.js +26 -136
  162. package/dist/es/standards-sdk.es91.js.map +1 -1
  163. package/dist/es/standards-sdk.es92.js +38 -172
  164. package/dist/es/standards-sdk.es92.js.map +1 -1
  165. package/dist/es/standards-sdk.es93.js +1 -1
  166. package/dist/es/standards-sdk.es94.js +3 -3
  167. package/dist/es/standards-sdk.es99.js +1 -1
  168. package/dist/umd/hcs-10/base-client.d.ts +56 -1
  169. package/dist/umd/hcs-10/base-client.d.ts.map +1 -1
  170. package/dist/umd/hcs-10/browser.d.ts +9 -20
  171. package/dist/umd/hcs-10/browser.d.ts.map +1 -1
  172. package/dist/umd/hcs-10/sdk.d.ts +7 -79
  173. package/dist/umd/hcs-10/sdk.d.ts.map +1 -1
  174. package/dist/umd/hcs-10/types.d.ts +7 -0
  175. package/dist/umd/hcs-10/types.d.ts.map +1 -1
  176. package/dist/umd/hcs-11/index.d.ts +1 -1
  177. package/dist/umd/hcs-11/index.d.ts.map +1 -1
  178. package/dist/umd/inscribe/types.d.ts +1 -1
  179. package/dist/umd/inscribe/types.d.ts.map +1 -1
  180. package/dist/umd/services/mirror-node.d.ts.map +1 -1
  181. package/dist/umd/standards-sdk.umd.js +2 -2
  182. package/dist/umd/standards-sdk.umd.js.map +1 -1
  183. package/package.json +1 -1
@@ -1,29 +1,32 @@
1
- const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
2
- const _32n = /* @__PURE__ */ BigInt(32);
3
- function fromBig(n, le = false) {
4
- if (le)
5
- return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
6
- return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
7
- }
8
- function split(lst, le = false) {
9
- let Ah = new Uint32Array(lst.length);
10
- let Al = new Uint32Array(lst.length);
11
- for (let i = 0; i < lst.length; i++) {
12
- const { h, l } = fromBig(lst[i], le);
13
- [Ah[i], Al[i]] = [h, l];
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import { Typed } from "./standards-sdk.es74.js";
5
+ import { Coder } from "./standards-sdk.es56.js";
6
+ import { defineProperties } from "./standards-sdk.es70.js";
7
+ import { getBytesCopy, hexlify } from "./standards-sdk.es68.js";
8
+ class FixedBytesCoder extends Coder {
9
+ constructor(size, localName) {
10
+ let name = "bytes" + String(size);
11
+ super(name, name, localName, false);
12
+ __publicField(this, "size");
13
+ defineProperties(this, { size }, { size: "number" });
14
+ }
15
+ defaultValue() {
16
+ return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2);
17
+ }
18
+ encode(writer, _value) {
19
+ let data = getBytesCopy(Typed.dereference(_value, this.type));
20
+ if (data.length !== this.size) {
21
+ this._throwError("incorrect data length", _value);
22
+ }
23
+ return writer.writeBytes(data);
24
+ }
25
+ decode(reader) {
26
+ return hexlify(reader.readBytes(this.size));
14
27
  }
15
- return [Ah, Al];
16
28
  }
17
- const rotlSH = (h, l, s) => h << s | l >>> 32 - s;
18
- const rotlSL = (h, l, s) => l << s | h >>> 32 - s;
19
- const rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
20
- const rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
21
29
  export {
22
- fromBig,
23
- rotlBH,
24
- rotlBL,
25
- rotlSH,
26
- rotlSL,
27
- split
30
+ FixedBytesCoder
28
31
  };
29
32
  //# sourceMappingURL=standards-sdk.es61.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es61.js","sources":["../../node_modules/@noble/hashes/esm/_u64.js"],"sourcesContent":["const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nfunction split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nconst rotr32L = (h, _l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { fromBig, split, toBig, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, rotlSH, rotlSL, rotlBH, rotlBL, add, add3L, add3H, add4L, add4H, add5H, add5L, };\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map"],"names":[],"mappings":"AAAA,MAAM,aAA6B,uBAAO,KAAK,KAAK,CAAC;AACrD,MAAM,OAAuB,uBAAO,EAAE;AAEtC,SAAS,QAAQ,GAAG,KAAK,OAAO;AAC5B,MAAI;AACA,WAAO,EAAE,GAAG,OAAO,IAAI,UAAU,GAAG,GAAG,OAAQ,KAAK,OAAQ,UAAU,EAAG;AAC7E,SAAO,EAAE,GAAG,OAAQ,KAAK,OAAQ,UAAU,IAAI,GAAG,GAAG,OAAO,IAAI,UAAU,IAAI,EAAG;AACrF;AACA,SAAS,MAAM,KAAK,KAAK,OAAO;AAC5B,MAAI,KAAK,IAAI,YAAY,IAAI,MAAM;AACnC,MAAI,KAAK,IAAI,YAAY,IAAI,MAAM;AACnC,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACjC,UAAM,EAAE,GAAG,EAAG,IAAG,QAAQ,IAAI,CAAC,GAAG,EAAE;AACnC,KAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAAA,EAC9B;AACI,SAAO,CAAC,IAAI,EAAE;AAClB;AAeK,MAAC,SAAS,CAAC,GAAG,GAAG,MAAO,KAAK,IAAM,MAAO,KAAK;AAC/C,MAAC,SAAS,CAAC,GAAG,GAAG,MAAO,KAAK,IAAM,MAAO,KAAK;AAE/C,MAAC,SAAS,CAAC,GAAG,GAAG,MAAO,KAAM,IAAI,KAAQ,MAAO,KAAK;AACtD,MAAC,SAAS,CAAC,GAAG,GAAG,MAAO,KAAM,IAAI,KAAQ,MAAO,KAAK;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es61.js","sources":["../../node_modules/ethers/lib.esm/abi/coders/fixed-bytes.js"],"sourcesContent":["import { defineProperties, getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class FixedBytesCoder extends Coder {\n size;\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n defineProperties(this, { size }, { size: \"number\" });\n }\n defaultValue() {\n return (\"0x0000000000000000000000000000000000000000000000000000000000000000\").substring(0, 2 + this.size * 2);\n }\n encode(writer, _value) {\n let data = getBytesCopy(Typed.dereference(_value, this.type));\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", _value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return hexlify(reader.readBytes(this.size));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map"],"names":[],"mappings":";;;;;;;AAMO,MAAM,wBAAwB,MAAM;AAAA,EAEvC,YAAY,MAAM,WAAW;AACzB,QAAI,OAAO,UAAU,OAAO,IAAI;AAChC,UAAM,MAAM,MAAM,WAAW,KAAK;AAHtC;AAII,qBAAiB,MAAM,EAAE,KAAM,GAAE,EAAE,MAAM,UAAU;AAAA,EAC3D;AAAA,EACI,eAAe;AACX,WAAQ,qEAAsE,UAAU,GAAG,IAAI,KAAK,OAAO,CAAC;AAAA,EACpH;AAAA,EACI,OAAO,QAAQ,QAAQ;AACnB,QAAI,OAAO,aAAa,MAAM,YAAY,QAAQ,KAAK,IAAI,CAAC;AAC5D,QAAI,KAAK,WAAW,KAAK,MAAM;AAC3B,WAAK,YAAY,yBAAyB,MAAM;AAAA,IAC5D;AACQ,WAAO,OAAO,WAAW,IAAI;AAAA,EACrC;AAAA,EACI,OAAO,QAAQ;AACX,WAAO,QAAQ,OAAO,UAAU,KAAK,IAAI,CAAC;AAAA,EAClD;AACA;","x_google_ignoreList":[0]}
@@ -1,41 +1,24 @@
1
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2
- const u8a = (a) => a instanceof Uint8Array;
3
- const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
4
- const isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
5
- if (!isLE)
6
- throw new Error("Non little-endian hardware is not supported");
7
- function utf8ToBytes(str) {
8
- if (typeof str !== "string")
9
- throw new Error(`utf8ToBytes expected string, got ${typeof str}`);
10
- return new Uint8Array(new TextEncoder().encode(str));
11
- }
12
- function toBytes(data) {
13
- if (typeof data === "string")
14
- data = utf8ToBytes(data);
15
- if (!u8a(data))
16
- throw new Error(`expected Uint8Array, got ${typeof data}`);
17
- return data;
18
- }
19
- class Hash {
20
- // Safe version that clones internal state
21
- clone() {
22
- return this._cloneInto();
1
+ import { Coder } from "./standards-sdk.es56.js";
2
+ const Empty = new Uint8Array([]);
3
+ class NullCoder extends Coder {
4
+ constructor(localName) {
5
+ super("null", "", localName, false);
6
+ }
7
+ defaultValue() {
8
+ return null;
9
+ }
10
+ encode(writer, value) {
11
+ if (value != null) {
12
+ this._throwError("not null", value);
13
+ }
14
+ return writer.writeBytes(Empty);
15
+ }
16
+ decode(reader) {
17
+ reader.readBytes(0);
18
+ return null;
23
19
  }
24
- }
25
- function wrapConstructor(hashCons) {
26
- const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
27
- const tmp = hashCons();
28
- hashC.outputLen = tmp.outputLen;
29
- hashC.blockLen = tmp.blockLen;
30
- hashC.create = () => hashCons();
31
- return hashC;
32
20
  }
33
21
  export {
34
- Hash,
35
- isLE,
36
- toBytes,
37
- u32,
38
- utf8ToBytes,
39
- wrapConstructor
22
+ NullCoder
40
23
  };
41
24
  //# sourceMappingURL=standards-sdk.es62.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es62.js","sources":["../../node_modules/@noble/hashes/esm/utils.js"],"sourcesContent":["/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated, we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\nconst u8a = (a) => a instanceof Uint8Array;\n// Cast array to different type\nexport const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n// Cast array to view\nexport const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\n// big-endian hardware is rare. Just in case someone still decides to run hashes:\n// early-throw an error because we don't support BE yet.\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\nif (!isLE)\n throw new Error('Non little-endian hardware is not supported');\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const len = hex.length;\n if (len % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + len);\n const array = new Uint8Array(len / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nexport const nextTick = async () => { };\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n if (!u8a(data))\n throw new Error(`expected Uint8Array, got ${typeof data}`);\n return data;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n let pad = 0; // walk through each item, ensure they have proper type\n arrays.forEach((a) => {\n if (!u8a(a))\n throw new Error('Uint8Array expected');\n r.set(a, pad);\n pad += a.length;\n });\n return r;\n}\n// For runtime check if class implements interface\nexport class Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\nconst toStr = {}.toString;\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && toStr.call(opts) !== '[object Object]')\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexport function wrapConstructor(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexport function wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport function wrapXOFConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map"],"names":[],"mappings":"AAAA;AAQA,MAAM,MAAM,CAAC,MAAM,aAAa;AAGpB,MAAC,MAAM,CAAC,QAAQ,IAAI,YAAY,IAAI,QAAQ,IAAI,YAAY,KAAK,MAAM,IAAI,aAAa,CAAC,CAAC;AAO1F,MAAC,OAAO,IAAI,WAAW,IAAI,YAAY,CAAC,SAAU,CAAC,EAAE,MAAM,EAAE,CAAC,MAAM;AAChF,IAAI,CAAC;AACD,QAAM,IAAI,MAAM,6CAA6C;AAuD1D,SAAS,YAAY,KAAK;AAC7B,MAAI,OAAO,QAAQ;AACf,UAAM,IAAI,MAAM,oCAAoC,OAAO,GAAG,EAAE;AACpE,SAAO,IAAI,WAAW,IAAI,YAAa,EAAC,OAAO,GAAG,CAAC;AACvD;AAMO,SAAS,QAAQ,MAAM;AAC1B,MAAI,OAAO,SAAS;AAChB,WAAO,YAAY,IAAI;AAC3B,MAAI,CAAC,IAAI,IAAI;AACT,UAAM,IAAI,MAAM,4BAA4B,OAAO,IAAI,EAAE;AAC7D,SAAO;AACX;AAgBO,MAAM,KAAK;AAAA;AAAA,EAEd,QAAQ;AACJ,WAAO,KAAK,WAAY;AAAA,EAChC;AACA;AAQO,SAAS,gBAAgB,UAAU;AACtC,QAAM,QAAQ,CAAC,QAAQ,SAAU,EAAC,OAAO,QAAQ,GAAG,CAAC,EAAE,OAAQ;AAC/D,QAAM,MAAM,SAAU;AACtB,QAAM,YAAY,IAAI;AACtB,QAAM,WAAW,IAAI;AACrB,QAAM,SAAS,MAAM,SAAU;AAC/B,SAAO;AACX;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es62.js","sources":["../../node_modules/ethers/lib.esm/abi/coders/null.js"],"sourcesContent":["import { Coder } from \"./abstract-coder.js\";\nconst Empty = new Uint8Array([]);\n/**\n * @_ignore\n */\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes(Empty);\n }\n decode(reader) {\n reader.readBytes(0);\n return null;\n }\n}\n//# sourceMappingURL=null.js.map"],"names":[],"mappings":";AACA,MAAM,QAAQ,IAAI,WAAW,EAAE;AAIxB,MAAM,kBAAkB,MAAM;AAAA,EACjC,YAAY,WAAW;AACnB,UAAM,QAAQ,IAAI,WAAW,KAAK;AAAA,EAC1C;AAAA,EACI,eAAe;AACX,WAAO;AAAA,EACf;AAAA,EACI,OAAO,QAAQ,OAAO;AAClB,QAAI,SAAS,MAAM;AACf,WAAK,YAAY,YAAY,KAAK;AAAA,IAC9C;AACQ,WAAO,OAAO,WAAW,KAAK;AAAA,EACtC;AAAA,EACI,OAAO,QAAQ;AACX,WAAO,UAAU,CAAC;AAClB,WAAO;AAAA,EACf;AACA;","x_google_ignoreList":[0]}
@@ -1,32 +1,47 @@
1
- function getDefaultExportFromCjs(x) {
2
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
3
- }
4
- function getAugmentedNamespace(n) {
5
- if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
6
- var f = n.default;
7
- if (typeof f == "function") {
8
- var a = function a2() {
9
- if (this instanceof a2) {
10
- return Reflect.construct(f, arguments, this.constructor);
11
- }
12
- return f.apply(this, arguments);
13
- };
14
- a.prototype = f.prototype;
15
- } else a = {};
16
- Object.defineProperty(a, "__esModule", { value: true });
17
- Object.keys(n).forEach(function(k) {
18
- var d = Object.getOwnPropertyDescriptor(n, k);
19
- Object.defineProperty(a, k, d.get ? d : {
20
- enumerable: true,
21
- get: function() {
22
- return n[k];
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import { Typed } from "./standards-sdk.es74.js";
5
+ import { Coder, WordSize } from "./standards-sdk.es56.js";
6
+ import { defineProperties } from "./standards-sdk.es70.js";
7
+ import { getBigInt, mask, toTwos, fromTwos } from "./standards-sdk.es72.js";
8
+ const BN_0 = BigInt(0);
9
+ const BN_1 = BigInt(1);
10
+ const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
11
+ class NumberCoder extends Coder {
12
+ constructor(size, signed, localName) {
13
+ const name = (signed ? "int" : "uint") + size * 8;
14
+ super(name, name, localName, false);
15
+ __publicField(this, "size");
16
+ __publicField(this, "signed");
17
+ defineProperties(this, { size, signed }, { size: "number", signed: "boolean" });
18
+ }
19
+ defaultValue() {
20
+ return 0;
21
+ }
22
+ encode(writer, _value) {
23
+ let value = getBigInt(Typed.dereference(_value, this.type));
24
+ let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8);
25
+ if (this.signed) {
26
+ let bounds = mask(maxUintValue, this.size * 8 - 1);
27
+ if (value > bounds || value < -(bounds + BN_1)) {
28
+ this._throwError("value out-of-bounds", _value);
23
29
  }
24
- });
25
- });
26
- return a;
30
+ value = toTwos(value, 8 * WordSize);
31
+ } else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) {
32
+ this._throwError("value out-of-bounds", _value);
33
+ }
34
+ return writer.writeValue(value);
35
+ }
36
+ decode(reader) {
37
+ let value = mask(reader.readValue(), this.size * 8);
38
+ if (this.signed) {
39
+ value = fromTwos(value, this.size * 8);
40
+ }
41
+ return value;
42
+ }
27
43
  }
28
44
  export {
29
- getAugmentedNamespace,
30
- getDefaultExportFromCjs
45
+ NumberCoder
31
46
  };
32
47
  //# sourceMappingURL=standards-sdk.es63.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es63.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"standards-sdk.es63.js","sources":["../../node_modules/ethers/lib.esm/abi/coders/number.js"],"sourcesContent":["import { defineProperties, fromTwos, getBigInt, mask, toTwos } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, WordSize } from \"./abstract-coder.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * @_ignore\n */\nexport class NumberCoder extends Coder {\n size;\n signed;\n constructor(size, signed, localName) {\n const name = ((signed ? \"int\" : \"uint\") + (size * 8));\n super(name, name, localName, false);\n defineProperties(this, { size, signed }, { size: \"number\", signed: \"boolean\" });\n }\n defaultValue() {\n return 0;\n }\n encode(writer, _value) {\n let value = getBigInt(Typed.dereference(_value, this.type));\n // Check bounds are safe for encoding\n let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8);\n if (this.signed) {\n let bounds = mask(maxUintValue, (this.size * 8) - 1);\n if (value > bounds || value < -(bounds + BN_1)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n value = toTwos(value, 8 * WordSize);\n }\n else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n let value = mask(reader.readValue(), this.size * 8);\n if (this.signed) {\n value = fromTwos(value, this.size * 8);\n }\n return value;\n }\n}\n//# sourceMappingURL=number.js.map"],"names":[],"mappings":";;;;;;;AAGA,MAAM,OAAO,OAAO,CAAC;AACrB,MAAM,OAAO,OAAO,CAAC;AACrB,MAAM,iBAAiB,OAAO,oEAAoE;AAI3F,MAAM,oBAAoB,MAAM;AAAA,EAGnC,YAAY,MAAM,QAAQ,WAAW;AACjC,UAAM,QAAS,SAAS,QAAQ,UAAW,OAAO;AAClD,UAAM,MAAM,MAAM,WAAW,KAAK;AAJtC;AACA;AAII,qBAAiB,MAAM,EAAE,MAAM,OAAM,GAAI,EAAE,MAAM,UAAU,QAAQ,WAAW;AAAA,EACtF;AAAA,EACI,eAAe;AACX,WAAO;AAAA,EACf;AAAA,EACI,OAAO,QAAQ,QAAQ;AACnB,QAAI,QAAQ,UAAU,MAAM,YAAY,QAAQ,KAAK,IAAI,CAAC;AAE1D,QAAI,eAAe,KAAK,gBAAgB,WAAW,CAAC;AACpD,QAAI,KAAK,QAAQ;AACb,UAAI,SAAS,KAAK,cAAe,KAAK,OAAO,IAAK,CAAC;AACnD,UAAI,QAAQ,UAAU,QAAQ,EAAE,SAAS,OAAO;AAC5C,aAAK,YAAY,uBAAuB,MAAM;AAAA,MAC9D;AACY,cAAQ,OAAO,OAAO,IAAI,QAAQ;AAAA,IAC9C,WACiB,QAAQ,QAAQ,QAAQ,KAAK,cAAc,KAAK,OAAO,CAAC,GAAG;AAChE,WAAK,YAAY,uBAAuB,MAAM;AAAA,IAC1D;AACQ,WAAO,OAAO,WAAW,KAAK;AAAA,EACtC;AAAA,EACI,OAAO,QAAQ;AACX,QAAI,QAAQ,KAAK,OAAO,UAAS,GAAI,KAAK,OAAO,CAAC;AAClD,QAAI,KAAK,QAAQ;AACb,cAAQ,SAAS,OAAO,KAAK,OAAO,CAAC;AAAA,IACjD;AACQ,WAAO;AAAA,EACf;AACA;","x_google_ignoreList":[0]}
@@ -1,365 +1,21 @@
1
- import bind from "./standards-sdk.es65.js";
2
- const { toString } = Object.prototype;
3
- const { getPrototypeOf } = Object;
4
- const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
5
- const str = toString.call(thing);
6
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
7
- })(/* @__PURE__ */ Object.create(null));
8
- const kindOfTest = (type) => {
9
- type = type.toLowerCase();
10
- return (thing) => kindOf(thing) === type;
11
- };
12
- const typeOfTest = (type) => (thing) => typeof thing === type;
13
- const { isArray } = Array;
14
- const isUndefined = typeOfTest("undefined");
15
- function isBuffer(val) {
16
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
17
- }
18
- const isArrayBuffer = kindOfTest("ArrayBuffer");
19
- function isArrayBufferView(val) {
20
- let result;
21
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
22
- result = ArrayBuffer.isView(val);
23
- } else {
24
- result = val && val.buffer && isArrayBuffer(val.buffer);
1
+ import { toUtf8Bytes, toUtf8String } from "./standards-sdk.es75.js";
2
+ import { Typed } from "./standards-sdk.es74.js";
3
+ import { DynamicBytesCoder } from "./standards-sdk.es60.js";
4
+ class StringCoder extends DynamicBytesCoder {
5
+ constructor(localName) {
6
+ super("string", localName);
25
7
  }
26
- return result;
27
- }
28
- const isString = typeOfTest("string");
29
- const isFunction = typeOfTest("function");
30
- const isNumber = typeOfTest("number");
31
- const isObject = (thing) => thing !== null && typeof thing === "object";
32
- const isBoolean = (thing) => thing === true || thing === false;
33
- const isPlainObject = (val) => {
34
- if (kindOf(val) !== "object") {
35
- return false;
8
+ defaultValue() {
9
+ return "";
36
10
  }
37
- const prototype = getPrototypeOf(val);
38
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
39
- };
40
- const isDate = kindOfTest("Date");
41
- const isFile = kindOfTest("File");
42
- const isBlob = kindOfTest("Blob");
43
- const isFileList = kindOfTest("FileList");
44
- const isStream = (val) => isObject(val) && isFunction(val.pipe);
45
- const isFormData = (thing) => {
46
- let kind;
47
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
48
- kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
49
- };
50
- const isURLSearchParams = kindOfTest("URLSearchParams");
51
- const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
52
- const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
53
- function forEach(obj, fn, { allOwnKeys = false } = {}) {
54
- if (obj === null || typeof obj === "undefined") {
55
- return;
11
+ encode(writer, _value) {
12
+ return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, "string")));
56
13
  }
57
- let i;
58
- let l;
59
- if (typeof obj !== "object") {
60
- obj = [obj];
14
+ decode(reader) {
15
+ return toUtf8String(super.decode(reader));
61
16
  }
62
- if (isArray(obj)) {
63
- for (i = 0, l = obj.length; i < l; i++) {
64
- fn.call(null, obj[i], i, obj);
65
- }
66
- } else {
67
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
68
- const len = keys.length;
69
- let key;
70
- for (i = 0; i < len; i++) {
71
- key = keys[i];
72
- fn.call(null, obj[key], key, obj);
73
- }
74
- }
75
- }
76
- function findKey(obj, key) {
77
- key = key.toLowerCase();
78
- const keys = Object.keys(obj);
79
- let i = keys.length;
80
- let _key;
81
- while (i-- > 0) {
82
- _key = keys[i];
83
- if (key === _key.toLowerCase()) {
84
- return _key;
85
- }
86
- }
87
- return null;
88
17
  }
89
- const _global = (() => {
90
- if (typeof globalThis !== "undefined") return globalThis;
91
- return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
92
- })();
93
- const isContextDefined = (context) => !isUndefined(context) && context !== _global;
94
- function merge() {
95
- const { caseless } = isContextDefined(this) && this || {};
96
- const result = {};
97
- const assignValue = (val, key) => {
98
- const targetKey = caseless && findKey(result, key) || key;
99
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
100
- result[targetKey] = merge(result[targetKey], val);
101
- } else if (isPlainObject(val)) {
102
- result[targetKey] = merge({}, val);
103
- } else if (isArray(val)) {
104
- result[targetKey] = val.slice();
105
- } else {
106
- result[targetKey] = val;
107
- }
108
- };
109
- for (let i = 0, l = arguments.length; i < l; i++) {
110
- arguments[i] && forEach(arguments[i], assignValue);
111
- }
112
- return result;
113
- }
114
- const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
115
- forEach(b, (val, key) => {
116
- if (thisArg && isFunction(val)) {
117
- a[key] = bind(val, thisArg);
118
- } else {
119
- a[key] = val;
120
- }
121
- }, { allOwnKeys });
122
- return a;
123
- };
124
- const stripBOM = (content) => {
125
- if (content.charCodeAt(0) === 65279) {
126
- content = content.slice(1);
127
- }
128
- return content;
129
- };
130
- const inherits = (constructor, superConstructor, props, descriptors) => {
131
- constructor.prototype = Object.create(superConstructor.prototype, descriptors);
132
- constructor.prototype.constructor = constructor;
133
- Object.defineProperty(constructor, "super", {
134
- value: superConstructor.prototype
135
- });
136
- props && Object.assign(constructor.prototype, props);
137
- };
138
- const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
139
- let props;
140
- let i;
141
- let prop;
142
- const merged = {};
143
- destObj = destObj || {};
144
- if (sourceObj == null) return destObj;
145
- do {
146
- props = Object.getOwnPropertyNames(sourceObj);
147
- i = props.length;
148
- while (i-- > 0) {
149
- prop = props[i];
150
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
151
- destObj[prop] = sourceObj[prop];
152
- merged[prop] = true;
153
- }
154
- }
155
- sourceObj = filter !== false && getPrototypeOf(sourceObj);
156
- } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
157
- return destObj;
158
- };
159
- const endsWith = (str, searchString, position) => {
160
- str = String(str);
161
- if (position === void 0 || position > str.length) {
162
- position = str.length;
163
- }
164
- position -= searchString.length;
165
- const lastIndex = str.indexOf(searchString, position);
166
- return lastIndex !== -1 && lastIndex === position;
167
- };
168
- const toArray = (thing) => {
169
- if (!thing) return null;
170
- if (isArray(thing)) return thing;
171
- let i = thing.length;
172
- if (!isNumber(i)) return null;
173
- const arr = new Array(i);
174
- while (i-- > 0) {
175
- arr[i] = thing[i];
176
- }
177
- return arr;
178
- };
179
- const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
180
- return (thing) => {
181
- return TypedArray && thing instanceof TypedArray;
182
- };
183
- })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
184
- const forEachEntry = (obj, fn) => {
185
- const generator = obj && obj[Symbol.iterator];
186
- const iterator = generator.call(obj);
187
- let result;
188
- while ((result = iterator.next()) && !result.done) {
189
- const pair = result.value;
190
- fn.call(obj, pair[0], pair[1]);
191
- }
192
- };
193
- const matchAll = (regExp, str) => {
194
- let matches;
195
- const arr = [];
196
- while ((matches = regExp.exec(str)) !== null) {
197
- arr.push(matches);
198
- }
199
- return arr;
200
- };
201
- const isHTMLForm = kindOfTest("HTMLFormElement");
202
- const toCamelCase = (str) => {
203
- return str.toLowerCase().replace(
204
- /[-_\s]([a-z\d])(\w*)/g,
205
- function replacer(m, p1, p2) {
206
- return p1.toUpperCase() + p2;
207
- }
208
- );
209
- };
210
- const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
211
- const isRegExp = kindOfTest("RegExp");
212
- const reduceDescriptors = (obj, reducer) => {
213
- const descriptors = Object.getOwnPropertyDescriptors(obj);
214
- const reducedDescriptors = {};
215
- forEach(descriptors, (descriptor, name) => {
216
- let ret;
217
- if ((ret = reducer(descriptor, name, obj)) !== false) {
218
- reducedDescriptors[name] = ret || descriptor;
219
- }
220
- });
221
- Object.defineProperties(obj, reducedDescriptors);
222
- };
223
- const freezeMethods = (obj) => {
224
- reduceDescriptors(obj, (descriptor, name) => {
225
- if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
226
- return false;
227
- }
228
- const value = obj[name];
229
- if (!isFunction(value)) return;
230
- descriptor.enumerable = false;
231
- if ("writable" in descriptor) {
232
- descriptor.writable = false;
233
- return;
234
- }
235
- if (!descriptor.set) {
236
- descriptor.set = () => {
237
- throw Error("Can not rewrite read-only method '" + name + "'");
238
- };
239
- }
240
- });
241
- };
242
- const toObjectSet = (arrayOrString, delimiter) => {
243
- const obj = {};
244
- const define = (arr) => {
245
- arr.forEach((value) => {
246
- obj[value] = true;
247
- });
248
- };
249
- isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
250
- return obj;
251
- };
252
- const noop = () => {
253
- };
254
- const toFiniteNumber = (value, defaultValue) => {
255
- return value != null && Number.isFinite(value = +value) ? value : defaultValue;
256
- };
257
- function isSpecCompliantForm(thing) {
258
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
259
- }
260
- const toJSONObject = (obj) => {
261
- const stack = new Array(10);
262
- const visit = (source, i) => {
263
- if (isObject(source)) {
264
- if (stack.indexOf(source) >= 0) {
265
- return;
266
- }
267
- if (!("toJSON" in source)) {
268
- stack[i] = source;
269
- const target = isArray(source) ? [] : {};
270
- forEach(source, (value, key) => {
271
- const reducedValue = visit(value, i + 1);
272
- !isUndefined(reducedValue) && (target[key] = reducedValue);
273
- });
274
- stack[i] = void 0;
275
- return target;
276
- }
277
- }
278
- return source;
279
- };
280
- return visit(obj, 0);
281
- };
282
- const isAsyncFn = kindOfTest("AsyncFunction");
283
- const isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
284
- const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
285
- if (setImmediateSupported) {
286
- return setImmediate;
287
- }
288
- return postMessageSupported ? ((token, callbacks) => {
289
- _global.addEventListener("message", ({ source, data }) => {
290
- if (source === _global && data === token) {
291
- callbacks.length && callbacks.shift()();
292
- }
293
- }, false);
294
- return (cb) => {
295
- callbacks.push(cb);
296
- _global.postMessage(token, "*");
297
- };
298
- })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
299
- })(
300
- typeof setImmediate === "function",
301
- isFunction(_global.postMessage)
302
- );
303
- const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
304
- const utils = {
305
- isArray,
306
- isArrayBuffer,
307
- isBuffer,
308
- isFormData,
309
- isArrayBufferView,
310
- isString,
311
- isNumber,
312
- isBoolean,
313
- isObject,
314
- isPlainObject,
315
- isReadableStream,
316
- isRequest,
317
- isResponse,
318
- isHeaders,
319
- isUndefined,
320
- isDate,
321
- isFile,
322
- isBlob,
323
- isRegExp,
324
- isFunction,
325
- isStream,
326
- isURLSearchParams,
327
- isTypedArray,
328
- isFileList,
329
- forEach,
330
- merge,
331
- extend,
332
- trim,
333
- stripBOM,
334
- inherits,
335
- toFlatObject,
336
- kindOf,
337
- kindOfTest,
338
- endsWith,
339
- toArray,
340
- forEachEntry,
341
- matchAll,
342
- isHTMLForm,
343
- hasOwnProperty,
344
- hasOwnProp: hasOwnProperty,
345
- // an alias to avoid ESLint no-prototype-builtins detection
346
- reduceDescriptors,
347
- freezeMethods,
348
- toObjectSet,
349
- toCamelCase,
350
- noop,
351
- toFiniteNumber,
352
- findKey,
353
- global: _global,
354
- isContextDefined,
355
- isSpecCompliantForm,
356
- toJSONObject,
357
- isAsyncFn,
358
- isThenable,
359
- setImmediate: _setImmediate,
360
- asap
361
- };
362
18
  export {
363
- utils as default
19
+ StringCoder
364
20
  };
365
21
  //# sourceMappingURL=standards-sdk.es64.js.map