@hashgraphonline/standards-sdk 0.0.89 → 0.0.91

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 (206) hide show
  1. package/dist/es/hcs-10/connections-manager.d.ts.map +1 -1
  2. package/dist/es/standards-sdk.es10.js +13 -4
  3. package/dist/es/standards-sdk.es10.js.map +1 -1
  4. package/dist/es/standards-sdk.es100.js +13 -32
  5. package/dist/es/standards-sdk.es100.js.map +1 -1
  6. package/dist/es/standards-sdk.es101.js +30 -13
  7. package/dist/es/standards-sdk.es101.js.map +1 -1
  8. package/dist/es/standards-sdk.es102.js +14 -3
  9. package/dist/es/standards-sdk.es102.js.map +1 -1
  10. package/dist/es/standards-sdk.es103.js +3 -3
  11. package/dist/es/standards-sdk.es103.js.map +1 -1
  12. package/dist/es/standards-sdk.es104.js +3 -15
  13. package/dist/es/standards-sdk.es104.js.map +1 -1
  14. package/dist/es/standards-sdk.es105.js +15 -4
  15. package/dist/es/standards-sdk.es105.js.map +1 -1
  16. package/dist/es/standards-sdk.es106.js +5 -39
  17. package/dist/es/standards-sdk.es106.js.map +1 -1
  18. package/dist/es/standards-sdk.es107.js +38 -39
  19. package/dist/es/standards-sdk.es107.js.map +1 -1
  20. package/dist/es/standards-sdk.es108.js +37 -34
  21. package/dist/es/standards-sdk.es108.js.map +1 -1
  22. package/dist/es/standards-sdk.es109.js +34 -75
  23. package/dist/es/standards-sdk.es109.js.map +1 -1
  24. package/dist/es/standards-sdk.es110.js +78 -4
  25. package/dist/es/standards-sdk.es110.js.map +1 -1
  26. package/dist/es/standards-sdk.es111.js +3 -34
  27. package/dist/es/standards-sdk.es111.js.map +1 -1
  28. package/dist/es/standards-sdk.es112.js +2 -33
  29. package/dist/es/standards-sdk.es112.js.map +1 -1
  30. package/dist/es/standards-sdk.es113.js +2 -9
  31. package/dist/es/standards-sdk.es113.js.map +1 -1
  32. package/dist/es/standards-sdk.es114.js +32 -32
  33. package/dist/es/standards-sdk.es114.js.map +1 -1
  34. package/dist/es/standards-sdk.es115.js +33 -3
  35. package/dist/es/standards-sdk.es115.js.map +1 -1
  36. package/dist/es/standards-sdk.es116.js +9 -2
  37. package/dist/es/standards-sdk.es116.js.map +1 -1
  38. package/dist/es/standards-sdk.es117.js +34 -2
  39. package/dist/es/standards-sdk.es117.js.map +1 -1
  40. package/dist/es/standards-sdk.es13.js +2 -2
  41. package/dist/es/standards-sdk.es15.js +1 -1
  42. package/dist/es/standards-sdk.es18.js +1 -1
  43. package/dist/es/standards-sdk.es19.js +2 -2
  44. package/dist/es/standards-sdk.es23.js +3 -7190
  45. package/dist/es/standards-sdk.es23.js.map +1 -1
  46. package/dist/es/standards-sdk.es24.js +4086 -960
  47. package/dist/es/standards-sdk.es24.js.map +1 -1
  48. package/dist/es/standards-sdk.es25.js +1041 -36
  49. package/dist/es/standards-sdk.es25.js.map +1 -1
  50. package/dist/es/standards-sdk.es26.js +36 -48
  51. package/dist/es/standards-sdk.es26.js.map +1 -1
  52. package/dist/es/standards-sdk.es27.js +48 -3
  53. package/dist/es/standards-sdk.es27.js.map +1 -1
  54. package/dist/es/standards-sdk.es28.js +7190 -2
  55. package/dist/es/standards-sdk.es28.js.map +1 -1
  56. package/dist/es/standards-sdk.es29.js +2 -5
  57. package/dist/es/standards-sdk.es29.js.map +1 -1
  58. package/dist/es/standards-sdk.es30.js +5 -4167
  59. package/dist/es/standards-sdk.es30.js.map +1 -1
  60. package/dist/es/standards-sdk.es31.js +379 -7096
  61. package/dist/es/standards-sdk.es31.js.map +1 -1
  62. package/dist/es/standards-sdk.es32.js +2 -3
  63. package/dist/es/standards-sdk.es32.js.map +1 -1
  64. package/dist/es/standards-sdk.es33.js +112 -93
  65. package/dist/es/standards-sdk.es33.js.map +1 -1
  66. package/dist/es/standards-sdk.es34.js +2 -2
  67. package/dist/es/standards-sdk.es34.js.map +1 -1
  68. package/dist/es/standards-sdk.es35.js +194 -15
  69. package/dist/es/standards-sdk.es35.js.map +1 -1
  70. package/dist/es/standards-sdk.es36.js +418 -389
  71. package/dist/es/standards-sdk.es36.js.map +1 -1
  72. package/dist/es/standards-sdk.es37.js +25 -2
  73. package/dist/es/standards-sdk.es37.js.map +1 -1
  74. package/dist/es/standards-sdk.es38.js +123 -348
  75. package/dist/es/standards-sdk.es38.js.map +1 -1
  76. package/dist/es/standards-sdk.es39.js +17 -5
  77. package/dist/es/standards-sdk.es39.js.map +1 -1
  78. package/dist/es/standards-sdk.es4.js +1 -1
  79. package/dist/es/standards-sdk.es40.js +23 -173
  80. package/dist/es/standards-sdk.es40.js.map +1 -1
  81. package/dist/es/standards-sdk.es41.js +23 -75
  82. package/dist/es/standards-sdk.es41.js.map +1 -1
  83. package/dist/es/standards-sdk.es42.js +18 -111
  84. package/dist/es/standards-sdk.es42.js.map +1 -1
  85. package/dist/es/standards-sdk.es43.js +38 -46
  86. package/dist/es/standards-sdk.es43.js.map +1 -1
  87. package/dist/es/standards-sdk.es44.js +17 -9
  88. package/dist/es/standards-sdk.es44.js.map +1 -1
  89. package/dist/es/standards-sdk.es45.js +52 -88
  90. package/dist/es/standards-sdk.es45.js.map +1 -1
  91. package/dist/es/standards-sdk.es46.js +1288 -3
  92. package/dist/es/standards-sdk.es46.js.map +1 -1
  93. package/dist/es/standards-sdk.es47.js +148 -2
  94. package/dist/es/standards-sdk.es47.js.map +1 -1
  95. package/dist/es/standards-sdk.es48.js +80 -102
  96. package/dist/es/standards-sdk.es48.js.map +1 -1
  97. package/dist/es/standards-sdk.es49.js +80 -70
  98. package/dist/es/standards-sdk.es49.js.map +1 -1
  99. package/dist/es/standards-sdk.es5.js +2 -2
  100. package/dist/es/standards-sdk.es50.js +31 -5
  101. package/dist/es/standards-sdk.es50.js.map +1 -1
  102. package/dist/es/standards-sdk.es51.js +5 -4
  103. package/dist/es/standards-sdk.es51.js.map +1 -1
  104. package/dist/es/standards-sdk.es52.js +138 -200
  105. package/dist/es/standards-sdk.es52.js.map +1 -1
  106. package/dist/es/standards-sdk.es53.js +20 -55
  107. package/dist/es/standards-sdk.es53.js.map +1 -1
  108. package/dist/es/standards-sdk.es54.js +792 -68
  109. package/dist/es/standards-sdk.es54.js.map +1 -1
  110. package/dist/es/standards-sdk.es55.js +174 -2282
  111. package/dist/es/standards-sdk.es55.js.map +1 -1
  112. package/dist/es/standards-sdk.es56.js +127 -148
  113. package/dist/es/standards-sdk.es56.js.map +1 -1
  114. package/dist/es/standards-sdk.es57.js +3 -83
  115. package/dist/es/standards-sdk.es57.js.map +1 -1
  116. package/dist/es/standards-sdk.es58.js +20 -22
  117. package/dist/es/standards-sdk.es58.js.map +1 -1
  118. package/dist/es/standards-sdk.es59.js +22 -143
  119. package/dist/es/standards-sdk.es59.js.map +1 -1
  120. package/dist/es/standards-sdk.es60.js +26 -91
  121. package/dist/es/standards-sdk.es60.js.map +1 -1
  122. package/dist/es/standards-sdk.es61.js +36 -193
  123. package/dist/es/standards-sdk.es61.js.map +1 -1
  124. package/dist/es/standards-sdk.es62.js +86 -423
  125. package/dist/es/standards-sdk.es62.js.map +1 -1
  126. package/dist/es/standards-sdk.es63.js +2 -25
  127. package/dist/es/standards-sdk.es63.js.map +1 -1
  128. package/dist/es/standards-sdk.es64.js +15 -138
  129. package/dist/es/standards-sdk.es64.js.map +1 -1
  130. package/dist/es/standards-sdk.es65.js +405 -14
  131. package/dist/es/standards-sdk.es65.js.map +1 -1
  132. package/dist/es/standards-sdk.es66.js +2282 -29
  133. package/dist/es/standards-sdk.es66.js.map +1 -1
  134. package/dist/es/standards-sdk.es67.js +160 -25
  135. package/dist/es/standards-sdk.es67.js.map +1 -1
  136. package/dist/es/standards-sdk.es68.js +3 -21
  137. package/dist/es/standards-sdk.es68.js.map +1 -1
  138. package/dist/es/standards-sdk.es69.js +359 -39
  139. package/dist/es/standards-sdk.es69.js.map +1 -1
  140. package/dist/es/standards-sdk.es7.js +2 -2
  141. package/dist/es/standards-sdk.es70.js +5 -17
  142. package/dist/es/standards-sdk.es70.js.map +1 -1
  143. package/dist/es/standards-sdk.es71.js +168 -50
  144. package/dist/es/standards-sdk.es71.js.map +1 -1
  145. package/dist/es/standards-sdk.es72.js +79 -1287
  146. package/dist/es/standards-sdk.es72.js.map +1 -1
  147. package/dist/es/standards-sdk.es73.js +110 -28
  148. package/dist/es/standards-sdk.es73.js.map +1 -1
  149. package/dist/es/standards-sdk.es74.js +51 -5
  150. package/dist/es/standards-sdk.es74.js.map +1 -1
  151. package/dist/es/standards-sdk.es75.js +10 -159
  152. package/dist/es/standards-sdk.es75.js.map +1 -1
  153. package/dist/es/standards-sdk.es76.js +81 -777
  154. package/dist/es/standards-sdk.es76.js.map +1 -1
  155. package/dist/es/standards-sdk.es77.js +3 -173
  156. package/dist/es/standards-sdk.es77.js.map +1 -1
  157. package/dist/es/standards-sdk.es78.js +2 -143
  158. package/dist/es/standards-sdk.es78.js.map +1 -1
  159. package/dist/es/standards-sdk.es79.js +106 -25
  160. package/dist/es/standards-sdk.es79.js.map +1 -1
  161. package/dist/es/standards-sdk.es8.js +2 -2
  162. package/dist/es/standards-sdk.es80.js +71 -60
  163. package/dist/es/standards-sdk.es80.js.map +1 -1
  164. package/dist/es/standards-sdk.es81.js +5 -49
  165. package/dist/es/standards-sdk.es81.js.map +1 -1
  166. package/dist/es/standards-sdk.es82.js +4 -9
  167. package/dist/es/standards-sdk.es82.js.map +1 -1
  168. package/dist/es/standards-sdk.es83.js +214 -58
  169. package/dist/es/standards-sdk.es83.js.map +1 -1
  170. package/dist/es/standards-sdk.es84.js +57 -5
  171. package/dist/es/standards-sdk.es84.js.map +1 -1
  172. package/dist/es/standards-sdk.es85.js +69 -15
  173. package/dist/es/standards-sdk.es85.js.map +1 -1
  174. package/dist/es/standards-sdk.es86.js +7136 -7
  175. package/dist/es/standards-sdk.es86.js.map +1 -1
  176. package/dist/es/standards-sdk.es87.js +31 -44
  177. package/dist/es/standards-sdk.es87.js.map +1 -1
  178. package/dist/es/standards-sdk.es88.js +63 -2
  179. package/dist/es/standards-sdk.es88.js.map +1 -1
  180. package/dist/es/standards-sdk.es89.js +47 -133
  181. package/dist/es/standards-sdk.es89.js.map +1 -1
  182. package/dist/es/standards-sdk.es9.js +1 -1
  183. package/dist/es/standards-sdk.es90.js +10 -172
  184. package/dist/es/standards-sdk.es90.js.map +1 -1
  185. package/dist/es/standards-sdk.es91.js +61 -17
  186. package/dist/es/standards-sdk.es91.js.map +1 -1
  187. package/dist/es/standards-sdk.es92.js +6 -27
  188. package/dist/es/standards-sdk.es92.js.map +1 -1
  189. package/dist/es/standards-sdk.es93.js +14 -25
  190. package/dist/es/standards-sdk.es93.js.map +1 -1
  191. package/dist/es/standards-sdk.es94.js +7 -38
  192. package/dist/es/standards-sdk.es94.js.map +1 -1
  193. package/dist/es/standards-sdk.es95.js +41 -415
  194. package/dist/es/standards-sdk.es95.js.map +1 -1
  195. package/dist/es/standards-sdk.es96.js +2 -2
  196. package/dist/es/standards-sdk.es96.js.map +1 -1
  197. package/dist/es/standards-sdk.es97.js +128 -112
  198. package/dist/es/standards-sdk.es97.js.map +1 -1
  199. package/dist/es/standards-sdk.es98.js +171 -12
  200. package/dist/es/standards-sdk.es98.js.map +1 -1
  201. package/dist/es/standards-sdk.es99.js +13 -13
  202. package/dist/es/standards-sdk.es99.js.map +1 -1
  203. package/dist/umd/hcs-10/connections-manager.d.ts.map +1 -1
  204. package/dist/umd/standards-sdk.umd.js +1 -1
  205. package/dist/umd/standards-sdk.umd.js.map +1 -1
  206. package/package.json +1 -1
@@ -1,151 +1,30 @@
1
- import { version } from "./standards-sdk.es37.js";
2
- import { defineProperties } from "./standards-sdk.es73.js";
3
- function stringify(value) {
4
- if (value == null) {
5
- return "null";
6
- }
7
- if (Array.isArray(value)) {
8
- return "[ " + value.map(stringify).join(", ") + " ]";
9
- }
10
- if (value instanceof Uint8Array) {
11
- const HEX = "0123456789abcdef";
12
- let result = "0x";
13
- for (let i = 0; i < value.length; i++) {
14
- result += HEX[value[i] >> 4];
15
- result += HEX[value[i] & 15];
16
- }
17
- return result;
18
- }
19
- if (typeof value === "object" && typeof value.toJSON === "function") {
20
- return stringify(value.toJSON());
21
- }
22
- switch (typeof value) {
23
- case "boolean":
24
- case "symbol":
25
- return value.toString();
26
- case "bigint":
27
- return BigInt(value).toString();
28
- case "number":
29
- return value.toString();
30
- case "string":
31
- return JSON.stringify(value);
32
- case "object": {
33
- const keys = Object.keys(value);
34
- keys.sort();
35
- return "{ " + keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(", ") + " }";
36
- }
37
- }
38
- return `[ COULD NOT SERIALIZE ]`;
1
+ function number(n) {
2
+ if (!Number.isSafeInteger(n) || n < 0)
3
+ throw new Error(`Wrong positive integer: ${n}`);
39
4
  }
40
- function isError(error, code) {
41
- return error && error.code === code;
5
+ function bytes(b, ...lengths) {
6
+ if (!(b instanceof Uint8Array))
7
+ throw new Error("Expected Uint8Array");
8
+ if (lengths.length > 0 && !lengths.includes(b.length))
9
+ throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);
42
10
  }
43
- function makeError(message, code, info) {
44
- let shortMessage = message;
45
- {
46
- const details = [];
47
- if (info) {
48
- if ("message" in info || "code" in info || "name" in info) {
49
- throw new Error(`value will overwrite populated values: ${stringify(info)}`);
50
- }
51
- for (const key in info) {
52
- if (key === "shortMessage") {
53
- continue;
54
- }
55
- const value = info[key];
56
- details.push(key + "=" + stringify(value));
57
- }
58
- }
59
- details.push(`code=${code}`);
60
- details.push(`version=${version}`);
61
- if (details.length) {
62
- message += " (" + details.join(", ") + ")";
63
- }
64
- }
65
- let error;
66
- switch (code) {
67
- case "INVALID_ARGUMENT":
68
- error = new TypeError(message);
69
- break;
70
- case "NUMERIC_FAULT":
71
- case "BUFFER_OVERRUN":
72
- error = new RangeError(message);
73
- break;
74
- default:
75
- error = new Error(message);
76
- }
77
- defineProperties(error, { code });
78
- if (info) {
79
- Object.assign(error, info);
80
- }
81
- if (error.shortMessage == null) {
82
- defineProperties(error, { shortMessage });
83
- }
84
- return error;
11
+ function exists(instance, checkFinished = true) {
12
+ if (instance.destroyed)
13
+ throw new Error("Hash instance has been destroyed");
14
+ if (checkFinished && instance.finished)
15
+ throw new Error("Hash#digest() has already been called");
85
16
  }
86
- function assert(check, message, code, info) {
87
- if (!check) {
88
- throw makeError(message, code, info);
89
- }
90
- }
91
- function assertArgument(check, message, name, value) {
92
- assert(check, message, "INVALID_ARGUMENT", { argument: name, value });
93
- }
94
- function assertArgumentCount(count, expectedCount, message) {
95
- if (message == null) {
96
- message = "";
97
- }
98
- if (message) {
99
- message = ": " + message;
100
- }
101
- assert(count >= expectedCount, "missing argument" + message, "MISSING_ARGUMENT", {
102
- count,
103
- expectedCount
104
- });
105
- assert(count <= expectedCount, "too many arguments" + message, "UNEXPECTED_ARGUMENT", {
106
- count,
107
- expectedCount
108
- });
109
- }
110
- ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => {
111
- try {
112
- if ("test".normalize(form) !== "test") {
113
- throw new Error("bad");
114
- }
115
- ;
116
- if (form === "NFD") {
117
- const check = String.fromCharCode(233).normalize("NFD");
118
- const expected = String.fromCharCode(101, 769);
119
- if (check !== expected) {
120
- throw new Error("broken");
121
- }
122
- }
123
- accum.push(form);
124
- } catch (error) {
125
- }
126
- return accum;
127
- }, []);
128
- function assertPrivate(givenGuard, guard, className) {
129
- if (className == null) {
130
- className = "";
131
- }
132
- if (givenGuard !== guard) {
133
- let method = className, operation = "new";
134
- if (className) {
135
- method += ".";
136
- operation += " " + className;
137
- }
138
- assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", {
139
- operation
140
- });
17
+ function output(out, instance) {
18
+ bytes(out);
19
+ const min = instance.outputLen;
20
+ if (out.length < min) {
21
+ throw new Error(`digestInto() expects output buffer of length at least ${min}`);
141
22
  }
142
23
  }
143
24
  export {
144
- assert,
145
- assertArgument,
146
- assertArgumentCount,
147
- assertPrivate,
148
- isError,
149
- makeError
25
+ bytes,
26
+ exists,
27
+ number,
28
+ output
150
29
  };
151
30
  //# sourceMappingURL=standards-sdk.es59.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es59.js","sources":["../../node_modules/ethers/lib.esm/utils/errors.js"],"sourcesContent":["/**\n * All errors in ethers include properties to ensure they are both\n * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``).\n *\n * The [[isError]] function can be used to check the error ``code`` and\n * provide a type guard for the properties present on that error interface.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + (value.map(stringify)).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof (value) === \"object\" && typeof (value.toJSON) === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof (value)) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return (value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return \"{ \" + keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") + \" }\";\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by ethers\n * that matches the error %%code%%.\n *\n * In TypeScript environments, this can be used to check that %%error%%\n * matches an EthersError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return (error && error.code === code);\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format ethers emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties\n * for the corresponding EthersError.\n *\n * Each error in ethers includes the version of ethers, a\n * machine-readable [[ErrorCode]], and depending on %%code%%, additional\n * required properties. The error message will also include the %%message%%,\n * ethers version, %%code%% and all additional properties, serialized.\n */\nexport function makeError(message, code, info) {\n let shortMessage = message;\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n if (key === \"shortMessage\") {\n continue;\n }\n const value = (info[key]);\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n if (error.shortMessage == null) {\n defineProperties(error, { shortMessage });\n }\n return error;\n}\n/**\n * Throws an EthersError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing argument\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount\n });\n assert(count <= expectedCount, \"too many arguments\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n ;\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\", info: { form }\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation\n });\n }\n}\n//# sourceMappingURL=errors.js.map"],"names":[],"mappings":";;AAWA,SAAS,UAAU,OAAO;AACtB,MAAI,SAAS,MAAM;AACf,WAAO;AAAA,EACf;AACI,MAAI,MAAM,QAAQ,KAAK,GAAG;AACtB,WAAO,OAAQ,MAAM,IAAI,SAAS,EAAG,KAAK,IAAI,IAAI;AAAA,EAC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A,QAAI,OAAO,UAAU,IAAI,MAAM,QAAQ;AACnC,YAAM,IAAI,MAAM,KAAK;AAAA,IACjC;AACQ;AAEA,QAAI,SAAS,OAAO;AAChB,YAAM,QAAQ,OAAO,aAAa,GAAI,EAAE,UAAU,KAAK;AACvD,YAAM,WAAW,OAAO,aAAa,KAAM,GAAM;AAEjD,UAAI,UAAU,UAAU;AACpB,cAAM,IAAI,MAAM,QAAQ;AAAA,MACxC;AAAA,IAEA;AACQ,UAAM,KAAK,IAAI;AAAA,EACvB,SACW,OAAO;AAAA,EAAA;AACd,SAAO;AACX,GAAG,CAAE,CAAA;AAeE,SAAS,cAAc,YAAY,OAAO,WAAW;AACxD,MAAI,aAAa,MAAM;AACnB,gBAAY;AAAA,EACpB;AACI,MAAI,eAAe,OAAO;AACtB,QAAI,SAAS,WAAW,YAAY;AACpC,QAAI,WAAW;AACX,gBAAU;AACV,mBAAa,MAAM;AAAA,IAC/B;AACQ,WAAO,OAAO,4BAA4B,MAAM,iBAAiB,yBAAyB;AAAA,MACtF;AAAA,IACZ,CAAS;AAAA,EACT;AACA;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es59.js","sources":["../../node_modules/@noble/hashes/esm/_assert.js"],"sourcesContent":["function number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`Wrong positive integer: ${n}`);\n}\nfunction bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`Expected boolean, not ${b}`);\n}\nfunction bytes(b, ...lengths) {\n if (!(b instanceof Uint8Array))\n throw new Error('Expected Uint8Array');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);\n}\nfunction hash(hash) {\n if (typeof hash !== 'function' || typeof hash.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(hash.outputLen);\n number(hash.blockLen);\n}\nfunction exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nfunction output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nexport { number, bool, bytes, hash, exists, output };\nconst assert = { number, bool, bytes, hash, exists, output };\nexport default assert;\n//# sourceMappingURL=_assert.js.map"],"names":[],"mappings":"AAAA,SAAS,OAAO,GAAG;AACf,MAAI,CAAC,OAAO,cAAc,CAAC,KAAK,IAAI;AAChC,UAAM,IAAI,MAAM,2BAA2B,CAAC,EAAE;AACtD;AAKA,SAAS,MAAM,MAAM,SAAS;AAC1B,MAAI,EAAE,aAAa;AACf,UAAM,IAAI,MAAM,qBAAqB;AACzC,MAAI,QAAQ,SAAS,KAAK,CAAC,QAAQ,SAAS,EAAE,MAAM;AAChD,UAAM,IAAI,MAAM,iCAAiC,OAAO,mBAAmB,EAAE,MAAM,EAAE;AAC7F;AAOA,SAAS,OAAO,UAAU,gBAAgB,MAAM;AAC5C,MAAI,SAAS;AACT,UAAM,IAAI,MAAM,kCAAkC;AACtD,MAAI,iBAAiB,SAAS;AAC1B,UAAM,IAAI,MAAM,uCAAuC;AAC/D;AACA,SAAS,OAAO,KAAK,UAAU;AAC3B,QAAM,GAAG;AACT,QAAM,MAAM,SAAS;AACrB,MAAI,IAAI,SAAS,KAAK;AAClB,UAAM,IAAI,MAAM,yDAAyD,GAAG,EAAE;AAAA,EACtF;AACA;","x_google_ignoreList":[0]}
@@ -1,94 +1,29 @@
1
- import { assert, assertArgument } from "./standards-sdk.es59.js";
2
- function _getBytes(value, name, copy) {
3
- if (value instanceof Uint8Array) {
4
- if (copy) {
5
- return new Uint8Array(value);
6
- }
7
- return value;
8
- }
9
- if (typeof value === "string" && value.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)) {
10
- const result = new Uint8Array((value.length - 2) / 2);
11
- let offset = 2;
12
- for (let i = 0; i < result.length; i++) {
13
- result[i] = parseInt(value.substring(offset, offset + 2), 16);
14
- offset += 2;
15
- }
16
- return result;
17
- }
18
- assertArgument(false, "invalid BytesLike value", name || "value", value);
19
- }
20
- function getBytes(value, name) {
21
- return _getBytes(value, name, false);
22
- }
23
- function getBytesCopy(value, name) {
24
- return _getBytes(value, name, true);
25
- }
26
- function isHexString(value, length) {
27
- if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) {
28
- return false;
29
- }
30
- if (typeof length === "number" && value.length !== 2 + 2 * length) {
31
- return false;
32
- }
33
- if (length === true && value.length % 2 !== 0) {
34
- return false;
35
- }
36
- return true;
37
- }
38
- const HexCharacters = "0123456789abcdef";
39
- function hexlify(data) {
40
- const bytes = getBytes(data);
41
- let result = "0x";
42
- for (let i = 0; i < bytes.length; i++) {
43
- const v = bytes[i];
44
- result += HexCharacters[(v & 240) >> 4] + HexCharacters[v & 15];
45
- }
46
- return result;
47
- }
48
- function concat(datas) {
49
- return "0x" + datas.map((d) => hexlify(d).substring(2)).join("");
50
- }
51
- function dataSlice(data, start, end) {
52
- const bytes = getBytes(data);
53
- if (end != null && end > bytes.length) {
54
- assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", {
55
- buffer: bytes,
56
- length: bytes.length,
57
- offset: end
58
- });
59
- }
60
- return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end));
61
- }
62
- function zeroPad(data, length, left) {
63
- const bytes = getBytes(data);
64
- assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", {
65
- buffer: new Uint8Array(bytes),
66
- length,
67
- offset: length + 1
68
- });
69
- const result = new Uint8Array(length);
70
- result.fill(0);
71
- if (left) {
72
- result.set(bytes, length - bytes.length);
73
- } else {
74
- result.set(bytes, 0);
75
- }
76
- return hexlify(result);
77
- }
78
- function zeroPadValue(data, length) {
79
- return zeroPad(data, length, true);
80
- }
81
- function zeroPadBytes(data, length) {
82
- return zeroPad(data, length, false);
83
- }
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];
14
+ }
15
+ return [Ah, Al];
16
+ }
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;
84
21
  export {
85
- concat,
86
- dataSlice,
87
- getBytes,
88
- getBytesCopy,
89
- hexlify,
90
- isHexString,
91
- zeroPadBytes,
92
- zeroPadValue
22
+ fromBig,
23
+ rotlBH,
24
+ rotlBL,
25
+ rotlSH,
26
+ rotlSL,
27
+ split
93
28
  };
94
29
  //# sourceMappingURL=standards-sdk.es60.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es60.js","sources":["../../node_modules/ethers/lib.esm/utils/data.js"],"sourcesContent":["/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { assert, assertArgument } from \"./errors.js\";\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof (value) === \"string\" && value.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof (value) !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof (length) === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && (value.length % 2) !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return (isHexString(value, true) || (value instanceof Uint8Array));\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(data) {\n const bytes = getBytes(data);\n let result = \"0x\";\n for (let i = 0; i < bytes.length; i++) {\n const v = bytes[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(datas) {\n return \"0x\" + datas.map((d) => hexlify(d).substring(2)).join(\"\");\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes, length: bytes.length, offset: end\n });\n }\n return hexlify(bytes.slice((start == null) ? 0 : start, (end == null) ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\n//# sourceMappingURL=data.js.map"],"names":[],"mappings":";AAOA,SAAS,UAAU,OAAO,MAAM,MAAM;AAClC,MAAI,iBAAiB,YAAY;AAC7B,QAAI,MAAM;AACN,aAAO,IAAI,WAAW,KAAK;AAAA,I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OAAO,KAAK;AACxC,QAAM,QAAQ,SAAS,IAAI;AAC3B,MAAI,OAAO,QAAQ,MAAM,MAAM,QAAQ;AACnC,WAAO,OAAO,mCAAmC,kBAAkB;AAAA,MAC/D,QAAQ;AAAA,MAAO,QAAQ,MAAM;AAAA,MAAQ,QAAQ;AAAA,IACzD,CAAS;AAAA,EACT;AACI,SAAO,QAAQ,MAAM,MAAO,SAAS,OAAQ,IAAI,OAAQ,OAAO,OAAQ,MAAM,SAAS,GAAG,CAAC;AAC/F;AAYA,SAAS,QAAQ,MAAM,QAAQ,MAAM;AACjC,QAAM,QAAQ,SAAS,IAAI;AAC3B,SAAO,UAAU,MAAM,QAAQ,+BAA+B,kBAAkB;AAAA,IAC5E,QAAQ,IAAI,WAAW,KAAK;AAAA,IAC5B;AAAA,IACA,QAAQ,SAAS;AAAA,EACzB,CAAK;AACD,QAAM,SAAS,IAAI,WAAW,MAAM;AACpC,SAAO,KAAK,CAAC;AACb,MAAI,MAAM;AACN,WAAO,IAAI,OAAO,SAAS,MAAM,MAAM;AAAA,EAC/C,OACS;AACD,WAAO,IAAI,OAAO,CAAC;AAAA,EAC3B;AACI,SAAO,QAAQ,MAAM;AACzB;AAWO,SAAS,aAAa,MAAM,QAAQ;AACvC,SAAO,QAAQ,MAAM,QAAQ,IAAI;AACrC;AAWO,SAAS,aAAa,MAAM,QAAQ;AACvC,SAAO,QAAQ,MAAM,QAAQ,KAAK;AACtC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es60.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,198 +1,41 @@
1
- var __typeError = (msg) => {
2
- throw TypeError(msg);
3
- };
4
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
5
- 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);
6
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
7
- var _AbiCoder_instances, getCoder_fn;
8
- import { Writer, Reader } from "./standards-sdk.es62.js";
9
- import { AddressCoder } from "./standards-sdk.es63.js";
10
- import { ArrayCoder } from "./standards-sdk.es64.js";
11
- import { BooleanCoder } from "./standards-sdk.es65.js";
12
- import { BytesCoder } from "./standards-sdk.es66.js";
13
- import { FixedBytesCoder } from "./standards-sdk.es67.js";
14
- import { NullCoder } from "./standards-sdk.es68.js";
15
- import { NumberCoder } from "./standards-sdk.es69.js";
16
- import { StringCoder } from "./standards-sdk.es70.js";
17
- import { TupleCoder } from "./standards-sdk.es71.js";
18
- import { ParamType } from "./standards-sdk.es72.js";
19
- import { assertArgument, assertArgumentCount, makeError } from "./standards-sdk.es59.js";
20
- import { getBytes, hexlify } from "./standards-sdk.es60.js";
21
- import { getAddress } from "./standards-sdk.es57.js";
22
- const PanicReasons = /* @__PURE__ */ new Map();
23
- PanicReasons.set(0, "GENERIC_PANIC");
24
- PanicReasons.set(1, "ASSERT_FALSE");
25
- PanicReasons.set(17, "OVERFLOW");
26
- PanicReasons.set(18, "DIVIDE_BY_ZERO");
27
- PanicReasons.set(33, "ENUM_RANGE_ERROR");
28
- PanicReasons.set(34, "BAD_STORAGE_DATA");
29
- PanicReasons.set(49, "STACK_UNDERFLOW");
30
- PanicReasons.set(50, "ARRAY_RANGE_ERROR");
31
- PanicReasons.set(65, "OUT_OF_MEMORY");
32
- PanicReasons.set(81, "UNINITIALIZED_FUNCTION_CALL");
33
- const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);
34
- const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);
35
- let defaultCoder = null;
36
- let defaultMaxInflation = 1024;
37
- function getBuiltinCallException(action, tx, data, abiCoder) {
38
- let message = "missing revert data";
39
- let reason = null;
40
- const invocation = null;
41
- let revert = null;
42
- if (data) {
43
- message = "execution reverted";
44
- const bytes = getBytes(data);
45
- data = hexlify(data);
46
- if (bytes.length === 0) {
47
- message += " (no data present; likely require(false) occurred";
48
- reason = "require(false)";
49
- } else if (bytes.length % 32 !== 4) {
50
- message += " (could not decode reason; invalid data length)";
51
- } else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") {
52
- try {
53
- reason = abiCoder.decode(["string"], bytes.slice(4))[0];
54
- revert = {
55
- signature: "Error(string)",
56
- name: "Error",
57
- args: [reason]
58
- };
59
- message += `: ${JSON.stringify(reason)}`;
60
- } catch (error) {
61
- message += " (could not decode reason; invalid string data)";
62
- }
63
- } else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") {
64
- try {
65
- const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]);
66
- revert = {
67
- signature: "Panic(uint256)",
68
- name: "Panic",
69
- args: [code]
70
- };
71
- reason = `Panic due to ${PanicReasons.get(code) || "UNKNOWN"}(${code})`;
72
- message += `: ${reason}`;
73
- } catch (error) {
74
- message += " (could not decode panic code)";
75
- }
76
- } else {
77
- message += " (unknown custom error)";
78
- }
79
- }
80
- const transaction = {
81
- to: tx.to ? getAddress(tx.to) : null,
82
- data: tx.data || "0x"
83
- };
84
- if (tx.from) {
85
- transaction.from = getAddress(tx.from);
86
- }
87
- return makeError(message, "CALL_EXCEPTION", {
88
- action,
89
- data,
90
- reason,
91
- transaction,
92
- invocation,
93
- revert
94
- });
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));
95
11
  }
96
- const _AbiCoder = class _AbiCoder {
97
- constructor() {
98
- __privateAdd(this, _AbiCoder_instances);
99
- }
100
- /**
101
- * Get the default values for the given %%types%%.
102
- *
103
- * For example, a ``uint`` is by default ``0`` and ``bool``
104
- * is by default ``false``.
105
- */
106
- getDefaultValue(types) {
107
- const coders = types.map((type) => __privateMethod(this, _AbiCoder_instances, getCoder_fn).call(this, ParamType.from(type)));
108
- const coder = new TupleCoder(coders, "_");
109
- return coder.defaultValue();
110
- }
111
- /**
112
- * Encode the %%values%% as the %%types%% into ABI data.
113
- *
114
- * @returns DataHexstring
115
- */
116
- encode(types, values) {
117
- assertArgumentCount(values.length, types.length, "types/values length mismatch");
118
- const coders = types.map((type) => __privateMethod(this, _AbiCoder_instances, getCoder_fn).call(this, ParamType.from(type)));
119
- const coder = new TupleCoder(coders, "_");
120
- const writer = new Writer();
121
- coder.encode(writer, values);
122
- return writer.data;
123
- }
124
- /**
125
- * Decode the ABI %%data%% as the %%types%% into values.
126
- *
127
- * If %%loose%% decoding is enabled, then strict padding is
128
- * not enforced. Some older versions of Solidity incorrectly
129
- * padded event data emitted from ``external`` functions.
130
- */
131
- decode(types, data, loose) {
132
- const coders = types.map((type) => __privateMethod(this, _AbiCoder_instances, getCoder_fn).call(this, ParamType.from(type)));
133
- const coder = new TupleCoder(coders, "_");
134
- return coder.decode(new Reader(data, loose, defaultMaxInflation));
135
- }
136
- static _setDefaultMaxInflation(value) {
137
- assertArgument(typeof value === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value);
138
- defaultMaxInflation = value;
139
- }
140
- /**
141
- * Returns the shared singleton instance of a default [[AbiCoder]].
142
- *
143
- * On the first call, the instance is created internally.
144
- */
145
- static defaultAbiCoder() {
146
- if (defaultCoder == null) {
147
- defaultCoder = new _AbiCoder();
148
- }
149
- return defaultCoder;
150
- }
151
- /**
152
- * Returns an ethers-compatible [[CallExceptionError]] Error for the given
153
- * result %%data%% for the [[CallExceptionAction]] %%action%% against
154
- * the Transaction %%tx%%.
155
- */
156
- static getBuiltinCallException(action, tx, data) {
157
- return getBuiltinCallException(action, tx, data, _AbiCoder.defaultAbiCoder());
158
- }
159
- };
160
- _AbiCoder_instances = new WeakSet();
161
- getCoder_fn = function(param) {
162
- if (param.isArray()) {
163
- return new ArrayCoder(__privateMethod(this, _AbiCoder_instances, getCoder_fn).call(this, param.arrayChildren), param.arrayLength, param.name);
164
- }
165
- if (param.isTuple()) {
166
- return new TupleCoder(param.components.map((c) => __privateMethod(this, _AbiCoder_instances, getCoder_fn).call(this, c)), param.name);
167
- }
168
- switch (param.baseType) {
169
- case "address":
170
- return new AddressCoder(param.name);
171
- case "bool":
172
- return new BooleanCoder(param.name);
173
- case "string":
174
- return new StringCoder(param.name);
175
- case "bytes":
176
- return new BytesCoder(param.name);
177
- case "":
178
- return new NullCoder(param.name);
179
- }
180
- let match = param.type.match(paramTypeNumber);
181
- if (match) {
182
- let size = parseInt(match[2] || "256");
183
- assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid " + match[1] + " bit length", "param", param);
184
- return new NumberCoder(size / 8, match[1] === "int", param.name);
185
- }
186
- match = param.type.match(paramTypeBytes);
187
- if (match) {
188
- let size = parseInt(match[1]);
189
- assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param);
190
- return new FixedBytesCoder(size, param.name);
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();
191
23
  }
192
- assertArgument(false, "invalid type", "type", param.type);
193
- };
194
- let AbiCoder = _AbiCoder;
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
+ }
195
33
  export {
196
- AbiCoder
34
+ Hash,
35
+ isLE,
36
+ toBytes,
37
+ u32,
38
+ utf8ToBytes,
39
+ wrapConstructor
197
40
  };
198
41
  //# sourceMappingURL=standards-sdk.es61.js.map