@sentio/sdk 2.0.0-rc.8 → 2.0.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 (503) hide show
  1. package/lib/aptos/api.d.ts +5 -0
  2. package/lib/aptos/api.js +21 -0
  3. package/lib/aptos/api.js.map +1 -0
  4. package/lib/aptos/aptos-plugin.d.ts +14 -0
  5. package/lib/aptos/aptos-plugin.js +146 -0
  6. package/lib/aptos/aptos-plugin.js.map +1 -0
  7. package/lib/aptos/aptos-processor.d.ts +72 -0
  8. package/lib/aptos/aptos-processor.js +201 -0
  9. package/lib/aptos/aptos-processor.js.map +1 -0
  10. package/lib/aptos/builtin/0x1.d.ts +1914 -0
  11. package/lib/aptos/builtin/0x1.js +2727 -0
  12. package/lib/aptos/builtin/0x1.js.map +1 -0
  13. package/lib/aptos/builtin/0x3.d.ts +491 -0
  14. package/lib/aptos/builtin/0x3.js +496 -0
  15. package/lib/aptos/builtin/0x3.js.map +1 -0
  16. package/lib/aptos/builtin/index.d.ts +2 -0
  17. package/lib/aptos/builtin/index.js +6 -0
  18. package/lib/aptos/builtin/index.js.map +1 -0
  19. package/lib/aptos/codegen/codegen.d.ts +21 -0
  20. package/lib/aptos/codegen/codegen.js +384 -0
  21. package/lib/aptos/codegen/codegen.js.map +1 -0
  22. package/lib/aptos/codegen/index.d.ts +1 -0
  23. package/lib/aptos/codegen/index.js +2 -0
  24. package/lib/aptos/codegen/index.js.map +1 -0
  25. package/lib/aptos/codegen/run.d.ts +1 -0
  26. package/lib/aptos/codegen/run.js +12 -0
  27. package/lib/aptos/codegen/run.js.map +1 -0
  28. package/lib/aptos/codegen/typegen.d.ts +18 -0
  29. package/lib/aptos/codegen/typegen.js +145 -0
  30. package/lib/aptos/codegen/typegen.js.map +1 -0
  31. package/lib/aptos/codegen/typegen.test.d.ts +1 -0
  32. package/lib/aptos/codegen/typegen.test.js.map +1 -0
  33. package/lib/aptos/context.d.ts +21 -0
  34. package/lib/aptos/context.js +59 -0
  35. package/lib/aptos/context.js.map +1 -0
  36. package/lib/aptos/index.d.ts +9 -0
  37. package/lib/aptos/index.js +8 -0
  38. package/lib/aptos/index.js.map +1 -0
  39. package/lib/aptos/models.d.ts +29 -0
  40. package/lib/aptos/models.js +2 -0
  41. package/lib/aptos/models.js.map +1 -0
  42. package/lib/aptos/move-coder.d.ts +22 -0
  43. package/lib/aptos/move-coder.js +162 -0
  44. package/lib/aptos/move-coder.js.map +1 -0
  45. package/lib/aptos/move-types.d.ts +10 -0
  46. package/lib/aptos/move-types.js +2 -0
  47. package/lib/aptos/move-types.js.map +1 -0
  48. package/lib/aptos/network.d.ts +11 -0
  49. package/lib/aptos/network.js +27 -0
  50. package/lib/aptos/network.js.map +1 -0
  51. package/lib/aptos/tests/aptos.test.d.ts +1 -0
  52. package/lib/aptos/tests/aptos.test.js.map +1 -0
  53. package/lib/aptos/tests/souffl3.d.ts +1 -0
  54. package/lib/aptos/tests/souffl3.js +44 -0
  55. package/lib/aptos/tests/souffl3.js.map +1 -0
  56. package/lib/aptos/tests/types/index.d.ts +3 -0
  57. package/lib/aptos/tests/types/index.js +7 -0
  58. package/lib/aptos/tests/types/index.js.map +1 -0
  59. package/lib/aptos/tests/types/reserved.d.ts +345 -0
  60. package/lib/aptos/tests/types/reserved.js +301 -0
  61. package/lib/aptos/tests/types/reserved.js.map +1 -0
  62. package/lib/aptos/tests/types/soffl3.d.ts +812 -0
  63. package/lib/aptos/tests/types/soffl3.js +548 -0
  64. package/lib/aptos/tests/types/soffl3.js.map +1 -0
  65. package/lib/aptos/tests/types/souffle.d.ts +340 -0
  66. package/lib/aptos/tests/types/souffle.js +295 -0
  67. package/lib/aptos/tests/types/souffle.js.map +1 -0
  68. package/lib/aptos/types.d.ts +9 -0
  69. package/lib/aptos/types.js +130 -0
  70. package/lib/aptos/types.js.map +1 -0
  71. package/lib/aptos/types.test.d.ts +1 -0
  72. package/lib/aptos/types.test.js.map +1 -0
  73. package/lib/aptos/utils.d.ts +7 -0
  74. package/lib/aptos/utils.js +20 -0
  75. package/lib/aptos/utils.js.map +1 -0
  76. package/lib/core/big-decimal.d.ts +2 -0
  77. package/lib/core/big-decimal.js +8 -0
  78. package/lib/core/big-decimal.js.map +1 -1
  79. package/lib/{utils → core}/chain.d.ts +0 -0
  80. package/lib/{utils → core}/chain.js +0 -0
  81. package/lib/core/chain.js.map +1 -0
  82. package/lib/core/index.d.ts +2 -4
  83. package/lib/core/index.js +2 -4
  84. package/lib/core/index.js.map +1 -1
  85. package/lib/core/numberish.d.ts +0 -2
  86. package/lib/core/numberish.js +0 -9
  87. package/lib/core/numberish.js.map +1 -1
  88. package/lib/core/sui-plugin.js +1 -1
  89. package/lib/core/sui-plugin.js.map +1 -1
  90. package/lib/core/sui-processor.d.ts +1 -1
  91. package/lib/core/sui-processor.js +1 -1
  92. package/lib/core/sui-processor.js.map +1 -1
  93. package/lib/eth/account-processor.d.ts +4 -4
  94. package/lib/eth/account-processor.js +4 -4
  95. package/lib/eth/account-processor.js.map +1 -1
  96. package/lib/eth/base-processor-template.d.ts +6 -5
  97. package/lib/eth/base-processor-template.js +1 -1
  98. package/lib/eth/base-processor-template.js.map +1 -1
  99. package/lib/eth/base-processor.d.ts +6 -5
  100. package/lib/eth/base-processor.js +3 -2
  101. package/lib/eth/base-processor.js.map +1 -1
  102. package/lib/{core → eth}/bind-options.d.ts +0 -0
  103. package/lib/{core → eth}/bind-options.js +0 -0
  104. package/lib/eth/bind-options.js.map +1 -0
  105. package/lib/eth/binds.d.ts +2 -2
  106. package/lib/eth/binds.js +1 -1
  107. package/lib/eth/binds.js.map +1 -1
  108. package/lib/{builtin → eth/builtin}/eacaggregatorproxy/index.d.ts +0 -0
  109. package/lib/{builtin → eth/builtin}/eacaggregatorproxy/index.js +0 -0
  110. package/lib/eth/builtin/eacaggregatorproxy/index.js.map +1 -0
  111. package/lib/{builtin → eth/builtin}/eacaggregatorproxy/test-utils.d.ts +0 -0
  112. package/lib/{builtin → eth/builtin}/eacaggregatorproxy/test-utils.js +0 -0
  113. package/lib/eth/builtin/eacaggregatorproxy/test-utils.js.map +1 -0
  114. package/lib/{builtin → eth/builtin}/erc1155/index.d.ts +0 -0
  115. package/lib/{builtin → eth/builtin}/erc1155/index.js +0 -0
  116. package/lib/eth/builtin/erc1155/index.js.map +1 -0
  117. package/lib/{builtin → eth/builtin}/erc1155/test-utils.d.ts +0 -0
  118. package/lib/{builtin → eth/builtin}/erc1155/test-utils.js +0 -0
  119. package/lib/eth/builtin/erc1155/test-utils.js.map +1 -0
  120. package/lib/{builtin → eth/builtin}/erc20/index.d.ts +0 -0
  121. package/lib/{builtin → eth/builtin}/erc20/index.js +0 -0
  122. package/lib/eth/builtin/erc20/index.js.map +1 -0
  123. package/lib/{builtin → eth/builtin}/erc20/test-utils.d.ts +0 -0
  124. package/lib/{builtin → eth/builtin}/erc20/test-utils.js +0 -0
  125. package/lib/eth/builtin/erc20/test-utils.js.map +1 -0
  126. package/lib/{builtin → eth/builtin}/erc20bytes/index.d.ts +0 -0
  127. package/lib/{builtin → eth/builtin}/erc20bytes/index.js +0 -0
  128. package/lib/eth/builtin/erc20bytes/index.js.map +1 -0
  129. package/lib/{builtin → eth/builtin}/erc20bytes/test-utils.d.ts +0 -0
  130. package/lib/{builtin → eth/builtin}/erc20bytes/test-utils.js +0 -0
  131. package/lib/eth/builtin/erc20bytes/test-utils.js.map +1 -0
  132. package/lib/{builtin → eth/builtin}/erc721/index.d.ts +0 -0
  133. package/lib/{builtin → eth/builtin}/erc721/index.js +0 -0
  134. package/lib/eth/builtin/erc721/index.js.map +1 -0
  135. package/lib/{builtin → eth/builtin}/erc721/test-utils.d.ts +0 -0
  136. package/lib/{builtin → eth/builtin}/erc721/test-utils.js +0 -0
  137. package/lib/eth/builtin/erc721/test-utils.js.map +1 -0
  138. package/lib/{builtin → eth/builtin}/index.d.ts +0 -0
  139. package/lib/{builtin → eth/builtin}/index.js +0 -0
  140. package/lib/eth/builtin/index.js.map +1 -0
  141. package/lib/{builtin → eth/builtin}/internal/EACAggregatorProxy.d.ts +5 -5
  142. package/lib/{builtin → eth/builtin}/internal/EACAggregatorProxy.js +0 -0
  143. package/lib/eth/builtin/internal/EACAggregatorProxy.js.map +1 -0
  144. package/lib/{builtin → eth/builtin}/internal/ERC1155.d.ts +5 -5
  145. package/lib/{builtin → eth/builtin}/internal/ERC1155.js +0 -0
  146. package/lib/eth/builtin/internal/ERC1155.js.map +1 -0
  147. package/lib/{builtin → eth/builtin}/internal/ERC20.d.ts +4 -4
  148. package/lib/{builtin → eth/builtin}/internal/ERC20.js +0 -0
  149. package/lib/eth/builtin/internal/ERC20.js.map +1 -0
  150. package/lib/{builtin → eth/builtin}/internal/ERC20Bytes.d.ts +3 -3
  151. package/lib/{builtin → eth/builtin}/internal/ERC20Bytes.js +0 -0
  152. package/lib/eth/builtin/internal/ERC20Bytes.js.map +1 -0
  153. package/lib/{builtin → eth/builtin}/internal/ERC721.d.ts +4 -4
  154. package/lib/{builtin → eth/builtin}/internal/ERC721.js +0 -0
  155. package/lib/eth/builtin/internal/ERC721.js.map +1 -0
  156. package/lib/{builtin → eth/builtin}/internal/WETH9.d.ts +5 -5
  157. package/lib/{builtin → eth/builtin}/internal/WETH9.js +0 -0
  158. package/lib/eth/builtin/internal/WETH9.js.map +1 -0
  159. package/lib/{builtin → eth/builtin}/internal/common.d.ts +4 -2
  160. package/lib/{builtin → eth/builtin}/internal/common.js +0 -0
  161. package/lib/eth/builtin/internal/common.js.map +1 -0
  162. package/lib/{builtin → eth/builtin}/internal/eacaggregatorproxy_processor.d.ts +5 -5
  163. package/lib/{builtin → eth/builtin}/internal/eacaggregatorproxy_processor.js +92 -182
  164. package/lib/eth/builtin/internal/eacaggregatorproxy_processor.js.map +1 -0
  165. package/lib/{builtin → eth/builtin}/internal/erc1155_processor.d.ts +5 -5
  166. package/lib/{builtin → eth/builtin}/internal/erc1155_processor.js +27 -52
  167. package/lib/eth/builtin/internal/erc1155_processor.js.map +1 -0
  168. package/lib/{builtin → eth/builtin}/internal/erc20_processor.d.ts +4 -4
  169. package/lib/{builtin → eth/builtin}/internal/erc20_processor.js +42 -82
  170. package/lib/eth/builtin/internal/erc20_processor.js.map +1 -0
  171. package/lib/{builtin → eth/builtin}/internal/erc20bytes_processor.d.ts +3 -3
  172. package/lib/{builtin → eth/builtin}/internal/erc20bytes_processor.js +32 -62
  173. package/lib/eth/builtin/internal/erc20bytes_processor.js.map +1 -0
  174. package/lib/{builtin → eth/builtin}/internal/erc721_processor.d.ts +4 -4
  175. package/lib/{builtin → eth/builtin}/internal/erc721_processor.js +47 -92
  176. package/lib/eth/builtin/internal/erc721_processor.js.map +1 -0
  177. package/lib/{builtin → eth/builtin}/internal/factories/EACAggregatorProxy__factory.d.ts +1 -1
  178. package/lib/{builtin → eth/builtin}/internal/factories/EACAggregatorProxy__factory.js +0 -0
  179. package/lib/eth/builtin/internal/factories/EACAggregatorProxy__factory.js.map +1 -0
  180. package/lib/{builtin → eth/builtin}/internal/factories/ERC1155__factory.d.ts +1 -1
  181. package/lib/{builtin → eth/builtin}/internal/factories/ERC1155__factory.js +0 -0
  182. package/lib/eth/builtin/internal/factories/ERC1155__factory.js.map +1 -0
  183. package/lib/{builtin → eth/builtin}/internal/factories/ERC20Bytes__factory.d.ts +1 -1
  184. package/lib/{builtin → eth/builtin}/internal/factories/ERC20Bytes__factory.js +0 -0
  185. package/lib/eth/builtin/internal/factories/ERC20Bytes__factory.js.map +1 -0
  186. package/lib/{builtin → eth/builtin}/internal/factories/ERC20__factory.d.ts +1 -1
  187. package/lib/{builtin → eth/builtin}/internal/factories/ERC20__factory.js +0 -0
  188. package/lib/eth/builtin/internal/factories/ERC20__factory.js.map +1 -0
  189. package/lib/{builtin → eth/builtin}/internal/factories/ERC721__factory.d.ts +1 -1
  190. package/lib/{builtin → eth/builtin}/internal/factories/ERC721__factory.js +0 -0
  191. package/lib/eth/builtin/internal/factories/ERC721__factory.js.map +1 -0
  192. package/lib/{builtin → eth/builtin}/internal/factories/WETH9__factory.d.ts +1 -1
  193. package/lib/{builtin → eth/builtin}/internal/factories/WETH9__factory.js +0 -0
  194. package/lib/eth/builtin/internal/factories/WETH9__factory.js.map +1 -0
  195. package/lib/{builtin → eth/builtin}/internal/factories/index.d.ts +0 -0
  196. package/lib/{builtin → eth/builtin}/internal/factories/index.js +0 -0
  197. package/lib/eth/builtin/internal/factories/index.js.map +1 -0
  198. package/lib/{builtin → eth/builtin}/internal/index.d.ts +0 -0
  199. package/lib/{builtin → eth/builtin}/internal/index.js +0 -0
  200. package/lib/eth/builtin/internal/index.js.map +1 -0
  201. package/lib/{builtin → eth/builtin}/internal/weth9_processor.d.ts +5 -5
  202. package/lib/{builtin → eth/builtin}/internal/weth9_processor.js +32 -62
  203. package/lib/eth/builtin/internal/weth9_processor.js.map +1 -0
  204. package/lib/{builtin → eth/builtin}/weth9/index.d.ts +0 -0
  205. package/lib/{builtin → eth/builtin}/weth9/index.js +0 -0
  206. package/lib/eth/builtin/weth9/index.js.map +1 -0
  207. package/lib/{builtin → eth/builtin}/weth9/test-utils.d.ts +0 -0
  208. package/lib/{builtin → eth/builtin}/weth9/test-utils.js +0 -0
  209. package/lib/eth/builtin/weth9/test-utils.js.map +1 -0
  210. package/lib/eth/codegen/codegen.d.ts +1 -0
  211. package/lib/eth/codegen/codegen.js +53 -0
  212. package/lib/eth/codegen/codegen.js.map +1 -0
  213. package/lib/{target-ethers-sentio/index.d.cts → eth/codegen/ethers-sentio.d.ts} +1 -1
  214. package/lib/eth/codegen/ethers-sentio.js +57 -0
  215. package/lib/eth/codegen/ethers-sentio.js.map +1 -0
  216. package/lib/{target-ethers-sentio/event-handler.d.cts → eth/codegen/event-handler.d.ts} +0 -0
  217. package/lib/eth/codegen/event-handler.js +46 -0
  218. package/lib/eth/codegen/event-handler.js.map +1 -0
  219. package/lib/{target-ethers-sentio/file.d.cts → eth/codegen/file.d.ts} +0 -0
  220. package/lib/{target-ethers-sentio/file.cjs → eth/codegen/file.js} +28 -35
  221. package/lib/eth/codegen/file.js.map +1 -0
  222. package/lib/{target-ethers-sentio/functions-handler.d.cts → eth/codegen/functions-handler.d.ts} +0 -0
  223. package/lib/{target-ethers-sentio/functions-handler.cjs → eth/codegen/functions-handler.js} +13 -18
  224. package/lib/eth/codegen/functions-handler.js.map +1 -0
  225. package/lib/eth/codegen/index.d.ts +1 -0
  226. package/lib/eth/codegen/index.js +2 -0
  227. package/lib/eth/codegen/index.js.map +1 -0
  228. package/lib/eth/codegen/run.d.ts +2 -0
  229. package/lib/eth/codegen/run.js +12 -0
  230. package/lib/eth/codegen/run.js.map +1 -0
  231. package/lib/{target-ethers-sentio/types.d.cts → eth/codegen/types.d.ts} +0 -0
  232. package/lib/{target-ethers-sentio/types.cjs → eth/codegen/types.js} +4 -10
  233. package/lib/eth/codegen/types.js.map +1 -0
  234. package/lib/{target-ethers-sentio/view-function.d.cts → eth/codegen/view-function.d.ts} +0 -0
  235. package/lib/eth/codegen/view-function.js +62 -0
  236. package/lib/eth/codegen/view-function.js.map +1 -0
  237. package/lib/{core → eth}/context.d.ts +5 -4
  238. package/lib/{core → eth}/context.js +7 -8
  239. package/lib/eth/context.js.map +1 -0
  240. package/lib/eth/error.d.ts +1 -0
  241. package/lib/eth/error.js +3 -0
  242. package/lib/eth/error.js.map +1 -0
  243. package/lib/eth/eth.d.ts +13 -0
  244. package/lib/{error.js → eth/eth.js} +20 -14
  245. package/lib/eth/eth.js.map +1 -0
  246. package/lib/eth/generic-processor.d.ts +2 -2
  247. package/lib/eth/generic-processor.js +2 -2
  248. package/lib/eth/generic-processor.js.map +1 -1
  249. package/lib/eth/generic-processor.test.js.map +1 -1
  250. package/lib/eth/index.d.ts +5 -1
  251. package/lib/eth/index.js +5 -1
  252. package/lib/eth/index.js.map +1 -1
  253. package/lib/eth/provider.js +3 -2
  254. package/lib/eth/provider.js.map +1 -1
  255. package/lib/index.d.ts +1 -3
  256. package/lib/index.js +1 -5
  257. package/lib/index.js.map +1 -1
  258. package/lib/jest.config.d.ts +9 -0
  259. package/lib/jest.config.js +9 -0
  260. package/lib/jest.config.js.map +1 -0
  261. package/lib/solana/builtin/index.d.ts +1 -0
  262. package/lib/solana/builtin/index.js +2 -0
  263. package/lib/solana/builtin/index.js.map +1 -0
  264. package/lib/solana/builtin/spl-token-processor.d.ts +39 -0
  265. package/lib/solana/builtin/spl-token-processor.js +254 -0
  266. package/lib/solana/builtin/spl-token-processor.js.map +1 -0
  267. package/lib/solana/builtin/types.d.ts +427 -0
  268. package/lib/solana/builtin/types.js +200 -0
  269. package/lib/solana/builtin/types.js.map +1 -0
  270. package/lib/solana/codegen/codegen.d.ts +1 -0
  271. package/lib/solana/codegen/codegen.js +122 -0
  272. package/lib/solana/codegen/codegen.js.map +1 -0
  273. package/lib/solana/codegen/index.d.ts +1 -0
  274. package/lib/solana/codegen/index.js +2 -0
  275. package/lib/solana/codegen/index.js.map +1 -0
  276. package/lib/solana/codegen/run.d.ts +2 -0
  277. package/lib/solana/codegen/run.js +12 -0
  278. package/lib/solana/codegen/run.js.map +1 -0
  279. package/lib/solana/index.d.ts +4 -0
  280. package/lib/solana/index.js +5 -0
  281. package/lib/solana/index.js.map +1 -0
  282. package/lib/solana/solana-context.d.ts +9 -0
  283. package/lib/solana/solana-context.js +28 -0
  284. package/lib/solana/solana-context.js.map +1 -0
  285. package/lib/solana/solana-options.d.ts +10 -0
  286. package/lib/solana/solana-options.js +10 -0
  287. package/lib/solana/solana-options.js.map +1 -0
  288. package/lib/solana/solana-plugin.d.ts +9 -0
  289. package/lib/solana/solana-plugin.js +87 -0
  290. package/lib/solana/solana-plugin.js.map +1 -0
  291. package/lib/solana/solana-processor.d.ts +43 -0
  292. package/lib/solana/solana-processor.js +72 -0
  293. package/lib/solana/solana-processor.js.map +1 -0
  294. package/lib/solana/tests/solana.test.d.ts +1 -0
  295. package/lib/solana/tests/solana.test.js.map +1 -0
  296. package/lib/solana/tests/types/basic_1.d.ts +26 -0
  297. package/lib/solana/tests/types/basic_1.js +63 -0
  298. package/lib/solana/tests/types/basic_1.js.map +1 -0
  299. package/lib/solana/tests/types/basic_1_processor.d.ts +21 -0
  300. package/lib/solana/tests/types/basic_1_processor.js +35 -0
  301. package/lib/solana/tests/types/basic_1_processor.js.map +1 -0
  302. package/lib/solana/tests/types/token_bridge.d.ts +29 -0
  303. package/lib/solana/tests/types/token_bridge.js +938 -0
  304. package/lib/solana/tests/types/token_bridge.js.map +1 -0
  305. package/lib/solana/tests/types/token_bridge_processor.d.ts +212 -0
  306. package/lib/solana/tests/types/token_bridge_processor.js +134 -0
  307. package/lib/solana/tests/types/token_bridge_processor.js.map +1 -0
  308. package/lib/solana/tests/wormhole-token-bridge.d.ts +15 -0
  309. package/lib/solana/tests/wormhole-token-bridge.js +79 -0
  310. package/lib/solana/tests/wormhole-token-bridge.js.map +1 -0
  311. package/lib/testing/test-processor-server.js +1 -1
  312. package/lib/testing/test-processor-server.js.map +1 -1
  313. package/lib/testing/test-provider.js +1 -1
  314. package/lib/testing/test-provider.js.map +1 -1
  315. package/lib/tsup.config.ts +3 -0
  316. package/lib/utils/conversion.d.ts +0 -5
  317. package/lib/utils/conversion.js +21 -20
  318. package/lib/utils/conversion.js.map +1 -1
  319. package/lib/utils/dex-price.js +2 -2
  320. package/lib/utils/dex-price.js.map +1 -1
  321. package/lib/utils/index.d.ts +4 -4
  322. package/lib/utils/index.js +4 -4
  323. package/lib/utils/index.js.map +1 -1
  324. package/lib/utils/token.d.ts +0 -1
  325. package/lib/utils/token.js +17 -28
  326. package/lib/utils/token.js.map +1 -1
  327. package/package.json +42 -20
  328. package/src/aptos/abis/0x1.json +9205 -0
  329. package/src/aptos/abis/0x3.json +1515 -0
  330. package/src/aptos/api.ts +23 -0
  331. package/src/aptos/aptos-plugin.ts +183 -0
  332. package/src/aptos/aptos-processor.ts +331 -0
  333. package/src/aptos/builtin/0x1.ts +4685 -0
  334. package/src/aptos/builtin/0x3.ts +1010 -0
  335. package/src/aptos/builtin/index.ts +5 -0
  336. package/src/aptos/codegen/codegen.ts +461 -0
  337. package/src/aptos/codegen/index.ts +1 -0
  338. package/src/aptos/codegen/run.ts +13 -0
  339. package/src/aptos/codegen/tsconfig.json +8 -0
  340. package/src/aptos/codegen/typegen.ts +165 -0
  341. package/src/aptos/context.ts +72 -0
  342. package/src/aptos/index.ts +10 -0
  343. package/src/aptos/models.ts +37 -0
  344. package/src/aptos/move-coder.ts +199 -0
  345. package/src/aptos/move-types.ts +11 -0
  346. package/src/aptos/network.ts +29 -0
  347. package/src/aptos/tests/abis/reserved.json +402 -0
  348. package/src/aptos/tests/abis/soffl3.json +1411 -0
  349. package/src/aptos/tests/abis/souffle.json +389 -0
  350. package/src/aptos/tests/souffl3.ts +57 -0
  351. package/src/aptos/tests/types/index.ts +6 -0
  352. package/src/aptos/tests/types/reserved.ts +781 -0
  353. package/src/aptos/tests/types/soffl3.ts +1567 -0
  354. package/src/aptos/tests/types/souffle.ts +780 -0
  355. package/src/aptos/types.ts +149 -0
  356. package/src/aptos/utils.ts +26 -0
  357. package/src/core/big-decimal.ts +11 -0
  358. package/src/{utils → core}/chain.ts +0 -0
  359. package/src/core/index.ts +2 -5
  360. package/src/core/numberish.ts +0 -11
  361. package/src/core/sui-plugin.ts +1 -1
  362. package/src/core/sui-processor.ts +1 -1
  363. package/src/{abis → eth/abis}/EACAggregatorProxy.json +0 -0
  364. package/src/{abis → eth/abis}/ERC1155.json +0 -0
  365. package/src/{abis → eth/abis}/ERC20.json +0 -0
  366. package/src/{abis → eth/abis}/ERC20Bytes.json +0 -0
  367. package/src/{abis → eth/abis}/ERC721.json +0 -0
  368. package/src/{abis → eth/abis}/WETH9.json +0 -0
  369. package/src/eth/account-processor.ts +7 -7
  370. package/src/eth/base-processor-template.ts +5 -4
  371. package/src/eth/base-processor.ts +10 -20
  372. package/src/{core → eth}/bind-options.ts +0 -0
  373. package/src/eth/binds.ts +2 -2
  374. package/src/{builtin → eth/builtin}/eacaggregatorproxy/index.ts +0 -0
  375. package/src/{builtin → eth/builtin}/eacaggregatorproxy/test-utils.ts +0 -0
  376. package/src/{builtin → eth/builtin}/erc1155/index.ts +0 -0
  377. package/src/{builtin → eth/builtin}/erc1155/test-utils.ts +0 -0
  378. package/src/{builtin → eth/builtin}/erc20/index.ts +0 -0
  379. package/src/{builtin → eth/builtin}/erc20/test-utils.ts +0 -0
  380. package/src/{builtin → eth/builtin}/erc20bytes/index.ts +0 -0
  381. package/src/{builtin → eth/builtin}/erc20bytes/test-utils.ts +0 -0
  382. package/src/{builtin → eth/builtin}/erc721/index.ts +0 -0
  383. package/src/{builtin → eth/builtin}/erc721/test-utils.ts +0 -0
  384. package/src/{builtin → eth/builtin}/index.ts +0 -0
  385. package/src/{builtin → eth/builtin}/internal/EACAggregatorProxy.ts +5 -9
  386. package/src/{builtin → eth/builtin}/internal/ERC1155.ts +5 -9
  387. package/src/{builtin → eth/builtin}/internal/ERC20.ts +4 -7
  388. package/src/{builtin → eth/builtin}/internal/ERC20Bytes.ts +3 -5
  389. package/src/{builtin → eth/builtin}/internal/ERC721.ts +4 -7
  390. package/src/{builtin → eth/builtin}/internal/WETH9.ts +5 -9
  391. package/src/eth/builtin/internal/common.ts +22 -0
  392. package/src/{builtin → eth/builtin}/internal/eacaggregatorproxy_processor.ts +92 -164
  393. package/src/{builtin → eth/builtin}/internal/erc1155_processor.ts +27 -51
  394. package/src/{builtin → eth/builtin}/internal/erc20_processor.ts +42 -74
  395. package/src/{builtin → eth/builtin}/internal/erc20bytes_processor.ts +32 -56
  396. package/src/{builtin → eth/builtin}/internal/erc721_processor.ts +47 -83
  397. package/src/{builtin → eth/builtin}/internal/factories/EACAggregatorProxy__factory.ts +1 -1
  398. package/src/{builtin → eth/builtin}/internal/factories/ERC1155__factory.ts +1 -1
  399. package/src/{builtin → eth/builtin}/internal/factories/ERC20Bytes__factory.ts +1 -1
  400. package/src/{builtin → eth/builtin}/internal/factories/ERC20__factory.ts +1 -1
  401. package/src/{builtin → eth/builtin}/internal/factories/ERC721__factory.ts +1 -1
  402. package/src/{builtin → eth/builtin}/internal/factories/WETH9__factory.ts +1 -1
  403. package/src/{builtin → eth/builtin}/internal/factories/index.ts +0 -0
  404. package/src/{builtin → eth/builtin}/internal/index.ts +0 -0
  405. package/src/{builtin → eth/builtin}/internal/weth9_processor.ts +32 -56
  406. package/src/{builtin → eth/builtin}/weth9/index.ts +0 -0
  407. package/src/{builtin → eth/builtin}/weth9/test-utils.ts +0 -0
  408. package/src/eth/codegen/codegen.ts +62 -0
  409. package/src/{target-ethers-sentio/index.cts → eth/codegen/ethers-sentio.ts} +2 -2
  410. package/src/{target-ethers-sentio/event-handler.cts → eth/codegen/event-handler.ts} +2 -2
  411. package/src/{target-ethers-sentio/file.cts → eth/codegen/file.ts} +7 -7
  412. package/src/{target-ethers-sentio/functions-handler.cts → eth/codegen/functions-handler.ts} +4 -4
  413. package/src/eth/codegen/index.ts +1 -0
  414. package/src/eth/codegen/run.ts +12 -0
  415. package/src/eth/codegen/tsconfig.json +8 -0
  416. package/src/{target-ethers-sentio/types.cts → eth/codegen/types.ts} +1 -1
  417. package/src/{target-ethers-sentio/view-function.cts → eth/codegen/view-function.ts} +7 -12
  418. package/src/{core → eth}/context.ts +8 -9
  419. package/src/eth/error.ts +4 -0
  420. package/src/eth/eth.ts +56 -0
  421. package/src/eth/generic-processor.ts +3 -3
  422. package/src/eth/index.ts +6 -2
  423. package/src/eth/provider.ts +4 -3
  424. package/src/index.ts +1 -6
  425. package/src/jest.config.ts +8 -0
  426. package/src/solana/builtin/index.ts +1 -0
  427. package/src/solana/builtin/spl-token-processor.ts +298 -0
  428. package/src/solana/builtin/types.ts +279 -0
  429. package/src/solana/codegen/codegen.ts +140 -0
  430. package/src/solana/codegen/index.ts +1 -0
  431. package/src/solana/codegen/run.ts +12 -0
  432. package/src/solana/codegen/tsconfig.json +8 -0
  433. package/src/solana/index.ts +4 -0
  434. package/src/solana/solana-context.ts +30 -0
  435. package/src/solana/solana-options.ts +11 -0
  436. package/src/solana/solana-plugin.ts +103 -0
  437. package/src/solana/solana-processor.ts +102 -0
  438. package/src/solana/tests/abis/basic_1.json +62 -0
  439. package/src/solana/tests/abis/token_bridge.json +937 -0
  440. package/src/solana/tests/types/basic_1.ts +62 -0
  441. package/src/solana/tests/types/basic_1_processor.ts +42 -0
  442. package/src/solana/tests/types/token_bridge.ts +937 -0
  443. package/src/solana/tests/types/token_bridge_processor.ts +150 -0
  444. package/src/solana/tests/wormhole-token-bridge.ts +96 -0
  445. package/src/testing/test-processor-server.ts +1 -1
  446. package/src/testing/test-provider.ts +1 -1
  447. package/src/tsup.config.ts +3 -0
  448. package/src/utils/conversion.ts +21 -25
  449. package/src/utils/dex-price.ts +2 -3
  450. package/src/utils/index.ts +4 -4
  451. package/src/utils/token.ts +19 -30
  452. package/lib/builtin/eacaggregatorproxy/index.js.map +0 -1
  453. package/lib/builtin/eacaggregatorproxy/test-utils.js.map +0 -1
  454. package/lib/builtin/erc1155/index.js.map +0 -1
  455. package/lib/builtin/erc1155/test-utils.js.map +0 -1
  456. package/lib/builtin/erc20/index.js.map +0 -1
  457. package/lib/builtin/erc20/test-utils.js.map +0 -1
  458. package/lib/builtin/erc20bytes/index.js.map +0 -1
  459. package/lib/builtin/erc20bytes/test-utils.js.map +0 -1
  460. package/lib/builtin/erc721/index.js.map +0 -1
  461. package/lib/builtin/erc721/test-utils.js.map +0 -1
  462. package/lib/builtin/index.js.map +0 -1
  463. package/lib/builtin/internal/EACAggregatorProxy.js.map +0 -1
  464. package/lib/builtin/internal/ERC1155.js.map +0 -1
  465. package/lib/builtin/internal/ERC20.js.map +0 -1
  466. package/lib/builtin/internal/ERC20Bytes.js.map +0 -1
  467. package/lib/builtin/internal/ERC721.js.map +0 -1
  468. package/lib/builtin/internal/WETH9.js.map +0 -1
  469. package/lib/builtin/internal/common.js.map +0 -1
  470. package/lib/builtin/internal/eacaggregatorproxy_processor.js.map +0 -1
  471. package/lib/builtin/internal/erc1155_processor.js.map +0 -1
  472. package/lib/builtin/internal/erc20_processor.js.map +0 -1
  473. package/lib/builtin/internal/erc20bytes_processor.js.map +0 -1
  474. package/lib/builtin/internal/erc721_processor.js.map +0 -1
  475. package/lib/builtin/internal/factories/EACAggregatorProxy__factory.js.map +0 -1
  476. package/lib/builtin/internal/factories/ERC1155__factory.js.map +0 -1
  477. package/lib/builtin/internal/factories/ERC20Bytes__factory.js.map +0 -1
  478. package/lib/builtin/internal/factories/ERC20__factory.js.map +0 -1
  479. package/lib/builtin/internal/factories/ERC721__factory.js.map +0 -1
  480. package/lib/builtin/internal/factories/WETH9__factory.js.map +0 -1
  481. package/lib/builtin/internal/factories/index.js.map +0 -1
  482. package/lib/builtin/internal/index.js.map +0 -1
  483. package/lib/builtin/internal/weth9_processor.js.map +0 -1
  484. package/lib/builtin/weth9/index.js.map +0 -1
  485. package/lib/builtin/weth9/test-utils.js.map +0 -1
  486. package/lib/core/bind-options.js.map +0 -1
  487. package/lib/core/context.js.map +0 -1
  488. package/lib/error.d.ts +0 -7
  489. package/lib/error.js.map +0 -1
  490. package/lib/target-ethers-sentio/event-handler.cjs +0 -52
  491. package/lib/target-ethers-sentio/event-handler.cjs.map +0 -1
  492. package/lib/target-ethers-sentio/file.cjs.map +0 -1
  493. package/lib/target-ethers-sentio/functions-handler.cjs.map +0 -1
  494. package/lib/target-ethers-sentio/index.cjs +0 -61
  495. package/lib/target-ethers-sentio/index.cjs.map +0 -1
  496. package/lib/target-ethers-sentio/types.cjs.map +0 -1
  497. package/lib/target-ethers-sentio/view-function.cjs +0 -74
  498. package/lib/target-ethers-sentio/view-function.cjs.map +0 -1
  499. package/lib/utils/chain.js.map +0 -1
  500. package/src/builtin/internal/common.ts +0 -46
  501. package/src/error.ts +0 -45
  502. package/src/target-ethers-sentio/.eslintrc.json +0 -14
  503. package/src/target-ethers-sentio/tsconfig.json +0 -9
@@ -0,0 +1,149 @@
1
+ import { SPLITTER, VECTOR_STR } from './utils.js'
2
+
3
+ export class TypeDescriptor {
4
+ // type: string
5
+
6
+ // qualified name without type parameters
7
+ qname: string
8
+ // account?: string
9
+ // module?: string
10
+
11
+ typeArgs: TypeDescriptor[]
12
+
13
+ constructor(symbol: string, typeParams?: TypeDescriptor[]) {
14
+ this.qname = symbol
15
+ this.typeArgs = typeParams || []
16
+ }
17
+
18
+ getSignature(): string {
19
+ if (this.typeArgs.length > 0) {
20
+ return this.qname + '<' + this.typeArgs.map((t) => t.getSignature()).join(', ') + '>'
21
+ }
22
+ return this.qname
23
+ }
24
+
25
+ // Replace T0, T1 with more concrete type
26
+ applyTypeArgs(ctx: Map<string, TypeDescriptor>): TypeDescriptor {
27
+ const replace = ctx.get(this.qname)
28
+ if (replace) {
29
+ return replace
30
+ }
31
+ if (ctx.size === 0 || this.typeArgs.length === 0) {
32
+ return this
33
+ }
34
+
35
+ const typeArgs: TypeDescriptor[] = []
36
+ for (const arg of this.typeArgs) {
37
+ const replace = ctx.get(arg.qname)
38
+ if (replace) {
39
+ typeArgs.push(replace)
40
+ } else {
41
+ typeArgs.push(arg.applyTypeArgs(ctx))
42
+ }
43
+ }
44
+ return new TypeDescriptor(this.qname, typeArgs)
45
+ }
46
+
47
+ // all depended types including itself, not include system type
48
+ dependedTypes(): string[] {
49
+ if (this.qname.startsWith('&')) {
50
+ return []
51
+ }
52
+ switch (this.qname) {
53
+ case 'signer':
54
+ case 'address':
55
+ case '0x1::string::String':
56
+ case 'bool':
57
+ case 'u8':
58
+ case 'u16':
59
+ case 'u32':
60
+ case 'u64':
61
+ case 'u128':
62
+ return []
63
+ }
64
+
65
+ // Type parameters are not depended
66
+ if (this.qname.indexOf(SPLITTER) == -1) {
67
+ if (this.qname.startsWith('T')) {
68
+ return []
69
+ }
70
+ }
71
+
72
+ const types = new Set<string>()
73
+ for (const param of this.typeArgs) {
74
+ param.dependedTypes().forEach((t) => types.add(t))
75
+ }
76
+
77
+ if (this.qname !== VECTOR_STR) {
78
+ types.add(this.qname)
79
+ }
80
+
81
+ return Array.from(types)
82
+ }
83
+ }
84
+
85
+ export function parseMoveType(type: string): TypeDescriptor {
86
+ // type = type.replace('&', '')
87
+
88
+ type = type.replaceAll('&mut ', '&')
89
+ type = type.replaceAll('mut ', '')
90
+
91
+ // TODO replace ' ' is not exactly safe, need to double check this
92
+ type = type.replaceAll(' ', '')
93
+
94
+ const stack: TypeDescriptor[] = [new TypeDescriptor('')]
95
+ let buffer = []
96
+
97
+ // xxx:asdf<g1<a,<c,d>>, b, g2<a,b>, e>
98
+ for (let i = 0; i < type.length; i++) {
99
+ const ch = type[i]
100
+ if (ch === '<') {
101
+ // const symbol = type.slice(symbolStart, i)
102
+ // symbolStart =
103
+ const symbol = buffer.join('')
104
+ buffer = []
105
+ stack[stack.length - 1].qname = symbol
106
+ stack.push(new TypeDescriptor(''))
107
+ continue
108
+ }
109
+ if (ch === '>') {
110
+ const typeParam = stack.pop()
111
+ if (!typeParam) {
112
+ throw Error('Uxpectecd stack size')
113
+ }
114
+ if (buffer.length > 0) {
115
+ typeParam.qname = buffer.join('')
116
+ buffer = []
117
+ }
118
+ stack[stack.length - 1].typeArgs.push(typeParam)
119
+ continue
120
+ }
121
+ if (ch === ',') {
122
+ const typeParam = stack.pop()
123
+ if (!typeParam) {
124
+ throw Error('Uxpectecd stack size')
125
+ }
126
+ if (buffer.length > 0) {
127
+ typeParam.qname = buffer.join('')
128
+ buffer = []
129
+ }
130
+
131
+ stack[stack.length - 1].typeArgs.push(typeParam)
132
+ // continue parse next param
133
+ stack.push(new TypeDescriptor(''))
134
+ continue
135
+ }
136
+
137
+ buffer.push(ch)
138
+ }
139
+
140
+ if (buffer.length > 0) {
141
+ stack[stack.length - 1].qname = buffer.join('')
142
+ }
143
+
144
+ const res = stack.pop()
145
+ if (!res || stack.length > 0) {
146
+ throw Error('Uxpectecd stack size')
147
+ }
148
+ return res
149
+ }
@@ -0,0 +1,26 @@
1
+ import { MoveFunction, MoveModule } from './move-types.js'
2
+
3
+ export const SPLITTER = '::'
4
+
5
+ export const VECTOR_STR = 'vector'
6
+
7
+ export function isFrameworkAccount(account: string) {
8
+ return account === '0x1' || account === '0x2' || account === '0x3'
9
+ }
10
+
11
+ export function moduleQname(module: MoveModule): string {
12
+ return module.address.toLowerCase() + SPLITTER + module.name
13
+ }
14
+
15
+ export function moduleQnameForType(type: string): [string, string] {
16
+ const parts = type.split(SPLITTER).slice(0, 2)
17
+ return [parts[0], parts[1]]
18
+ }
19
+
20
+ export function getMeaningfulFunctionParams(func: MoveFunction): string[] {
21
+ let params = func.params
22
+ if (func.params[0] === '&signer') {
23
+ params = params.slice(1)
24
+ }
25
+ return params
26
+ }
@@ -5,8 +5,19 @@ export { BigDecimal } from '@sentio/bigdecimal'
5
5
  declare global {
6
6
  interface BigInt {
7
7
  asBigDecimal(): BigDecimal
8
+ scaleDown(decimal: number | bigint): BigDecimal
8
9
  }
9
10
  }
10
11
  BigInt.prototype.asBigDecimal = function () {
11
12
  return new BigDecimal(this.toString())
12
13
  }
14
+
15
+ BigInt.prototype.scaleDown = function (decimal: number | bigint) {
16
+ // @ts-ignore this is fine
17
+ return scaleDown(this, decimal)
18
+ }
19
+
20
+ export function scaleDown(amount: bigint, decimal: number | bigint): BigDecimal {
21
+ const divider = new BigDecimal(10).pow(Number(decimal))
22
+ return amount.asBigDecimal().dividedBy(divider)
23
+ }
File without changes
package/src/core/index.ts CHANGED
@@ -1,13 +1,10 @@
1
- export { BigDecimal } from './big-decimal.js'
1
+ export { BigDecimal, scaleDown } from './big-decimal.js'
2
2
  export { BaseContext } from './base-context.js'
3
3
  export { type Labels, normalizeLabels } from './metadata.js'
4
- export { ContractContext, ContractView, BoundContractView } from './context.js'
5
4
  export { CounterBinding, Meter, GaugeBinding, Counter, Gauge, MetricOptions } from './meter.js'
6
5
  export { EventTracker, AccountEventTracker } from './event-tracker.js'
7
6
  export { Exporter } from './exporter.js'
8
- export { type Numberish, toBigInteger, toMetricValue, toBlockTag } from './numberish.js'
9
-
10
- export { BindOptions } from './bind-options.js'
7
+ export { type Numberish, toBigInteger, toMetricValue } from './numberish.js'
11
8
 
12
9
  export { SuiBaseProcessor, SuiBindOptions } from './sui-processor.js'
13
10
 
@@ -1,19 +1,8 @@
1
1
  import { BigInteger, MetricValue } from '@sentio/protos'
2
2
  import { BigDecimal } from './big-decimal.js'
3
- import { BlockTag } from 'ethers/providers'
4
3
 
5
4
  export type Numberish = number | bigint | BigDecimal | string
6
5
 
7
- export function toBlockTag(a: number | bigint): BlockTag {
8
- if (typeof a === 'number') {
9
- return a
10
- }
11
- if (a > Number.MAX_SAFE_INTEGER) {
12
- return '0x' + a.toString(16)
13
- }
14
- return Number(a)
15
- }
16
-
17
6
  export function toMetricValue(value: Numberish): MetricValue {
18
7
  if (typeof value === 'number') {
19
8
  if (Number.isNaN(value)) {
@@ -3,7 +3,7 @@ import { ContractConfig, DataBinding, HandlerType, ProcessConfigResponse, Proces
3
3
 
4
4
  import { ServerError, Status } from 'nice-grpc'
5
5
 
6
- import { CHAIN_IDS } from '../utils/chain.js'
6
+ import { CHAIN_IDS } from './chain.js'
7
7
  import { SuiProcessorState } from './sui-processor.js'
8
8
 
9
9
  export class SuiPlugin extends Plugin {
@@ -1,4 +1,4 @@
1
- import { SuiContext } from './context.js'
1
+ import { SuiContext } from '../eth/context.js'
2
2
  import { ProcessResult } from '@sentio/protos'
3
3
  import { ListStateStorage } from '@sentio/runtime'
4
4
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,16 +1,16 @@
1
- import { ERC20__factory, ERC721__factory } from '../builtin/internal/index.js'
1
+ import { ERC20__factory, ERC721__factory } from './builtin/internal/index.js'
2
2
  import { AddressType, EthFetchConfig, ProcessResult } from '@sentio/protos'
3
- import { AccountBindOptions } from '../core/bind-options.js'
3
+ import { AccountBindOptions } from './bind-options.js'
4
4
 
5
5
  import { Network, LogParams } from 'ethers/providers'
6
6
 
7
- import { TransferEvent as ERC20TransferEvent } from '../builtin/internal/ERC20.js'
8
- import { TransferEvent as ERC721TransferEvent } from '../builtin/internal/ERC721.js'
7
+ import { TransferEvent as ERC20TransferEvent } from './builtin/internal/ERC20.js'
8
+ import { TransferEvent as ERC721TransferEvent } from './builtin/internal/ERC721.js'
9
9
 
10
- import { ERC20Processor } from '../builtin/internal/erc20_processor.js'
11
- import { ERC721Processor } from '../builtin/internal/erc721_processor.js'
10
+ import { ERC20Processor } from './builtin/internal/erc20_processor.js'
11
+ import { ERC721Processor } from './builtin/internal/erc721_processor.js'
12
12
 
13
- import { AccountContext } from '../core/context.js'
13
+ import { AccountContext } from './context.js'
14
14
  import { PromiseOrVoid } from '../promise-or-void.js'
15
15
  import { AddressOrTypeEventFilter, EventsHandler } from './base-processor.js'
16
16
  import { Transaction, Block, TransactionReceipt, LogDescription } from 'ethers'
@@ -1,13 +1,14 @@
1
- import { BoundContractView, ContractContext, ContractView } from '../core/context.js'
1
+ import { BoundContractView, ContractContext, ContractView } from './context.js'
2
2
  import { BaseContract, ContractEvent, Block, LogDescription } from 'ethers'
3
3
  import { AddressOrTypeEventFilter, BaseProcessor } from './base-processor.js'
4
- import { BindOptions, getOptionsSignature } from '../core/bind-options.js'
4
+ import { BindOptions, getOptionsSignature } from './bind-options.js'
5
5
  import { EthFetchConfig, HandleInterval, TemplateInstance } from '@sentio/protos'
6
6
  import { PromiseOrVoid } from '../promise-or-void.js'
7
7
  import { Trace } from './trace.js'
8
8
  import { ListStateStorage } from '@sentio/runtime'
9
9
  import { EventFilter, LogParams, Network } from 'ethers/providers'
10
10
  import { DeferredTopicFilter } from 'ethers/contract'
11
+ import { EthLog } from './eth.js'
11
12
 
12
13
  export class ProcessorTemplateProcessorState extends ListStateStorage<
13
14
  BaseProcessorTemplate<BaseContract, BoundContractView<BaseContract, any>>
@@ -36,7 +37,7 @@ export abstract class BaseProcessorTemplate<
36
37
  fetchConfig?: EthFetchConfig
37
38
  }[] = []
38
39
  eventHandlers: {
39
- handler: (event: LogDescription, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid
40
+ handler: (event: EthLog, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid
40
41
  filter: DeferredTopicFilter | DeferredTopicFilter[]
41
42
  fetchConfig?: EthFetchConfig
42
43
  }[] = []
@@ -87,7 +88,7 @@ export abstract class BaseProcessorTemplate<
87
88
  }
88
89
 
89
90
  public onEvent(
90
- handler: (event: LogDescription, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
91
+ handler: (event: EthLog, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
91
92
  filter: DeferredTopicFilter | DeferredTopicFilter[],
92
93
  fetchConfig?: EthFetchConfig
93
94
  ) {
@@ -1,18 +1,7 @@
1
- import {
2
- Block,
3
- ContractEvent,
4
- Log,
5
- TransactionReceipt,
6
- BytesLike,
7
- BaseContract,
8
- Transaction,
9
- DeferredTopicFilter,
10
- LogDescription,
11
- EventFragment,
12
- } from 'ethers'
13
- import { EventFilter, LogParams, Network } from 'ethers/providers'
1
+ import { Block, TransactionReceipt, BaseContract, Transaction, DeferredTopicFilter } from 'ethers'
2
+ import { LogParams, Network } from 'ethers/providers'
14
3
 
15
- import { BoundContractView, ContractContext, ContractView } from '../core/context.js'
4
+ import { BoundContractView, ContractContext, ContractView } from './context.js'
16
5
  import {
17
6
  AddressType,
18
7
  Data_EthBlock,
@@ -22,10 +11,11 @@ import {
22
11
  HandleInterval,
23
12
  ProcessResult,
24
13
  } from '@sentio/protos'
25
- import { BindInternalOptions, BindOptions } from '../core/bind-options.js'
14
+ import { BindInternalOptions, BindOptions } from './bind-options.js'
26
15
  import { PromiseOrVoid } from '../promise-or-void.js'
27
16
  import { Trace } from './trace.js'
28
17
  import { ServerError, Status } from 'nice-grpc'
18
+ import { EthLog } from './eth.js'
29
19
 
30
20
  export interface AddressOrTypeEventFilter extends DeferredTopicFilter {
31
21
  addressType?: AddressType
@@ -88,7 +78,7 @@ export abstract class BaseProcessor<
88
78
  }
89
79
 
90
80
  public onEvent(
91
- handler: (event: LogDescription, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
81
+ handler: (event: EthLog, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
92
82
  filter: DeferredTopicFilter | DeferredTopicFilter[],
93
83
  fetchConfig?: EthFetchConfig
94
84
  ) {
@@ -128,8 +118,10 @@ export abstract class BaseProcessor<
128
118
  const logParam = log as any as { topics: Array<string>; data: string }
129
119
 
130
120
  const parsed = contractView.rawContract.interface.parseLog(logParam)
121
+
131
122
  if (parsed) {
132
- await handler(parsed, ctx)
123
+ const event: EthLog = { ...log, args: parsed.args }
124
+ await handler(event, ctx)
133
125
  return ctx.getProcessResult()
134
126
  }
135
127
  return ProcessResult.fromPartial({})
@@ -197,9 +189,7 @@ export abstract class BaseProcessor<
197
189
  return this
198
190
  }
199
191
 
200
- public onAllEvents(
201
- handler: (event: LogDescription, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid
202
- ) {
192
+ public onAllEvents(handler: (event: EthLog, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid) {
203
193
  const _filters: DeferredTopicFilter[] = []
204
194
  const tmpContract = this.CreateBoundContractView()
205
195
 
File without changes
package/src/eth/binds.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { BindOptions, getOptionsSignature } from '../core/bind-options.js'
2
- import { ContractView } from '../core/index.js'
1
+ import { BindOptions, getOptionsSignature } from './bind-options.js'
2
+ import { ContractView } from './context.js'
3
3
  import { BaseProcessor } from './base-processor.js'
4
4
  import { Networkish, Network } from 'ethers/providers'
5
5
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  /* Autogenerated file. Do not edit manually. */
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
- import type { BaseContract, Interface, LogDescription } from "ethers";
4
+ import type { BaseContract, Interface } from "ethers";
5
5
  import type { ContractRunner } from "ethers/providers";
6
6
  import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common.js";
7
7
 
@@ -15,8 +15,7 @@ export interface AnswerUpdatedEventObject {
15
15
  export type AnswerUpdatedEvent = TypedEvent<
16
16
  [bigint, bigint, bigint],
17
17
  AnswerUpdatedEventObject
18
- > &
19
- LogDescription;
18
+ >;
20
19
 
21
20
  export type AnswerUpdatedEventFilter = TypedEventFilter<AnswerUpdatedEvent>;
22
21
 
@@ -28,8 +27,7 @@ export interface NewRoundEventObject {
28
27
  export type NewRoundEvent = TypedEvent<
29
28
  [bigint, string, bigint],
30
29
  NewRoundEventObject
31
- > &
32
- LogDescription;
30
+ >;
33
31
 
34
32
  export type NewRoundEventFilter = TypedEventFilter<NewRoundEvent>;
35
33
 
@@ -40,8 +38,7 @@ export interface OwnershipTransferRequestedEventObject {
40
38
  export type OwnershipTransferRequestedEvent = TypedEvent<
41
39
  [string, string],
42
40
  OwnershipTransferRequestedEventObject
43
- > &
44
- LogDescription;
41
+ >;
45
42
 
46
43
  export type OwnershipTransferRequestedEventFilter =
47
44
  TypedEventFilter<OwnershipTransferRequestedEvent>;
@@ -53,8 +50,7 @@ export interface OwnershipTransferredEventObject {
53
50
  export type OwnershipTransferredEvent = TypedEvent<
54
51
  [string, string],
55
52
  OwnershipTransferredEventObject
56
- > &
57
- LogDescription;
53
+ >;
58
54
 
59
55
  export type OwnershipTransferredEventFilter =
60
56
  TypedEventFilter<OwnershipTransferredEvent>;
@@ -1,7 +1,7 @@
1
1
  /* Autogenerated file. Do not edit manually. */
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
- import type { BaseContract, Interface, LogDescription } from "ethers";
4
+ import type { BaseContract, Interface } from "ethers";
5
5
  import type { ContractRunner } from "ethers/providers";
6
6
  import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common.js";
7
7
 
@@ -15,8 +15,7 @@ export interface ApprovalForAllEventObject {
15
15
  export type ApprovalForAllEvent = TypedEvent<
16
16
  [string, string, boolean],
17
17
  ApprovalForAllEventObject
18
- > &
19
- LogDescription;
18
+ >;
20
19
 
21
20
  export type ApprovalForAllEventFilter = TypedEventFilter<ApprovalForAllEvent>;
22
21
 
@@ -30,8 +29,7 @@ export interface TransferBatchEventObject {
30
29
  export type TransferBatchEvent = TypedEvent<
31
30
  [string, string, string, bigint[], bigint[]],
32
31
  TransferBatchEventObject
33
- > &
34
- LogDescription;
32
+ >;
35
33
 
36
34
  export type TransferBatchEventFilter = TypedEventFilter<TransferBatchEvent>;
37
35
 
@@ -45,8 +43,7 @@ export interface TransferSingleEventObject {
45
43
  export type TransferSingleEvent = TypedEvent<
46
44
  [string, string, string, bigint, bigint],
47
45
  TransferSingleEventObject
48
- > &
49
- LogDescription;
46
+ >;
50
47
 
51
48
  export type TransferSingleEventFilter = TypedEventFilter<TransferSingleEvent>;
52
49
 
@@ -54,8 +51,7 @@ export interface URIEventObject {
54
51
  value: string;
55
52
  id: bigint;
56
53
  }
57
- export type URIEvent = TypedEvent<[string, bigint], URIEventObject> &
58
- LogDescription;
54
+ export type URIEvent = TypedEvent<[string, bigint], URIEventObject>;
59
55
 
60
56
  export type URIEventFilter = TypedEventFilter<URIEvent>;
61
57
 
@@ -1,7 +1,7 @@
1
1
  /* Autogenerated file. Do not edit manually. */
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
- import type { BaseContract, Interface, LogDescription } from "ethers";
4
+ import type { BaseContract, Interface } from "ethers";
5
5
  import type { ContractRunner } from "ethers/providers";
6
6
  import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common.js";
7
7
 
@@ -15,8 +15,7 @@ export interface ApprovalEventObject {
15
15
  export type ApprovalEvent = TypedEvent<
16
16
  [string, string, bigint],
17
17
  ApprovalEventObject
18
- > &
19
- LogDescription;
18
+ >;
20
19
 
21
20
  export type ApprovalEventFilter = TypedEventFilter<ApprovalEvent>;
22
21
 
@@ -27,8 +26,7 @@ export interface OwnershipTransferredEventObject {
27
26
  export type OwnershipTransferredEvent = TypedEvent<
28
27
  [string, string],
29
28
  OwnershipTransferredEventObject
30
- > &
31
- LogDescription;
29
+ >;
32
30
 
33
31
  export type OwnershipTransferredEventFilter =
34
32
  TypedEventFilter<OwnershipTransferredEvent>;
@@ -41,8 +39,7 @@ export interface TransferEventObject {
41
39
  export type TransferEvent = TypedEvent<
42
40
  [string, string, bigint],
43
41
  TransferEventObject
44
- > &
45
- LogDescription;
42
+ >;
46
43
 
47
44
  export type TransferEventFilter = TypedEventFilter<TransferEvent>;
48
45
 
@@ -1,7 +1,7 @@
1
1
  /* Autogenerated file. Do not edit manually. */
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
- import type { BaseContract, Interface, LogDescription } from "ethers";
4
+ import type { BaseContract, Interface } from "ethers";
5
5
  import type { ContractRunner } from "ethers/providers";
6
6
  import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common.js";
7
7
 
@@ -15,8 +15,7 @@ export interface ApprovalEventObject {
15
15
  export type ApprovalEvent = TypedEvent<
16
16
  [string, string, bigint],
17
17
  ApprovalEventObject
18
- > &
19
- LogDescription;
18
+ >;
20
19
 
21
20
  export type ApprovalEventFilter = TypedEventFilter<ApprovalEvent>;
22
21
 
@@ -28,8 +27,7 @@ export interface TransferEventObject {
28
27
  export type TransferEvent = TypedEvent<
29
28
  [string, string, bigint],
30
29
  TransferEventObject
31
- > &
32
- LogDescription;
30
+ >;
33
31
 
34
32
  export type TransferEventFilter = TypedEventFilter<TransferEvent>;
35
33
 
@@ -1,7 +1,7 @@
1
1
  /* Autogenerated file. Do not edit manually. */
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
- import type { BaseContract, Interface, LogDescription } from "ethers";
4
+ import type { BaseContract, Interface } from "ethers";
5
5
  import type { ContractRunner } from "ethers/providers";
6
6
  import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common.js";
7
7
 
@@ -15,8 +15,7 @@ export interface ApprovalEventObject {
15
15
  export type ApprovalEvent = TypedEvent<
16
16
  [string, string, bigint],
17
17
  ApprovalEventObject
18
- > &
19
- LogDescription;
18
+ >;
20
19
 
21
20
  export type ApprovalEventFilter = TypedEventFilter<ApprovalEvent>;
22
21
 
@@ -28,8 +27,7 @@ export interface ApprovalForAllEventObject {
28
27
  export type ApprovalForAllEvent = TypedEvent<
29
28
  [string, string, boolean],
30
29
  ApprovalForAllEventObject
31
- > &
32
- LogDescription;
30
+ >;
33
31
 
34
32
  export type ApprovalForAllEventFilter = TypedEventFilter<ApprovalForAllEvent>;
35
33
 
@@ -41,8 +39,7 @@ export interface TransferEventObject {
41
39
  export type TransferEvent = TypedEvent<
42
40
  [string, string, bigint],
43
41
  TransferEventObject
44
- > &
45
- LogDescription;
42
+ >;
46
43
 
47
44
  export type TransferEventFilter = TypedEventFilter<TransferEvent>;
48
45