@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,1044 +1,176 @@
1
- var __defProp = Object.defineProperty;
2
- var __typeError = (msg) => {
3
- throw TypeError(msg);
4
- };
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
8
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
9
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
12
- var _errors, _events, _functions, _abiCoder, _Interface_instances, getFunction_fn, getEvent_fn;
13
- import { keccak256 } from "./standards-sdk.es111.js";
14
- import { AbiCoder } from "./standards-sdk.es93.js";
15
- import { Result } from "./standards-sdk.es94.js";
16
- import { Fragment, ConstructorFragment, FunctionFragment, EventFragment, ErrorFragment, ParamType } from "./standards-sdk.es104.js";
17
- import { Typed } from "./standards-sdk.es112.js";
18
- import { defineProperties } from "./standards-sdk.es108.js";
19
- import { assertArgument, assert } from "./standards-sdk.es105.js";
20
- import { isHexString, dataSlice, concat, getBytesCopy, hexlify, getBytes, zeroPadBytes, zeroPadValue } from "./standards-sdk.es106.js";
21
- import { id } from "./standards-sdk.es109.js";
22
- import { getBigInt, toBeHex } from "./standards-sdk.es110.js";
23
- class LogDescription {
24
- /**
25
- * @_ignore:
26
- */
27
- constructor(fragment, topic, args) {
28
- /**
29
- * The matching fragment for the ``topic0``.
30
- */
31
- __publicField(this, "fragment");
32
- /**
33
- * The name of the Event.
34
- */
35
- __publicField(this, "name");
36
- /**
37
- * The full Event signature.
38
- */
39
- __publicField(this, "signature");
40
- /**
41
- * The topic hash for the Event.
42
- */
43
- __publicField(this, "topic");
44
- /**
45
- * The arguments passed into the Event with ``emit``.
46
- */
47
- __publicField(this, "args");
48
- const name = fragment.name, signature = fragment.format();
49
- defineProperties(this, {
50
- fragment,
51
- name,
52
- signature,
53
- topic,
54
- args
55
- });
56
- }
57
- }
58
- class TransactionDescription {
59
- /**
60
- * @_ignore:
61
- */
62
- constructor(fragment, selector, args, value) {
63
- /**
64
- * The matching fragment from the transaction ``data``.
65
- */
66
- __publicField(this, "fragment");
67
- /**
68
- * The name of the Function from the transaction ``data``.
69
- */
70
- __publicField(this, "name");
71
- /**
72
- * The arguments passed to the Function from the transaction ``data``.
73
- */
74
- __publicField(this, "args");
75
- /**
76
- * The full Function signature from the transaction ``data``.
77
- */
78
- __publicField(this, "signature");
79
- /**
80
- * The selector for the Function from the transaction ``data``.
81
- */
82
- __publicField(this, "selector");
83
- /**
84
- * The ``value`` (in wei) from the transaction.
85
- */
86
- __publicField(this, "value");
87
- const name = fragment.name, signature = fragment.format();
88
- defineProperties(this, {
89
- fragment,
90
- name,
91
- args,
92
- signature,
93
- selector,
94
- value
95
- });
96
- }
97
- }
98
- class ErrorDescription {
99
- /**
100
- * @_ignore:
101
- */
102
- constructor(fragment, selector, args) {
103
- /**
104
- * The matching fragment.
105
- */
106
- __publicField(this, "fragment");
107
- /**
108
- * The name of the Error.
109
- */
110
- __publicField(this, "name");
111
- /**
112
- * The arguments passed to the Error with ``revert``.
113
- */
114
- __publicField(this, "args");
115
- /**
116
- * The full Error signature.
117
- */
118
- __publicField(this, "signature");
119
- /**
120
- * The selector for the Error.
121
- */
122
- __publicField(this, "selector");
123
- const name = fragment.name, signature = fragment.format();
124
- defineProperties(this, {
125
- fragment,
126
- name,
127
- args,
128
- signature,
129
- selector
130
- });
131
- }
132
- }
133
- class Indexed {
134
- /**
135
- * @_ignore:
136
- */
137
- constructor(hash) {
138
- /**
139
- * The ``keccak256`` of the value logged.
140
- */
141
- __publicField(this, "hash");
142
- /**
143
- * @_ignore:
144
- */
145
- __publicField(this, "_isIndexed");
146
- defineProperties(this, { hash, _isIndexed: true });
147
- }
148
- /**
149
- * Returns ``true`` if %%value%% is an **Indexed**.
150
- *
151
- * This provides a Type Guard for property access.
152
- */
153
- static isIndexed(value) {
154
- return !!(value && value._isIndexed);
155
- }
156
- }
157
- const PanicReasons = {
158
- "0": "generic panic",
159
- "1": "assert(false)",
160
- "17": "arithmetic overflow",
161
- "18": "division or modulo by zero",
162
- "33": "enum overflow",
163
- "34": "invalid encoded storage byte array accessed",
164
- "49": "out-of-bounds array access; popping on an empty array",
165
- "50": "out-of-bounds access of an array or bytesN",
166
- "65": "out of memory",
167
- "81": "uninitialized function"
168
- };
169
- const BuiltinErrors = {
170
- "0x08c379a0": {
171
- signature: "Error(string)",
172
- name: "Error",
173
- inputs: ["string"],
174
- reason: (message) => {
175
- return `reverted with reason string ${JSON.stringify(message)}`;
176
- }
177
- },
178
- "0x4e487b71": {
179
- signature: "Panic(uint256)",
180
- name: "Panic",
181
- inputs: ["uint256"],
182
- reason: (code) => {
183
- let reason = "unknown panic code";
184
- if (code >= 0 && code <= 255 && PanicReasons[code.toString()]) {
185
- reason = PanicReasons[code.toString()];
186
- }
187
- return `reverted with panic code 0x${code.toString(16)} (${reason})`;
188
- }
189
- }
190
- };
191
- const _Interface = class _Interface {
192
- /**
193
- * Create a new Interface for the %%fragments%%.
194
- */
195
- constructor(fragments) {
196
- __privateAdd(this, _Interface_instances);
197
- /**
198
- * All the Contract ABI members (i.e. methods, events, errors, etc).
199
- */
200
- __publicField(this, "fragments");
201
- /**
202
- * The Contract constructor.
203
- */
204
- __publicField(this, "deploy");
205
- /**
206
- * The Fallback method, if any.
207
- */
208
- __publicField(this, "fallback");
209
- /**
210
- * If receiving ether is supported.
211
- */
212
- __publicField(this, "receive");
213
- __privateAdd(this, _errors);
214
- __privateAdd(this, _events);
215
- __privateAdd(this, _functions);
216
- // #structs: Map<string, StructFragment>;
217
- __privateAdd(this, _abiCoder);
218
- let abi = [];
219
- if (typeof fragments === "string") {
220
- abi = JSON.parse(fragments);
221
- } else {
222
- abi = fragments;
223
- }
224
- __privateSet(this, _functions, /* @__PURE__ */ new Map());
225
- __privateSet(this, _errors, /* @__PURE__ */ new Map());
226
- __privateSet(this, _events, /* @__PURE__ */ new Map());
227
- const frags = [];
228
- for (const a of abi) {
229
- try {
230
- frags.push(Fragment.from(a));
231
- } catch (error) {
232
- console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`, error.message);
233
- }
234
- }
235
- defineProperties(this, {
236
- fragments: Object.freeze(frags)
237
- });
238
- let fallback = null;
239
- let receive = false;
240
- __privateSet(this, _abiCoder, this.getAbiCoder());
241
- this.fragments.forEach((fragment, index) => {
242
- let bucket;
243
- switch (fragment.type) {
244
- case "constructor":
245
- if (this.deploy) {
246
- console.log("duplicate definition - constructor");
247
- return;
248
- }
249
- defineProperties(this, { deploy: fragment });
250
- return;
251
- case "fallback":
252
- if (fragment.inputs.length === 0) {
253
- receive = true;
254
- } else {
255
- assertArgument(!fallback || fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment);
256
- fallback = fragment;
257
- receive = fallback.payable;
258
- }
259
- return;
260
- case "function":
261
- bucket = __privateGet(this, _functions);
262
- break;
263
- case "event":
264
- bucket = __privateGet(this, _events);
265
- break;
266
- case "error":
267
- bucket = __privateGet(this, _errors);
268
- break;
269
- default:
270
- return;
271
- }
272
- const signature = fragment.format();
273
- if (bucket.has(signature)) {
274
- return;
275
- }
276
- bucket.set(signature, fragment);
277
- });
278
- if (!this.deploy) {
279
- defineProperties(this, {
280
- deploy: ConstructorFragment.from("constructor()")
281
- });
282
- }
283
- defineProperties(this, { fallback, receive });
284
- }
285
- /**
286
- * Returns the entire Human-Readable ABI, as an array of
287
- * signatures, optionally as %%minimal%% strings, which
288
- * removes parameter names and unneceesary spaces.
289
- */
290
- format(minimal) {
291
- const format = minimal ? "minimal" : "full";
292
- const abi = this.fragments.map((f) => f.format(format));
293
- return abi;
294
- }
295
- /**
296
- * Return the JSON-encoded ABI. This is the format Solidiy
297
- * returns.
298
- */
299
- formatJson() {
300
- const abi = this.fragments.map((f) => f.format("json"));
301
- return JSON.stringify(abi.map((j) => JSON.parse(j)));
302
- }
303
- /**
304
- * The ABI coder that will be used to encode and decode binary
305
- * data.
306
- */
307
- getAbiCoder() {
308
- return AbiCoder.defaultAbiCoder();
309
- }
310
- /**
311
- * Get the function name for %%key%%, which may be a function selector,
312
- * function name or function signature that belongs to the ABI.
313
- */
314
- getFunctionName(key) {
315
- const fragment = __privateMethod(this, _Interface_instances, getFunction_fn).call(this, key, null, false);
316
- assertArgument(fragment, "no matching function", "key", key);
317
- return fragment.name;
318
- }
319
- /**
320
- * Returns true if %%key%% (a function selector, function name or
321
- * function signature) is present in the ABI.
322
- *
323
- * In the case of a function name, the name may be ambiguous, so
324
- * accessing the [[FunctionFragment]] may require refinement.
325
- */
326
- hasFunction(key) {
327
- return !!__privateMethod(this, _Interface_instances, getFunction_fn).call(this, key, null, false);
328
- }
329
- /**
330
- * Get the [[FunctionFragment]] for %%key%%, which may be a function
331
- * selector, function name or function signature that belongs to the ABI.
332
- *
333
- * If %%values%% is provided, it will use the Typed API to handle
334
- * ambiguous cases where multiple functions match by name.
335
- *
336
- * If the %%key%% and %%values%% do not refine to a single function in
337
- * the ABI, this will throw.
338
- */
339
- getFunction(key, values) {
340
- return __privateMethod(this, _Interface_instances, getFunction_fn).call(this, key, values || null, true);
341
- }
342
- /**
343
- * Iterate over all functions, calling %%callback%%, sorted by their name.
344
- */
345
- forEachFunction(callback) {
346
- const names = Array.from(__privateGet(this, _functions).keys());
347
- names.sort((a, b) => a.localeCompare(b));
348
- for (let i = 0; i < names.length; i++) {
349
- const name = names[i];
350
- callback(__privateGet(this, _functions).get(name), i);
351
- }
352
- }
353
- /**
354
- * Get the event name for %%key%%, which may be a topic hash,
355
- * event name or event signature that belongs to the ABI.
356
- */
357
- getEventName(key) {
358
- const fragment = __privateMethod(this, _Interface_instances, getEvent_fn).call(this, key, null, false);
359
- assertArgument(fragment, "no matching event", "key", key);
360
- return fragment.name;
361
- }
362
- /**
363
- * Returns true if %%key%% (an event topic hash, event name or
364
- * event signature) is present in the ABI.
365
- *
366
- * In the case of an event name, the name may be ambiguous, so
367
- * accessing the [[EventFragment]] may require refinement.
368
- */
369
- hasEvent(key) {
370
- return !!__privateMethod(this, _Interface_instances, getEvent_fn).call(this, key, null, false);
371
- }
372
- /**
373
- * Get the [[EventFragment]] for %%key%%, which may be a topic hash,
374
- * event name or event signature that belongs to the ABI.
375
- *
376
- * If %%values%% is provided, it will use the Typed API to handle
377
- * ambiguous cases where multiple events match by name.
378
- *
379
- * If the %%key%% and %%values%% do not refine to a single event in
380
- * the ABI, this will throw.
381
- */
382
- getEvent(key, values) {
383
- return __privateMethod(this, _Interface_instances, getEvent_fn).call(this, key, values || null, true);
384
- }
385
- /**
386
- * Iterate over all events, calling %%callback%%, sorted by their name.
387
- */
388
- forEachEvent(callback) {
389
- const names = Array.from(__privateGet(this, _events).keys());
390
- names.sort((a, b) => a.localeCompare(b));
391
- for (let i = 0; i < names.length; i++) {
392
- const name = names[i];
393
- callback(__privateGet(this, _events).get(name), i);
394
- }
395
- }
396
- /**
397
- * Get the [[ErrorFragment]] for %%key%%, which may be an error
398
- * selector, error name or error signature that belongs to the ABI.
399
- *
400
- * If %%values%% is provided, it will use the Typed API to handle
401
- * ambiguous cases where multiple errors match by name.
402
- *
403
- * If the %%key%% and %%values%% do not refine to a single error in
404
- * the ABI, this will throw.
405
- */
406
- getError(key, values) {
407
- if (isHexString(key)) {
408
- const selector = key.toLowerCase();
409
- if (BuiltinErrors[selector]) {
410
- return ErrorFragment.from(BuiltinErrors[selector].signature);
411
- }
412
- for (const fragment of __privateGet(this, _errors).values()) {
413
- if (selector === fragment.selector) {
414
- return fragment;
415
- }
416
- }
417
- return null;
418
- }
419
- if (key.indexOf("(") === -1) {
420
- const matching = [];
421
- for (const [name, fragment] of __privateGet(this, _errors)) {
422
- if (name.split(
423
- "("
424
- /* fix:) */
425
- )[0] === key) {
426
- matching.push(fragment);
427
- }
428
- }
429
- if (matching.length === 0) {
430
- if (key === "Error") {
431
- return ErrorFragment.from("error Error(string)");
432
- }
433
- if (key === "Panic") {
434
- return ErrorFragment.from("error Panic(uint256)");
435
- }
436
- return null;
437
- } else if (matching.length > 1) {
438
- const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", ");
439
- assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key);
440
- }
441
- return matching[0];
442
- }
443
- key = ErrorFragment.from(key).format();
444
- if (key === "Error(string)") {
445
- return ErrorFragment.from("error Error(string)");
446
- }
447
- if (key === "Panic(uint256)") {
448
- return ErrorFragment.from("error Panic(uint256)");
449
- }
450
- const result = __privateGet(this, _errors).get(key);
451
- if (result) {
452
- return result;
453
- }
454
- return null;
455
- }
456
- /**
457
- * Iterate over all errors, calling %%callback%%, sorted by their name.
458
- */
459
- forEachError(callback) {
460
- const names = Array.from(__privateGet(this, _errors).keys());
461
- names.sort((a, b) => a.localeCompare(b));
462
- for (let i = 0; i < names.length; i++) {
463
- const name = names[i];
464
- callback(__privateGet(this, _errors).get(name), i);
465
- }
466
- }
467
- // Get the 4-byte selector used by Solidity to identify a function
468
- /*
469
- getSelector(fragment: ErrorFragment | FunctionFragment): string {
470
- if (typeof(fragment) === "string") {
471
- const matches: Array<Fragment> = [ ];
472
-
473
- try { matches.push(this.getFunction(fragment)); } catch (error) { }
474
- try { matches.push(this.getError(<string>fragment)); } catch (_) { }
475
-
476
- if (matches.length === 0) {
477
- logger.throwArgumentError("unknown fragment", "key", fragment);
478
- } else if (matches.length > 1) {
479
- logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment);
480
- }
481
-
482
- fragment = matches[0];
483
- }
484
-
485
- return dataSlice(id(fragment.format()), 0, 4);
486
- }
487
- */
488
- // Get the 32-byte topic hash used by Solidity to identify an event
489
- /*
490
- getEventTopic(fragment: EventFragment): string {
491
- //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); }
492
- return id(fragment.format());
493
- }
494
- */
495
- _decodeParams(params, data) {
496
- return __privateGet(this, _abiCoder).decode(params, data);
497
- }
498
- _encodeParams(params, values) {
499
- return __privateGet(this, _abiCoder).encode(params, values);
500
- }
501
- /**
502
- * Encodes a ``tx.data`` object for deploying the Contract with
503
- * the %%values%% as the constructor arguments.
504
- */
505
- encodeDeploy(values) {
506
- return this._encodeParams(this.deploy.inputs, values || []);
507
- }
508
- /**
509
- * Decodes the result %%data%% (e.g. from an ``eth_call``) for the
510
- * specified error (see [[getError]] for valid values for
511
- * %%key%%).
512
- *
513
- * Most developers should prefer the [[parseCallResult]] method instead,
514
- * which will automatically detect a ``CALL_EXCEPTION`` and throw the
515
- * corresponding error.
516
- */
517
- decodeErrorResult(fragment, data) {
518
- if (typeof fragment === "string") {
519
- const f = this.getError(fragment);
520
- assertArgument(f, "unknown error", "fragment", fragment);
521
- fragment = f;
522
- }
523
- assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data);
524
- return this._decodeParams(fragment.inputs, dataSlice(data, 4));
525
- }
526
- /**
527
- * Encodes the transaction revert data for a call result that
528
- * reverted from the the Contract with the sepcified %%error%%
529
- * (see [[getError]] for valid values for %%fragment%%) with the %%values%%.
530
- *
531
- * This is generally not used by most developers, unless trying to mock
532
- * a result from a Contract.
533
- */
534
- encodeErrorResult(fragment, values) {
535
- if (typeof fragment === "string") {
536
- const f = this.getError(fragment);
537
- assertArgument(f, "unknown error", "fragment", fragment);
538
- fragment = f;
539
- }
540
- return concat([
541
- fragment.selector,
542
- this._encodeParams(fragment.inputs, values || [])
543
- ]);
544
- }
545
- /**
546
- * Decodes the %%data%% from a transaction ``tx.data`` for
547
- * the function specified (see [[getFunction]] for valid values
548
- * for %%fragment%%).
549
- *
550
- * Most developers should prefer the [[parseTransaction]] method
551
- * instead, which will automatically detect the fragment.
552
- */
553
- decodeFunctionData(fragment, data) {
554
- if (typeof fragment === "string") {
555
- const f = this.getFunction(fragment);
556
- assertArgument(f, "unknown function", "fragment", fragment);
557
- fragment = f;
558
- }
559
- assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data);
560
- return this._decodeParams(fragment.inputs, dataSlice(data, 4));
561
- }
562
- /**
563
- * Encodes the ``tx.data`` for a transaction that calls the function
564
- * specified (see [[getFunction]] for valid values for %%fragment%%) with
565
- * the %%values%%.
566
- */
567
- encodeFunctionData(fragment, values) {
568
- if (typeof fragment === "string") {
569
- const f = this.getFunction(fragment);
570
- assertArgument(f, "unknown function", "fragment", fragment);
571
- fragment = f;
572
- }
573
- return concat([
574
- fragment.selector,
575
- this._encodeParams(fragment.inputs, values || [])
576
- ]);
577
- }
578
- /**
579
- * Decodes the result %%data%% (e.g. from an ``eth_call``) for the
580
- * specified function (see [[getFunction]] for valid values for
581
- * %%key%%).
582
- *
583
- * Most developers should prefer the [[parseCallResult]] method instead,
584
- * which will automatically detect a ``CALL_EXCEPTION`` and throw the
585
- * corresponding error.
586
- */
587
- decodeFunctionResult(fragment, data) {
588
- if (typeof fragment === "string") {
589
- const f = this.getFunction(fragment);
590
- assertArgument(f, "unknown function", "fragment", fragment);
591
- fragment = f;
592
- }
593
- let message = "invalid length for result data";
594
- const bytes = getBytesCopy(data);
595
- if (bytes.length % 32 === 0) {
596
- try {
597
- return __privateGet(this, _abiCoder).decode(fragment.outputs, bytes);
598
- } catch (error) {
599
- message = "could not decode result data";
600
- }
601
- }
602
- assert(false, message, "BAD_DATA", {
603
- value: hexlify(bytes),
604
- info: { method: fragment.name, signature: fragment.format() }
605
- });
606
- }
607
- makeError(_data, tx) {
608
- const data = getBytes(_data, "data");
609
- const error = AbiCoder.getBuiltinCallException("call", tx, data);
610
- const customPrefix = "execution reverted (unknown custom error)";
611
- if (error.message.startsWith(customPrefix)) {
612
- const selector = hexlify(data.slice(0, 4));
613
- const ef = this.getError(selector);
614
- if (ef) {
615
- try {
616
- const args = __privateGet(this, _abiCoder).decode(ef.inputs, data.slice(4));
617
- error.revert = {
618
- name: ef.name,
619
- signature: ef.format(),
620
- args
621
- };
622
- error.reason = error.revert.signature;
623
- error.message = `execution reverted: ${error.reason}`;
624
- } catch (e) {
625
- error.message = `execution reverted (coult not decode custom error)`;
626
- }
627
- }
628
- }
629
- const parsed = this.parseTransaction(tx);
630
- if (parsed) {
631
- error.invocation = {
632
- method: parsed.name,
633
- signature: parsed.signature,
634
- args: parsed.args
635
- };
636
- }
637
- return error;
638
- }
639
- /**
640
- * Encodes the result data (e.g. from an ``eth_call``) for the
641
- * specified function (see [[getFunction]] for valid values
642
- * for %%fragment%%) with %%values%%.
643
- *
644
- * This is generally not used by most developers, unless trying to mock
645
- * a result from a Contract.
646
- */
647
- encodeFunctionResult(fragment, values) {
648
- if (typeof fragment === "string") {
649
- const f = this.getFunction(fragment);
650
- assertArgument(f, "unknown function", "fragment", fragment);
651
- fragment = f;
652
- }
653
- return hexlify(__privateGet(this, _abiCoder).encode(fragment.outputs, values || []));
654
- }
655
- /*
656
- spelunk(inputs: Array<ParamType>, values: ReadonlyArray<any>, processfunc: (type: string, value: any) => Promise<any>): Promise<Array<any>> {
657
- const promises: Array<Promise<>> = [ ];
658
- const process = function(type: ParamType, value: any): any {
659
- if (type.baseType === "array") {
660
- return descend(type.child
661
- }
662
- if (type. === "address") {
663
- }
664
- };
665
-
666
- const descend = function (inputs: Array<ParamType>, values: ReadonlyArray<any>) {
667
- if (inputs.length !== values.length) { throw new Error("length mismatch"); }
668
-
669
- };
670
-
671
- const result: Array<any> = [ ];
672
- values.forEach((value, index) => {
673
- if (value == null) {
674
- topics.push(null);
675
- } else if (param.baseType === "array" || param.baseType === "tuple") {
676
- logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value);
677
- } else if (Array.isArray(value)) {
678
- topics.push(value.map((value) => encodeTopic(param, value)));
679
- } else {
680
- topics.push(encodeTopic(param, value));
681
- }
682
- });
683
- }
684
- */
685
- // Create the filter for the event with search criteria (e.g. for eth_filterLog)
686
- encodeFilterTopics(fragment, values) {
687
- if (typeof fragment === "string") {
688
- const f = this.getEvent(fragment);
689
- assertArgument(f, "unknown event", "eventFragment", fragment);
690
- fragment = f;
691
- }
692
- assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length });
693
- const topics = [];
694
- if (!fragment.anonymous) {
695
- topics.push(fragment.topicHash);
696
- }
697
- const encodeTopic = (param, value) => {
698
- if (param.type === "string") {
699
- return id(value);
700
- } else if (param.type === "bytes") {
701
- return keccak256(hexlify(value));
702
- }
703
- if (param.type === "bool" && typeof value === "boolean") {
704
- value = value ? "0x01" : "0x00";
705
- } else if (param.type.match(/^u?int/)) {
706
- value = toBeHex(value);
707
- } else if (param.type.match(/^bytes/)) {
708
- value = zeroPadBytes(value, 32);
709
- } else if (param.type === "address") {
710
- __privateGet(this, _abiCoder).encode(["address"], [value]);
711
- }
712
- return zeroPadValue(hexlify(value), 32);
1
+ import { Hbar, Long, HbarUnit, ContractId, AccountId, FileId } from "@hashgraph/sdk";
2
+ import { Buffer } from "buffer";
3
+ import { parseKey } from "./standards-sdk.es33.js";
4
+ class SCSParser {
5
+ static parseContractCall(body) {
6
+ if (!body) return void 0;
7
+ const hbarAmount = Hbar.fromTinybars(Long.fromValue(body.amount ?? 0));
8
+ const data = {
9
+ contractId: new ContractId(
10
+ body.contractID.shardNum ?? 0,
11
+ body.contractID.realmNum ?? 0,
12
+ body.contractID.contractNum ?? 0
13
+ ).toString(),
14
+ gas: Long.fromValue(body.gas ?? 0).toNumber(),
15
+ amount: parseFloat(hbarAmount.toString(HbarUnit.Hbar))
713
16
  };
714
- values.forEach((value, index) => {
715
- const param = fragment.inputs[index];
716
- if (!param.indexed) {
717
- assertArgument(value == null, "cannot filter non-indexed parameters; must be null", "contract." + param.name, value);
718
- return;
719
- }
720
- if (value == null) {
721
- topics.push(null);
722
- } else if (param.baseType === "array" || param.baseType === "tuple") {
723
- assertArgument(false, "filtering with tuples or arrays not supported", "contract." + param.name, value);
724
- } else if (Array.isArray(value)) {
725
- topics.push(value.map((value2) => encodeTopic(param, value2)));
17
+ if (body.functionParameters) {
18
+ data.functionParameters = Buffer.from(body.functionParameters).toString(
19
+ "hex"
20
+ );
21
+ if (data.functionParameters.length >= 8) {
22
+ data.functionName = data.functionParameters.substring(0, 8);
23
+ }
24
+ }
25
+ return data;
26
+ }
27
+ static parseContractCreate(body) {
28
+ if (!body) return void 0;
29
+ const data = {};
30
+ if (body.initialBalance) {
31
+ data.initialBalance = Hbar.fromTinybars(
32
+ Long.fromValue(body.initialBalance)
33
+ ).toString(HbarUnit.Hbar);
34
+ }
35
+ if (body.gas) {
36
+ data.gas = Long.fromValue(body.gas).toString();
37
+ }
38
+ if (body.adminKey) {
39
+ data.adminKey = parseKey(body.adminKey);
40
+ }
41
+ if (body.constructorParameters) {
42
+ data.constructorParameters = Buffer.from(
43
+ body.constructorParameters
44
+ ).toString("hex");
45
+ }
46
+ if (body.memo) {
47
+ data.memo = body.memo;
48
+ }
49
+ if (body.autoRenewPeriod?.seconds) {
50
+ data.autoRenewPeriod = Long.fromValue(
51
+ body.autoRenewPeriod.seconds
52
+ ).toString();
53
+ }
54
+ if (body.stakedAccountId) {
55
+ data.stakedAccountId = new AccountId(
56
+ body.stakedAccountId.shardNum ?? 0,
57
+ body.stakedAccountId.realmNum ?? 0,
58
+ body.stakedAccountId.accountNum ?? 0
59
+ ).toString();
60
+ } else if (body.stakedNodeId !== null && body.stakedNodeId !== void 0) {
61
+ data.stakedNodeId = Long.fromValue(body.stakedNodeId).toString();
62
+ }
63
+ if (body.declineReward !== void 0) {
64
+ data.declineReward = body.declineReward;
65
+ }
66
+ if (body.maxAutomaticTokenAssociations !== void 0) {
67
+ data.maxAutomaticTokenAssociations = body.maxAutomaticTokenAssociations;
68
+ }
69
+ if (body.fileID) {
70
+ data.initcodeSource = "fileID";
71
+ data.initcode = new FileId(
72
+ body.fileID.shardNum ?? 0,
73
+ body.fileID.realmNum ?? 0,
74
+ body.fileID.fileNum ?? 0
75
+ ).toString();
76
+ } else if (body.initcode && body.initcode.length > 0) {
77
+ data.initcodeSource = "bytes";
78
+ data.initcode = Buffer.from(body.initcode).toString("hex");
79
+ }
80
+ return data;
81
+ }
82
+ static parseContractUpdate(body) {
83
+ if (!body) return void 0;
84
+ const data = {};
85
+ if (body.contractID) {
86
+ data.contractIdToUpdate = new ContractId(
87
+ body.contractID.shardNum ?? 0,
88
+ body.contractID.realmNum ?? 0,
89
+ body.contractID.contractNum ?? 0
90
+ ).toString();
91
+ }
92
+ if (body.adminKey) {
93
+ data.adminKey = parseKey(body.adminKey);
94
+ }
95
+ if (body.expirationTime?.seconds) {
96
+ data.expirationTime = `${Long.fromValue(
97
+ body.expirationTime.seconds
98
+ ).toString()}.${body.expirationTime.nanos}`;
99
+ }
100
+ if (body.autoRenewPeriod?.seconds) {
101
+ data.autoRenewPeriod = Long.fromValue(
102
+ body.autoRenewPeriod.seconds
103
+ ).toString();
104
+ }
105
+ if (body.memo) {
106
+ const memoAsAny = body.memo;
107
+ if (memoAsAny && typeof memoAsAny === "object" && memoAsAny.hasOwnProperty("value")) {
108
+ const memoVal = memoAsAny.value;
109
+ data.memo = memoVal === null || memoVal === void 0 ? void 0 : String(memoVal);
110
+ } else if (typeof memoAsAny === "string") {
111
+ data.memo = memoAsAny;
726
112
  } else {
727
- topics.push(encodeTopic(param, value));
113
+ data.memo = void 0;
728
114
  }
729
- });
730
- while (topics.length && topics[topics.length - 1] === null) {
731
- topics.pop();
732
- }
733
- return topics;
734
- }
735
- encodeEventLog(fragment, values) {
736
- if (typeof fragment === "string") {
737
- const f = this.getEvent(fragment);
738
- assertArgument(f, "unknown event", "eventFragment", fragment);
739
- fragment = f;
740
- }
741
- const topics = [];
742
- const dataTypes = [];
743
- const dataValues = [];
744
- if (!fragment.anonymous) {
745
- topics.push(fragment.topicHash);
746
- }
747
- assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values);
748
- fragment.inputs.forEach((param, index) => {
749
- const value = values[index];
750
- if (param.indexed) {
751
- if (param.type === "string") {
752
- topics.push(id(value));
753
- } else if (param.type === "bytes") {
754
- topics.push(keccak256(value));
755
- } else if (param.baseType === "tuple" || param.baseType === "array") {
756
- throw new Error("not implemented");
757
- } else {
758
- topics.push(__privateGet(this, _abiCoder).encode([param.type], [value]));
759
- }
760
- } else {
761
- dataTypes.push(param);
762
- dataValues.push(value);
763
- }
764
- });
765
- return {
766
- data: __privateGet(this, _abiCoder).encode(dataTypes, dataValues),
767
- topics
768
- };
769
- }
770
- // Decode a filter for the event and the search criteria
771
- decodeEventLog(fragment, data, topics) {
772
- if (typeof fragment === "string") {
773
- const f = this.getEvent(fragment);
774
- assertArgument(f, "unknown event", "eventFragment", fragment);
775
- fragment = f;
776
- }
777
- if (topics != null && !fragment.anonymous) {
778
- const eventTopic = fragment.topicHash;
779
- assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]);
780
- topics = topics.slice(1);
781
- }
782
- const indexed = [];
783
- const nonIndexed = [];
784
- const dynamic = [];
785
- fragment.inputs.forEach((param, index) => {
786
- if (param.indexed) {
787
- if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") {
788
- indexed.push(ParamType.from({ type: "bytes32", name: param.name }));
789
- dynamic.push(true);
790
- } else {
791
- indexed.push(param);
792
- dynamic.push(false);
793
- }
794
- } else {
795
- nonIndexed.push(param);
796
- dynamic.push(false);
797
- }
798
- });
799
- const resultIndexed = topics != null ? __privateGet(this, _abiCoder).decode(indexed, concat(topics)) : null;
800
- const resultNonIndexed = __privateGet(this, _abiCoder).decode(nonIndexed, data, true);
801
- const values = [];
802
- const keys = [];
803
- let nonIndexedIndex = 0, indexedIndex = 0;
804
- fragment.inputs.forEach((param, index) => {
805
- let value = null;
806
- if (param.indexed) {
807
- if (resultIndexed == null) {
808
- value = new Indexed(null);
809
- } else if (dynamic[index]) {
810
- value = new Indexed(resultIndexed[indexedIndex++]);
811
- } else {
812
- try {
813
- value = resultIndexed[indexedIndex++];
814
- } catch (error) {
815
- value = error;
816
- }
817
- }
818
- } else {
819
- try {
820
- value = resultNonIndexed[nonIndexedIndex++];
821
- } catch (error) {
822
- value = error;
823
- }
824
- }
825
- values.push(value);
826
- keys.push(param.name || null);
827
- });
828
- return Result.fromItems(values, keys);
829
- }
830
- /**
831
- * Parses a transaction, finding the matching function and extracts
832
- * the parameter values along with other useful function details.
833
- *
834
- * If the matching function cannot be found, return null.
835
- */
836
- parseTransaction(tx) {
837
- const data = getBytes(tx.data, "tx.data");
838
- const value = getBigInt(tx.value != null ? tx.value : 0, "tx.value");
839
- const fragment = this.getFunction(hexlify(data.slice(0, 4)));
840
- if (!fragment) {
841
- return null;
842
- }
843
- const args = __privateGet(this, _abiCoder).decode(fragment.inputs, data.slice(4));
844
- return new TransactionDescription(fragment, fragment.selector, args, value);
845
- }
846
- parseCallResult(data) {
847
- throw new Error("@TODO");
848
- }
849
- /**
850
- * Parses a receipt log, finding the matching event and extracts
851
- * the parameter values along with other useful event details.
852
- *
853
- * If the matching event cannot be found, returns null.
854
- */
855
- parseLog(log) {
856
- const fragment = this.getEvent(log.topics[0]);
857
- if (!fragment || fragment.anonymous) {
858
- return null;
859
- }
860
- return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));
861
- }
862
- /**
863
- * Parses a revert data, finding the matching error and extracts
864
- * the parameter values along with other useful error details.
865
- *
866
- * If the matching error cannot be found, returns null.
867
- */
868
- parseError(data) {
869
- const hexData = hexlify(data);
870
- const fragment = this.getError(dataSlice(hexData, 0, 4));
871
- if (!fragment) {
872
- return null;
873
- }
874
- const args = __privateGet(this, _abiCoder).decode(fragment.inputs, dataSlice(hexData, 4));
875
- return new ErrorDescription(fragment, fragment.selector, args);
876
- }
877
- /**
878
- * Creates a new [[Interface]] from the ABI %%value%%.
879
- *
880
- * The %%value%% may be provided as an existing [[Interface]] object,
881
- * a JSON-encoded ABI or any Human-Readable ABI format.
882
- */
883
- static from(value) {
884
- if (value instanceof _Interface) {
885
- return value;
886
- }
887
- if (typeof value === "string") {
888
- return new _Interface(JSON.parse(value));
889
- }
890
- if (typeof value.formatJson === "function") {
891
- return new _Interface(value.formatJson());
892
- }
893
- if (typeof value.format === "function") {
894
- return new _Interface(value.format("json"));
895
- }
896
- return new _Interface(value);
897
- }
898
- };
899
- _errors = new WeakMap();
900
- _events = new WeakMap();
901
- _functions = new WeakMap();
902
- _abiCoder = new WeakMap();
903
- _Interface_instances = new WeakSet();
904
- // Find a function definition by any means necessary (unless it is ambiguous)
905
- getFunction_fn = function(key, values, forceUnique) {
906
- if (isHexString(key)) {
907
- const selector = key.toLowerCase();
908
- for (const fragment of __privateGet(this, _functions).values()) {
909
- if (selector === fragment.selector) {
910
- return fragment;
911
- }
912
- }
913
- return null;
914
- }
915
- if (key.indexOf("(") === -1) {
916
- const matching = [];
917
- for (const [name, fragment] of __privateGet(this, _functions)) {
918
- if (name.split(
919
- "("
920
- /* fix:) */
921
- )[0] === key) {
922
- matching.push(fragment);
923
- }
924
- }
925
- if (values) {
926
- const lastValue = values.length > 0 ? values[values.length - 1] : null;
927
- let valueLength = values.length;
928
- let allowOptions = true;
929
- if (Typed.isTyped(lastValue) && lastValue.type === "overrides") {
930
- allowOptions = false;
931
- valueLength--;
932
- }
933
- for (let i = matching.length - 1; i >= 0; i--) {
934
- const inputs = matching[i].inputs.length;
935
- if (inputs !== valueLength && (!allowOptions || inputs !== valueLength - 1)) {
936
- matching.splice(i, 1);
937
- }
938
- }
939
- for (let i = matching.length - 1; i >= 0; i--) {
940
- const inputs = matching[i].inputs;
941
- for (let j = 0; j < values.length; j++) {
942
- if (!Typed.isTyped(values[j])) {
943
- continue;
944
- }
945
- if (j >= inputs.length) {
946
- if (values[j].type === "overrides") {
947
- continue;
948
- }
949
- matching.splice(i, 1);
950
- break;
951
- }
952
- if (values[j].type !== inputs[j].baseType) {
953
- matching.splice(i, 1);
954
- break;
955
- }
956
- }
957
- }
958
- }
959
- if (matching.length === 1 && values && values.length !== matching[0].inputs.length) {
960
- const lastArg = values[values.length - 1];
961
- if (lastArg == null || Array.isArray(lastArg) || typeof lastArg !== "object") {
962
- matching.splice(0, 1);
963
- }
964
- }
965
- if (matching.length === 0) {
966
- return null;
967
- }
968
- if (matching.length > 1 && forceUnique) {
969
- const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", ");
970
- assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key);
971
- }
972
- return matching[0];
973
- }
974
- const result = __privateGet(this, _functions).get(FunctionFragment.from(key).format());
975
- if (result) {
976
- return result;
977
- }
978
- return null;
979
- };
980
- // Find an event definition by any means necessary (unless it is ambiguous)
981
- getEvent_fn = function(key, values, forceUnique) {
982
- if (isHexString(key)) {
983
- const eventTopic = key.toLowerCase();
984
- for (const fragment of __privateGet(this, _events).values()) {
985
- if (eventTopic === fragment.topicHash) {
986
- return fragment;
987
- }
988
- }
989
- return null;
990
- }
991
- if (key.indexOf("(") === -1) {
992
- const matching = [];
993
- for (const [name, fragment] of __privateGet(this, _events)) {
994
- if (name.split(
995
- "("
996
- /* fix:) */
997
- )[0] === key) {
998
- matching.push(fragment);
999
- }
1000
- }
1001
- if (values) {
1002
- for (let i = matching.length - 1; i >= 0; i--) {
1003
- if (matching[i].inputs.length < values.length) {
1004
- matching.splice(i, 1);
1005
- }
1006
- }
1007
- for (let i = matching.length - 1; i >= 0; i--) {
1008
- const inputs = matching[i].inputs;
1009
- for (let j = 0; j < values.length; j++) {
1010
- if (!Typed.isTyped(values[j])) {
1011
- continue;
1012
- }
1013
- if (values[j].type !== inputs[j].baseType) {
1014
- matching.splice(i, 1);
1015
- break;
1016
- }
1017
- }
1018
- }
1019
- }
1020
- if (matching.length === 0) {
1021
- return null;
1022
- }
1023
- if (matching.length > 1 && forceUnique) {
1024
- const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", ");
1025
- assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key);
1026
- }
1027
- return matching[0];
1028
- }
1029
- const result = __privateGet(this, _events).get(EventFragment.from(key).format());
1030
- if (result) {
1031
- return result;
115
+ } else {
116
+ data.memo = void 0;
117
+ }
118
+ if (body.stakedAccountId) {
119
+ data.stakedAccountId = new AccountId(
120
+ body.stakedAccountId.shardNum ?? 0,
121
+ body.stakedAccountId.realmNum ?? 0,
122
+ body.stakedAccountId.accountNum ?? 0
123
+ ).toString();
124
+ data.stakedNodeId = void 0;
125
+ } else if (body.stakedNodeId !== null && body.stakedNodeId !== void 0 && Long.fromValue(body.stakedNodeId).notEquals(-1)) {
126
+ data.stakedNodeId = Long.fromValue(body.stakedNodeId).toString();
127
+ data.stakedAccountId = void 0;
128
+ } else {
129
+ data.stakedNodeId = void 0;
130
+ data.stakedAccountId = void 0;
131
+ }
132
+ if (body.declineReward?.value !== void 0) {
133
+ data.declineReward = body.declineReward.value;
134
+ }
135
+ if (body.maxAutomaticTokenAssociations?.value !== void 0) {
136
+ data.maxAutomaticTokenAssociations = body.maxAutomaticTokenAssociations.value;
137
+ }
138
+ if (body.autoRenewAccountId) {
139
+ data.autoRenewAccountId = new AccountId(
140
+ body.autoRenewAccountId.shardNum ?? 0,
141
+ body.autoRenewAccountId.realmNum ?? 0,
142
+ body.autoRenewAccountId.accountNum ?? 0
143
+ ).toString();
144
+ }
145
+ return data;
146
+ }
147
+ static parseContractDelete(body) {
148
+ if (!body) return void 0;
149
+ const data = {};
150
+ if (body.contractID) {
151
+ data.contractIdToDelete = new ContractId(
152
+ body.contractID.shardNum ?? 0,
153
+ body.contractID.realmNum ?? 0,
154
+ body.contractID.contractNum ?? 0
155
+ ).toString();
156
+ }
157
+ if (body.transferAccountID) {
158
+ data.transferAccountId = new AccountId(
159
+ body.transferAccountID.shardNum ?? 0,
160
+ body.transferAccountID.realmNum ?? 0,
161
+ body.transferAccountID.accountNum ?? 0
162
+ ).toString();
163
+ } else if (body.transferContractID) {
164
+ data.transferContractId = new ContractId(
165
+ body.transferContractID.shardNum ?? 0,
166
+ body.transferContractID.realmNum ?? 0,
167
+ body.transferContractID.contractNum ?? 0
168
+ ).toString();
169
+ }
170
+ return data;
1032
171
  }
1033
- return null;
1034
- };
1035
- let Interface = _Interface;
172
+ }
1036
173
  export {
1037
- ErrorDescription,
1038
- Indexed,
1039
- Interface,
1040
- LogDescription,
1041
- Result,
1042
- TransactionDescription
174
+ SCSParser
1043
175
  };
1044
176
  //# sourceMappingURL=standards-sdk.es30.js.map