@across-protocol/sdk 3.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 (930) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +116 -0
  3. package/dist/cjs/apiClient/abstractClient.d.ts +13 -0
  4. package/dist/cjs/apiClient/abstractClient.js +17 -0
  5. package/dist/cjs/apiClient/abstractClient.js.map +1 -0
  6. package/dist/cjs/apiClient/index.d.ts +2 -0
  7. package/dist/cjs/apiClient/index.js +11 -0
  8. package/dist/cjs/apiClient/index.js.map +1 -0
  9. package/dist/cjs/apiClient/mockedClient.d.ts +11 -0
  10. package/dist/cjs/apiClient/mockedClient.js +60 -0
  11. package/dist/cjs/apiClient/mockedClient.js.map +1 -0
  12. package/dist/cjs/apiClient/productionClient.d.ts +10 -0
  13. package/dist/cjs/apiClient/productionClient.js +110 -0
  14. package/dist/cjs/apiClient/productionClient.js.map +1 -0
  15. package/dist/cjs/apiClient/types.d.ts +44 -0
  16. package/dist/cjs/apiClient/types.js +3 -0
  17. package/dist/cjs/apiClient/types.js.map +1 -0
  18. package/dist/cjs/caching/Arweave/ArweaveClient.d.ts +20 -0
  19. package/dist/cjs/caching/Arweave/ArweaveClient.js +218 -0
  20. package/dist/cjs/caching/Arweave/ArweaveClient.js.map +1 -0
  21. package/dist/cjs/caching/Arweave/index.d.ts +1 -0
  22. package/dist/cjs/caching/Arweave/index.js +5 -0
  23. package/dist/cjs/caching/Arweave/index.js.map +1 -0
  24. package/dist/cjs/caching/IPFS/PinataIPFSClient.d.ts +11 -0
  25. package/dist/cjs/caching/IPFS/PinataIPFSClient.js +67 -0
  26. package/dist/cjs/caching/IPFS/PinataIPFSClient.js.map +1 -0
  27. package/dist/cjs/caching/IPFS/index.d.ts +1 -0
  28. package/dist/cjs/caching/IPFS/index.js +5 -0
  29. package/dist/cjs/caching/IPFS/index.js.map +1 -0
  30. package/dist/cjs/caching/index.d.ts +2 -0
  31. package/dist/cjs/caching/index.js +6 -0
  32. package/dist/cjs/caching/index.js.map +1 -0
  33. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +66 -0
  34. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +377 -0
  35. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -0
  36. package/dist/cjs/clients/AcrossConfigStoreClient/index.d.ts +1 -0
  37. package/dist/cjs/clients/AcrossConfigStoreClient/index.js +5 -0
  38. package/dist/cjs/clients/AcrossConfigStoreClient/index.js.map +1 -0
  39. package/dist/cjs/clients/BaseAbstractClient.d.ts +22 -0
  40. package/dist/cjs/clients/BaseAbstractClient.js +76 -0
  41. package/dist/cjs/clients/BaseAbstractClient.js.map +1 -0
  42. package/dist/cjs/clients/HubPoolClient.d.ts +111 -0
  43. package/dist/cjs/clients/HubPoolClient.js +758 -0
  44. package/dist/cjs/clients/HubPoolClient.js.map +1 -0
  45. package/dist/cjs/clients/SpokePoolClient.d.ts +117 -0
  46. package/dist/cjs/clients/SpokePoolClient.js +553 -0
  47. package/dist/cjs/clients/SpokePoolClient.js.map +1 -0
  48. package/dist/cjs/clients/index.d.ts +4 -0
  49. package/dist/cjs/clients/index.js +14 -0
  50. package/dist/cjs/clients/index.js.map +1 -0
  51. package/dist/cjs/clients/mocks/MockConfigStoreClient.d.ts +20 -0
  52. package/dist/cjs/clients/mocks/MockConfigStoreClient.js +121 -0
  53. package/dist/cjs/clients/mocks/MockConfigStoreClient.js.map +1 -0
  54. package/dist/cjs/clients/mocks/MockEvents.d.ts +27 -0
  55. package/dist/cjs/clients/mocks/MockEvents.js +117 -0
  56. package/dist/cjs/clients/mocks/MockEvents.js.map +1 -0
  57. package/dist/cjs/clients/mocks/MockHubPoolClient.d.ts +35 -0
  58. package/dist/cjs/clients/mocks/MockHubPoolClient.js +222 -0
  59. package/dist/cjs/clients/mocks/MockHubPoolClient.js.map +1 -0
  60. package/dist/cjs/clients/mocks/MockSpokePoolClient.d.ts +38 -0
  61. package/dist/cjs/clients/mocks/MockSpokePoolClient.js +319 -0
  62. package/dist/cjs/clients/mocks/MockSpokePoolClient.js.map +1 -0
  63. package/dist/cjs/clients/mocks/index.d.ts +3 -0
  64. package/dist/cjs/clients/mocks/index.js +7 -0
  65. package/dist/cjs/clients/mocks/index.js.map +1 -0
  66. package/dist/cjs/coingecko/Coingecko.d.ts +40 -0
  67. package/dist/cjs/coingecko/Coingecko.js +277 -0
  68. package/dist/cjs/coingecko/Coingecko.js.map +1 -0
  69. package/dist/cjs/coingecko/index.d.ts +1 -0
  70. package/dist/cjs/coingecko/index.js +5 -0
  71. package/dist/cjs/coingecko/index.js.map +1 -0
  72. package/dist/cjs/constants.d.ts +18 -0
  73. package/dist/cjs/constants.js +27 -0
  74. package/dist/cjs/constants.js.map +1 -0
  75. package/dist/cjs/contracts/acrossConfigStore.d.ts +57 -0
  76. package/dist/cjs/contracts/acrossConfigStore.js +65 -0
  77. package/dist/cjs/contracts/acrossConfigStore.js.map +1 -0
  78. package/dist/cjs/contracts/hubPool.d.ts +17 -0
  79. package/dist/cjs/contracts/hubPool.js +61 -0
  80. package/dist/cjs/contracts/hubPool.js.map +1 -0
  81. package/dist/cjs/contracts/index.d.ts +2 -0
  82. package/dist/cjs/contracts/index.js +7 -0
  83. package/dist/cjs/contracts/index.js.map +1 -0
  84. package/dist/cjs/contracts/utils.d.ts +15 -0
  85. package/dist/cjs/contracts/utils.js +40 -0
  86. package/dist/cjs/contracts/utils.js.map +1 -0
  87. package/dist/cjs/gasPriceOracle/adapters/arbitrum.d.ts +3 -0
  88. package/dist/cjs/gasPriceOracle/adapters/arbitrum.js +25 -0
  89. package/dist/cjs/gasPriceOracle/adapters/arbitrum.js.map +1 -0
  90. package/dist/cjs/gasPriceOracle/adapters/ethereum.d.ts +4 -0
  91. package/dist/cjs/gasPriceOracle/adapters/ethereum.js +46 -0
  92. package/dist/cjs/gasPriceOracle/adapters/ethereum.js.map +1 -0
  93. package/dist/cjs/gasPriceOracle/adapters/index.d.ts +3 -0
  94. package/dist/cjs/gasPriceOracle/adapters/index.js +7 -0
  95. package/dist/cjs/gasPriceOracle/adapters/index.js.map +1 -0
  96. package/dist/cjs/gasPriceOracle/adapters/polygon.d.ts +3 -0
  97. package/dist/cjs/gasPriceOracle/adapters/polygon.js +77 -0
  98. package/dist/cjs/gasPriceOracle/adapters/polygon.js.map +1 -0
  99. package/dist/cjs/gasPriceOracle/index.d.ts +2 -0
  100. package/dist/cjs/gasPriceOracle/index.js +6 -0
  101. package/dist/cjs/gasPriceOracle/index.js.map +1 -0
  102. package/dist/cjs/gasPriceOracle/oracle.d.ts +3 -0
  103. package/dist/cjs/gasPriceOracle/oracle.js +45 -0
  104. package/dist/cjs/gasPriceOracle/oracle.js.map +1 -0
  105. package/dist/cjs/gasPriceOracle/types.d.ts +8 -0
  106. package/dist/cjs/gasPriceOracle/types.js +3 -0
  107. package/dist/cjs/gasPriceOracle/types.js.map +1 -0
  108. package/dist/cjs/gasPriceOracle/util.d.ts +2 -0
  109. package/dist/cjs/gasPriceOracle/util.js +8 -0
  110. package/dist/cjs/gasPriceOracle/util.js.map +1 -0
  111. package/dist/cjs/index.d.ts +15 -0
  112. package/dist/cjs/index.js +20 -0
  113. package/dist/cjs/index.js.map +1 -0
  114. package/dist/cjs/interfaces/Bridge.d.ts +9 -0
  115. package/dist/cjs/interfaces/Bridge.js +3 -0
  116. package/dist/cjs/interfaces/Bridge.js.map +1 -0
  117. package/dist/cjs/interfaces/CachingMechanism.d.ts +5 -0
  118. package/dist/cjs/interfaces/CachingMechanism.js +3 -0
  119. package/dist/cjs/interfaces/CachingMechanism.js.map +1 -0
  120. package/dist/cjs/interfaces/Common.d.ts +10 -0
  121. package/dist/cjs/interfaces/Common.js +3 -0
  122. package/dist/cjs/interfaces/Common.js.map +1 -0
  123. package/dist/cjs/interfaces/ConfigStore.d.ts +81 -0
  124. package/dist/cjs/interfaces/ConfigStore.js +3 -0
  125. package/dist/cjs/interfaces/ConfigStore.js.map +1 -0
  126. package/dist/cjs/interfaces/Error.d.ts +5 -0
  127. package/dist/cjs/interfaces/Error.js +3 -0
  128. package/dist/cjs/interfaces/Error.js.map +1 -0
  129. package/dist/cjs/interfaces/HubPool.d.ts +98 -0
  130. package/dist/cjs/interfaces/HubPool.js +3 -0
  131. package/dist/cjs/interfaces/HubPool.js.map +1 -0
  132. package/dist/cjs/interfaces/SpokePool.d.ts +103 -0
  133. package/dist/cjs/interfaces/SpokePool.js +16 -0
  134. package/dist/cjs/interfaces/SpokePool.js.map +1 -0
  135. package/dist/cjs/interfaces/TypedData.d.ts +19 -0
  136. package/dist/cjs/interfaces/TypedData.js +3 -0
  137. package/dist/cjs/interfaces/TypedData.js.map +1 -0
  138. package/dist/cjs/interfaces/index.d.ts +8 -0
  139. package/dist/cjs/interfaces/index.js +12 -0
  140. package/dist/cjs/interfaces/index.js.map +1 -0
  141. package/dist/cjs/lpFeeCalculator/index.d.ts +1 -0
  142. package/dist/cjs/lpFeeCalculator/index.js +5 -0
  143. package/dist/cjs/lpFeeCalculator/index.js.map +1 -0
  144. package/dist/cjs/lpFeeCalculator/lpFeeCalculator.d.ts +19 -0
  145. package/dist/cjs/lpFeeCalculator/lpFeeCalculator.js +79 -0
  146. package/dist/cjs/lpFeeCalculator/lpFeeCalculator.js.map +1 -0
  147. package/dist/cjs/lpFeeCalculator/rateModel.d.ts +28 -0
  148. package/dist/cjs/lpFeeCalculator/rateModel.js +103 -0
  149. package/dist/cjs/lpFeeCalculator/rateModel.js.map +1 -0
  150. package/dist/cjs/merkleDistributor/MerkleDistributor.d.ts +8 -0
  151. package/dist/cjs/merkleDistributor/MerkleDistributor.js +25 -0
  152. package/dist/cjs/merkleDistributor/MerkleDistributor.js.map +1 -0
  153. package/dist/cjs/merkleDistributor/index.d.ts +2 -0
  154. package/dist/cjs/merkleDistributor/index.js +6 -0
  155. package/dist/cjs/merkleDistributor/index.js.map +1 -0
  156. package/dist/cjs/merkleDistributor/model/Distribution.d.ts +17 -0
  157. package/dist/cjs/merkleDistributor/model/Distribution.js +3 -0
  158. package/dist/cjs/merkleDistributor/model/Distribution.js.map +1 -0
  159. package/dist/cjs/merkleDistributor/model/index.d.ts +1 -0
  160. package/dist/cjs/merkleDistributor/model/index.js +5 -0
  161. package/dist/cjs/merkleDistributor/model/index.js.map +1 -0
  162. package/dist/cjs/package.json +1 -0
  163. package/dist/cjs/pool/TransactionManager.d.ts +12 -0
  164. package/dist/cjs/pool/TransactionManager.js +121 -0
  165. package/dist/cjs/pool/TransactionManager.js.map +1 -0
  166. package/dist/cjs/pool/index.d.ts +1 -0
  167. package/dist/cjs/pool/index.js +5 -0
  168. package/dist/cjs/pool/index.js.map +1 -0
  169. package/dist/cjs/pool/poolClient.d.ts +232 -0
  170. package/dist/cjs/pool/poolClient.js +869 -0
  171. package/dist/cjs/pool/poolClient.js.map +1 -0
  172. package/dist/cjs/priceClient/adapters/acrossApi.d.ts +13 -0
  173. package/dist/cjs/priceClient/adapters/acrossApi.js +48 -0
  174. package/dist/cjs/priceClient/adapters/acrossApi.js.map +1 -0
  175. package/dist/cjs/priceClient/adapters/baseAdapter.d.ts +17 -0
  176. package/dist/cjs/priceClient/adapters/baseAdapter.js +81 -0
  177. package/dist/cjs/priceClient/adapters/baseAdapter.js.map +1 -0
  178. package/dist/cjs/priceClient/adapters/coingecko.d.ts +14 -0
  179. package/dist/cjs/priceClient/adapters/coingecko.js +75 -0
  180. package/dist/cjs/priceClient/adapters/coingecko.js.map +1 -0
  181. package/dist/cjs/priceClient/adapters/defiLlama.d.ts +17 -0
  182. package/dist/cjs/priceClient/adapters/defiLlama.js +95 -0
  183. package/dist/cjs/priceClient/adapters/defiLlama.js.map +1 -0
  184. package/dist/cjs/priceClient/adapters/index.d.ts +3 -0
  185. package/dist/cjs/priceClient/adapters/index.js +8 -0
  186. package/dist/cjs/priceClient/adapters/index.js.map +1 -0
  187. package/dist/cjs/priceClient/index.d.ts +2 -0
  188. package/dist/cjs/priceClient/index.js +7 -0
  189. package/dist/cjs/priceClient/index.js.map +1 -0
  190. package/dist/cjs/priceClient/priceClient.d.ts +32 -0
  191. package/dist/cjs/priceClient/priceClient.js +197 -0
  192. package/dist/cjs/priceClient/priceClient.js.map +1 -0
  193. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.d.ts +29 -0
  194. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js +62 -0
  195. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -0
  196. package/dist/cjs/relayFeeCalculator/chain-queries/factory.d.ts +151 -0
  197. package/dist/cjs/relayFeeCalculator/chain-queries/factory.js +35 -0
  198. package/dist/cjs/relayFeeCalculator/chain-queries/factory.js.map +1 -0
  199. package/dist/cjs/relayFeeCalculator/chain-queries/index.d.ts +3 -0
  200. package/dist/cjs/relayFeeCalculator/chain-queries/index.js +7 -0
  201. package/dist/cjs/relayFeeCalculator/chain-queries/index.js.map +1 -0
  202. package/dist/cjs/relayFeeCalculator/chain-queries/polygon.d.ts +152 -0
  203. package/dist/cjs/relayFeeCalculator/chain-queries/polygon.js +43 -0
  204. package/dist/cjs/relayFeeCalculator/chain-queries/polygon.js.map +1 -0
  205. package/dist/cjs/relayFeeCalculator/index.d.ts +2 -0
  206. package/dist/cjs/relayFeeCalculator/index.js +6 -0
  207. package/dist/cjs/relayFeeCalculator/index.js.map +1 -0
  208. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +231 -0
  209. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js +224 -0
  210. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js.map +1 -0
  211. package/dist/cjs/typechain.d.ts +17 -0
  212. package/dist/cjs/typechain.js +20 -0
  213. package/dist/cjs/typechain.js.map +1 -0
  214. package/dist/cjs/typeguards/error.d.ts +3 -0
  215. package/dist/cjs/typeguards/error.js +11 -0
  216. package/dist/cjs/typeguards/error.js.map +1 -0
  217. package/dist/cjs/typeguards/index.d.ts +1 -0
  218. package/dist/cjs/typeguards/index.js +5 -0
  219. package/dist/cjs/typeguards/index.js.map +1 -0
  220. package/dist/cjs/utils/AddressUtils.d.ts +2 -0
  221. package/dist/cjs/utils/AddressUtils.js +24 -0
  222. package/dist/cjs/utils/AddressUtils.js.map +1 -0
  223. package/dist/cjs/utils/ArrayUtils.d.ts +12 -0
  224. package/dist/cjs/utils/ArrayUtils.js +125 -0
  225. package/dist/cjs/utils/ArrayUtils.js.map +1 -0
  226. package/dist/cjs/utils/BigNumberUtils.d.ts +8 -0
  227. package/dist/cjs/utils/BigNumberUtils.js +26 -0
  228. package/dist/cjs/utils/BigNumberUtils.js.map +1 -0
  229. package/dist/cjs/utils/BlockExplorerUtils.d.ts +3 -0
  230. package/dist/cjs/utils/BlockExplorerUtils.js +52 -0
  231. package/dist/cjs/utils/BlockExplorerUtils.js.map +1 -0
  232. package/dist/cjs/utils/BlockUtils.d.ts +28 -0
  233. package/dist/cjs/utils/BlockUtils.js +251 -0
  234. package/dist/cjs/utils/BlockUtils.js.map +1 -0
  235. package/dist/cjs/utils/BundleUtils.d.ts +5 -0
  236. package/dist/cjs/utils/BundleUtils.js +62 -0
  237. package/dist/cjs/utils/BundleUtils.js.map +1 -0
  238. package/dist/cjs/utils/CachingUtils.d.ts +5 -0
  239. package/dist/cjs/utils/CachingUtils.js +59 -0
  240. package/dist/cjs/utils/CachingUtils.js.map +1 -0
  241. package/dist/cjs/utils/DeploymentUtils.d.ts +1 -0
  242. package/dist/cjs/utils/DeploymentUtils.js +8 -0
  243. package/dist/cjs/utils/DeploymentUtils.js.map +1 -0
  244. package/dist/cjs/utils/DepositUtils.d.ts +19 -0
  245. package/dist/cjs/utils/DepositUtils.js +107 -0
  246. package/dist/cjs/utils/DepositUtils.js.map +1 -0
  247. package/dist/cjs/utils/EventUtils.d.ts +18 -0
  248. package/dist/cjs/utils/EventUtils.js +169 -0
  249. package/dist/cjs/utils/EventUtils.js.map +1 -0
  250. package/dist/cjs/utils/FlowUtils.d.ts +7 -0
  251. package/dist/cjs/utils/FlowUtils.js +42 -0
  252. package/dist/cjs/utils/FlowUtils.js.map +1 -0
  253. package/dist/cjs/utils/FormattingUtils.d.ts +15 -0
  254. package/dist/cjs/utils/FormattingUtils.js +107 -0
  255. package/dist/cjs/utils/FormattingUtils.js.map +1 -0
  256. package/dist/cjs/utils/IPFSUtils.d.ts +4 -0
  257. package/dist/cjs/utils/IPFSUtils.js +48 -0
  258. package/dist/cjs/utils/IPFSUtils.js.map +1 -0
  259. package/dist/cjs/utils/JSONUtils.d.ts +4 -0
  260. package/dist/cjs/utils/JSONUtils.js +53 -0
  261. package/dist/cjs/utils/JSONUtils.js.map +1 -0
  262. package/dist/cjs/utils/LogUtils.d.ts +14 -0
  263. package/dist/cjs/utils/LogUtils.js +18 -0
  264. package/dist/cjs/utils/LogUtils.js.map +1 -0
  265. package/dist/cjs/utils/Multicall.d.ts +13 -0
  266. package/dist/cjs/utils/Multicall.js +73 -0
  267. package/dist/cjs/utils/Multicall.js.map +1 -0
  268. package/dist/cjs/utils/NetworkUtils.d.ts +10 -0
  269. package/dist/cjs/utils/NetworkUtils.js +70 -0
  270. package/dist/cjs/utils/NetworkUtils.js.map +1 -0
  271. package/dist/cjs/utils/NumberUtils.d.ts +2 -0
  272. package/dist/cjs/utils/NumberUtils.js +12 -0
  273. package/dist/cjs/utils/NumberUtils.js.map +1 -0
  274. package/dist/cjs/utils/ObjectUtils.d.ts +5 -0
  275. package/dist/cjs/utils/ObjectUtils.js +65 -0
  276. package/dist/cjs/utils/ObjectUtils.js.map +1 -0
  277. package/dist/cjs/utils/ReviverUtils.d.ts +3 -0
  278. package/dist/cjs/utils/ReviverUtils.js +23 -0
  279. package/dist/cjs/utils/ReviverUtils.js.map +1 -0
  280. package/dist/cjs/utils/SpokeUtils.d.ts +16 -0
  281. package/dist/cjs/utils/SpokeUtils.js +299 -0
  282. package/dist/cjs/utils/SpokeUtils.js.map +1 -0
  283. package/dist/cjs/utils/TimeUtils.d.ts +1 -0
  284. package/dist/cjs/utils/TimeUtils.js +8 -0
  285. package/dist/cjs/utils/TimeUtils.js.map +1 -0
  286. package/dist/cjs/utils/TokenUtils.d.ts +303 -0
  287. package/dist/cjs/utils/TokenUtils.js +74 -0
  288. package/dist/cjs/utils/TokenUtils.js.map +1 -0
  289. package/dist/cjs/utils/TypeGuards.d.ts +3 -0
  290. package/dist/cjs/utils/TypeGuards.js +16 -0
  291. package/dist/cjs/utils/TypeGuards.js.map +1 -0
  292. package/dist/cjs/utils/TypeUtils.d.ts +5 -0
  293. package/dist/cjs/utils/TypeUtils.js +3 -0
  294. package/dist/cjs/utils/TypeUtils.js.map +1 -0
  295. package/dist/cjs/utils/V3Utils.d.ts +4 -0
  296. package/dist/cjs/utils/V3Utils.js +15 -0
  297. package/dist/cjs/utils/V3Utils.js.map +1 -0
  298. package/dist/cjs/utils/ValidatorUtils.d.ts +2 -0
  299. package/dist/cjs/utils/ValidatorUtils.js +39 -0
  300. package/dist/cjs/utils/ValidatorUtils.js.map +1 -0
  301. package/dist/cjs/utils/abi/contracts/Multicall3.json +440 -0
  302. package/dist/cjs/utils/abi/index.d.ts +3 -0
  303. package/dist/cjs/utils/abi/index.js +31 -0
  304. package/dist/cjs/utils/abi/index.js.map +1 -0
  305. package/dist/cjs/utils/common.d.ts +79 -0
  306. package/dist/cjs/utils/common.js +220 -0
  307. package/dist/cjs/utils/common.js.map +1 -0
  308. package/dist/cjs/utils/index.d.ts +29 -0
  309. package/dist/cjs/utils/index.js +33 -0
  310. package/dist/cjs/utils/index.js.map +1 -0
  311. package/dist/esm/apiClient/abstractClient.d.ts +66 -0
  312. package/dist/esm/apiClient/abstractClient.js +31 -0
  313. package/dist/esm/apiClient/abstractClient.js.map +1 -0
  314. package/dist/esm/apiClient/index.d.ts +2 -0
  315. package/dist/esm/apiClient/index.js +3 -0
  316. package/dist/esm/apiClient/index.js.map +1 -0
  317. package/dist/esm/apiClient/mockedClient.d.ts +24 -0
  318. package/dist/esm/apiClient/mockedClient.js +69 -0
  319. package/dist/esm/apiClient/mockedClient.js.map +1 -0
  320. package/dist/esm/apiClient/productionClient.d.ts +16 -0
  321. package/dist/esm/apiClient/productionClient.js +114 -0
  322. package/dist/esm/apiClient/productionClient.js.map +1 -0
  323. package/dist/esm/apiClient/types.d.ts +44 -0
  324. package/dist/esm/apiClient/types.js +2 -0
  325. package/dist/esm/apiClient/types.js.map +1 -0
  326. package/dist/esm/caching/Arweave/ArweaveClient.d.ts +61 -0
  327. package/dist/esm/caching/Arweave/ArweaveClient.js +265 -0
  328. package/dist/esm/caching/Arweave/ArweaveClient.js.map +1 -0
  329. package/dist/esm/caching/Arweave/index.d.ts +1 -0
  330. package/dist/esm/caching/Arweave/index.js +2 -0
  331. package/dist/esm/caching/Arweave/index.js.map +1 -0
  332. package/dist/esm/caching/IPFS/PinataIPFSClient.d.ts +37 -0
  333. package/dist/esm/caching/IPFS/PinataIPFSClient.js +81 -0
  334. package/dist/esm/caching/IPFS/PinataIPFSClient.js.map +1 -0
  335. package/dist/esm/caching/IPFS/index.d.ts +1 -0
  336. package/dist/esm/caching/IPFS/index.js +2 -0
  337. package/dist/esm/caching/IPFS/index.js.map +1 -0
  338. package/dist/esm/caching/index.d.ts +2 -0
  339. package/dist/esm/caching/index.js +3 -0
  340. package/dist/esm/caching/index.js.map +1 -0
  341. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +108 -0
  342. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +467 -0
  343. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -0
  344. package/dist/esm/clients/AcrossConfigStoreClient/index.d.ts +1 -0
  345. package/dist/esm/clients/AcrossConfigStoreClient/index.js +2 -0
  346. package/dist/esm/clients/AcrossConfigStoreClient/index.js.map +1 -0
  347. package/dist/esm/clients/BaseAbstractClient.d.ts +51 -0
  348. package/dist/esm/clients/BaseAbstractClient.js +101 -0
  349. package/dist/esm/clients/BaseAbstractClient.js.map +1 -0
  350. package/dist/esm/clients/HubPoolClient.d.ts +134 -0
  351. package/dist/esm/clients/HubPoolClient.js +862 -0
  352. package/dist/esm/clients/HubPoolClient.js.map +1 -0
  353. package/dist/esm/clients/SpokePoolClient.d.ts +318 -0
  354. package/dist/esm/clients/SpokePoolClient.js +780 -0
  355. package/dist/esm/clients/SpokePoolClient.js.map +1 -0
  356. package/dist/esm/clients/index.d.ts +4 -0
  357. package/dist/esm/clients/index.js +6 -0
  358. package/dist/esm/clients/index.js.map +1 -0
  359. package/dist/esm/clients/mocks/MockConfigStoreClient.d.ts +20 -0
  360. package/dist/esm/clients/mocks/MockConfigStoreClient.js +122 -0
  361. package/dist/esm/clients/mocks/MockConfigStoreClient.js.map +1 -0
  362. package/dist/esm/clients/mocks/MockEvents.d.ts +34 -0
  363. package/dist/esm/clients/mocks/MockEvents.js +126 -0
  364. package/dist/esm/clients/mocks/MockEvents.js.map +1 -0
  365. package/dist/esm/clients/mocks/MockHubPoolClient.d.ts +35 -0
  366. package/dist/esm/clients/mocks/MockHubPoolClient.js +223 -0
  367. package/dist/esm/clients/mocks/MockHubPoolClient.js.map +1 -0
  368. package/dist/esm/clients/mocks/MockSpokePoolClient.d.ts +38 -0
  369. package/dist/esm/clients/mocks/MockSpokePoolClient.js +322 -0
  370. package/dist/esm/clients/mocks/MockSpokePoolClient.js.map +1 -0
  371. package/dist/esm/clients/mocks/index.d.ts +3 -0
  372. package/dist/esm/clients/mocks/index.js +4 -0
  373. package/dist/esm/clients/mocks/index.js.map +1 -0
  374. package/dist/esm/coingecko/Coingecko.d.ts +40 -0
  375. package/dist/esm/coingecko/Coingecko.js +283 -0
  376. package/dist/esm/coingecko/Coingecko.js.map +1 -0
  377. package/dist/esm/coingecko/index.d.ts +1 -0
  378. package/dist/esm/coingecko/index.js +2 -0
  379. package/dist/esm/coingecko/index.js.map +1 -0
  380. package/dist/esm/constants.d.ts +29 -0
  381. package/dist/esm/constants.js +34 -0
  382. package/dist/esm/constants.js.map +1 -0
  383. package/dist/esm/contracts/acrossConfigStore.d.ts +57 -0
  384. package/dist/esm/contracts/acrossConfigStore.js +62 -0
  385. package/dist/esm/contracts/acrossConfigStore.js.map +1 -0
  386. package/dist/esm/contracts/hubPool.d.ts +17 -0
  387. package/dist/esm/contracts/hubPool.js +55 -0
  388. package/dist/esm/contracts/hubPool.js.map +1 -0
  389. package/dist/esm/contracts/index.d.ts +2 -0
  390. package/dist/esm/contracts/index.js +5 -0
  391. package/dist/esm/contracts/index.js.map +1 -0
  392. package/dist/esm/contracts/utils.d.ts +23 -0
  393. package/dist/esm/contracts/utils.js +38 -0
  394. package/dist/esm/contracts/utils.js.map +1 -0
  395. package/dist/esm/gasPriceOracle/adapters/arbitrum.d.ts +3 -0
  396. package/dist/esm/gasPriceOracle/adapters/arbitrum.js +25 -0
  397. package/dist/esm/gasPriceOracle/adapters/arbitrum.js.map +1 -0
  398. package/dist/esm/gasPriceOracle/adapters/ethereum.d.ts +4 -0
  399. package/dist/esm/gasPriceOracle/adapters/ethereum.js +41 -0
  400. package/dist/esm/gasPriceOracle/adapters/ethereum.js.map +1 -0
  401. package/dist/esm/gasPriceOracle/adapters/index.d.ts +3 -0
  402. package/dist/esm/gasPriceOracle/adapters/index.js +4 -0
  403. package/dist/esm/gasPriceOracle/adapters/index.js.map +1 -0
  404. package/dist/esm/gasPriceOracle/adapters/polygon.d.ts +3 -0
  405. package/dist/esm/gasPriceOracle/adapters/polygon.js +78 -0
  406. package/dist/esm/gasPriceOracle/adapters/polygon.js.map +1 -0
  407. package/dist/esm/gasPriceOracle/index.d.ts +2 -0
  408. package/dist/esm/gasPriceOracle/index.js +2 -0
  409. package/dist/esm/gasPriceOracle/index.js.map +1 -0
  410. package/dist/esm/gasPriceOracle/oracle.d.ts +10 -0
  411. package/dist/esm/gasPriceOracle/oracle.js +48 -0
  412. package/dist/esm/gasPriceOracle/oracle.js.map +1 -0
  413. package/dist/esm/gasPriceOracle/types.d.ts +8 -0
  414. package/dist/esm/gasPriceOracle/types.js +2 -0
  415. package/dist/esm/gasPriceOracle/types.js.map +1 -0
  416. package/dist/esm/gasPriceOracle/util.d.ts +2 -0
  417. package/dist/esm/gasPriceOracle/util.js +4 -0
  418. package/dist/esm/gasPriceOracle/util.js.map +1 -0
  419. package/dist/esm/index.d.ts +15 -0
  420. package/dist/esm/index.js +31 -0
  421. package/dist/esm/index.js.map +1 -0
  422. package/dist/esm/interfaces/Bridge.d.ts +9 -0
  423. package/dist/esm/interfaces/Bridge.js +2 -0
  424. package/dist/esm/interfaces/Bridge.js.map +1 -0
  425. package/dist/esm/interfaces/CachingMechanism.d.ts +26 -0
  426. package/dist/esm/interfaces/CachingMechanism.js +2 -0
  427. package/dist/esm/interfaces/CachingMechanism.js.map +1 -0
  428. package/dist/esm/interfaces/Common.d.ts +10 -0
  429. package/dist/esm/interfaces/Common.js +2 -0
  430. package/dist/esm/interfaces/Common.js.map +1 -0
  431. package/dist/esm/interfaces/ConfigStore.d.ts +157 -0
  432. package/dist/esm/interfaces/ConfigStore.js +2 -0
  433. package/dist/esm/interfaces/ConfigStore.js.map +1 -0
  434. package/dist/esm/interfaces/Error.d.ts +5 -0
  435. package/dist/esm/interfaces/Error.js +2 -0
  436. package/dist/esm/interfaces/Error.js.map +1 -0
  437. package/dist/esm/interfaces/HubPool.d.ts +98 -0
  438. package/dist/esm/interfaces/HubPool.js +2 -0
  439. package/dist/esm/interfaces/HubPool.js.map +1 -0
  440. package/dist/esm/interfaces/SpokePool.d.ts +103 -0
  441. package/dist/esm/interfaces/SpokePool.js +13 -0
  442. package/dist/esm/interfaces/SpokePool.js.map +1 -0
  443. package/dist/esm/interfaces/TypedData.d.ts +19 -0
  444. package/dist/esm/interfaces/TypedData.js +2 -0
  445. package/dist/esm/interfaces/TypedData.js.map +1 -0
  446. package/dist/esm/interfaces/index.d.ts +8 -0
  447. package/dist/esm/interfaces/index.js +9 -0
  448. package/dist/esm/interfaces/index.js.map +1 -0
  449. package/dist/esm/lpFeeCalculator/index.d.ts +1 -0
  450. package/dist/esm/lpFeeCalculator/index.js +2 -0
  451. package/dist/esm/lpFeeCalculator/index.js.map +1 -0
  452. package/dist/esm/lpFeeCalculator/lpFeeCalculator.d.ts +66 -0
  453. package/dist/esm/lpFeeCalculator/lpFeeCalculator.js +129 -0
  454. package/dist/esm/lpFeeCalculator/lpFeeCalculator.js.map +1 -0
  455. package/dist/esm/lpFeeCalculator/rateModel.d.ts +45 -0
  456. package/dist/esm/lpFeeCalculator/rateModel.js +138 -0
  457. package/dist/esm/lpFeeCalculator/rateModel.js.map +1 -0
  458. package/dist/esm/merkleDistributor/MerkleDistributor.d.ts +20 -0
  459. package/dist/esm/merkleDistributor/MerkleDistributor.js +34 -0
  460. package/dist/esm/merkleDistributor/MerkleDistributor.js.map +1 -0
  461. package/dist/esm/merkleDistributor/index.d.ts +2 -0
  462. package/dist/esm/merkleDistributor/index.js +3 -0
  463. package/dist/esm/merkleDistributor/index.js.map +1 -0
  464. package/dist/esm/merkleDistributor/model/Distribution.d.ts +17 -0
  465. package/dist/esm/merkleDistributor/model/Distribution.js +2 -0
  466. package/dist/esm/merkleDistributor/model/Distribution.js.map +1 -0
  467. package/dist/esm/merkleDistributor/model/index.d.ts +1 -0
  468. package/dist/esm/merkleDistributor/model/index.js +2 -0
  469. package/dist/esm/merkleDistributor/model/index.js.map +1 -0
  470. package/dist/esm/package.json +1 -0
  471. package/dist/esm/pool/TransactionManager.d.ts +12 -0
  472. package/dist/esm/pool/TransactionManager.js +122 -0
  473. package/dist/esm/pool/TransactionManager.js.map +1 -0
  474. package/dist/esm/pool/index.d.ts +1 -0
  475. package/dist/esm/pool/index.js +2 -0
  476. package/dist/esm/pool/index.js.map +1 -0
  477. package/dist/esm/pool/poolClient.d.ts +242 -0
  478. package/dist/esm/pool/poolClient.js +899 -0
  479. package/dist/esm/pool/poolClient.js.map +1 -0
  480. package/dist/esm/priceClient/adapters/acrossApi.d.ts +14 -0
  481. package/dist/esm/priceClient/adapters/acrossApi.js +49 -0
  482. package/dist/esm/priceClient/adapters/acrossApi.js.map +1 -0
  483. package/dist/esm/priceClient/adapters/baseAdapter.d.ts +17 -0
  484. package/dist/esm/priceClient/adapters/baseAdapter.js +78 -0
  485. package/dist/esm/priceClient/adapters/baseAdapter.js.map +1 -0
  486. package/dist/esm/priceClient/adapters/coingecko.d.ts +14 -0
  487. package/dist/esm/priceClient/adapters/coingecko.js +73 -0
  488. package/dist/esm/priceClient/adapters/coingecko.js.map +1 -0
  489. package/dist/esm/priceClient/adapters/defiLlama.d.ts +17 -0
  490. package/dist/esm/priceClient/adapters/defiLlama.js +93 -0
  491. package/dist/esm/priceClient/adapters/defiLlama.js.map +1 -0
  492. package/dist/esm/priceClient/adapters/index.d.ts +3 -0
  493. package/dist/esm/priceClient/adapters/index.js +7 -0
  494. package/dist/esm/priceClient/adapters/index.js.map +1 -0
  495. package/dist/esm/priceClient/index.d.ts +2 -0
  496. package/dist/esm/priceClient/index.js +4 -0
  497. package/dist/esm/priceClient/index.js.map +1 -0
  498. package/dist/esm/priceClient/priceClient.d.ts +32 -0
  499. package/dist/esm/priceClient/priceClient.js +206 -0
  500. package/dist/esm/priceClient/priceClient.js.map +1 -0
  501. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.d.ts +61 -0
  502. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js +91 -0
  503. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -0
  504. package/dist/esm/relayFeeCalculator/chain-queries/factory.d.ts +151 -0
  505. package/dist/esm/relayFeeCalculator/chain-queries/factory.js +38 -0
  506. package/dist/esm/relayFeeCalculator/chain-queries/factory.js.map +1 -0
  507. package/dist/esm/relayFeeCalculator/chain-queries/index.d.ts +3 -0
  508. package/dist/esm/relayFeeCalculator/chain-queries/index.js +4 -0
  509. package/dist/esm/relayFeeCalculator/chain-queries/index.js.map +1 -0
  510. package/dist/esm/relayFeeCalculator/chain-queries/polygon.d.ts +152 -0
  511. package/dist/esm/relayFeeCalculator/chain-queries/polygon.js +40 -0
  512. package/dist/esm/relayFeeCalculator/chain-queries/polygon.js.map +1 -0
  513. package/dist/esm/relayFeeCalculator/index.d.ts +2 -0
  514. package/dist/esm/relayFeeCalculator/index.js +3 -0
  515. package/dist/esm/relayFeeCalculator/index.js.map +1 -0
  516. package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +282 -0
  517. package/dist/esm/relayFeeCalculator/relayFeeCalculator.js +298 -0
  518. package/dist/esm/relayFeeCalculator/relayFeeCalculator.js.map +1 -0
  519. package/dist/esm/typechain.d.ts +22 -0
  520. package/dist/esm/typechain.js +9 -0
  521. package/dist/esm/typechain.js.map +1 -0
  522. package/dist/esm/typeguards/error.d.ts +3 -0
  523. package/dist/esm/typeguards/error.js +6 -0
  524. package/dist/esm/typeguards/error.js.map +1 -0
  525. package/dist/esm/typeguards/index.d.ts +1 -0
  526. package/dist/esm/typeguards/index.js +2 -0
  527. package/dist/esm/typeguards/index.js.map +1 -0
  528. package/dist/esm/utils/AddressUtils.d.ts +8 -0
  529. package/dist/esm/utils/AddressUtils.js +28 -0
  530. package/dist/esm/utils/AddressUtils.js.map +1 -0
  531. package/dist/esm/utils/ArrayUtils.d.ts +98 -0
  532. package/dist/esm/utils/ArrayUtils.js +196 -0
  533. package/dist/esm/utils/ArrayUtils.js.map +1 -0
  534. package/dist/esm/utils/BigNumberUtils.d.ts +31 -0
  535. package/dist/esm/utils/BigNumberUtils.js +52 -0
  536. package/dist/esm/utils/BigNumberUtils.js.map +1 -0
  537. package/dist/esm/utils/BlockExplorerUtils.d.ts +21 -0
  538. package/dist/esm/utils/BlockExplorerUtils.js +91 -0
  539. package/dist/esm/utils/BlockExplorerUtils.js.map +1 -0
  540. package/dist/esm/utils/BlockUtils.d.ts +46 -0
  541. package/dist/esm/utils/BlockUtils.js +294 -0
  542. package/dist/esm/utils/BlockUtils.js.map +1 -0
  543. package/dist/esm/utils/BundleUtils.d.ts +29 -0
  544. package/dist/esm/utils/BundleUtils.js +89 -0
  545. package/dist/esm/utils/BundleUtils.js.map +1 -0
  546. package/dist/esm/utils/CachingUtils.d.ts +17 -0
  547. package/dist/esm/utils/CachingUtils.js +66 -0
  548. package/dist/esm/utils/CachingUtils.js.map +1 -0
  549. package/dist/esm/utils/DeploymentUtils.d.ts +1 -0
  550. package/dist/esm/utils/DeploymentUtils.js +2 -0
  551. package/dist/esm/utils/DeploymentUtils.js.map +1 -0
  552. package/dist/esm/utils/DepositUtils.d.ts +46 -0
  553. package/dist/esm/utils/DepositUtils.js +138 -0
  554. package/dist/esm/utils/DepositUtils.js.map +1 -0
  555. package/dist/esm/utils/EventUtils.d.ts +32 -0
  556. package/dist/esm/utils/EventUtils.js +194 -0
  557. package/dist/esm/utils/EventUtils.js.map +1 -0
  558. package/dist/esm/utils/FlowUtils.d.ts +8 -0
  559. package/dist/esm/utils/FlowUtils.js +39 -0
  560. package/dist/esm/utils/FlowUtils.js.map +1 -0
  561. package/dist/esm/utils/FormattingUtils.d.ts +61 -0
  562. package/dist/esm/utils/FormattingUtils.js +167 -0
  563. package/dist/esm/utils/FormattingUtils.js.map +1 -0
  564. package/dist/esm/utils/IPFSUtils.d.ts +24 -0
  565. package/dist/esm/utils/IPFSUtils.js +65 -0
  566. package/dist/esm/utils/IPFSUtils.js.map +1 -0
  567. package/dist/esm/utils/JSONUtils.d.ts +31 -0
  568. package/dist/esm/utils/JSONUtils.js +82 -0
  569. package/dist/esm/utils/JSONUtils.js.map +1 -0
  570. package/dist/esm/utils/LogUtils.d.ts +20 -0
  571. package/dist/esm/utils/LogUtils.js +19 -0
  572. package/dist/esm/utils/LogUtils.js.map +1 -0
  573. package/dist/esm/utils/Multicall.d.ts +13 -0
  574. package/dist/esm/utils/Multicall.js +70 -0
  575. package/dist/esm/utils/Multicall.js.map +1 -0
  576. package/dist/esm/utils/NetworkUtils.d.ts +60 -0
  577. package/dist/esm/utils/NetworkUtils.js +109 -0
  578. package/dist/esm/utils/NetworkUtils.js.map +1 -0
  579. package/dist/esm/utils/NumberUtils.d.ts +12 -0
  580. package/dist/esm/utils/NumberUtils.js +17 -0
  581. package/dist/esm/utils/NumberUtils.js.map +1 -0
  582. package/dist/esm/utils/ObjectUtils.d.ts +10 -0
  583. package/dist/esm/utils/ObjectUtils.js +72 -0
  584. package/dist/esm/utils/ObjectUtils.js.map +1 -0
  585. package/dist/esm/utils/ReviverUtils.d.ts +15 -0
  586. package/dist/esm/utils/ReviverUtils.js +33 -0
  587. package/dist/esm/utils/ReviverUtils.js.map +1 -0
  588. package/dist/esm/utils/SpokeUtils.d.ts +64 -0
  589. package/dist/esm/utils/SpokeUtils.js +370 -0
  590. package/dist/esm/utils/SpokeUtils.js.map +1 -0
  591. package/dist/esm/utils/TimeUtils.d.ts +5 -0
  592. package/dist/esm/utils/TimeUtils.js +8 -0
  593. package/dist/esm/utils/TimeUtils.js.map +1 -0
  594. package/dist/esm/utils/TokenUtils.d.ts +325 -0
  595. package/dist/esm/utils/TokenUtils.js +88 -0
  596. package/dist/esm/utils/TokenUtils.js.map +1 -0
  597. package/dist/esm/utils/TypeGuards.d.ts +3 -0
  598. package/dist/esm/utils/TypeGuards.js +10 -0
  599. package/dist/esm/utils/TypeGuards.js.map +1 -0
  600. package/dist/esm/utils/TypeUtils.d.ts +5 -0
  601. package/dist/esm/utils/TypeUtils.js +2 -0
  602. package/dist/esm/utils/TypeUtils.js.map +1 -0
  603. package/dist/esm/utils/V3Utils.d.ts +4 -0
  604. package/dist/esm/utils/V3Utils.js +10 -0
  605. package/dist/esm/utils/V3Utils.js.map +1 -0
  606. package/dist/esm/utils/ValidatorUtils.d.ts +2 -0
  607. package/dist/esm/utils/ValidatorUtils.js +35 -0
  608. package/dist/esm/utils/ValidatorUtils.js.map +1 -0
  609. package/dist/esm/utils/abi/contracts/Multicall3.json +440 -0
  610. package/dist/esm/utils/abi/index.d.ts +18 -0
  611. package/dist/esm/utils/abi/index.js +41 -0
  612. package/dist/esm/utils/abi/index.js.map +1 -0
  613. package/dist/esm/utils/common.d.ts +204 -0
  614. package/dist/esm/utils/common.js +325 -0
  615. package/dist/esm/utils/common.js.map +1 -0
  616. package/dist/esm/utils/index.d.ts +29 -0
  617. package/dist/esm/utils/index.js +30 -0
  618. package/dist/esm/utils/index.js.map +1 -0
  619. package/dist/types/apiClient/abstractClient.d.ts +67 -0
  620. package/dist/types/apiClient/abstractClient.d.ts.map +1 -0
  621. package/dist/types/apiClient/index.d.ts +3 -0
  622. package/dist/types/apiClient/index.d.ts.map +1 -0
  623. package/dist/types/apiClient/mockedClient.d.ts +25 -0
  624. package/dist/types/apiClient/mockedClient.d.ts.map +1 -0
  625. package/dist/types/apiClient/productionClient.d.ts +17 -0
  626. package/dist/types/apiClient/productionClient.d.ts.map +1 -0
  627. package/dist/types/apiClient/types.d.ts +45 -0
  628. package/dist/types/apiClient/types.d.ts.map +1 -0
  629. package/dist/types/caching/Arweave/ArweaveClient.d.ts +62 -0
  630. package/dist/types/caching/Arweave/ArweaveClient.d.ts.map +1 -0
  631. package/dist/types/caching/Arweave/index.d.ts +2 -0
  632. package/dist/types/caching/Arweave/index.d.ts.map +1 -0
  633. package/dist/types/caching/IPFS/PinataIPFSClient.d.ts +38 -0
  634. package/dist/types/caching/IPFS/PinataIPFSClient.d.ts.map +1 -0
  635. package/dist/types/caching/IPFS/index.d.ts +2 -0
  636. package/dist/types/caching/IPFS/index.d.ts.map +1 -0
  637. package/dist/types/caching/index.d.ts +3 -0
  638. package/dist/types/caching/index.d.ts.map +1 -0
  639. package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +109 -0
  640. package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts.map +1 -0
  641. package/dist/types/clients/AcrossConfigStoreClient/index.d.ts +2 -0
  642. package/dist/types/clients/AcrossConfigStoreClient/index.d.ts.map +1 -0
  643. package/dist/types/clients/BaseAbstractClient.d.ts +52 -0
  644. package/dist/types/clients/BaseAbstractClient.d.ts.map +1 -0
  645. package/dist/types/clients/HubPoolClient.d.ts +135 -0
  646. package/dist/types/clients/HubPoolClient.d.ts.map +1 -0
  647. package/dist/types/clients/SpokePoolClient.d.ts +319 -0
  648. package/dist/types/clients/SpokePoolClient.d.ts.map +1 -0
  649. package/dist/types/clients/index.d.ts +5 -0
  650. package/dist/types/clients/index.d.ts.map +1 -0
  651. package/dist/types/clients/mocks/MockConfigStoreClient.d.ts +21 -0
  652. package/dist/types/clients/mocks/MockConfigStoreClient.d.ts.map +1 -0
  653. package/dist/types/clients/mocks/MockEvents.d.ts +35 -0
  654. package/dist/types/clients/mocks/MockEvents.d.ts.map +1 -0
  655. package/dist/types/clients/mocks/MockHubPoolClient.d.ts +36 -0
  656. package/dist/types/clients/mocks/MockHubPoolClient.d.ts.map +1 -0
  657. package/dist/types/clients/mocks/MockSpokePoolClient.d.ts +39 -0
  658. package/dist/types/clients/mocks/MockSpokePoolClient.d.ts.map +1 -0
  659. package/dist/types/clients/mocks/index.d.ts +4 -0
  660. package/dist/types/clients/mocks/index.d.ts.map +1 -0
  661. package/dist/types/coingecko/Coingecko.d.ts +41 -0
  662. package/dist/types/coingecko/Coingecko.d.ts.map +1 -0
  663. package/dist/types/coingecko/index.d.ts +2 -0
  664. package/dist/types/coingecko/index.d.ts.map +1 -0
  665. package/dist/types/constants.d.ts +30 -0
  666. package/dist/types/constants.d.ts.map +1 -0
  667. package/dist/types/contracts/acrossConfigStore.d.ts +58 -0
  668. package/dist/types/contracts/acrossConfigStore.d.ts.map +1 -0
  669. package/dist/types/contracts/hubPool.d.ts +18 -0
  670. package/dist/types/contracts/hubPool.d.ts.map +1 -0
  671. package/dist/types/contracts/index.d.ts +3 -0
  672. package/dist/types/contracts/index.d.ts.map +1 -0
  673. package/dist/types/contracts/utils.d.ts +24 -0
  674. package/dist/types/contracts/utils.d.ts.map +1 -0
  675. package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts +4 -0
  676. package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts.map +1 -0
  677. package/dist/types/gasPriceOracle/adapters/ethereum.d.ts +5 -0
  678. package/dist/types/gasPriceOracle/adapters/ethereum.d.ts.map +1 -0
  679. package/dist/types/gasPriceOracle/adapters/index.d.ts +4 -0
  680. package/dist/types/gasPriceOracle/adapters/index.d.ts.map +1 -0
  681. package/dist/types/gasPriceOracle/adapters/polygon.d.ts +4 -0
  682. package/dist/types/gasPriceOracle/adapters/polygon.d.ts.map +1 -0
  683. package/dist/types/gasPriceOracle/index.d.ts +3 -0
  684. package/dist/types/gasPriceOracle/index.d.ts.map +1 -0
  685. package/dist/types/gasPriceOracle/oracle.d.ts +11 -0
  686. package/dist/types/gasPriceOracle/oracle.d.ts.map +1 -0
  687. package/dist/types/gasPriceOracle/types.d.ts +9 -0
  688. package/dist/types/gasPriceOracle/types.d.ts.map +1 -0
  689. package/dist/types/gasPriceOracle/util.d.ts +3 -0
  690. package/dist/types/gasPriceOracle/util.d.ts.map +1 -0
  691. package/dist/types/index.d.ts +16 -0
  692. package/dist/types/index.d.ts.map +1 -0
  693. package/dist/types/interfaces/Bridge.d.ts +10 -0
  694. package/dist/types/interfaces/Bridge.d.ts.map +1 -0
  695. package/dist/types/interfaces/CachingMechanism.d.ts +27 -0
  696. package/dist/types/interfaces/CachingMechanism.d.ts.map +1 -0
  697. package/dist/types/interfaces/Common.d.ts +11 -0
  698. package/dist/types/interfaces/Common.d.ts.map +1 -0
  699. package/dist/types/interfaces/ConfigStore.d.ts +158 -0
  700. package/dist/types/interfaces/ConfigStore.d.ts.map +1 -0
  701. package/dist/types/interfaces/Error.d.ts +6 -0
  702. package/dist/types/interfaces/Error.d.ts.map +1 -0
  703. package/dist/types/interfaces/HubPool.d.ts +99 -0
  704. package/dist/types/interfaces/HubPool.d.ts.map +1 -0
  705. package/dist/types/interfaces/SpokePool.d.ts +104 -0
  706. package/dist/types/interfaces/SpokePool.d.ts.map +1 -0
  707. package/dist/types/interfaces/TypedData.d.ts +20 -0
  708. package/dist/types/interfaces/TypedData.d.ts.map +1 -0
  709. package/dist/types/interfaces/index.d.ts +9 -0
  710. package/dist/types/interfaces/index.d.ts.map +1 -0
  711. package/dist/types/lpFeeCalculator/index.d.ts +2 -0
  712. package/dist/types/lpFeeCalculator/index.d.ts.map +1 -0
  713. package/dist/types/lpFeeCalculator/lpFeeCalculator.d.ts +67 -0
  714. package/dist/types/lpFeeCalculator/lpFeeCalculator.d.ts.map +1 -0
  715. package/dist/types/lpFeeCalculator/rateModel.d.ts +46 -0
  716. package/dist/types/lpFeeCalculator/rateModel.d.ts.map +1 -0
  717. package/dist/types/merkleDistributor/MerkleDistributor.d.ts +21 -0
  718. package/dist/types/merkleDistributor/MerkleDistributor.d.ts.map +1 -0
  719. package/dist/types/merkleDistributor/index.d.ts +3 -0
  720. package/dist/types/merkleDistributor/index.d.ts.map +1 -0
  721. package/dist/types/merkleDistributor/model/Distribution.d.ts +18 -0
  722. package/dist/types/merkleDistributor/model/Distribution.d.ts.map +1 -0
  723. package/dist/types/merkleDistributor/model/index.d.ts +2 -0
  724. package/dist/types/merkleDistributor/model/index.d.ts.map +1 -0
  725. package/dist/types/pool/TransactionManager.d.ts +13 -0
  726. package/dist/types/pool/TransactionManager.d.ts.map +1 -0
  727. package/dist/types/pool/index.d.ts +2 -0
  728. package/dist/types/pool/index.d.ts.map +1 -0
  729. package/dist/types/pool/poolClient.d.ts +243 -0
  730. package/dist/types/pool/poolClient.d.ts.map +1 -0
  731. package/dist/types/priceClient/adapters/acrossApi.d.ts +15 -0
  732. package/dist/types/priceClient/adapters/acrossApi.d.ts.map +1 -0
  733. package/dist/types/priceClient/adapters/baseAdapter.d.ts +18 -0
  734. package/dist/types/priceClient/adapters/baseAdapter.d.ts.map +1 -0
  735. package/dist/types/priceClient/adapters/coingecko.d.ts +15 -0
  736. package/dist/types/priceClient/adapters/coingecko.d.ts.map +1 -0
  737. package/dist/types/priceClient/adapters/defiLlama.d.ts +18 -0
  738. package/dist/types/priceClient/adapters/defiLlama.d.ts.map +1 -0
  739. package/dist/types/priceClient/adapters/index.d.ts +4 -0
  740. package/dist/types/priceClient/adapters/index.d.ts.map +1 -0
  741. package/dist/types/priceClient/index.d.ts +3 -0
  742. package/dist/types/priceClient/index.d.ts.map +1 -0
  743. package/dist/types/priceClient/priceClient.d.ts +33 -0
  744. package/dist/types/priceClient/priceClient.d.ts.map +1 -0
  745. package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts +62 -0
  746. package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts.map +1 -0
  747. package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts +152 -0
  748. package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -0
  749. package/dist/types/relayFeeCalculator/chain-queries/index.d.ts +4 -0
  750. package/dist/types/relayFeeCalculator/chain-queries/index.d.ts.map +1 -0
  751. package/dist/types/relayFeeCalculator/chain-queries/polygon.d.ts +153 -0
  752. package/dist/types/relayFeeCalculator/chain-queries/polygon.d.ts.map +1 -0
  753. package/dist/types/relayFeeCalculator/index.d.ts +3 -0
  754. package/dist/types/relayFeeCalculator/index.d.ts.map +1 -0
  755. package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +283 -0
  756. package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -0
  757. package/dist/types/typechain.d.ts +23 -0
  758. package/dist/types/typechain.d.ts.map +1 -0
  759. package/dist/types/typeguards/error.d.ts +4 -0
  760. package/dist/types/typeguards/error.d.ts.map +1 -0
  761. package/dist/types/typeguards/index.d.ts +2 -0
  762. package/dist/types/typeguards/index.d.ts.map +1 -0
  763. package/dist/types/utils/AddressUtils.d.ts +9 -0
  764. package/dist/types/utils/AddressUtils.d.ts.map +1 -0
  765. package/dist/types/utils/ArrayUtils.d.ts +99 -0
  766. package/dist/types/utils/ArrayUtils.d.ts.map +1 -0
  767. package/dist/types/utils/BigNumberUtils.d.ts +32 -0
  768. package/dist/types/utils/BigNumberUtils.d.ts.map +1 -0
  769. package/dist/types/utils/BlockExplorerUtils.d.ts +22 -0
  770. package/dist/types/utils/BlockExplorerUtils.d.ts.map +1 -0
  771. package/dist/types/utils/BlockUtils.d.ts +47 -0
  772. package/dist/types/utils/BlockUtils.d.ts.map +1 -0
  773. package/dist/types/utils/BundleUtils.d.ts +30 -0
  774. package/dist/types/utils/BundleUtils.d.ts.map +1 -0
  775. package/dist/types/utils/CachingUtils.d.ts +18 -0
  776. package/dist/types/utils/CachingUtils.d.ts.map +1 -0
  777. package/dist/types/utils/DeploymentUtils.d.ts +2 -0
  778. package/dist/types/utils/DeploymentUtils.d.ts.map +1 -0
  779. package/dist/types/utils/DepositUtils.d.ts +47 -0
  780. package/dist/types/utils/DepositUtils.d.ts.map +1 -0
  781. package/dist/types/utils/EventUtils.d.ts +33 -0
  782. package/dist/types/utils/EventUtils.d.ts.map +1 -0
  783. package/dist/types/utils/FlowUtils.d.ts +9 -0
  784. package/dist/types/utils/FlowUtils.d.ts.map +1 -0
  785. package/dist/types/utils/FormattingUtils.d.ts +62 -0
  786. package/dist/types/utils/FormattingUtils.d.ts.map +1 -0
  787. package/dist/types/utils/IPFSUtils.d.ts +25 -0
  788. package/dist/types/utils/IPFSUtils.d.ts.map +1 -0
  789. package/dist/types/utils/JSONUtils.d.ts +32 -0
  790. package/dist/types/utils/JSONUtils.d.ts.map +1 -0
  791. package/dist/types/utils/LogUtils.d.ts +21 -0
  792. package/dist/types/utils/LogUtils.d.ts.map +1 -0
  793. package/dist/types/utils/Multicall.d.ts +14 -0
  794. package/dist/types/utils/Multicall.d.ts.map +1 -0
  795. package/dist/types/utils/NetworkUtils.d.ts +61 -0
  796. package/dist/types/utils/NetworkUtils.d.ts.map +1 -0
  797. package/dist/types/utils/NumberUtils.d.ts +13 -0
  798. package/dist/types/utils/NumberUtils.d.ts.map +1 -0
  799. package/dist/types/utils/ObjectUtils.d.ts +11 -0
  800. package/dist/types/utils/ObjectUtils.d.ts.map +1 -0
  801. package/dist/types/utils/ReviverUtils.d.ts +16 -0
  802. package/dist/types/utils/ReviverUtils.d.ts.map +1 -0
  803. package/dist/types/utils/SpokeUtils.d.ts +65 -0
  804. package/dist/types/utils/SpokeUtils.d.ts.map +1 -0
  805. package/dist/types/utils/TimeUtils.d.ts +6 -0
  806. package/dist/types/utils/TimeUtils.d.ts.map +1 -0
  807. package/dist/types/utils/TokenUtils.d.ts +326 -0
  808. package/dist/types/utils/TokenUtils.d.ts.map +1 -0
  809. package/dist/types/utils/TypeGuards.d.ts +4 -0
  810. package/dist/types/utils/TypeGuards.d.ts.map +1 -0
  811. package/dist/types/utils/TypeUtils.d.ts +6 -0
  812. package/dist/types/utils/TypeUtils.d.ts.map +1 -0
  813. package/dist/types/utils/V3Utils.d.ts +5 -0
  814. package/dist/types/utils/V3Utils.d.ts.map +1 -0
  815. package/dist/types/utils/ValidatorUtils.d.ts +3 -0
  816. package/dist/types/utils/ValidatorUtils.d.ts.map +1 -0
  817. package/dist/types/utils/abi/index.d.ts +19 -0
  818. package/dist/types/utils/abi/index.d.ts.map +1 -0
  819. package/dist/types/utils/common.d.ts +205 -0
  820. package/dist/types/utils/common.d.ts.map +1 -0
  821. package/dist/types/utils/index.d.ts +30 -0
  822. package/dist/types/utils/index.d.ts.map +1 -0
  823. package/package.json +144 -0
  824. package/src/apiClient/abstractClient.ts +95 -0
  825. package/src/apiClient/index.ts +2 -0
  826. package/src/apiClient/mockedClient.ts +90 -0
  827. package/src/apiClient/productionClient.ts +98 -0
  828. package/src/apiClient/types.ts +49 -0
  829. package/src/caching/Arweave/ArweaveClient.ts +238 -0
  830. package/src/caching/Arweave/index.ts +1 -0
  831. package/src/caching/IPFS/PinataIPFSClient.ts +92 -0
  832. package/src/caching/IPFS/index.ts +1 -0
  833. package/src/caching/index.ts +2 -0
  834. package/src/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.ts +526 -0
  835. package/src/clients/AcrossConfigStoreClient/index.ts +1 -0
  836. package/src/clients/BaseAbstractClient.ts +94 -0
  837. package/src/clients/HubPoolClient.ts +1010 -0
  838. package/src/clients/SpokePoolClient.ts +894 -0
  839. package/src/clients/index.ts +9 -0
  840. package/src/clients/mocks/MockConfigStoreClient.ts +129 -0
  841. package/src/clients/mocks/MockEvents.ts +156 -0
  842. package/src/clients/mocks/MockHubPoolClient.ts +257 -0
  843. package/src/clients/mocks/MockSpokePoolClient.ts +341 -0
  844. package/src/clients/mocks/index.ts +3 -0
  845. package/src/coingecko/Coingecko.ts +277 -0
  846. package/src/coingecko/index.ts +1 -0
  847. package/src/constants.ts +53 -0
  848. package/src/contracts/acrossConfigStore.ts +49 -0
  849. package/src/contracts/hubPool.ts +90 -0
  850. package/src/contracts/index.ts +2 -0
  851. package/src/contracts/utils.ts +56 -0
  852. package/src/gasPriceOracle/adapters/arbitrum.ts +21 -0
  853. package/src/gasPriceOracle/adapters/ethereum.ts +27 -0
  854. package/src/gasPriceOracle/adapters/index.ts +3 -0
  855. package/src/gasPriceOracle/adapters/polygon.ts +77 -0
  856. package/src/gasPriceOracle/index.ts +2 -0
  857. package/src/gasPriceOracle/oracle.ts +42 -0
  858. package/src/gasPriceOracle/types.ts +10 -0
  859. package/src/gasPriceOracle/util.ts +5 -0
  860. package/src/index.ts +15 -0
  861. package/src/interfaces/Bridge.ts +10 -0
  862. package/src/interfaces/CachingMechanism.ts +37 -0
  863. package/src/interfaces/Common.ts +12 -0
  864. package/src/interfaces/ConfigStore.ts +173 -0
  865. package/src/interfaces/Error.ts +5 -0
  866. package/src/interfaces/HubPool.ts +118 -0
  867. package/src/interfaces/SpokePool.ts +119 -0
  868. package/src/interfaces/TypedData.ts +21 -0
  869. package/src/interfaces/index.ts +8 -0
  870. package/src/lpFeeCalculator/README.md +27 -0
  871. package/src/lpFeeCalculator/index.ts +1 -0
  872. package/src/lpFeeCalculator/lpFeeCalculator.ts +169 -0
  873. package/src/lpFeeCalculator/rateModel.ts +183 -0
  874. package/src/merkleDistributor/MerkleDistributor.ts +37 -0
  875. package/src/merkleDistributor/README.md +30 -0
  876. package/src/merkleDistributor/index.ts +2 -0
  877. package/src/merkleDistributor/model/Distribution.ts +17 -0
  878. package/src/merkleDistributor/model/index.ts +1 -0
  879. package/src/pool/TransactionManager.ts +73 -0
  880. package/src/pool/index.ts +1 -0
  881. package/src/pool/poolClient.ts +840 -0
  882. package/src/priceClient/README.md +36 -0
  883. package/src/priceClient/adapters/acrossApi.ts +44 -0
  884. package/src/priceClient/adapters/baseAdapter.ts +65 -0
  885. package/src/priceClient/adapters/coingecko.ts +67 -0
  886. package/src/priceClient/adapters/defiLlama.ts +96 -0
  887. package/src/priceClient/adapters/index.ts +3 -0
  888. package/src/priceClient/index.ts +2 -0
  889. package/src/priceClient/priceClient.ts +192 -0
  890. package/src/relayFeeCalculator/README.md +34 -0
  891. package/src/relayFeeCalculator/chain-queries/baseQuery.ts +98 -0
  892. package/src/relayFeeCalculator/chain-queries/factory.ts +58 -0
  893. package/src/relayFeeCalculator/chain-queries/index.ts +3 -0
  894. package/src/relayFeeCalculator/chain-queries/polygon.ts +45 -0
  895. package/src/relayFeeCalculator/index.ts +2 -0
  896. package/src/relayFeeCalculator/relayFeeCalculator.ts +410 -0
  897. package/src/typechain.ts +46 -0
  898. package/src/typeguards/error.ts +7 -0
  899. package/src/typeguards/index.ts +1 -0
  900. package/src/utils/AddressUtils.ts +18 -0
  901. package/src/utils/ArrayUtils.ts +170 -0
  902. package/src/utils/BigNumberUtils.ts +58 -0
  903. package/src/utils/BlockExplorerUtils.ts +91 -0
  904. package/src/utils/BlockUtils.ts +265 -0
  905. package/src/utils/BundleUtils.ts +109 -0
  906. package/src/utils/CachingUtils.ts +56 -0
  907. package/src/utils/DeploymentUtils.ts +5 -0
  908. package/src/utils/DepositUtils.ts +144 -0
  909. package/src/utils/EventUtils.ts +227 -0
  910. package/src/utils/FlowUtils.ts +48 -0
  911. package/src/utils/FormattingUtils.ts +186 -0
  912. package/src/utils/IPFSUtils.ts +48 -0
  913. package/src/utils/JSONUtils.ts +85 -0
  914. package/src/utils/LogUtils.ts +38 -0
  915. package/src/utils/Multicall.ts +64 -0
  916. package/src/utils/NetworkUtils.ts +117 -0
  917. package/src/utils/NumberUtils.ts +17 -0
  918. package/src/utils/ObjectUtils.ts +77 -0
  919. package/src/utils/ReviverUtils.ts +31 -0
  920. package/src/utils/SpokeUtils.ts +372 -0
  921. package/src/utils/TimeUtils.ts +7 -0
  922. package/src/utils/TokenUtils.ts +94 -0
  923. package/src/utils/TypeGuards.ts +15 -0
  924. package/src/utils/TypeUtils.ts +9 -0
  925. package/src/utils/V3Utils.ts +12 -0
  926. package/src/utils/ValidatorUtils.ts +38 -0
  927. package/src/utils/abi/contracts/Multicall3.json +440 -0
  928. package/src/utils/abi/index.ts +33 -0
  929. package/src/utils/common.ts +392 -0
  930. package/src/utils/index.ts +29 -0
@@ -0,0 +1,109 @@
1
+ import { AcrossConfigStoreClient, HubPoolClient } from "../clients";
2
+ import { ProposedRootBundle } from "../interfaces";
3
+
4
+ /**
5
+ * Return block number for `chain` in `bundleEvaluationBlockNumbers` using the mapping
6
+ * in `chainIdListForBundleEvaluationBlockNumbers` to figure out which index in `bundleEvaluationBlockNumbers`
7
+ * the block for `chain` is
8
+ * @param bundleEvaluationBlockNumbers Usually, the bundle end blocks proposed in a root bundle.
9
+ * @param chain The chain to look up block for
10
+ * @param chainIdListForBundleEvaluationBlockNumbers The hardcoded sequence of chain IDs. For example:
11
+ * [1, 10, 137, 288, 42161] implies that if we're looking for the block for chain 137, it's at index 2 in
12
+ * `bundleEvaluationBlockNumbers`.
13
+ * @returns The block for `chain` in `bundleEvaluationBlockNumbers`.
14
+ */
15
+ export function getBlockForChain(
16
+ bundleEvaluationBlockNumbers: number[],
17
+ chain: number,
18
+ chainIdListForBundleEvaluationBlockNumbers: number[]
19
+ ): number {
20
+ const indexForChain = chainIdListForBundleEvaluationBlockNumbers.indexOf(chain);
21
+ if (indexForChain === -1) {
22
+ throw new Error(`Could not find chain ${chain} in chain ID list ${chainIdListForBundleEvaluationBlockNumbers}`);
23
+ }
24
+ const blockForChain = bundleEvaluationBlockNumbers[indexForChain];
25
+ if (blockForChain === undefined) {
26
+ throw new Error(`Invalid block range for chain ${chain}`);
27
+ }
28
+ return blockForChain;
29
+ }
30
+
31
+ /**
32
+ * Similar concept as `getBlockForChain`, but returns the block range for `chain` in `blockRanges`.
33
+ * @param blockRanges
34
+ * @param chain
35
+ * @param chainIdListForBundleEvaluationBlockNumbers
36
+ * @returns
37
+ */
38
+ export function getBlockRangeForChain(
39
+ blockRanges: number[][],
40
+ chain: number,
41
+ chainIdListForBundleEvaluationBlockNumbers: number[]
42
+ ): number[] {
43
+ const indexForChain = chainIdListForBundleEvaluationBlockNumbers.indexOf(chain);
44
+ if (indexForChain === -1) {
45
+ throw new Error(`Could not find chain ${chain} in chain ID list ${chainIdListForBundleEvaluationBlockNumbers}`);
46
+ }
47
+ const blockRangeForChain = blockRanges[indexForChain];
48
+ if (!blockRangeForChain || blockRangeForChain.length !== 2) {
49
+ throw new Error(`Invalid block range for chain ${chain}`);
50
+ }
51
+ return blockRangeForChain;
52
+ }
53
+
54
+ /**
55
+ * Return bundle block range for `rootBundle` whose bundle end blocks were included in the proposal.
56
+ * This amounts to reconstructing the bundle range start block.
57
+ * @param rootBundle Root bundle to return bundle block range for
58
+ * @returns blockRanges: number[][], [[startBlock, endBlock], [startBlock, endBlock], ...]
59
+ */
60
+ export function getImpliedBundleBlockRanges(
61
+ hubPoolClient: HubPoolClient,
62
+ configStoreClient: AcrossConfigStoreClient,
63
+ rootBundle: ProposedRootBundle
64
+ ): number[][] {
65
+ const prevRootBundle = hubPoolClient.getLatestFullyExecutedRootBundle(rootBundle.blockNumber);
66
+ // If chain is disabled for this bundle block range, end block should be same as previous bundle.
67
+ // Otherwise the range should be previous bundle's endBlock + 1 to current bundle's end block.
68
+
69
+ // Get enabled chains at the mainnet start block of the current root bundle.
70
+ // We'll check each chain represented in the bundleEvaluationBlockNumbers to see if it's enabled and
71
+ // use that to determine the implied block range.
72
+ const mainnetStartBlock = prevRootBundle?.bundleEvaluationBlockNumbers[0].toNumber() ?? 0;
73
+ const enabledChainsAtMainnetStartBlock = configStoreClient.getEnabledChains(mainnetStartBlock);
74
+
75
+ // Load all chain indices in order to map bundle evaluation block numbers to enabled chains list.
76
+ const chainIdIndices = configStoreClient.getChainIdIndicesForBlock(rootBundle.blockNumber);
77
+ const result = rootBundle.bundleEvaluationBlockNumbers.map((endBlock, i) => {
78
+ const fromBlock = prevRootBundle?.bundleEvaluationBlockNumbers?.[i]
79
+ ? prevRootBundle.bundleEvaluationBlockNumbers[i].toNumber() + 1
80
+ : 0;
81
+ const chainId = chainIdIndices[i];
82
+ if (!enabledChainsAtMainnetStartBlock.includes(chainId)) {
83
+ return [endBlock.toNumber(), endBlock.toNumber()];
84
+ }
85
+ return [fromBlock, endBlock.toNumber()];
86
+ });
87
+
88
+ // Lastly, sanity check the results to catch errors early:
89
+ // 1. If the chain is enabled, the start block should be strictly less than to the end block.
90
+ // 2. If the chain is disabled, the start block should be equal to the end block.
91
+ result.forEach(([start, end], i) => {
92
+ const chainId = chainIdIndices[i];
93
+ if (enabledChainsAtMainnetStartBlock.includes(chainId)) {
94
+ if (start >= end) {
95
+ throw new Error(
96
+ `Invalid block range for enabled chain ${chainId}: start block ${start} is greater than or equal to end block ${end}`
97
+ );
98
+ }
99
+ } else {
100
+ if (start !== end) {
101
+ throw new Error(
102
+ `Invalid block range for disabled chain ${chainId}: start block ${start} is not equal to end block ${end}`
103
+ );
104
+ }
105
+ }
106
+ });
107
+
108
+ return result;
109
+ }
@@ -0,0 +1,56 @@
1
+ import { DEFAULT_CACHING_SAFE_LAG, DEFAULT_CACHING_TTL } from "../constants";
2
+ import { CachingMechanismInterface, Deposit, Fill, SlowFillRequest } from "../interfaces";
3
+ import { assert } from "./LogUtils";
4
+ import { composeRevivers, objectWithBigNumberReviver } from "./ReviverUtils";
5
+ import { getRelayHashFromEvent } from "./SpokeUtils";
6
+ import { getCurrentTime } from "./TimeUtils";
7
+ import { isDefined } from "./TypeGuards";
8
+
9
+ export function shouldCache(eventTimestamp: number, latestTime: number, cachingMaxAge: number): boolean {
10
+ assert(eventTimestamp.toString().length === 10, "eventTimestamp must be in seconds");
11
+ assert(latestTime.toString().length === 10, "eventTimestamp must be in seconds");
12
+ return latestTime - eventTimestamp >= cachingMaxAge;
13
+ }
14
+
15
+ /**
16
+ * Calls the cache's get method and returns the result if it is defined, otherwise returns undefined.
17
+ * @param key The key to get from the cache.
18
+ * @param cache The cache to get the key from.
19
+ * @returns The value associated with the key in the cache, or undefined if the key is not in the cache.
20
+ */
21
+ export async function getDepositInCache(key: string, cache: CachingMechanismInterface): Promise<Deposit | undefined> {
22
+ const depositRaw = await cache.get<string>(key);
23
+ return isDefined(depositRaw) ? JSON.parse(depositRaw, composeRevivers(objectWithBigNumberReviver)) : undefined;
24
+ }
25
+
26
+ export async function setDepositInCache(
27
+ deposit: Deposit,
28
+ currentChainTime: number,
29
+ cache: CachingMechanismInterface,
30
+ expirySeconds = DEFAULT_CACHING_TTL,
31
+ timeToCache = DEFAULT_CACHING_SAFE_LAG
32
+ ): Promise<void> {
33
+ const currentTimeInSeconds = getCurrentTime();
34
+ // We should first confirm that neither the deposit's quoteTimestamp nor the currentChainTime
35
+ // are in the future. If they are, we should not cache the deposit.
36
+ if (deposit.quoteTimestamp > currentTimeInSeconds || currentChainTime > currentTimeInSeconds) {
37
+ return;
38
+ }
39
+
40
+ // We should note here that the user can theoretically set the deposit's quoteTimestamp
41
+ // to whatever they want. As a result, this could be used to manipulate the caching mechanism.
42
+ if (shouldCache(deposit.quoteTimestamp, currentChainTime, timeToCache)) {
43
+ await cache.set(getDepositKey(deposit), JSON.stringify(deposit), expirySeconds);
44
+ }
45
+ }
46
+
47
+ /**
48
+ * Resolves the key for caching a bridge event.
49
+ * @param bridgeEvent The depositId, and originChainId are used to generate the key for v2, and the
50
+ * full V3 relay hash is used for v3 events..
51
+ * @returns The key for caching the event.
52
+ */
53
+ export function getDepositKey(bridgeEvent: Deposit | Fill | SlowFillRequest): string {
54
+ const relayHash = getRelayHashFromEvent(bridgeEvent);
55
+ return `deposit_${bridgeEvent.originChainId}_${bridgeEvent.depositId}_${relayHash}`;
56
+ }
@@ -0,0 +1,5 @@
1
+ export {
2
+ getContractInfoFromAddress,
3
+ getDeployedAddress,
4
+ getDeployedBlockNumber,
5
+ } from "@across-protocol/contracts/dist/src/DeploymentUtils";
@@ -0,0 +1,144 @@
1
+ import assert from "assert";
2
+ import { SpokePoolClient } from "../clients";
3
+ import { DEFAULT_CACHING_TTL, EMPTY_MESSAGE } from "../constants";
4
+ import { CachingMechanismInterface, Deposit, DepositWithBlock, Fill, SlowFillRequest } from "../interfaces";
5
+ import { getNetworkName } from "./NetworkUtils";
6
+ import { getDepositInCache, getDepositKey, setDepositInCache } from "./CachingUtils";
7
+ import { validateFillForDeposit } from "./FlowUtils";
8
+ import { getCurrentTime } from "./TimeUtils";
9
+ import { isDefined } from "./TypeGuards";
10
+ import { isDepositFormedCorrectly } from "./ValidatorUtils";
11
+
12
+ // Load a deposit for a fill if the fill's deposit ID is outside this client's search range.
13
+ // This can be used by the Dataworker to determine whether to give a relayer a refund for a fill
14
+ // of a deposit older or younger than its fixed lookback.
15
+
16
+ export enum InvalidFill {
17
+ DepositIdInvalid = 0, // Deposit ID seems invalid for origin SpokePool
18
+ DepositIdNotFound, // Deposit ID not found (bad RPC data?)
19
+ FillMismatch, // Fill does not match deposit parameters for deposit ID.
20
+ }
21
+
22
+ export type DepositSearchResult =
23
+ | { found: true; deposit: DepositWithBlock }
24
+ | { found: false; code: InvalidFill; reason: string };
25
+
26
+ /**
27
+ * Attempts to resolve a deposit for a fill. If the fill's deposit Id is within the spoke pool client's search range,
28
+ * the deposit is returned immediately. Otherwise, the deposit is queried first from the provided cache, and if it is
29
+ * not found in the cache, it is queried from the spoke pool client. If the deposit is found, it is cached before
30
+ * being returned.
31
+ * @param spokePoolClient The spoke pool client to use to query the deposit.
32
+ * @param fill The fill to resolve a deposit for.
33
+ * @param cache An optional cache to use to store the deposit. Optional.
34
+ * @returns The deposit for the fill, or undefined if the deposit could not be found.
35
+ * @throws If the fill's origin chain ID does not match the spoke pool client's chain ID.
36
+ * @throws If the spoke pool client has not been updated.
37
+ */
38
+ export async function queryHistoricalDepositForFill(
39
+ spokePoolClient: SpokePoolClient,
40
+ fill: Fill | SlowFillRequest,
41
+ cache?: CachingMechanismInterface
42
+ ): Promise<DepositSearchResult> {
43
+ if (fill.originChainId !== spokePoolClient.chainId) {
44
+ throw new Error(`OriginChainId mismatch (${fill.originChainId} != ${spokePoolClient.chainId})`);
45
+ }
46
+
47
+ // We need to update client so we know the first and last deposit ID's queried for this spoke pool client, as well
48
+ // as the global first and last deposit ID's for this spoke pool.
49
+ if (!spokePoolClient.isUpdated) {
50
+ throw new Error("SpokePoolClient must be updated before querying historical deposits");
51
+ }
52
+
53
+ const { depositId } = fill;
54
+ let { firstDepositIdForSpokePool: lowId, lastDepositIdForSpokePool: highId } = spokePoolClient;
55
+ if (depositId < lowId || depositId > highId) {
56
+ return {
57
+ found: false,
58
+ code: InvalidFill.DepositIdInvalid,
59
+ reason: `Deposit ID ${depositId} is outside of SpokePool bounds [${lowId},${highId}].`,
60
+ };
61
+ }
62
+
63
+ ({ earliestDepositIdQueried: lowId, latestDepositIdQueried: highId } = spokePoolClient);
64
+ if (depositId >= lowId && depositId <= highId) {
65
+ const deposit = spokePoolClient.getDeposit(depositId);
66
+ if (isDefined(deposit) && validateFillForDeposit(fill, deposit)) {
67
+ return { found: true, deposit };
68
+ }
69
+
70
+ return {
71
+ found: false,
72
+ code: isDefined(deposit) ? InvalidFill.FillMismatch : InvalidFill.DepositIdNotFound,
73
+ reason: `Deposit ID ${depositId} not found in SpokePoolClient event buffer.`,
74
+ };
75
+ }
76
+
77
+ let deposit: DepositWithBlock, cachedDeposit: Deposit | undefined;
78
+ if (cache) {
79
+ cachedDeposit = await getDepositInCache(getDepositKey(fill), cache);
80
+ // We only want to warn and remove the cached deposit if it
81
+ // A: exists
82
+ // B: is not formed correctly
83
+ if (isDefined(cachedDeposit) && !isDepositFormedCorrectly(cachedDeposit)) {
84
+ spokePoolClient.logger.warn({
85
+ at: "[SDK]:DepositUtils#queryHistoricalDepositForFill",
86
+ message: "Cached deposit was not formed correctly, removing from cache",
87
+ fill,
88
+ cachedDeposit,
89
+ });
90
+ // By setting this value to undefined, we eventually have to pull
91
+ // the deposit from our spoke pool client. Because this new deposit
92
+ // is formed correctly, we will cache it below.
93
+ cachedDeposit = undefined;
94
+ }
95
+ }
96
+
97
+ if (isDefined(cachedDeposit)) {
98
+ deposit = cachedDeposit as DepositWithBlock;
99
+ } else {
100
+ deposit = await spokePoolClient.findDeposit(fill.depositId, fill.destinationChainId, fill.depositor);
101
+ if (cache) {
102
+ await setDepositInCache(deposit, getCurrentTime(), cache, DEFAULT_CACHING_TTL);
103
+ }
104
+ }
105
+
106
+ if (validateFillForDeposit(fill, deposit)) {
107
+ return { found: true, deposit };
108
+ }
109
+
110
+ return {
111
+ found: false,
112
+ code: InvalidFill.FillMismatch,
113
+ reason: `Fill is not valid for ${getNetworkName(deposit.originChainId)} deposit ${depositId}`,
114
+ };
115
+ }
116
+
117
+ /**
118
+ * Determines if a message is empty or not.
119
+ * @param message The message to check.
120
+ * @returns True if the message is empty, false otherwise.
121
+ */
122
+ export function isMessageEmpty(message = EMPTY_MESSAGE): boolean {
123
+ return message === "" || message === "0x";
124
+ }
125
+
126
+ /**
127
+ * Determines if a deposit was updated via a speed-up transaction.
128
+ * @param deposit Deposit to evaluate.
129
+ * @returns True if the deposit was updated, otherwise false.
130
+ */
131
+ export function isDepositSpedUp(deposit: Deposit): boolean {
132
+ return isDefined(deposit.speedUpSignature) && isDefined(deposit.updatedOutputAmount);
133
+ }
134
+
135
+ /**
136
+ * Resolves the applicable message for a deposit.
137
+ * @param deposit Deposit to evaluate.
138
+ * @returns Original or updated message string, depending on whether the depositor updated the deposit.
139
+ */
140
+ export function resolveDepositMessage(deposit: Deposit): string {
141
+ const message = isDepositSpedUp(deposit) ? deposit.updatedMessage : deposit.message;
142
+ assert(isDefined(message)); // Appease tsc about the updatedMessage being possibly undefined.
143
+ return message;
144
+ }
@@ -0,0 +1,227 @@
1
+ import { Result } from "@ethersproject/abi";
2
+ import { delay } from "./common";
3
+ import { SortableEvent } from "../interfaces";
4
+ import { Contract, Event, EventFilter } from "ethers";
5
+
6
+ const maxRetries = 3;
7
+ const retrySleepTime = 10;
8
+
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ export function spreadEvent(args: Result = {} as Result): any {
11
+ const keys = Object.keys(args).filter((key: string) => isNaN(+key)); // Extract non-numeric keys.
12
+
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
+ const returnedObject: any = {};
15
+ keys.forEach((key: string) => {
16
+ switch (typeof args[key]) {
17
+ case "boolean": // fallthrough
18
+ case "number":
19
+ case "string":
20
+ returnedObject[key] = args[key];
21
+ break;
22
+ case "object":
23
+ if (Array.isArray(args[key])) {
24
+ returnedObject[key] =
25
+ Object.keys(args[key]).filter((key: string) => isNaN(+key)).length > 0
26
+ ? spreadEvent(args[key]) // Record/array hybrid...
27
+ : args[key]; // Just an array
28
+ } else {
29
+ returnedObject[key] = args[key];
30
+ }
31
+ break;
32
+ }
33
+ });
34
+
35
+ // ID information, if included in an event, should be cast to a number rather than a BigNumber.
36
+ if (returnedObject.groupIndex) {
37
+ returnedObject.groupIndex = Number(returnedObject.groupIndex);
38
+ }
39
+ if (returnedObject.leafId) {
40
+ returnedObject.leafId = Number(returnedObject.leafId);
41
+ }
42
+ if (returnedObject.chainId) {
43
+ returnedObject.chainId = Number(returnedObject.chainId);
44
+ }
45
+ if (returnedObject.destinationChainId) {
46
+ returnedObject.destinationChainId = Number(returnedObject.destinationChainId);
47
+ }
48
+ if (returnedObject.originChainId) {
49
+ returnedObject.originChainId = Number(returnedObject.originChainId);
50
+ }
51
+ if (returnedObject.repaymentChainId) {
52
+ returnedObject.repaymentChainId = Number(returnedObject.repaymentChainId);
53
+ }
54
+ if (returnedObject.l2ChainId) {
55
+ returnedObject.l2ChainId = Number(returnedObject.l2ChainId);
56
+ }
57
+ if (returnedObject.rootBundleId) {
58
+ returnedObject.rootBundleId = Number(returnedObject.rootBundleId);
59
+ }
60
+
61
+ return returnedObject;
62
+ }
63
+
64
+ export interface EventSearchConfig {
65
+ fromBlock: number;
66
+ toBlock: number;
67
+ maxBlockLookBack?: number;
68
+ }
69
+
70
+ export async function paginatedEventQuery(
71
+ contract: Contract,
72
+ filter: EventFilter,
73
+ searchConfig: EventSearchConfig,
74
+ retryCount = 0
75
+ ): Promise<Event[]> {
76
+ // If the max block look back is set to 0 then we dont need to do any pagination and can query over the whole range.
77
+ if (searchConfig.maxBlockLookBack === 0) {
78
+ return await contract.queryFilter(filter, searchConfig.fromBlock, searchConfig.toBlock);
79
+ }
80
+
81
+ // Compute the number of queries needed. If there is no maxBlockLookBack set then we can execute the whole query in
82
+ // one go. Else, the number of queries is the range over which we are searching, divided by the maxBlockLookBack,
83
+ // rounded up. This gives us the number of queries we need to execute to traverse the whole block range.
84
+ const paginatedRanges = getPaginatedBlockRanges(searchConfig);
85
+
86
+ try {
87
+ return (
88
+ (
89
+ await Promise.all(
90
+ paginatedRanges.map(([fromBlock, toBlock]) => contract.queryFilter(filter, fromBlock, toBlock))
91
+ )
92
+ )
93
+ .flat()
94
+ // Filter events by block number because ranges can include blocks that are outside the range specified for caching reasons.
95
+ .filter((event) => event.blockNumber >= searchConfig.fromBlock && event.blockNumber <= searchConfig.toBlock)
96
+ );
97
+ } catch (error) {
98
+ if (retryCount < maxRetries) {
99
+ await delay(retrySleepTime);
100
+ return await paginatedEventQuery(contract, filter, searchConfig, retryCount + 1);
101
+ } else {
102
+ throw error;
103
+ }
104
+ }
105
+ }
106
+
107
+ /**
108
+ * @dev Warning: this is a specialized function!! Its functionality is not obvious.
109
+ * This function attempts to return block ranges to repeat ranges as much as possible. To do so, it may include blocks that
110
+ * are outside the provided range. The guarantee is that it will always include _at least_ the blocks requested.
111
+ * @param eventSearchConfig contains fromBlock, toBlock, and maxBlockLookBack.
112
+ * The range is inclusive, so the results will include events in the fromBlock and in the toBlock.
113
+ * maxBlockLookback defined the maximum number of blocks to search. Because the range is inclusive, the maximum diff
114
+ * in the returned pairs is maxBlockLookBack - 1. This is a bit non-intuitive here, but this is meant so that this
115
+ * parameter more closely aligns with the more commonly understood definition of a max query range that node providers
116
+ * use.
117
+ * @returns an array of disjoint fromBlock, toBlock ranges that should be queried. These cover at least the entire
118
+ * input range, but can include blocks outside of the desired range, so results should be filtered. Results
119
+ * are ordered from smallest to largest.
120
+ */
121
+ export function getPaginatedBlockRanges({
122
+ fromBlock,
123
+ toBlock,
124
+ maxBlockLookBack,
125
+ }: EventSearchConfig): [number, number][] {
126
+ // If the maxBlockLookBack is undefined, we can look back as far as we like. Just return the entire range.
127
+ if (maxBlockLookBack === undefined) {
128
+ return [[fromBlock, toBlock]];
129
+ }
130
+
131
+ // If the fromBlock is > toBlock, then return no ranges.
132
+ if (fromBlock > toBlock) {
133
+ return [];
134
+ }
135
+
136
+ // A maxBlockLookBack of 0 is not allowed.
137
+ if (maxBlockLookBack <= 0) {
138
+ throw new Error("Cannot set maxBlockLookBack <= 0");
139
+ }
140
+
141
+ // Floor the requestedFromBlock to the nearest smaller multiple of the maxBlockLookBack to enhance caching.
142
+ // This means that a range like 5 - 45 with a maxBlockLookBack of 20 would look like:
143
+ // 0-19, 20-39, 40-45.
144
+ // This allows us to get the max number of repeated node queries. The maximum number of "nonstandard" queries per
145
+ // call of this function is 1.
146
+ const flooredStartBlock = Math.floor(fromBlock / maxBlockLookBack) * maxBlockLookBack;
147
+
148
+ // Note: range is inclusive, so we have to add one to the number of blocks to query.
149
+ const iterations = Math.ceil((toBlock + 1 - flooredStartBlock) / maxBlockLookBack);
150
+
151
+ const ranges: [number, number][] = [];
152
+ for (let i = 0; i < iterations; i++) {
153
+ // Each inner range start is just a multiple of the maxBlockLookBack added to the start block.
154
+ const innerFromBlock = flooredStartBlock + maxBlockLookBack * i;
155
+
156
+ // The innerFromBlock is just the max range from the innerFromBlock or the outer toBlock, whichever is smaller.
157
+ // The end block should never be larger than the outer toBlock. This is to avoid querying blocks that are in the
158
+ // future.
159
+ const innerToBlock = Math.min(innerFromBlock + maxBlockLookBack - 1, toBlock);
160
+ ranges.push([innerFromBlock, innerToBlock]);
161
+ }
162
+
163
+ return ranges;
164
+ }
165
+
166
+ export function spreadEventWithBlockNumber(event: Event): SortableEvent {
167
+ return {
168
+ ...spreadEvent(event.args),
169
+ blockNumber: event.blockNumber,
170
+ transactionIndex: event.transactionIndex,
171
+ logIndex: event.logIndex,
172
+ transactionHash: event.transactionHash,
173
+ };
174
+ }
175
+
176
+ // This copies the array and sorts it, returning a new array with the new ordering.
177
+ export function sortEventsAscending<T extends SortableEvent>(events: T[]): T[] {
178
+ return sortEventsAscendingInPlace([...events]);
179
+ }
180
+
181
+ // This sorts the events in place, meaning it modifies the passed array and returns a reference to the same array.
182
+ // Note: this method should only be used in cases where modifications are acceptable.
183
+ export function sortEventsAscendingInPlace<T extends SortableEvent>(events: T[]): T[] {
184
+ return events.sort((ex, ey) => {
185
+ if (ex.blockNumber !== ey.blockNumber) {
186
+ return ex.blockNumber - ey.blockNumber;
187
+ }
188
+ if (ex.transactionIndex !== ey.transactionIndex) {
189
+ return ex.transactionIndex - ey.transactionIndex;
190
+ }
191
+ return ex.logIndex - ey.logIndex;
192
+ });
193
+ }
194
+
195
+ // This copies the array and sorts it, returning a new array with the new ordering.
196
+ export function sortEventsDescending<T extends SortableEvent>(events: T[]): T[] {
197
+ return sortEventsDescendingInPlace([...events]);
198
+ }
199
+
200
+ // This sorts the events in place, meaning it modifies the passed array and returns a reference to the same array.
201
+ // Note: this method should only be used in cases where modifications are acceptable.
202
+ export function sortEventsDescendingInPlace<T extends SortableEvent>(events: T[]): T[] {
203
+ return events.sort((ex, ey) => {
204
+ if (ex.blockNumber !== ey.blockNumber) {
205
+ return ey.blockNumber - ex.blockNumber;
206
+ }
207
+ if (ex.transactionIndex !== ey.transactionIndex) {
208
+ return ey.transactionIndex - ex.transactionIndex;
209
+ }
210
+ return ey.logIndex - ex.logIndex;
211
+ });
212
+ }
213
+
214
+ // Returns true if ex is older than ey.
215
+ export function isEventOlder<T extends SortableEvent>(ex: T, ey: T): boolean {
216
+ if (ex.blockNumber !== ey.blockNumber) {
217
+ return ex.blockNumber < ey.blockNumber;
218
+ }
219
+ if (ex.transactionIndex !== ey.transactionIndex) {
220
+ return ex.transactionIndex < ey.transactionIndex;
221
+ }
222
+ return ex.logIndex < ey.logIndex;
223
+ }
224
+
225
+ export function getTransactionHashes(events: SortableEvent[]): string[] {
226
+ return [...Array.from(new Set(events.map((e) => e.transactionHash)))];
227
+ }
@@ -0,0 +1,48 @@
1
+ import { Deposit, Fill, RelayData, SlowFillRequest } from "../interfaces";
2
+ import { getRelayDataHash } from "./SpokeUtils";
3
+
4
+ export const FILL_DEPOSIT_COMPARISON_KEYS = [
5
+ "depositId",
6
+ "originChainId",
7
+ "destinationChainId",
8
+ "depositor",
9
+ "recipient",
10
+ "message",
11
+ ] as const;
12
+
13
+ export const V3_DEPOSIT_COMPARISON_KEYS = [
14
+ ...FILL_DEPOSIT_COMPARISON_KEYS,
15
+ "inputToken",
16
+ "inputAmount",
17
+ "outputToken",
18
+ "outputAmount",
19
+ "fillDeadline",
20
+ "exclusivityDeadline",
21
+ "exclusiveRelayer",
22
+ ] as const;
23
+
24
+ export function filledSameDeposit(fillA: Fill, fillB: Fill): boolean {
25
+ // Don't bother hashing obvious mismatches.
26
+ if (fillA.depositId !== fillB.depositId) {
27
+ return false;
28
+ }
29
+
30
+ const { destinationChainId: chainA } = fillA;
31
+ const { destinationChainId: chainB } = fillB;
32
+ return getRelayDataHash(fillA, chainA) === getRelayDataHash(fillB, chainB);
33
+ }
34
+
35
+ export function validateFillForDeposit(
36
+ relayData: RelayData & { destinationChainId: number }, // V3Fill, SlowFillRequest...
37
+ deposit?: Deposit
38
+ ): boolean {
39
+ if (deposit === undefined) {
40
+ return false;
41
+ }
42
+
43
+ return validateV3FillForDeposit(relayData, deposit);
44
+ }
45
+
46
+ function validateV3FillForDeposit(fill: Fill | SlowFillRequest, deposit: Deposit): boolean {
47
+ return getRelayDataHash(fill, fill.destinationChainId) === getRelayDataHash(deposit, deposit.destinationChainId);
48
+ }