@across-protocol/sdk 4.1.62 → 4.1.63-beta.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 (358) hide show
  1. package/dist/cjs/arch/evm/SpokeUtils.d.ts +1 -1
  2. package/dist/cjs/arch/evm/SpokeUtils.js +6 -5
  3. package/dist/cjs/arch/evm/SpokeUtils.js.map +1 -1
  4. package/dist/cjs/arch/svm/SpokeUtils.d.ts +20 -0
  5. package/dist/cjs/arch/svm/SpokeUtils.js +428 -0
  6. package/dist/cjs/arch/svm/SpokeUtils.js.map +1 -0
  7. package/dist/cjs/arch/svm/constants.d.ts +1 -0
  8. package/dist/cjs/arch/svm/constants.js +5 -0
  9. package/dist/cjs/arch/svm/constants.js.map +1 -0
  10. package/dist/cjs/arch/svm/eventsClient.d.ts +21 -0
  11. package/dist/cjs/{svm → arch/svm}/eventsClient.js +60 -28
  12. package/dist/cjs/arch/svm/eventsClient.js.map +1 -0
  13. package/dist/cjs/arch/svm/index.d.ts +5 -1
  14. package/dist/cjs/arch/svm/index.js +6 -2
  15. package/dist/cjs/arch/svm/index.js.map +1 -1
  16. package/dist/cjs/{svm → arch/svm}/types.d.ts +9 -4
  17. package/dist/cjs/arch/svm/types.js.map +1 -0
  18. package/dist/cjs/arch/svm/utils.d.ts +17 -0
  19. package/dist/cjs/arch/svm/utils.js +204 -0
  20. package/dist/cjs/arch/svm/utils.js.map +1 -0
  21. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +1 -1
  22. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +7 -7
  23. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
  24. package/dist/cjs/clients/BaseAbstractClient.d.ts +6 -5
  25. package/dist/cjs/clients/BaseAbstractClient.js +30 -19
  26. package/dist/cjs/clients/BaseAbstractClient.js.map +1 -1
  27. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js +15 -11
  28. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  29. package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js +1 -1
  30. package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
  31. package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.d.ts +90 -90
  32. package/dist/cjs/clients/HubPoolClient.d.ts +1 -1
  33. package/dist/cjs/clients/HubPoolClient.js +16 -16
  34. package/dist/cjs/clients/HubPoolClient.js.map +1 -1
  35. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +3 -3
  36. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js +23 -20
  37. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
  38. package/dist/cjs/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +23 -0
  39. package/dist/cjs/clients/SpokePoolClient/SVMSpokePoolClient.js +145 -0
  40. package/dist/cjs/clients/SpokePoolClient/SVMSpokePoolClient.js.map +1 -0
  41. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.d.ts +5 -5
  42. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js +50 -54
  43. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
  44. package/dist/cjs/clients/SpokePoolClient/index.d.ts +3 -0
  45. package/dist/cjs/clients/SpokePoolClient/index.js +8 -1
  46. package/dist/cjs/clients/SpokePoolClient/index.js.map +1 -1
  47. package/dist/cjs/clients/index.d.ts +1 -1
  48. package/dist/cjs/clients/index.js +2 -1
  49. package/dist/cjs/clients/index.js.map +1 -1
  50. package/dist/cjs/clients/mocks/MockConfigStoreClient.d.ts +1 -1
  51. package/dist/cjs/clients/mocks/MockConfigStoreClient.js +2 -2
  52. package/dist/cjs/clients/mocks/MockConfigStoreClient.js.map +1 -1
  53. package/dist/cjs/clients/mocks/MockHubPoolClient.js +2 -2
  54. package/dist/cjs/clients/mocks/MockHubPoolClient.js.map +1 -1
  55. package/dist/cjs/clients/mocks/MockSpokePoolClient.js +7 -4
  56. package/dist/cjs/clients/mocks/MockSpokePoolClient.js.map +1 -1
  57. package/dist/cjs/gasPriceOracle/adapters/arbitrum.d.ts +2 -2
  58. package/dist/cjs/gasPriceOracle/adapters/arbitrum.js.map +1 -1
  59. package/dist/cjs/gasPriceOracle/adapters/ethereum.d.ts +4 -4
  60. package/dist/cjs/gasPriceOracle/adapters/ethereum.js.map +1 -1
  61. package/dist/cjs/gasPriceOracle/adapters/linea-viem.js +3 -2
  62. package/dist/cjs/gasPriceOracle/adapters/linea-viem.js.map +1 -1
  63. package/dist/cjs/gasPriceOracle/adapters/polygon.d.ts +3 -3
  64. package/dist/cjs/gasPriceOracle/adapters/solana.d.ts +4 -0
  65. package/dist/cjs/gasPriceOracle/adapters/solana.js +43 -0
  66. package/dist/cjs/gasPriceOracle/adapters/solana.js.map +1 -0
  67. package/dist/cjs/gasPriceOracle/index.d.ts +1 -1
  68. package/dist/cjs/gasPriceOracle/oracle.d.ts +4 -3
  69. package/dist/cjs/gasPriceOracle/oracle.js +16 -9
  70. package/dist/cjs/gasPriceOracle/oracle.js.map +1 -1
  71. package/dist/cjs/gasPriceOracle/types.d.ts +6 -1
  72. package/dist/cjs/index.d.ts +0 -1
  73. package/dist/cjs/index.js +1 -2
  74. package/dist/cjs/index.js.map +1 -1
  75. package/dist/cjs/interfaces/SpokePool.d.ts +7 -0
  76. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
  77. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js +5 -4
  78. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
  79. package/dist/cjs/relayFeeCalculator/chain-queries/factory.d.ts +4 -2
  80. package/dist/cjs/relayFeeCalculator/chain-queries/factory.js +7 -1
  81. package/dist/cjs/relayFeeCalculator/chain-queries/factory.js.map +1 -1
  82. package/dist/cjs/relayFeeCalculator/chain-queries/index.d.ts +1 -0
  83. package/dist/cjs/relayFeeCalculator/chain-queries/index.js +1 -0
  84. package/dist/cjs/relayFeeCalculator/chain-queries/index.js.map +1 -1
  85. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.d.ts +31 -0
  86. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js +136 -0
  87. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js.map +1 -0
  88. package/dist/cjs/utils/AddressUtils.d.ts +9 -3
  89. package/dist/cjs/utils/AddressUtils.js +36 -6
  90. package/dist/cjs/utils/AddressUtils.js.map +1 -1
  91. package/dist/cjs/utils/ArrayUtils.d.ts +1 -0
  92. package/dist/cjs/utils/ArrayUtils.js +6 -1
  93. package/dist/cjs/utils/ArrayUtils.js.map +1 -1
  94. package/dist/cjs/utils/EventUtils.d.ts +4 -4
  95. package/dist/cjs/utils/EventUtils.js +7 -4
  96. package/dist/cjs/utils/EventUtils.js.map +1 -1
  97. package/dist/cjs/utils/JSONUtils.js +3 -0
  98. package/dist/cjs/utils/JSONUtils.js.map +1 -1
  99. package/dist/cjs/utils/SpokeUtils.js +5 -0
  100. package/dist/cjs/utils/SpokeUtils.js.map +1 -1
  101. package/dist/esm/arch/evm/SpokeUtils.d.ts +1 -1
  102. package/dist/esm/arch/evm/SpokeUtils.js +6 -5
  103. package/dist/esm/arch/evm/SpokeUtils.js.map +1 -1
  104. package/dist/esm/arch/svm/SpokeUtils.d.ts +94 -0
  105. package/dist/esm/arch/svm/SpokeUtils.js +513 -0
  106. package/dist/esm/arch/svm/SpokeUtils.js.map +1 -0
  107. package/dist/esm/arch/svm/constants.d.ts +1 -0
  108. package/dist/esm/arch/svm/constants.js +2 -0
  109. package/dist/esm/arch/svm/constants.js.map +1 -0
  110. package/dist/esm/arch/svm/eventsClient.d.ts +67 -0
  111. package/dist/esm/{svm → arch/svm}/eventsClient.js +69 -27
  112. package/dist/esm/arch/svm/eventsClient.js.map +1 -0
  113. package/dist/esm/arch/svm/index.d.ts +5 -1
  114. package/dist/esm/arch/svm/index.js +5 -1
  115. package/dist/esm/arch/svm/index.js.map +1 -1
  116. package/dist/{types → esm/arch}/svm/types.d.ts +9 -5
  117. package/dist/esm/arch/svm/types.js.map +1 -0
  118. package/dist/esm/arch/svm/utils.d.ts +59 -0
  119. package/dist/esm/arch/svm/utils.js +248 -0
  120. package/dist/esm/arch/svm/utils.js.map +1 -0
  121. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +1 -1
  122. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +7 -7
  123. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
  124. package/dist/esm/clients/BaseAbstractClient.d.ts +6 -5
  125. package/dist/esm/clients/BaseAbstractClient.js +30 -19
  126. package/dist/esm/clients/BaseAbstractClient.js.map +1 -1
  127. package/dist/esm/clients/BundleDataClient/BundleDataClient.js +17 -14
  128. package/dist/esm/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  129. package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js +1 -1
  130. package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
  131. package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.d.ts +90 -90
  132. package/dist/esm/clients/HubPoolClient.d.ts +1 -1
  133. package/dist/esm/clients/HubPoolClient.js +16 -16
  134. package/dist/esm/clients/HubPoolClient.js.map +1 -1
  135. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +3 -3
  136. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js +23 -20
  137. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
  138. package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +67 -0
  139. package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.js +196 -0
  140. package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.js.map +1 -0
  141. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.d.ts +7 -7
  142. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js +51 -55
  143. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
  144. package/dist/esm/clients/SpokePoolClient/index.d.ts +8 -0
  145. package/dist/esm/clients/SpokePoolClient/index.js +10 -0
  146. package/dist/esm/clients/SpokePoolClient/index.js.map +1 -1
  147. package/dist/esm/clients/index.d.ts +1 -1
  148. package/dist/esm/clients/index.js +1 -1
  149. package/dist/esm/clients/index.js.map +1 -1
  150. package/dist/esm/clients/mocks/MockConfigStoreClient.d.ts +1 -1
  151. package/dist/esm/clients/mocks/MockConfigStoreClient.js +2 -2
  152. package/dist/esm/clients/mocks/MockConfigStoreClient.js.map +1 -1
  153. package/dist/esm/clients/mocks/MockHubPoolClient.js +2 -2
  154. package/dist/esm/clients/mocks/MockHubPoolClient.js.map +1 -1
  155. package/dist/esm/clients/mocks/MockSpokePoolClient.js +8 -5
  156. package/dist/esm/clients/mocks/MockSpokePoolClient.js.map +1 -1
  157. package/dist/esm/gasPriceOracle/adapters/arbitrum.d.ts +2 -2
  158. package/dist/esm/gasPriceOracle/adapters/arbitrum.js.map +1 -1
  159. package/dist/esm/gasPriceOracle/adapters/ethereum.d.ts +4 -4
  160. package/dist/esm/gasPriceOracle/adapters/ethereum.js.map +1 -1
  161. package/dist/esm/gasPriceOracle/adapters/linea-viem.js +3 -2
  162. package/dist/esm/gasPriceOracle/adapters/linea-viem.js.map +1 -1
  163. package/dist/esm/gasPriceOracle/adapters/polygon.d.ts +4 -4
  164. package/dist/esm/gasPriceOracle/adapters/polygon.js +1 -1
  165. package/dist/esm/gasPriceOracle/adapters/solana.d.ts +8 -0
  166. package/dist/esm/gasPriceOracle/adapters/solana.js +43 -0
  167. package/dist/esm/gasPriceOracle/adapters/solana.js.map +1 -0
  168. package/dist/esm/gasPriceOracle/index.d.ts +1 -1
  169. package/dist/esm/gasPriceOracle/oracle.d.ts +4 -3
  170. package/dist/esm/gasPriceOracle/oracle.js +18 -9
  171. package/dist/esm/gasPriceOracle/oracle.js.map +1 -1
  172. package/dist/esm/gasPriceOracle/types.d.ts +6 -1
  173. package/dist/esm/index.d.ts +0 -1
  174. package/dist/esm/index.js +0 -2
  175. package/dist/esm/index.js.map +1 -1
  176. package/dist/esm/interfaces/SpokePool.d.ts +7 -0
  177. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
  178. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js +4 -3
  179. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
  180. package/dist/esm/relayFeeCalculator/chain-queries/factory.d.ts +4 -2
  181. package/dist/esm/relayFeeCalculator/chain-queries/factory.js +8 -2
  182. package/dist/esm/relayFeeCalculator/chain-queries/factory.js.map +1 -1
  183. package/dist/esm/relayFeeCalculator/chain-queries/index.d.ts +1 -0
  184. package/dist/esm/relayFeeCalculator/chain-queries/index.js +1 -0
  185. package/dist/esm/relayFeeCalculator/chain-queries/index.js.map +1 -1
  186. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.d.ts +66 -0
  187. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js +169 -0
  188. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js.map +1 -0
  189. package/dist/esm/utils/AddressUtils.d.ts +9 -3
  190. package/dist/esm/utils/AddressUtils.js +41 -6
  191. package/dist/esm/utils/AddressUtils.js.map +1 -1
  192. package/dist/esm/utils/ArrayUtils.d.ts +6 -0
  193. package/dist/esm/utils/ArrayUtils.js +9 -0
  194. package/dist/esm/utils/ArrayUtils.js.map +1 -1
  195. package/dist/esm/utils/EventUtils.d.ts +4 -4
  196. package/dist/esm/utils/EventUtils.js +7 -4
  197. package/dist/esm/utils/EventUtils.js.map +1 -1
  198. package/dist/esm/utils/JSONUtils.js +3 -0
  199. package/dist/esm/utils/JSONUtils.js.map +1 -1
  200. package/dist/esm/utils/SpokeUtils.js +5 -0
  201. package/dist/esm/utils/SpokeUtils.js.map +1 -1
  202. package/dist/types/arch/evm/SpokeUtils.d.ts +1 -1
  203. package/dist/types/arch/evm/SpokeUtils.d.ts.map +1 -1
  204. package/dist/types/arch/svm/SpokeUtils.d.ts +95 -0
  205. package/dist/types/arch/svm/SpokeUtils.d.ts.map +1 -0
  206. package/dist/types/arch/svm/constants.d.ts +2 -0
  207. package/dist/types/arch/svm/constants.d.ts.map +1 -0
  208. package/dist/types/arch/svm/eventsClient.d.ts +68 -0
  209. package/dist/types/arch/svm/eventsClient.d.ts.map +1 -0
  210. package/dist/types/arch/svm/index.d.ts +5 -1
  211. package/dist/types/arch/svm/index.d.ts.map +1 -1
  212. package/dist/{esm → types/arch}/svm/types.d.ts +10 -4
  213. package/dist/types/arch/svm/types.d.ts.map +1 -0
  214. package/dist/types/arch/svm/utils.d.ts +60 -0
  215. package/dist/types/arch/svm/utils.d.ts.map +1 -0
  216. package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +1 -1
  217. package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts.map +1 -1
  218. package/dist/types/clients/BaseAbstractClient.d.ts +6 -5
  219. package/dist/types/clients/BaseAbstractClient.d.ts.map +1 -1
  220. package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts.map +1 -1
  221. package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts +90 -90
  222. package/dist/types/clients/HubPoolClient.d.ts +1 -1
  223. package/dist/types/clients/HubPoolClient.d.ts.map +1 -1
  224. package/dist/types/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +3 -3
  225. package/dist/types/clients/SpokePoolClient/EVMSpokePoolClient.d.ts.map +1 -1
  226. package/dist/types/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +68 -0
  227. package/dist/types/clients/SpokePoolClient/SVMSpokePoolClient.d.ts.map +1 -0
  228. package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts +7 -7
  229. package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts.map +1 -1
  230. package/dist/types/clients/SpokePoolClient/index.d.ts +8 -0
  231. package/dist/types/clients/SpokePoolClient/index.d.ts.map +1 -1
  232. package/dist/types/clients/index.d.ts +1 -1
  233. package/dist/types/clients/index.d.ts.map +1 -1
  234. package/dist/types/clients/mocks/MockConfigStoreClient.d.ts +1 -1
  235. package/dist/types/clients/mocks/MockConfigStoreClient.d.ts.map +1 -1
  236. package/dist/types/clients/mocks/MockSpokePoolClient.d.ts.map +1 -1
  237. package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts +2 -2
  238. package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts.map +1 -1
  239. package/dist/types/gasPriceOracle/adapters/ethereum.d.ts +4 -4
  240. package/dist/types/gasPriceOracle/adapters/ethereum.d.ts.map +1 -1
  241. package/dist/types/gasPriceOracle/adapters/linea-viem.d.ts.map +1 -1
  242. package/dist/types/gasPriceOracle/adapters/polygon.d.ts +4 -4
  243. package/dist/types/gasPriceOracle/adapters/polygon.d.ts.map +1 -1
  244. package/dist/types/gasPriceOracle/adapters/solana.d.ts +9 -0
  245. package/dist/types/gasPriceOracle/adapters/solana.d.ts.map +1 -0
  246. package/dist/types/gasPriceOracle/index.d.ts +1 -1
  247. package/dist/types/gasPriceOracle/index.d.ts.map +1 -1
  248. package/dist/types/gasPriceOracle/oracle.d.ts +4 -3
  249. package/dist/types/gasPriceOracle/oracle.d.ts.map +1 -1
  250. package/dist/types/gasPriceOracle/types.d.ts +6 -1
  251. package/dist/types/gasPriceOracle/types.d.ts.map +1 -1
  252. package/dist/types/index.d.ts +0 -1
  253. package/dist/types/index.d.ts.map +1 -1
  254. package/dist/types/interfaces/SpokePool.d.ts +7 -0
  255. package/dist/types/interfaces/SpokePool.d.ts.map +1 -1
  256. package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
  257. package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts.map +1 -1
  258. package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts +4 -2
  259. package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
  260. package/dist/types/relayFeeCalculator/chain-queries/index.d.ts +1 -0
  261. package/dist/types/relayFeeCalculator/chain-queries/index.d.ts.map +1 -1
  262. package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts +67 -0
  263. package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts.map +1 -0
  264. package/dist/types/utils/AddressUtils.d.ts +9 -3
  265. package/dist/types/utils/AddressUtils.d.ts.map +1 -1
  266. package/dist/types/utils/ArrayUtils.d.ts +6 -0
  267. package/dist/types/utils/ArrayUtils.d.ts.map +1 -1
  268. package/dist/types/utils/EventUtils.d.ts +4 -4
  269. package/dist/types/utils/EventUtils.d.ts.map +1 -1
  270. package/dist/types/utils/JSONUtils.d.ts.map +1 -1
  271. package/dist/types/utils/SpokeUtils.d.ts.map +1 -1
  272. package/package.json +4 -1
  273. package/src/arch/evm/SpokeUtils.ts +5 -5
  274. package/src/arch/svm/SpokeUtils.ts +526 -0
  275. package/src/arch/svm/constants.ts +1 -0
  276. package/src/{svm → arch/svm}/eventsClient.ts +67 -45
  277. package/src/arch/svm/index.ts +5 -1
  278. package/src/{svm → arch/svm}/types.ts +21 -4
  279. package/src/arch/svm/utils.ts +222 -0
  280. package/src/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.ts +7 -7
  281. package/src/clients/BaseAbstractClient.ts +20 -13
  282. package/src/clients/BundleDataClient/BundleDataClient.ts +28 -19
  283. package/src/clients/BundleDataClient/utils/PoolRebalanceUtils.ts +1 -1
  284. package/src/clients/HubPoolClient.ts +16 -16
  285. package/src/clients/SpokePoolClient/EVMSpokePoolClient.ts +23 -21
  286. package/src/clients/SpokePoolClient/SVMSpokePoolClient.ts +244 -0
  287. package/src/clients/SpokePoolClient/SpokePoolClient.ts +44 -56
  288. package/src/clients/SpokePoolClient/index.ts +11 -0
  289. package/src/clients/index.ts +1 -1
  290. package/src/clients/mocks/MockConfigStoreClient.ts +2 -2
  291. package/src/clients/mocks/MockHubPoolClient.ts +2 -2
  292. package/src/clients/mocks/MockSpokePoolClient.ts +9 -4
  293. package/src/gasPriceOracle/adapters/arbitrum.ts +5 -2
  294. package/src/gasPriceOracle/adapters/ethereum.ts +7 -4
  295. package/src/gasPriceOracle/adapters/linea-viem.ts +3 -1
  296. package/src/gasPriceOracle/adapters/polygon.ts +6 -6
  297. package/src/gasPriceOracle/adapters/solana.ts +45 -0
  298. package/src/gasPriceOracle/index.ts +1 -1
  299. package/src/gasPriceOracle/oracle.ts +20 -4
  300. package/src/gasPriceOracle/types.ts +7 -1
  301. package/src/index.ts +0 -1
  302. package/src/interfaces/SpokePool.ts +7 -0
  303. package/src/relayFeeCalculator/chain-queries/baseQuery.ts +5 -3
  304. package/src/relayFeeCalculator/chain-queries/factory.ts +21 -5
  305. package/src/relayFeeCalculator/chain-queries/index.ts +1 -0
  306. package/src/relayFeeCalculator/chain-queries/svmQuery.ts +193 -0
  307. package/src/utils/AddressUtils.ts +49 -6
  308. package/src/utils/ArrayUtils.ts +12 -0
  309. package/src/utils/EventUtils.ts +11 -11
  310. package/src/utils/JSONUtils.ts +2 -0
  311. package/src/utils/SpokeUtils.ts +5 -1
  312. package/dist/cjs/svm/eventsClient.d.ts +0 -15
  313. package/dist/cjs/svm/eventsClient.js.map +0 -1
  314. package/dist/cjs/svm/index.d.ts +0 -3
  315. package/dist/cjs/svm/index.js +0 -8
  316. package/dist/cjs/svm/index.js.map +0 -1
  317. package/dist/cjs/svm/types.js.map +0 -1
  318. package/dist/cjs/svm/utils/events.d.ts +0 -8
  319. package/dist/cjs/svm/utils/events.js +0 -47
  320. package/dist/cjs/svm/utils/events.js.map +0 -1
  321. package/dist/cjs/svm/utils/helpers.d.ts +0 -2
  322. package/dist/cjs/svm/utils/helpers.js +0 -19
  323. package/dist/cjs/svm/utils/helpers.js.map +0 -1
  324. package/dist/cjs/svm/utils/index.d.ts +0 -1
  325. package/dist/cjs/svm/utils/index.js +0 -5
  326. package/dist/cjs/svm/utils/index.js.map +0 -1
  327. package/dist/esm/svm/eventsClient.d.ts +0 -51
  328. package/dist/esm/svm/eventsClient.js.map +0 -1
  329. package/dist/esm/svm/index.d.ts +0 -3
  330. package/dist/esm/svm/index.js +0 -5
  331. package/dist/esm/svm/index.js.map +0 -1
  332. package/dist/esm/svm/types.js.map +0 -1
  333. package/dist/esm/svm/utils/events.d.ts +0 -17
  334. package/dist/esm/svm/utils/events.js +0 -55
  335. package/dist/esm/svm/utils/events.js.map +0 -1
  336. package/dist/esm/svm/utils/helpers.d.ts +0 -5
  337. package/dist/esm/svm/utils/helpers.js +0 -18
  338. package/dist/esm/svm/utils/helpers.js.map +0 -1
  339. package/dist/esm/svm/utils/index.d.ts +0 -1
  340. package/dist/esm/svm/utils/index.js +0 -2
  341. package/dist/esm/svm/utils/index.js.map +0 -1
  342. package/dist/types/svm/eventsClient.d.ts +0 -52
  343. package/dist/types/svm/eventsClient.d.ts.map +0 -1
  344. package/dist/types/svm/index.d.ts +0 -4
  345. package/dist/types/svm/index.d.ts.map +0 -1
  346. package/dist/types/svm/types.d.ts.map +0 -1
  347. package/dist/types/svm/utils/events.d.ts +0 -18
  348. package/dist/types/svm/utils/events.d.ts.map +0 -1
  349. package/dist/types/svm/utils/helpers.d.ts +0 -6
  350. package/dist/types/svm/utils/helpers.d.ts.map +0 -1
  351. package/dist/types/svm/utils/index.d.ts +0 -2
  352. package/dist/types/svm/utils/index.d.ts.map +0 -1
  353. package/src/svm/index.ts +0 -3
  354. package/src/svm/utils/events.ts +0 -58
  355. package/src/svm/utils/helpers.ts +0 -9
  356. package/src/svm/utils/index.ts +0 -1
  357. /package/dist/cjs/{svm → arch/svm}/types.js +0 -0
  358. /package/dist/esm/{svm → arch/svm}/types.js +0 -0
@@ -2,24 +2,24 @@ import { __assign, __awaiter, __generator, __spreadArray } from "tslib";
2
2
  import { getDeployedAddress, SvmSpokeIdl } from "@across-protocol/contracts";
3
3
  import { getSolanaChainId } from "@across-protocol/contracts/dist/src/svm/web3-v1";
4
4
  import web3 from "@solana/kit";
5
- import { bs58 } from "../utils";
6
- import { decodeEvent } from "./utils/events";
7
- import { isDevnet } from "./utils/helpers";
8
- var SvmSpokeEventsClient = /** @class */ (function () {
5
+ import { bs58 } from "../../utils";
6
+ import { decodeEvent, isDevnet } from "./utils";
7
+ var SvmCpiEventsClient = /** @class */ (function () {
9
8
  /**
10
- * Private constructor. Use the async create() method to instantiate.
9
+ * Protected constructor. Use the async create() method to instantiate.
11
10
  */
12
- function SvmSpokeEventsClient(rpc, svmSpokeAddress, eventAuthority) {
11
+ function SvmCpiEventsClient(rpc, address, eventAuthority, idl) {
13
12
  this.rpc = rpc;
14
- this.svmSpokeAddress = svmSpokeAddress;
15
- this.svmSpokeEventAuthority = eventAuthority;
13
+ this.programAddress = address;
14
+ this.programEventAuthority = eventAuthority;
15
+ this.idl = idl;
16
16
  }
17
17
  /**
18
18
  * Factory method to asynchronously create an instance of SvmSpokeEventsClient.
19
19
  */
20
- SvmSpokeEventsClient.create = function (rpc) {
20
+ SvmCpiEventsClient.create = function (rpc) {
21
21
  return __awaiter(this, void 0, void 0, function () {
22
- var isTestnet, programId, svmSpokeAddress, svmSpokeEventAuthority;
22
+ var isTestnet, programId;
23
23
  return __generator(this, function (_a) {
24
24
  switch (_a.label) {
25
25
  case 0: return [4 /*yield*/, isDevnet(rpc)];
@@ -28,14 +28,25 @@ var SvmSpokeEventsClient = /** @class */ (function () {
28
28
  programId = getDeployedAddress("SvmSpoke", getSolanaChainId(isTestnet ? "devnet" : "mainnet").toString());
29
29
  if (!programId)
30
30
  throw new Error("Program not found");
31
- svmSpokeAddress = web3.address(programId);
31
+ return [2 /*return*/, this.createFor(rpc, programId, SvmSpokeIdl)];
32
+ }
33
+ });
34
+ });
35
+ };
36
+ SvmCpiEventsClient.createFor = function (rpc, programId, idl) {
37
+ return __awaiter(this, void 0, void 0, function () {
38
+ var address, eventAuthority;
39
+ return __generator(this, function (_a) {
40
+ switch (_a.label) {
41
+ case 0:
42
+ address = web3.address(programId);
32
43
  return [4 /*yield*/, web3.getProgramDerivedAddress({
33
- programAddress: svmSpokeAddress,
44
+ programAddress: address,
34
45
  seeds: ["__event_authority"],
35
46
  })];
36
- case 2:
37
- svmSpokeEventAuthority = (_a.sent())[0];
38
- return [2 /*return*/, new SvmSpokeEventsClient(rpc, svmSpokeAddress, svmSpokeEventAuthority)];
47
+ case 1:
48
+ eventAuthority = (_a.sent())[0];
49
+ return [2 /*return*/, new SvmCpiEventsClient(rpc, address, eventAuthority, idl)];
39
50
  }
40
51
  });
41
52
  });
@@ -49,7 +60,7 @@ var SvmSpokeEventsClient = /** @class */ (function () {
49
60
  * @param options - Options for fetching signatures.
50
61
  * @returns A promise that resolves to an array of events matching the eventName.
51
62
  */
52
- SvmSpokeEventsClient.prototype.queryEvents = function (eventName, fromSlot, toSlot, options) {
63
+ SvmCpiEventsClient.prototype.queryEvents = function (eventName, fromSlot, toSlot, options) {
53
64
  if (options === void 0) { options = { limit: 1000, commitment: "confirmed" }; }
54
65
  return __awaiter(this, void 0, void 0, function () {
55
66
  var events;
@@ -63,22 +74,47 @@ var SvmSpokeEventsClient = /** @class */ (function () {
63
74
  });
64
75
  });
65
76
  };
77
+ /**
78
+ * Queries events for the provided derived address at instantiation filtered by event name.
79
+ *
80
+ * @param eventName - The name of the event to filter by.
81
+ * @param fromSlot - Optional starting slot.
82
+ * @param toSlot - Optional ending slot.
83
+ * @param options - Options for fetching signatures.
84
+ * @returns A promise that resolves to an array of events matching the eventName.
85
+ */
86
+ SvmCpiEventsClient.prototype.queryDerivedAddressEvents = function (eventName, derivedAddress, fromSlot, toSlot, options) {
87
+ if (options === void 0) { options = { limit: 1000, commitment: "confirmed" }; }
88
+ return __awaiter(this, void 0, void 0, function () {
89
+ var events;
90
+ return __generator(this, function (_a) {
91
+ switch (_a.label) {
92
+ case 0: return [4 /*yield*/, this.queryAllEvents(fromSlot, toSlot, options, derivedAddress)];
93
+ case 1:
94
+ events = _a.sent();
95
+ return [2 /*return*/, events.filter(function (event) { return event.name === eventName; })];
96
+ }
97
+ });
98
+ });
99
+ };
66
100
  /**
67
101
  * Queries all events for a specific program.
68
102
  *
69
103
  * @param fromSlot - Optional starting slot.
70
104
  * @param toSlot - Optional ending slot.
71
105
  * @param options - Options for fetching signatures.
106
+ * @param forDerivedAddress - Whether to query events for the program or the derived address.
72
107
  * @returns A promise that resolves to an array of all events with additional metadata.
73
108
  */
74
- SvmSpokeEventsClient.prototype.queryAllEvents = function (fromSlot, toSlot, options) {
109
+ SvmCpiEventsClient.prototype.queryAllEvents = function (fromSlot, toSlot, options, derivedAddress) {
75
110
  if (options === void 0) { options = { limit: 1000, commitment: "confirmed" }; }
76
111
  return __awaiter(this, void 0, void 0, function () {
77
- var allSignatures, hasMoreSignatures, currentOptions, signatures, filteredSignatures, eventsWithSlots;
112
+ var addressToQuery, allSignatures, hasMoreSignatures, currentOptions, signatures, filteredSignatures, eventsWithSlots;
78
113
  var _this = this;
79
114
  return __generator(this, function (_a) {
80
115
  switch (_a.label) {
81
116
  case 0:
117
+ addressToQuery = derivedAddress || this.programAddress;
82
118
  allSignatures = [];
83
119
  hasMoreSignatures = true;
84
120
  currentOptions = options;
@@ -86,7 +122,7 @@ var SvmSpokeEventsClient = /** @class */ (function () {
86
122
  case 1:
87
123
  if (!hasMoreSignatures) return [3 /*break*/, 3];
88
124
  return [4 /*yield*/, this.rpc
89
- .getSignaturesForAddress(this.svmSpokeAddress, currentOptions)
125
+ .getSignaturesForAddress(addressToQuery, currentOptions)
90
126
  .send()];
91
127
  case 2:
92
128
  signatures = _a.sent();
@@ -134,7 +170,7 @@ var SvmSpokeEventsClient = /** @class */ (function () {
134
170
  * @param commitment - Commitment level.
135
171
  * @returns A promise that resolves to an array of events.
136
172
  */
137
- SvmSpokeEventsClient.prototype.readEventsFromSignature = function (txSignature, commitment) {
173
+ SvmCpiEventsClient.prototype.readEventsFromSignature = function (txSignature, commitment) {
138
174
  if (commitment === void 0) { commitment = "confirmed"; }
139
175
  return __awaiter(this, void 0, void 0, function () {
140
176
  var txResult;
@@ -158,7 +194,7 @@ var SvmSpokeEventsClient = /** @class */ (function () {
158
194
  * @param txResult - The transaction result.
159
195
  * @returns A promise that resolves to an array of events with their data and name.
160
196
  */
161
- SvmSpokeEventsClient.prototype.processEventFromTx = function (txResult) {
197
+ SvmCpiEventsClient.prototype.processEventFromTx = function (txResult) {
162
198
  var _a, _b, _c, _d, _e, _f, _g, _h;
163
199
  if (!txResult)
164
200
  return [];
@@ -177,19 +213,25 @@ var SvmSpokeEventsClient = /** @class */ (function () {
177
213
  var singleIxAccount = ix.accounts.length === 1 ? messageAccountKeys[ix.accounts[0]] : undefined;
178
214
  if (ixProgramId !== undefined &&
179
215
  singleIxAccount !== undefined &&
180
- this.svmSpokeAddress === ixProgramId &&
181
- this.svmSpokeEventAuthority === singleIxAccount) {
216
+ this.programAddress === ixProgramId &&
217
+ this.programEventAuthority === singleIxAccount) {
182
218
  var ixData = bs58.decode(ix.data);
183
219
  // Skip the first 8 bytes (assumed header) and encode the rest.
184
220
  var eventData = Buffer.from(ixData.slice(8)).toString("base64");
185
- var _m = decodeEvent(SvmSpokeIdl, eventData), name_1 = _m.name, data = _m.data;
186
- events.push({ program: this.svmSpokeAddress, name: name_1, data: data });
221
+ var _m = decodeEvent(this.idl, eventData), name_1 = _m.name, data = _m.data;
222
+ events.push({ program: this.programAddress, name: name_1, data: data });
187
223
  }
188
224
  }
189
225
  }
190
226
  return events;
191
227
  };
192
- return SvmSpokeEventsClient;
228
+ SvmCpiEventsClient.prototype.getProgramAddress = function () {
229
+ return this.programAddress;
230
+ };
231
+ SvmCpiEventsClient.prototype.getRpc = function () {
232
+ return this.rpc;
233
+ };
234
+ return SvmCpiEventsClient;
193
235
  }());
194
- export { SvmSpokeEventsClient };
236
+ export { SvmCpiEventsClient };
195
237
  //# sourceMappingURL=eventsClient.js.map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,KAAiB,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,EAA/C,MAAI,UAAA,EAAE,IAAI,UAAqC,CAAC;oBACxD,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,QAAA,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC;iBAC3D;aACF;SACF;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,8CAAiB,GAAxB;QACE,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAEM,mCAAM,GAAb;QACE,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IACH,yBAAC;AAAD,CAAC,AAvMD,IAuMC"}
@@ -1 +1,5 @@
1
- export declare const platform = "svm";
1
+ export * from "./eventsClient";
2
+ export * from "./SpokeUtils";
3
+ export * from "./types";
4
+ export * from "./utils";
5
+ export * from "./constants";
@@ -1,2 +1,6 @@
1
- export var platform = "svm"; // Placeholder for actual exports.
1
+ export * from "./eventsClient";
2
+ export * from "./SpokeUtils";
3
+ export * from "./types";
4
+ export * from "./utils";
5
+ export * from "./constants";
2
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/arch/svm/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,kCAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/arch/svm/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Signature, Address, UnixTimestamp } from "@solana/kit";
2
1
  import { SvmSpokeClient } from "@across-protocol/contracts";
2
+ import { Address, Rpc, RpcSubscriptions, RpcTransport, Signature, SignatureNotificationsApi, SlotNotificationsApi, SolanaRpcApiFromTransport, UnixTimestamp } from "@solana/kit";
3
3
  export type EventData = SvmSpokeClient.BridgedToHubPool | SvmSpokeClient.TokensBridged | SvmSpokeClient.ExecutedRelayerRefundRoot | SvmSpokeClient.RelayedRootBundle | SvmSpokeClient.PausedDeposits | SvmSpokeClient.PausedFills | SvmSpokeClient.SetXDomainAdmin | SvmSpokeClient.EnabledDepositRoute | SvmSpokeClient.FilledRelay | SvmSpokeClient.FundsDeposited | SvmSpokeClient.EmergencyDeletedRootBundle | SvmSpokeClient.RequestedSlowFill | SvmSpokeClient.ClaimedRelayerRefund | SvmSpokeClient.TransferredOwnership;
4
4
  export declare enum SVMEventNames {
5
5
  FilledRelay = "FilledRelay",
@@ -18,13 +18,17 @@ export declare enum SVMEventNames {
18
18
  TransferredOwnership = "TransferredOwnership"
19
19
  }
20
20
  export type EventName = keyof typeof SVMEventNames;
21
- export type EventWithData<T extends EventData> = {
21
+ export type EventWithData = {
22
22
  confirmationStatus: string | null;
23
23
  blockTime: UnixTimestamp | null;
24
24
  signature: Signature;
25
25
  slot: bigint;
26
- name: EventName;
27
- data: T;
26
+ name: string;
27
+ data: unknown;
28
28
  program: Address;
29
29
  };
30
- //# sourceMappingURL=types.d.ts.map
30
+ export type RpcClient = {
31
+ rpc: Rpc<SolanaRpcApiFromTransport<RpcTransport>>;
32
+ rpcSubscriptions: RpcSubscriptions<SignatureNotificationsApi & SlotNotificationsApi>;
33
+ };
34
+ export type SVMProvider = Rpc<SolanaRpcApiFromTransport<RpcTransport>>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/arch/svm/types.ts"],"names":[],"mappings":"AA6BA,MAAM,CAAN,IAAY,aAeX;AAfD,WAAY,aAAa;IACvB,4CAA2B,CAAA;IAC3B,kDAAiC,CAAA;IACjC,4DAA2C,CAAA;IAC3C,wDAAuC,CAAA;IACvC,wEAAuD,CAAA;IACvD,sDAAqC,CAAA;IACrC,kDAAiC,CAAA;IACjC,4CAA2B,CAAA;IAC3B,oDAAmC,CAAA;IACnC,0EAAyD,CAAA;IACzD,wDAAuC,CAAA;IACvC,8DAA6C,CAAA;IAC7C,gDAA+B,CAAA;IAC/B,8DAA6C,CAAA;AAC/C,CAAC,EAfW,aAAa,KAAb,aAAa,QAexB"}
@@ -0,0 +1,59 @@
1
+ import { Idl } from "@coral-xyz/anchor";
2
+ import { Address, type TransactionSigner } from "@solana/kit";
3
+ import { RelayData } from "../../interfaces";
4
+ import { EventName, SVMProvider } from "./types";
5
+ /**
6
+ * Basic void TransactionSigner type
7
+ */
8
+ export declare const SolanaVoidSigner: (simulationAddress: string) => TransactionSigner<string>;
9
+ /**
10
+ * Helper to determine if the current RPC network is devnet.
11
+ */
12
+ export declare function isDevnet(rpc: SVMProvider): Promise<boolean>;
13
+ /**
14
+ * Parses event data from a transaction.
15
+ */
16
+ export declare function parseEventData(eventData: any): any;
17
+ /**
18
+ * Decodes a raw event according to a supplied IDL.
19
+ */
20
+ export declare function decodeEvent(idl: Idl, rawEvent: string): {
21
+ data: unknown;
22
+ name: string;
23
+ };
24
+ /**
25
+ * Gets the event name from a raw name.
26
+ */
27
+ export declare function getEventName(rawName: string): EventName;
28
+ /**
29
+ * Unwraps any data structure and converts Address types to strings and Uint8Array to hex or BigInt.
30
+ * Recursively processes nested objects and arrays.
31
+ */
32
+ export declare function unwrapEventData(data: unknown, uint8ArrayKeysAsBigInt?: string[], currentKey?: string): unknown;
33
+ /**
34
+ * Returns the PDA for the State account.
35
+ * @param programId The SpokePool program ID.
36
+ * @returns The PDA for the State account.
37
+ */
38
+ export declare function getStatePda(programId: Address): Promise<Address>;
39
+ /**
40
+ * Returns the fill status PDA for the given relay data.
41
+ * @param programId The SpokePool program ID.
42
+ * @param relayData The relay data to get the fill status PDA for.
43
+ * @param destinationChainId The destination chain ID.
44
+ * @returns The PDA for the fill status.
45
+ */
46
+ export declare function getFillStatusPda(programId: Address, relayData: RelayData, destinationChainId: number): Promise<Address>;
47
+ /**
48
+ * Returns the PDA for a route account on SVM Spoke.
49
+ * @param originToken The origin token address.
50
+ * @param seed The seed for the route account.
51
+ * @param routeChainId The route chain ID.
52
+ * @returns The PDA for the route account.
53
+ */
54
+ export declare function getRoutePda(originToken: Address, seed: bigint, routeChainId: bigint): Promise<Address>;
55
+ /**
56
+ * Returns the PDA for the Event Authority.
57
+ * @returns The PDA for the Event Authority.
58
+ */
59
+ export declare const getEventAuthority: () => Promise<Address<string>>;
@@ -0,0 +1,248 @@
1
+ import { __awaiter, __generator } from "tslib";
2
+ import { BN, BorshEventCoder } from "@coral-xyz/anchor";
3
+ import { address, getProgramDerivedAddress, getU64Encoder, getAddressEncoder, isAddress, } from "@solana/kit";
4
+ import { BigNumber, getRelayDataHash, isUint8Array, SvmAddress } from "../../utils";
5
+ import { SvmSpokeClient } from "@across-protocol/contracts";
6
+ import { FillType } from "../../interfaces";
7
+ import { SVMEventNames } from "./types";
8
+ /**
9
+ * Basic void TransactionSigner type
10
+ */
11
+ export var SolanaVoidSigner = function (simulationAddress) {
12
+ return {
13
+ address: address(simulationAddress),
14
+ signAndSendTransactions: function () { return __awaiter(void 0, void 0, void 0, function () {
15
+ return __generator(this, function (_a) {
16
+ switch (_a.label) {
17
+ case 0: return [4 /*yield*/, Promise.resolve([])];
18
+ case 1: return [2 /*return*/, _a.sent()];
19
+ }
20
+ });
21
+ }); },
22
+ };
23
+ };
24
+ /**
25
+ * Helper to determine if the current RPC network is devnet.
26
+ */
27
+ export function isDevnet(rpc) {
28
+ return __awaiter(this, void 0, void 0, function () {
29
+ var genesisHash;
30
+ return __generator(this, function (_a) {
31
+ switch (_a.label) {
32
+ case 0: return [4 /*yield*/, rpc.getGenesisHash().send()];
33
+ case 1:
34
+ genesisHash = _a.sent();
35
+ return [2 /*return*/, genesisHash === "EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG"];
36
+ }
37
+ });
38
+ });
39
+ }
40
+ /**
41
+ * Parses event data from a transaction.
42
+ */
43
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
+ export function parseEventData(eventData) {
45
+ if (!eventData)
46
+ return eventData;
47
+ if (Array.isArray(eventData)) {
48
+ return eventData.map(parseEventData);
49
+ }
50
+ if (typeof eventData === "object") {
51
+ if (eventData.constructor.name === "PublicKey") {
52
+ return address(eventData.toString());
53
+ }
54
+ if (BN.isBN(eventData)) {
55
+ return BigInt(eventData.toString());
56
+ }
57
+ // Convert each key from snake_case to camelCase and process the value recursively.
58
+ return Object.fromEntries(Object.entries(eventData).map(function (_a) {
59
+ var key = _a[0], value = _a[1];
60
+ return [snakeToCamel(key), parseEventData(value)];
61
+ }));
62
+ }
63
+ return eventData;
64
+ }
65
+ /**
66
+ * Decodes a raw event according to a supplied IDL.
67
+ */
68
+ export function decodeEvent(idl, rawEvent) {
69
+ var event = new BorshEventCoder(idl).decode(rawEvent);
70
+ if (!event)
71
+ throw new Error("Malformed rawEvent for IDL ".concat(idl.address, ": ").concat(rawEvent));
72
+ return {
73
+ name: event.name,
74
+ data: parseEventData(event.data),
75
+ };
76
+ }
77
+ /**
78
+ * Converts a snake_case string to camelCase.
79
+ */
80
+ function snakeToCamel(s) {
81
+ return s.replace(/(_\w)/g, function (match) { return match[1].toUpperCase(); });
82
+ }
83
+ /**
84
+ * Gets the event name from a raw name.
85
+ */
86
+ export function getEventName(rawName) {
87
+ if (Object.values(SVMEventNames).some(function (name) { return rawName.includes(name); }))
88
+ return rawName;
89
+ throw new Error("Unknown event name: ".concat(rawName));
90
+ }
91
+ /**
92
+ * Unwraps any data structure and converts Address types to strings and Uint8Array to hex or BigInt.
93
+ * Recursively processes nested objects and arrays.
94
+ */
95
+ export function unwrapEventData(data, uint8ArrayKeysAsBigInt, currentKey) {
96
+ if (uint8ArrayKeysAsBigInt === void 0) { uint8ArrayKeysAsBigInt = ["depositId"]; }
97
+ // Handle null/undefined
98
+ if (data == null) {
99
+ return data;
100
+ }
101
+ // Handle BigInt
102
+ if (typeof data === "bigint") {
103
+ return BigNumber.from(data);
104
+ }
105
+ // Handle Uint8Array and byte arrays
106
+ if (data instanceof Uint8Array || isUint8Array(data)) {
107
+ var bytes = data instanceof Uint8Array ? data : new Uint8Array(data);
108
+ var hex = "0x" + Buffer.from(bytes).toString("hex");
109
+ if (currentKey && uint8ArrayKeysAsBigInt.includes(currentKey)) {
110
+ return BigNumber.from(hex);
111
+ }
112
+ return hex;
113
+ }
114
+ // Handle regular arrays (non-byte arrays)
115
+ if (Array.isArray(data)) {
116
+ return data.map(function (item) { return unwrapEventData(item, uint8ArrayKeysAsBigInt); });
117
+ }
118
+ // Handle strings (potential addresses)
119
+ if (typeof data === "string" && isAddress(data)) {
120
+ return SvmAddress.from(data).toBytes32();
121
+ }
122
+ // Handle objects
123
+ if (typeof data === "object") {
124
+ // Special case: if an object is in the context of the fillType key, then
125
+ // parse out the fillType from the object
126
+ if (currentKey === "fillType") {
127
+ var fillType = Object.keys(data)[0];
128
+ switch (fillType) {
129
+ case "FastFill":
130
+ return FillType.FastFill;
131
+ case "ReplacedSlowFill":
132
+ return FillType.ReplacedSlowFill;
133
+ case "SlowFill":
134
+ return FillType.SlowFill;
135
+ default:
136
+ throw new Error("Unknown fill type: ".concat(fillType));
137
+ }
138
+ }
139
+ // Special case: if an object is empty, return 0x
140
+ if (Object.keys(data).length === 0) {
141
+ return "0x";
142
+ }
143
+ return Object.fromEntries(Object.entries(data).map(function (_a) {
144
+ var key = _a[0], value = _a[1];
145
+ return [
146
+ key,
147
+ unwrapEventData(value, uint8ArrayKeysAsBigInt, key),
148
+ ];
149
+ }));
150
+ }
151
+ // Return primitives as is
152
+ return data;
153
+ }
154
+ /**
155
+ * Returns the PDA for the State account.
156
+ * @param programId The SpokePool program ID.
157
+ * @returns The PDA for the State account.
158
+ */
159
+ export function getStatePda(programId) {
160
+ return __awaiter(this, void 0, void 0, function () {
161
+ var intEncoder, seed, statePda;
162
+ return __generator(this, function (_a) {
163
+ switch (_a.label) {
164
+ case 0:
165
+ intEncoder = getU64Encoder();
166
+ seed = intEncoder.encode(0);
167
+ return [4 /*yield*/, getProgramDerivedAddress({
168
+ programAddress: programId,
169
+ seeds: ["state", seed],
170
+ })];
171
+ case 1:
172
+ statePda = (_a.sent())[0];
173
+ return [2 /*return*/, statePda];
174
+ }
175
+ });
176
+ });
177
+ }
178
+ /**
179
+ * Returns the fill status PDA for the given relay data.
180
+ * @param programId The SpokePool program ID.
181
+ * @param relayData The relay data to get the fill status PDA for.
182
+ * @param destinationChainId The destination chain ID.
183
+ * @returns The PDA for the fill status.
184
+ */
185
+ export function getFillStatusPda(programId, relayData, destinationChainId) {
186
+ return __awaiter(this, void 0, void 0, function () {
187
+ var relayDataHash, uint8RelayDataHash, fillStatusPda;
188
+ return __generator(this, function (_a) {
189
+ switch (_a.label) {
190
+ case 0:
191
+ relayDataHash = getRelayDataHash(relayData, destinationChainId);
192
+ uint8RelayDataHash = new Uint8Array(Buffer.from(relayDataHash.slice(2), "hex"));
193
+ return [4 /*yield*/, getProgramDerivedAddress({
194
+ programAddress: programId,
195
+ seeds: ["fills", uint8RelayDataHash],
196
+ })];
197
+ case 1:
198
+ fillStatusPda = (_a.sent())[0];
199
+ return [2 /*return*/, fillStatusPda];
200
+ }
201
+ });
202
+ });
203
+ }
204
+ /**
205
+ * Returns the PDA for a route account on SVM Spoke.
206
+ * @param originToken The origin token address.
207
+ * @param seed The seed for the route account.
208
+ * @param routeChainId The route chain ID.
209
+ * @returns The PDA for the route account.
210
+ */
211
+ export function getRoutePda(originToken, seed, routeChainId) {
212
+ return __awaiter(this, void 0, void 0, function () {
213
+ var intEncoder, addressEncoder, pda;
214
+ return __generator(this, function (_a) {
215
+ switch (_a.label) {
216
+ case 0:
217
+ intEncoder = getU64Encoder();
218
+ addressEncoder = getAddressEncoder();
219
+ return [4 /*yield*/, getProgramDerivedAddress({
220
+ programAddress: address(SvmSpokeClient.SVM_SPOKE_PROGRAM_ADDRESS),
221
+ seeds: ["route", addressEncoder.encode(originToken), intEncoder.encode(seed), intEncoder.encode(routeChainId)],
222
+ })];
223
+ case 1:
224
+ pda = (_a.sent())[0];
225
+ return [2 /*return*/, pda];
226
+ }
227
+ });
228
+ });
229
+ }
230
+ /**
231
+ * Returns the PDA for the Event Authority.
232
+ * @returns The PDA for the Event Authority.
233
+ */
234
+ export var getEventAuthority = function () { return __awaiter(void 0, void 0, void 0, function () {
235
+ var eventAuthority;
236
+ return __generator(this, function (_a) {
237
+ switch (_a.label) {
238
+ case 0: return [4 /*yield*/, getProgramDerivedAddress({
239
+ programAddress: address(SvmSpokeClient.SVM_SPOKE_PROGRAM_ADDRESS),
240
+ seeds: ["__event_authority"],
241
+ })];
242
+ case 1:
243
+ eventAuthority = (_a.sent())[0];
244
+ return [2 /*return*/, eventAuthority];
245
+ }
246
+ });
247
+ }); };
248
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/arch/svm/utils.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,eAAe,EAAO,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,OAAO,EACP,wBAAwB,EACxB,aAAa,EACb,iBAAiB,EAEjB,SAAS,GAEV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAa,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAa,aAAa,EAAe,MAAM,SAAS,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,IAAM,gBAAgB,GAA6D,UACxF,iBAAyB;IAEzB,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC;QACnC,uBAAuB,EAAE;;;4BAChB,qBAAM,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,E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;;;;;;GAMG;AACH,MAAM,UAAgB,WAAW,CAAC,WAAoB,EAAE,IAAY,EAAE,YAAoB;;;;;;oBAClF,UAAU,GAAG,aAAa,EAAE,CAAC;oBAC7B,cAAc,GAAG,iBAAiB,EAAE,CAAC;oBAC7B,qBAAM,wBAAwB,CAAC;4BAC3C,cAAc,EAAE,OAAO,CAAC,cAAc,CAAC,yBAAyB,CAAC;4BACjE,KAAK,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;yBAC/G,CAAC,EAAA;;oBAHK,GAAG,GAAI,CAAA,SAGZ,CAAA,GAHQ;oBAIV,sBAAO,GAAG,EAAC;;;;CACZ;AAED;;;GAGG;AACH,MAAM,CAAC,IAAM,iBAAiB,GAAG;;;;oBACN,qBAAM,wBAAwB,CAAC;oBACtD,cAAc,EAAE,OAAO,CAAC,cAAc,CAAC,yBAAyB,CAAC;oBACjE,KAAK,EAAE,CAAC,mBAAmB,CAAC;iBAC7B,CAAC,EAAA;;gBAHK,cAAc,GAAI,CAAA,SAGvB,CAAA,GAHmB;gBAIrB,sBAAO,cAAc,EAAC;;;KACvB,CAAC"}
@@ -43,7 +43,7 @@ export declare class AcrossConfigStoreClient extends BaseAbstractClient {
43
43
  cumulativeDisabledChainUpdates: DisabledChainsUpdate[];
44
44
  hasLatestConfigStoreVersion: boolean;
45
45
  chainId: number | undefined;
46
- constructor(logger: winston.Logger, configStore: Contract, eventSearchConfig: MakeOptional<EventSearchConfig, "toBlock"> | undefined, configStoreVersion: number);
46
+ constructor(logger: winston.Logger, configStore: Contract, eventSearchConfig: MakeOptional<EventSearchConfig, "to"> | undefined, configStoreVersion: number);
47
47
  getRateModelForBlockNumber(l1Token: string, originChainId: number | string, destinationChainId: number | string, blockNumber?: number | undefined): RateModel;
48
48
  getRouteRateModelForBlockNumber(l1Token: string, route: string, blockNumber?: number | undefined): RateModel | undefined;
49
49
  /**
@@ -39,7 +39,7 @@ var KNOWN_INVALID_TOKEN_CONFIG_UPDATE_HASHES = [
39
39
  var AcrossConfigStoreClient = /** @class */ (function (_super) {
40
40
  __extends(AcrossConfigStoreClient, _super);
41
41
  function AcrossConfigStoreClient(logger, configStore, eventSearchConfig, configStoreVersion) {
42
- if (eventSearchConfig === void 0) { eventSearchConfig = { fromBlock: 0, maxBlockLookBack: 0 }; }
42
+ if (eventSearchConfig === void 0) { eventSearchConfig = { from: 0, maxLookBack: 0 }; }
43
43
  var _this = _super.call(this, eventSearchConfig) || this;
44
44
  _this.logger = logger;
45
45
  _this.configStore = configStore;
@@ -54,8 +54,8 @@ var AcrossConfigStoreClient = /** @class */ (function (_super) {
54
54
  _this.cumulativeConfigStoreVersionUpdates = [];
55
55
  _this.cumulativeDisabledChainUpdates = [];
56
56
  _this.hasLatestConfigStoreVersion = false;
57
- _this.firstBlockToSearch = eventSearchConfig.fromBlock;
58
- _this.latestBlockSearched = 0;
57
+ _this.firstHeightToSearch = eventSearchConfig.from;
58
+ _this.latestHeightSearched = 0;
59
59
  return _this;
60
60
  }
61
61
  AcrossConfigStoreClient.prototype.getRateModelForBlockNumber = function (l1Token, originChainId, destinationChainId, blockNumber) {
@@ -299,7 +299,7 @@ var AcrossConfigStoreClient = /** @class */ (function (_super) {
299
299
  return [2 /*return*/, {
300
300
  success: true,
301
301
  chainId: chainId,
302
- searchEndBlock: searchConfig.toBlock,
302
+ searchEndBlock: searchConfig.to,
303
303
  events: {
304
304
  updatedTokenConfigEvents: updatedTokenConfigSortableEvents,
305
305
  updatedGlobalConfigEvents: updatedGlobalConfigSortableEvents,
@@ -498,9 +498,9 @@ var AcrossConfigStoreClient = /** @class */ (function (_super) {
498
498
  _loop_1(i);
499
499
  }
500
500
  this.hasLatestConfigStoreVersion = this.hasValidConfigStoreVersionForTimestamp();
501
- this.latestBlockSearched = result.searchEndBlock;
502
- this.firstBlockToSearch = result.searchEndBlock + 1; // Next iteration should start off from where this one ended.
503
- this.eventSearchConfig.toBlock = undefined; // Caller can re-set on subsequent updates if necessary
501
+ this.latestHeightSearched = result.searchEndBlock;
502
+ this.firstHeightToSearch = result.searchEndBlock + 1; // Next iteration should start off from where this one ended.
503
+ this.eventSearchConfig.to = undefined; // Caller can re-set on subsequent updates if necessary
504
504
  this.chainId = (_e = this.chainId) !== null && _e !== void 0 ? _e : chainId; // Update on the first run only.
505
505
  this.isUpdated = true;
506
506
  this.logger.debug({ at: "ConfigStore", message: "ConfigStore client updated!" });