@sentio/sdk 2.3.6-rc.1 → 2.4.0-rc.1

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 (279) hide show
  1. package/lib/aptos/tests/aptos.test.js.map +1 -1
  2. package/lib/eth/account-processor.d.ts +2 -2
  3. package/lib/eth/account-processor.js +2 -2
  4. package/lib/eth/account-processor.js.map +1 -1
  5. package/lib/eth/builtin/eacaggregatorproxy.d.ts +2 -2
  6. package/lib/eth/builtin/eacaggregatorproxy.js +2 -2
  7. package/lib/eth/builtin/eacaggregatorproxy.js.map +1 -1
  8. package/lib/eth/builtin/erc1155.d.ts +2 -2
  9. package/lib/eth/builtin/erc1155.js +2 -2
  10. package/lib/eth/builtin/erc1155.js.map +1 -1
  11. package/lib/eth/builtin/erc20.d.ts +2 -2
  12. package/lib/eth/builtin/erc20.js +2 -2
  13. package/lib/eth/builtin/erc20.js.map +1 -1
  14. package/lib/eth/builtin/erc20bytes.d.ts +2 -2
  15. package/lib/eth/builtin/erc20bytes.js +2 -2
  16. package/lib/eth/builtin/erc20bytes.js.map +1 -1
  17. package/lib/eth/builtin/erc721.d.ts +2 -2
  18. package/lib/eth/builtin/erc721.js +2 -2
  19. package/lib/eth/builtin/erc721.js.map +1 -1
  20. package/lib/eth/builtin/internal/{eacaggregatorproxy_processor.d.ts → eacaggregatorproxy-processor.d.ts} +0 -0
  21. package/lib/eth/builtin/internal/{eacaggregatorproxy_processor.js → eacaggregatorproxy-processor.js} +1 -1
  22. package/lib/eth/builtin/internal/{eacaggregatorproxy_processor.js.map → eacaggregatorproxy-processor.js.map} +1 -1
  23. package/lib/eth/builtin/internal/{eacaggregatorproxy_test-utils.d.ts → eacaggregatorproxy-test-utils.d.ts} +0 -0
  24. package/lib/eth/builtin/internal/{eacaggregatorproxy_test-utils.js → eacaggregatorproxy-test-utils.js} +2 -2
  25. package/lib/eth/builtin/internal/{eacaggregatorproxy_test-utils.js.map → eacaggregatorproxy-test-utils.js.map} +1 -1
  26. package/lib/eth/builtin/internal/{erc1155_processor.d.ts → erc1155-processor.d.ts} +0 -0
  27. package/lib/eth/builtin/internal/{erc1155_processor.js → erc1155-processor.js} +1 -1
  28. package/lib/eth/builtin/internal/{erc1155_processor.js.map → erc1155-processor.js.map} +1 -1
  29. package/lib/eth/builtin/internal/{erc1155_test-utils.d.ts → erc1155-test-utils.d.ts} +0 -0
  30. package/lib/eth/builtin/internal/{erc1155_test-utils.js → erc1155-test-utils.js} +2 -2
  31. package/lib/eth/builtin/internal/{erc1155_test-utils.js.map → erc1155-test-utils.js.map} +1 -1
  32. package/lib/eth/builtin/internal/{erc20_processor.d.ts → erc20-processor.d.ts} +0 -0
  33. package/lib/eth/builtin/internal/{erc20_processor.js → erc20-processor.js} +1 -1
  34. package/lib/eth/builtin/internal/{erc20_processor.js.map → erc20-processor.js.map} +1 -1
  35. package/lib/eth/builtin/internal/{erc20_test-utils.d.ts → erc20-test-utils.d.ts} +0 -0
  36. package/lib/eth/builtin/internal/{erc20_test-utils.js → erc20-test-utils.js} +2 -2
  37. package/lib/eth/builtin/internal/{erc20_test-utils.js.map → erc20-test-utils.js.map} +1 -1
  38. package/lib/eth/builtin/internal/{erc20bytes_processor.d.ts → erc20bytes-processor.d.ts} +0 -0
  39. package/lib/eth/builtin/internal/{erc20bytes_processor.js → erc20bytes-processor.js} +1 -1
  40. package/lib/eth/builtin/internal/{erc20bytes_processor.js.map → erc20bytes-processor.js.map} +1 -1
  41. package/lib/eth/builtin/internal/{erc20bytes_test-utils.d.ts → erc20bytes-test-utils.d.ts} +0 -0
  42. package/lib/eth/builtin/internal/{erc20bytes_test-utils.js → erc20bytes-test-utils.js} +2 -2
  43. package/lib/eth/builtin/internal/{erc20bytes_test-utils.js.map → erc20bytes-test-utils.js.map} +1 -1
  44. package/lib/eth/builtin/internal/{erc721_processor.d.ts → erc721-processor.d.ts} +0 -0
  45. package/lib/eth/builtin/internal/{erc721_processor.js → erc721-processor.js} +1 -1
  46. package/lib/eth/builtin/internal/{erc721_processor.js.map → erc721-processor.js.map} +1 -1
  47. package/lib/eth/builtin/internal/{erc721_test-utils.d.ts → erc721-test-utils.d.ts} +0 -0
  48. package/lib/eth/builtin/internal/{erc721_test-utils.js → erc721-test-utils.js} +2 -2
  49. package/lib/eth/builtin/internal/{erc721_test-utils.js.map → erc721-test-utils.js.map} +1 -1
  50. package/lib/eth/builtin/internal/{weth9_processor.d.ts → weth9-processor.d.ts} +0 -0
  51. package/lib/eth/builtin/internal/{weth9_processor.js → weth9-processor.js} +1 -1
  52. package/lib/eth/builtin/internal/{weth9_processor.js.map → weth9-processor.js.map} +1 -1
  53. package/lib/eth/builtin/internal/{weth9_test-utils.d.ts → weth9-test-utils.d.ts} +0 -0
  54. package/lib/eth/builtin/internal/{weth9_test-utils.js → weth9-test-utils.js} +2 -2
  55. package/lib/eth/builtin/internal/{weth9_test-utils.js.map → weth9-test-utils.js.map} +1 -1
  56. package/lib/eth/builtin/weth9.d.ts +2 -2
  57. package/lib/eth/builtin/weth9.js +2 -2
  58. package/lib/eth/builtin/weth9.js.map +1 -1
  59. package/lib/eth/codegen/ethers-sentio.js +2 -2
  60. package/lib/eth/codegen/ethers-sentio.js.map +1 -1
  61. package/lib/eth/codegen/file.js +3 -3
  62. package/lib/eth/codegen/file.js.map +1 -1
  63. package/lib/eth/generic-processor.test.js.map +1 -1
  64. package/lib/eth/tests/account.test.d.ts +1 -0
  65. package/lib/eth/tests/account.test.js.map +1 -0
  66. package/lib/eth/tests/codegen.test.d.ts +1 -0
  67. package/lib/eth/tests/codegen.test.js.map +1 -0
  68. package/lib/eth/tests/erc20-template.test.d.ts +1 -0
  69. package/lib/eth/tests/erc20-template.test.js.map +1 -0
  70. package/lib/eth/tests/erc20.d.ts +1 -0
  71. package/lib/eth/tests/erc20.js +52 -0
  72. package/lib/eth/tests/erc20.js.map +1 -0
  73. package/lib/eth/tests/erc20.test.d.ts +1 -0
  74. package/lib/eth/tests/erc20.test.js.map +1 -0
  75. package/lib/eth/tests/error-capture.test.d.ts +1 -0
  76. package/lib/eth/tests/error-capture.test.js.map +1 -0
  77. package/lib/eth/tests/logger.test.d.ts +1 -0
  78. package/lib/eth/tests/logger.test.js.map +1 -0
  79. package/lib/eth/tests/types/anyswaprouter.d.ts +3 -0
  80. package/lib/eth/tests/types/anyswaprouter.js +7 -0
  81. package/lib/eth/tests/types/anyswaprouter.js.map +1 -0
  82. package/lib/eth/tests/types/commitmentpool.d.ts +3 -0
  83. package/lib/eth/tests/types/commitmentpool.js +7 -0
  84. package/lib/eth/tests/types/commitmentpool.js.map +1 -0
  85. package/lib/eth/tests/types/index.d.ts +12 -0
  86. package/lib/eth/tests/types/index.js +16 -0
  87. package/lib/eth/tests/types/index.js.map +1 -0
  88. package/lib/eth/tests/types/internal/AnyswapRouter.d.ts +122 -0
  89. package/lib/eth/tests/types/internal/AnyswapRouter.js +2 -0
  90. package/lib/eth/tests/types/internal/AnyswapRouter.js.map +1 -0
  91. package/lib/eth/tests/types/internal/CommitmentPool.d.ts +176 -0
  92. package/lib/eth/tests/types/internal/CommitmentPool.js +2 -0
  93. package/lib/eth/tests/types/internal/CommitmentPool.js.map +1 -0
  94. package/lib/eth/tests/types/internal/MembershipStakerV3.d.ts +81 -0
  95. package/lib/eth/tests/types/internal/MembershipStakerV3.js +2 -0
  96. package/lib/eth/tests/types/internal/MembershipStakerV3.js.map +1 -0
  97. package/lib/eth/tests/types/internal/Pyth.d.ts +204 -0
  98. package/lib/eth/tests/types/internal/Pyth.js +2 -0
  99. package/lib/eth/tests/types/internal/Pyth.js.map +1 -0
  100. package/lib/eth/tests/types/internal/Seaport.d.ts +350 -0
  101. package/lib/eth/tests/types/internal/Seaport.js +2 -0
  102. package/lib/eth/tests/types/internal/Seaport.js.map +1 -0
  103. package/lib/eth/tests/types/internal/TokenExchange.d.ts +128 -0
  104. package/lib/eth/tests/types/internal/TokenExchange.js +2 -0
  105. package/lib/eth/tests/types/internal/TokenExchange.js.map +1 -0
  106. package/lib/eth/tests/types/internal/anyswaprouter-processor.d.ts +463 -0
  107. package/lib/eth/tests/types/internal/anyswaprouter-processor.js +425 -0
  108. package/lib/eth/tests/types/internal/anyswaprouter-processor.js.map +1 -0
  109. package/lib/eth/tests/types/internal/anyswaprouter-test-utils.d.ts +9 -0
  110. package/lib/eth/tests/types/internal/anyswaprouter-test-utils.js +124 -0
  111. package/lib/eth/tests/types/internal/anyswaprouter-test-utils.js.map +1 -0
  112. package/lib/eth/tests/types/internal/commitmentpool-processor.d.ts +348 -0
  113. package/lib/eth/tests/types/internal/commitmentpool-processor.js +607 -0
  114. package/lib/eth/tests/types/internal/commitmentpool-processor.js.map +1 -0
  115. package/lib/eth/tests/types/internal/commitmentpool-test-utils.d.ts +9 -0
  116. package/lib/eth/tests/types/internal/commitmentpool-test-utils.js +87 -0
  117. package/lib/eth/tests/types/internal/commitmentpool-test-utils.js.map +1 -0
  118. package/lib/eth/tests/types/internal/common.d.ts +10 -0
  119. package/lib/eth/tests/types/internal/common.js +8 -0
  120. package/lib/eth/tests/types/internal/common.js.map +1 -0
  121. package/lib/eth/tests/types/internal/factories/AnyswapRouter__factory.d.ts +988 -0
  122. package/lib/eth/tests/types/internal/factories/AnyswapRouter__factory.js +1269 -0
  123. package/lib/eth/tests/types/internal/factories/AnyswapRouter__factory.js.map +1 -0
  124. package/lib/eth/tests/types/internal/factories/CommitmentPool__factory.d.ts +792 -0
  125. package/lib/eth/tests/types/internal/factories/CommitmentPool__factory.js +1040 -0
  126. package/lib/eth/tests/types/internal/factories/CommitmentPool__factory.js.map +1 -0
  127. package/lib/eth/tests/types/internal/factories/MembershipStakerV3__factory.d.ts +549 -0
  128. package/lib/eth/tests/types/internal/factories/MembershipStakerV3__factory.js +721 -0
  129. package/lib/eth/tests/types/internal/factories/MembershipStakerV3__factory.js.map +1 -0
  130. package/lib/eth/tests/types/internal/factories/Pyth__factory.d.ts +1130 -0
  131. package/lib/eth/tests/types/internal/factories/Pyth__factory.js +1486 -0
  132. package/lib/eth/tests/types/internal/factories/Pyth__factory.js.map +1 -0
  133. package/lib/eth/tests/types/internal/factories/Seaport__factory.d.ts +2018 -0
  134. package/lib/eth/tests/types/internal/factories/Seaport__factory.js +2610 -0
  135. package/lib/eth/tests/types/internal/factories/Seaport__factory.js.map +1 -0
  136. package/lib/eth/tests/types/internal/factories/TokenExchange__factory.d.ts +651 -0
  137. package/lib/eth/tests/types/internal/factories/TokenExchange__factory.js +853 -0
  138. package/lib/eth/tests/types/internal/factories/TokenExchange__factory.js.map +1 -0
  139. package/lib/eth/tests/types/internal/factories/index.d.ts +6 -0
  140. package/lib/eth/tests/types/internal/factories/index.js +10 -0
  141. package/lib/eth/tests/types/internal/factories/index.js.map +1 -0
  142. package/lib/eth/tests/types/internal/index.d.ts +13 -0
  143. package/lib/eth/tests/types/internal/index.js +8 -0
  144. package/lib/eth/tests/types/internal/index.js.map +1 -0
  145. package/lib/eth/tests/types/internal/membershipstakerv3-processor.d.ts +287 -0
  146. package/lib/eth/tests/types/internal/membershipstakerv3-processor.js +596 -0
  147. package/lib/eth/tests/types/internal/membershipstakerv3-processor.js.map +1 -0
  148. package/lib/eth/tests/types/internal/membershipstakerv3-test-utils.d.ts +11 -0
  149. package/lib/eth/tests/types/internal/membershipstakerv3-test-utils.js +109 -0
  150. package/lib/eth/tests/types/internal/membershipstakerv3-test-utils.js.map +1 -0
  151. package/lib/eth/tests/types/internal/pyth-processor.d.ts +422 -0
  152. package/lib/eth/tests/types/internal/pyth-processor.js +890 -0
  153. package/lib/eth/tests/types/internal/pyth-processor.js.map +1 -0
  154. package/lib/eth/tests/types/internal/pyth-test-utils.d.ts +13 -0
  155. package/lib/eth/tests/types/internal/pyth-test-utils.js +131 -0
  156. package/lib/eth/tests/types/internal/pyth-test-utils.js.map +1 -0
  157. package/lib/eth/tests/types/internal/seaport-processor.d.ts +211 -0
  158. package/lib/eth/tests/types/internal/seaport-processor.js +237 -0
  159. package/lib/eth/tests/types/internal/seaport-processor.js.map +1 -0
  160. package/lib/eth/tests/types/internal/seaport-test-utils.d.ts +6 -0
  161. package/lib/eth/tests/types/internal/seaport-test-utils.js +61 -0
  162. package/lib/eth/tests/types/internal/seaport-test-utils.js.map +1 -0
  163. package/lib/eth/tests/types/internal/tokenexchange-processor.d.ts +334 -0
  164. package/lib/eth/tests/types/internal/tokenexchange-processor.js +667 -0
  165. package/lib/eth/tests/types/internal/tokenexchange-processor.js.map +1 -0
  166. package/lib/eth/tests/types/internal/tokenexchange-test-utils.d.ts +13 -0
  167. package/lib/eth/tests/types/internal/tokenexchange-test-utils.js +149 -0
  168. package/lib/eth/tests/types/internal/tokenexchange-test-utils.js.map +1 -0
  169. package/lib/eth/tests/types/membershipstakerv3.d.ts +3 -0
  170. package/lib/eth/tests/types/membershipstakerv3.js +7 -0
  171. package/lib/eth/tests/types/membershipstakerv3.js.map +1 -0
  172. package/lib/eth/tests/types/pyth.d.ts +3 -0
  173. package/lib/eth/tests/types/pyth.js +7 -0
  174. package/lib/eth/tests/types/pyth.js.map +1 -0
  175. package/lib/eth/tests/types/seaport.d.ts +3 -0
  176. package/lib/eth/tests/types/seaport.js +7 -0
  177. package/lib/eth/tests/types/seaport.js.map +1 -0
  178. package/lib/eth/tests/types/tokenexchange.d.ts +3 -0
  179. package/lib/eth/tests/types/tokenexchange.js +7 -0
  180. package/lib/eth/tests/types/tokenexchange.js.map +1 -0
  181. package/lib/solana/builtin/types.d.ts +8 -8
  182. package/lib/solana/tests/solana.test.js.map +1 -1
  183. package/lib/sui/sui-processor.js +2 -8
  184. package/lib/sui/sui-processor.js.map +1 -1
  185. package/lib/sui/tests/sui.test.js.map +1 -1
  186. package/lib/sui/utils.d.ts +2 -0
  187. package/lib/sui/utils.js +11 -0
  188. package/lib/sui/utils.js.map +1 -0
  189. package/lib/testing/aptos-facet.d.ts +12 -0
  190. package/lib/testing/aptos-facet.js +91 -0
  191. package/lib/testing/aptos-facet.js.map +1 -0
  192. package/lib/testing/eth-facet.d.ts +27 -0
  193. package/lib/testing/eth-facet.js +211 -0
  194. package/lib/testing/eth-facet.js.map +1 -0
  195. package/lib/testing/solana-facet.d.ts +7 -0
  196. package/lib/testing/solana-facet.js +22 -0
  197. package/lib/testing/solana-facet.js.map +1 -0
  198. package/lib/testing/sui-facet.d.ts +12 -0
  199. package/lib/testing/sui-facet.js +103 -0
  200. package/lib/testing/sui-facet.js.map +1 -0
  201. package/lib/testing/test-processor-server.d.ts +9 -23
  202. package/lib/testing/test-processor-server.js +13 -227
  203. package/lib/testing/test-processor-server.js.map +1 -1
  204. package/lib/utils/dex-price.js +1 -1
  205. package/lib/utils/dex-price.js.map +1 -1
  206. package/lib/utils/token.js +1 -1
  207. package/lib/utils/token.js.map +1 -1
  208. package/package.json +5 -5
  209. package/src/eth/account-processor.ts +2 -5
  210. package/src/eth/builtin/eacaggregatorproxy.ts +2 -2
  211. package/src/eth/builtin/erc1155.ts +2 -2
  212. package/src/eth/builtin/erc20.ts +2 -2
  213. package/src/eth/builtin/erc20bytes.ts +2 -2
  214. package/src/eth/builtin/erc721.ts +2 -2
  215. package/src/eth/builtin/internal/{eacaggregatorproxy_processor.ts → eacaggregatorproxy-processor.ts} +0 -0
  216. package/src/eth/builtin/internal/{eacaggregatorproxy_test-utils.ts → eacaggregatorproxy-test-utils.ts} +1 -1
  217. package/src/eth/builtin/internal/{erc1155_processor.ts → erc1155-processor.ts} +0 -0
  218. package/src/eth/builtin/internal/{erc1155_test-utils.ts → erc1155-test-utils.ts} +1 -1
  219. package/src/eth/builtin/internal/{erc20_processor.ts → erc20-processor.ts} +0 -0
  220. package/src/eth/builtin/internal/{erc20_test-utils.ts → erc20-test-utils.ts} +1 -1
  221. package/src/eth/builtin/internal/{erc20bytes_processor.ts → erc20bytes-processor.ts} +0 -0
  222. package/src/eth/builtin/internal/{erc20bytes_test-utils.ts → erc20bytes-test-utils.ts} +1 -1
  223. package/src/eth/builtin/internal/{erc721_processor.ts → erc721-processor.ts} +0 -0
  224. package/src/eth/builtin/internal/{erc721_test-utils.ts → erc721-test-utils.ts} +1 -1
  225. package/src/eth/builtin/internal/{weth9_processor.ts → weth9-processor.ts} +0 -0
  226. package/src/eth/builtin/internal/{weth9_test-utils.ts → weth9-test-utils.ts} +1 -1
  227. package/src/eth/builtin/weth9.ts +2 -2
  228. package/src/eth/codegen/ethers-sentio.ts +2 -2
  229. package/src/eth/codegen/file.ts +3 -3
  230. package/src/eth/tests/abis/eth/CommitmentPool.json +1034 -0
  231. package/src/eth/tests/abis/eth/MembershipStakerV3.json +706 -0
  232. package/src/eth/tests/abis/eth/Pyth.json +1471 -0
  233. package/src/eth/tests/abis/eth/Seaport.json +2595 -0
  234. package/src/eth/tests/abis/eth/TokenExchange.json +838 -0
  235. package/src/eth/tests/abis/eth/anyswapRouter.json +490 -0
  236. package/src/eth/tests/erc20.ts +63 -0
  237. package/src/eth/tests/types/anyswaprouter.ts +7 -0
  238. package/src/eth/tests/types/commitmentpool.ts +7 -0
  239. package/src/eth/tests/types/index.ts +33 -0
  240. package/src/eth/tests/types/internal/AnyswapRouter.ts +122 -0
  241. package/src/eth/tests/types/internal/CommitmentPool.ts +208 -0
  242. package/src/eth/tests/types/internal/MembershipStakerV3.ts +108 -0
  243. package/src/eth/tests/types/internal/Pyth.ts +246 -0
  244. package/src/eth/tests/types/internal/Seaport.ts +389 -0
  245. package/src/eth/tests/types/internal/TokenExchange.ts +142 -0
  246. package/src/eth/tests/types/internal/anyswaprouter-processor.ts +1396 -0
  247. package/src/eth/tests/types/internal/anyswaprouter-test-utils.ts +187 -0
  248. package/src/eth/tests/types/internal/commitmentpool-processor.ts +1575 -0
  249. package/src/eth/tests/types/internal/commitmentpool-test-utils.ts +150 -0
  250. package/src/eth/tests/types/internal/common.ts +23 -0
  251. package/src/eth/tests/types/internal/factories/AnyswapRouter__factory.ts +1278 -0
  252. package/src/eth/tests/types/internal/factories/CommitmentPool__factory.ts +1049 -0
  253. package/src/eth/tests/types/internal/factories/MembershipStakerV3__factory.ts +730 -0
  254. package/src/eth/tests/types/internal/factories/Pyth__factory.ts +1492 -0
  255. package/src/eth/tests/types/internal/factories/Seaport__factory.ts +2616 -0
  256. package/src/eth/tests/types/internal/factories/TokenExchange__factory.ts +862 -0
  257. package/src/eth/tests/types/internal/factories/index.ts +9 -0
  258. package/src/eth/tests/types/internal/index.ts +16 -0
  259. package/src/eth/tests/types/internal/membershipstakerv3-processor.ts +1399 -0
  260. package/src/eth/tests/types/internal/membershipstakerv3-test-utils.ts +188 -0
  261. package/src/eth/tests/types/internal/pyth-processor.ts +2043 -0
  262. package/src/eth/tests/types/internal/pyth-test-utils.ts +226 -0
  263. package/src/eth/tests/types/internal/seaport-processor.ts +678 -0
  264. package/src/eth/tests/types/internal/seaport-test-utils.ts +100 -0
  265. package/src/eth/tests/types/internal/tokenexchange-processor.ts +1570 -0
  266. package/src/eth/tests/types/internal/tokenexchange-test-utils.ts +244 -0
  267. package/src/eth/tests/types/membershipstakerv3.ts +7 -0
  268. package/src/eth/tests/types/pyth.ts +7 -0
  269. package/src/eth/tests/types/seaport.ts +7 -0
  270. package/src/eth/tests/types/tokenexchange.ts +7 -0
  271. package/src/sui/sui-processor.ts +2 -7
  272. package/src/sui/utils.ts +11 -0
  273. package/src/testing/aptos-facet.ts +111 -0
  274. package/src/testing/eth-facet.ts +233 -0
  275. package/src/testing/solana-facet.ts +25 -0
  276. package/src/testing/sui-facet.ts +119 -0
  277. package/src/testing/test-processor-server.ts +15 -252
  278. package/src/utils/dex-price.ts +1 -1
  279. package/src/utils/token.ts +1 -3
@@ -0,0 +1,226 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ import { LogParams } from "ethers/providers";
5
+ import {
6
+ AdminChangedEventObject,
7
+ BatchPriceFeedUpdateEventObject,
8
+ BeaconUpgradedEventObject,
9
+ ContractUpgradedEventObject,
10
+ DataSourcesSetEventObject,
11
+ FeeSetEventObject,
12
+ GovernanceDataSourceSetEventObject,
13
+ OwnershipTransferredEventObject,
14
+ PriceFeedUpdateEventObject,
15
+ UpgradedEventObject,
16
+ ValidPeriodSetEventObject,
17
+ } from "./Pyth.js";
18
+ import { getPythContract } from "./pyth-processor.js";
19
+ const mockField = {
20
+ blockHash:
21
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
22
+ blockNumber: 0,
23
+ logIndex: 0,
24
+ removed: false,
25
+ transactionHash:
26
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
27
+ transactionIndex: 0,
28
+ };
29
+
30
+ export function mockAdminChangedLog(
31
+ contractAddress: string,
32
+ event: AdminChangedEventObject
33
+ ): LogParams {
34
+ const contract = getPythContract(contractAddress);
35
+ const encodedLog = contract.rawContract.interface.encodeEventLog(
36
+ "AdminChanged(address,address)",
37
+ [event.previousAdmin, event.newAdmin]
38
+ );
39
+ return {
40
+ ...mockField,
41
+ index: 0,
42
+ address: contractAddress,
43
+ data: encodedLog.data,
44
+ topics: encodedLog.topics,
45
+ };
46
+ }
47
+
48
+ export function mockBatchPriceFeedUpdateLog(
49
+ contractAddress: string,
50
+ event: BatchPriceFeedUpdateEventObject
51
+ ): LogParams {
52
+ const contract = getPythContract(contractAddress);
53
+ const encodedLog = contract.rawContract.interface.encodeEventLog(
54
+ "BatchPriceFeedUpdate(uint16,uint64)",
55
+ [event.chainId, event.sequenceNumber]
56
+ );
57
+ return {
58
+ ...mockField,
59
+ index: 0,
60
+ address: contractAddress,
61
+ data: encodedLog.data,
62
+ topics: encodedLog.topics,
63
+ };
64
+ }
65
+
66
+ export function mockBeaconUpgradedLog(
67
+ contractAddress: string,
68
+ event: BeaconUpgradedEventObject
69
+ ): LogParams {
70
+ const contract = getPythContract(contractAddress);
71
+ const encodedLog = contract.rawContract.interface.encodeEventLog(
72
+ "BeaconUpgraded(address)",
73
+ [event.beacon]
74
+ );
75
+ return {
76
+ ...mockField,
77
+ index: 0,
78
+ address: contractAddress,
79
+ data: encodedLog.data,
80
+ topics: encodedLog.topics,
81
+ };
82
+ }
83
+
84
+ export function mockContractUpgradedLog(
85
+ contractAddress: string,
86
+ event: ContractUpgradedEventObject
87
+ ): LogParams {
88
+ const contract = getPythContract(contractAddress);
89
+ const encodedLog = contract.rawContract.interface.encodeEventLog(
90
+ "ContractUpgraded(address,address)",
91
+ [event.oldImplementation, event.newImplementation]
92
+ );
93
+ return {
94
+ ...mockField,
95
+ index: 0,
96
+ address: contractAddress,
97
+ data: encodedLog.data,
98
+ topics: encodedLog.topics,
99
+ };
100
+ }
101
+
102
+ export function mockDataSourcesSetLog(
103
+ contractAddress: string,
104
+ event: DataSourcesSetEventObject
105
+ ): LogParams {
106
+ const contract = getPythContract(contractAddress);
107
+ const encodedLog = contract.rawContract.interface.encodeEventLog(
108
+ "DataSourcesSet(tuple[],tuple[])",
109
+ [event.oldDataSources, event.newDataSources]
110
+ );
111
+ return {
112
+ ...mockField,
113
+ index: 0,
114
+ address: contractAddress,
115
+ data: encodedLog.data,
116
+ topics: encodedLog.topics,
117
+ };
118
+ }
119
+
120
+ export function mockFeeSetLog(
121
+ contractAddress: string,
122
+ event: FeeSetEventObject
123
+ ): LogParams {
124
+ const contract = getPythContract(contractAddress);
125
+ const encodedLog = contract.rawContract.interface.encodeEventLog(
126
+ "FeeSet(uint256,uint256)",
127
+ [event.oldFee, event.newFee]
128
+ );
129
+ return {
130
+ ...mockField,
131
+ index: 0,
132
+ address: contractAddress,
133
+ data: encodedLog.data,
134
+ topics: encodedLog.topics,
135
+ };
136
+ }
137
+
138
+ export function mockGovernanceDataSourceSetLog(
139
+ contractAddress: string,
140
+ event: GovernanceDataSourceSetEventObject
141
+ ): LogParams {
142
+ const contract = getPythContract(contractAddress);
143
+ const encodedLog = contract.rawContract.interface.encodeEventLog(
144
+ "GovernanceDataSourceSet(tuple,tuple,uint64)",
145
+ [event.oldDataSource, event.newDataSource, event.initialSequence]
146
+ );
147
+ return {
148
+ ...mockField,
149
+ index: 0,
150
+ address: contractAddress,
151
+ data: encodedLog.data,
152
+ topics: encodedLog.topics,
153
+ };
154
+ }
155
+
156
+ export function mockOwnershipTransferredLog(
157
+ contractAddress: string,
158
+ event: OwnershipTransferredEventObject
159
+ ): LogParams {
160
+ const contract = getPythContract(contractAddress);
161
+ const encodedLog = contract.rawContract.interface.encodeEventLog(
162
+ "OwnershipTransferred(address,address)",
163
+ [event.previousOwner, event.newOwner]
164
+ );
165
+ return {
166
+ ...mockField,
167
+ index: 0,
168
+ address: contractAddress,
169
+ data: encodedLog.data,
170
+ topics: encodedLog.topics,
171
+ };
172
+ }
173
+
174
+ export function mockPriceFeedUpdateLog(
175
+ contractAddress: string,
176
+ event: PriceFeedUpdateEventObject
177
+ ): LogParams {
178
+ const contract = getPythContract(contractAddress);
179
+ const encodedLog = contract.rawContract.interface.encodeEventLog(
180
+ "PriceFeedUpdate(bytes32,uint64,int64,uint64)",
181
+ [event.id, event.publishTime, event.price, event.conf]
182
+ );
183
+ return {
184
+ ...mockField,
185
+ index: 0,
186
+ address: contractAddress,
187
+ data: encodedLog.data,
188
+ topics: encodedLog.topics,
189
+ };
190
+ }
191
+
192
+ export function mockUpgradedLog(
193
+ contractAddress: string,
194
+ event: UpgradedEventObject
195
+ ): LogParams {
196
+ const contract = getPythContract(contractAddress);
197
+ const encodedLog = contract.rawContract.interface.encodeEventLog(
198
+ "Upgraded(address)",
199
+ [event.implementation]
200
+ );
201
+ return {
202
+ ...mockField,
203
+ index: 0,
204
+ address: contractAddress,
205
+ data: encodedLog.data,
206
+ topics: encodedLog.topics,
207
+ };
208
+ }
209
+
210
+ export function mockValidPeriodSetLog(
211
+ contractAddress: string,
212
+ event: ValidPeriodSetEventObject
213
+ ): LogParams {
214
+ const contract = getPythContract(contractAddress);
215
+ const encodedLog = contract.rawContract.interface.encodeEventLog(
216
+ "ValidPeriodSet(uint256,uint256)",
217
+ [event.oldValidPeriod, event.newValidPeriod]
218
+ );
219
+ return {
220
+ ...mockField,
221
+ index: 0,
222
+ address: contractAddress,
223
+ data: encodedLog.data,
224
+ topics: encodedLog.topics,
225
+ };
226
+ }