@across-protocol/sdk 4.1.63-beta.0 → 4.1.63

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 (366) hide show
  1. package/dist/cjs/arch/evm/SpokeUtils.d.ts +1 -1
  2. package/dist/cjs/arch/evm/SpokeUtils.js +5 -6
  3. package/dist/cjs/arch/evm/SpokeUtils.js.map +1 -1
  4. package/dist/cjs/arch/svm/index.d.ts +1 -5
  5. package/dist/cjs/arch/svm/index.js +2 -6
  6. package/dist/cjs/arch/svm/index.js.map +1 -1
  7. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +1 -1
  8. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +7 -7
  9. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
  10. package/dist/cjs/clients/BaseAbstractClient.d.ts +5 -6
  11. package/dist/cjs/clients/BaseAbstractClient.js +19 -30
  12. package/dist/cjs/clients/BaseAbstractClient.js.map +1 -1
  13. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js +11 -15
  14. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  15. package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js +1 -1
  16. package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
  17. package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.d.ts +90 -90
  18. package/dist/cjs/clients/HubPoolClient.d.ts +1 -1
  19. package/dist/cjs/clients/HubPoolClient.js +16 -16
  20. package/dist/cjs/clients/HubPoolClient.js.map +1 -1
  21. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +3 -3
  22. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js +20 -23
  23. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
  24. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.d.ts +5 -5
  25. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js +54 -50
  26. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
  27. package/dist/cjs/clients/SpokePoolClient/index.d.ts +0 -3
  28. package/dist/cjs/clients/SpokePoolClient/index.js +1 -8
  29. package/dist/cjs/clients/SpokePoolClient/index.js.map +1 -1
  30. package/dist/cjs/clients/index.d.ts +1 -1
  31. package/dist/cjs/clients/index.js +1 -2
  32. package/dist/cjs/clients/index.js.map +1 -1
  33. package/dist/cjs/clients/mocks/MockConfigStoreClient.d.ts +1 -1
  34. package/dist/cjs/clients/mocks/MockConfigStoreClient.js +2 -2
  35. package/dist/cjs/clients/mocks/MockConfigStoreClient.js.map +1 -1
  36. package/dist/cjs/clients/mocks/MockHubPoolClient.js +2 -2
  37. package/dist/cjs/clients/mocks/MockHubPoolClient.js.map +1 -1
  38. package/dist/cjs/clients/mocks/MockSpokePoolClient.js +4 -7
  39. package/dist/cjs/clients/mocks/MockSpokePoolClient.js.map +1 -1
  40. package/dist/cjs/gasPriceOracle/adapters/arbitrum.d.ts +2 -2
  41. package/dist/cjs/gasPriceOracle/adapters/arbitrum.js.map +1 -1
  42. package/dist/cjs/gasPriceOracle/adapters/ethereum.d.ts +4 -4
  43. package/dist/cjs/gasPriceOracle/adapters/ethereum.js.map +1 -1
  44. package/dist/cjs/gasPriceOracle/adapters/linea-viem.js +2 -3
  45. package/dist/cjs/gasPriceOracle/adapters/linea-viem.js.map +1 -1
  46. package/dist/cjs/gasPriceOracle/adapters/polygon.d.ts +3 -3
  47. package/dist/cjs/gasPriceOracle/index.d.ts +1 -1
  48. package/dist/cjs/gasPriceOracle/oracle.d.ts +3 -4
  49. package/dist/cjs/gasPriceOracle/oracle.js +9 -16
  50. package/dist/cjs/gasPriceOracle/oracle.js.map +1 -1
  51. package/dist/cjs/gasPriceOracle/types.d.ts +1 -6
  52. package/dist/cjs/index.d.ts +1 -0
  53. package/dist/cjs/index.js +2 -1
  54. package/dist/cjs/index.js.map +1 -1
  55. package/dist/cjs/interfaces/SpokePool.d.ts +0 -7
  56. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
  57. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js +4 -5
  58. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
  59. package/dist/cjs/relayFeeCalculator/chain-queries/factory.d.ts +11 -4
  60. package/dist/cjs/relayFeeCalculator/chain-queries/factory.js +1 -7
  61. package/dist/cjs/relayFeeCalculator/chain-queries/factory.js.map +1 -1
  62. package/dist/cjs/relayFeeCalculator/chain-queries/index.d.ts +0 -1
  63. package/dist/cjs/relayFeeCalculator/chain-queries/index.js +0 -1
  64. package/dist/cjs/relayFeeCalculator/chain-queries/index.js.map +1 -1
  65. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +9 -0
  66. package/dist/cjs/svm/eventsClient.d.ts +15 -0
  67. package/dist/cjs/{arch/svm → svm}/eventsClient.js +28 -60
  68. package/dist/cjs/svm/eventsClient.js.map +1 -0
  69. package/dist/cjs/svm/index.d.ts +3 -0
  70. package/dist/cjs/svm/index.js +8 -0
  71. package/dist/cjs/svm/index.js.map +1 -0
  72. package/dist/{esm/arch → cjs}/svm/types.d.ts +4 -9
  73. package/dist/cjs/svm/types.js.map +1 -0
  74. package/dist/cjs/svm/utils/events.d.ts +8 -0
  75. package/dist/cjs/svm/utils/events.js +47 -0
  76. package/dist/cjs/svm/utils/events.js.map +1 -0
  77. package/dist/cjs/svm/utils/helpers.d.ts +2 -0
  78. package/dist/cjs/svm/utils/helpers.js +19 -0
  79. package/dist/cjs/svm/utils/helpers.js.map +1 -0
  80. package/dist/cjs/svm/utils/index.d.ts +1 -0
  81. package/dist/cjs/svm/utils/index.js +5 -0
  82. package/dist/cjs/svm/utils/index.js.map +1 -0
  83. package/dist/cjs/utils/AddressUtils.d.ts +3 -9
  84. package/dist/cjs/utils/AddressUtils.js +6 -36
  85. package/dist/cjs/utils/AddressUtils.js.map +1 -1
  86. package/dist/cjs/utils/ArrayUtils.d.ts +0 -1
  87. package/dist/cjs/utils/ArrayUtils.js +1 -6
  88. package/dist/cjs/utils/ArrayUtils.js.map +1 -1
  89. package/dist/cjs/utils/EventUtils.d.ts +4 -4
  90. package/dist/cjs/utils/EventUtils.js +4 -7
  91. package/dist/cjs/utils/EventUtils.js.map +1 -1
  92. package/dist/cjs/utils/JSONUtils.js +0 -3
  93. package/dist/cjs/utils/JSONUtils.js.map +1 -1
  94. package/dist/cjs/utils/SpokeUtils.js +0 -5
  95. package/dist/cjs/utils/SpokeUtils.js.map +1 -1
  96. package/dist/cjs/utils/TokenUtils.d.ts +18 -0
  97. package/dist/esm/arch/evm/SpokeUtils.d.ts +1 -1
  98. package/dist/esm/arch/evm/SpokeUtils.js +5 -6
  99. package/dist/esm/arch/evm/SpokeUtils.js.map +1 -1
  100. package/dist/esm/arch/svm/index.d.ts +1 -5
  101. package/dist/esm/arch/svm/index.js +1 -5
  102. package/dist/esm/arch/svm/index.js.map +1 -1
  103. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +1 -1
  104. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +7 -7
  105. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
  106. package/dist/esm/clients/BaseAbstractClient.d.ts +5 -6
  107. package/dist/esm/clients/BaseAbstractClient.js +19 -30
  108. package/dist/esm/clients/BaseAbstractClient.js.map +1 -1
  109. package/dist/esm/clients/BundleDataClient/BundleDataClient.js +14 -17
  110. package/dist/esm/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  111. package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js +1 -1
  112. package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
  113. package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.d.ts +90 -90
  114. package/dist/esm/clients/HubPoolClient.d.ts +1 -1
  115. package/dist/esm/clients/HubPoolClient.js +16 -16
  116. package/dist/esm/clients/HubPoolClient.js.map +1 -1
  117. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +3 -3
  118. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js +20 -23
  119. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
  120. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.d.ts +7 -7
  121. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js +55 -51
  122. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
  123. package/dist/esm/clients/SpokePoolClient/index.d.ts +0 -8
  124. package/dist/esm/clients/SpokePoolClient/index.js +0 -10
  125. package/dist/esm/clients/SpokePoolClient/index.js.map +1 -1
  126. package/dist/esm/clients/index.d.ts +1 -1
  127. package/dist/esm/clients/index.js +1 -1
  128. package/dist/esm/clients/index.js.map +1 -1
  129. package/dist/esm/clients/mocks/MockConfigStoreClient.d.ts +1 -1
  130. package/dist/esm/clients/mocks/MockConfigStoreClient.js +2 -2
  131. package/dist/esm/clients/mocks/MockConfigStoreClient.js.map +1 -1
  132. package/dist/esm/clients/mocks/MockHubPoolClient.js +2 -2
  133. package/dist/esm/clients/mocks/MockHubPoolClient.js.map +1 -1
  134. package/dist/esm/clients/mocks/MockSpokePoolClient.js +5 -8
  135. package/dist/esm/clients/mocks/MockSpokePoolClient.js.map +1 -1
  136. package/dist/esm/gasPriceOracle/adapters/arbitrum.d.ts +2 -2
  137. package/dist/esm/gasPriceOracle/adapters/arbitrum.js.map +1 -1
  138. package/dist/esm/gasPriceOracle/adapters/ethereum.d.ts +4 -4
  139. package/dist/esm/gasPriceOracle/adapters/ethereum.js.map +1 -1
  140. package/dist/esm/gasPriceOracle/adapters/linea-viem.js +2 -3
  141. package/dist/esm/gasPriceOracle/adapters/linea-viem.js.map +1 -1
  142. package/dist/esm/gasPriceOracle/adapters/polygon.d.ts +4 -4
  143. package/dist/esm/gasPriceOracle/adapters/polygon.js +1 -1
  144. package/dist/esm/gasPriceOracle/index.d.ts +1 -1
  145. package/dist/esm/gasPriceOracle/oracle.d.ts +3 -4
  146. package/dist/esm/gasPriceOracle/oracle.js +9 -18
  147. package/dist/esm/gasPriceOracle/oracle.js.map +1 -1
  148. package/dist/esm/gasPriceOracle/types.d.ts +1 -6
  149. package/dist/esm/index.d.ts +1 -0
  150. package/dist/esm/index.js +2 -0
  151. package/dist/esm/index.js.map +1 -1
  152. package/dist/esm/interfaces/SpokePool.d.ts +0 -7
  153. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
  154. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js +3 -4
  155. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
  156. package/dist/esm/relayFeeCalculator/chain-queries/factory.d.ts +11 -4
  157. package/dist/esm/relayFeeCalculator/chain-queries/factory.js +2 -8
  158. package/dist/esm/relayFeeCalculator/chain-queries/factory.js.map +1 -1
  159. package/dist/esm/relayFeeCalculator/chain-queries/index.d.ts +0 -1
  160. package/dist/esm/relayFeeCalculator/chain-queries/index.js +0 -1
  161. package/dist/esm/relayFeeCalculator/chain-queries/index.js.map +1 -1
  162. package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +9 -0
  163. package/dist/esm/svm/eventsClient.d.ts +51 -0
  164. package/dist/esm/{arch/svm → svm}/eventsClient.js +27 -69
  165. package/dist/esm/svm/eventsClient.js.map +1 -0
  166. package/dist/esm/svm/index.d.ts +3 -0
  167. package/dist/esm/svm/index.js +5 -0
  168. package/dist/esm/svm/index.js.map +1 -0
  169. package/dist/{cjs/arch → esm}/svm/types.d.ts +4 -9
  170. package/dist/esm/svm/types.js.map +1 -0
  171. package/dist/esm/svm/utils/events.d.ts +17 -0
  172. package/dist/esm/svm/utils/events.js +55 -0
  173. package/dist/esm/svm/utils/events.js.map +1 -0
  174. package/dist/esm/svm/utils/helpers.d.ts +5 -0
  175. package/dist/esm/svm/utils/helpers.js +18 -0
  176. package/dist/esm/svm/utils/helpers.js.map +1 -0
  177. package/dist/esm/svm/utils/index.d.ts +1 -0
  178. package/dist/esm/svm/utils/index.js +2 -0
  179. package/dist/esm/svm/utils/index.js.map +1 -0
  180. package/dist/esm/utils/AddressUtils.d.ts +3 -9
  181. package/dist/esm/utils/AddressUtils.js +6 -41
  182. package/dist/esm/utils/AddressUtils.js.map +1 -1
  183. package/dist/esm/utils/ArrayUtils.d.ts +0 -6
  184. package/dist/esm/utils/ArrayUtils.js +0 -9
  185. package/dist/esm/utils/ArrayUtils.js.map +1 -1
  186. package/dist/esm/utils/EventUtils.d.ts +4 -4
  187. package/dist/esm/utils/EventUtils.js +4 -7
  188. package/dist/esm/utils/EventUtils.js.map +1 -1
  189. package/dist/esm/utils/JSONUtils.js +0 -3
  190. package/dist/esm/utils/JSONUtils.js.map +1 -1
  191. package/dist/esm/utils/SpokeUtils.js +0 -5
  192. package/dist/esm/utils/SpokeUtils.js.map +1 -1
  193. package/dist/esm/utils/TokenUtils.d.ts +18 -0
  194. package/dist/types/arch/evm/SpokeUtils.d.ts +1 -1
  195. package/dist/types/arch/evm/SpokeUtils.d.ts.map +1 -1
  196. package/dist/types/arch/svm/index.d.ts +1 -5
  197. package/dist/types/arch/svm/index.d.ts.map +1 -1
  198. package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +1 -1
  199. package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts.map +1 -1
  200. package/dist/types/clients/BaseAbstractClient.d.ts +5 -6
  201. package/dist/types/clients/BaseAbstractClient.d.ts.map +1 -1
  202. package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts.map +1 -1
  203. package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts +90 -90
  204. package/dist/types/clients/HubPoolClient.d.ts +1 -1
  205. package/dist/types/clients/HubPoolClient.d.ts.map +1 -1
  206. package/dist/types/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +3 -3
  207. package/dist/types/clients/SpokePoolClient/EVMSpokePoolClient.d.ts.map +1 -1
  208. package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts +7 -7
  209. package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts.map +1 -1
  210. package/dist/types/clients/SpokePoolClient/index.d.ts +0 -8
  211. package/dist/types/clients/SpokePoolClient/index.d.ts.map +1 -1
  212. package/dist/types/clients/index.d.ts +1 -1
  213. package/dist/types/clients/index.d.ts.map +1 -1
  214. package/dist/types/clients/mocks/MockConfigStoreClient.d.ts +1 -1
  215. package/dist/types/clients/mocks/MockConfigStoreClient.d.ts.map +1 -1
  216. package/dist/types/clients/mocks/MockSpokePoolClient.d.ts.map +1 -1
  217. package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts +2 -2
  218. package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts.map +1 -1
  219. package/dist/types/gasPriceOracle/adapters/ethereum.d.ts +4 -4
  220. package/dist/types/gasPriceOracle/adapters/ethereum.d.ts.map +1 -1
  221. package/dist/types/gasPriceOracle/adapters/linea-viem.d.ts.map +1 -1
  222. package/dist/types/gasPriceOracle/adapters/polygon.d.ts +4 -4
  223. package/dist/types/gasPriceOracle/adapters/polygon.d.ts.map +1 -1
  224. package/dist/types/gasPriceOracle/index.d.ts +1 -1
  225. package/dist/types/gasPriceOracle/index.d.ts.map +1 -1
  226. package/dist/types/gasPriceOracle/oracle.d.ts +3 -4
  227. package/dist/types/gasPriceOracle/oracle.d.ts.map +1 -1
  228. package/dist/types/gasPriceOracle/types.d.ts +1 -6
  229. package/dist/types/gasPriceOracle/types.d.ts.map +1 -1
  230. package/dist/types/index.d.ts +1 -0
  231. package/dist/types/index.d.ts.map +1 -1
  232. package/dist/types/interfaces/SpokePool.d.ts +0 -7
  233. package/dist/types/interfaces/SpokePool.d.ts.map +1 -1
  234. package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
  235. package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts.map +1 -1
  236. package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts +11 -4
  237. package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
  238. package/dist/types/relayFeeCalculator/chain-queries/index.d.ts +0 -1
  239. package/dist/types/relayFeeCalculator/chain-queries/index.d.ts.map +1 -1
  240. package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +9 -0
  241. package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
  242. package/dist/types/svm/eventsClient.d.ts +52 -0
  243. package/dist/types/svm/eventsClient.d.ts.map +1 -0
  244. package/dist/types/svm/index.d.ts +4 -0
  245. package/dist/types/svm/index.d.ts.map +1 -0
  246. package/dist/types/{arch/svm → svm}/types.d.ts +4 -9
  247. package/dist/types/svm/types.d.ts.map +1 -0
  248. package/dist/types/svm/utils/events.d.ts +18 -0
  249. package/dist/types/svm/utils/events.d.ts.map +1 -0
  250. package/dist/types/svm/utils/helpers.d.ts +6 -0
  251. package/dist/types/svm/utils/helpers.d.ts.map +1 -0
  252. package/dist/types/svm/utils/index.d.ts +2 -0
  253. package/dist/types/svm/utils/index.d.ts.map +1 -0
  254. package/dist/types/utils/AddressUtils.d.ts +3 -9
  255. package/dist/types/utils/AddressUtils.d.ts.map +1 -1
  256. package/dist/types/utils/ArrayUtils.d.ts +0 -6
  257. package/dist/types/utils/ArrayUtils.d.ts.map +1 -1
  258. package/dist/types/utils/EventUtils.d.ts +4 -4
  259. package/dist/types/utils/EventUtils.d.ts.map +1 -1
  260. package/dist/types/utils/JSONUtils.d.ts.map +1 -1
  261. package/dist/types/utils/SpokeUtils.d.ts.map +1 -1
  262. package/dist/types/utils/TokenUtils.d.ts +18 -0
  263. package/dist/types/utils/TokenUtils.d.ts.map +1 -1
  264. package/package.json +2 -5
  265. package/src/arch/evm/SpokeUtils.ts +5 -5
  266. package/src/arch/svm/index.ts +1 -5
  267. package/src/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.ts +7 -7
  268. package/src/clients/BaseAbstractClient.ts +13 -20
  269. package/src/clients/BundleDataClient/BundleDataClient.ts +19 -28
  270. package/src/clients/BundleDataClient/utils/PoolRebalanceUtils.ts +1 -1
  271. package/src/clients/HubPoolClient.ts +16 -16
  272. package/src/clients/SpokePoolClient/EVMSpokePoolClient.ts +21 -23
  273. package/src/clients/SpokePoolClient/SpokePoolClient.ts +56 -44
  274. package/src/clients/SpokePoolClient/index.ts +0 -11
  275. package/src/clients/index.ts +1 -1
  276. package/src/clients/mocks/MockConfigStoreClient.ts +2 -2
  277. package/src/clients/mocks/MockHubPoolClient.ts +2 -2
  278. package/src/clients/mocks/MockSpokePoolClient.ts +4 -9
  279. package/src/gasPriceOracle/adapters/arbitrum.ts +2 -5
  280. package/src/gasPriceOracle/adapters/ethereum.ts +4 -7
  281. package/src/gasPriceOracle/adapters/linea-viem.ts +1 -3
  282. package/src/gasPriceOracle/adapters/polygon.ts +6 -6
  283. package/src/gasPriceOracle/index.ts +1 -1
  284. package/src/gasPriceOracle/oracle.ts +4 -20
  285. package/src/gasPriceOracle/types.ts +1 -7
  286. package/src/index.ts +1 -0
  287. package/src/interfaces/SpokePool.ts +0 -7
  288. package/src/relayFeeCalculator/chain-queries/baseQuery.ts +3 -5
  289. package/src/relayFeeCalculator/chain-queries/factory.ts +5 -21
  290. package/src/relayFeeCalculator/chain-queries/index.ts +0 -1
  291. package/src/{arch/svm → svm}/eventsClient.ts +45 -67
  292. package/src/svm/index.ts +3 -0
  293. package/src/{arch/svm → svm}/types.ts +4 -21
  294. package/src/svm/utils/events.ts +58 -0
  295. package/src/svm/utils/helpers.ts +9 -0
  296. package/src/svm/utils/index.ts +1 -0
  297. package/src/utils/AddressUtils.ts +6 -49
  298. package/src/utils/ArrayUtils.ts +0 -12
  299. package/src/utils/EventUtils.ts +11 -11
  300. package/src/utils/JSONUtils.ts +0 -2
  301. package/src/utils/SpokeUtils.ts +1 -5
  302. package/dist/cjs/arch/svm/SpokeUtils.d.ts +0 -20
  303. package/dist/cjs/arch/svm/SpokeUtils.js +0 -428
  304. package/dist/cjs/arch/svm/SpokeUtils.js.map +0 -1
  305. package/dist/cjs/arch/svm/constants.d.ts +0 -1
  306. package/dist/cjs/arch/svm/constants.js +0 -5
  307. package/dist/cjs/arch/svm/constants.js.map +0 -1
  308. package/dist/cjs/arch/svm/eventsClient.d.ts +0 -21
  309. package/dist/cjs/arch/svm/eventsClient.js.map +0 -1
  310. package/dist/cjs/arch/svm/types.js.map +0 -1
  311. package/dist/cjs/arch/svm/utils.d.ts +0 -17
  312. package/dist/cjs/arch/svm/utils.js +0 -204
  313. package/dist/cjs/arch/svm/utils.js.map +0 -1
  314. package/dist/cjs/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +0 -23
  315. package/dist/cjs/clients/SpokePoolClient/SVMSpokePoolClient.js +0 -145
  316. package/dist/cjs/clients/SpokePoolClient/SVMSpokePoolClient.js.map +0 -1
  317. package/dist/cjs/gasPriceOracle/adapters/solana.d.ts +0 -4
  318. package/dist/cjs/gasPriceOracle/adapters/solana.js +0 -43
  319. package/dist/cjs/gasPriceOracle/adapters/solana.js.map +0 -1
  320. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.d.ts +0 -31
  321. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js +0 -136
  322. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js.map +0 -1
  323. package/dist/esm/arch/svm/SpokeUtils.d.ts +0 -94
  324. package/dist/esm/arch/svm/SpokeUtils.js +0 -513
  325. package/dist/esm/arch/svm/SpokeUtils.js.map +0 -1
  326. package/dist/esm/arch/svm/constants.d.ts +0 -1
  327. package/dist/esm/arch/svm/constants.js +0 -2
  328. package/dist/esm/arch/svm/constants.js.map +0 -1
  329. package/dist/esm/arch/svm/eventsClient.d.ts +0 -67
  330. package/dist/esm/arch/svm/eventsClient.js.map +0 -1
  331. package/dist/esm/arch/svm/types.js.map +0 -1
  332. package/dist/esm/arch/svm/utils.d.ts +0 -59
  333. package/dist/esm/arch/svm/utils.js +0 -248
  334. package/dist/esm/arch/svm/utils.js.map +0 -1
  335. package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +0 -67
  336. package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.js +0 -196
  337. package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.js.map +0 -1
  338. package/dist/esm/gasPriceOracle/adapters/solana.d.ts +0 -8
  339. package/dist/esm/gasPriceOracle/adapters/solana.js +0 -43
  340. package/dist/esm/gasPriceOracle/adapters/solana.js.map +0 -1
  341. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.d.ts +0 -66
  342. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js +0 -169
  343. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js.map +0 -1
  344. package/dist/types/arch/svm/SpokeUtils.d.ts +0 -95
  345. package/dist/types/arch/svm/SpokeUtils.d.ts.map +0 -1
  346. package/dist/types/arch/svm/constants.d.ts +0 -2
  347. package/dist/types/arch/svm/constants.d.ts.map +0 -1
  348. package/dist/types/arch/svm/eventsClient.d.ts +0 -68
  349. package/dist/types/arch/svm/eventsClient.d.ts.map +0 -1
  350. package/dist/types/arch/svm/types.d.ts.map +0 -1
  351. package/dist/types/arch/svm/utils.d.ts +0 -60
  352. package/dist/types/arch/svm/utils.d.ts.map +0 -1
  353. package/dist/types/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +0 -68
  354. package/dist/types/clients/SpokePoolClient/SVMSpokePoolClient.d.ts.map +0 -1
  355. package/dist/types/gasPriceOracle/adapters/solana.d.ts +0 -9
  356. package/dist/types/gasPriceOracle/adapters/solana.d.ts.map +0 -1
  357. package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts +0 -67
  358. package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts.map +0 -1
  359. package/src/arch/svm/SpokeUtils.ts +0 -526
  360. package/src/arch/svm/constants.ts +0 -1
  361. package/src/arch/svm/utils.ts +0 -222
  362. package/src/clients/SpokePoolClient/SVMSpokePoolClient.ts +0 -244
  363. package/src/gasPriceOracle/adapters/solana.ts +0 -45
  364. package/src/relayFeeCalculator/chain-queries/svmQuery.ts +0 -193
  365. /package/dist/cjs/{arch/svm → svm}/types.js +0 -0
  366. /package/dist/esm/{arch/svm → svm}/types.js +0 -0
@@ -1,196 +0,0 @@
1
- import { __assign, __awaiter, __extends, __generator, __spreadArray } from "tslib";
2
- import { SVMEventNames, unwrapEventData, getFillDeadline, getTimestampForSlot, getStatePda, SvmCpiEventsClient, relayFillStatus, fillStatusArray, } from "../../arch/svm";
3
- import { sortEventsAscendingInPlace, } from "../../utils";
4
- import { isUpdateFailureReason } from "../BaseAbstractClient";
5
- import { knownEventNames, SpokePoolClient } from "./SpokePoolClient";
6
- /**
7
- * SvmSpokePoolClient is a client for the SVM SpokePool program. It extends the base SpokePoolClient
8
- * and implements the abstract methods required for interacting with an SVM Spoke Pool.
9
- */
10
- var SvmSpokePoolClient = /** @class */ (function (_super) {
11
- __extends(SvmSpokePoolClient, _super);
12
- /**
13
- * Protected constructor. Use the async create() method to instantiate.
14
- */
15
- function SvmSpokePoolClient(logger, hubPoolClient, chainId, deploymentSlot, // Using slot instead of block number for SVM
16
- eventSearchConfig, svmEventsClient, programId, statePda) {
17
- var _this =
18
- // Convert deploymentSlot to number for base class, might need refinement
19
- _super.call(this, logger, hubPoolClient, chainId, Number(deploymentSlot), eventSearchConfig) || this;
20
- _this.svmEventsClient = svmEventsClient;
21
- _this.programId = programId;
22
- _this.statePda = statePda;
23
- return _this;
24
- }
25
- /**
26
- * Factory method to asynchronously create an instance of SvmSpokePoolClient.
27
- */
28
- SvmSpokePoolClient.create = function (logger, hubPoolClient, chainId, deploymentSlot, eventSearchConfig, // Provide default
29
- rpc) {
30
- if (eventSearchConfig === void 0) { eventSearchConfig = { from: 0, maxLookBack: 0 }; }
31
- return __awaiter(this, void 0, void 0, function () {
32
- var svmEventsClient, programId, statePda;
33
- return __generator(this, function (_a) {
34
- switch (_a.label) {
35
- case 0: return [4 /*yield*/, SvmCpiEventsClient.create(rpc)];
36
- case 1:
37
- svmEventsClient = _a.sent();
38
- programId = svmEventsClient.getProgramAddress();
39
- return [4 /*yield*/, getStatePda(programId)];
40
- case 2:
41
- statePda = _a.sent();
42
- return [2 /*return*/, new SvmSpokePoolClient(logger, hubPoolClient, chainId, deploymentSlot, eventSearchConfig, svmEventsClient, programId, statePda)];
43
- }
44
- });
45
- });
46
- };
47
- /**
48
- * Factory method to asynchronously create an instance of SvmSpokePoolClient with an existing event client.
49
- */
50
- SvmSpokePoolClient.createWithExistingEventClient = function (logger, hubPoolClient, chainId, deploymentSlot, eventSearchConfig, // Provide default
51
- eventClient) {
52
- if (eventSearchConfig === void 0) { eventSearchConfig = { from: 0, maxLookBack: 0 }; }
53
- return __awaiter(this, void 0, void 0, function () {
54
- var programId, statePda;
55
- return __generator(this, function (_a) {
56
- switch (_a.label) {
57
- case 0:
58
- programId = eventClient.getProgramAddress();
59
- return [4 /*yield*/, getStatePda(programId)];
60
- case 1:
61
- statePda = _a.sent();
62
- return [2 /*return*/, new SvmSpokePoolClient(logger, hubPoolClient, chainId, deploymentSlot, eventSearchConfig, eventClient, programId, statePda)];
63
- }
64
- });
65
- });
66
- };
67
- SvmSpokePoolClient.prototype._queryableEventNames = function () {
68
- // We want to take the internal event names relevant to
69
- // the SVM SpokePoolClient and filter them against the
70
- // knownEventNames list that we reference in practice
71
- var internalEventNames = Object.values(SVMEventNames);
72
- return internalEventNames.filter(function (e) { return knownEventNames.includes(e); });
73
- };
74
- /**
75
- * Performs an update to refresh the state of this client by querying SVM events.
76
- */
77
- SvmSpokePoolClient.prototype._update = function (eventsToQuery) {
78
- return __awaiter(this, void 0, void 0, function () {
79
- var searchConfig, reason, deploymentSlot, eventSearchConfigs, spokePoolAddress, timerStart, _a, currentTime, eventsQueried, errMsg;
80
- var _this = this;
81
- return __generator(this, function (_b) {
82
- switch (_b.label) {
83
- case 0: return [4 /*yield*/, this.updateSearchConfig(this.svmEventsClient.getRpc())];
84
- case 1:
85
- searchConfig = _b.sent();
86
- if (isUpdateFailureReason(searchConfig)) {
87
- reason = searchConfig;
88
- return [2 /*return*/, { success: false, reason: reason }];
89
- }
90
- deploymentSlot = BigInt(this.deploymentBlock);
91
- eventSearchConfigs = eventsToQuery.map(function (eventName) {
92
- if (!_this._queryableEventNames().includes(eventName)) {
93
- throw new Error("SpokePoolClient: Cannot query unrecognised SpokePool event name: ".concat(eventName));
94
- }
95
- var _searchConfig = __assign({}, searchConfig); // shallow copy
96
- // By default, an event's query range is controlled by the `eventSearchConfig` passed in during instantiation.
97
- // However, certain events have special overriding requirements to their search ranges:
98
- // - EnabledDepositRoute: The full history is always required, so override the requested fromBlock.
99
- if (eventName === "EnabledDepositRoute" && !_this.isUpdated) {
100
- _searchConfig.from = Number(deploymentSlot);
101
- }
102
- return _searchConfig;
103
- });
104
- spokePoolAddress = this.svmEventsClient.getProgramAddress();
105
- this.log("debug", "Updating SpokePool client for chain ".concat(this.chainId), {
106
- eventsToQuery: eventsToQuery,
107
- searchConfig: searchConfig,
108
- spokePool: spokePoolAddress,
109
- });
110
- timerStart = Date.now();
111
- return [4 /*yield*/, Promise.all(__spreadArray([
112
- this.svmEventsClient.getRpc().getBlockTime(BigInt(searchConfig.to)).send()
113
- ], eventsToQuery.map(function (eventName, idx) { return __awaiter(_this, void 0, void 0, function () {
114
- var config, events;
115
- return __generator(this, function (_a) {
116
- switch (_a.label) {
117
- case 0:
118
- config = eventSearchConfigs[idx];
119
- return [4 /*yield*/, this.svmEventsClient.queryEvents(eventName, BigInt(config.from), BigInt(config.to), {
120
- limit: config.maxLookBack,
121
- })];
122
- case 1:
123
- events = _a.sent();
124
- return [2 /*return*/, events.map(function (event) { return (__assign({ txnRef: event.signature, blockNumber: Number(event.slot), txnIndex: 0, logIndex: 0 }, unwrapEventData(event.data))); })];
125
- }
126
- });
127
- }); }), true))];
128
- case 2:
129
- _a = _b.sent(), currentTime = _a[0], eventsQueried = _a.slice(1);
130
- this.log("debug", "Time to query new events from RPC for ".concat(this.chainId, ": ").concat(Date.now() - timerStart, " ms"));
131
- if (currentTime < this.currentTime) {
132
- errMsg = "currentTime: ".concat(currentTime, " < ").concat(this.currentTime);
133
- throw new Error("SvmSpokePoolClient::update: ".concat(errMsg));
134
- }
135
- // Sort all events to ensure they are stored in a consistent order.
136
- eventsQueried.forEach(function (events) { return sortEventsAscendingInPlace(events); });
137
- return [2 /*return*/, {
138
- success: true,
139
- currentTime: Number(currentTime),
140
- searchEndBlock: searchConfig.to,
141
- events: eventsQueried,
142
- }];
143
- }
144
- });
145
- });
146
- };
147
- /**
148
- * Retrieves the fill deadline buffer fetched from the State PDA.
149
- * @note This function assumes that fill deadline buffer is a constant value in svm environments.
150
- */
151
- SvmSpokePoolClient.prototype.getMaxFillDeadlineInRange = function (_startSlot, _endSlot) {
152
- return getFillDeadline(this.svmEventsClient.getRpc(), this.statePda);
153
- };
154
- /**
155
- * Retrieves the timestamp for a given SVM slot number.
156
- */
157
- SvmSpokePoolClient.prototype.getTimestampForBlock = function (slot) {
158
- return getTimestampForSlot(this.svmEventsClient.getRpc(), slot);
159
- };
160
- /**
161
- * Retrieves the timestamp for a given SVM slot number.
162
- * @note This function uses the same underlying function as getTimestampForBlock.
163
- * It is kept for consistency with the EVM SpokePoolClient.
164
- */
165
- SvmSpokePoolClient.prototype.getTimeAt = function (slot) {
166
- return getTimestampForSlot(this.svmEventsClient.getRpc(), slot);
167
- };
168
- /**
169
- * Finds a deposit based on its deposit ID on the SVM chain.
170
- * TODO: Implement SVM state query for deposit details.
171
- */
172
- SvmSpokePoolClient.prototype.findDeposit = function (_depositId) {
173
- throw new Error("findDeposit not implemented for SVM");
174
- };
175
- /**
176
- * Retrieves the fill status for a given relay data from the SVM chain.
177
- */
178
- SvmSpokePoolClient.prototype.relayFillStatus = function (relayData, atHeight, destinationChainId) {
179
- destinationChainId !== null && destinationChainId !== void 0 ? destinationChainId : (destinationChainId = this.chainId);
180
- return relayFillStatus(this.programId, relayData, destinationChainId, this.svmEventsClient, atHeight);
181
- };
182
- /**
183
- * Retrieves the fill status for an array of given relay data.
184
- * @param relayData The array relay data to retrieve the fill status for.
185
- * @param atHeight The slot at which to query the fill status.
186
- * @returns The fill status for each of the given relay data.
187
- */
188
- SvmSpokePoolClient.prototype.fillStatusArray = function (relayData, atHeight, destinationChainId) {
189
- // @note: deploymentBlock actually refers to the deployment slot. Also, blockTag should be a slot number.
190
- destinationChainId !== null && destinationChainId !== void 0 ? destinationChainId : (destinationChainId = this.chainId);
191
- return fillStatusArray(this.programId, relayData, destinationChainId, this.svmEventsClient, atHeight, this.logger);
192
- };
193
- return SvmSpokePoolClient;
194
- }(SpokePoolClient));
195
- export { SvmSpokePoolClient };
196
- //# sourceMappingURL=SVMSpokePoolClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SVMSpokePoolClient.js","sourceRoot":"","sources":["../../../../src/clients/SpokePoolClient/SVMSpokePoolClient.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAKL,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAmB,MAAM,mBAAmB,CAAC;AAEtF;;;GAGG;AACH;IAAwC,sCAAe;IACrD;;OAEG;IACH,4BACE,MAAsB,EACtB,aAAmC,EACnC,OAAe,EACf,cAAsB,EAAE,6CAA6C;IACrE,iBAAwD,EACjD,eAAmC,EAChC,SAAkB,EAClB,QAAiB;QAR7B;QAUE,yEAAyE;QACzE,kBAAM,MAAM,EAAE,aAAa,EAAE,OAAO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,EAAE,kBAAkB,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;IACxG,CAAC;IAED;;;;;OAKG;IACI,4CAAe,GAAtB,UACE,SAAsB,EACtB,QAAiB,EACjB,kBAA2B;QAE3B,yGAAyG;QACzG,kBAAkB,aAAlB,kBAAkB,cAAlB,kBAAkB,IAAlB,kBAAkB,GAAK,IAAI,CAAC,OAAO,EAAC;QACpC,OAAO,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACrH,CAAC;IACH,yBAAC;AAAD,CAAC,AAvND,CAAwC,eAAe,GAuNtD"}
@@ -1,8 +0,0 @@
1
- import { SVMProvider } from "../../arch/svm";
2
- import { GasPriceEstimate } from "../types";
3
- import { GasPriceEstimateOptions } from "../oracle";
4
- /**
5
- * @notice Returns result of getFeeForMessage and getRecentPrioritizationFees RPC calls.
6
- * @returns GasPriceEstimate
7
- */
8
- export declare function messageFee(provider: SVMProvider, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate>;
@@ -1,43 +0,0 @@
1
- import { __awaiter, __generator } from "tslib";
2
- import { toBN, dedupArray, parseUnits } from "../../utils";
3
- import { compileTransaction } from "@solana/kit";
4
- /**
5
- * @notice Returns result of getFeeForMessage and getRecentPrioritizationFees RPC calls.
6
- * @returns GasPriceEstimate
7
- */
8
- export function messageFee(provider, opts) {
9
- return __awaiter(this, void 0, void 0, function () {
10
- var _unsignedTx, unsignedTx, compiledTransaction, encodedTransactionMessage, baseFeeResponse, instructionAddresses, recentPriorityFees, nonzeroPrioritizationFees, totalPrioritizationFees, flooredPriorityFeePerGas, microLamportsPerComputeUnit;
11
- return __generator(this, function (_a) {
12
- switch (_a.label) {
13
- case 0:
14
- _unsignedTx = opts.unsignedTx;
15
- unsignedTx = _unsignedTx;
16
- compiledTransaction = compileTransaction(unsignedTx);
17
- encodedTransactionMessage = Buffer.from(compiledTransaction.messageBytes).toString("base64");
18
- return [4 /*yield*/, provider.getFeeForMessage(encodedTransactionMessage).send()];
19
- case 1:
20
- baseFeeResponse = _a.sent();
21
- instructionAddresses = dedupArray(unsignedTx.instructions.map(function (instruction) { return instruction.programAddress; }));
22
- return [4 /*yield*/, provider.getRecentPrioritizationFees(instructionAddresses).send()];
23
- case 2:
24
- recentPriorityFees = _a.sent();
25
- nonzeroPrioritizationFees = recentPriorityFees
26
- .slice(125)
27
- .map(function (value) { return value.prioritizationFee; })
28
- .filter(function (fee) { return fee > 0; });
29
- totalPrioritizationFees = nonzeroPrioritizationFees.reduce(function (acc, fee) { return acc + fee; }, BigInt(0));
30
- flooredPriorityFeePerGas = parseUnits(process.env["MIN_PRIORITY_FEE_PER_GAS_".concat(opts.chainId)] || "0", 6);
31
- microLamportsPerComputeUnit = toBN(totalPrioritizationFees / BigInt(nonzeroPrioritizationFees.length));
32
- if (microLamportsPerComputeUnit.lt(flooredPriorityFeePerGas)) {
33
- microLamportsPerComputeUnit = flooredPriorityFeePerGas;
34
- }
35
- return [2 /*return*/, {
36
- baseFee: toBN(baseFeeResponse.value),
37
- microLamportsPerComputeUnit: microLamportsPerComputeUnit,
38
- }];
39
- }
40
- });
41
- });
42
- }
43
- //# sourceMappingURL=solana.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"solana.js","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/solana.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG3D,OAAO,EAA+D,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE9G;;;GAGG;AACH,MAAM,UAAgB,UAAU,CAAC,QAAqB,EAAE,IAA6B;;;;;;oBAC/D,WAAW,GAAK,IAAI,WAAT,CAAU;oBAGnC,UAAU,GAAG,WAA2C,CAAC;oBACzD,mBAAmB,GAAG,kBAAkB,CAAC,UAAU,CAAC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AAO,EAAE,IAAI,CAAC,eAAgB,CAAC,KAAM,CAAC;4BACtC,2BAA2B,6BAAA;yBAC5B,EAAC;;;;CACH"}
@@ -1,66 +0,0 @@
1
- import { SymbolMappingType } from "./";
2
- import { Deposit } from "../../interfaces";
3
- import { BigNumberish, TransactionCostEstimate, BigNumber, SvmAddress } from "../../utils";
4
- import { Logger, QueryInterface } from "../relayFeeCalculator";
5
- import { SVMProvider } from "../../arch/svm";
6
- /**
7
- * A special QueryBase implementation for SVM used for querying gas costs, token prices, and decimals of various tokens
8
- * on Solana.
9
- */
10
- export declare class SvmQuery implements QueryInterface {
11
- readonly provider: SVMProvider;
12
- readonly symbolMapping: SymbolMappingType;
13
- readonly spokePoolAddress: SvmAddress;
14
- readonly simulatedRelayerAddress: SvmAddress;
15
- readonly logger: Logger;
16
- readonly coingeckoProApiKey?: string | undefined;
17
- readonly fixedGasPrice?: BigNumberish | undefined;
18
- readonly coingeckoBaseCurrency: string;
19
- protected computeUnitEstimator: (transactionMessage: import("@solana/kit").CompilableTransactionMessage | (import("@solana/kit").ITransactionMessageWithFeePayer<string> & import("@solana/kit").TransactionMessage), config?: Omit<Readonly<{
20
- abortSignal?: AbortSignal | undefined;
21
- commitment?: import("@solana/kit").Commitment | undefined;
22
- minContextSlot?: bigint | undefined;
23
- rpc: import("@solana/kit").Rpc<import("@solana/kit").SimulateTransactionApi>;
24
- transactionMessage: import("@solana/kit").CompilableTransactionMessage | (import("@solana/kit").ITransactionMessageWithFeePayer<string> & import("@solana/kit").TransactionMessage);
25
- }>, "rpc" | "transactionMessage"> | undefined) => Promise<number>;
26
- /**
27
- * Instantiates a SvmQuery instance
28
- * @param provider A valid solana/kit rpc client.
29
- * @param symbolMapping A mapping to valid ERC20 tokens and their respective characteristics
30
- * @param spokePoolAddress The valid address of the Spoke Pool deployment
31
- * @param simulatedRelayerAddress The address that these queries will reference as the sender. Note: This address must be approved for USDC
32
- * @param logger A logging utility to report logs
33
- * @param coingeckoProApiKey An optional CoinGecko API key that links to a PRO account
34
- * @param fixedGasPrice Overrides the gas price with a fixed value. Note: primarily used for the Boba blockchain
35
- * @param coingeckoBaseCurrency The basis currency that CoinGecko will use to resolve pricing
36
- */
37
- constructor(provider: SVMProvider, symbolMapping: SymbolMappingType, spokePoolAddress: SvmAddress, simulatedRelayerAddress: SvmAddress, logger: Logger, coingeckoProApiKey?: string | undefined, fixedGasPrice?: BigNumberish | undefined, coingeckoBaseCurrency?: string);
38
- /**
39
- * Retrieves the current gas costs of performing a fillRelay contract at the referenced SpokePool.
40
- * @param deposit V3 deposit instance.
41
- * @param relayerAddress Relayer address to simulate with.
42
- * @param options
43
- * @param options.gasPrice Optional gas price to use for the simulation.
44
- * @param options.gasUnits Optional gas units to use for the simulation.
45
- * @param options.transport Optional transport object for custom gas price retrieval.
46
- * @returns The gas estimate for this function call (multiplied with the optional buffer).
47
- */
48
- getGasCosts(deposit: Omit<Deposit, "messageHash">, _relayer?: string, options?: Partial<{
49
- gasPrice: BigNumberish;
50
- gasUnits: BigNumberish;
51
- baseFeeMultiplier: BigNumber;
52
- priorityFeeMultiplier: BigNumber;
53
- }>): Promise<TransactionCostEstimate>;
54
- /**
55
- * Retrieves the current price of a token
56
- * @param tokenSymbol A valid [CoinGecko-ID](https://api.coingecko.com/api/v3/coins/list)
57
- * @returns The resolved token price within the specified coingeckoBaseCurrency
58
- */
59
- getTokenPrice(tokenSymbol: string): Promise<number>;
60
- /**
61
- * Resolves the number of decimal places a token can have
62
- * @param tokenSymbol A valid Across-Enabled Token ID
63
- * @returns The number of decimals of precision for the corresponding tokenSymbol
64
- */
65
- getTokenDecimals(tokenSymbol: string): number;
66
- }
@@ -1,169 +0,0 @@
1
- import { __awaiter, __generator } from "tslib";
2
- import { pipe } from "@solana/functional";
3
- import { Coingecko } from "../../coingecko";
4
- import { CHAIN_IDs, DEFAULT_SIMULATED_RELAYER_ADDRESS } from "../../constants";
5
- import { getGasPriceEstimate } from "../../gasPriceOracle";
6
- import { toBN, isDefined, toAddressType, } from "../../utils";
7
- import { fillRelayInstruction, createApproveInstruction, createTokenAccountsInstruction, SolanaVoidSigner, getAssociatedTokenAddress, } from "../../arch/svm";
8
- import { createTransactionMessage, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, getComputeUnitEstimateForTransactionMessageFactory, fetchEncodedAccount, } from "@solana/kit";
9
- import { TOKEN_PROGRAM_ADDRESS, getMintSize, getInitializeMintInstruction, fetchMint } from "@solana-program/token";
10
- import { getCreateAccountInstruction } from "@solana-program/system";
11
- /**
12
- * A special QueryBase implementation for SVM used for querying gas costs, token prices, and decimals of various tokens
13
- * on Solana.
14
- */
15
- var SvmQuery = /** @class */ (function () {
16
- /**
17
- * Instantiates a SvmQuery instance
18
- * @param provider A valid solana/kit rpc client.
19
- * @param symbolMapping A mapping to valid ERC20 tokens and their respective characteristics
20
- * @param spokePoolAddress The valid address of the Spoke Pool deployment
21
- * @param simulatedRelayerAddress The address that these queries will reference as the sender. Note: This address must be approved for USDC
22
- * @param logger A logging utility to report logs
23
- * @param coingeckoProApiKey An optional CoinGecko API key that links to a PRO account
24
- * @param fixedGasPrice Overrides the gas price with a fixed value. Note: primarily used for the Boba blockchain
25
- * @param coingeckoBaseCurrency The basis currency that CoinGecko will use to resolve pricing
26
- */
27
- function SvmQuery(provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, logger, coingeckoProApiKey, fixedGasPrice, coingeckoBaseCurrency) {
28
- if (coingeckoBaseCurrency === void 0) { coingeckoBaseCurrency = "eth"; }
29
- this.provider = provider;
30
- this.symbolMapping = symbolMapping;
31
- this.spokePoolAddress = spokePoolAddress;
32
- this.simulatedRelayerAddress = simulatedRelayerAddress;
33
- this.logger = logger;
34
- this.coingeckoProApiKey = coingeckoProApiKey;
35
- this.fixedGasPrice = fixedGasPrice;
36
- this.coingeckoBaseCurrency = coingeckoBaseCurrency;
37
- this.computeUnitEstimator = getComputeUnitEstimateForTransactionMessageFactory({
38
- rpc: provider,
39
- });
40
- }
41
- /**
42
- * Retrieves the current gas costs of performing a fillRelay contract at the referenced SpokePool.
43
- * @param deposit V3 deposit instance.
44
- * @param relayerAddress Relayer address to simulate with.
45
- * @param options
46
- * @param options.gasPrice Optional gas price to use for the simulation.
47
- * @param options.gasUnits Optional gas units to use for the simulation.
48
- * @param options.transport Optional transport object for custom gas price retrieval.
49
- * @returns The gas estimate for this function call (multiplied with the optional buffer).
50
- */
51
- SvmQuery.prototype.getGasCosts = function (deposit, _relayer, options) {
52
- if (_relayer === void 0) { _relayer = DEFAULT_SIMULATED_RELAYER_ADDRESS; }
53
- if (options === void 0) { options = {}; }
54
- return __awaiter(this, void 0, void 0, function () {
55
- var mint, owner, associatedToken, simulatedSigner, recipientCreateTokenAccountInstructions, _a, associatedTokenAccountExists, mintInfo, _b, _c, space, rent, createAccountIx, initializeMintIx, _d, createTokenAccountsIx, approveIx, fillIx, recentBlockhash, fillRelayTx, _e, computeUnitsConsumed, _gasPriceEstimate, _f, _g, _h, gasPriceEstimate, gasPrice;
56
- var _this = this;
57
- return __generator(this, function (_j) {
58
- switch (_j.label) {
59
- case 0:
60
- mint = toAddressType(deposit.outputToken).forceSvmAddress();
61
- owner = toAddressType(deposit.recipient).forceSvmAddress();
62
- return [4 /*yield*/, getAssociatedTokenAddress(owner, mint)];
63
- case 1:
64
- associatedToken = _j.sent();
65
- simulatedSigner = SolanaVoidSigner(this.simulatedRelayerAddress.toBase58());
66
- recipientCreateTokenAccountInstructions = undefined;
67
- _c = (_b = Promise).all;
68
- return [4 /*yield*/, fetchEncodedAccount(this.provider, associatedToken)];
69
- case 2: return [4 /*yield*/, _c.apply(_b, [[
70
- (_j.sent()).exists,
71
- fetchMint(this.provider, mint.toV2Address())
72
- ]])];
73
- case 3:
74
- _a = _j.sent(), associatedTokenAccountExists = _a[0], mintInfo = _a[1];
75
- if (!!associatedTokenAccountExists) return [3 /*break*/, 5];
76
- space = BigInt(getMintSize());
77
- return [4 /*yield*/, this.provider.getMinimumBalanceForRentExemption(space).send()];
78
- case 4:
79
- rent = _j.sent();
80
- createAccountIx = getCreateAccountInstruction({
81
- payer: simulatedSigner,
82
- newAccount: SolanaVoidSigner(mint.toBase58()),
83
- lamports: rent,
84
- space: space,
85
- programAddress: TOKEN_PROGRAM_ADDRESS,
86
- });
87
- initializeMintIx = getInitializeMintInstruction({
88
- mint: mint.toV2Address(),
89
- decimals: mintInfo.data.decimals,
90
- mintAuthority: owner.toV2Address(),
91
- });
92
- recipientCreateTokenAccountInstructions = [createAccountIx, initializeMintIx];
93
- _j.label = 5;
94
- case 5: return [4 /*yield*/, Promise.all([
95
- createTokenAccountsInstruction(mint, simulatedSigner),
96
- createApproveInstruction(mint, deposit.outputAmount, this.simulatedRelayerAddress, this.spokePoolAddress, mintInfo.data.decimals),
97
- fillRelayInstruction(this.spokePoolAddress, deposit, simulatedSigner, associatedToken),
98
- ])];
99
- case 6:
100
- _d = _j.sent(), createTokenAccountsIx = _d[0], approveIx = _d[1], fillIx = _d[2];
101
- return [4 /*yield*/, this.provider.getLatestBlockhash().send()];
102
- case 7:
103
- recentBlockhash = _j.sent();
104
- fillRelayTx = pipe(createTransactionMessage({ version: 0 }), function (tx) { return setTransactionMessageFeePayer(_this.simulatedRelayerAddress.toV2Address(), tx); }, function (tx) { return setTransactionMessageLifetimeUsingBlockhash(recentBlockhash.value, tx); }, function (tx) {
105
- return isDefined(recipientCreateTokenAccountInstructions)
106
- ? appendTransactionMessageInstructions(recipientCreateTokenAccountInstructions, tx)
107
- : tx;
108
- }, function (tx) { return appendTransactionMessageInstructions([createTokenAccountsIx, approveIx, fillIx], tx); });
109
- _g = (_f = Promise).all;
110
- _h = toBN;
111
- return [4 /*yield*/, this.computeUnitEstimator(fillRelayTx)];
112
- case 8: return [4 /*yield*/, _g.apply(_f, [[
113
- _h.apply(void 0, [_j.sent()]),
114
- getGasPriceEstimate(this.provider, {
115
- unsignedTx: fillRelayTx,
116
- baseFeeMultiplier: options.baseFeeMultiplier,
117
- priorityFeeMultiplier: options.priorityFeeMultiplier,
118
- })
119
- ]])];
120
- case 9:
121
- _e = _j.sent(), computeUnitsConsumed = _e[0], _gasPriceEstimate = _e[1];
122
- gasPriceEstimate = _gasPriceEstimate;
123
- gasPrice = gasPriceEstimate.baseFee.add(gasPriceEstimate.microLamportsPerComputeUnit.mul(computeUnitsConsumed).div(toBN(1000000)) // 1_000_000 microLamports/lamport.
124
- );
125
- return [2 /*return*/, {
126
- nativeGasCost: computeUnitsConsumed,
127
- tokenGasCost: gasPrice,
128
- gasPrice: gasPrice,
129
- }];
130
- }
131
- });
132
- });
133
- };
134
- /**
135
- * Retrieves the current price of a token
136
- * @param tokenSymbol A valid [CoinGecko-ID](https://api.coingecko.com/api/v3/coins/list)
137
- * @returns The resolved token price within the specified coingeckoBaseCurrency
138
- */
139
- SvmQuery.prototype.getTokenPrice = function (tokenSymbol) {
140
- return __awaiter(this, void 0, void 0, function () {
141
- var coingeckoInstance, _a, price;
142
- return __generator(this, function (_b) {
143
- switch (_b.label) {
144
- case 0:
145
- if (!this.symbolMapping[tokenSymbol])
146
- throw new Error("".concat(tokenSymbol, " does not exist in mapping"));
147
- coingeckoInstance = Coingecko.get(this.logger, this.coingeckoProApiKey);
148
- return [4 /*yield*/, coingeckoInstance.getCurrentPriceByContract(this.symbolMapping[tokenSymbol].addresses[CHAIN_IDs.MAINNET], this.coingeckoBaseCurrency)];
149
- case 1:
150
- _a = _b.sent(), price = _a[1];
151
- return [2 /*return*/, price];
152
- }
153
- });
154
- });
155
- };
156
- /**
157
- * Resolves the number of decimal places a token can have
158
- * @param tokenSymbol A valid Across-Enabled Token ID
159
- * @returns The number of decimals of precision for the corresponding tokenSymbol
160
- */
161
- SvmQuery.prototype.getTokenDecimals = function (tokenSymbol) {
162
- if (!this.symbolMapping[tokenSymbol])
163
- throw new Error("".concat(tokenSymbol, " does not exist in mapping"));
164
- return this.symbolMapping[tokenSymbol].decimals;
165
- };
166
- return SvmQuery;
167
- }());
168
- export { SvmQuery };
169
- //# sourceMappingURL=svmQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"svmQuery.js","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/svmQuery.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAE/E,OAAO,EAAE,mBAAmB,EAAuB,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAKL,IAAI,EACJ,SAAS,EACT,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAE9B,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,2CAA2C,EAC3C,oCAAoC,EACpC,kDAAkD,EAClD,mBAAmB,GAEpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,4BAA4B,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACpH,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAErE;;;GAGG;AACH;IAGE;;;;;;;;;;OAUG;IACH,kBACW,QAAqB,EACrB,aAAgC,EAChC,gBAA4B,EAC5B,uBAAmC,EACnC,MAAc,EACd,kBAA2B,EAC3B,aAA4B,EAC5B,qBAAqC;QAArC,sCAAA,EAAA,6BAAqC;QAPrC,aAAQ,GAAR,QAAQ,CAAa;QACrB,kBAAa,GAAb,aAAa,CAAmB;QAChC,qBAAgB,GAAhB,gBAAgB,CAAY;QAC5B,4BAAuB,GAAvB,uBAAuB,CAAY;QACnC,WAAM,GAAN,MAAM,CAAQ;QACd,uBAAkB,GAAlB,kBAAkB,CAAS;QAC3B,kBAAa,GAAb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,WAAW,+BAA4B,CAAC,CAAC;wBAC5F,iBAAiB,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;wBAC5D,qBAAM,iBAAiB,CAAC,yBAAyB,CACjE,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,EAC5D,IAAI,CAAC,qBAAqB,CAC3B,EAAA;;wBAHK,KAAY,SAGjB,EAHQ,KAAK,QAAA;wBAId,sBAAO,KAAK,EAAC;;;;KACd;IAED;;;;OAIG;IACH,mCAAgB,GAAhB,UAAiB,WAAmB;QAClC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,UAAG,WAAW,+BAA4B,CAAC,CAAC;QAClG,OAAO,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC;IAClD,CAAC;IACH,eAAC;AAAD,CAAC,AAxJD,IAwJC"}
@@ -1,95 +0,0 @@
1
- import { SvmAddress, BigNumber } from "../../utils";
2
- import { SvmSpokeClient } from "@across-protocol/contracts";
3
- import { SvmCpiEventsClient } from "./";
4
- import { Deposit, FillStatus, FillWithBlock, RelayData } from "../../interfaces";
5
- import { Address, type TransactionSigner } from "@solana/kit";
6
- import { Logger } from "winston";
7
- import { SVMProvider } from "./types";
8
- /**
9
- * @param spokePool SpokePool Contract instance.
10
- * @param deposit V3Deopsit instance.
11
- * @param repaymentChainId Optional repaymentChainId (defaults to destinationChainId).
12
- * @returns An Ethers UnsignedTransaction instance.
13
- */
14
- export declare function populateV3Relay(_spokePool: unknown, _deposit: Omit<Deposit, "messageHash">, _relayer: string, _repaymentChainId?: number): Promise<unknown>;
15
- /**
16
- * Retrieves the chain time at a particular slot.
17
- */
18
- export declare function getTimestampForSlot(provider: SVMProvider, slotNumber: number): Promise<number>;
19
- /**
20
- * Returns the current fill deadline buffer.
21
- * @param provider SVM Provider instance
22
- * @param statePda Spoke Pool's State PDA
23
- * @returns fill deadline buffer
24
- */
25
- export declare function getFillDeadline(provider: SVMProvider, statePda: Address): Promise<number>;
26
- /**
27
- * Finds the deposit id at a specific block number.
28
- * @param blockTag The block number to search for the deposit ID at.
29
- * @returns The deposit ID.
30
- */
31
- export declare function getDepositIdAtBlock(_contract: unknown, _blockTag: number): Promise<BigNumber>;
32
- export declare function findDepositBlock(_spokePool: unknown, depositId: BigNumber, _lowBlock: number, _highBlock?: number): Promise<number | undefined>;
33
- /**
34
- * Resolves the fill status of a deposit at a specific slot or at the current confirmed one.
35
- *
36
- * If no slot is provided, attempts to solve the fill status using the PDA. Otherwise, it is reconstructed from PDA events.
37
- *
38
- * @param programId - The spoke pool program ID.
39
- * @param relayData - Deposit information used to locate the fill status.
40
- * @param destinationChainId - Destination chain ID (must be an SVM chain).
41
- * @param provider - SVM provider instance.
42
- * @param svmEventsClient - SVM events client for querying events.
43
- * @param atHeight - (Optional) Specific slot number to query. Defaults to the latest confirmed slot.
44
- * @returns The fill status for the deposit at the specified or current slot.
45
- */
46
- export declare function relayFillStatus(programId: Address, relayData: RelayData, destinationChainId: number, svmEventsClient: SvmCpiEventsClient, atHeight?: number): Promise<FillStatus>;
47
- /**
48
- * Resolves fill statuses for multiple deposits at a specific or latest confirmed slot,
49
- * using PDAs when possible and falling back to events if needed.
50
- *
51
- * @param programId The spoke pool program ID.
52
- * @param relayData An array of relay data to resolve fill statuses for.
53
- * @param destinationChainId The destination chain ID (must be an SVM chain).
54
- * @param provider SVM Provider instance.
55
- * @param svmEventsClient SVM events client instance for querying events.
56
- * @param atHeight (Optional) The slot number to query at. If omitted, queries the latest confirmed slot.
57
- * @returns An array of fill statuses for the specified deposits at the requested slot (or at the current confirmed slot).
58
- */
59
- export declare function fillStatusArray(programId: Address, relayData: RelayData[], destinationChainId: number, svmEventsClient: SvmCpiEventsClient, atHeight?: number, logger?: Logger): Promise<(FillStatus | undefined)[]>;
60
- /**
61
- * Finds the `FilledRelay` event for a given deposit within the provided slot range.
62
- *
63
- * @param relayData - Deposit information that is used to complete a fill.
64
- * @param destinationChainId - Destination chain ID (must be an SVM chain).
65
- * @param svmEventsClient - SVM events client instance for querying events.
66
- * @param fromSlot - Starting slot to search.
67
- * @param toSlot (Optional) Ending slot to search. If not provided, the current confirmed slot will be used.
68
- * @returns The fill event with block info, or `undefined` if not found.
69
- */
70
- export declare function findFillEvent(relayData: RelayData, destinationChainId: number, svmEventsClient: SvmCpiEventsClient, fromSlot: number, toSlot?: number): Promise<FillWithBlock | undefined>;
71
- /**
72
- * @param spokePool Address (program ID) of the SvmSpoke.
73
- * @param deposit V3Deopsit instance.
74
- * @param relayer Address of the relayer filling the deposit.
75
- * @param repaymentChainId Optional repaymentChainId (defaults to destinationChainId).
76
- * @returns An Ethers UnsignedTransaction instance.
77
- */
78
- export declare function fillRelayInstruction(spokePool: SvmAddress, deposit: Omit<Deposit, "messageHash">, relayer: TransactionSigner<string>, recipientTokenAccount: Address<string>, repaymentChainId?: number): Promise<SvmSpokeClient.FillRelayInstruction<Address<"JAZWcGrpSWNPTBj8QtJ9UyQqhJCDhG9GJkDeMf5NQBiq">, string, string, string, string, string, string, string, string, string, string, string, string, []>>;
79
- /**
80
- * @param mint Address of the token corresponding to the account being made.
81
- * @param relayer Address of the relayer filling the deposit.
82
- * @returns An instruction for creating a new token account.
83
- */
84
- export declare function createTokenAccountsInstruction(mint: SvmAddress, relayer: TransactionSigner<string>): SvmSpokeClient.CreateTokenAccountsInstruction;
85
- /**
86
- * @param mint Address of the token corresponding to the account being made.
87
- * @param amount Amount of the token to approve.
88
- * @param relayer Address of the relayer filling the deposit.
89
- * @param spokePool Address (program ID) of the SvmSpoke.
90
- * @returns A token approval instruction.
91
- */
92
- export declare function createApproveInstruction(mint: SvmAddress, amount: BigNumber, relayer: SvmAddress, spokePool: SvmAddress, mintDecimals?: number): Promise<import("@solana-program/token").ApproveCheckedInstruction<Address<"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA">, string, string, string, string, []>>;
93
- export declare function getAssociatedTokenAddress(owner: SvmAddress, mint: SvmAddress, tokenProgramId?: Address<string>): Promise<Address<string>>;
94
- export declare function getRelayDataHash(relayData: RelayData, destinationChainId: number): string;
95
- //# sourceMappingURL=SpokeUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpokeUtils.d.ts","sourceRoot":"","sources":["../../../../src/arch/svm/SpokeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,SAAS,EASV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAe,kBAAkB,EAAwD,MAAM,IAAI,CAAC;AAC3G,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAMjF,OAAO,EACL,OAAO,EAMP,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAiB,WAAW,EAAE,MAAM,SAAS,CAAC;AAGrD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,OAAO,EACnB,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,EACtC,QAAQ,EAAE,MAAM,EAChB,iBAAiB,SAA8B,GAC9C,OAAO,CAAC,OAAO,CAAC,CAElB;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAIpG;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAG/F;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,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8B,CAC5C,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,GACjC,cAAc,CAAC,8BAA8B,CAK/C;AAED;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,UAAU,EACrB,YAAY,CAAC,EAAE,MAAM,kKAsBtB;AAED,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,UAAU,EAChB,cAAc,GAAE,OAAO,CAAC,MAAM,CAAyB,GACtD,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAM1B;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,GAAG,MAAM,CA0BzF"}
@@ -1,2 +0,0 @@
1
- export declare const SVM_SPOKE_SEED: bigint;
2
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/arch/svm/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QAAY,CAAC"}