@hashgraphonline/standards-sdk 0.0.109 → 0.0.112-canary.0

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 (360) hide show
  1. package/dist/cjs/fees/fee-config-builder.d.ts +115 -0
  2. package/dist/cjs/fees/fee-config-builder.d.ts.map +1 -0
  3. package/dist/cjs/fees/index.d.ts +3 -0
  4. package/dist/cjs/fees/index.d.ts.map +1 -0
  5. package/dist/cjs/fees/types.d.ts +26 -0
  6. package/dist/cjs/fees/types.d.ts.map +1 -0
  7. package/dist/cjs/hcs-10/base-client.d.ts +289 -0
  8. package/dist/cjs/hcs-10/base-client.d.ts.map +1 -0
  9. package/dist/cjs/hcs-10/browser.d.ts +126 -0
  10. package/dist/cjs/hcs-10/browser.d.ts.map +1 -0
  11. package/dist/cjs/hcs-10/connections-manager.d.ts +357 -0
  12. package/dist/cjs/hcs-10/connections-manager.d.ts.map +1 -0
  13. package/dist/cjs/hcs-10/errors.d.ts +14 -0
  14. package/dist/cjs/hcs-10/errors.d.ts.map +1 -0
  15. package/dist/cjs/hcs-10/index.d.ts +8 -0
  16. package/dist/cjs/hcs-10/index.d.ts.map +1 -0
  17. package/dist/cjs/hcs-10/registrations.d.ts +49 -0
  18. package/dist/cjs/hcs-10/registrations.d.ts.map +1 -0
  19. package/dist/cjs/hcs-10/sdk.d.ts +193 -0
  20. package/dist/cjs/hcs-10/sdk.d.ts.map +1 -0
  21. package/dist/cjs/hcs-10/types.d.ts +205 -0
  22. package/dist/cjs/hcs-10/types.d.ts.map +1 -0
  23. package/dist/cjs/hcs-11/agent-builder.d.ts +53 -0
  24. package/dist/cjs/hcs-11/agent-builder.d.ts.map +1 -0
  25. package/dist/cjs/hcs-11/client.d.ts +82 -0
  26. package/dist/cjs/hcs-11/client.d.ts.map +1 -0
  27. package/dist/cjs/hcs-11/index.d.ts +5 -0
  28. package/dist/cjs/hcs-11/index.d.ts.map +1 -0
  29. package/dist/cjs/hcs-11/person-builder.d.ts +29 -0
  30. package/dist/cjs/hcs-11/person-builder.d.ts.map +1 -0
  31. package/dist/cjs/hcs-11/types.d.ts +165 -0
  32. package/dist/cjs/hcs-11/types.d.ts.map +1 -0
  33. package/dist/cjs/hcs-3/index.d.ts +2 -0
  34. package/dist/cjs/hcs-3/index.d.ts.map +1 -0
  35. package/dist/cjs/hcs-3/src/index.d.ts +47 -0
  36. package/dist/cjs/hcs-3/src/index.d.ts.map +1 -0
  37. package/dist/cjs/hcs-7/evm-bridge.d.ts +25 -0
  38. package/dist/cjs/hcs-7/evm-bridge.d.ts.map +1 -0
  39. package/dist/cjs/hcs-7/index.d.ts +3 -0
  40. package/dist/cjs/hcs-7/index.d.ts.map +1 -0
  41. package/dist/cjs/hcs-7/redis-cache.d.ts +26 -0
  42. package/dist/cjs/hcs-7/redis-cache.d.ts.map +1 -0
  43. package/dist/cjs/hcs-7/wasm-bridge.d.ts +72 -0
  44. package/dist/cjs/hcs-7/wasm-bridge.d.ts.map +1 -0
  45. package/dist/cjs/index-BmPzMkW9.cjs +11 -0
  46. package/dist/cjs/index-BmPzMkW9.cjs.map +1 -0
  47. package/dist/cjs/index-CHar8dVv-CUVf-if8.cjs +11 -0
  48. package/dist/cjs/index-CHar8dVv-CUVf-if8.cjs.map +1 -0
  49. package/dist/cjs/index.d.ts +9 -0
  50. package/dist/cjs/index.d.ts.map +1 -0
  51. package/dist/cjs/inscribe/index.d.ts +3 -0
  52. package/dist/cjs/inscribe/index.d.ts.map +1 -0
  53. package/dist/cjs/inscribe/inscriber.d.ts +34 -0
  54. package/dist/cjs/inscribe/inscriber.d.ts.map +1 -0
  55. package/dist/cjs/inscribe/types.d.ts +79 -0
  56. package/dist/cjs/inscribe/types.d.ts.map +1 -0
  57. package/dist/cjs/services/index.d.ts +3 -0
  58. package/dist/cjs/services/index.d.ts.map +1 -0
  59. package/dist/cjs/services/mirror-node.d.ts +444 -0
  60. package/dist/cjs/services/mirror-node.d.ts.map +1 -0
  61. package/dist/cjs/services/types.d.ts +573 -0
  62. package/dist/cjs/services/types.d.ts.map +1 -0
  63. package/dist/cjs/standards-sdk.cjs +2 -0
  64. package/dist/cjs/standards-sdk.cjs.map +1 -0
  65. package/dist/cjs/utils/hrl-resolver.d.ts +53 -0
  66. package/dist/cjs/utils/hrl-resolver.d.ts.map +1 -0
  67. package/dist/cjs/utils/index.d.ts +7 -0
  68. package/dist/cjs/utils/index.d.ts.map +1 -0
  69. package/dist/cjs/utils/logger.d.ts +24 -0
  70. package/dist/cjs/utils/logger.d.ts.map +1 -0
  71. package/dist/cjs/utils/parsers/crypto-parser.d.ts +14 -0
  72. package/dist/cjs/utils/parsers/crypto-parser.d.ts.map +1 -0
  73. package/dist/cjs/utils/parsers/file-parser.d.ts +9 -0
  74. package/dist/cjs/utils/parsers/file-parser.d.ts.map +1 -0
  75. package/dist/cjs/utils/parsers/hcs-parser.d.ts +9 -0
  76. package/dist/cjs/utils/parsers/hcs-parser.d.ts.map +1 -0
  77. package/dist/cjs/utils/parsers/hts-parser.d.ts +20 -0
  78. package/dist/cjs/utils/parsers/hts-parser.d.ts.map +1 -0
  79. package/dist/cjs/utils/parsers/parser-utils.d.ts +3 -0
  80. package/dist/cjs/utils/parsers/parser-utils.d.ts.map +1 -0
  81. package/dist/cjs/utils/parsers/scs-parser.d.ts +9 -0
  82. package/dist/cjs/utils/parsers/scs-parser.d.ts.map +1 -0
  83. package/dist/cjs/utils/parsers/util-parser.d.ts +6 -0
  84. package/dist/cjs/utils/parsers/util-parser.d.ts.map +1 -0
  85. package/dist/cjs/utils/progress-reporter.d.ts +54 -0
  86. package/dist/cjs/utils/progress-reporter.d.ts.map +1 -0
  87. package/dist/cjs/utils/sleep.d.ts +2 -0
  88. package/dist/cjs/utils/sleep.d.ts.map +1 -0
  89. package/dist/cjs/utils/topic-fee-utils.d.ts +12 -0
  90. package/dist/cjs/utils/topic-fee-utils.d.ts.map +1 -0
  91. package/dist/cjs/utils/transaction-parser-types.d.ts +317 -0
  92. package/dist/cjs/utils/transaction-parser-types.d.ts.map +1 -0
  93. package/dist/cjs/utils/transaction-parser.d.ts +40 -0
  94. package/dist/cjs/utils/transaction-parser.d.ts.map +1 -0
  95. package/dist/cjs/utils/types.d.ts +5 -0
  96. package/dist/cjs/utils/types.d.ts.map +1 -0
  97. package/dist/es/hcs-10/base-client.d.ts +46 -1
  98. package/dist/es/hcs-10/base-client.d.ts.map +1 -1
  99. package/dist/es/hcs-10/browser.d.ts +30 -0
  100. package/dist/es/hcs-10/browser.d.ts.map +1 -1
  101. package/dist/es/hcs-10/sdk.d.ts.map +1 -1
  102. package/dist/es/hcs-10/types.d.ts +34 -0
  103. package/dist/es/hcs-10/types.d.ts.map +1 -1
  104. package/dist/es/services/mirror-node.d.ts +231 -3
  105. package/dist/es/services/mirror-node.d.ts.map +1 -1
  106. package/dist/es/services/types.d.ts +328 -0
  107. package/dist/es/services/types.d.ts.map +1 -1
  108. package/dist/es/standards-sdk.es13.js +4 -4
  109. package/dist/es/standards-sdk.es13.js.map +1 -1
  110. package/dist/es/standards-sdk.es15.js +1 -1
  111. package/dist/es/standards-sdk.es18.js +1 -2
  112. package/dist/es/standards-sdk.es18.js.map +1 -1
  113. package/dist/es/standards-sdk.es19.js +10 -10
  114. package/dist/es/standards-sdk.es19.js.map +1 -1
  115. package/dist/es/standards-sdk.es20.js +2 -2
  116. package/dist/es/standards-sdk.es21.js +662 -15
  117. package/dist/es/standards-sdk.es21.js.map +1 -1
  118. package/dist/es/standards-sdk.es24.js +5543 -122
  119. package/dist/es/standards-sdk.es24.js.map +1 -1
  120. package/dist/es/standards-sdk.es25.js +2 -7190
  121. package/dist/es/standards-sdk.es25.js.map +1 -1
  122. package/dist/es/standards-sdk.es26.js +501 -3
  123. package/dist/es/standards-sdk.es26.js.map +1 -1
  124. package/dist/es/standards-sdk.es27.js +108 -8
  125. package/dist/es/standards-sdk.es27.js.map +1 -1
  126. package/dist/es/standards-sdk.es28.js +66 -2
  127. package/dist/es/standards-sdk.es28.js.map +1 -1
  128. package/dist/es/standards-sdk.es29.js +242 -4153
  129. package/dist/es/standards-sdk.es29.js.map +1 -1
  130. package/dist/es/standards-sdk.es30.js +169 -1037
  131. package/dist/es/standards-sdk.es30.js.map +1 -1
  132. package/dist/es/standards-sdk.es31.js +11 -5
  133. package/dist/es/standards-sdk.es31.js.map +1 -1
  134. package/dist/es/standards-sdk.es32.js +7136 -36
  135. package/dist/es/standards-sdk.es32.js.map +1 -1
  136. package/dist/es/standards-sdk.es33.js +41 -47
  137. package/dist/es/standards-sdk.es33.js.map +1 -1
  138. package/dist/es/standards-sdk.es4.js +2 -2
  139. package/dist/es/standards-sdk.es4.js.map +1 -1
  140. package/dist/es/standards-sdk.es5.js +11 -2
  141. package/dist/es/standards-sdk.es5.js.map +1 -1
  142. package/dist/es/standards-sdk.es7.js +7 -6
  143. package/dist/es/standards-sdk.es7.js.map +1 -1
  144. package/dist/es/standards-sdk.es8.js +6 -5
  145. package/dist/es/standards-sdk.es8.js.map +1 -1
  146. package/dist/es/standards-sdk.es9.js +1 -1
  147. package/dist/umd/hcs-10/base-client.d.ts +46 -1
  148. package/dist/umd/hcs-10/base-client.d.ts.map +1 -1
  149. package/dist/umd/hcs-10/browser.d.ts +30 -0
  150. package/dist/umd/hcs-10/browser.d.ts.map +1 -1
  151. package/dist/umd/hcs-10/sdk.d.ts.map +1 -1
  152. package/dist/umd/hcs-10/types.d.ts +34 -0
  153. package/dist/umd/hcs-10/types.d.ts.map +1 -1
  154. package/dist/umd/services/mirror-node.d.ts +231 -3
  155. package/dist/umd/services/mirror-node.d.ts.map +1 -1
  156. package/dist/umd/services/types.d.ts +328 -0
  157. package/dist/umd/services/types.d.ts.map +1 -1
  158. package/dist/umd/standards-sdk.umd.js +12 -12
  159. package/dist/umd/standards-sdk.umd.js.map +1 -1
  160. package/package.json +6 -5
  161. package/dist/es/standards-sdk.es100.js +0 -24
  162. package/dist/es/standards-sdk.es100.js.map +0 -1
  163. package/dist/es/standards-sdk.es101.js +0 -47
  164. package/dist/es/standards-sdk.es101.js.map +0 -1
  165. package/dist/es/standards-sdk.es102.js +0 -21
  166. package/dist/es/standards-sdk.es102.js.map +0 -1
  167. package/dist/es/standards-sdk.es103.js +0 -64
  168. package/dist/es/standards-sdk.es103.js.map +0 -1
  169. package/dist/es/standards-sdk.es104.js +0 -1292
  170. package/dist/es/standards-sdk.es104.js.map +0 -1
  171. package/dist/es/standards-sdk.es105.js +0 -151
  172. package/dist/es/standards-sdk.es105.js.map +0 -1
  173. package/dist/es/standards-sdk.es106.js +0 -94
  174. package/dist/es/standards-sdk.es106.js.map +0 -1
  175. package/dist/es/standards-sdk.es107.js +0 -87
  176. package/dist/es/standards-sdk.es107.js.map +0 -1
  177. package/dist/es/standards-sdk.es108.js +0 -35
  178. package/dist/es/standards-sdk.es108.js.map +0 -1
  179. package/dist/es/standards-sdk.es109.js +0 -9
  180. package/dist/es/standards-sdk.es109.js.map +0 -1
  181. package/dist/es/standards-sdk.es110.js +0 -162
  182. package/dist/es/standards-sdk.es110.js.map +0 -1
  183. package/dist/es/standards-sdk.es111.js +0 -26
  184. package/dist/es/standards-sdk.es111.js.map +0 -1
  185. package/dist/es/standards-sdk.es112.js +0 -796
  186. package/dist/es/standards-sdk.es112.js.map +0 -1
  187. package/dist/es/standards-sdk.es113.js +0 -2285
  188. package/dist/es/standards-sdk.es113.js.map +0 -1
  189. package/dist/es/standards-sdk.es114.js +0 -177
  190. package/dist/es/standards-sdk.es114.js.map +0 -1
  191. package/dist/es/standards-sdk.es115.js +0 -146
  192. package/dist/es/standards-sdk.es115.js.map +0 -1
  193. package/dist/es/standards-sdk.es116.js +0 -6
  194. package/dist/es/standards-sdk.es116.js.map +0 -1
  195. package/dist/es/standards-sdk.es117.js +0 -5
  196. package/dist/es/standards-sdk.es117.js.map +0 -1
  197. package/dist/es/standards-sdk.es118.js +0 -5
  198. package/dist/es/standards-sdk.es118.js.map +0 -1
  199. package/dist/es/standards-sdk.es119.js +0 -37
  200. package/dist/es/standards-sdk.es119.js.map +0 -1
  201. package/dist/es/standards-sdk.es120.js +0 -36
  202. package/dist/es/standards-sdk.es120.js.map +0 -1
  203. package/dist/es/standards-sdk.es121.js +0 -12
  204. package/dist/es/standards-sdk.es121.js.map +0 -1
  205. package/dist/es/standards-sdk.es122.js +0 -37
  206. package/dist/es/standards-sdk.es122.js.map +0 -1
  207. package/dist/es/standards-sdk.es123.js +0 -24
  208. package/dist/es/standards-sdk.es123.js.map +0 -1
  209. package/dist/es/standards-sdk.es124.js +0 -30
  210. package/dist/es/standards-sdk.es124.js.map +0 -1
  211. package/dist/es/standards-sdk.es125.js +0 -29
  212. package/dist/es/standards-sdk.es125.js.map +0 -1
  213. package/dist/es/standards-sdk.es126.js +0 -41
  214. package/dist/es/standards-sdk.es126.js.map +0 -1
  215. package/dist/es/standards-sdk.es127.js +0 -7139
  216. package/dist/es/standards-sdk.es127.js.map +0 -1
  217. package/dist/es/standards-sdk.es128.js +0 -13
  218. package/dist/es/standards-sdk.es128.js.map +0 -1
  219. package/dist/es/standards-sdk.es129.js +0 -14
  220. package/dist/es/standards-sdk.es129.js.map +0 -1
  221. package/dist/es/standards-sdk.es130.js +0 -21
  222. package/dist/es/standards-sdk.es130.js.map +0 -1
  223. package/dist/es/standards-sdk.es131.js +0 -9
  224. package/dist/es/standards-sdk.es131.js.map +0 -1
  225. package/dist/es/standards-sdk.es132.js +0 -12
  226. package/dist/es/standards-sdk.es132.js.map +0 -1
  227. package/dist/es/standards-sdk.es133.js +0 -45
  228. package/dist/es/standards-sdk.es133.js.map +0 -1
  229. package/dist/es/standards-sdk.es34.js +0 -504
  230. package/dist/es/standards-sdk.es34.js.map +0 -1
  231. package/dist/es/standards-sdk.es35.js +0 -112
  232. package/dist/es/standards-sdk.es35.js.map +0 -1
  233. package/dist/es/standards-sdk.es36.js +0 -69
  234. package/dist/es/standards-sdk.es36.js.map +0 -1
  235. package/dist/es/standards-sdk.es37.js +0 -260
  236. package/dist/es/standards-sdk.es37.js.map +0 -1
  237. package/dist/es/standards-sdk.es38.js +0 -176
  238. package/dist/es/standards-sdk.es38.js.map +0 -1
  239. package/dist/es/standards-sdk.es39.js +0 -14
  240. package/dist/es/standards-sdk.es39.js.map +0 -1
  241. package/dist/es/standards-sdk.es40.js +0 -13
  242. package/dist/es/standards-sdk.es40.js.map +0 -1
  243. package/dist/es/standards-sdk.es41.js +0 -422
  244. package/dist/es/standards-sdk.es41.js.map +0 -1
  245. package/dist/es/standards-sdk.es42.js +0 -5
  246. package/dist/es/standards-sdk.es42.js.map +0 -1
  247. package/dist/es/standards-sdk.es43.js +0 -123
  248. package/dist/es/standards-sdk.es43.js.map +0 -1
  249. package/dist/es/standards-sdk.es44.js +0 -7
  250. package/dist/es/standards-sdk.es44.js.map +0 -1
  251. package/dist/es/standards-sdk.es45.js +0 -367
  252. package/dist/es/standards-sdk.es45.js.map +0 -1
  253. package/dist/es/standards-sdk.es46.js +0 -9
  254. package/dist/es/standards-sdk.es46.js.map +0 -1
  255. package/dist/es/standards-sdk.es47.js +0 -182
  256. package/dist/es/standards-sdk.es47.js.map +0 -1
  257. package/dist/es/standards-sdk.es48.js +0 -84
  258. package/dist/es/standards-sdk.es48.js.map +0 -1
  259. package/dist/es/standards-sdk.es49.js +0 -117
  260. package/dist/es/standards-sdk.es49.js.map +0 -1
  261. package/dist/es/standards-sdk.es50.js +0 -55
  262. package/dist/es/standards-sdk.es50.js.map +0 -1
  263. package/dist/es/standards-sdk.es51.js +0 -13
  264. package/dist/es/standards-sdk.es51.js.map +0 -1
  265. package/dist/es/standards-sdk.es52.js +0 -100
  266. package/dist/es/standards-sdk.es52.js.map +0 -1
  267. package/dist/es/standards-sdk.es53.js +0 -7
  268. package/dist/es/standards-sdk.es53.js.map +0 -1
  269. package/dist/es/standards-sdk.es54.js +0 -5
  270. package/dist/es/standards-sdk.es54.js.map +0 -1
  271. package/dist/es/standards-sdk.es55.js +0 -116
  272. package/dist/es/standards-sdk.es55.js.map +0 -1
  273. package/dist/es/standards-sdk.es56.js +0 -77
  274. package/dist/es/standards-sdk.es56.js.map +0 -1
  275. package/dist/es/standards-sdk.es57.js +0 -9
  276. package/dist/es/standards-sdk.es57.js.map +0 -1
  277. package/dist/es/standards-sdk.es58.js +0 -8
  278. package/dist/es/standards-sdk.es58.js.map +0 -1
  279. package/dist/es/standards-sdk.es59.js +0 -224
  280. package/dist/es/standards-sdk.es59.js.map +0 -1
  281. package/dist/es/standards-sdk.es60.js +0 -61
  282. package/dist/es/standards-sdk.es60.js.map +0 -1
  283. package/dist/es/standards-sdk.es61.js +0 -72
  284. package/dist/es/standards-sdk.es61.js.map +0 -1
  285. package/dist/es/standards-sdk.es62.js +0 -6
  286. package/dist/es/standards-sdk.es62.js.map +0 -1
  287. package/dist/es/standards-sdk.es63.js +0 -167
  288. package/dist/es/standards-sdk.es63.js.map +0 -1
  289. package/dist/es/standards-sdk.es64.js +0 -35
  290. package/dist/es/standards-sdk.es64.js.map +0 -1
  291. package/dist/es/standards-sdk.es65.js +0 -66
  292. package/dist/es/standards-sdk.es65.js.map +0 -1
  293. package/dist/es/standards-sdk.es66.js +0 -53
  294. package/dist/es/standards-sdk.es66.js.map +0 -1
  295. package/dist/es/standards-sdk.es67.js +0 -13
  296. package/dist/es/standards-sdk.es67.js.map +0 -1
  297. package/dist/es/standards-sdk.es68.js +0 -68
  298. package/dist/es/standards-sdk.es68.js.map +0 -1
  299. package/dist/es/standards-sdk.es69.js +0 -9
  300. package/dist/es/standards-sdk.es69.js.map +0 -1
  301. package/dist/es/standards-sdk.es70.js +0 -18
  302. package/dist/es/standards-sdk.es70.js.map +0 -1
  303. package/dist/es/standards-sdk.es71.js +0 -10
  304. package/dist/es/standards-sdk.es71.js.map +0 -1
  305. package/dist/es/standards-sdk.es72.js +0 -48
  306. package/dist/es/standards-sdk.es72.js.map +0 -1
  307. package/dist/es/standards-sdk.es73.js +0 -5
  308. package/dist/es/standards-sdk.es73.js.map +0 -1
  309. package/dist/es/standards-sdk.es74.js +0 -139
  310. package/dist/es/standards-sdk.es74.js.map +0 -1
  311. package/dist/es/standards-sdk.es75.js +0 -175
  312. package/dist/es/standards-sdk.es75.js.map +0 -1
  313. package/dist/es/standards-sdk.es76.js +0 -5
  314. package/dist/es/standards-sdk.es76.js.map +0 -1
  315. package/dist/es/standards-sdk.es77.js +0 -16
  316. package/dist/es/standards-sdk.es77.js.map +0 -1
  317. package/dist/es/standards-sdk.es78.js +0 -16
  318. package/dist/es/standards-sdk.es78.js.map +0 -1
  319. package/dist/es/standards-sdk.es79.js +0 -104
  320. package/dist/es/standards-sdk.es79.js.map +0 -1
  321. package/dist/es/standards-sdk.es80.js +0 -5
  322. package/dist/es/standards-sdk.es80.js.map +0 -1
  323. package/dist/es/standards-sdk.es81.js +0 -19
  324. package/dist/es/standards-sdk.es81.js.map +0 -1
  325. package/dist/es/standards-sdk.es82.js +0 -412
  326. package/dist/es/standards-sdk.es82.js.map +0 -1
  327. package/dist/es/standards-sdk.es83.js +0 -35
  328. package/dist/es/standards-sdk.es83.js.map +0 -1
  329. package/dist/es/standards-sdk.es84.js +0 -18
  330. package/dist/es/standards-sdk.es84.js.map +0 -1
  331. package/dist/es/standards-sdk.es85.js +0 -7
  332. package/dist/es/standards-sdk.es85.js.map +0 -1
  333. package/dist/es/standards-sdk.es86.js +0 -7
  334. package/dist/es/standards-sdk.es86.js.map +0 -1
  335. package/dist/es/standards-sdk.es87.js +0 -19
  336. package/dist/es/standards-sdk.es87.js.map +0 -1
  337. package/dist/es/standards-sdk.es88.js +0 -8
  338. package/dist/es/standards-sdk.es88.js.map +0 -1
  339. package/dist/es/standards-sdk.es89.js +0 -42
  340. package/dist/es/standards-sdk.es89.js.map +0 -1
  341. package/dist/es/standards-sdk.es90.js +0 -43
  342. package/dist/es/standards-sdk.es90.js.map +0 -1
  343. package/dist/es/standards-sdk.es91.js +0 -40
  344. package/dist/es/standards-sdk.es91.js.map +0 -1
  345. package/dist/es/standards-sdk.es92.js +0 -81
  346. package/dist/es/standards-sdk.es92.js.map +0 -1
  347. package/dist/es/standards-sdk.es93.js +0 -198
  348. package/dist/es/standards-sdk.es93.js.map +0 -1
  349. package/dist/es/standards-sdk.es94.js +0 -441
  350. package/dist/es/standards-sdk.es94.js.map +0 -1
  351. package/dist/es/standards-sdk.es95.js +0 -28
  352. package/dist/es/standards-sdk.es95.js.map +0 -1
  353. package/dist/es/standards-sdk.es96.js +0 -142
  354. package/dist/es/standards-sdk.es96.js.map +0 -1
  355. package/dist/es/standards-sdk.es97.js +0 -21
  356. package/dist/es/standards-sdk.es97.js.map +0 -1
  357. package/dist/es/standards-sdk.es98.js +0 -32
  358. package/dist/es/standards-sdk.es98.js.map +0 -1
  359. package/dist/es/standards-sdk.es99.js +0 -32
  360. package/dist/es/standards-sdk.es99.js.map +0 -1
@@ -1,22 +1,29 @@
1
- import Buffer from "./standards-sdk.es24.js";
1
+ import Buffer from "vite-plugin-node-polyfills/shims/buffer";
2
2
  import { PublicKey, Timestamp, AccountId } from "@hashgraph/sdk";
3
- import "./standards-sdk.es32.js";
3
+ import axios from "axios";
4
4
  import { Logger } from "./standards-sdk.es15.js";
5
5
  import { proto } from "@hashgraph/proto";
6
- import axios from "./standards-sdk.es33.js";
7
6
  class HederaMirrorNode {
8
- constructor(network, logger) {
7
+ constructor(network, logger, config) {
9
8
  this.maxRetries = 3;
10
9
  this.initialDelayMs = 1e3;
11
10
  this.maxDelayMs = 3e4;
12
11
  this.backoffFactor = 2;
13
12
  this.network = network;
14
- this.baseUrl = this.getMirrorNodeUrl();
13
+ this.apiKey = config?.apiKey;
14
+ this.customHeaders = config?.headers || {};
15
+ this.baseUrl = config?.customUrl || this.getMirrorNodeUrl();
15
16
  this.logger = logger || new Logger({
16
17
  level: "debug",
17
18
  module: "MirrorNode"
18
19
  });
19
20
  this.isServerEnvironment = typeof window === "undefined";
21
+ if (config?.customUrl) {
22
+ this.logger.info(`Using custom mirror node URL: ${config.customUrl}`);
23
+ }
24
+ if (config?.apiKey) {
25
+ this.logger.info("Using API key for mirror node requests");
26
+ }
20
27
  }
21
28
  /**
22
29
  * Configures the retry mechanism for API requests.
@@ -31,6 +38,36 @@ class HederaMirrorNode {
31
38
  `Retry configuration updated: maxRetries=${this.maxRetries}, initialDelayMs=${this.initialDelayMs}, maxDelayMs=${this.maxDelayMs}, backoffFactor=${this.backoffFactor}`
32
39
  );
33
40
  }
41
+ /**
42
+ * Updates the mirror node configuration.
43
+ * @param config The new mirror node configuration.
44
+ */
45
+ configureMirrorNode(config) {
46
+ if (config.customUrl) {
47
+ this.baseUrl = config.customUrl;
48
+ this.logger.info(`Updated mirror node URL: ${config.customUrl}`);
49
+ }
50
+ if (config.apiKey) {
51
+ this.apiKey = config.apiKey;
52
+ this.logger.info("Updated API key for mirror node requests");
53
+ }
54
+ if (config.headers) {
55
+ this.customHeaders = { ...this.customHeaders, ...config.headers };
56
+ this.logger.info("Updated custom headers for mirror node requests");
57
+ }
58
+ }
59
+ /**
60
+ * Constructs a full URL for API requests, handling custom providers with API keys in the path.
61
+ * @param endpoint The API endpoint (e.g., '/api/v1/accounts/0.0.123')
62
+ * @returns The full URL for the request
63
+ */
64
+ constructUrl(endpoint) {
65
+ if (this.baseUrl.includes("<API-KEY>") && this.apiKey) {
66
+ const baseUrlWithKey = this.baseUrl.replace("<API-KEY>", this.apiKey);
67
+ return endpoint.startsWith("/") ? `${baseUrlWithKey}${endpoint}` : `${baseUrlWithKey}/${endpoint}`;
68
+ }
69
+ return endpoint.startsWith("/") ? `${this.baseUrl}${endpoint}` : `${this.baseUrl}/${endpoint}`;
70
+ }
34
71
  getMirrorNodeUrl() {
35
72
  return this.network === "mainnet" ? "https://mainnet-public.mirrornode.hedera.com" : "https://testnet.mirrornode.hedera.com";
36
73
  }
@@ -68,7 +105,7 @@ class HederaMirrorNode {
68
105
  */
69
106
  async getAccountMemo(accountId) {
70
107
  this.logger.info(`Getting account memo for account ID: ${accountId}`);
71
- const accountInfoUrl = `${this.baseUrl}/api/v1/accounts/${accountId}`;
108
+ const accountInfoUrl = this.constructUrl(`/api/v1/accounts/${accountId}`);
72
109
  try {
73
110
  const accountInfo = await this._requestWithRetry(
74
111
  accountInfoUrl
@@ -94,7 +131,7 @@ class HederaMirrorNode {
94
131
  */
95
132
  async getTopicInfo(topicId) {
96
133
  try {
97
- const topicInfoUrl = `${this.baseUrl}/api/v1/topics/${topicId}`;
134
+ const topicInfoUrl = this.constructUrl(`/api/v1/topics/${topicId}`);
98
135
  this.logger.debug(`Fetching topic info from ${topicInfoUrl}`);
99
136
  const data = await this._requestWithRetry(topicInfoUrl);
100
137
  return data;
@@ -152,7 +189,7 @@ class HederaMirrorNode {
152
189
  async getTokenInfo(tokenId) {
153
190
  this.logger.debug(`Fetching token info for ${tokenId}`);
154
191
  try {
155
- const tokenInfoUrl = `${this.baseUrl}/api/v1/tokens/${tokenId}`;
192
+ const tokenInfoUrl = this.constructUrl(`/api/v1/tokens/${tokenId}`);
156
193
  const data = await this._requestWithRetry(
157
194
  tokenInfoUrl
158
195
  );
@@ -177,7 +214,7 @@ class HederaMirrorNode {
177
214
  */
178
215
  async getTopicMessages(topicId) {
179
216
  this.logger.trace(`Querying messages for topic ${topicId}`);
180
- let nextUrl = `${this.baseUrl}/api/v1/topics/${topicId}/messages`;
217
+ let nextUrl = this.constructUrl(`/api/v1/topics/${topicId}/messages`);
181
218
  const messages = [];
182
219
  while (nextUrl) {
183
220
  try {
@@ -231,7 +268,7 @@ class HederaMirrorNode {
231
268
  }
232
269
  }
233
270
  }
234
- nextUrl = data.links?.next ? `${this.baseUrl}${data.links.next}` : "";
271
+ nextUrl = data.links?.next ? this.constructUrl(data.links.next) : "";
235
272
  } catch (e) {
236
273
  const error = e;
237
274
  const logMessage = `Error querying topic messages for topic ${topicId} (URL: ${nextUrl}) after retries: ${error.message}`;
@@ -249,7 +286,7 @@ class HederaMirrorNode {
249
286
  */
250
287
  async requestAccount(accountId) {
251
288
  try {
252
- const accountInfoUrl = `${this.baseUrl}/api/v1/accounts/${accountId}`;
289
+ const accountInfoUrl = this.constructUrl(`/api/v1/accounts/${accountId}`);
253
290
  this.logger.debug(`Requesting account info from ${accountInfoUrl}`);
254
291
  const data = await this._requestWithRetry(
255
292
  accountInfoUrl
@@ -446,9 +483,23 @@ class HederaMirrorNode {
446
483
  async _requestWithRetry(url, axiosConfig) {
447
484
  let attempt = 0;
448
485
  let delay = this.initialDelayMs;
486
+ const config = {
487
+ ...axiosConfig,
488
+ headers: {
489
+ ...this.customHeaders,
490
+ ...axiosConfig?.headers
491
+ }
492
+ };
493
+ if (this.apiKey) {
494
+ config.headers = {
495
+ ...config.headers,
496
+ Authorization: `Bearer ${this.apiKey}`,
497
+ "X-API-Key": this.apiKey
498
+ };
499
+ }
449
500
  while (attempt < this.maxRetries) {
450
501
  try {
451
- const response = await axios.get(url, axiosConfig);
502
+ const response = await axios.get(url, config);
452
503
  return response.data;
453
504
  } catch (error) {
454
505
  attempt++;
@@ -483,9 +534,33 @@ class HederaMirrorNode {
483
534
  async _fetchWithRetry(url, fetchOptions) {
484
535
  let attempt = 0;
485
536
  let delay = this.initialDelayMs;
537
+ const headers = {
538
+ ...this.customHeaders
539
+ };
540
+ if (fetchOptions?.headers) {
541
+ if (fetchOptions.headers instanceof Headers) {
542
+ fetchOptions.headers.forEach((value, key) => {
543
+ headers[key] = value;
544
+ });
545
+ } else if (Array.isArray(fetchOptions.headers)) {
546
+ fetchOptions.headers.forEach(([key, value]) => {
547
+ headers[key] = value;
548
+ });
549
+ } else {
550
+ Object.assign(headers, fetchOptions.headers);
551
+ }
552
+ }
553
+ if (this.apiKey) {
554
+ headers["Authorization"] = `Bearer ${this.apiKey}`;
555
+ headers["X-API-Key"] = this.apiKey;
556
+ }
557
+ const options = {
558
+ ...fetchOptions,
559
+ headers
560
+ };
486
561
  while (attempt < this.maxRetries) {
487
562
  try {
488
- const request = await fetch(url, fetchOptions);
563
+ const request = await fetch(url, options);
489
564
  if (!request.ok) {
490
565
  if (request.status >= 400 && request.status < 500 && request.status !== 429) {
491
566
  this.logger.error(
@@ -525,8 +600,8 @@ class HederaMirrorNode {
525
600
  * @param accountId The ID of the account.
526
601
  * @returns A promise that resolves to the HBAR balance or null if an error occurs.
527
602
  */
528
- async getAccountBalanceNumerical(accountId) {
529
- this.logger.info(`Getting numerical balance for account ${accountId}`);
603
+ async getAccountBalance(accountId) {
604
+ this.logger.info(`Getting balance for account ${accountId}`);
530
605
  try {
531
606
  const accountInfo = await this.requestAccount(accountId);
532
607
  if (accountInfo && accountInfo.balance) {
@@ -833,6 +908,578 @@ class HederaMirrorNode {
833
908
  return null;
834
909
  }
835
910
  }
911
+ /**
912
+ * Retrieves token airdrops for a given account ID.
913
+ * @param accountId The ID of the account to retrieve airdrops for.
914
+ * @param limit The maximum number of airdrops to return.
915
+ * @returns A promise that resolves to an array of TokenAirdrop or null.
916
+ */
917
+ async getTokenAirdrops(accountId, limit = 100) {
918
+ this.logger.info(`Getting token airdrops for account ${accountId}`);
919
+ const url = `${this.baseUrl}/api/v1/accounts/${accountId}/airdrops/tokens?limit=${limit}`;
920
+ try {
921
+ const response = await this._requestWithRetry(url);
922
+ return response.airdrops || [];
923
+ } catch (error) {
924
+ this.logger.error(
925
+ `Error fetching token airdrops for account ${accountId}: ${error.message}`
926
+ );
927
+ return null;
928
+ }
929
+ }
930
+ /**
931
+ * Retrieves blocks from the network.
932
+ * @param options Optional parameters for filtering blocks.
933
+ * @returns A promise that resolves to an array of Block or null.
934
+ */
935
+ async getBlocks(options) {
936
+ this.logger.info("Getting blocks from the network");
937
+ let url = `${this.baseUrl}/api/v1/blocks`;
938
+ const params = new URLSearchParams();
939
+ if (options?.limit) {
940
+ params.append("limit", options.limit.toString());
941
+ }
942
+ if (options?.order) {
943
+ params.append("order", options.order);
944
+ }
945
+ if (options?.timestamp) {
946
+ params.append("timestamp", options.timestamp);
947
+ }
948
+ if (options?.blockNumber) {
949
+ params.append("block.number", options.blockNumber);
950
+ }
951
+ const queryString = params.toString();
952
+ if (queryString) {
953
+ url += `?${queryString}`;
954
+ }
955
+ try {
956
+ const response = await this._requestWithRetry(url);
957
+ return response.blocks || [];
958
+ } catch (error) {
959
+ this.logger.error(`Error fetching blocks: ${error.message}`);
960
+ return null;
961
+ }
962
+ }
963
+ /**
964
+ * Retrieves a specific block by number or hash.
965
+ * @param blockNumberOrHash The block number or hash.
966
+ * @returns A promise that resolves to a Block or null.
967
+ */
968
+ async getBlock(blockNumberOrHash) {
969
+ this.logger.info(`Getting block ${blockNumberOrHash}`);
970
+ const url = `${this.baseUrl}/api/v1/blocks/${blockNumberOrHash}`;
971
+ try {
972
+ const response = await this._requestWithRetry(url);
973
+ return response;
974
+ } catch (error) {
975
+ this.logger.error(
976
+ `Error fetching block ${blockNumberOrHash}: ${error.message}`
977
+ );
978
+ return null;
979
+ }
980
+ }
981
+ /**
982
+ * Retrieves contract entities from the network.
983
+ * @param options Optional parameters for filtering contracts.
984
+ * @returns A promise that resolves to an array of ContractEntity or null.
985
+ */
986
+ async getContracts(options) {
987
+ this.logger.info("Getting contracts from the network");
988
+ let url = `${this.baseUrl}/api/v1/contracts`;
989
+ const params = new URLSearchParams();
990
+ if (options?.contractId) {
991
+ params.append("contract.id", options.contractId);
992
+ }
993
+ if (options?.limit) {
994
+ params.append("limit", options.limit.toString());
995
+ }
996
+ if (options?.order) {
997
+ params.append("order", options.order);
998
+ }
999
+ const queryString = params.toString();
1000
+ if (queryString) {
1001
+ url += `?${queryString}`;
1002
+ }
1003
+ try {
1004
+ const response = await this._requestWithRetry(url);
1005
+ return response.contracts || [];
1006
+ } catch (error) {
1007
+ this.logger.error(`Error fetching contracts: ${error.message}`);
1008
+ return null;
1009
+ }
1010
+ }
1011
+ /**
1012
+ * Retrieves a specific contract by ID or address.
1013
+ * @param contractIdOrAddress The contract ID or EVM address.
1014
+ * @param timestamp Optional timestamp for historical data.
1015
+ * @returns A promise that resolves to a ContractEntity or null.
1016
+ */
1017
+ async getContract(contractIdOrAddress, timestamp) {
1018
+ this.logger.info(`Getting contract ${contractIdOrAddress}`);
1019
+ let url = `${this.baseUrl}/api/v1/contracts/${contractIdOrAddress}`;
1020
+ if (timestamp) {
1021
+ url += `?timestamp=${timestamp}`;
1022
+ }
1023
+ try {
1024
+ const response = await this._requestWithRetry(url);
1025
+ return response;
1026
+ } catch (error) {
1027
+ this.logger.error(
1028
+ `Error fetching contract ${contractIdOrAddress}: ${error.message}`
1029
+ );
1030
+ return null;
1031
+ }
1032
+ }
1033
+ /**
1034
+ * Retrieves contract results from the network.
1035
+ * @param options Optional parameters for filtering contract results.
1036
+ * @returns A promise that resolves to an array of ContractResult or null.
1037
+ */
1038
+ async getContractResults(options) {
1039
+ this.logger.info("Getting contract results from the network");
1040
+ let url = `${this.baseUrl}/api/v1/contracts/results`;
1041
+ const params = new URLSearchParams();
1042
+ if (options?.from) {
1043
+ params.append("from", options.from);
1044
+ }
1045
+ if (options?.blockHash) {
1046
+ params.append("block.hash", options.blockHash);
1047
+ }
1048
+ if (options?.blockNumber) {
1049
+ params.append("block.number", options.blockNumber);
1050
+ }
1051
+ if (options?.internal !== void 0) {
1052
+ params.append("internal", options.internal.toString());
1053
+ }
1054
+ if (options?.limit) {
1055
+ params.append("limit", options.limit.toString());
1056
+ }
1057
+ if (options?.order) {
1058
+ params.append("order", options.order);
1059
+ }
1060
+ if (options?.timestamp) {
1061
+ params.append("timestamp", options.timestamp);
1062
+ }
1063
+ if (options?.transactionIndex) {
1064
+ params.append("transaction.index", options.transactionIndex.toString());
1065
+ }
1066
+ const queryString = params.toString();
1067
+ if (queryString) {
1068
+ url += `?${queryString}`;
1069
+ }
1070
+ try {
1071
+ const response = await this._requestWithRetry(
1072
+ url
1073
+ );
1074
+ return response.results || [];
1075
+ } catch (error) {
1076
+ this.logger.error(`Error fetching contract results: ${error.message}`);
1077
+ return null;
1078
+ }
1079
+ }
1080
+ /**
1081
+ * Retrieves a specific contract result by transaction ID or hash.
1082
+ * @param transactionIdOrHash The transaction ID or hash.
1083
+ * @param nonce Optional nonce filter.
1084
+ * @returns A promise that resolves to a ContractResult or null.
1085
+ */
1086
+ async getContractResult(transactionIdOrHash, nonce) {
1087
+ this.logger.info(`Getting contract result for ${transactionIdOrHash}`);
1088
+ let url = `${this.baseUrl}/api/v1/contracts/results/${transactionIdOrHash}`;
1089
+ if (nonce !== void 0) {
1090
+ url += `?nonce=${nonce}`;
1091
+ }
1092
+ try {
1093
+ const response = await this._requestWithRetry(url);
1094
+ return response;
1095
+ } catch (error) {
1096
+ this.logger.error(
1097
+ `Error fetching contract result for ${transactionIdOrHash}: ${error.message}`
1098
+ );
1099
+ return null;
1100
+ }
1101
+ }
1102
+ /**
1103
+ * Retrieves contract results for a specific contract.
1104
+ * @param contractIdOrAddress The contract ID or EVM address.
1105
+ * @param options Optional parameters for filtering.
1106
+ * @returns A promise that resolves to an array of ContractResult or null.
1107
+ */
1108
+ async getContractResultsByContract(contractIdOrAddress, options) {
1109
+ this.logger.info(
1110
+ `Getting contract results for contract ${contractIdOrAddress}`
1111
+ );
1112
+ let url = `${this.baseUrl}/api/v1/contracts/${contractIdOrAddress}/results`;
1113
+ const params = new URLSearchParams();
1114
+ if (options?.blockHash) {
1115
+ params.append("block.hash", options.blockHash);
1116
+ }
1117
+ if (options?.blockNumber) {
1118
+ params.append("block.number", options.blockNumber);
1119
+ }
1120
+ if (options?.from) {
1121
+ params.append("from", options.from);
1122
+ }
1123
+ if (options?.internal !== void 0) {
1124
+ params.append("internal", options.internal.toString());
1125
+ }
1126
+ if (options?.limit) {
1127
+ params.append("limit", options.limit.toString());
1128
+ }
1129
+ if (options?.order) {
1130
+ params.append("order", options.order);
1131
+ }
1132
+ if (options?.timestamp) {
1133
+ params.append("timestamp", options.timestamp);
1134
+ }
1135
+ if (options?.transactionIndex) {
1136
+ params.append("transaction.index", options.transactionIndex.toString());
1137
+ }
1138
+ const queryString = params.toString();
1139
+ if (queryString) {
1140
+ url += `?${queryString}`;
1141
+ }
1142
+ try {
1143
+ const response = await this._requestWithRetry(
1144
+ url
1145
+ );
1146
+ return response.results || [];
1147
+ } catch (error) {
1148
+ this.logger.error(
1149
+ `Error fetching contract results for ${contractIdOrAddress}: ${error.message}`
1150
+ );
1151
+ return null;
1152
+ }
1153
+ }
1154
+ /**
1155
+ * Retrieves contract state for a specific contract.
1156
+ * @param contractIdOrAddress The contract ID or EVM address.
1157
+ * @param options Optional parameters for filtering.
1158
+ * @returns A promise that resolves to an array of ContractState or null.
1159
+ */
1160
+ async getContractState(contractIdOrAddress, options) {
1161
+ this.logger.info(`Getting contract state for ${contractIdOrAddress}`);
1162
+ let url = `${this.baseUrl}/api/v1/contracts/${contractIdOrAddress}/state`;
1163
+ const params = new URLSearchParams();
1164
+ if (options?.limit) {
1165
+ params.append("limit", options.limit.toString());
1166
+ }
1167
+ if (options?.order) {
1168
+ params.append("order", options.order);
1169
+ }
1170
+ if (options?.slot) {
1171
+ params.append("slot", options.slot);
1172
+ }
1173
+ if (options?.timestamp) {
1174
+ params.append("timestamp", options.timestamp);
1175
+ }
1176
+ const queryString = params.toString();
1177
+ if (queryString) {
1178
+ url += `?${queryString}`;
1179
+ }
1180
+ try {
1181
+ const response = await this._requestWithRetry(url);
1182
+ return response.state || [];
1183
+ } catch (error) {
1184
+ this.logger.error(
1185
+ `Error fetching contract state for ${contractIdOrAddress}: ${error.message}`
1186
+ );
1187
+ return null;
1188
+ }
1189
+ }
1190
+ /**
1191
+ * Retrieves contract actions for a specific transaction.
1192
+ * @param transactionIdOrHash The transaction ID or hash.
1193
+ * @param options Optional parameters for filtering.
1194
+ * @returns A promise that resolves to an array of ContractAction or null.
1195
+ */
1196
+ async getContractActions(transactionIdOrHash, options) {
1197
+ this.logger.info(`Getting contract actions for ${transactionIdOrHash}`);
1198
+ let url = `${this.baseUrl}/api/v1/contracts/results/${transactionIdOrHash}/actions`;
1199
+ const params = new URLSearchParams();
1200
+ if (options?.index) {
1201
+ params.append("index", options.index);
1202
+ }
1203
+ if (options?.limit) {
1204
+ params.append("limit", options.limit.toString());
1205
+ }
1206
+ if (options?.order) {
1207
+ params.append("order", options.order);
1208
+ }
1209
+ const queryString = params.toString();
1210
+ if (queryString) {
1211
+ url += `?${queryString}`;
1212
+ }
1213
+ try {
1214
+ const response = await this._requestWithRetry(
1215
+ url
1216
+ );
1217
+ return response.actions || [];
1218
+ } catch (error) {
1219
+ this.logger.error(
1220
+ `Error fetching contract actions for ${transactionIdOrHash}: ${error.message}`
1221
+ );
1222
+ return null;
1223
+ }
1224
+ }
1225
+ /**
1226
+ * Retrieves contract logs from the network.
1227
+ * @param options Optional parameters for filtering logs.
1228
+ * @returns A promise that resolves to an array of ContractLog or null.
1229
+ */
1230
+ async getContractLogs(options) {
1231
+ this.logger.info("Getting contract logs from the network");
1232
+ let url = `${this.baseUrl}/api/v1/contracts/results/logs`;
1233
+ const params = new URLSearchParams();
1234
+ if (options?.index) {
1235
+ params.append("index", options.index);
1236
+ }
1237
+ if (options?.limit) {
1238
+ params.append("limit", options.limit.toString());
1239
+ }
1240
+ if (options?.order) {
1241
+ params.append("order", options.order);
1242
+ }
1243
+ if (options?.timestamp) {
1244
+ params.append("timestamp", options.timestamp);
1245
+ }
1246
+ if (options?.topic0) {
1247
+ params.append("topic0", options.topic0);
1248
+ }
1249
+ if (options?.topic1) {
1250
+ params.append("topic1", options.topic1);
1251
+ }
1252
+ if (options?.topic2) {
1253
+ params.append("topic2", options.topic2);
1254
+ }
1255
+ if (options?.topic3) {
1256
+ params.append("topic3", options.topic3);
1257
+ }
1258
+ if (options?.transactionHash) {
1259
+ params.append("transaction.hash", options.transactionHash);
1260
+ }
1261
+ const queryString = params.toString();
1262
+ if (queryString) {
1263
+ url += `?${queryString}`;
1264
+ }
1265
+ try {
1266
+ const response = await this._requestWithRetry(url);
1267
+ return response.logs || [];
1268
+ } catch (error) {
1269
+ this.logger.error(`Error fetching contract logs: ${error.message}`);
1270
+ return null;
1271
+ }
1272
+ }
1273
+ /**
1274
+ * Retrieves contract logs for a specific contract.
1275
+ * @param contractIdOrAddress The contract ID or EVM address.
1276
+ * @param options Optional parameters for filtering logs.
1277
+ * @returns A promise that resolves to an array of ContractLog or null.
1278
+ */
1279
+ async getContractLogsByContract(contractIdOrAddress, options) {
1280
+ this.logger.info(
1281
+ `Getting contract logs for contract ${contractIdOrAddress}`
1282
+ );
1283
+ let url = `${this.baseUrl}/api/v1/contracts/${contractIdOrAddress}/results/logs`;
1284
+ const params = new URLSearchParams();
1285
+ if (options?.index) {
1286
+ params.append("index", options.index);
1287
+ }
1288
+ if (options?.limit) {
1289
+ params.append("limit", options.limit.toString());
1290
+ }
1291
+ if (options?.order) {
1292
+ params.append("order", options.order);
1293
+ }
1294
+ if (options?.timestamp) {
1295
+ params.append("timestamp", options.timestamp);
1296
+ }
1297
+ if (options?.topic0) {
1298
+ params.append("topic0", options.topic0);
1299
+ }
1300
+ if (options?.topic1) {
1301
+ params.append("topic1", options.topic1);
1302
+ }
1303
+ if (options?.topic2) {
1304
+ params.append("topic2", options.topic2);
1305
+ }
1306
+ if (options?.topic3) {
1307
+ params.append("topic3", options.topic3);
1308
+ }
1309
+ const queryString = params.toString();
1310
+ if (queryString) {
1311
+ url += `?${queryString}`;
1312
+ }
1313
+ try {
1314
+ const response = await this._requestWithRetry(url);
1315
+ return response.logs || [];
1316
+ } catch (error) {
1317
+ this.logger.error(
1318
+ `Error fetching contract logs for ${contractIdOrAddress}: ${error.message}`
1319
+ );
1320
+ return null;
1321
+ }
1322
+ }
1323
+ /**
1324
+ * Retrieves opcode traces for a specific transaction.
1325
+ * @param transactionIdOrHash The transaction ID or hash.
1326
+ * @param options Optional parameters for trace details.
1327
+ * @returns A promise that resolves to an OpcodeTraceResponse or null.
1328
+ */
1329
+ async getOpcodeTraces(transactionIdOrHash, options) {
1330
+ this.logger.info(`Getting opcode traces for ${transactionIdOrHash}`);
1331
+ let url = `${this.baseUrl}/api/v1/contracts/results/${transactionIdOrHash}/opcodes`;
1332
+ const params = new URLSearchParams();
1333
+ if (options?.stack !== void 0) {
1334
+ params.append("stack", options.stack.toString());
1335
+ }
1336
+ if (options?.memory !== void 0) {
1337
+ params.append("memory", options.memory.toString());
1338
+ }
1339
+ if (options?.storage !== void 0) {
1340
+ params.append("storage", options.storage.toString());
1341
+ }
1342
+ const queryString = params.toString();
1343
+ if (queryString) {
1344
+ url += `?${queryString}`;
1345
+ }
1346
+ try {
1347
+ const response = await this._requestWithRetry(url);
1348
+ return response;
1349
+ } catch (error) {
1350
+ this.logger.error(
1351
+ `Error fetching opcode traces for ${transactionIdOrHash}: ${error.message}`
1352
+ );
1353
+ return null;
1354
+ }
1355
+ }
1356
+ /**
1357
+ * Retrieves NFT information by token ID and serial number.
1358
+ * @param tokenId The token ID.
1359
+ * @param serialNumber The serial number of the NFT.
1360
+ * @returns A promise that resolves to an NftInfo or null.
1361
+ */
1362
+ async getNftInfo(tokenId, serialNumber) {
1363
+ this.logger.info(`Getting NFT info for ${tokenId}/${serialNumber}`);
1364
+ const url = `${this.baseUrl}/api/v1/tokens/${tokenId}/nfts/${serialNumber}`;
1365
+ try {
1366
+ const response = await this._requestWithRetry(url);
1367
+ return response.nft;
1368
+ } catch (error) {
1369
+ this.logger.error(
1370
+ `Error fetching NFT info for ${tokenId}/${serialNumber}: ${error.message}`
1371
+ );
1372
+ return null;
1373
+ }
1374
+ }
1375
+ /**
1376
+ * Retrieves NFTs for a specific token.
1377
+ * @param tokenId The token ID.
1378
+ * @param options Optional parameters for filtering NFTs.
1379
+ * @returns A promise that resolves to an array of NftInfo or null.
1380
+ */
1381
+ async getNftsByToken(tokenId, options) {
1382
+ this.logger.info(`Getting NFTs for token ${tokenId}`);
1383
+ let url = `${this.baseUrl}/api/v1/tokens/${tokenId}/nfts`;
1384
+ const params = new URLSearchParams();
1385
+ if (options?.accountId) {
1386
+ params.append("account.id", options.accountId);
1387
+ }
1388
+ if (options?.limit) {
1389
+ params.append("limit", options.limit.toString());
1390
+ }
1391
+ if (options?.order) {
1392
+ params.append("order", options.order);
1393
+ }
1394
+ if (options?.serialNumber) {
1395
+ params.append("serialnumber", options.serialNumber);
1396
+ }
1397
+ const queryString = params.toString();
1398
+ if (queryString) {
1399
+ url += `?${queryString}`;
1400
+ }
1401
+ try {
1402
+ const response = await this._requestWithRetry(url);
1403
+ return response.nfts || [];
1404
+ } catch (error) {
1405
+ this.logger.error(
1406
+ `Error fetching NFTs for token ${tokenId}: ${error.message}`
1407
+ );
1408
+ return null;
1409
+ }
1410
+ }
1411
+ /**
1412
+ * Retrieves network information.
1413
+ * @returns A promise that resolves to NetworkInfo or null.
1414
+ */
1415
+ async getNetworkInfo() {
1416
+ this.logger.info("Getting network information");
1417
+ const url = `${this.baseUrl}/api/v1/network/nodes`;
1418
+ try {
1419
+ const response = await this._requestWithRetry(url);
1420
+ return response;
1421
+ } catch (error) {
1422
+ this.logger.error(`Error fetching network info: ${error.message}`);
1423
+ return null;
1424
+ }
1425
+ }
1426
+ /**
1427
+ * Retrieves network fees.
1428
+ * @param timestamp Optional timestamp for historical fees.
1429
+ * @returns A promise that resolves to NetworkFees or null.
1430
+ */
1431
+ async getNetworkFees(timestamp) {
1432
+ this.logger.info("Getting network fees");
1433
+ let url = `${this.baseUrl}/api/v1/network/fees`;
1434
+ if (timestamp) {
1435
+ url += `?timestamp=${timestamp}`;
1436
+ }
1437
+ try {
1438
+ const response = await this._requestWithRetry(url);
1439
+ return response;
1440
+ } catch (error) {
1441
+ this.logger.error(`Error fetching network fees: ${error.message}`);
1442
+ return null;
1443
+ }
1444
+ }
1445
+ /**
1446
+ * Retrieves network supply information.
1447
+ * @param timestamp Optional timestamp for historical supply data.
1448
+ * @returns A promise that resolves to NetworkSupply or null.
1449
+ */
1450
+ async getNetworkSupply(timestamp) {
1451
+ this.logger.info("Getting network supply");
1452
+ let url = `${this.baseUrl}/api/v1/network/supply`;
1453
+ if (timestamp) {
1454
+ url += `?timestamp=${timestamp}`;
1455
+ }
1456
+ try {
1457
+ const response = await this._requestWithRetry(url);
1458
+ return response;
1459
+ } catch (error) {
1460
+ this.logger.error(`Error fetching network supply: ${error.message}`);
1461
+ return null;
1462
+ }
1463
+ }
1464
+ /**
1465
+ * Retrieves network stake information.
1466
+ * @param timestamp Optional timestamp for historical stake data.
1467
+ * @returns A promise that resolves to NetworkStake or null.
1468
+ */
1469
+ async getNetworkStake(timestamp) {
1470
+ this.logger.info("Getting network stake");
1471
+ let url = `${this.baseUrl}/api/v1/network/stake`;
1472
+ if (timestamp) {
1473
+ url += `?timestamp=${timestamp}`;
1474
+ }
1475
+ try {
1476
+ const response = await this._requestWithRetry(url);
1477
+ return response;
1478
+ } catch (error) {
1479
+ this.logger.error(`Error fetching network stake: ${error.message}`);
1480
+ return null;
1481
+ }
1482
+ }
836
1483
  }
837
1484
  export {
838
1485
  HederaMirrorNode