@across-protocol/sdk 4.1.63-beta.3 → 4.1.64-alpha.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 (510) hide show
  1. package/dist/cjs/arch/evm/SpokeUtils.d.ts +1 -1
  2. package/dist/cjs/arch/evm/SpokeUtils.js +5 -6
  3. package/dist/cjs/arch/evm/SpokeUtils.js.map +1 -1
  4. package/dist/cjs/arch/evm/index.d.ts +0 -1
  5. package/dist/cjs/arch/evm/index.js +0 -1
  6. package/dist/cjs/arch/evm/index.js.map +1 -1
  7. package/dist/cjs/arch/svm/index.d.ts +1 -5
  8. package/dist/cjs/arch/svm/index.js +2 -6
  9. package/dist/cjs/arch/svm/index.js.map +1 -1
  10. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +1 -1
  11. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +7 -7
  12. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
  13. package/dist/cjs/clients/BaseAbstractClient.d.ts +5 -6
  14. package/dist/cjs/clients/BaseAbstractClient.js +19 -30
  15. package/dist/cjs/clients/BaseAbstractClient.js.map +1 -1
  16. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js +11 -15
  17. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  18. package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js +1 -1
  19. package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
  20. package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.d.ts +114 -114
  21. package/dist/cjs/clients/HubPoolClient.d.ts +3 -4
  22. package/dist/cjs/clients/HubPoolClient.js +17 -18
  23. package/dist/cjs/clients/HubPoolClient.js.map +1 -1
  24. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +3 -3
  25. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js +20 -23
  26. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
  27. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.d.ts +5 -5
  28. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js +57 -54
  29. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
  30. package/dist/cjs/clients/SpokePoolClient/index.d.ts +0 -3
  31. package/dist/cjs/clients/SpokePoolClient/index.js +1 -8
  32. package/dist/cjs/clients/SpokePoolClient/index.js.map +1 -1
  33. package/dist/cjs/clients/index.d.ts +1 -1
  34. package/dist/cjs/clients/index.js +1 -2
  35. package/dist/cjs/clients/index.js.map +1 -1
  36. package/dist/cjs/clients/mocks/MockConfigStoreClient.d.ts +1 -1
  37. package/dist/cjs/clients/mocks/MockConfigStoreClient.js +2 -2
  38. package/dist/cjs/clients/mocks/MockConfigStoreClient.js.map +1 -1
  39. package/dist/cjs/clients/mocks/MockHubPoolClient.js +2 -2
  40. package/dist/cjs/clients/mocks/MockHubPoolClient.js.map +1 -1
  41. package/dist/cjs/clients/mocks/MockSpokePoolClient.js +4 -7
  42. package/dist/cjs/clients/mocks/MockSpokePoolClient.js.map +1 -1
  43. package/dist/cjs/clients/mocks/index.d.ts +0 -2
  44. package/dist/cjs/clients/mocks/index.js +0 -2
  45. package/dist/cjs/clients/mocks/index.js.map +1 -1
  46. package/dist/cjs/constants.d.ts +0 -1
  47. package/dist/cjs/constants.js +1 -2
  48. package/dist/cjs/constants.js.map +1 -1
  49. package/dist/cjs/gasPriceOracle/adapters/arbitrum.d.ts +2 -2
  50. package/dist/cjs/gasPriceOracle/adapters/arbitrum.js.map +1 -1
  51. package/dist/cjs/gasPriceOracle/adapters/ethereum.d.ts +4 -4
  52. package/dist/cjs/gasPriceOracle/adapters/ethereum.js.map +1 -1
  53. package/dist/cjs/gasPriceOracle/adapters/linea-viem.js +2 -3
  54. package/dist/cjs/gasPriceOracle/adapters/linea-viem.js.map +1 -1
  55. package/dist/cjs/gasPriceOracle/adapters/polygon.d.ts +3 -3
  56. package/dist/cjs/gasPriceOracle/index.d.ts +1 -1
  57. package/dist/cjs/gasPriceOracle/oracle.d.ts +3 -4
  58. package/dist/cjs/gasPriceOracle/oracle.js +9 -16
  59. package/dist/cjs/gasPriceOracle/oracle.js.map +1 -1
  60. package/dist/cjs/gasPriceOracle/types.d.ts +1 -6
  61. package/dist/cjs/index.d.ts +1 -0
  62. package/dist/cjs/index.js +2 -1
  63. package/dist/cjs/index.js.map +1 -1
  64. package/dist/cjs/interfaces/SpokePool.d.ts +0 -13
  65. package/dist/cjs/interfaces/SpokePool.js.map +1 -1
  66. package/dist/cjs/providers/index.d.ts +1 -1
  67. package/dist/cjs/providers/index.js +2 -1
  68. package/dist/cjs/providers/index.js.map +1 -1
  69. package/dist/cjs/providers/{mocks/mockEthersProvider.js → mockProvider.js} +2 -2
  70. package/dist/cjs/providers/mockProvider.js.map +1 -0
  71. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
  72. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js +8 -10
  73. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
  74. package/dist/cjs/relayFeeCalculator/chain-queries/factory.d.ts +2 -4
  75. package/dist/cjs/relayFeeCalculator/chain-queries/factory.js +2 -8
  76. package/dist/cjs/relayFeeCalculator/chain-queries/factory.js.map +1 -1
  77. package/dist/cjs/relayFeeCalculator/chain-queries/index.d.ts +0 -1
  78. package/dist/cjs/relayFeeCalculator/chain-queries/index.js +0 -1
  79. package/dist/cjs/relayFeeCalculator/chain-queries/index.js.map +1 -1
  80. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +0 -2
  81. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js +4 -10
  82. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
  83. package/dist/cjs/svm/eventsClient.d.ts +15 -0
  84. package/dist/cjs/svm/eventsClient.js +157 -0
  85. package/dist/cjs/svm/eventsClient.js.map +1 -0
  86. package/dist/cjs/svm/index.d.ts +3 -0
  87. package/dist/cjs/svm/index.js +8 -0
  88. package/dist/cjs/svm/index.js.map +1 -0
  89. package/dist/cjs/{arch/svm → svm}/types.d.ts +4 -9
  90. package/dist/cjs/svm/types.js.map +1 -0
  91. package/dist/cjs/svm/utils/events.d.ts +8 -0
  92. package/dist/cjs/svm/utils/events.js +47 -0
  93. package/dist/cjs/svm/utils/events.js.map +1 -0
  94. package/dist/cjs/svm/utils/helpers.d.ts +2 -0
  95. package/dist/cjs/svm/utils/helpers.js +19 -0
  96. package/dist/cjs/svm/utils/helpers.js.map +1 -0
  97. package/dist/cjs/svm/utils/index.d.ts +1 -0
  98. package/dist/cjs/svm/utils/index.js +5 -0
  99. package/dist/cjs/svm/utils/index.js.map +1 -0
  100. package/dist/cjs/utils/AddressUtils.d.ts +3 -9
  101. package/dist/cjs/utils/AddressUtils.js +6 -36
  102. package/dist/cjs/utils/AddressUtils.js.map +1 -1
  103. package/dist/cjs/utils/ArrayUtils.d.ts +0 -1
  104. package/dist/cjs/utils/ArrayUtils.js +1 -6
  105. package/dist/cjs/utils/ArrayUtils.js.map +1 -1
  106. package/dist/cjs/utils/BlockUtils.d.ts +27 -2
  107. package/dist/cjs/utils/BlockUtils.js +208 -2
  108. package/dist/cjs/utils/BlockUtils.js.map +1 -1
  109. package/dist/cjs/utils/EventUtils.d.ts +4 -4
  110. package/dist/cjs/utils/EventUtils.js +4 -7
  111. package/dist/cjs/utils/EventUtils.js.map +1 -1
  112. package/dist/cjs/utils/JSONUtils.js +0 -3
  113. package/dist/cjs/utils/JSONUtils.js.map +1 -1
  114. package/dist/cjs/utils/SpokeUtils.js +0 -5
  115. package/dist/cjs/utils/SpokeUtils.js.map +1 -1
  116. package/dist/cjs/utils/index.d.ts +0 -1
  117. package/dist/cjs/utils/index.js +0 -1
  118. package/dist/cjs/utils/index.js.map +1 -1
  119. package/dist/esm/arch/evm/SpokeUtils.d.ts +1 -1
  120. package/dist/esm/arch/evm/SpokeUtils.js +5 -6
  121. package/dist/esm/arch/evm/SpokeUtils.js.map +1 -1
  122. package/dist/esm/arch/evm/index.d.ts +0 -1
  123. package/dist/esm/arch/evm/index.js +0 -1
  124. package/dist/esm/arch/evm/index.js.map +1 -1
  125. package/dist/esm/arch/svm/index.d.ts +1 -5
  126. package/dist/esm/arch/svm/index.js +1 -5
  127. package/dist/esm/arch/svm/index.js.map +1 -1
  128. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +1 -1
  129. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +7 -7
  130. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
  131. package/dist/esm/clients/BaseAbstractClient.d.ts +5 -6
  132. package/dist/esm/clients/BaseAbstractClient.js +19 -30
  133. package/dist/esm/clients/BaseAbstractClient.js.map +1 -1
  134. package/dist/esm/clients/BundleDataClient/BundleDataClient.js +14 -17
  135. package/dist/esm/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  136. package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js +1 -1
  137. package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
  138. package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.d.ts +114 -114
  139. package/dist/esm/clients/HubPoolClient.d.ts +3 -4
  140. package/dist/esm/clients/HubPoolClient.js +18 -19
  141. package/dist/esm/clients/HubPoolClient.js.map +1 -1
  142. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +3 -3
  143. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js +20 -23
  144. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
  145. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.d.ts +7 -7
  146. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js +59 -57
  147. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
  148. package/dist/esm/clients/SpokePoolClient/index.d.ts +0 -8
  149. package/dist/esm/clients/SpokePoolClient/index.js +0 -10
  150. package/dist/esm/clients/SpokePoolClient/index.js.map +1 -1
  151. package/dist/esm/clients/index.d.ts +1 -1
  152. package/dist/esm/clients/index.js +1 -1
  153. package/dist/esm/clients/index.js.map +1 -1
  154. package/dist/esm/clients/mocks/MockConfigStoreClient.d.ts +1 -1
  155. package/dist/esm/clients/mocks/MockConfigStoreClient.js +2 -2
  156. package/dist/esm/clients/mocks/MockConfigStoreClient.js.map +1 -1
  157. package/dist/esm/clients/mocks/MockHubPoolClient.js +2 -2
  158. package/dist/esm/clients/mocks/MockHubPoolClient.js.map +1 -1
  159. package/dist/esm/clients/mocks/MockSpokePoolClient.js +5 -8
  160. package/dist/esm/clients/mocks/MockSpokePoolClient.js.map +1 -1
  161. package/dist/esm/clients/mocks/index.d.ts +0 -2
  162. package/dist/esm/clients/mocks/index.js +0 -2
  163. package/dist/esm/clients/mocks/index.js.map +1 -1
  164. package/dist/esm/constants.d.ts +0 -1
  165. package/dist/esm/constants.js +0 -1
  166. package/dist/esm/constants.js.map +1 -1
  167. package/dist/esm/gasPriceOracle/adapters/arbitrum.d.ts +2 -2
  168. package/dist/esm/gasPriceOracle/adapters/arbitrum.js.map +1 -1
  169. package/dist/esm/gasPriceOracle/adapters/ethereum.d.ts +4 -4
  170. package/dist/esm/gasPriceOracle/adapters/ethereum.js.map +1 -1
  171. package/dist/esm/gasPriceOracle/adapters/linea-viem.js +2 -3
  172. package/dist/esm/gasPriceOracle/adapters/linea-viem.js.map +1 -1
  173. package/dist/esm/gasPriceOracle/adapters/polygon.d.ts +4 -4
  174. package/dist/esm/gasPriceOracle/adapters/polygon.js +1 -1
  175. package/dist/esm/gasPriceOracle/index.d.ts +1 -1
  176. package/dist/esm/gasPriceOracle/oracle.d.ts +3 -4
  177. package/dist/esm/gasPriceOracle/oracle.js +9 -18
  178. package/dist/esm/gasPriceOracle/oracle.js.map +1 -1
  179. package/dist/esm/gasPriceOracle/types.d.ts +1 -6
  180. package/dist/esm/index.d.ts +1 -0
  181. package/dist/esm/index.js +2 -0
  182. package/dist/esm/index.js.map +1 -1
  183. package/dist/esm/interfaces/SpokePool.d.ts +0 -13
  184. package/dist/esm/interfaces/SpokePool.js.map +1 -1
  185. package/dist/esm/providers/index.d.ts +1 -1
  186. package/dist/esm/providers/index.js +2 -1
  187. package/dist/esm/providers/index.js.map +1 -1
  188. package/dist/esm/providers/{mocks/mockEthersProvider.js → mockProvider.js} +2 -2
  189. package/dist/esm/providers/mockProvider.js.map +1 -0
  190. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
  191. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js +8 -10
  192. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
  193. package/dist/esm/relayFeeCalculator/chain-queries/factory.d.ts +2 -4
  194. package/dist/esm/relayFeeCalculator/chain-queries/factory.js +5 -11
  195. package/dist/esm/relayFeeCalculator/chain-queries/factory.js.map +1 -1
  196. package/dist/esm/relayFeeCalculator/chain-queries/index.d.ts +0 -1
  197. package/dist/esm/relayFeeCalculator/chain-queries/index.js +0 -1
  198. package/dist/esm/relayFeeCalculator/chain-queries/index.js.map +1 -1
  199. package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +1 -12
  200. package/dist/esm/relayFeeCalculator/relayFeeCalculator.js +5 -10
  201. package/dist/esm/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
  202. package/dist/esm/svm/eventsClient.d.ts +51 -0
  203. package/dist/esm/svm/eventsClient.js +195 -0
  204. package/dist/esm/svm/eventsClient.js.map +1 -0
  205. package/dist/esm/svm/index.d.ts +3 -0
  206. package/dist/esm/svm/index.js +5 -0
  207. package/dist/esm/svm/index.js.map +1 -0
  208. package/dist/esm/{arch/svm → svm}/types.d.ts +4 -9
  209. package/dist/esm/svm/types.js.map +1 -0
  210. package/dist/esm/svm/utils/events.d.ts +17 -0
  211. package/dist/esm/svm/utils/events.js +55 -0
  212. package/dist/esm/svm/utils/events.js.map +1 -0
  213. package/dist/esm/svm/utils/helpers.d.ts +5 -0
  214. package/dist/esm/svm/utils/helpers.js +18 -0
  215. package/dist/esm/svm/utils/helpers.js.map +1 -0
  216. package/dist/esm/svm/utils/index.d.ts +1 -0
  217. package/dist/esm/svm/utils/index.js +2 -0
  218. package/dist/esm/svm/utils/index.js.map +1 -0
  219. package/dist/esm/utils/AddressUtils.d.ts +3 -9
  220. package/dist/esm/utils/AddressUtils.js +6 -41
  221. package/dist/esm/utils/AddressUtils.js.map +1 -1
  222. package/dist/esm/utils/ArrayUtils.d.ts +0 -6
  223. package/dist/esm/utils/ArrayUtils.js +0 -9
  224. package/dist/esm/utils/ArrayUtils.js.map +1 -1
  225. package/dist/esm/utils/BlockUtils.d.ts +36 -2
  226. package/dist/esm/utils/BlockUtils.js +243 -2
  227. package/dist/esm/utils/BlockUtils.js.map +1 -1
  228. package/dist/esm/utils/EventUtils.d.ts +4 -4
  229. package/dist/esm/utils/EventUtils.js +4 -7
  230. package/dist/esm/utils/EventUtils.js.map +1 -1
  231. package/dist/esm/utils/JSONUtils.js +0 -3
  232. package/dist/esm/utils/JSONUtils.js.map +1 -1
  233. package/dist/esm/utils/SpokeUtils.js +0 -5
  234. package/dist/esm/utils/SpokeUtils.js.map +1 -1
  235. package/dist/esm/utils/index.d.ts +0 -1
  236. package/dist/esm/utils/index.js +0 -1
  237. package/dist/esm/utils/index.js.map +1 -1
  238. package/dist/types/arch/evm/SpokeUtils.d.ts +1 -1
  239. package/dist/types/arch/evm/SpokeUtils.d.ts.map +1 -1
  240. package/dist/types/arch/evm/index.d.ts +0 -1
  241. package/dist/types/arch/evm/index.d.ts.map +1 -1
  242. package/dist/types/arch/svm/index.d.ts +1 -5
  243. package/dist/types/arch/svm/index.d.ts.map +1 -1
  244. package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +1 -1
  245. package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts.map +1 -1
  246. package/dist/types/clients/BaseAbstractClient.d.ts +5 -6
  247. package/dist/types/clients/BaseAbstractClient.d.ts.map +1 -1
  248. package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts.map +1 -1
  249. package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts +114 -114
  250. package/dist/types/clients/HubPoolClient.d.ts +3 -4
  251. package/dist/types/clients/HubPoolClient.d.ts.map +1 -1
  252. package/dist/types/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +3 -3
  253. package/dist/types/clients/SpokePoolClient/EVMSpokePoolClient.d.ts.map +1 -1
  254. package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts +7 -7
  255. package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts.map +1 -1
  256. package/dist/types/clients/SpokePoolClient/index.d.ts +0 -8
  257. package/dist/types/clients/SpokePoolClient/index.d.ts.map +1 -1
  258. package/dist/types/clients/index.d.ts +1 -1
  259. package/dist/types/clients/index.d.ts.map +1 -1
  260. package/dist/types/clients/mocks/MockConfigStoreClient.d.ts +1 -1
  261. package/dist/types/clients/mocks/MockConfigStoreClient.d.ts.map +1 -1
  262. package/dist/types/clients/mocks/MockSpokePoolClient.d.ts.map +1 -1
  263. package/dist/types/clients/mocks/index.d.ts +0 -2
  264. package/dist/types/clients/mocks/index.d.ts.map +1 -1
  265. package/dist/types/constants.d.ts +0 -1
  266. package/dist/types/constants.d.ts.map +1 -1
  267. package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts +2 -2
  268. package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts.map +1 -1
  269. package/dist/types/gasPriceOracle/adapters/ethereum.d.ts +4 -4
  270. package/dist/types/gasPriceOracle/adapters/ethereum.d.ts.map +1 -1
  271. package/dist/types/gasPriceOracle/adapters/linea-viem.d.ts.map +1 -1
  272. package/dist/types/gasPriceOracle/adapters/polygon.d.ts +4 -4
  273. package/dist/types/gasPriceOracle/adapters/polygon.d.ts.map +1 -1
  274. package/dist/types/gasPriceOracle/index.d.ts +1 -1
  275. package/dist/types/gasPriceOracle/index.d.ts.map +1 -1
  276. package/dist/types/gasPriceOracle/oracle.d.ts +3 -4
  277. package/dist/types/gasPriceOracle/oracle.d.ts.map +1 -1
  278. package/dist/types/gasPriceOracle/types.d.ts +1 -6
  279. package/dist/types/gasPriceOracle/types.d.ts.map +1 -1
  280. package/dist/types/index.d.ts +1 -0
  281. package/dist/types/index.d.ts.map +1 -1
  282. package/dist/types/interfaces/SpokePool.d.ts +0 -13
  283. package/dist/types/interfaces/SpokePool.d.ts.map +1 -1
  284. package/dist/types/providers/index.d.ts +1 -1
  285. package/dist/types/providers/index.d.ts.map +1 -1
  286. package/dist/types/providers/{mocks/mockEthersProvider.d.ts → mockProvider.d.ts} +1 -1
  287. package/dist/types/providers/mockProvider.d.ts.map +1 -0
  288. package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
  289. package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts.map +1 -1
  290. package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts +2 -4
  291. package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
  292. package/dist/types/relayFeeCalculator/chain-queries/index.d.ts +0 -1
  293. package/dist/types/relayFeeCalculator/chain-queries/index.d.ts.map +1 -1
  294. package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +1 -12
  295. package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
  296. package/dist/types/svm/eventsClient.d.ts +52 -0
  297. package/dist/types/svm/eventsClient.d.ts.map +1 -0
  298. package/dist/types/svm/index.d.ts +4 -0
  299. package/dist/types/svm/index.d.ts.map +1 -0
  300. package/dist/types/{arch/svm → svm}/types.d.ts +4 -9
  301. package/dist/types/svm/types.d.ts.map +1 -0
  302. package/dist/types/svm/utils/events.d.ts +18 -0
  303. package/dist/types/svm/utils/events.d.ts.map +1 -0
  304. package/dist/types/svm/utils/helpers.d.ts +6 -0
  305. package/dist/types/svm/utils/helpers.d.ts.map +1 -0
  306. package/dist/types/svm/utils/index.d.ts +2 -0
  307. package/dist/types/svm/utils/index.d.ts.map +1 -0
  308. package/dist/types/utils/AddressUtils.d.ts +3 -9
  309. package/dist/types/utils/AddressUtils.d.ts.map +1 -1
  310. package/dist/types/utils/ArrayUtils.d.ts +0 -6
  311. package/dist/types/utils/ArrayUtils.d.ts.map +1 -1
  312. package/dist/types/utils/BlockUtils.d.ts +36 -2
  313. package/dist/types/utils/BlockUtils.d.ts.map +1 -1
  314. package/dist/types/utils/EventUtils.d.ts +4 -4
  315. package/dist/types/utils/EventUtils.d.ts.map +1 -1
  316. package/dist/types/utils/JSONUtils.d.ts.map +1 -1
  317. package/dist/types/utils/SpokeUtils.d.ts.map +1 -1
  318. package/dist/types/utils/index.d.ts +0 -1
  319. package/dist/types/utils/index.d.ts.map +1 -1
  320. package/package.json +1 -3
  321. package/src/arch/evm/SpokeUtils.ts +5 -5
  322. package/src/arch/evm/index.ts +0 -1
  323. package/src/arch/svm/index.ts +1 -5
  324. package/src/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.ts +7 -7
  325. package/src/clients/BaseAbstractClient.ts +13 -20
  326. package/src/clients/BundleDataClient/BundleDataClient.ts +19 -28
  327. package/src/clients/BundleDataClient/utils/PoolRebalanceUtils.ts +1 -1
  328. package/src/clients/HubPoolClient.ts +19 -19
  329. package/src/clients/SpokePoolClient/EVMSpokePoolClient.ts +21 -23
  330. package/src/clients/SpokePoolClient/SpokePoolClient.ts +59 -50
  331. package/src/clients/SpokePoolClient/index.ts +0 -11
  332. package/src/clients/index.ts +1 -1
  333. package/src/clients/mocks/MockConfigStoreClient.ts +2 -2
  334. package/src/clients/mocks/MockHubPoolClient.ts +2 -2
  335. package/src/clients/mocks/MockSpokePoolClient.ts +4 -9
  336. package/src/clients/mocks/index.ts +0 -2
  337. package/src/constants.ts +0 -1
  338. package/src/gasPriceOracle/adapters/arbitrum.ts +2 -5
  339. package/src/gasPriceOracle/adapters/ethereum.ts +4 -7
  340. package/src/gasPriceOracle/adapters/linea-viem.ts +1 -3
  341. package/src/gasPriceOracle/adapters/polygon.ts +6 -6
  342. package/src/gasPriceOracle/index.ts +1 -1
  343. package/src/gasPriceOracle/oracle.ts +4 -20
  344. package/src/gasPriceOracle/types.ts +1 -7
  345. package/src/index.ts +1 -0
  346. package/src/interfaces/SpokePool.ts +0 -14
  347. package/src/providers/index.ts +1 -1
  348. package/src/providers/{mocks/mockEthersProvider.ts → mockProvider.ts} +1 -1
  349. package/src/relayFeeCalculator/chain-queries/baseQuery.ts +9 -11
  350. package/src/relayFeeCalculator/chain-queries/factory.ts +8 -24
  351. package/src/relayFeeCalculator/chain-queries/index.ts +0 -1
  352. package/src/relayFeeCalculator/relayFeeCalculator.ts +4 -16
  353. package/src/svm/eventsClient.ts +199 -0
  354. package/src/svm/index.ts +3 -0
  355. package/src/{arch/svm → svm}/types.ts +4 -21
  356. package/src/svm/utils/events.ts +58 -0
  357. package/src/svm/utils/helpers.ts +9 -0
  358. package/src/svm/utils/index.ts +1 -0
  359. package/src/utils/AddressUtils.ts +6 -49
  360. package/src/utils/ArrayUtils.ts +0 -12
  361. package/src/utils/BlockUtils.ts +215 -5
  362. package/src/utils/EventUtils.ts +11 -11
  363. package/src/utils/JSONUtils.ts +0 -2
  364. package/src/utils/SpokeUtils.ts +3 -7
  365. package/src/utils/index.ts +0 -1
  366. package/dist/cjs/arch/evm/BlockUtils.d.ts +0 -15
  367. package/dist/cjs/arch/evm/BlockUtils.js +0 -218
  368. package/dist/cjs/arch/evm/BlockUtils.js.map +0 -1
  369. package/dist/cjs/arch/svm/SpokeUtils.d.ts +0 -21
  370. package/dist/cjs/arch/svm/SpokeUtils.js +0 -454
  371. package/dist/cjs/arch/svm/SpokeUtils.js.map +0 -1
  372. package/dist/cjs/arch/svm/constants.d.ts +0 -2
  373. package/dist/cjs/arch/svm/constants.js +0 -7
  374. package/dist/cjs/arch/svm/constants.js.map +0 -1
  375. package/dist/cjs/arch/svm/eventsClient.d.ts +0 -26
  376. package/dist/cjs/arch/svm/eventsClient.js +0 -253
  377. package/dist/cjs/arch/svm/eventsClient.js.map +0 -1
  378. package/dist/cjs/arch/svm/types.js.map +0 -1
  379. package/dist/cjs/arch/svm/utils.d.ts +0 -18
  380. package/dist/cjs/arch/svm/utils.js +0 -212
  381. package/dist/cjs/arch/svm/utils.js.map +0 -1
  382. package/dist/cjs/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +0 -23
  383. package/dist/cjs/clients/SpokePoolClient/SVMSpokePoolClient.js +0 -172
  384. package/dist/cjs/clients/SpokePoolClient/SVMSpokePoolClient.js.map +0 -1
  385. package/dist/cjs/clients/mocks/MockSvmCpiEventsClient.d.ts +0 -33
  386. package/dist/cjs/clients/mocks/MockSvmCpiEventsClient.js +0 -184
  387. package/dist/cjs/clients/mocks/MockSvmCpiEventsClient.js.map +0 -1
  388. package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.d.ts +0 -30
  389. package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.js +0 -90
  390. package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.js.map +0 -1
  391. package/dist/cjs/gasPriceOracle/adapters/solana.d.ts +0 -4
  392. package/dist/cjs/gasPriceOracle/adapters/solana.js +0 -43
  393. package/dist/cjs/gasPriceOracle/adapters/solana.js.map +0 -1
  394. package/dist/cjs/providers/mocks/MockCachedSolanaRpcFactory.d.ts +0 -5
  395. package/dist/cjs/providers/mocks/MockCachedSolanaRpcFactory.js +0 -21
  396. package/dist/cjs/providers/mocks/MockCachedSolanaRpcFactory.js.map +0 -1
  397. package/dist/cjs/providers/mocks/MockRateLimitedSolanaRpcFactory.d.ts +0 -5
  398. package/dist/cjs/providers/mocks/MockRateLimitedSolanaRpcFactory.js +0 -20
  399. package/dist/cjs/providers/mocks/MockRateLimitedSolanaRpcFactory.js.map +0 -1
  400. package/dist/cjs/providers/mocks/MockSolanaRpcFactory.d.ts +0 -13
  401. package/dist/cjs/providers/mocks/MockSolanaRpcFactory.js +0 -76
  402. package/dist/cjs/providers/mocks/MockSolanaRpcFactory.js.map +0 -1
  403. package/dist/cjs/providers/mocks/index.d.ts +0 -4
  404. package/dist/cjs/providers/mocks/index.js +0 -8
  405. package/dist/cjs/providers/mocks/index.js.map +0 -1
  406. package/dist/cjs/providers/mocks/mockEthersProvider.js.map +0 -1
  407. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.d.ts +0 -37
  408. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js +0 -171
  409. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js.map +0 -1
  410. package/dist/cjs/utils/BlockFinder.d.ts +0 -22
  411. package/dist/cjs/utils/BlockFinder.js +0 -10
  412. package/dist/cjs/utils/BlockFinder.js.map +0 -1
  413. package/dist/esm/arch/evm/BlockUtils.d.ts +0 -24
  414. package/dist/esm/arch/evm/BlockUtils.js +0 -250
  415. package/dist/esm/arch/evm/BlockUtils.js.map +0 -1
  416. package/dist/esm/arch/svm/SpokeUtils.d.ts +0 -129
  417. package/dist/esm/arch/svm/SpokeUtils.js +0 -576
  418. package/dist/esm/arch/svm/SpokeUtils.js.map +0 -1
  419. package/dist/esm/arch/svm/constants.d.ts +0 -2
  420. package/dist/esm/arch/svm/constants.js +0 -3
  421. package/dist/esm/arch/svm/constants.js.map +0 -1
  422. package/dist/esm/arch/svm/eventsClient.d.ts +0 -87
  423. package/dist/esm/arch/svm/eventsClient.js +0 -316
  424. package/dist/esm/arch/svm/eventsClient.js.map +0 -1
  425. package/dist/esm/arch/svm/types.js.map +0 -1
  426. package/dist/esm/arch/svm/utils.d.ts +0 -63
  427. package/dist/esm/arch/svm/utils.js +0 -258
  428. package/dist/esm/arch/svm/utils.js.map +0 -1
  429. package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +0 -66
  430. package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.js +0 -225
  431. package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.js.map +0 -1
  432. package/dist/esm/clients/mocks/MockSvmCpiEventsClient.d.ts +0 -33
  433. package/dist/esm/clients/mocks/MockSvmCpiEventsClient.js +0 -183
  434. package/dist/esm/clients/mocks/MockSvmCpiEventsClient.js.map +0 -1
  435. package/dist/esm/clients/mocks/MockSvmSpokePoolClient.d.ts +0 -30
  436. package/dist/esm/clients/mocks/MockSvmSpokePoolClient.js +0 -89
  437. package/dist/esm/clients/mocks/MockSvmSpokePoolClient.js.map +0 -1
  438. package/dist/esm/gasPriceOracle/adapters/solana.d.ts +0 -8
  439. package/dist/esm/gasPriceOracle/adapters/solana.js +0 -43
  440. package/dist/esm/gasPriceOracle/adapters/solana.js.map +0 -1
  441. package/dist/esm/providers/mocks/MockCachedSolanaRpcFactory.d.ts +0 -5
  442. package/dist/esm/providers/mocks/MockCachedSolanaRpcFactory.js +0 -19
  443. package/dist/esm/providers/mocks/MockCachedSolanaRpcFactory.js.map +0 -1
  444. package/dist/esm/providers/mocks/MockRateLimitedSolanaRpcFactory.d.ts +0 -5
  445. package/dist/esm/providers/mocks/MockRateLimitedSolanaRpcFactory.js +0 -18
  446. package/dist/esm/providers/mocks/MockRateLimitedSolanaRpcFactory.js.map +0 -1
  447. package/dist/esm/providers/mocks/MockSolanaRpcFactory.d.ts +0 -13
  448. package/dist/esm/providers/mocks/MockSolanaRpcFactory.js +0 -74
  449. package/dist/esm/providers/mocks/MockSolanaRpcFactory.js.map +0 -1
  450. package/dist/esm/providers/mocks/index.d.ts +0 -4
  451. package/dist/esm/providers/mocks/index.js +0 -5
  452. package/dist/esm/providers/mocks/index.js.map +0 -1
  453. package/dist/esm/providers/mocks/mockEthersProvider.js.map +0 -1
  454. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.d.ts +0 -84
  455. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js +0 -216
  456. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js.map +0 -1
  457. package/dist/esm/utils/BlockFinder.d.ts +0 -22
  458. package/dist/esm/utils/BlockFinder.js +0 -7
  459. package/dist/esm/utils/BlockFinder.js.map +0 -1
  460. package/dist/types/arch/evm/BlockUtils.d.ts +0 -25
  461. package/dist/types/arch/evm/BlockUtils.d.ts.map +0 -1
  462. package/dist/types/arch/svm/SpokeUtils.d.ts +0 -130
  463. package/dist/types/arch/svm/SpokeUtils.d.ts.map +0 -1
  464. package/dist/types/arch/svm/constants.d.ts +0 -3
  465. package/dist/types/arch/svm/constants.d.ts.map +0 -1
  466. package/dist/types/arch/svm/eventsClient.d.ts +0 -88
  467. package/dist/types/arch/svm/eventsClient.d.ts.map +0 -1
  468. package/dist/types/arch/svm/types.d.ts.map +0 -1
  469. package/dist/types/arch/svm/utils.d.ts +0 -64
  470. package/dist/types/arch/svm/utils.d.ts.map +0 -1
  471. package/dist/types/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +0 -67
  472. package/dist/types/clients/SpokePoolClient/SVMSpokePoolClient.d.ts.map +0 -1
  473. package/dist/types/clients/mocks/MockSvmCpiEventsClient.d.ts +0 -34
  474. package/dist/types/clients/mocks/MockSvmCpiEventsClient.d.ts.map +0 -1
  475. package/dist/types/clients/mocks/MockSvmSpokePoolClient.d.ts +0 -31
  476. package/dist/types/clients/mocks/MockSvmSpokePoolClient.d.ts.map +0 -1
  477. package/dist/types/gasPriceOracle/adapters/solana.d.ts +0 -9
  478. package/dist/types/gasPriceOracle/adapters/solana.d.ts.map +0 -1
  479. package/dist/types/providers/mocks/MockCachedSolanaRpcFactory.d.ts +0 -6
  480. package/dist/types/providers/mocks/MockCachedSolanaRpcFactory.d.ts.map +0 -1
  481. package/dist/types/providers/mocks/MockRateLimitedSolanaRpcFactory.d.ts +0 -6
  482. package/dist/types/providers/mocks/MockRateLimitedSolanaRpcFactory.d.ts.map +0 -1
  483. package/dist/types/providers/mocks/MockSolanaRpcFactory.d.ts +0 -14
  484. package/dist/types/providers/mocks/MockSolanaRpcFactory.d.ts.map +0 -1
  485. package/dist/types/providers/mocks/index.d.ts +0 -5
  486. package/dist/types/providers/mocks/index.d.ts.map +0 -1
  487. package/dist/types/providers/mocks/mockEthersProvider.d.ts.map +0 -1
  488. package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts +0 -85
  489. package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts.map +0 -1
  490. package/dist/types/utils/BlockFinder.d.ts +0 -23
  491. package/dist/types/utils/BlockFinder.d.ts.map +0 -1
  492. package/src/arch/evm/BlockUtils.ts +0 -209
  493. package/src/arch/svm/SpokeUtils.ts +0 -596
  494. package/src/arch/svm/constants.ts +0 -2
  495. package/src/arch/svm/eventsClient.ts +0 -342
  496. package/src/arch/svm/utils.ts +0 -233
  497. package/src/clients/SpokePoolClient/SVMSpokePoolClient.ts +0 -268
  498. package/src/clients/mocks/MockSvmCpiEventsClient.ts +0 -226
  499. package/src/clients/mocks/MockSvmSpokePoolClient.ts +0 -119
  500. package/src/gasPriceOracle/adapters/solana.ts +0 -45
  501. package/src/providers/mocks/MockCachedSolanaRpcFactory.ts +0 -15
  502. package/src/providers/mocks/MockRateLimitedSolanaRpcFactory.ts +0 -14
  503. package/src/providers/mocks/MockSolanaRpcFactory.ts +0 -55
  504. package/src/providers/mocks/index.ts +0 -4
  505. package/src/relayFeeCalculator/chain-queries/svmQuery.ts +0 -225
  506. package/src/utils/BlockFinder.ts +0 -26
  507. /package/dist/cjs/providers/{mocks/mockEthersProvider.d.ts → mockProvider.d.ts} +0 -0
  508. /package/dist/cjs/{arch/svm → svm}/types.js +0 -0
  509. /package/dist/esm/providers/{mocks/mockEthersProvider.d.ts → mockProvider.d.ts} +0 -0
  510. /package/dist/esm/{arch/svm → svm}/types.js +0 -0
@@ -39,17 +39,20 @@ export class EVMSpokePoolClient extends SpokePoolClient {
39
39
  hubPoolClient: HubPoolClient | null,
40
40
  chainId: number,
41
41
  deploymentBlock: number,
42
- eventSearchConfig: MakeOptional<EventSearchConfig, "to"> = { from: 0, maxLookBack: 0 }
42
+ eventSearchConfig: MakeOptional<EventSearchConfig, "toBlock"> = { fromBlock: 0, maxBlockLookBack: 0 }
43
43
  ) {
44
44
  super(logger, hubPoolClient, chainId, deploymentBlock, eventSearchConfig);
45
45
  }
46
46
 
47
- public override relayFillStatus(relayData: RelayData, atHeight?: number): Promise<FillStatus> {
48
- return relayFillStatus(this.spokePool, relayData, atHeight, this.chainId);
47
+ public override relayFillStatus(relayData: RelayData, blockTag?: number | "latest"): Promise<FillStatus> {
48
+ return relayFillStatus(this.spokePool, relayData, blockTag, this.chainId);
49
49
  }
50
50
 
51
- public override fillStatusArray(relayData: RelayData[], atHeight?: number): Promise<(FillStatus | undefined)[]> {
52
- return fillStatusArray(this.spokePool, relayData, atHeight);
51
+ public override fillStatusArray(
52
+ relayData: RelayData[],
53
+ blockTag?: number | "latest"
54
+ ): Promise<(FillStatus | undefined)[]> {
55
+ return fillStatusArray(this.spokePool, relayData, blockTag);
53
56
  }
54
57
 
55
58
  public override getMaxFillDeadlineInRange(startBlock: number, endBlock: number): Promise<number> {
@@ -86,7 +89,7 @@ export class EVMSpokePoolClient extends SpokePoolClient {
86
89
  // However, certain events have special overriding requirements to their search ranges:
87
90
  // - EnabledDepositRoute: The full history is always required, so override the requested fromBlock.
88
91
  if (eventName === "EnabledDepositRoute" && !this.isUpdated) {
89
- _searchConfig.from = this.deploymentBlock;
92
+ _searchConfig.fromBlock = this.deploymentBlock;
90
93
  }
91
94
 
92
95
  return {
@@ -107,7 +110,7 @@ export class EVMSpokePoolClient extends SpokePoolClient {
107
110
  const [multicallOutput, ...events] = await Promise.all([
108
111
  spokePool.callStatic.multicall(
109
112
  multicallFunctions.map((f) => spokePool.interface.encodeFunctionData(f)),
110
- { blockTag: searchConfig.to }
113
+ { blockTag: searchConfig.toBlock }
111
114
  ),
112
115
  ...eventSearchConfigs.map((config) => paginatedEventQuery(this.spokePool, config.filter, config.searchConfig)),
113
116
  ]);
@@ -121,22 +124,17 @@ export class EVMSpokePoolClient extends SpokePoolClient {
121
124
  const errMsg = BigNumber.isBigNumber(currentTime)
122
125
  ? `currentTime: ${currentTime} < ${toBN(this.currentTime)}`
123
126
  : `currentTime is not a BigNumber: ${JSON.stringify(currentTime)}`;
124
- throw new Error(`EVMSpokePoolClient::update: ${errMsg}`);
127
+ throw new Error(`SpokePoolClient::update: ${errMsg}`);
125
128
  }
126
129
 
127
130
  // Sort all events to ensure they are stored in a consistent order.
128
131
  events.forEach((events) => sortEventsAscendingInPlace(events.map(logToSortableEvent)));
129
132
 
130
- // Map events to SortableEvent
131
- const eventsWithBlockNumber = events.map((eventList) =>
132
- eventList.map((event) => spreadEventWithBlockNumber(event))
133
- );
134
-
135
133
  return {
136
134
  success: true,
137
135
  currentTime: currentTime.toNumber(), // uint32
138
- searchEndBlock: searchConfig.to,
139
- events: eventsWithBlockNumber,
136
+ searchEndBlock: searchConfig.toBlock,
137
+ events,
140
138
  };
141
139
  }
142
140
 
@@ -151,31 +149,31 @@ export class EVMSpokePoolClient extends SpokePoolClient {
151
149
  }
152
150
 
153
151
  // No deposit found; revert to searching for it.
154
- const upperBound = this.latestHeightSearched || undefined; // Don't permit block 0 as the high block.
155
- const from = await findDepositBlock(this.spokePool, depositId, this.deploymentBlock, upperBound);
152
+ const upperBound = this.latestBlockSearched || undefined; // Don't permit block 0 as the high block.
153
+ const fromBlock = await findDepositBlock(this.spokePool, depositId, this.deploymentBlock, upperBound);
156
154
  const chain = getNetworkName(this.chainId);
157
- if (!from) {
155
+ if (!fromBlock) {
158
156
  const reason =
159
157
  `Unable to find ${chain} depositId ${depositId}` +
160
158
  ` within blocks [${this.deploymentBlock}, ${upperBound ?? "latest"}].`;
161
159
  return { found: false, code: InvalidFill.DepositIdNotFound, reason };
162
160
  }
163
161
 
164
- const to = from;
162
+ const toBlock = fromBlock;
165
163
  const tStart = Date.now();
166
164
  // Check both V3FundsDeposited and FundsDeposited events to look for a specified depositId.
167
- const { maxLookBack } = this.eventSearchConfig;
165
+ const { maxBlockLookBack } = this.eventSearchConfig;
168
166
  const query = (
169
167
  await Promise.all([
170
168
  paginatedEventQuery(
171
169
  this.spokePool,
172
170
  this.spokePool.filters.V3FundsDeposited(null, null, null, null, null, depositId),
173
- { from, to, maxLookBack }
171
+ { fromBlock, toBlock, maxBlockLookBack }
174
172
  ),
175
173
  paginatedEventQuery(
176
174
  this.spokePool,
177
175
  this.spokePool.filters.FundsDeposited(null, null, null, null, null, depositId),
178
- { from, to, maxLookBack }
176
+ { fromBlock, toBlock, maxBlockLookBack }
179
177
  ),
180
178
  ])
181
179
  ).flat();
@@ -186,7 +184,7 @@ export class EVMSpokePoolClient extends SpokePoolClient {
186
184
  return {
187
185
  found: false,
188
186
  code: InvalidFill.DepositIdNotFound,
189
- reason: `${chain} depositId ${depositId} not found at block ${from}.`,
187
+ reason: `${chain} depositId ${depositId} not found at block ${fromBlock}.`,
190
188
  };
191
189
  }
192
190
 
@@ -18,22 +18,25 @@ import {
18
18
  toAddress,
19
19
  validateFillForDeposit,
20
20
  chainIsEvm,
21
- chainIsProd,
22
21
  } from "../../utils";
23
- import { duplicateEvent, sortEventsAscendingInPlace } from "../../utils/EventUtils";
22
+ import {
23
+ duplicateEvent,
24
+ sortEventsAscendingInPlace,
25
+ spreadEvent,
26
+ spreadEventWithBlockNumber,
27
+ } from "../../utils/EventUtils";
24
28
  import { ZERO_ADDRESS } from "../../constants";
25
29
  import {
26
30
  Deposit,
27
31
  DepositWithBlock,
28
- EnabledDepositRouteWithBlock,
29
32
  Fill,
30
33
  FillStatus,
31
34
  FillWithBlock,
35
+ Log,
32
36
  RelayData,
33
37
  RelayerRefundExecutionWithBlock,
34
38
  RootBundleRelayWithBlock,
35
39
  SlowFillRequestWithBlock,
36
- SortableEvent,
37
40
  SpeedUpWithBlock,
38
41
  TokensBridged,
39
42
  } from "../../interfaces";
@@ -45,7 +48,7 @@ import { HubPoolClient } from "../HubPoolClient";
45
48
  export type SpokePoolUpdateSuccess = {
46
49
  success: true;
47
50
  currentTime: number;
48
- events: SortableEvent[][];
51
+ events: Log[][];
49
52
  searchEndBlock: number;
50
53
  };
51
54
  export type SpokePoolUpdateFailure = {
@@ -102,11 +105,11 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
102
105
  readonly hubPoolClient: HubPoolClient | null,
103
106
  readonly chainId: number,
104
107
  public deploymentBlock: number,
105
- eventSearchConfig: MakeOptional<EventSearchConfig, "to"> = { from: 0, maxLookBack: 0 }
108
+ eventSearchConfig: MakeOptional<EventSearchConfig, "toBlock"> = { fromBlock: 0, maxBlockLookBack: 0 }
106
109
  ) {
107
110
  super(eventSearchConfig);
108
- this.firstHeightToSearch = eventSearchConfig.from;
109
- this.latestHeightSearched = 0;
111
+ this.firstBlockToSearch = eventSearchConfig.fromBlock;
112
+ this.latestBlockSearched = 0;
110
113
  this.configStoreClient = hubPoolClient?.configStoreClient;
111
114
  }
112
115
 
@@ -350,7 +353,7 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
350
353
  fillCount: number;
351
354
  invalidFills: FillWithBlock[];
352
355
  } {
353
- const { outputAmount, originChainId } = deposit;
356
+ const { outputAmount } = deposit;
354
357
  const fillsForDeposit = this.depositHashesToFills[this.getDepositHash(deposit)];
355
358
  // If no fills then the full amount is remaining.
356
359
  if (fillsForDeposit === undefined || fillsForDeposit.length === 0) {
@@ -370,7 +373,7 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
370
373
  const { chainToSendRefundTo: repaymentChainId } = getRefundInformationFromFill(
371
374
  fillRepaymentData,
372
375
  this.hubPoolClient!,
373
- this.hubPoolClient!.latestHeightSearched
376
+ this.hubPoolClient!.latestBlockSearched
374
377
  );
375
378
  // In order to keep this function sync, we can't call verifyFillRepayment so we'll log any fills where
376
379
  // the filler-specified repayment chain and repayment address is not a valid repayment upon
@@ -406,10 +409,8 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
406
409
  }
407
410
  return newInvalidFill;
408
411
  });
409
- // Log invalid and unrepayable fills as warns if we are on a production network.
410
- const logLevel = chainIsProd(originChainId) ? "warn" : "debug";
411
412
  if (invalidFillsForDeposit.length > 0) {
412
- this.logger[logLevel]({
413
+ this.logger.warn({
413
414
  at: "SpokePoolClient",
414
415
  chainId: this.chainId,
415
416
  message: "Invalid fills found matching deposit ID",
@@ -420,7 +421,7 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
420
421
  }
421
422
  const unrepayableFillsForDeposit = unrepayableFills.filter((x) => x.depositId.eq(deposit.depositId));
422
423
  if (unrepayableFillsForDeposit.length > 0) {
423
- this.logger[logLevel]({
424
+ this.logger.warn({
424
425
  at: "SpokePoolClient",
425
426
  chainId: this.chainId,
426
427
  message: "Unrepayable fills found where we need to switch repayment address and or chain",
@@ -485,7 +486,7 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
485
486
  * @see _update
486
487
  */
487
488
  public async update(eventsToQuery = this._queryableEventNames()): Promise<void> {
488
- const duplicateEvents: SortableEvent[] = [];
489
+ const duplicateEvents: Log[] = [];
489
490
  if (this.hubPoolClient !== null && !this.hubPoolClient.isUpdated) {
490
491
  throw new Error("HubPoolClient not updated");
491
492
  }
@@ -497,14 +498,14 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
497
498
  const { events: queryResults, currentTime, searchEndBlock } = update;
498
499
 
499
500
  if (eventsToQuery.includes("TokensBridged")) {
500
- for (const event of queryResults[eventsToQuery.indexOf("TokensBridged")] as TokensBridged[]) {
501
- this.tokensBridged.push(event);
501
+ for (const event of queryResults[eventsToQuery.indexOf("TokensBridged")]) {
502
+ this.tokensBridged.push(spreadEventWithBlockNumber(event) as TokensBridged);
502
503
  }
503
504
  }
504
505
 
505
506
  // Performs the indexing of a deposit-like spoke pool event.
506
507
  const queryDepositEvents = async (eventName: string) => {
507
- const depositEvents = (queryResults[eventsToQuery.indexOf(eventName)] ?? []) as DepositWithBlock[];
508
+ const depositEvents = queryResults[eventsToQuery.indexOf(eventName)] ?? [];
508
509
  if (depositEvents.length > 0) {
509
510
  this.log(
510
511
  "debug",
@@ -517,20 +518,22 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
517
518
 
518
519
  // For each deposit, resolve its quoteTimestamp to a block number on the HubPool.
519
520
  // Don't bother filtering for uniqueness; the HubPoolClient handles this efficienctly.
520
- const quoteBlockNumbers = await this.getBlockNumbers(depositEvents.map((e) => e.quoteTimestamp));
521
+ const quoteBlockNumbers = await this.getBlockNumbers(
522
+ depositEvents.map(({ args }) => Number(args["quoteTimestamp"]))
523
+ );
521
524
  for (const event of depositEvents) {
522
- const quoteBlockNumber = quoteBlockNumbers[Number(event.quoteTimestamp)];
525
+ const quoteBlockNumber = quoteBlockNumbers[Number(event.args["quoteTimestamp"])];
523
526
 
524
527
  // Derive and append the common properties that are not part of the onchain event.
525
528
  const deposit = {
526
- ...event,
527
- messageHash: getMessageHash(event.message),
529
+ ...spreadEventWithBlockNumber(event),
530
+ messageHash: getMessageHash(event.args.message),
528
531
  quoteBlockNumber,
529
532
  originChainId: this.chainId,
530
533
  // The following properties are placeholders to be updated immediately.
531
534
  fromLiteChain: true,
532
535
  toLiteChain: true,
533
- };
536
+ } as DepositWithBlock;
534
537
 
535
538
  deposit.fromLiteChain = this.isOriginLiteChain(deposit);
536
539
  deposit.toLiteChain = this.isDestinationLiteChain(deposit);
@@ -561,10 +564,10 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
561
564
 
562
565
  // Performs indexing of a "speed up deposit"-like event.
563
566
  const querySpeedUpDepositEvents = (eventName: string) => {
564
- const speedUpEvents = (queryResults[eventsToQuery.indexOf(eventName)] ?? []) as SpeedUpWithBlock[];
567
+ const speedUpEvents = queryResults[eventsToQuery.indexOf(eventName)] ?? [];
565
568
 
566
569
  for (const event of speedUpEvents) {
567
- const speedUp = { ...event, originChainId: this.chainId };
570
+ const speedUp = { ...spreadEventWithBlockNumber(event), originChainId: this.chainId } as SpeedUpWithBlock;
568
571
  assign(this.speedUps, [speedUp.depositor, speedUp.depositId.toString()], [speedUp]);
569
572
 
570
573
  // Find deposit hash matching this speed up event and update the deposit data associated with the hash,
@@ -589,12 +592,12 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
589
592
 
590
593
  // Performs indexing of "requested slow fill"-like events.
591
594
  const queryRequestedSlowFillEvents = (eventName: string) => {
592
- const slowFillRequests = (queryResults[eventsToQuery.indexOf(eventName)] ?? []) as SlowFillRequestWithBlock[];
595
+ const slowFillRequests = queryResults[eventsToQuery.indexOf(eventName)];
593
596
  for (const event of slowFillRequests) {
594
597
  const slowFillRequest = {
595
- ...event,
598
+ ...spreadEventWithBlockNumber(event),
596
599
  destinationChainId: this.chainId,
597
- };
600
+ } as SlowFillRequestWithBlock;
598
601
 
599
602
  if (eventName === "RequestedV3SlowFill") {
600
603
  slowFillRequest.messageHash = getMessageHash(slowFillRequest.message);
@@ -620,7 +623,7 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
620
623
 
621
624
  // Performs indexing of filled relay-like events.
622
625
  const queryFilledRelayEvents = (eventName: string) => {
623
- const fillEvents = (queryResults[eventsToQuery.indexOf(eventName)] ?? []) as FillWithBlock[];
626
+ const fillEvents = queryResults[eventsToQuery.indexOf(eventName)] ?? [];
624
627
 
625
628
  if (fillEvents.length > 0) {
626
629
  this.log("debug", `Using ${fillEvents.length} newly queried ${eventName} events for chain ${this.chainId}`, {
@@ -632,13 +635,13 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
632
635
  // test that the types are complete. A broader change in strategy for safely unpacking events will be introduced.
633
636
  for (const event of fillEvents) {
634
637
  const fill = {
635
- ...event,
638
+ ...spreadEventWithBlockNumber(event),
636
639
  destinationChainId: this.chainId,
637
- };
640
+ } as FillWithBlock;
638
641
 
639
642
  if (eventName === "FilledV3Relay") {
640
- fill.messageHash = getMessageHash((event as unknown as { message: string }).message);
641
- fill.relayExecutionInfo.updatedMessageHash = getMessageHash(event.relayExecutionInfo.updatedMessage!);
643
+ fill.messageHash = getMessageHash(event.args.message);
644
+ fill.relayExecutionInfo.updatedMessageHash = getMessageHash(event.args.relayExecutionInfo.updatedMessage);
642
645
  }
643
646
 
644
647
  // Sanity check that this event is not a duplicate.
@@ -661,27 +664,30 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
661
664
  });
662
665
 
663
666
  if (eventsToQuery.includes("EnabledDepositRoute")) {
664
- const enableDepositsEvents = (queryResults[eventsToQuery.indexOf("EnabledDepositRoute")] ??
665
- []) as EnabledDepositRouteWithBlock[];
667
+ const enableDepositsEvents = queryResults[eventsToQuery.indexOf("EnabledDepositRoute")];
666
668
 
667
669
  for (const event of enableDepositsEvents) {
668
- assign(this.depositRoutes, [event.originToken, event.destinationChainId], event.enabled);
670
+ const enableDeposit = spreadEvent(event.args);
671
+ assign(
672
+ this.depositRoutes,
673
+ [enableDeposit.originToken, enableDeposit.destinationChainId],
674
+ enableDeposit.enabled
675
+ );
669
676
  }
670
677
  }
671
678
 
672
679
  if (eventsToQuery.includes("RelayedRootBundle")) {
673
- const relayedRootBundleEvents = (queryResults[eventsToQuery.indexOf("RelayedRootBundle")] ??
674
- []) as RootBundleRelayWithBlock[];
680
+ const relayedRootBundleEvents = queryResults[eventsToQuery.indexOf("RelayedRootBundle")];
675
681
  for (const event of relayedRootBundleEvents) {
676
- this.rootBundleRelays.push(event);
682
+ this.rootBundleRelays.push(spreadEventWithBlockNumber(event) as RootBundleRelayWithBlock);
677
683
  }
678
684
  }
679
685
 
680
686
  if (eventsToQuery.includes("ExecutedRelayerRefundRoot")) {
681
- const refundEvents = (queryResults[eventsToQuery.indexOf("ExecutedRelayerRefundRoot")] ??
682
- []) as RelayerRefundExecutionWithBlock[];
687
+ const refundEvents = queryResults[eventsToQuery.indexOf("ExecutedRelayerRefundRoot")];
683
688
  for (const event of refundEvents) {
684
- this.relayerRefundExecutions.push(event);
689
+ const executedRefund = spreadEventWithBlockNumber(event) as RelayerRefundExecutionWithBlock;
690
+ this.relayerRefundExecutions.push(executedRefund);
685
691
  }
686
692
  }
687
693
 
@@ -694,12 +700,12 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
694
700
 
695
701
  // Next iteration should start off from where this one ended.
696
702
  this.currentTime = currentTime;
697
- this.latestHeightSearched = searchEndBlock;
698
- this.firstHeightToSearch = searchEndBlock + 1;
699
- this.eventSearchConfig.to = undefined; // Caller can re-set on subsequent updates if necessary
703
+ this.latestBlockSearched = searchEndBlock;
704
+ this.firstBlockToSearch = searchEndBlock + 1;
705
+ this.eventSearchConfig.toBlock = undefined; // Caller can re-set on subsequent updates if necessary
700
706
  this.isUpdated = true;
701
707
  this.log("debug", `SpokePool client for chain ${this.chainId} updated!`, {
702
- nextFirstHeightToSearch: this.firstHeightToSearch,
708
+ nextFirstBlockToSearch: this.firstBlockToSearch,
703
709
  });
704
710
  }
705
711
 
@@ -842,16 +848,19 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
842
848
  /**
843
849
  * Retrieves the fill status for a given relay data.
844
850
  * @param relayData The relay data to retrieve the fill status for.
845
- * @param atHeight The height at which to query the fill status.
851
+ * @param blockTag The block at which to query the fill status.
846
852
  * @returns The fill status for the given relay data.
847
853
  */
848
- public abstract relayFillStatus(relayData: RelayData, atHeight?: number): Promise<FillStatus>;
854
+ public abstract relayFillStatus(relayData: RelayData, blockTag?: number | "latest"): Promise<FillStatus>;
849
855
 
850
856
  /**
851
857
  * Retrieves the fill status for an array of given relay data.
852
858
  * @param relayData The array relay data to retrieve the fill status for.
853
- * @param atHeight The height at which to query the fill status.
859
+ * @param blockTag The block at which to query the fill status.
854
860
  * @returns The fill status for each of the given relay data.
855
861
  */
856
- public abstract fillStatusArray(relayData: RelayData[], atHeight?: number): Promise<(FillStatus | undefined)[]>;
862
+ public abstract fillStatusArray(
863
+ relayData: RelayData[],
864
+ blockTag?: number | "latest"
865
+ ): Promise<(FillStatus | undefined)[]>;
857
866
  }
@@ -1,10 +1,8 @@
1
1
  import { EVMSpokePoolClient } from "./EVMSpokePoolClient";
2
- import { SvmSpokePoolClient } from "./SVMSpokePoolClient";
3
2
  import { SpokePoolClient } from "./SpokePoolClient";
4
3
 
5
4
  export { EVMSpokePoolClient } from "./EVMSpokePoolClient";
6
5
  export { SpokePoolClient, SpokePoolUpdate } from "./SpokePoolClient";
7
- export { SvmSpokePoolClient } from "./SVMSpokePoolClient";
8
6
 
9
7
  /**
10
8
  * Checks if a SpokePoolClient is an EVMSpokePoolClient.
@@ -14,12 +12,3 @@ export { SvmSpokePoolClient } from "./SVMSpokePoolClient";
14
12
  export function isEVMSpokePoolClient(spokePoolClient: SpokePoolClient): spokePoolClient is EVMSpokePoolClient {
15
13
  return spokePoolClient instanceof EVMSpokePoolClient;
16
14
  }
17
-
18
- /**
19
- * Checks if a SpokePoolClient is an SVMSpokePoolClient.
20
- * @param spokePoolClient The SpokePoolClient to check.
21
- * @returns True if the SpokePoolClient is an SVMSpokePoolClient, false otherwise.
22
- */
23
- export function isSvmSpokePoolClient(spokePoolClient: SpokePoolClient): spokePoolClient is SvmSpokePoolClient {
24
- return spokePoolClient instanceof SvmSpokePoolClient;
25
- }
@@ -6,6 +6,6 @@ export {
6
6
  } from "./AcrossConfigStoreClient";
7
7
  export { UpdateFailureReason } from "./BaseAbstractClient";
8
8
  export { HubPoolClient, LpFeeRequest } from "./HubPoolClient";
9
- export { SpokePoolClient, SpokePoolUpdate, EVMSpokePoolClient, SvmSpokePoolClient } from "./SpokePoolClient";
9
+ export { SpokePoolClient, SpokePoolUpdate, EVMSpokePoolClient } from "./SpokePoolClient";
10
10
  export * as BundleDataClient from "./BundleDataClient";
11
11
  export * as mocks from "./mocks";
@@ -33,7 +33,7 @@ export class MockConfigStoreClient extends AcrossConfigStoreClient {
33
33
  constructor(
34
34
  logger: winston.Logger,
35
35
  configStore: Contract,
36
- eventSearchConfig: MakeOptional<EventSearchConfig, "to"> = { from: 0, maxLookBack: 0 },
36
+ eventSearchConfig: MakeOptional<EventSearchConfig, "toBlock"> = { fromBlock: 0, maxBlockLookBack: 0 },
37
37
  configStoreVersion: number,
38
38
  chainId = 1,
39
39
  mockUpdate = false,
@@ -97,7 +97,7 @@ export class MockConfigStoreClient extends AcrossConfigStoreClient {
97
97
  return Promise.resolve({
98
98
  success: true,
99
99
  chainId: this.chainId as number,
100
- searchEndBlock: this.eventSearchConfig.to || latestBlockSearched,
100
+ searchEndBlock: this.eventSearchConfig.toBlock || latestBlockSearched,
101
101
  events: {
102
102
  updatedGlobalConfigEvents: events["UpdatedGlobalConfig"].map(spreadEventWithBlockNumber),
103
103
  globalConfigUpdateTimes,
@@ -79,7 +79,7 @@ export class MockHubPoolClient extends HubPoolClient {
79
79
  }
80
80
 
81
81
  setLatestBlockNumber(blockNumber: number) {
82
- this.latestHeightSearched = blockNumber;
82
+ this.latestBlockSearched = blockNumber;
83
83
  }
84
84
 
85
85
  addL1Token(l1Token: L1Token) {
@@ -158,7 +158,7 @@ export class MockHubPoolClient extends HubPoolClient {
158
158
  latestBlockSearched,
159
159
  pendingRootBundleProposal: this.rootBundleProposal,
160
160
  events,
161
- searchEndBlock: this.eventSearchConfig.to || latestBlockSearched,
161
+ searchEndBlock: this.eventSearchConfig.toBlock || latestBlockSearched,
162
162
  });
163
163
  }
164
164
 
@@ -27,7 +27,6 @@ import {
27
27
  bnOne,
28
28
  toAddress,
29
29
  toBytes32,
30
- spreadEventWithBlockNumber,
31
30
  } from "../../utils";
32
31
  import { EVMSpokePoolClient, SpokePoolUpdate } from "../SpokePoolClient";
33
32
  import { HubPoolClient } from "../HubPoolClient";
@@ -51,7 +50,7 @@ export class MockSpokePoolClient extends EVMSpokePoolClient {
51
50
  opts: { hubPoolClient: HubPoolClient | null } = { hubPoolClient: null }
52
51
  ) {
53
52
  super(logger, spokePool, opts.hubPoolClient, chainId, deploymentBlock);
54
- this.latestHeightSearched = deploymentBlock;
53
+ this.latestBlockSearched = deploymentBlock;
55
54
  this.eventManager = getEventManager(chainId, this.eventSignatures, deploymentBlock);
56
55
  }
57
56
 
@@ -68,7 +67,7 @@ export class MockSpokePoolClient extends EVMSpokePoolClient {
68
67
  }
69
68
 
70
69
  setLatestBlockNumber(blockNumber: number): void {
71
- this.latestHeightSearched = blockNumber;
70
+ this.latestBlockSearched = blockNumber;
72
71
  }
73
72
 
74
73
  setDepositIds(_depositIds: BigNumber[]): void {
@@ -107,16 +106,12 @@ export class MockSpokePoolClient extends EVMSpokePoolClient {
107
106
  }
108
107
  });
109
108
 
110
- const eventsWithBlockNumber = events.map((eventList) =>
111
- eventList.map((event) => spreadEventWithBlockNumber(event))
112
- );
113
-
114
109
  return Promise.resolve({
115
110
  success: true,
116
111
  firstDepositId: bnZero,
117
112
  currentTime,
118
- events: eventsWithBlockNumber,
119
- searchEndBlock: this.eventSearchConfig.to || latestBlockSearched,
113
+ events,
114
+ searchEndBlock: this.eventSearchConfig.toBlock || latestBlockSearched,
120
115
  });
121
116
  }
122
117
 
@@ -1,5 +1,3 @@
1
1
  export * from "./MockConfigStoreClient";
2
2
  export * from "./MockHubPoolClient";
3
3
  export * from "./MockSpokePoolClient";
4
- export * from "./MockSvmCpiEventsClient";
5
- export * from "./MockSvmSpokePoolClient";
package/src/constants.ts CHANGED
@@ -54,7 +54,6 @@ export const DEFAULT_CACHING_TTL = 60 * 60 * 24 * 7 * 2; // 2 Weeks
54
54
  export const DEFAULT_CACHING_SAFE_LAG = 60 * 60; // 1 hour
55
55
 
56
56
  export const DEFAULT_SIMULATED_RELAYER_ADDRESS = "0x07aE8551Be970cB1cCa11Dd7a11F47Ae82e70E67";
57
- export const DEFAULT_SIMULATED_RELAYER_ADDRESS_SVM = "FmMK62wrtWVb5SVoTZftSCGw3nEDA79hDbZNTRnC1R6t";
58
57
  export const DEFAULT_SIMULATED_RELAYER_ADDRESS_TEST = "0x9A8f92a830A5cB89a3816e3D267CB7791c16b04D"; // Görli, ...
59
58
 
60
59
  export const DEFAULT_ARWEAVE_STORAGE_ADDRESS = "Z6hjBM8FHu90lYWB8o5jR1dfX92FlV2WBaND9xgp8Lg";
@@ -1,6 +1,6 @@
1
1
  import { providers } from "ethers";
2
2
  import { bnOne } from "../../utils";
3
- import { EvmGasPriceEstimate } from "../types";
3
+ import { GasPriceEstimate } from "../types";
4
4
  import * as ethereum from "./ethereum";
5
5
  import { GasPriceEstimateOptions } from "../oracle";
6
6
 
@@ -16,10 +16,7 @@ import { GasPriceEstimateOptions } from "../oracle";
16
16
  * function.
17
17
  * @returns GasPriceEstimate
18
18
  */
19
- export async function eip1559(
20
- provider: providers.Provider,
21
- opts: GasPriceEstimateOptions
22
- ): Promise<EvmGasPriceEstimate> {
19
+ export async function eip1559(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate> {
23
20
  const { maxFeePerGas: _maxFeePerGas, maxPriorityFeePerGas } = await ethereum.eip1559(provider, opts);
24
21
 
25
22
  // eip1559() sets maxFeePerGas = lastBaseFeePerGas + maxPriorityFeePerGas, so back out priority fee.
@@ -1,7 +1,7 @@
1
1
  import assert from "assert";
2
2
  import { providers } from "ethers";
3
3
  import { BigNumber, bnZero, fixedPointAdjustment, getNetworkName, parseUnits } from "../../utils";
4
- import { EvmGasPriceEstimate } from "../types";
4
+ import { GasPriceEstimate } from "../types";
5
5
  import { gasPriceError } from "../util";
6
6
  import { GasPriceEstimateOptions } from "../oracle";
7
7
 
@@ -13,7 +13,7 @@ import { GasPriceEstimateOptions } from "../oracle";
13
13
  * @param priorityFeeMultiplier Amount to multiply priority fee or unused for legacy gas pricing.
14
14
  * @returns Promise of gas price estimate object.
15
15
  */
16
- export function eip1559(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<EvmGasPriceEstimate> {
16
+ export function eip1559(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate> {
17
17
  return eip1559Raw(provider, opts.chainId, opts.baseFeeMultiplier, opts.priorityFeeMultiplier);
18
18
  }
19
19
 
@@ -29,7 +29,7 @@ export async function eip1559Raw(
29
29
  chainId: number,
30
30
  baseFeeMultiplier: BigNumber,
31
31
  priorityFeeMultiplier: BigNumber
32
- ): Promise<EvmGasPriceEstimate> {
32
+ ): Promise<GasPriceEstimate> {
33
33
  const [{ baseFeePerGas }, _maxPriorityFeePerGas] = await Promise.all([
34
34
  provider.getBlock("pending"),
35
35
  (provider as providers.JsonRpcProvider).send("eth_maxPriorityFeePerGas", []),
@@ -54,10 +54,7 @@ export async function eip1559Raw(
54
54
  * @dev Its recommended to use the eip1559Raw method over this one where possible as it will be more accurate.
55
55
  * @returns GasPriceEstimate
56
56
  */
57
- export async function legacy(
58
- provider: providers.Provider,
59
- opts: GasPriceEstimateOptions
60
- ): Promise<EvmGasPriceEstimate> {
57
+ export async function legacy(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate> {
61
58
  const { chainId, baseFeeMultiplier } = opts;
62
59
  const gasPrice = await provider.getGasPrice();
63
60
 
@@ -1,4 +1,3 @@
1
- import { PopulatedTransaction } from "ethers";
2
1
  import { Address, Hex, PublicClient } from "viem";
3
2
  import { estimateGas } from "viem/linea";
4
3
  import { DEFAULT_SIMULATED_RELAYER_ADDRESS as account } from "../../constants";
@@ -27,8 +26,7 @@ export async function eip1559(
27
26
  provider: PublicClient,
28
27
  opts: GasPriceEstimateOptions
29
28
  ): Promise<InternalGasPriceEstimate> {
30
- const { unsignedTx: _unsignedTx, priorityFeeMultiplier } = opts;
31
- const unsignedTx = _unsignedTx as PopulatedTransaction; // Cast the opaque unsignedTx type to an ethers PopulatedTransaction.
29
+ const { unsignedTx, priorityFeeMultiplier } = opts;
32
30
  const { baseFeePerGas, priorityFeePerGas: _priorityFeePerGas } = await estimateGas(provider, {
33
31
  account: (unsignedTx?.from as Address) ?? account,
34
32
  to: (unsignedTx?.to as Address) ?? account,
@@ -2,7 +2,7 @@ import { providers } from "ethers";
2
2
  import { BaseHTTPAdapter, BaseHTTPAdapterArgs } from "../../priceClient/adapters/baseAdapter";
3
3
  import { BigNumber, bnZero, fixedPointAdjustment, isDefined, parseUnits } from "../../utils";
4
4
  import { CHAIN_IDs } from "../../constants";
5
- import { EvmGasPriceEstimate } from "../types";
5
+ import { GasPriceEstimate } from "../types";
6
6
  import { gasPriceError } from "../util";
7
7
  import { eip1559 } from "./ethereum";
8
8
  import { GasPriceEstimateOptions } from "../oracle";
@@ -38,7 +38,7 @@ export class PolygonGasStation extends BaseHTTPAdapter {
38
38
  this.chainId = chainId;
39
39
  }
40
40
 
41
- async getFeeData(strategy: "safeLow" | "standard" | "fast" = "fast"): Promise<EvmGasPriceEstimate> {
41
+ async getFeeData(strategy: "safeLow" | "standard" | "fast" = "fast"): Promise<GasPriceEstimate> {
42
42
  const gas = await this.query("v2", {});
43
43
 
44
44
  const gasPrice = (gas as GasStationV2Response)?.[strategy];
@@ -69,7 +69,7 @@ export class PolygonGasStation extends BaseHTTPAdapter {
69
69
  }
70
70
 
71
71
  class MockRevertingPolygonGasStation extends PolygonGasStation {
72
- getFeeData(): Promise<EvmGasPriceEstimate> {
72
+ getFeeData(): Promise<GasPriceEstimate> {
73
73
  throw new Error();
74
74
  }
75
75
  }
@@ -78,7 +78,7 @@ export const MockPolygonGasStationBaseFee = () => parseUnits("12", 9);
78
78
  export const MockPolygonGasStationPriorityFee = () => parseUnits("1", 9);
79
79
 
80
80
  class MockPolygonGasStation extends PolygonGasStation {
81
- getFeeData(): Promise<EvmGasPriceEstimate> {
81
+ getFeeData(): Promise<GasPriceEstimate> {
82
82
  return Promise.resolve({
83
83
  maxPriorityFeePerGas: MockPolygonGasStationPriorityFee(),
84
84
  maxFeePerGas: MockPolygonGasStationBaseFee().add(MockPolygonGasStationPriorityFee()),
@@ -90,12 +90,12 @@ class MockPolygonGasStation extends PolygonGasStation {
90
90
  * @notice Returns the gas price suggested by the Polygon GasStation API or reconstructs it using
91
91
  * the eip1559() method as a fallback.
92
92
  * @param provider Ethers Provider.
93
- * @returns EvmGasPriceEstimate
93
+ * @returns GasPriceEstimate
94
94
  */
95
95
  export async function gasStation(
96
96
  provider: providers.Provider,
97
97
  opts: GasPriceEstimateOptions
98
- ): Promise<EvmGasPriceEstimate> {
98
+ ): Promise<GasPriceEstimate> {
99
99
  const { chainId, baseFeeMultiplier, priorityFeeMultiplier } = opts;
100
100
  let gasStation: PolygonGasStation;
101
101
  if (process.env.TEST_POLYGON_GAS_STATION === "true") {
@@ -1,2 +1,2 @@
1
1
  export { getGasPriceEstimate } from "./oracle";
2
- export { GasPriceEstimate, EvmGasPriceEstimate, SvmGasPriceEstimate } from "./types";
2
+ export { GasPriceEstimate } from "./types";