@hashgraphonline/standards-sdk 0.0.102 → 0.0.104

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 (219) hide show
  1. package/dist/es/services/mirror-node.d.ts +1 -1
  2. package/dist/es/services/mirror-node.d.ts.map +1 -1
  3. package/dist/es/standards-sdk.es100.js +4 -10
  4. package/dist/es/standards-sdk.es100.js.map +1 -1
  5. package/dist/es/standards-sdk.es101.js +39 -18
  6. package/dist/es/standards-sdk.es101.js.map +1 -1
  7. package/dist/es/standards-sdk.es102.js +39 -5
  8. package/dist/es/standards-sdk.es102.js.map +1 -1
  9. package/dist/es/standards-sdk.es103.js +37 -9
  10. package/dist/es/standards-sdk.es103.js.map +1 -1
  11. package/dist/es/standards-sdk.es104.js +77 -12
  12. package/dist/es/standards-sdk.es104.js.map +1 -1
  13. package/dist/es/standards-sdk.es105.js +21 -13
  14. package/dist/es/standards-sdk.es105.js.map +1 -1
  15. package/dist/es/standards-sdk.es106.js +25 -30
  16. package/dist/es/standards-sdk.es106.js.map +1 -1
  17. package/dist/es/standards-sdk.es107.js +25 -14
  18. package/dist/es/standards-sdk.es107.js.map +1 -1
  19. package/dist/es/standards-sdk.es108.js +37 -3
  20. package/dist/es/standards-sdk.es108.js.map +1 -1
  21. package/dist/es/standards-sdk.es109.js +33 -3
  22. package/dist/es/standards-sdk.es109.js.map +1 -1
  23. package/dist/es/standards-sdk.es110.js +32 -15
  24. package/dist/es/standards-sdk.es110.js.map +1 -1
  25. package/dist/es/standards-sdk.es111.js +9 -5
  26. package/dist/es/standards-sdk.es111.js.map +1 -1
  27. package/dist/es/standards-sdk.es112.js +34 -39
  28. package/dist/es/standards-sdk.es112.js.map +1 -1
  29. package/dist/es/standards-sdk.es113.js +3 -40
  30. package/dist/es/standards-sdk.es113.js.map +1 -1
  31. package/dist/es/standards-sdk.es114.js +2 -37
  32. package/dist/es/standards-sdk.es114.js.map +1 -1
  33. package/dist/es/standards-sdk.es115.js +2 -78
  34. package/dist/es/standards-sdk.es115.js.map +1 -1
  35. package/dist/es/standards-sdk.es116.js +7092 -375
  36. package/dist/es/standards-sdk.es116.js.map +1 -1
  37. package/dist/es/standards-sdk.es117.js +101 -2
  38. package/dist/es/standards-sdk.es117.js.map +1 -1
  39. package/dist/es/standards-sdk.es118.js +2 -120
  40. package/dist/es/standards-sdk.es118.js.map +1 -1
  41. package/dist/es/standards-sdk.es119.js +16 -3
  42. package/dist/es/standards-sdk.es119.js.map +1 -1
  43. package/dist/es/standards-sdk.es120.js +409 -2
  44. package/dist/es/standards-sdk.es120.js.map +1 -1
  45. package/dist/es/standards-sdk.es121.js +2282 -2
  46. package/dist/es/standards-sdk.es121.js.map +1 -1
  47. package/dist/es/standards-sdk.es122.js +9 -33
  48. package/dist/es/standards-sdk.es122.js.map +1 -1
  49. package/dist/es/standards-sdk.es123.js +10 -32
  50. package/dist/es/standards-sdk.es123.js.map +1 -1
  51. package/dist/es/standards-sdk.es124.js +18 -9
  52. package/dist/es/standards-sdk.es124.js.map +1 -1
  53. package/dist/es/standards-sdk.es125.js +5 -33
  54. package/dist/es/standards-sdk.es125.js.map +1 -1
  55. package/dist/es/standards-sdk.es126.js +8 -3
  56. package/dist/es/standards-sdk.es126.js.map +1 -1
  57. package/dist/es/standards-sdk.es13.js +3 -3
  58. package/dist/es/standards-sdk.es15.js +1 -1
  59. package/dist/es/standards-sdk.es19.js +2 -2
  60. package/dist/es/standards-sdk.es20.js +2 -2
  61. package/dist/es/standards-sdk.es21.js +10 -14
  62. package/dist/es/standards-sdk.es21.js.map +1 -1
  63. package/dist/es/standards-sdk.es24.js +10 -10
  64. package/dist/es/standards-sdk.es25.js +5 -1769
  65. package/dist/es/standards-sdk.es25.js.map +1 -1
  66. package/dist/es/standards-sdk.es27.js +17 -17
  67. package/dist/es/standards-sdk.es28.js +122 -5543
  68. package/dist/es/standards-sdk.es28.js.map +1 -1
  69. package/dist/es/standards-sdk.es29.js +10 -3
  70. package/dist/es/standards-sdk.es29.js.map +1 -1
  71. package/dist/es/standards-sdk.es30.js +7189 -8
  72. package/dist/es/standards-sdk.es30.js.map +1 -1
  73. package/dist/es/standards-sdk.es31.js +3 -2
  74. package/dist/es/standards-sdk.es31.js.map +1 -1
  75. package/dist/es/standards-sdk.es32.js +8 -4167
  76. package/dist/es/standards-sdk.es32.js.map +1 -1
  77. package/dist/es/standards-sdk.es33.js +2 -5
  78. package/dist/es/standards-sdk.es33.js.map +1 -1
  79. package/dist/es/standards-sdk.es34.js +4166 -8
  80. package/dist/es/standards-sdk.es34.js.map +1 -1
  81. package/dist/es/standards-sdk.es35.js +419 -2
  82. package/dist/es/standards-sdk.es35.js.map +1 -1
  83. package/dist/es/standards-sdk.es36.js +2 -84
  84. package/dist/es/standards-sdk.es36.js.map +1 -1
  85. package/dist/es/standards-sdk.es37.js +119 -22
  86. package/dist/es/standards-sdk.es37.js.map +1 -1
  87. package/dist/es/standards-sdk.es38.js +3 -147
  88. package/dist/es/standards-sdk.es38.js.map +1 -1
  89. package/dist/es/standards-sdk.es39.js +350 -77
  90. package/dist/es/standards-sdk.es39.js.map +1 -1
  91. package/dist/es/standards-sdk.es40.js +5 -173
  92. package/dist/es/standards-sdk.es40.js.map +1 -1
  93. package/dist/es/standards-sdk.es41.js +178 -5
  94. package/dist/es/standards-sdk.es41.js.map +1 -1
  95. package/dist/es/standards-sdk.es42.js +72 -134
  96. package/dist/es/standards-sdk.es42.js.map +1 -1
  97. package/dist/es/standards-sdk.es43.js +105 -186
  98. package/dist/es/standards-sdk.es43.js.map +1 -1
  99. package/dist/es/standards-sdk.es44.js +47 -433
  100. package/dist/es/standards-sdk.es44.js.map +1 -1
  101. package/dist/es/standards-sdk.es45.js +9 -24
  102. package/dist/es/standards-sdk.es45.js.map +1 -1
  103. package/dist/es/standards-sdk.es46.js +84 -126
  104. package/dist/es/standards-sdk.es46.js.map +1 -1
  105. package/dist/es/standards-sdk.es47.js +3 -17
  106. package/dist/es/standards-sdk.es47.js.map +1 -1
  107. package/dist/es/standards-sdk.es48.js +2 -29
  108. package/dist/es/standards-sdk.es48.js.map +1 -1
  109. package/dist/es/standards-sdk.es49.js +107 -23
  110. package/dist/es/standards-sdk.es49.js.map +1 -1
  111. package/dist/es/standards-sdk.es5.js +1 -1
  112. package/dist/es/standards-sdk.es50.js +71 -18
  113. package/dist/es/standards-sdk.es50.js.map +1 -1
  114. package/dist/es/standards-sdk.es51.js +5 -43
  115. package/dist/es/standards-sdk.es51.js.map +1 -1
  116. package/dist/es/standards-sdk.es52.js +4 -17
  117. package/dist/es/standards-sdk.es52.js.map +1 -1
  118. package/dist/es/standards-sdk.es53.js +209 -49
  119. package/dist/es/standards-sdk.es53.js.map +1 -1
  120. package/dist/es/standards-sdk.es54.js +49 -1280
  121. package/dist/es/standards-sdk.es54.js.map +1 -1
  122. package/dist/es/standards-sdk.es55.js +69 -32
  123. package/dist/es/standards-sdk.es55.js.map +1 -1
  124. package/dist/es/standards-sdk.es56.js +2 -159
  125. package/dist/es/standards-sdk.es56.js.map +1 -1
  126. package/dist/es/standards-sdk.es57.js +78 -787
  127. package/dist/es/standards-sdk.es57.js.map +1 -1
  128. package/dist/es/standards-sdk.es58.js +19 -360
  129. package/dist/es/standards-sdk.es58.js.map +1 -1
  130. package/dist/es/standards-sdk.es59.js +147 -5
  131. package/dist/es/standards-sdk.es59.js.map +1 -1
  132. package/dist/es/standards-sdk.es60.js +84 -172
  133. package/dist/es/standards-sdk.es60.js.map +1 -1
  134. package/dist/es/standards-sdk.es61.js +3 -81
  135. package/dist/es/standards-sdk.es61.js.map +1 -1
  136. package/dist/es/standards-sdk.es62.js +154 -104
  137. package/dist/es/standards-sdk.es62.js.map +1 -1
  138. package/dist/es/standards-sdk.es63.js +27 -47
  139. package/dist/es/standards-sdk.es63.js.map +1 -1
  140. package/dist/es/standards-sdk.es64.js +62 -9
  141. package/dist/es/standards-sdk.es64.js.map +1 -1
  142. package/dist/es/standards-sdk.es65.js +45 -92
  143. package/dist/es/standards-sdk.es65.js.map +1 -1
  144. package/dist/es/standards-sdk.es66.js +9 -3
  145. package/dist/es/standards-sdk.es66.js.map +1 -1
  146. package/dist/es/standards-sdk.es67.js +65 -2
  147. package/dist/es/standards-sdk.es67.js.map +1 -1
  148. package/dist/es/standards-sdk.es68.js +6 -113
  149. package/dist/es/standards-sdk.es68.js.map +1 -1
  150. package/dist/es/standards-sdk.es69.js +14 -73
  151. package/dist/es/standards-sdk.es69.js.map +1 -1
  152. package/dist/es/standards-sdk.es7.js +4 -4
  153. package/dist/es/standards-sdk.es70.js +7 -6
  154. package/dist/es/standards-sdk.es70.js.map +1 -1
  155. package/dist/es/standards-sdk.es71.js +45 -5
  156. package/dist/es/standards-sdk.es71.js.map +1 -1
  157. package/dist/es/standards-sdk.es72.js +2 -221
  158. package/dist/es/standards-sdk.es72.js.map +1 -1
  159. package/dist/es/standards-sdk.es73.js +130 -52
  160. package/dist/es/standards-sdk.es73.js.map +1 -1
  161. package/dist/es/standards-sdk.es74.js +170 -67
  162. package/dist/es/standards-sdk.es74.js.map +1 -1
  163. package/dist/es/standards-sdk.es75.js +191 -97
  164. package/dist/es/standards-sdk.es75.js.map +1 -1
  165. package/dist/es/standards-sdk.es76.js +438 -2
  166. package/dist/es/standards-sdk.es76.js.map +1 -1
  167. package/dist/es/standards-sdk.es77.js +24 -15
  168. package/dist/es/standards-sdk.es77.js.map +1 -1
  169. package/dist/es/standards-sdk.es78.js +131 -401
  170. package/dist/es/standards-sdk.es78.js.map +1 -1
  171. package/dist/es/standards-sdk.es79.js +16 -25
  172. package/dist/es/standards-sdk.es79.js.map +1 -1
  173. package/dist/es/standards-sdk.es8.js +3 -3
  174. package/dist/es/standards-sdk.es80.js +26 -23
  175. package/dist/es/standards-sdk.es80.js.map +1 -1
  176. package/dist/es/standards-sdk.es81.js +27 -36
  177. package/dist/es/standards-sdk.es81.js.map +1 -1
  178. package/dist/es/standards-sdk.es82.js +13 -13
  179. package/dist/es/standards-sdk.es82.js.map +1 -1
  180. package/dist/es/standards-sdk.es83.js +44 -2282
  181. package/dist/es/standards-sdk.es83.js.map +1 -1
  182. package/dist/es/standards-sdk.es84.js +13 -159
  183. package/dist/es/standards-sdk.es84.js.map +1 -1
  184. package/dist/es/standards-sdk.es85.js +61 -3
  185. package/dist/es/standards-sdk.es85.js.map +1 -1
  186. package/dist/es/standards-sdk.es86.js +1284 -27
  187. package/dist/es/standards-sdk.es86.js.map +1 -1
  188. package/dist/es/standards-sdk.es87.js +27 -58
  189. package/dist/es/standards-sdk.es87.js.map +1 -1
  190. package/dist/es/standards-sdk.es88.js +5 -49
  191. package/dist/es/standards-sdk.es88.js.map +1 -1
  192. package/dist/es/standards-sdk.es89.js +157 -8
  193. package/dist/es/standards-sdk.es89.js.map +1 -1
  194. package/dist/es/standards-sdk.es9.js +1 -1
  195. package/dist/es/standards-sdk.es90.js +787 -59
  196. package/dist/es/standards-sdk.es90.js.map +1 -1
  197. package/dist/es/standards-sdk.es91.js +143 -6
  198. package/dist/es/standards-sdk.es91.js.map +1 -1
  199. package/dist/es/standards-sdk.es92.js +171 -12
  200. package/dist/es/standards-sdk.es92.js.map +1 -1
  201. package/dist/es/standards-sdk.es93.js +10 -4
  202. package/dist/es/standards-sdk.es93.js.map +1 -1
  203. package/dist/es/standards-sdk.es94.js +13 -45
  204. package/dist/es/standards-sdk.es94.js.map +1 -1
  205. package/dist/es/standards-sdk.es95.js +32 -2
  206. package/dist/es/standards-sdk.es95.js.map +1 -1
  207. package/dist/es/standards-sdk.es96.js +14 -135
  208. package/dist/es/standards-sdk.es96.js.map +1 -1
  209. package/dist/es/standards-sdk.es97.js +4 -172
  210. package/dist/es/standards-sdk.es97.js.map +1 -1
  211. package/dist/es/standards-sdk.es98.js +3 -7135
  212. package/dist/es/standards-sdk.es98.js.map +1 -1
  213. package/dist/es/standards-sdk.es99.js +15 -9
  214. package/dist/es/standards-sdk.es99.js.map +1 -1
  215. package/dist/umd/services/mirror-node.d.ts +1 -1
  216. package/dist/umd/services/mirror-node.d.ts.map +1 -1
  217. package/dist/umd/standards-sdk.umd.js +1 -1
  218. package/dist/umd/standards-sdk.umd.js.map +1 -1
  219. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es121.js","sources":["../../node_modules/axios/lib/platform/browser/classes/Blob.js"],"sourcesContent":["'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n"],"names":[],"mappings":"AAEA,MAAA,SAAe,OAAO,SAAS,cAAc,OAAO;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es121.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,37 +1,13 @@
1
- function speedometer(samplesCount, min) {
2
- samplesCount = samplesCount || 10;
3
- const bytes = new Array(samplesCount);
4
- const timestamps = new Array(samplesCount);
5
- let head = 0;
6
- let tail = 0;
7
- let firstSampleTS;
8
- min = min !== void 0 ? min : 1e3;
9
- return function push(chunkLength) {
10
- const now = Date.now();
11
- const startedAt = timestamps[tail];
12
- if (!firstSampleTS) {
13
- firstSampleTS = now;
14
- }
15
- bytes[head] = chunkLength;
16
- timestamps[head] = now;
17
- let i = tail;
18
- let bytesCount = 0;
19
- while (i !== head) {
20
- bytesCount += bytes[i++];
21
- i = i % samplesCount;
22
- }
23
- head = (head + 1) % samplesCount;
24
- if (head === tail) {
25
- tail = (tail + 1) % samplesCount;
26
- }
27
- if (now - firstSampleTS < min) {
28
- return;
29
- }
30
- const passed = startedAt && now - startedAt;
31
- return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
32
- };
1
+ import toInteger from "./standards-sdk.es123.js";
2
+ import toDate from "./standards-sdk.es124.js";
3
+ import requiredArgs from "./standards-sdk.es125.js";
4
+ function addMilliseconds(dirtyDate, dirtyAmount) {
5
+ requiredArgs(2, arguments);
6
+ var timestamp = toDate(dirtyDate).getTime();
7
+ var amount = toInteger(dirtyAmount);
8
+ return new Date(timestamp + amount);
33
9
  }
34
10
  export {
35
- speedometer as default
11
+ addMilliseconds as default
36
12
  };
37
13
  //# sourceMappingURL=standards-sdk.es122.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es122.js","sources":["../../node_modules/axios/lib/helpers/speedometer.js"],"sourcesContent":["'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n"],"names":[],"mappings":"AAQA,SAAS,YAAY,cAAc,KAAK;AACtC,iBAAe,gBAAgB;AAC/B,QAAM,QAAQ,IAAI,MAAM,YAAY;AACpC,QAAM,aAAa,IAAI,MAAM,YAAY;AACzC,MAAI,OAAO;AACX,MAAI,OAAO;AACX,MAAI;AAEJ,QAAM,QAAQ,SAAY,MAAM;AAEhC,SAAO,SAAS,KAAK,aAAa;AAChC,UAAM,MAAM,KAAK,IAAK;AAEtB,UAAM,YAAY,WAAW,IAAI;AAEjC,QAAI,CAAC,eAAe;AAClB,sBAAgB;AAAA,IACtB;AAEI,UAAM,IAAI,IAAI;AACd,eAAW,IAAI,IAAI;AAEnB,QAAI,IAAI;AACR,QAAI,aAAa;AAEjB,WAAO,MAAM,MAAM;AACjB,oBAAc,MAAM,GAAG;AACvB,UAAI,IAAI;AAAA,IACd;AAEI,YAAQ,OAAO,KAAK;AAEpB,QAAI,SAAS,MAAM;AACjB,cAAQ,OAAO,KAAK;AAAA,IAC1B;AAEI,QAAI,MAAM,gBAAgB,KAAK;AAC7B;AAAA,IACN;AAEI,UAAM,SAAS,aAAa,MAAM;AAElC,WAAO,SAAS,KAAK,MAAM,aAAa,MAAO,MAAM,IAAI;AAAA,EAC1D;AACH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es122.js","sources":["../../node_modules/date-fns/esm/addMilliseconds/index.js"],"sourcesContent":["import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var timestamp = toDate(dirtyDate).getTime();\n var amount = toInteger(dirtyAmount);\n return new Date(timestamp + amount);\n}"],"names":[],"mappings":";;;AAqBe,SAAS,gBAAgB,WAAW,aAAa;AAC9D,eAAa,GAAG,SAAS;AACzB,MAAI,YAAY,OAAO,SAAS,EAAE,QAAS;AAC3C,MAAI,SAAS,UAAU,WAAW;AAClC,SAAO,IAAI,KAAK,YAAY,MAAM;AACpC;","x_google_ignoreList":[0]}
@@ -1,36 +1,14 @@
1
- function throttle(fn, freq) {
2
- let timestamp = 0;
3
- let threshold = 1e3 / freq;
4
- let lastArgs;
5
- let timer;
6
- const invoke = (args, now = Date.now()) => {
7
- timestamp = now;
8
- lastArgs = null;
9
- if (timer) {
10
- clearTimeout(timer);
11
- timer = null;
12
- }
13
- fn.apply(null, args);
14
- };
15
- const throttled = (...args) => {
16
- const now = Date.now();
17
- const passed = now - timestamp;
18
- if (passed >= threshold) {
19
- invoke(args, now);
20
- } else {
21
- lastArgs = args;
22
- if (!timer) {
23
- timer = setTimeout(() => {
24
- timer = null;
25
- invoke(lastArgs);
26
- }, threshold - passed);
27
- }
28
- }
29
- };
30
- const flush = () => lastArgs && invoke(lastArgs);
31
- return [throttled, flush];
1
+ function toInteger(dirtyNumber) {
2
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
3
+ return NaN;
4
+ }
5
+ var number = Number(dirtyNumber);
6
+ if (isNaN(number)) {
7
+ return number;
8
+ }
9
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
32
10
  }
33
11
  export {
34
- throttle as default
12
+ toInteger as default
35
13
  };
36
14
  //# sourceMappingURL=standards-sdk.es123.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es123.js","sources":["../../node_modules/axios/lib/helpers/throttle.js"],"sourcesContent":["/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn.apply(null, args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n"],"names":[],"mappings":"AAMA,SAAS,SAAS,IAAI,MAAM;AAC1B,MAAI,YAAY;AAChB,MAAI,YAAY,MAAO;AACvB,MAAI;AACJ,MAAI;AAEJ,QAAM,SAAS,CAAC,MAAM,MAAM,KAAK,IAAG,MAAO;AACzC,gBAAY;AACZ,eAAW;AACX,QAAI,OAAO;AACT,mBAAa,KAAK;AAClB,cAAQ;AAAA,IACd;AACI,OAAG,MAAM,MAAM,IAAI;AAAA,EACvB;AAEE,QAAM,YAAY,IAAI,SAAS;AAC7B,UAAM,MAAM,KAAK,IAAK;AACtB,UAAM,SAAS,MAAM;AACrB,QAAK,UAAU,WAAW;AACxB,aAAO,MAAM,GAAG;AAAA,IACtB,OAAW;AACL,iBAAW;AACX,UAAI,CAAC,OAAO;AACV,gBAAQ,WAAW,MAAM;AACvB,kBAAQ;AACR,iBAAO,QAAQ;AAAA,QACzB,GAAW,YAAY,MAAM;AAAA,MAC7B;AAAA,IACA;AAAA,EACA;AAEE,QAAM,QAAQ,MAAM,YAAY,OAAO,QAAQ;AAE/C,SAAO,CAAC,WAAW,KAAK;AAC1B;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es123.js","sources":["../../node_modules/date-fns/esm/_lib/toInteger/index.js"],"sourcesContent":["export default function toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n var number = Number(dirtyNumber);\n if (isNaN(number)) {\n return number;\n }\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}"],"names":[],"mappings":"AAAe,SAAS,UAAU,aAAa;AAC7C,MAAI,gBAAgB,QAAQ,gBAAgB,QAAQ,gBAAgB,OAAO;AACzE,WAAO;AAAA,EACX;AACE,MAAI,SAAS,OAAO,WAAW;AAC/B,MAAI,MAAM,MAAM,GAAG;AACjB,WAAO;AAAA,EACX;AACE,SAAO,SAAS,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,MAAM,MAAM;AAC3D;","x_google_ignoreList":[0]}
@@ -1,12 +1,21 @@
1
- import platform from "./standards-sdk.es93.js";
2
- const isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin, isMSIE) => (url) => {
3
- url = new URL(url, platform.origin);
4
- return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
5
- })(
6
- new URL(platform.origin),
7
- platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
8
- ) : () => true;
1
+ import _typeof from "./standards-sdk.es126.js";
2
+ import requiredArgs from "./standards-sdk.es125.js";
3
+ function toDate(argument) {
4
+ requiredArgs(1, arguments);
5
+ var argStr = Object.prototype.toString.call(argument);
6
+ if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") {
7
+ return new Date(argument.getTime());
8
+ } else if (typeof argument === "number" || argStr === "[object Number]") {
9
+ return new Date(argument);
10
+ } else {
11
+ if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
12
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
13
+ console.warn(new Error().stack);
14
+ }
15
+ return /* @__PURE__ */ new Date(NaN);
16
+ }
17
+ }
9
18
  export {
10
- isURLSameOrigin as default
19
+ toDate as default
11
20
  };
12
21
  //# sourceMappingURL=standards-sdk.es124.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es124.js","sources":["../../node_modules/axios/lib/helpers/isURLSameOrigin.js"],"sourcesContent":["import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n"],"names":[],"mappings":";AAEA,MAAA,kBAAe,SAAS,wBAAyB,kBAAC,QAAQ,WAAW,CAAC,QAAQ;AAC5E,QAAM,IAAI,IAAI,KAAK,SAAS,MAAM;AAElC,SACE,OAAO,aAAa,IAAI,YACxB,OAAO,SAAS,IAAI,SACnB,UAAU,OAAO,SAAS,IAAI;AAEnC;AAAA,EACE,IAAI,IAAI,SAAS,MAAM;AAAA,EACvB,SAAS,aAAa,kBAAkB,KAAK,SAAS,UAAU,SAAS;AAC3E,IAAI,MAAM;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es124.js","sources":["../../node_modules/date-fns/esm/toDate/index.js"],"sourcesContent":["import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments\");\n // eslint-disable-next-line no-console\n console.warn(new Error().stack);\n }\n return new Date(NaN);\n }\n}"],"names":[],"mappings":";;AAgCe,SAAS,OAAO,UAAU;AACvC,eAAa,GAAG,SAAS;AACzB,MAAI,SAAS,OAAO,UAAU,SAAS,KAAK,QAAQ;AAGpD,MAAI,oBAAoB,QAAQ,QAAQ,QAAQ,MAAM,YAAY,WAAW,iBAAiB;AAE5F,WAAO,IAAI,KAAK,SAAS,SAAS;AAAA,EACnC,WAAU,OAAO,aAAa,YAAY,WAAW,mBAAmB;AACvE,WAAO,IAAI,KAAK,QAAQ;AAAA,EAC5B,OAAS;AACL,SAAK,OAAO,aAAa,YAAY,WAAW,sBAAsB,OAAO,YAAY,aAAa;AAEpG,cAAQ,KAAK,oNAAoN;AAEjO,cAAQ,KAAK,IAAI,MAAK,EAAG,KAAK;AAAA,IACpC;AACI,WAAO,oBAAI,KAAK,GAAG;AAAA,EACvB;AACA;","x_google_ignoreList":[0]}
@@ -1,37 +1,9 @@
1
- import utils from "./standards-sdk.es58.js";
2
- import platform from "./standards-sdk.es93.js";
3
- const cookies = platform.hasStandardBrowserEnv ? (
4
- // Standard browser envs support document.cookie
5
- {
6
- write(name, value, expires, path, domain, secure) {
7
- const cookie = [name + "=" + encodeURIComponent(value)];
8
- utils.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
9
- utils.isString(path) && cookie.push("path=" + path);
10
- utils.isString(domain) && cookie.push("domain=" + domain);
11
- secure === true && cookie.push("secure");
12
- document.cookie = cookie.join("; ");
13
- },
14
- read(name) {
15
- const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
16
- return match ? decodeURIComponent(match[3]) : null;
17
- },
18
- remove(name) {
19
- this.write(name, "", Date.now() - 864e5);
20
- }
1
+ function requiredArgs(required, args) {
2
+ if (args.length < required) {
3
+ throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
21
4
  }
22
- ) : (
23
- // Non-standard browser env (web workers, react-native) lack needed support.
24
- {
25
- write() {
26
- },
27
- read() {
28
- return null;
29
- },
30
- remove() {
31
- }
32
- }
33
- );
5
+ }
34
6
  export {
35
- cookies as default
7
+ requiredArgs as default
36
8
  };
37
9
  //# sourceMappingURL=standards-sdk.es125.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es125.js","sources":["../../node_modules/axios/lib/helpers/cookies.js"],"sourcesContent":["import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n"],"names":[],"mappings":";;AAGA,MAAe,UAAA,SAAS;AAAA;AAAA,EAGtB;AAAA,IACE,MAAM,MAAM,OAAO,SAAS,MAAM,QAAQ,QAAQ;AAChD,YAAM,SAAS,CAAC,OAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtD,YAAM,SAAS,OAAO,KAAK,OAAO,KAAK,aAAa,IAAI,KAAK,OAAO,EAAE,YAAW,CAAE;AAEnF,YAAM,SAAS,IAAI,KAAK,OAAO,KAAK,UAAU,IAAI;AAElD,YAAM,SAAS,MAAM,KAAK,OAAO,KAAK,YAAY,MAAM;AAExD,iBAAW,QAAQ,OAAO,KAAK,QAAQ;AAEvC,eAAS,SAAS,OAAO,KAAK,IAAI;AAAA,IACnC;AAAA,IAED,KAAK,MAAM;AACT,YAAM,QAAQ,SAAS,OAAO,MAAM,IAAI,OAAO,eAAe,OAAO,WAAW,CAAC;AACjF,aAAQ,QAAQ,mBAAmB,MAAM,CAAC,CAAC,IAAI;AAAA,IAChD;AAAA,IAED,OAAO,MAAM;AACX,WAAK,MAAM,MAAM,IAAI,KAAK,IAAK,IAAG,KAAQ;AAAA,IAChD;AAAA,EACA;AAAA;AAAA;AAAA,EAKE;AAAA,IACE,QAAQ;AAAA,IAAE;AAAA,IACV,OAAO;AACL,aAAO;AAAA,IACR;AAAA,IACD,SAAS;AAAA,IAAA;AAAA,EACV;AAAA;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es125.js","sources":["../../node_modules/date-fns/esm/_lib/requiredArgs/index.js"],"sourcesContent":["export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}"],"names":[],"mappings":"AAAe,SAAS,aAAa,UAAU,MAAM;AACnD,MAAI,KAAK,SAAS,UAAU;AAC1B,UAAM,IAAI,UAAU,WAAW,eAAe,WAAW,IAAI,MAAM,MAAM,yBAAyB,KAAK,SAAS,UAAU;AAAA,EAC9H;AACA;","x_google_ignoreList":[0]}
@@ -1,7 +1,12 @@
1
- function getDefaultExportFromCjs(x) {
2
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1
+ function _typeof(o) {
2
+ "@babel/helpers - typeof";
3
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
4
+ return typeof o2;
5
+ } : function(o2) {
6
+ return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
7
+ }, _typeof(o);
3
8
  }
4
9
  export {
5
- getDefaultExportFromCjs
10
+ _typeof as default
6
11
  };
7
12
  //# sourceMappingURL=standards-sdk.es126.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es126.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"standards-sdk.es126.js","sources":["../../node_modules/@babel/runtime/helpers/esm/typeof.js"],"sourcesContent":["function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };"],"names":["o"],"mappings":"AAAA,SAAS,QAAQ,GAAG;AAClB;AAEA,SAAO,UAAU,cAAc,OAAO,UAAU,YAAY,OAAO,OAAO,WAAW,SAAUA,IAAG;AAChG,WAAO,OAAOA;AAAA,EACf,IAAG,SAAUA,IAAG;AACf,WAAOA,MAAK,cAAc,OAAO,UAAUA,GAAE,gBAAgB,UAAUA,OAAM,OAAO,YAAY,WAAW,OAAOA;AAAA,EACtH,GAAK,QAAQ,CAAC;AACd;","x_google_ignoreList":[0]}
@@ -1,9 +1,9 @@
1
- import Buffer from "./standards-sdk.es25.js";
1
+ import Buffer from "./standards-sdk.es28.js";
2
2
  import { Client, PrivateKey, Status, AccountUpdateTransaction } from "@hashgraph/sdk";
3
3
  import { inscribeWithSigner, inscribe } from "./standards-sdk.es20.js";
4
4
  import { Logger } from "./standards-sdk.es15.js";
5
- import { m as mimeTypesExports } from "./standards-sdk.es29.js";
6
- import z from "./standards-sdk.es32.js";
5
+ import { m as mimeTypesExports } from "./standards-sdk.es31.js";
6
+ import z from "./standards-sdk.es34.js";
7
7
  import { ProgressReporter } from "./standards-sdk.es17.js";
8
8
  import { HederaMirrorNode } from "./standards-sdk.es21.js";
9
9
  import { AIAgentCapability, AIAgentType, ProfileType, capabilityNameToCapabilityMap } from "./standards-sdk.es14.js";
@@ -1,4 +1,4 @@
1
- import pino from "./standards-sdk.es33.js";
1
+ import pino from "./standards-sdk.es25.js";
2
2
  const _Logger = class _Logger {
3
3
  constructor(options = {}) {
4
4
  const level = options.level || "info";
@@ -1,7 +1,7 @@
1
1
  import { proto } from "@hashgraph/proto";
2
- import { Buffer as Buffer$1 } from "./standards-sdk.es25.js";
2
+ import { Buffer as Buffer$1 } from "./standards-sdk.es28.js";
3
3
  import { Hbar, Long, HbarUnit, AccountId, TokenId, ContractId } from "@hashgraph/sdk";
4
- import { decodeBase64 } from "./standards-sdk.es34.js";
4
+ import { decodeBase64 } from "./standards-sdk.es29.js";
5
5
  class TransactionParser {
6
6
  /**
7
7
  * Parse a base64 encoded transaction body and return structured data
@@ -1,5 +1,5 @@
1
- import Buffer from "./standards-sdk.es25.js";
2
- import { I as InscriptionSDK } from "./standards-sdk.es28.js";
1
+ import Buffer from "./standards-sdk.es28.js";
2
+ import { I as InscriptionSDK } from "./standards-sdk.es30.js";
3
3
  import { Logger } from "./standards-sdk.es15.js";
4
4
  import { ProgressReporter } from "./standards-sdk.es17.js";
5
5
  async function inscribe(input, clientConfig, options, existingSDK) {
@@ -1,6 +1,7 @@
1
- import Buffer from "./standards-sdk.es25.js";
1
+ import Buffer from "./standards-sdk.es28.js";
2
2
  import { PublicKey, Timestamp, AccountId } from "@hashgraph/sdk";
3
3
  import "./standards-sdk.es26.js";
4
+ import { Logger } from "./standards-sdk.es15.js";
4
5
  import { proto } from "@hashgraph/proto";
5
6
  import axios from "./standards-sdk.es27.js";
6
7
  class HederaMirrorNode {
@@ -11,7 +12,10 @@ class HederaMirrorNode {
11
12
  this.backoffFactor = 2;
12
13
  this.network = network;
13
14
  this.baseUrl = this.getMirrorNodeUrl();
14
- this.logger = logger;
15
+ this.logger = logger || new Logger({
16
+ level: "debug",
17
+ module: "MirrorNode"
18
+ });
15
19
  this.isServerEnvironment = typeof window === "undefined";
16
20
  }
17
21
  /**
@@ -69,7 +73,7 @@ class HederaMirrorNode {
69
73
  const accountInfo = await this._requestWithRetry(
70
74
  accountInfoUrl
71
75
  );
72
- if (accountInfo && accountInfo.memo) {
76
+ if (accountInfo?.memo) {
73
77
  return accountInfo.memo;
74
78
  }
75
79
  this.logger.warn(`No memo found for account ${accountId}`);
@@ -690,20 +694,12 @@ class HederaMirrorNode {
690
694
  const url = `${this.baseUrl}/api/v1/transactions?timestamp=${timestamp}&limit=1`;
691
695
  try {
692
696
  const response = await this._requestWithRetry(url);
693
- if (response && response.transactions && response.transactions.length > 0) {
694
- const specificTransactionId = response.transactions[0].transaction_id;
695
- this.logger.debug(
696
- `Transaction found by timestamp, fetching full details for ID: ${specificTransactionId}`
697
- );
698
- return this.getTransaction(specificTransactionId);
699
- }
700
- this.logger.warn(`No transaction found for timestamp: ${timestamp}`);
701
- return null;
697
+ return response.transactions;
702
698
  } catch (error) {
703
699
  this.logger.error(
704
- `Error fetching transaction by timestamp ${timestamp}: ${error.message}`
700
+ `Error fetching transaction by timestamp ${timestamp}: ${error}`
705
701
  );
706
- return null;
702
+ return [];
707
703
  }
708
704
  }
709
705
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es21.js","sources":["../../src/services/mirror-node.ts"],"sourcesContent":["import { PublicKey, Timestamp, AccountId } from '@hashgraph/sdk';\nimport axios, { AxiosRequestConfig } from 'axios';\nimport { Logger } from '../utils/logger';\nimport { HCSMessage } from '../hcs-10/base-client';\nimport { proto } from '@hashgraph/proto';\nimport {\n AccountResponse,\n CustomFees,\n HBARPrice,\n ScheduleInfo,\n TokenInfoResponse,\n TopicMessagesResponse,\n TopicResponse,\n Transaction as HederaTransaction,\n AccountTokenBalance,\n AccountTokensResponse,\n NftDetail,\n AccountNftsResponse,\n ContractCallQueryResponse,\n} from './types';\nimport { NetworkType } from '../utils/types';\n\n/**\n * Configuration for retry attempts.\n */\nexport interface RetryConfig {\n maxRetries?: number;\n initialDelayMs?: number;\n maxDelayMs?: number;\n backoffFactor?: number;\n}\n\nexport class HederaMirrorNode {\n private network: NetworkType;\n private baseUrl: string;\n private logger: Logger;\n private isServerEnvironment: boolean;\n\n private maxRetries: number = 3;\n private initialDelayMs: number = 1000;\n private maxDelayMs: number = 30000;\n private backoffFactor: number = 2;\n\n constructor(network: NetworkType, logger: Logger) {\n this.network = network;\n this.baseUrl = this.getMirrorNodeUrl();\n this.logger = logger;\n this.isServerEnvironment = typeof window === 'undefined';\n }\n\n /**\n * Configures the retry mechanism for API requests.\n * @param config The retry configuration.\n */\n public configureRetry(config: RetryConfig): void {\n this.maxRetries = config.maxRetries ?? this.maxRetries;\n this.initialDelayMs = config.initialDelayMs ?? this.initialDelayMs;\n this.maxDelayMs = config.maxDelayMs ?? this.maxDelayMs;\n this.backoffFactor = config.backoffFactor ?? this.backoffFactor;\n this.logger.info(\n `Retry configuration updated: maxRetries=${this.maxRetries}, initialDelayMs=${this.initialDelayMs}, maxDelayMs=${this.maxDelayMs}, backoffFactor=${this.backoffFactor}`\n );\n }\n\n private getMirrorNodeUrl(): string {\n return this.network === 'mainnet'\n ? 'https://mainnet-public.mirrornode.hedera.com'\n : 'https://testnet.mirrornode.hedera.com';\n }\n\n getBaseUrl(): string {\n return this.baseUrl;\n }\n\n /**\n * Retrieves the public key for a given account ID from the mirror node.\n * @param accountId The ID of the account to retrieve the public key for.\n * @returns A promise that resolves to the public key for the given account.\n * @throws An error if the account ID is invalid or the public key cannot be retrieved.\n */\n async getPublicKey(accountId: string): Promise<PublicKey> {\n this.logger.info(`Getting public key for account ${accountId}`);\n\n const accountInfo = await this.requestAccount(accountId);\n\n try {\n if (!accountInfo || !accountInfo.key) {\n throw new Error(\n `Failed to retrieve public key for account ID: ${accountId}`\n );\n }\n\n return PublicKey.fromString(accountInfo.key.key);\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error fetching public key from Mirror Node: ${error.message}`;\n this.logger.error(logMessage);\n throw new Error(logMessage);\n }\n }\n\n /**\n * Retrieves the memo for a given account ID from the mirror node.\n * @param accountId The ID of the account to retrieve the memo for.\n * @returns A promise that resolves to the memo for the given account.\n * @throws An error if the account ID is invalid or the memo cannot be retrieved.\n */\n async getAccountMemo(accountId: string): Promise<string | null> {\n this.logger.info(`Getting account memo for account ID: ${accountId}`);\n const accountInfoUrl = `${this.baseUrl}/api/v1/accounts/${accountId}`;\n\n try {\n const accountInfo = await this._requestWithRetry<AccountResponse>(\n accountInfoUrl\n );\n\n if (accountInfo && accountInfo.memo) {\n return accountInfo.memo;\n }\n this.logger.warn(`No memo found for account ${accountId}`);\n return null;\n } catch (e: any) {\n const error = e as Error;\n this.logger.error(\n `Failed to get account memo for ${accountId} after retries: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Retrieves topic information for a given topic ID from the mirror node.\n * @param topicId The ID of the topic to retrieve information for.\n * @returns A promise that resolves to the topic information.\n * @throws An error if the topic ID is invalid or the information cannot be retrieved.\n */\n async getTopicInfo(topicId: string): Promise<TopicResponse> {\n try {\n const topicInfoUrl = `${this.baseUrl}/api/v1/topics/${topicId}`;\n this.logger.debug(`Fetching topic info from ${topicInfoUrl}`);\n const data = await this._requestWithRetry<TopicResponse>(topicInfoUrl);\n return data;\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error retrieving topic information for ${topicId} after retries: ${error.message}`;\n this.logger.error(logMessage);\n throw new Error(logMessage);\n }\n }\n\n /**\n * Retrieves custom fees for a given topic ID from the mirror node.\n * @param topicId The ID of the topic to retrieve custom fees for.\n * @returns A promise that resolves to the custom fees for the given topic.\n * @throws An error if the topic ID is invalid or the custom fees cannot be retrieved.\n */\n async getTopicFees(topicId: string): Promise<CustomFees | null> {\n try {\n const topicInfo = await this.getTopicInfo(topicId);\n return topicInfo.custom_fees;\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error retrieving topic fees: ${error.message}`;\n this.logger.error(logMessage);\n return null;\n }\n }\n\n /**\n * Retrieves the current HBAR price from the mirror node.\n * @param date The date to retrieve the HBAR price for.\n * @returns A promise that resolves to the HBAR price for the given date.\n * @throws An error if the date is invalid or the price cannot be retrieved.\n */\n async getHBARPrice(date: Date): Promise<number | null> {\n try {\n const timestamp = Timestamp.fromDate(date).toString();\n const url = `https://mainnet-public.mirrornode.hedera.com/api/v1/network/exchangerate?timestamp=${timestamp}`;\n this.logger.debug(`Fetching HBAR price from ${url}`);\n\n const response = await this._fetchWithRetry<HBARPrice>(url);\n\n const usdPrice =\n Number(response?.current_rate?.cent_equivalent) /\n Number(response?.current_rate?.hbar_equivalent) /\n 100;\n\n return usdPrice;\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error retrieving HBAR price: ${error.message}`;\n this.logger.error(logMessage);\n return null;\n }\n }\n\n /**\n * Retrieves token information for a given token ID from the mirror node.\n * @param tokenId The ID of the token to retrieve information for.\n * @returns A promise that resolves to the token information.\n * @throws An error if the token ID is invalid or the information cannot be retrieved.\n */\n async getTokenInfo(tokenId: string): Promise<TokenInfoResponse | null> {\n this.logger.debug(`Fetching token info for ${tokenId}`);\n try {\n const tokenInfoUrl = `${this.baseUrl}/api/v1/tokens/${tokenId}`;\n const data = await this._requestWithRetry<TokenInfoResponse>(\n tokenInfoUrl\n );\n if (data) {\n this.logger.trace(`Token info found for ${tokenId}:`, data);\n return data;\n }\n this.logger.warn(`No token info found for ${tokenId}`);\n return null;\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error fetching token info for ${tokenId}: ${error.message}`;\n this.logger.error(logMessage);\n\n return null;\n }\n }\n\n /**\n * Retrieves messages for a given topic ID from the mirror node.\n * @param topicId The ID of the topic to retrieve messages for.\n * @returns A promise that resolves to the messages for the given topic.\n * @throws An error if the topic ID is invalid or the messages cannot be retrieved.\n */\n async getTopicMessages(topicId: string): Promise<HCSMessage[]> {\n this.logger.trace(`Querying messages for topic ${topicId}`);\n\n let nextUrl = `${this.baseUrl}/api/v1/topics/${topicId}/messages`;\n const messages: HCSMessage[] = [];\n\n while (nextUrl) {\n try {\n const data = await this._requestWithRetry<TopicMessagesResponse>(\n nextUrl\n );\n\n if (data.messages && data.messages.length > 0) {\n for (const message of data.messages) {\n try {\n if (!message.message) {\n continue;\n }\n\n let messageContent: string;\n try {\n if (this.isServerEnvironment) {\n messageContent = Buffer.from(\n message.message,\n 'base64'\n ).toString('utf-8');\n } else {\n messageContent = new TextDecoder().decode(\n Uint8Array.from(atob(message.message), (c) =>\n c.charCodeAt(0)\n )\n );\n }\n } catch (error) {\n const logMessage = `Error decoding message: ${error}`;\n this.logger.error(logMessage);\n continue;\n }\n\n let messageJson;\n try {\n messageJson = JSON.parse(messageContent);\n } catch (error) {\n const logMessage = `Invalid JSON message content: ${messageContent}`;\n this.logger.error(logMessage);\n continue;\n }\n\n messageJson.sequence_number = message.sequence_number;\n messages.push({\n ...messageJson,\n consensus_timestamp: message.consensus_timestamp,\n sequence_number: message.sequence_number,\n created: new Date(Number(message.consensus_timestamp) * 1000),\n });\n } catch (error: any) {\n const logMessage = `Error processing message: ${error.message}`;\n this.logger.error(logMessage);\n }\n }\n }\n\n nextUrl = data.links?.next ? `${this.baseUrl}${data.links.next}` : '';\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error querying topic messages for topic ${topicId} (URL: ${nextUrl}) after retries: ${error.message}`;\n this.logger.error(logMessage);\n throw new Error(logMessage);\n }\n }\n\n return messages;\n }\n\n /**\n * Requests account information for a given account ID from the mirror node.\n * @param accountId The ID of the account to retrieve information for.\n * @returns A promise that resolves to the account information.\n * @throws An error if the account ID is invalid or the information cannot be retrieved.\n */\n async requestAccount(accountId: string): Promise<AccountResponse> {\n try {\n const accountInfoUrl = `${this.baseUrl}/api/v1/accounts/${accountId}`;\n this.logger.debug(`Requesting account info from ${accountInfoUrl}`);\n const data = await this._requestWithRetry<AccountResponse>(\n accountInfoUrl\n );\n if (!data) {\n throw new Error(\n `No data received from mirror node for account: ${accountId}`\n );\n }\n return data;\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Failed to fetch account ${accountId} after retries: ${error.message}`;\n this.logger.error(logMessage);\n throw new Error(logMessage);\n }\n }\n\n /**\n * Checks if a user has access to a given key list.\n * @param keyBytes The key list to check access for.\n * @param userPublicKey The public key of the user to check access for.\n * @returns A promise that resolves to true if the user has access, false otherwise.\n */\n async checkKeyListAccess(\n keyBytes: Buffer,\n userPublicKey: PublicKey\n ): Promise<boolean> {\n try {\n const key = proto.Key.decode(keyBytes);\n return this.evaluateKeyAccess(key, userPublicKey);\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error decoding protobuf key: ${error.message}`;\n this.logger.error(logMessage);\n throw new Error(logMessage);\n }\n }\n\n /**\n * Evaluates the access of a given key to a user's public key.\n * @param key The key to evaluate access for.\n * @param userPublicKey The public key of the user to evaluate access for.\n * @returns A promise that resolves to true if the key has access, false otherwise.\n */\n private async evaluateKeyAccess(\n key: proto.IKey,\n userPublicKey: PublicKey\n ): Promise<boolean> {\n if (key.ed25519) {\n return this.compareEd25519Key(key.ed25519, userPublicKey);\n }\n\n if (key.keyList) {\n return this.evaluateKeyList(key.keyList, userPublicKey);\n }\n\n if (key.thresholdKey && key.thresholdKey.keys) {\n return this.evaluateKeyList(key.thresholdKey.keys, userPublicKey);\n }\n\n return false;\n }\n\n /**\n * Evaluates the access of a given key list to a user's public key.\n * @param keyList The key list to evaluate access for.\n * @param userPublicKey The public key of the user to evaluate access for.\n * @returns A promise that resolves to true if the key list has access, false otherwise.\n */\n private async evaluateKeyList(\n keyList: proto.IKeyList,\n userPublicKey: PublicKey\n ): Promise<boolean> {\n const keys = keyList.keys || [];\n\n for (const listKey of keys) {\n if (!listKey) continue;\n\n if (listKey.ed25519) {\n if (this.compareEd25519Key(listKey.ed25519, userPublicKey)) {\n return true;\n }\n } else if (listKey.keyList || listKey.thresholdKey) {\n try {\n const nestedKeyBytes = proto.Key.encode({\n ...(listKey.keyList ? { keyList: listKey.keyList } : {}),\n ...(listKey.thresholdKey\n ? { thresholdKey: listKey.thresholdKey }\n : {}),\n }).finish();\n\n const hasNestedAccess = await this.checkKeyListAccess(\n Buffer.from(nestedKeyBytes),\n userPublicKey\n );\n\n if (hasNestedAccess) {\n return true;\n }\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error in nested key: ${error.message}`;\n this.logger.debug(logMessage);\n }\n }\n }\n\n return false;\n }\n\n /**\n * Compares an Ed25519 key with a user's public key.\n * @param keyData The Ed25519 key data to compare.\n * @param userPublicKey The public key of the user to compare with.\n * @returns A boolean indicating whether the key matches the user's public key.\n */\n private compareEd25519Key(\n keyData: Uint8Array,\n userPublicKey: PublicKey\n ): boolean {\n try {\n const decodedKey = PublicKey.fromBytes(Buffer.from(keyData));\n return decodedKey.toString() === userPublicKey.toString();\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error comparing Ed25519 key: ${error.message}`;\n this.logger.debug(logMessage);\n return false;\n }\n }\n\n /**\n * Retrieves information about a scheduled transaction\n * @param scheduleId The ID of the scheduled transaction\n * @returns A promise that resolves to the scheduled transaction information\n */\n async getScheduleInfo(scheduleId: string): Promise<ScheduleInfo | null> {\n try {\n this.logger.info(\n `Getting information for scheduled transaction ${scheduleId}`\n );\n\n const url = `${this.baseUrl}/api/v1/schedules/${scheduleId}`;\n const data = await this._requestWithRetry<ScheduleInfo>(url);\n\n if (data) {\n return data;\n }\n\n this.logger.warn(\n `No schedule info found for ${scheduleId} after retries.`\n );\n return null;\n } catch (error: any) {\n this.logger.error(\n `Error fetching schedule info for ${scheduleId} after retries: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Checks the status of a scheduled transaction\n * @param scheduleId The schedule ID to check\n * @returns Status of the scheduled transaction\n */\n public async getScheduledTransactionStatus(scheduleId: string): Promise<{\n executed: boolean;\n executedDate?: Date;\n deleted: boolean;\n }> {\n try {\n this.logger.info(\n `Checking status of scheduled transaction ${scheduleId}`\n );\n\n const scheduleInfo = await this.getScheduleInfo(scheduleId);\n\n if (!scheduleInfo) {\n throw new Error(`Schedule ${scheduleId} not found`);\n }\n\n return {\n executed: Boolean(scheduleInfo.executed_timestamp),\n executedDate: scheduleInfo.executed_timestamp\n ? new Date(Number(scheduleInfo.executed_timestamp) * 1000)\n : undefined,\n deleted: scheduleInfo.deleted || false,\n };\n } catch (error) {\n this.logger.error(\n `Error checking scheduled transaction status: ${error}`\n );\n throw error;\n }\n }\n\n /**\n * Retrieves details for a given transaction ID or hash from the mirror node.\n * @param transactionIdOrHash The ID or hash of the transaction.\n * @returns A promise that resolves to the transaction details.\n * @throws An error if the transaction ID/hash is invalid or details cannot be retrieved.\n */\n async getTransaction(\n transactionIdOrHash: string\n ): Promise<HederaTransaction | null> {\n this.logger.info(\n `Getting transaction details for ID/hash: ${transactionIdOrHash}`\n );\n const endpoint = transactionIdOrHash.includes('-')\n ? `transactions/${transactionIdOrHash}`\n : `transactions/${transactionIdOrHash}`;\n\n const transactionDetailsUrl = `${this.baseUrl}/api/v1/${endpoint}`;\n\n try {\n const response = await this._requestWithRetry<{\n transactions: HederaTransaction[];\n }>(transactionDetailsUrl);\n\n if (response?.transactions?.length > 0) {\n this.logger.trace(\n `Transaction details found for ${transactionIdOrHash}:`,\n response.transactions[0]\n );\n return response.transactions[0];\n }\n\n this.logger.warn(\n `No transaction details found for ${transactionIdOrHash} or unexpected response structure.`\n );\n return null;\n } catch (e: any) {\n const error = e as Error;\n this.logger.error(\n `Failed to get transaction details for ${transactionIdOrHash} after retries: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Private helper to make GET requests with retry logic using Axios.\n */\n private async _requestWithRetry<T>(\n url: string,\n axiosConfig?: AxiosRequestConfig\n ): Promise<T> {\n let attempt = 0;\n let delay = this.initialDelayMs;\n\n while (attempt < this.maxRetries) {\n try {\n const response = await axios.get<T>(url, axiosConfig);\n return response.data;\n } catch (error: any) {\n attempt++;\n const isLastAttempt = attempt >= this.maxRetries;\n const statusCode = error.response?.status;\n\n if (\n statusCode &&\n statusCode >= 400 &&\n statusCode < 500 &&\n statusCode !== 429\n ) {\n this.logger.error(\n `Client error for ${url} (status ${statusCode}): ${error.message}. Not retrying.`\n );\n throw error;\n }\n\n if (isLastAttempt) {\n this.logger.error(\n `Max retries (${this.maxRetries}) reached for ${url}. Last error: ${error.message}`\n );\n throw error;\n }\n\n this.logger.warn(\n `Attempt ${attempt}/${this.maxRetries} failed for ${url}: ${error.message}. Retrying in ${delay}ms...`\n );\n await new Promise((resolve) => setTimeout(resolve, delay));\n delay = Math.min(delay * this.backoffFactor, this.maxDelayMs);\n }\n }\n\n throw new Error(\n `Failed to fetch data from ${url} after ${this.maxRetries} attempts.`\n );\n }\n\n /**\n * Private helper to make fetch requests with retry logic.\n */\n private async _fetchWithRetry<T>(\n url: string,\n fetchOptions?: RequestInit\n ): Promise<T> {\n let attempt = 0;\n let delay = this.initialDelayMs;\n\n while (attempt < this.maxRetries) {\n try {\n const request = await fetch(url, fetchOptions);\n if (!request.ok) {\n if (\n request.status >= 400 &&\n request.status < 500 &&\n request.status !== 429\n ) {\n this.logger.error(\n `Client error for ${url} (status ${request.status}): ${request.statusText}. Not retrying.`\n );\n throw new Error(\n `Fetch failed with status ${request.status}: ${request.statusText} for URL: ${url}`\n );\n }\n throw new Error(\n `Fetch failed with status ${request.status}: ${request.statusText} for URL: ${url}`\n );\n }\n const response = (await request.json()) as T;\n return response;\n } catch (error: any) {\n attempt++;\n if (attempt >= this.maxRetries) {\n this.logger.error(\n `Max retries (${this.maxRetries}) reached for ${url}. Last error: ${error.message}`\n );\n throw error;\n }\n this.logger.warn(\n `Attempt ${attempt}/${this.maxRetries} failed for ${url}: ${error.message}. Retrying in ${delay}ms...`\n );\n await new Promise((resolve) => setTimeout(resolve, delay));\n delay = Math.min(delay * this.backoffFactor, this.maxDelayMs);\n }\n }\n throw new Error(\n `Failed to fetch data from ${url} after ${this.maxRetries} attempts.`\n );\n }\n\n /**\n * Retrieves the numerical balance (in HBAR) for a given account ID.\n * @param accountId The ID of the account.\n * @returns A promise that resolves to the HBAR balance or null if an error occurs.\n */\n async getAccountBalanceNumerical(accountId: string): Promise<number | null> {\n this.logger.info(`Getting numerical balance for account ${accountId}`);\n try {\n const accountInfo = await this.requestAccount(accountId);\n if (accountInfo && accountInfo.balance) {\n const hbarBalance = accountInfo.balance.balance / 100_000_000;\n return hbarBalance;\n }\n this.logger.warn(\n `Could not retrieve balance for account ${accountId} from account info.`\n );\n return null;\n } catch (error: any) {\n this.logger.error(\n `Error fetching numerical balance for account ${accountId}: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Retrieves messages for a given topic ID with optional filters.\n * @param topicId The ID of the topic.\n * @param sequenceNumber Filter by sequence number (e.g., \"gt:10\", \"lte:20\").\n * @param startTime Filter by consensus timestamp (e.g., \"gt:1629400000.000000000\").\n * @param endTime Filter by consensus timestamp (e.g., \"lt:1629500000.000000000\").\n * @param limit The maximum number of messages to return.\n * @returns A promise that resolves to an array of HCSMessages or null.\n */\n async getTopicMessagesByFilter(\n topicId: string,\n options?: {\n sequenceNumber?: string;\n startTime?: string;\n endTime?: string;\n limit?: number;\n order?: 'asc' | 'desc';\n }\n ): Promise<HCSMessage[] | null> {\n this.logger.trace(\n `Querying messages for topic ${topicId} with filters: ${JSON.stringify(\n options\n )}`\n );\n\n let nextUrl = `${this.baseUrl}/api/v1/topics/${topicId}/messages`;\n const params = new URLSearchParams();\n\n if (options?.limit) {\n params.append('limit', options.limit.toString());\n }\n if (options?.sequenceNumber) {\n params.append('sequencenumber', options.sequenceNumber);\n }\n if (options?.startTime) {\n params.append('timestamp', `gte:${options.startTime}`);\n }\n if (options?.endTime) {\n params.append('timestamp', `lt:${options.endTime}`);\n }\n if (options?.order) {\n params.append('order', options.order);\n }\n\n const queryString = params.toString();\n if (queryString) {\n nextUrl += `?${queryString}`;\n }\n\n const messages: HCSMessage[] = [];\n let pagesFetched = 0;\n const maxPages = 10;\n\n try {\n while (nextUrl && pagesFetched < maxPages) {\n pagesFetched++;\n const data = await this._requestWithRetry<TopicMessagesResponse>(\n nextUrl\n );\n\n if (data.messages && data.messages.length > 0) {\n for (const message of data.messages) {\n try {\n if (!message.message) {\n continue;\n }\n let messageContent: string;\n if (this.isServerEnvironment) {\n messageContent = Buffer.from(\n message.message,\n 'base64'\n ).toString('utf-8');\n } else {\n messageContent = new TextDecoder().decode(\n Uint8Array.from(atob(message.message), (c) => c.charCodeAt(0))\n );\n }\n let messageJson = {};\n try {\n messageJson = JSON.parse(messageContent);\n } catch (parseError) {\n this.logger.debug(\n `Message content is not valid JSON, using raw: ${messageContent}`\n );\n messageJson = { raw_content: messageContent };\n }\n\n const parsedContent = messageJson as any;\n\n const hcsMsg: HCSMessage = {\n ...parsedContent,\n consensus_timestamp: message.consensus_timestamp,\n sequence_number: message.sequence_number,\n payer_account_id: message.payer_account_id,\n topic_id: message.topic_id,\n running_hash: message.running_hash,\n running_hash_version: message.running_hash_version,\n chunk_info: message.chunk_info,\n created: new Date(\n Number(message.consensus_timestamp.split('.')[0]) * 1000 +\n Number(message.consensus_timestamp.split('.')[1] || 0) /\n 1_000_000\n ),\n payer: message.payer_account_id,\n };\n\n messages.push(hcsMsg);\n } catch (error: any) {\n this.logger.error(\n `Error processing individual message: ${error.message}`\n );\n }\n }\n }\n if (options?.limit && messages.length >= options.limit) break;\n nextUrl = data.links?.next ? `${this.baseUrl}${data.links.next}` : '';\n }\n return messages;\n } catch (e: any) {\n const error = e as Error;\n this.logger.error(\n `Error querying filtered topic messages for ${topicId}: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Retrieves token balances for a given account ID.\n * @param accountId The ID of the account.\n * @param limit The maximum number of tokens to return.\n * @returns A promise that resolves to an array of AccountTokenBalance or null.\n */\n async getAccountTokens(\n accountId: string,\n limit: number = 100\n ): Promise<AccountTokenBalance[] | null> {\n this.logger.info(`Getting tokens for account ${accountId}`);\n let allTokens: AccountTokenBalance[] = [];\n let url = `${this.baseUrl}/api/v1/accounts/${accountId}/tokens?limit=${limit}`;\n\n try {\n for (let i = 0; i < 10 && url; i++) {\n const response = await this._requestWithRetry<AccountTokensResponse>(\n url\n );\n if (response && response.tokens) {\n allTokens = allTokens.concat(response.tokens);\n }\n url = response.links?.next\n ? `${this.baseUrl}${response.links.next}`\n : '';\n if (!url || (limit && allTokens.length >= limit)) {\n if (limit && allTokens.length > limit) {\n allTokens = allTokens.slice(0, limit);\n }\n break;\n }\n }\n return allTokens;\n } catch (error: any) {\n this.logger.error(\n `Error fetching tokens for account ${accountId}: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Retrieves transaction details by consensus timestamp.\n * @param timestamp The consensus timestamp of the transaction (e.g., \"1629400000.000000000\").\n * @returns A promise that resolves to the transaction details or null.\n */\n async getTransactionByTimestamp(\n timestamp: string\n ): Promise<HederaTransaction | null> {\n this.logger.info(`Getting transaction by timestamp: ${timestamp}`);\n const url = `${this.baseUrl}/api/v1/transactions?timestamp=${timestamp}&limit=1`;\n\n try {\n const response = await this._requestWithRetry<{\n transactions: HederaTransaction[];\n }>(url);\n\n if (\n response &&\n response.transactions &&\n response.transactions.length > 0\n ) {\n const specificTransactionId = response.transactions[0].transaction_id;\n this.logger.debug(\n `Transaction found by timestamp, fetching full details for ID: ${specificTransactionId}`\n );\n return this.getTransaction(specificTransactionId);\n }\n this.logger.warn(`No transaction found for timestamp: ${timestamp}`);\n return null;\n } catch (error: any) {\n this.logger.error(\n `Error fetching transaction by timestamp ${timestamp}: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Retrieves NFTs for a given account ID, optionally filtered by token ID.\n * @param accountId The ID of the account.\n * @param tokenId Optional ID of the token to filter NFTs by.\n * @param limit The maximum number of NFTs to return per page (API has its own max).\n * @returns A promise that resolves to an array of NftDetail or null.\n */\n async getAccountNfts(\n accountId: string,\n tokenId?: string,\n limit: number = 100\n ): Promise<NftDetail[] | null> {\n this.logger.info(\n `Getting NFTs for account ${accountId}${\n tokenId ? ` for token ${tokenId}` : ''\n }`\n );\n let allNfts: NftDetail[] = [];\n let url = `${this.baseUrl}/api/v1/accounts/${accountId}/nfts?limit=${limit}`;\n if (tokenId) {\n url += `&token.id=${tokenId}`;\n }\n\n try {\n for (let i = 0; i < 10 && url; i++) {\n const response = await this._requestWithRetry<AccountNftsResponse>(url);\n if (response && response.nfts) {\n const nftsWithUri = response.nfts.map((nft) => {\n let tokenUri: string | undefined = undefined;\n if (nft.metadata) {\n try {\n if (this.isServerEnvironment) {\n tokenUri = Buffer.from(nft.metadata, 'base64').toString(\n 'utf-8'\n );\n } else {\n tokenUri = new TextDecoder().decode(\n Uint8Array.from(atob(nft.metadata), (c) => c.charCodeAt(0))\n );\n }\n } catch (e) {\n this.logger.warn(\n `Failed to decode metadata for NFT ${nft.token_id} SN ${\n nft.serial_number\n }: ${(e as Error).message}`\n );\n }\n }\n return { ...nft, token_uri: tokenUri };\n });\n allNfts = allNfts.concat(nftsWithUri);\n }\n url = response.links?.next\n ? `${this.baseUrl}${response.links.next}`\n : '';\n if (!url) break;\n }\n return allNfts;\n } catch (error: any) {\n this.logger.error(\n `Error fetching NFTs for account ${accountId}: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Validates NFT ownership by checking if a specific serial number of a token ID exists for an account.\n * @param accountId The ID of the account.\n * @param tokenId The ID of the NFT's token.\n * @param serialNumber The serial number of the NFT.\n * @returns A promise that resolves to the NftDetail if owned, or null otherwise.\n */\n async validateNFTOwnership(\n accountId: string,\n tokenId: string,\n serialNumber: number\n ): Promise<NftDetail | null> {\n this.logger.info(\n `Validating ownership of NFT ${tokenId} SN ${serialNumber} for account ${accountId}`\n );\n try {\n const nfts = await this.getAccountNfts(accountId, tokenId);\n if (nfts) {\n const foundNft = nfts.find(\n (nft) =>\n nft.token_id === tokenId && nft.serial_number === serialNumber\n );\n return foundNft || null;\n }\n return null;\n } catch (error: any) {\n this.logger.error(`Error validating NFT ownership: ${error.message}`);\n return null;\n }\n }\n\n /**\n * Performs a read-only query against a smart contract (eth_call like).\n * @param contractIdOrAddress The contract ID (e.g., \"0.0.123\") or EVM address (e.g., \"0x...\").\n * @param functionSelector The function selector and encoded parameters (e.g., \"0xabcdef12...\").\n * @param payerAccountId The account ID of the payer (not strictly payer for read-only, but often required as 'from').\n * @param estimate Whether this is an estimate call. Mirror node might not support this directly in /contracts/call for true estimation.\n * @param block Block parameter, e.g., \"latest\", \"pending\", or block number.\n * @param value The value in tinybars to send with the call (for payable view/pure functions, usually 0).\n * @returns A promise that resolves to the contract call query response or null.\n */\n async readSmartContractQuery(\n contractIdOrAddress: string,\n functionSelector: string,\n payerAccountId: string,\n options?: {\n estimate?: boolean;\n block?: string;\n value?: number;\n gas?: number;\n gasPrice?: number;\n }\n ): Promise<ContractCallQueryResponse | null> {\n this.logger.info(\n `Reading smart contract ${contractIdOrAddress} with selector ${functionSelector}`\n );\n const url = `${this.baseUrl}/api/v1/contracts/call`;\n\n const toAddress = contractIdOrAddress.startsWith('0x')\n ? contractIdOrAddress\n : `0x${AccountId.fromString(contractIdOrAddress).toSolidityAddress()}`;\n const fromAddress = payerAccountId.startsWith('0x')\n ? payerAccountId\n : `0x${AccountId.fromString(payerAccountId).toSolidityAddress()}`;\n\n const body: any = {\n block: options?.block || 'latest',\n data: functionSelector,\n estimate: options?.estimate || false,\n from: fromAddress,\n to: toAddress,\n gas: options?.gas,\n gasPrice: options?.gasPrice,\n value: options?.value || 0,\n };\n\n Object.keys(body).forEach((key) => {\n const K = key as keyof typeof body;\n if (body[K] === undefined) {\n delete body[K];\n }\n });\n\n try {\n const response = await this._fetchWithRetry<ContractCallQueryResponse>(\n url,\n {\n method: 'POST',\n body: JSON.stringify(body),\n headers: {\n 'Content-Type': 'application/json',\n },\n }\n );\n return response;\n } catch (error: any) {\n this.logger.error(\n `Error reading smart contract ${contractIdOrAddress}: ${error.message}`\n );\n return null;\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAgCO,MAAM,iBAAiB;AAAA,EAW5B,YAAY,SAAsB,QAAgB;AALlD,SAAQ,aAAqB;AAC7B,SAAQ,iBAAyB;AACjC,SAAQ,aAAqB;AAC7B,SAAQ,gBAAwB;AAG9B,SAAK,UAAU;AACV,SAAA,UAAU,KAAK,iBAAiB;AACrC,SAAK,SAAS;AACT,SAAA,sBAAsB,OAAO,WAAW;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOxC,eAAe,QAA2B;AAC1C,SAAA,aAAa,OAAO,cAAc,KAAK;AACvC,SAAA,iBAAiB,OAAO,kBAAkB,KAAK;AAC/C,SAAA,aAAa,OAAO,cAAc,KAAK;AACvC,SAAA,gBAAgB,OAAO,iBAAiB,KAAK;AAClD,SAAK,OAAO;AAAA,MACV,2CAA2C,KAAK,UAAU,oBAAoB,KAAK,cAAc,gBAAgB,KAAK,UAAU,mBAAmB,KAAK,aAAa;AAAA,IACvK;AAAA,EAAA;AAAA,EAGM,mBAA2B;AAC1B,WAAA,KAAK,YAAY,YACpB,iDACA;AAAA,EAAA;AAAA,EAGN,aAAqB;AACnB,WAAO,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASd,MAAM,aAAa,WAAuC;AACxD,SAAK,OAAO,KAAK,kCAAkC,SAAS,EAAE;AAE9D,UAAM,cAAc,MAAM,KAAK,eAAe,SAAS;AAEnD,QAAA;AACF,UAAI,CAAC,eAAe,CAAC,YAAY,KAAK;AACpC,cAAM,IAAI;AAAA,UACR,iDAAiD,SAAS;AAAA,QAC5D;AAAA,MAAA;AAGF,aAAO,UAAU,WAAW,YAAY,IAAI,GAAG;AAAA,aACxC,GAAQ;AACf,YAA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T;AAEJ;"}
1
+ {"version":3,"file":"standards-sdk.es21.js","sources":["../../src/services/mirror-node.ts"],"sourcesContent":["import { PublicKey, Timestamp, AccountId } from '@hashgraph/sdk';\nimport axios, { AxiosRequestConfig } from 'axios';\nimport { Logger } from '../utils/logger';\nimport { HCSMessage } from '../hcs-10/base-client';\nimport { proto } from '@hashgraph/proto';\nimport {\n AccountResponse,\n CustomFees,\n HBARPrice,\n ScheduleInfo,\n TokenInfoResponse,\n TopicMessagesResponse,\n TopicResponse,\n Transaction as HederaTransaction,\n AccountTokenBalance,\n AccountTokensResponse,\n NftDetail,\n AccountNftsResponse,\n ContractCallQueryResponse,\n} from './types';\nimport { NetworkType } from '../utils/types';\n\n/**\n * Configuration for retry attempts.\n */\nexport interface RetryConfig {\n maxRetries?: number;\n initialDelayMs?: number;\n maxDelayMs?: number;\n backoffFactor?: number;\n}\n\nexport class HederaMirrorNode {\n private network: NetworkType;\n private baseUrl: string;\n private logger: Logger;\n private isServerEnvironment: boolean;\n\n private maxRetries: number = 3;\n private initialDelayMs: number = 1000;\n private maxDelayMs: number = 30000;\n private backoffFactor: number = 2;\n\n constructor(network: NetworkType, logger: Logger) {\n this.network = network;\n this.baseUrl = this.getMirrorNodeUrl();\n this.logger =\n logger ||\n new Logger({\n level: 'debug',\n module: 'MirrorNode',\n });\n this.isServerEnvironment = typeof window === 'undefined';\n }\n\n /**\n * Configures the retry mechanism for API requests.\n * @param config The retry configuration.\n */\n public configureRetry(config: RetryConfig): void {\n this.maxRetries = config.maxRetries ?? this.maxRetries;\n this.initialDelayMs = config.initialDelayMs ?? this.initialDelayMs;\n this.maxDelayMs = config.maxDelayMs ?? this.maxDelayMs;\n this.backoffFactor = config.backoffFactor ?? this.backoffFactor;\n this.logger.info(\n `Retry configuration updated: maxRetries=${this.maxRetries}, initialDelayMs=${this.initialDelayMs}, maxDelayMs=${this.maxDelayMs}, backoffFactor=${this.backoffFactor}`\n );\n }\n\n private getMirrorNodeUrl(): string {\n return this.network === 'mainnet'\n ? 'https://mainnet-public.mirrornode.hedera.com'\n : 'https://testnet.mirrornode.hedera.com';\n }\n\n getBaseUrl(): string {\n return this.baseUrl;\n }\n\n /**\n * Retrieves the public key for a given account ID from the mirror node.\n * @param accountId The ID of the account to retrieve the public key for.\n * @returns A promise that resolves to the public key for the given account.\n * @throws An error if the account ID is invalid or the public key cannot be retrieved.\n */\n async getPublicKey(accountId: string): Promise<PublicKey> {\n this.logger.info(`Getting public key for account ${accountId}`);\n\n const accountInfo = await this.requestAccount(accountId);\n\n try {\n if (!accountInfo || !accountInfo.key) {\n throw new Error(\n `Failed to retrieve public key for account ID: ${accountId}`\n );\n }\n\n return PublicKey.fromString(accountInfo.key.key);\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error fetching public key from Mirror Node: ${error.message}`;\n this.logger.error(logMessage);\n throw new Error(logMessage);\n }\n }\n\n /**\n * Retrieves the memo for a given account ID from the mirror node.\n * @param accountId The ID of the account to retrieve the memo for.\n * @returns A promise that resolves to the memo for the given account.\n * @throws An error if the account ID is invalid or the memo cannot be retrieved.\n */\n async getAccountMemo(accountId: string): Promise<string | null> {\n this.logger.info(`Getting account memo for account ID: ${accountId}`);\n const accountInfoUrl = `${this.baseUrl}/api/v1/accounts/${accountId}`;\n\n try {\n const accountInfo = await this._requestWithRetry<AccountResponse>(\n accountInfoUrl\n );\n\n if (accountInfo?.memo) {\n return accountInfo.memo;\n }\n this.logger.warn(`No memo found for account ${accountId}`);\n return null;\n } catch (e: any) {\n const error = e as Error;\n this.logger.error(\n `Failed to get account memo for ${accountId} after retries: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Retrieves topic information for a given topic ID from the mirror node.\n * @param topicId The ID of the topic to retrieve information for.\n * @returns A promise that resolves to the topic information.\n * @throws An error if the topic ID is invalid or the information cannot be retrieved.\n */\n async getTopicInfo(topicId: string): Promise<TopicResponse> {\n try {\n const topicInfoUrl = `${this.baseUrl}/api/v1/topics/${topicId}`;\n this.logger.debug(`Fetching topic info from ${topicInfoUrl}`);\n const data = await this._requestWithRetry<TopicResponse>(topicInfoUrl);\n return data;\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error retrieving topic information for ${topicId} after retries: ${error.message}`;\n this.logger.error(logMessage);\n throw new Error(logMessage);\n }\n }\n\n /**\n * Retrieves custom fees for a given topic ID from the mirror node.\n * @param topicId The ID of the topic to retrieve custom fees for.\n * @returns A promise that resolves to the custom fees for the given topic.\n * @throws An error if the topic ID is invalid or the custom fees cannot be retrieved.\n */\n async getTopicFees(topicId: string): Promise<CustomFees | null> {\n try {\n const topicInfo = await this.getTopicInfo(topicId);\n return topicInfo.custom_fees;\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error retrieving topic fees: ${error.message}`;\n this.logger.error(logMessage);\n return null;\n }\n }\n\n /**\n * Retrieves the current HBAR price from the mirror node.\n * @param date The date to retrieve the HBAR price for.\n * @returns A promise that resolves to the HBAR price for the given date.\n * @throws An error if the date is invalid or the price cannot be retrieved.\n */\n async getHBARPrice(date: Date): Promise<number | null> {\n try {\n const timestamp = Timestamp.fromDate(date).toString();\n const url = `https://mainnet-public.mirrornode.hedera.com/api/v1/network/exchangerate?timestamp=${timestamp}`;\n this.logger.debug(`Fetching HBAR price from ${url}`);\n\n const response = await this._fetchWithRetry<HBARPrice>(url);\n\n const usdPrice =\n Number(response?.current_rate?.cent_equivalent) /\n Number(response?.current_rate?.hbar_equivalent) /\n 100;\n\n return usdPrice;\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error retrieving HBAR price: ${error.message}`;\n this.logger.error(logMessage);\n return null;\n }\n }\n\n /**\n * Retrieves token information for a given token ID from the mirror node.\n * @param tokenId The ID of the token to retrieve information for.\n * @returns A promise that resolves to the token information.\n * @throws An error if the token ID is invalid or the information cannot be retrieved.\n */\n async getTokenInfo(tokenId: string): Promise<TokenInfoResponse | null> {\n this.logger.debug(`Fetching token info for ${tokenId}`);\n try {\n const tokenInfoUrl = `${this.baseUrl}/api/v1/tokens/${tokenId}`;\n const data = await this._requestWithRetry<TokenInfoResponse>(\n tokenInfoUrl\n );\n if (data) {\n this.logger.trace(`Token info found for ${tokenId}:`, data);\n return data;\n }\n this.logger.warn(`No token info found for ${tokenId}`);\n return null;\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error fetching token info for ${tokenId}: ${error.message}`;\n this.logger.error(logMessage);\n\n return null;\n }\n }\n\n /**\n * Retrieves messages for a given topic ID from the mirror node.\n * @param topicId The ID of the topic to retrieve messages for.\n * @returns A promise that resolves to the messages for the given topic.\n * @throws An error if the topic ID is invalid or the messages cannot be retrieved.\n */\n async getTopicMessages(topicId: string): Promise<HCSMessage[]> {\n this.logger.trace(`Querying messages for topic ${topicId}`);\n\n let nextUrl = `${this.baseUrl}/api/v1/topics/${topicId}/messages`;\n const messages: HCSMessage[] = [];\n\n while (nextUrl) {\n try {\n const data = await this._requestWithRetry<TopicMessagesResponse>(\n nextUrl\n );\n\n if (data.messages && data.messages.length > 0) {\n for (const message of data.messages) {\n try {\n if (!message.message) {\n continue;\n }\n\n let messageContent: string;\n try {\n if (this.isServerEnvironment) {\n messageContent = Buffer.from(\n message.message,\n 'base64'\n ).toString('utf-8');\n } else {\n messageContent = new TextDecoder().decode(\n Uint8Array.from(atob(message.message), (c) =>\n c.charCodeAt(0)\n )\n );\n }\n } catch (error) {\n const logMessage = `Error decoding message: ${error}`;\n this.logger.error(logMessage);\n continue;\n }\n\n let messageJson;\n try {\n messageJson = JSON.parse(messageContent);\n } catch (error) {\n const logMessage = `Invalid JSON message content: ${messageContent}`;\n this.logger.error(logMessage);\n continue;\n }\n\n messageJson.sequence_number = message.sequence_number;\n messages.push({\n ...messageJson,\n consensus_timestamp: message.consensus_timestamp,\n sequence_number: message.sequence_number,\n created: new Date(Number(message.consensus_timestamp) * 1000),\n });\n } catch (error: any) {\n const logMessage = `Error processing message: ${error.message}`;\n this.logger.error(logMessage);\n }\n }\n }\n\n nextUrl = data.links?.next ? `${this.baseUrl}${data.links.next}` : '';\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error querying topic messages for topic ${topicId} (URL: ${nextUrl}) after retries: ${error.message}`;\n this.logger.error(logMessage);\n throw new Error(logMessage);\n }\n }\n\n return messages;\n }\n\n /**\n * Requests account information for a given account ID from the mirror node.\n * @param accountId The ID of the account to retrieve information for.\n * @returns A promise that resolves to the account information.\n * @throws An error if the account ID is invalid or the information cannot be retrieved.\n */\n async requestAccount(accountId: string): Promise<AccountResponse> {\n try {\n const accountInfoUrl = `${this.baseUrl}/api/v1/accounts/${accountId}`;\n this.logger.debug(`Requesting account info from ${accountInfoUrl}`);\n const data = await this._requestWithRetry<AccountResponse>(\n accountInfoUrl\n );\n if (!data) {\n throw new Error(\n `No data received from mirror node for account: ${accountId}`\n );\n }\n return data;\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Failed to fetch account ${accountId} after retries: ${error.message}`;\n this.logger.error(logMessage);\n throw new Error(logMessage);\n }\n }\n\n /**\n * Checks if a user has access to a given key list.\n * @param keyBytes The key list to check access for.\n * @param userPublicKey The public key of the user to check access for.\n * @returns A promise that resolves to true if the user has access, false otherwise.\n */\n async checkKeyListAccess(\n keyBytes: Buffer,\n userPublicKey: PublicKey\n ): Promise<boolean> {\n try {\n const key = proto.Key.decode(keyBytes);\n return this.evaluateKeyAccess(key, userPublicKey);\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error decoding protobuf key: ${error.message}`;\n this.logger.error(logMessage);\n throw new Error(logMessage);\n }\n }\n\n /**\n * Evaluates the access of a given key to a user's public key.\n * @param key The key to evaluate access for.\n * @param userPublicKey The public key of the user to evaluate access for.\n * @returns A promise that resolves to true if the key has access, false otherwise.\n */\n private async evaluateKeyAccess(\n key: proto.IKey,\n userPublicKey: PublicKey\n ): Promise<boolean> {\n if (key.ed25519) {\n return this.compareEd25519Key(key.ed25519, userPublicKey);\n }\n\n if (key.keyList) {\n return this.evaluateKeyList(key.keyList, userPublicKey);\n }\n\n if (key.thresholdKey && key.thresholdKey.keys) {\n return this.evaluateKeyList(key.thresholdKey.keys, userPublicKey);\n }\n\n return false;\n }\n\n /**\n * Evaluates the access of a given key list to a user's public key.\n * @param keyList The key list to evaluate access for.\n * @param userPublicKey The public key of the user to evaluate access for.\n * @returns A promise that resolves to true if the key list has access, false otherwise.\n */\n private async evaluateKeyList(\n keyList: proto.IKeyList,\n userPublicKey: PublicKey\n ): Promise<boolean> {\n const keys = keyList.keys || [];\n\n for (const listKey of keys) {\n if (!listKey) continue;\n\n if (listKey.ed25519) {\n if (this.compareEd25519Key(listKey.ed25519, userPublicKey)) {\n return true;\n }\n } else if (listKey.keyList || listKey.thresholdKey) {\n try {\n const nestedKeyBytes = proto.Key.encode({\n ...(listKey.keyList ? { keyList: listKey.keyList } : {}),\n ...(listKey.thresholdKey\n ? { thresholdKey: listKey.thresholdKey }\n : {}),\n }).finish();\n\n const hasNestedAccess = await this.checkKeyListAccess(\n Buffer.from(nestedKeyBytes),\n userPublicKey\n );\n\n if (hasNestedAccess) {\n return true;\n }\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error in nested key: ${error.message}`;\n this.logger.debug(logMessage);\n }\n }\n }\n\n return false;\n }\n\n /**\n * Compares an Ed25519 key with a user's public key.\n * @param keyData The Ed25519 key data to compare.\n * @param userPublicKey The public key of the user to compare with.\n * @returns A boolean indicating whether the key matches the user's public key.\n */\n private compareEd25519Key(\n keyData: Uint8Array,\n userPublicKey: PublicKey\n ): boolean {\n try {\n const decodedKey = PublicKey.fromBytes(Buffer.from(keyData));\n return decodedKey.toString() === userPublicKey.toString();\n } catch (e: any) {\n const error = e as Error;\n const logMessage = `Error comparing Ed25519 key: ${error.message}`;\n this.logger.debug(logMessage);\n return false;\n }\n }\n\n /**\n * Retrieves information about a scheduled transaction\n * @param scheduleId The ID of the scheduled transaction\n * @returns A promise that resolves to the scheduled transaction information\n */\n async getScheduleInfo(scheduleId: string): Promise<ScheduleInfo | null> {\n try {\n this.logger.info(\n `Getting information for scheduled transaction ${scheduleId}`\n );\n\n const url = `${this.baseUrl}/api/v1/schedules/${scheduleId}`;\n const data = await this._requestWithRetry<ScheduleInfo>(url);\n\n if (data) {\n return data;\n }\n\n this.logger.warn(\n `No schedule info found for ${scheduleId} after retries.`\n );\n return null;\n } catch (error: any) {\n this.logger.error(\n `Error fetching schedule info for ${scheduleId} after retries: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Checks the status of a scheduled transaction\n * @param scheduleId The schedule ID to check\n * @returns Status of the scheduled transaction\n */\n public async getScheduledTransactionStatus(scheduleId: string): Promise<{\n executed: boolean;\n executedDate?: Date;\n deleted: boolean;\n }> {\n try {\n this.logger.info(\n `Checking status of scheduled transaction ${scheduleId}`\n );\n\n const scheduleInfo = await this.getScheduleInfo(scheduleId);\n\n if (!scheduleInfo) {\n throw new Error(`Schedule ${scheduleId} not found`);\n }\n\n return {\n executed: Boolean(scheduleInfo.executed_timestamp),\n executedDate: scheduleInfo.executed_timestamp\n ? new Date(Number(scheduleInfo.executed_timestamp) * 1000)\n : undefined,\n deleted: scheduleInfo.deleted || false,\n };\n } catch (error) {\n this.logger.error(\n `Error checking scheduled transaction status: ${error}`\n );\n throw error;\n }\n }\n\n /**\n * Retrieves details for a given transaction ID or hash from the mirror node.\n * @param transactionIdOrHash The ID or hash of the transaction.\n * @returns A promise that resolves to the transaction details.\n * @throws An error if the transaction ID/hash is invalid or details cannot be retrieved.\n */\n async getTransaction(\n transactionIdOrHash: string\n ): Promise<HederaTransaction | null> {\n this.logger.info(\n `Getting transaction details for ID/hash: ${transactionIdOrHash}`\n );\n const endpoint = transactionIdOrHash.includes('-')\n ? `transactions/${transactionIdOrHash}`\n : `transactions/${transactionIdOrHash}`;\n\n const transactionDetailsUrl = `${this.baseUrl}/api/v1/${endpoint}`;\n\n try {\n const response = await this._requestWithRetry<{\n transactions: HederaTransaction[];\n }>(transactionDetailsUrl);\n\n if (response?.transactions?.length > 0) {\n this.logger.trace(\n `Transaction details found for ${transactionIdOrHash}:`,\n response.transactions[0]\n );\n return response.transactions[0];\n }\n\n this.logger.warn(\n `No transaction details found for ${transactionIdOrHash} or unexpected response structure.`\n );\n return null;\n } catch (e: any) {\n const error = e as Error;\n this.logger.error(\n `Failed to get transaction details for ${transactionIdOrHash} after retries: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Private helper to make GET requests with retry logic using Axios.\n */\n private async _requestWithRetry<T>(\n url: string,\n axiosConfig?: AxiosRequestConfig\n ): Promise<T> {\n let attempt = 0;\n let delay = this.initialDelayMs;\n\n while (attempt < this.maxRetries) {\n try {\n const response = await axios.get<T>(url, axiosConfig);\n return response.data;\n } catch (error: any) {\n attempt++;\n const isLastAttempt = attempt >= this.maxRetries;\n const statusCode = error.response?.status;\n\n if (\n statusCode &&\n statusCode >= 400 &&\n statusCode < 500 &&\n statusCode !== 429\n ) {\n this.logger.error(\n `Client error for ${url} (status ${statusCode}): ${error.message}. Not retrying.`\n );\n throw error;\n }\n\n if (isLastAttempt) {\n this.logger.error(\n `Max retries (${this.maxRetries}) reached for ${url}. Last error: ${error.message}`\n );\n throw error;\n }\n\n this.logger.warn(\n `Attempt ${attempt}/${this.maxRetries} failed for ${url}: ${error.message}. Retrying in ${delay}ms...`\n );\n await new Promise((resolve) => setTimeout(resolve, delay));\n delay = Math.min(delay * this.backoffFactor, this.maxDelayMs);\n }\n }\n\n throw new Error(\n `Failed to fetch data from ${url} after ${this.maxRetries} attempts.`\n );\n }\n\n /**\n * Private helper to make fetch requests with retry logic.\n */\n private async _fetchWithRetry<T>(\n url: string,\n fetchOptions?: RequestInit\n ): Promise<T> {\n let attempt = 0;\n let delay = this.initialDelayMs;\n\n while (attempt < this.maxRetries) {\n try {\n const request = await fetch(url, fetchOptions);\n if (!request.ok) {\n if (\n request.status >= 400 &&\n request.status < 500 &&\n request.status !== 429\n ) {\n this.logger.error(\n `Client error for ${url} (status ${request.status}): ${request.statusText}. Not retrying.`\n );\n throw new Error(\n `Fetch failed with status ${request.status}: ${request.statusText} for URL: ${url}`\n );\n }\n throw new Error(\n `Fetch failed with status ${request.status}: ${request.statusText} for URL: ${url}`\n );\n }\n const response = (await request.json()) as T;\n return response;\n } catch (error: any) {\n attempt++;\n if (attempt >= this.maxRetries) {\n this.logger.error(\n `Max retries (${this.maxRetries}) reached for ${url}. Last error: ${error.message}`\n );\n throw error;\n }\n this.logger.warn(\n `Attempt ${attempt}/${this.maxRetries} failed for ${url}: ${error.message}. Retrying in ${delay}ms...`\n );\n await new Promise((resolve) => setTimeout(resolve, delay));\n delay = Math.min(delay * this.backoffFactor, this.maxDelayMs);\n }\n }\n throw new Error(\n `Failed to fetch data from ${url} after ${this.maxRetries} attempts.`\n );\n }\n\n /**\n * Retrieves the numerical balance (in HBAR) for a given account ID.\n * @param accountId The ID of the account.\n * @returns A promise that resolves to the HBAR balance or null if an error occurs.\n */\n async getAccountBalanceNumerical(accountId: string): Promise<number | null> {\n this.logger.info(`Getting numerical balance for account ${accountId}`);\n try {\n const accountInfo = await this.requestAccount(accountId);\n if (accountInfo && accountInfo.balance) {\n const hbarBalance = accountInfo.balance.balance / 100_000_000;\n return hbarBalance;\n }\n this.logger.warn(\n `Could not retrieve balance for account ${accountId} from account info.`\n );\n return null;\n } catch (error: any) {\n this.logger.error(\n `Error fetching numerical balance for account ${accountId}: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Retrieves messages for a given topic ID with optional filters.\n * @param topicId The ID of the topic.\n * @param sequenceNumber Filter by sequence number (e.g., \"gt:10\", \"lte:20\").\n * @param startTime Filter by consensus timestamp (e.g., \"gt:1629400000.000000000\").\n * @param endTime Filter by consensus timestamp (e.g., \"lt:1629500000.000000000\").\n * @param limit The maximum number of messages to return.\n * @returns A promise that resolves to an array of HCSMessages or null.\n */\n async getTopicMessagesByFilter(\n topicId: string,\n options?: {\n sequenceNumber?: string;\n startTime?: string;\n endTime?: string;\n limit?: number;\n order?: 'asc' | 'desc';\n }\n ): Promise<HCSMessage[] | null> {\n this.logger.trace(\n `Querying messages for topic ${topicId} with filters: ${JSON.stringify(\n options\n )}`\n );\n\n let nextUrl = `${this.baseUrl}/api/v1/topics/${topicId}/messages`;\n const params = new URLSearchParams();\n\n if (options?.limit) {\n params.append('limit', options.limit.toString());\n }\n if (options?.sequenceNumber) {\n params.append('sequencenumber', options.sequenceNumber);\n }\n if (options?.startTime) {\n params.append('timestamp', `gte:${options.startTime}`);\n }\n if (options?.endTime) {\n params.append('timestamp', `lt:${options.endTime}`);\n }\n if (options?.order) {\n params.append('order', options.order);\n }\n\n const queryString = params.toString();\n if (queryString) {\n nextUrl += `?${queryString}`;\n }\n\n const messages: HCSMessage[] = [];\n let pagesFetched = 0;\n const maxPages = 10;\n\n try {\n while (nextUrl && pagesFetched < maxPages) {\n pagesFetched++;\n const data = await this._requestWithRetry<TopicMessagesResponse>(\n nextUrl\n );\n\n if (data.messages && data.messages.length > 0) {\n for (const message of data.messages) {\n try {\n if (!message.message) {\n continue;\n }\n let messageContent: string;\n if (this.isServerEnvironment) {\n messageContent = Buffer.from(\n message.message,\n 'base64'\n ).toString('utf-8');\n } else {\n messageContent = new TextDecoder().decode(\n Uint8Array.from(atob(message.message), (c) => c.charCodeAt(0))\n );\n }\n let messageJson = {};\n try {\n messageJson = JSON.parse(messageContent);\n } catch (parseError) {\n this.logger.debug(\n `Message content is not valid JSON, using raw: ${messageContent}`\n );\n messageJson = { raw_content: messageContent };\n }\n\n const parsedContent = messageJson as any;\n\n const hcsMsg: HCSMessage = {\n ...parsedContent,\n consensus_timestamp: message.consensus_timestamp,\n sequence_number: message.sequence_number,\n payer_account_id: message.payer_account_id,\n topic_id: message.topic_id,\n running_hash: message.running_hash,\n running_hash_version: message.running_hash_version,\n chunk_info: message.chunk_info,\n created: new Date(\n Number(message.consensus_timestamp.split('.')[0]) * 1000 +\n Number(message.consensus_timestamp.split('.')[1] || 0) /\n 1_000_000\n ),\n payer: message.payer_account_id,\n };\n\n messages.push(hcsMsg);\n } catch (error: any) {\n this.logger.error(\n `Error processing individual message: ${error.message}`\n );\n }\n }\n }\n if (options?.limit && messages.length >= options.limit) break;\n nextUrl = data.links?.next ? `${this.baseUrl}${data.links.next}` : '';\n }\n return messages;\n } catch (e: any) {\n const error = e as Error;\n this.logger.error(\n `Error querying filtered topic messages for ${topicId}: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Retrieves token balances for a given account ID.\n * @param accountId The ID of the account.\n * @param limit The maximum number of tokens to return.\n * @returns A promise that resolves to an array of AccountTokenBalance or null.\n */\n async getAccountTokens(\n accountId: string,\n limit: number = 100\n ): Promise<AccountTokenBalance[] | null> {\n this.logger.info(`Getting tokens for account ${accountId}`);\n let allTokens: AccountTokenBalance[] = [];\n let url = `${this.baseUrl}/api/v1/accounts/${accountId}/tokens?limit=${limit}`;\n\n try {\n for (let i = 0; i < 10 && url; i++) {\n const response = await this._requestWithRetry<AccountTokensResponse>(\n url\n );\n if (response && response.tokens) {\n allTokens = allTokens.concat(response.tokens);\n }\n url = response.links?.next\n ? `${this.baseUrl}${response.links.next}`\n : '';\n if (!url || (limit && allTokens.length >= limit)) {\n if (limit && allTokens.length > limit) {\n allTokens = allTokens.slice(0, limit);\n }\n break;\n }\n }\n return allTokens;\n } catch (error: any) {\n this.logger.error(\n `Error fetching tokens for account ${accountId}: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Retrieves transaction details by consensus timestamp.\n * @param timestamp The consensus timestamp of the transaction (e.g., \"1629400000.000000000\").\n * @returns A promise that resolves to the transaction details or null.\n */\n async getTransactionByTimestamp(\n timestamp: string\n ): Promise<HederaTransaction[]> {\n this.logger.info(`Getting transaction by timestamp: ${timestamp}`);\n const url = `${this.baseUrl}/api/v1/transactions?timestamp=${timestamp}&limit=1`;\n\n try {\n const response = await this._requestWithRetry<{\n transactions: HederaTransaction[];\n }>(url);\n\n return response.transactions;\n } catch (error: unknown) {\n this.logger.error(\n `Error fetching transaction by timestamp ${timestamp}: ${error}`\n );\n return [];\n }\n }\n\n /**\n * Retrieves NFTs for a given account ID, optionally filtered by token ID.\n * @param accountId The ID of the account.\n * @param tokenId Optional ID of the token to filter NFTs by.\n * @param limit The maximum number of NFTs to return per page (API has its own max).\n * @returns A promise that resolves to an array of NftDetail or null.\n */\n async getAccountNfts(\n accountId: string,\n tokenId?: string,\n limit: number = 100\n ): Promise<NftDetail[] | null> {\n this.logger.info(\n `Getting NFTs for account ${accountId}${\n tokenId ? ` for token ${tokenId}` : ''\n }`\n );\n let allNfts: NftDetail[] = [];\n let url = `${this.baseUrl}/api/v1/accounts/${accountId}/nfts?limit=${limit}`;\n if (tokenId) {\n url += `&token.id=${tokenId}`;\n }\n\n try {\n for (let i = 0; i < 10 && url; i++) {\n const response = await this._requestWithRetry<AccountNftsResponse>(url);\n if (response && response.nfts) {\n const nftsWithUri = response.nfts.map((nft) => {\n let tokenUri: string | undefined = undefined;\n if (nft.metadata) {\n try {\n if (this.isServerEnvironment) {\n tokenUri = Buffer.from(nft.metadata, 'base64').toString(\n 'utf-8'\n );\n } else {\n tokenUri = new TextDecoder().decode(\n Uint8Array.from(atob(nft.metadata), (c) => c.charCodeAt(0))\n );\n }\n } catch (e) {\n this.logger.warn(\n `Failed to decode metadata for NFT ${nft.token_id} SN ${\n nft.serial_number\n }: ${(e as Error).message}`\n );\n }\n }\n return { ...nft, token_uri: tokenUri };\n });\n allNfts = allNfts.concat(nftsWithUri);\n }\n url = response.links?.next\n ? `${this.baseUrl}${response.links.next}`\n : '';\n if (!url) break;\n }\n return allNfts;\n } catch (error: any) {\n this.logger.error(\n `Error fetching NFTs for account ${accountId}: ${error.message}`\n );\n return null;\n }\n }\n\n /**\n * Validates NFT ownership by checking if a specific serial number of a token ID exists for an account.\n * @param accountId The ID of the account.\n * @param tokenId The ID of the NFT's token.\n * @param serialNumber The serial number of the NFT.\n * @returns A promise that resolves to the NftDetail if owned, or null otherwise.\n */\n async validateNFTOwnership(\n accountId: string,\n tokenId: string,\n serialNumber: number\n ): Promise<NftDetail | null> {\n this.logger.info(\n `Validating ownership of NFT ${tokenId} SN ${serialNumber} for account ${accountId}`\n );\n try {\n const nfts = await this.getAccountNfts(accountId, tokenId);\n if (nfts) {\n const foundNft = nfts.find(\n (nft) =>\n nft.token_id === tokenId && nft.serial_number === serialNumber\n );\n return foundNft || null;\n }\n return null;\n } catch (error: any) {\n this.logger.error(`Error validating NFT ownership: ${error.message}`);\n return null;\n }\n }\n\n /**\n * Performs a read-only query against a smart contract (eth_call like).\n * @param contractIdOrAddress The contract ID (e.g., \"0.0.123\") or EVM address (e.g., \"0x...\").\n * @param functionSelector The function selector and encoded parameters (e.g., \"0xabcdef12...\").\n * @param payerAccountId The account ID of the payer (not strictly payer for read-only, but often required as 'from').\n * @param estimate Whether this is an estimate call. Mirror node might not support this directly in /contracts/call for true estimation.\n * @param block Block parameter, e.g., \"latest\", \"pending\", or block number.\n * @param value The value in tinybars to send with the call (for payable view/pure functions, usually 0).\n * @returns A promise that resolves to the contract call query response or null.\n */\n async readSmartContractQuery(\n contractIdOrAddress: string,\n functionSelector: string,\n payerAccountId: string,\n options?: {\n estimate?: boolean;\n block?: string;\n value?: number;\n gas?: number;\n gasPrice?: number;\n }\n ): Promise<ContractCallQueryResponse | null> {\n this.logger.info(\n `Reading smart contract ${contractIdOrAddress} with selector ${functionSelector}`\n );\n const url = `${this.baseUrl}/api/v1/contracts/call`;\n\n const toAddress = contractIdOrAddress.startsWith('0x')\n ? contractIdOrAddress\n : `0x${AccountId.fromString(contractIdOrAddress).toSolidityAddress()}`;\n const fromAddress = payerAccountId.startsWith('0x')\n ? payerAccountId\n : `0x${AccountId.fromString(payerAccountId).toSolidityAddress()}`;\n\n const body: any = {\n block: options?.block || 'latest',\n data: functionSelector,\n estimate: options?.estimate || false,\n from: fromAddress,\n to: toAddress,\n gas: options?.gas,\n gasPrice: options?.gasPrice,\n value: options?.value || 0,\n };\n\n Object.keys(body).forEach((key) => {\n const K = key as keyof typeof body;\n if (body[K] === undefined) {\n delete body[K];\n }\n });\n\n try {\n const response = await this._fetchWithRetry<ContractCallQueryResponse>(\n url,\n {\n method: 'POST',\n body: JSON.stringify(body),\n headers: {\n 'Content-Type': 'application/json',\n },\n }\n );\n return response;\n } catch (error: any) {\n this.logger.error(\n `Error reading smart contract ${contractIdOrAddress}: ${error.message}`\n );\n return null;\n }\n }\n}\n"],"names":[],"mappings":";;;;;;AAgCO,MAAM,iBAAiB;AAAA,EAW5B,YAAY,SAAsB,QAAgB;AALlD,SAAQ,aAAqB;AAC7B,SAAQ,iBAAyB;AACjC,SAAQ,aAAqB;AAC7B,SAAQ,gBAAwB;AAG9B,SAAK,UAAU;AACV,SAAA,UAAU,KAAK,iBAAiB;AAChC,SAAA,SACH,UACA,IAAI,OAAO;AAAA,MACT,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA,CACT;AACE,SAAA,sBAAsB,OAAO,WAAW;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOxC,eAAe,QAA2B;AAC1C,SAAA,aAAa,OAAO,cAAc,KAAK;AACvC,SAAA,iBAAiB,OAAO,kBAAkB,KAAK;AAC/C,SAAA,aAAa,OAAO,cAAc,KAAK;AACvC,SAAA,gBAAgB,OAAO,iBAAiB,KAAK;AAClD,SAAK,OAAO;AAAA,MACV,2CAA2C,KAAK,UAAU,oBAAoB,KAAK,cAAc,gBAAgB,KAAK,UAAU,mBAAmB,KAAK,aAAa;AAAA,IACvK;AAAA,EAAA;AAAA,EAGM,mBAA2B;AAC1B,WAAA,KAAK,YAAY,YACpB,iDACA;AAAA,EAAA;AAAA,EAGN,aAAqB;AACnB,WAAO,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASd,MAAM,aAAa,WAAuC;AACxD,SAAK,OAAO,KAAK,kCAAkC,SAAS,EAAE;AAE9D,UAAM,cAAc,MAAM,KAAK,eAAe,SAAS;AAEnD,QAAA;AACF,UAAI,CAAC,eAAe,CAAC,YAAY,KAAK;AACpC,cAAM,IAAI;AAAA,UACR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