@across-protocol/sdk 4.2.16-alpha.6 → 4.2.16

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 (234) hide show
  1. package/dist/cjs/arch/evm/SpokeUtils.d.ts +3 -8
  2. package/dist/cjs/arch/evm/SpokeUtils.js +11 -26
  3. package/dist/cjs/arch/evm/SpokeUtils.js.map +1 -1
  4. package/dist/cjs/arch/svm/SpokeUtils.d.ts +2 -8
  5. package/dist/cjs/arch/svm/SpokeUtils.js +50 -41
  6. package/dist/cjs/arch/svm/SpokeUtils.js.map +1 -1
  7. package/dist/cjs/arch/svm/eventsClient.js +2 -4
  8. package/dist/cjs/arch/svm/eventsClient.js.map +1 -1
  9. package/dist/cjs/arch/svm/utils.d.ts +3 -3
  10. package/dist/cjs/arch/svm/utils.js +14 -16
  11. package/dist/cjs/arch/svm/utils.js.map +1 -1
  12. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +3 -3
  13. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +2 -4
  14. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
  15. package/dist/cjs/clients/BundleDataClient/BundleDataClient.d.ts +6 -7
  16. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js +83 -78
  17. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  18. package/dist/cjs/clients/BundleDataClient/utils/DataworkerUtils.js +13 -13
  19. package/dist/cjs/clients/BundleDataClient/utils/DataworkerUtils.js.map +1 -1
  20. package/dist/cjs/clients/BundleDataClient/utils/FillUtils.d.ts +1 -2
  21. package/dist/cjs/clients/BundleDataClient/utils/FillUtils.js +2 -3
  22. package/dist/cjs/clients/BundleDataClient/utils/FillUtils.js.map +1 -1
  23. package/dist/cjs/clients/BundleDataClient/utils/MerkleTreeUtils.js +1 -5
  24. package/dist/cjs/clients/BundleDataClient/utils/MerkleTreeUtils.js.map +1 -1
  25. package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js +3 -3
  26. package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
  27. package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.d.ts +71 -71
  28. package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.js +8 -13
  29. package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.js.map +1 -1
  30. package/dist/cjs/clients/HubPoolClient.d.ts +21 -21
  31. package/dist/cjs/clients/HubPoolClient.js +58 -84
  32. package/dist/cjs/clients/HubPoolClient.js.map +1 -1
  33. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js +1 -1
  34. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
  35. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.d.ts +2 -2
  36. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js +45 -65
  37. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
  38. package/dist/cjs/clients/SpokePoolClient/SpokePoolClientManager.d.ts +13 -0
  39. package/dist/cjs/clients/SpokePoolClient/SpokePoolClientManager.js +18 -0
  40. package/dist/cjs/clients/SpokePoolClient/SpokePoolClientManager.js.map +1 -0
  41. package/dist/cjs/clients/mocks/MockHubPoolClient.d.ts +9 -9
  42. package/dist/cjs/clients/mocks/MockHubPoolClient.js +9 -15
  43. package/dist/cjs/clients/mocks/MockHubPoolClient.js.map +1 -1
  44. package/dist/cjs/clients/mocks/MockSpokePoolClient.d.ts +3 -5
  45. package/dist/cjs/clients/mocks/MockSpokePoolClient.js +36 -40
  46. package/dist/cjs/clients/mocks/MockSpokePoolClient.js.map +1 -1
  47. package/dist/cjs/clients/mocks/MockSvmCpiEventsClient.d.ts +1 -1
  48. package/dist/cjs/clients/mocks/MockSvmCpiEventsClient.js +4 -6
  49. package/dist/cjs/clients/mocks/MockSvmCpiEventsClient.js.map +1 -1
  50. package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.d.ts +2 -2
  51. package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.js +2 -2
  52. package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.js.map +1 -1
  53. package/dist/cjs/interfaces/HubPool.d.ts +14 -19
  54. package/dist/cjs/interfaces/SpokePool.d.ts +19 -18
  55. package/dist/cjs/interfaces/SpokePool.js.map +1 -1
  56. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.d.ts +7 -15
  57. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js +15 -24
  58. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
  59. package/dist/cjs/relayFeeCalculator/chain-queries/factory.js +1 -1
  60. package/dist/cjs/relayFeeCalculator/chain-queries/factory.js.map +1 -1
  61. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.d.ts +4 -12
  62. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js +44 -46
  63. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js.map +1 -1
  64. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +6 -6
  65. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js +10 -10
  66. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
  67. package/dist/cjs/utils/AddressUtils.d.ts +8 -12
  68. package/dist/cjs/utils/AddressUtils.js +36 -33
  69. package/dist/cjs/utils/AddressUtils.js.map +1 -1
  70. package/dist/cjs/utils/NetworkUtils.js +1 -1
  71. package/dist/cjs/utils/NetworkUtils.js.map +1 -1
  72. package/dist/cjs/utils/SpokeUtils.d.ts +3 -3
  73. package/dist/cjs/utils/SpokeUtils.js +22 -4
  74. package/dist/cjs/utils/SpokeUtils.js.map +1 -1
  75. package/dist/cjs/utils/TokenUtils.d.ts +4 -4
  76. package/dist/cjs/utils/TokenUtils.js +3 -5
  77. package/dist/cjs/utils/TokenUtils.js.map +1 -1
  78. package/dist/esm/arch/evm/SpokeUtils.d.ts +4 -9
  79. package/dist/esm/arch/evm/SpokeUtils.js +14 -29
  80. package/dist/esm/arch/evm/SpokeUtils.js.map +1 -1
  81. package/dist/esm/arch/svm/SpokeUtils.d.ts +3 -9
  82. package/dist/esm/arch/svm/SpokeUtils.js +55 -42
  83. package/dist/esm/arch/svm/SpokeUtils.js.map +1 -1
  84. package/dist/esm/arch/svm/eventsClient.js +3 -5
  85. package/dist/esm/arch/svm/eventsClient.js.map +1 -1
  86. package/dist/esm/arch/svm/utils.d.ts +3 -3
  87. package/dist/esm/arch/svm/utils.js +15 -17
  88. package/dist/esm/arch/svm/utils.js.map +1 -1
  89. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +3 -3
  90. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +2 -4
  91. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
  92. package/dist/esm/clients/BundleDataClient/BundleDataClient.d.ts +6 -7
  93. package/dist/esm/clients/BundleDataClient/BundleDataClient.js +84 -79
  94. package/dist/esm/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  95. package/dist/esm/clients/BundleDataClient/utils/DataworkerUtils.js +14 -14
  96. package/dist/esm/clients/BundleDataClient/utils/DataworkerUtils.js.map +1 -1
  97. package/dist/esm/clients/BundleDataClient/utils/FillUtils.d.ts +1 -2
  98. package/dist/esm/clients/BundleDataClient/utils/FillUtils.js +3 -5
  99. package/dist/esm/clients/BundleDataClient/utils/FillUtils.js.map +1 -1
  100. package/dist/esm/clients/BundleDataClient/utils/MerkleTreeUtils.js +1 -5
  101. package/dist/esm/clients/BundleDataClient/utils/MerkleTreeUtils.js.map +1 -1
  102. package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js +4 -4
  103. package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
  104. package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.d.ts +71 -71
  105. package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.js +10 -20
  106. package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.js.map +1 -1
  107. package/dist/esm/clients/HubPoolClient.d.ts +22 -23
  108. package/dist/esm/clients/HubPoolClient.js +63 -98
  109. package/dist/esm/clients/HubPoolClient.js.map +1 -1
  110. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js +2 -2
  111. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
  112. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.d.ts +2 -2
  113. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js +47 -68
  114. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
  115. package/dist/esm/clients/SpokePoolClient/SpokePoolClientManager.d.ts +28 -0
  116. package/dist/esm/clients/SpokePoolClient/SpokePoolClientManager.js +30 -0
  117. package/dist/esm/clients/SpokePoolClient/SpokePoolClientManager.js.map +1 -0
  118. package/dist/esm/clients/mocks/MockHubPoolClient.d.ts +9 -9
  119. package/dist/esm/clients/mocks/MockHubPoolClient.js +10 -16
  120. package/dist/esm/clients/mocks/MockHubPoolClient.js.map +1 -1
  121. package/dist/esm/clients/mocks/MockSpokePoolClient.d.ts +3 -5
  122. package/dist/esm/clients/mocks/MockSpokePoolClient.js +38 -42
  123. package/dist/esm/clients/mocks/MockSpokePoolClient.js.map +1 -1
  124. package/dist/esm/clients/mocks/MockSvmCpiEventsClient.d.ts +1 -1
  125. package/dist/esm/clients/mocks/MockSvmCpiEventsClient.js +5 -7
  126. package/dist/esm/clients/mocks/MockSvmCpiEventsClient.js.map +1 -1
  127. package/dist/esm/clients/mocks/MockSvmSpokePoolClient.d.ts +2 -2
  128. package/dist/esm/clients/mocks/MockSvmSpokePoolClient.js +3 -3
  129. package/dist/esm/clients/mocks/MockSvmSpokePoolClient.js.map +1 -1
  130. package/dist/esm/interfaces/HubPool.d.ts +14 -19
  131. package/dist/esm/interfaces/SpokePool.d.ts +19 -18
  132. package/dist/esm/interfaces/SpokePool.js.map +1 -1
  133. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.d.ts +10 -18
  134. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js +20 -29
  135. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
  136. package/dist/esm/relayFeeCalculator/chain-queries/factory.js +2 -2
  137. package/dist/esm/relayFeeCalculator/chain-queries/factory.js.map +1 -1
  138. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.d.ts +6 -14
  139. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js +48 -51
  140. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js.map +1 -1
  141. package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +6 -6
  142. package/dist/esm/relayFeeCalculator/relayFeeCalculator.js +9 -9
  143. package/dist/esm/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
  144. package/dist/esm/utils/AddressUtils.d.ts +8 -12
  145. package/dist/esm/utils/AddressUtils.js +38 -36
  146. package/dist/esm/utils/AddressUtils.js.map +1 -1
  147. package/dist/esm/utils/NetworkUtils.js +1 -1
  148. package/dist/esm/utils/NetworkUtils.js.map +1 -1
  149. package/dist/esm/utils/SpokeUtils.d.ts +8 -3
  150. package/dist/esm/utils/SpokeUtils.js +26 -4
  151. package/dist/esm/utils/SpokeUtils.js.map +1 -1
  152. package/dist/esm/utils/TokenUtils.d.ts +18 -22
  153. package/dist/esm/utils/TokenUtils.js +4 -6
  154. package/dist/esm/utils/TokenUtils.js.map +1 -1
  155. package/dist/types/arch/evm/SpokeUtils.d.ts +4 -9
  156. package/dist/types/arch/evm/SpokeUtils.d.ts.map +1 -1
  157. package/dist/types/arch/svm/SpokeUtils.d.ts +3 -9
  158. package/dist/types/arch/svm/SpokeUtils.d.ts.map +1 -1
  159. package/dist/types/arch/svm/eventsClient.d.ts.map +1 -1
  160. package/dist/types/arch/svm/utils.d.ts +3 -3
  161. package/dist/types/arch/svm/utils.d.ts.map +1 -1
  162. package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +3 -3
  163. package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts.map +1 -1
  164. package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts +6 -7
  165. package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts.map +1 -1
  166. package/dist/types/clients/BundleDataClient/utils/DataworkerUtils.d.ts.map +1 -1
  167. package/dist/types/clients/BundleDataClient/utils/FillUtils.d.ts +1 -2
  168. package/dist/types/clients/BundleDataClient/utils/FillUtils.d.ts.map +1 -1
  169. package/dist/types/clients/BundleDataClient/utils/MerkleTreeUtils.d.ts.map +1 -1
  170. package/dist/types/clients/BundleDataClient/utils/PoolRebalanceUtils.d.ts.map +1 -1
  171. package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts +71 -71
  172. package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts.map +1 -1
  173. package/dist/types/clients/HubPoolClient.d.ts +22 -23
  174. package/dist/types/clients/HubPoolClient.d.ts.map +1 -1
  175. package/dist/types/clients/SpokePoolClient/EVMSpokePoolClient.d.ts.map +1 -1
  176. package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts +2 -2
  177. package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts.map +1 -1
  178. package/dist/types/clients/SpokePoolClient/SpokePoolClientManager.d.ts +29 -0
  179. package/dist/types/clients/SpokePoolClient/SpokePoolClientManager.d.ts.map +1 -0
  180. package/dist/types/clients/mocks/MockHubPoolClient.d.ts +9 -9
  181. package/dist/types/clients/mocks/MockHubPoolClient.d.ts.map +1 -1
  182. package/dist/types/clients/mocks/MockSpokePoolClient.d.ts +3 -5
  183. package/dist/types/clients/mocks/MockSpokePoolClient.d.ts.map +1 -1
  184. package/dist/types/clients/mocks/MockSvmCpiEventsClient.d.ts +1 -1
  185. package/dist/types/clients/mocks/MockSvmCpiEventsClient.d.ts.map +1 -1
  186. package/dist/types/clients/mocks/MockSvmSpokePoolClient.d.ts +2 -2
  187. package/dist/types/clients/mocks/MockSvmSpokePoolClient.d.ts.map +1 -1
  188. package/dist/types/interfaces/HubPool.d.ts +14 -19
  189. package/dist/types/interfaces/HubPool.d.ts.map +1 -1
  190. package/dist/types/interfaces/SpokePool.d.ts +19 -18
  191. package/dist/types/interfaces/SpokePool.d.ts.map +1 -1
  192. package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts +10 -18
  193. package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts.map +1 -1
  194. package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
  195. package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts +6 -14
  196. package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts.map +1 -1
  197. package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +6 -6
  198. package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
  199. package/dist/types/utils/AddressUtils.d.ts +8 -12
  200. package/dist/types/utils/AddressUtils.d.ts.map +1 -1
  201. package/dist/types/utils/SpokeUtils.d.ts +8 -3
  202. package/dist/types/utils/SpokeUtils.d.ts.map +1 -1
  203. package/dist/types/utils/TokenUtils.d.ts +18 -22
  204. package/dist/types/utils/TokenUtils.d.ts.map +1 -1
  205. package/package.json +2 -1
  206. package/src/arch/evm/SpokeUtils.ts +22 -72
  207. package/src/arch/svm/SpokeUtils.ts +53 -67
  208. package/src/arch/svm/eventsClient.ts +8 -40
  209. package/src/arch/svm/utils.ts +6 -6
  210. package/src/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.ts +4 -7
  211. package/src/clients/BundleDataClient/BundleDataClient.ts +90 -77
  212. package/src/clients/BundleDataClient/utils/DataworkerUtils.ts +13 -28
  213. package/src/clients/BundleDataClient/utils/FillUtils.ts +4 -10
  214. package/src/clients/BundleDataClient/utils/MerkleTreeUtils.ts +1 -7
  215. package/src/clients/BundleDataClient/utils/PoolRebalanceUtils.ts +4 -4
  216. package/src/clients/BundleDataClient/utils/SuperstructUtils.ts +10 -22
  217. package/src/clients/HubPoolClient.ts +82 -127
  218. package/src/clients/SpokePoolClient/EVMSpokePoolClient.ts +0 -6
  219. package/src/clients/SpokePoolClient/SpokePoolClient.ts +35 -121
  220. package/src/clients/SpokePoolClient/SpokePoolClientManager.ts +36 -0
  221. package/src/clients/mocks/MockHubPoolClient.ts +19 -24
  222. package/src/clients/mocks/MockSpokePoolClient.ts +27 -39
  223. package/src/clients/mocks/MockSvmCpiEventsClient.ts +5 -8
  224. package/src/clients/mocks/MockSvmSpokePoolClient.ts +3 -12
  225. package/src/interfaces/HubPool.ts +14 -23
  226. package/src/interfaces/SpokePool.ts +19 -19
  227. package/src/relayFeeCalculator/chain-queries/baseQuery.ts +20 -39
  228. package/src/relayFeeCalculator/chain-queries/factory.ts +2 -2
  229. package/src/relayFeeCalculator/chain-queries/svmQuery.ts +56 -57
  230. package/src/relayFeeCalculator/relayFeeCalculator.ts +13 -15
  231. package/src/utils/AddressUtils.ts +51 -39
  232. package/src/utils/NetworkUtils.ts +1 -1
  233. package/src/utils/SpokeUtils.ts +33 -11
  234. package/src/utils/TokenUtils.ts +8 -10
@@ -1,4 +1,4 @@
1
- import { Address, BigNumber, EvmAddress } from "../utils";
1
+ import { BigNumber } from "../utils";
2
2
  import { SortableEvent } from "./Common";
3
3
 
4
4
  export interface PoolRebalanceLeaf {
@@ -8,7 +8,7 @@ export interface PoolRebalanceLeaf {
8
8
  netSendAmounts: BigNumber[];
9
9
  runningBalances: BigNumber[];
10
10
  leafId: number;
11
- l1Tokens: EvmAddress[];
11
+ l1Tokens: string[];
12
12
  }
13
13
 
14
14
  export interface RelayerRefundLeaf {
@@ -16,8 +16,8 @@ export interface RelayerRefundLeaf {
16
16
  chainId: number;
17
17
  refundAmounts: BigNumber[];
18
18
  leafId: number;
19
- l2TokenAddress: Address;
20
- refundAddresses: Address[];
19
+ l2TokenAddress: string;
20
+ refundAddresses: string[];
21
21
  }
22
22
 
23
23
  export interface ProposedRootBundle extends SortableEvent {
@@ -27,7 +27,7 @@ export interface ProposedRootBundle extends SortableEvent {
27
27
  poolRebalanceRoot: string;
28
28
  relayerRefundRoot: string;
29
29
  slowRelayRoot: string;
30
- proposer: EvmAddress;
30
+ proposer: string;
31
31
  }
32
32
 
33
33
  export type RealizedLpFee = {
@@ -55,7 +55,7 @@ export interface ExecutedRootBundle extends SortableEvent {
55
55
  netSendAmounts: BigNumber[];
56
56
  runningBalances: BigNumber[];
57
57
  leafId: number;
58
- l1Tokens: EvmAddress[];
58
+ l1Tokens: string[];
59
59
  proof: string[];
60
60
  }
61
61
 
@@ -76,14 +76,8 @@ export interface RelayerRefundLeafWithGroup extends RelayerRefundLeaf {
76
76
  groupIndex: number;
77
77
  }
78
78
 
79
- export interface L1TokenInfo {
80
- address: EvmAddress;
81
- symbol: string;
82
- decimals: number;
83
- }
84
-
85
- export interface TokenInfo {
86
- address: Address;
79
+ export interface L1Token {
80
+ address: string;
87
81
  symbol: string;
88
82
  decimals: number;
89
83
  }
@@ -93,30 +87,27 @@ export interface LpToken {
93
87
  liquidReserves: BigNumber;
94
88
  }
95
89
 
96
- // TODO: I think I don't change string -> Address in the Events. I change right after the event is read
97
90
  export interface CrossChainContractsSet extends SortableEvent {
98
91
  l2ChainId: number;
99
- spokePool: Address;
92
+ spokePool: string;
100
93
  }
101
94
 
102
- // TODO: I think I don't change string -> Address in the Events. I change right after the event is read
103
95
  export interface DestinationTokenWithBlock extends SortableEvent {
104
- l2Token: Address;
105
- l1Token: EvmAddress;
96
+ l2Token: string;
97
+ l1Token: string;
106
98
  }
107
99
 
108
- // TODO: I think I don't change string -> Address in the Events. I change right after the event is read
109
100
  export interface SetPoolRebalanceRoot extends SortableEvent {
110
101
  destinationChainId: number;
111
- l1Token: EvmAddress;
112
- destinationToken: Address;
102
+ l1Token: string;
103
+ destinationToken: string;
113
104
  }
114
105
 
115
106
  export interface PendingRootBundle {
116
107
  poolRebalanceRoot: string;
117
108
  relayerRefundRoot: string;
118
109
  slowRelayRoot: string;
119
- proposer: EvmAddress;
110
+ proposer: string;
120
111
  unclaimedPoolRebalanceLeafCount: number;
121
112
  challengePeriodEndTimestamp: number;
122
113
  bundleEvaluationBlockNumbers: number[];
@@ -1,34 +1,31 @@
1
1
  import { SortableEvent } from "./Common";
2
2
  import { SpokePoolClient } from "../clients";
3
- import { BigNumber, Address, EvmAddress } from "../utils";
3
+ import { BigNumber } from "../utils";
4
4
  import { RelayerRefundLeaf } from "./HubPool";
5
5
 
6
6
  export interface RelayData {
7
7
  originChainId: number;
8
- depositor: Address;
9
- recipient: Address;
8
+ depositor: string;
9
+ recipient: string;
10
10
  depositId: BigNumber;
11
- inputToken: Address;
11
+ inputToken: string;
12
12
  inputAmount: BigNumber;
13
- outputToken: Address;
13
+ outputToken: string;
14
14
  outputAmount: BigNumber;
15
15
  message: string;
16
16
  fillDeadline: number;
17
- exclusiveRelayer: Address;
17
+ exclusiveRelayer: string;
18
18
  exclusivityDeadline: number;
19
19
  }
20
20
 
21
- export interface SpeedUpCommon {
22
- updatedRecipient: Address;
23
- updatedOutputAmount: BigNumber;
24
- updatedMessage: string;
25
- }
26
-
27
- export interface Deposit extends RelayData, Partial<SpeedUpCommon> {
21
+ export interface Deposit extends RelayData {
28
22
  messageHash: string;
29
23
  destinationChainId: number;
30
24
  quoteTimestamp: number;
31
25
  speedUpSignature?: string;
26
+ updatedRecipient?: string;
27
+ updatedOutputAmount?: BigNumber;
28
+ updatedMessage?: string;
32
29
  fromLiteChain: boolean;
33
30
  toLiteChain: boolean;
34
31
  }
@@ -54,7 +51,7 @@ export enum FillType {
54
51
  }
55
52
 
56
53
  export interface RelayExecutionEventInfo {
57
- updatedRecipient: Address;
54
+ updatedRecipient: string;
58
55
  updatedOutputAmount: BigNumber;
59
56
  updatedMessage?: string;
60
57
  updatedMessageHash: string;
@@ -64,7 +61,7 @@ export interface RelayExecutionEventInfo {
64
61
  export interface Fill extends Omit<RelayData, "message"> {
65
62
  messageHash: string;
66
63
  destinationChainId: number;
67
- relayer: Address;
64
+ relayer: string;
68
65
  repaymentChainId: number;
69
66
  relayExecutionInfo: RelayExecutionEventInfo;
70
67
  }
@@ -75,17 +72,20 @@ export interface FillWithTime extends Fill, SortableEvent {
75
72
  }
76
73
 
77
74
  export interface EnabledDepositRoute {
78
- originToken: Address;
75
+ originToken: string;
79
76
  destinationChainId: number;
80
77
  enabled: boolean;
81
78
  }
82
79
 
83
80
  export interface EnabledDepositRouteWithBlock extends EnabledDepositRoute, SortableEvent {}
84
- export interface SpeedUp extends SpeedUpCommon {
85
- depositor: EvmAddress;
81
+ export interface SpeedUp {
82
+ depositor: string;
86
83
  depositorSignature: string;
87
84
  depositId: BigNumber;
88
85
  originChainId: number;
86
+ updatedRecipient: string;
87
+ updatedOutputAmount: BigNumber;
88
+ updatedMessage: string;
89
89
  }
90
90
 
91
91
  export interface SpeedUpWithBlock extends SpeedUp, SortableEvent {}
@@ -130,7 +130,7 @@ export interface TokensBridged extends SortableEvent {
130
130
  amountToReturn: BigNumber;
131
131
  chainId: number;
132
132
  leafId: number;
133
- l2TokenAddress: Address;
133
+ l2TokenAddress: string;
134
134
  }
135
135
 
136
136
  export interface ClaimedRelayerRefundWithBlock extends SortableEvent {
@@ -1,25 +1,23 @@
1
1
  import { L2Provider } from "@eth-optimism/sdk/dist/interfaces/l2-provider";
2
2
  import { isL2Provider as isOptimismL2Provider } from "@eth-optimism/sdk/dist/l2-provider";
3
+
3
4
  import { PopulatedTransaction, providers, VoidSigner } from "ethers";
4
5
  import { Coingecko } from "../../coingecko";
5
6
  import { CHAIN_IDs } from "../../constants";
6
- import { RelayData } from "../../interfaces";
7
+ import { Deposit } from "../../interfaces";
7
8
  import { SpokePool, SpokePool__factory } from "../../typechain";
8
9
  import { populateV3Relay } from "../../arch/evm";
9
10
  import {
10
11
  BigNumberish,
11
- EvmAddress,
12
12
  TransactionCostEstimate,
13
13
  BigNumber,
14
14
  toBNWei,
15
15
  bnZero,
16
16
  chainIsOPStack,
17
17
  fixedPointAdjustment,
18
- toAddressType,
19
- Address,
20
18
  } from "../../utils";
21
19
  import assert from "assert";
22
- import { Logger, QueryInterface, getDefaultRelayer } from "../relayFeeCalculator";
20
+ import { Logger, QueryInterface, getDefaultSimulatedRelayerAddress } from "../relayFeeCalculator";
23
21
  import { Transport } from "viem";
24
22
  import { getGasPriceEstimate } from "../../gasPriceOracle";
25
23
  import { EvmProvider } from "../../arch/evm/types";
@@ -64,7 +62,7 @@ export class QueryBase implements QueryInterface {
64
62
 
65
63
  /**
66
64
  * Retrieves the current gas costs of performing a fillRelay contract at the referenced SpokePool.
67
- * @param relayData RelayData instance, supplemented with destinationChainId
65
+ * @param deposit V3 deposit instance.
68
66
  * @param relayerAddress Relayer address to simulate with.
69
67
  * @param options
70
68
  * @param options.gasPrice Optional gas price to use for the simulation.
@@ -73,8 +71,8 @@ export class QueryBase implements QueryInterface {
73
71
  * @returns The gas estimate for this function call (multiplied with the optional buffer).
74
72
  */
75
73
  async getGasCosts(
76
- relayData: RelayData & { destinationChainId: number },
77
- relayer = toAddressType(getDefaultRelayer(relayData.destinationChainId), relayData.destinationChainId),
74
+ deposit: Omit<Deposit, "messageHash">,
75
+ relayer = getDefaultSimulatedRelayerAddress(deposit.destinationChainId),
78
76
  options: Partial<{
79
77
  gasPrice: BigNumberish;
80
78
  gasUnits: BigNumberish;
@@ -93,12 +91,7 @@ export class QueryBase implements QueryInterface {
93
91
  transport,
94
92
  } = options;
95
93
 
96
- const { recipient, outputToken, exclusiveRelayer } = relayData;
97
- assert(recipient.isEVM(), `getGasCosts: recipient not an EVM address (${recipient})`);
98
- assert(outputToken.isEVM(), `getGasCosts: outputToken not an EVM address (${outputToken})`);
99
- assert(exclusiveRelayer.isEVM(), `getGasCosts: exclusiveRelayer not an EVM address (${exclusiveRelayer})`);
100
-
101
- const tx = await this.getUnsignedTxFromDeposit({ ...relayData, recipient, outputToken, exclusiveRelayer }, relayer);
94
+ const tx = await this.getUnsignedTxFromDeposit(deposit, relayer);
102
95
  const {
103
96
  nativeGasCost,
104
97
  tokenGasCost,
@@ -123,41 +116,29 @@ export class QueryBase implements QueryInterface {
123
116
 
124
117
  /**
125
118
  * @notice Return ethers.PopulatedTransaction for a fill based on input deposit args
126
- * @param relayData RelayData instance, supplemented with destinationChainId
119
+ * @param deposit
127
120
  * @param relayer Sender of PopulatedTransaction
128
121
  * @returns PopulatedTransaction
129
122
  */
130
123
  getUnsignedTxFromDeposit(
131
- relayData: Omit<RelayData, "recipient" | "outputToken"> & {
132
- destinationChainId: number;
133
- recipient: EvmAddress;
134
- outputToken: EvmAddress;
135
- },
136
- relayer = toAddressType(getDefaultRelayer(relayData.destinationChainId), relayData.destinationChainId)
124
+ deposit: Omit<Deposit, "messageHash">,
125
+ relayer = getDefaultSimulatedRelayerAddress(deposit.destinationChainId)
137
126
  ): Promise<PopulatedTransaction> {
138
- return populateV3Relay(this.spokePool, relayData, relayer);
127
+ return populateV3Relay(this.spokePool, deposit, relayer);
139
128
  }
140
129
 
141
130
  /**
142
131
  * @notice Return the gas cost of a simulated transaction
143
- * @param relayData RelayData instance, supplemented with destinationChainId
132
+ * @param deposit
144
133
  * @param relayer Sender of PopulatedTransaction
145
134
  * @returns Estimated gas cost based on ethers.VoidSigner's gas estimation
146
135
  */
147
136
  async getNativeGasCost(
148
- relayData: RelayData & { destinationChainId: number },
149
- relayer = toAddressType(getDefaultRelayer(relayData.destinationChainId), relayData.destinationChainId)
137
+ deposit: Omit<Deposit, "messageHash">,
138
+ relayer = getDefaultSimulatedRelayerAddress(deposit.destinationChainId)
150
139
  ): Promise<BigNumber> {
151
- const { recipient, outputToken, exclusiveRelayer } = relayData;
152
- assert(recipient.isEVM(), `getNativeGasCost: recipient not an EVM address (${recipient})`);
153
- assert(outputToken.isEVM(), `getNativeGasCost: outputToken not an EVM address (${outputToken})`);
154
- assert(exclusiveRelayer.isEVM(), `getNativeGasCost: exclusiveRelayer not an EVM address (${exclusiveRelayer})`);
155
-
156
- const unsignedTx = await this.getUnsignedTxFromDeposit(
157
- { ...relayData, recipient, outputToken, exclusiveRelayer },
158
- relayer
159
- );
160
- const voidSigner = new VoidSigner(relayer.toEvmAddress(), this.provider);
140
+ const unsignedTx = await this.getUnsignedTxFromDeposit(deposit, relayer);
141
+ const voidSigner = new VoidSigner(relayer, this.provider);
161
142
  return voidSigner.estimateGas(unsignedTx);
162
143
  }
163
144
 
@@ -171,7 +152,7 @@ export class QueryBase implements QueryInterface {
171
152
  */
172
153
  async getOpStackL1DataFee(
173
154
  unsignedTx: PopulatedTransaction,
174
- relayer = toAddressType(getDefaultRelayer(unsignedTx.chainId), CHAIN_IDs.MAINNET),
155
+ relayer = getDefaultSimulatedRelayerAddress(unsignedTx.chainId),
175
156
  options: Partial<{
176
157
  opStackL2GasUnits: BigNumberish;
177
158
  opStackL1DataFeeMultiplier: BigNumber;
@@ -180,7 +161,7 @@ export class QueryBase implements QueryInterface {
180
161
  const { opStackL2GasUnits, opStackL1DataFeeMultiplier = toBNWei("1") } = options || {};
181
162
  const { chainId } = await this.provider.getNetwork();
182
163
  assert(isOptimismL2Provider(this.provider), `Unexpected provider for chain ID ${chainId}.`);
183
- const voidSigner = new VoidSigner(relayer.toEvmAddress(), this.provider);
164
+ const voidSigner = new VoidSigner(relayer, this.provider);
184
165
  const populatedTransaction = await voidSigner.populateTransaction({
185
166
  ...unsignedTx,
186
167
  gasLimit: opStackL2GasUnits, // prevents additional gas estimation call
@@ -202,7 +183,7 @@ export class QueryBase implements QueryInterface {
202
183
  */
203
184
  async estimateGas(
204
185
  unsignedTx: PopulatedTransaction,
205
- senderAddress: Address,
186
+ senderAddress: string,
206
187
  provider: providers.Provider | L2Provider<providers.Provider>,
207
188
  options: Partial<{
208
189
  gasPrice: BigNumberish;
@@ -223,7 +204,7 @@ export class QueryBase implements QueryInterface {
223
204
  } = options || {};
224
205
 
225
206
  const { chainId } = await provider.getNetwork();
226
- const voidSigner = new VoidSigner(senderAddress.toEvmAddress(), provider);
207
+ const voidSigner = new VoidSigner(senderAddress, provider);
227
208
 
228
209
  // Estimate the Gas units required to submit this transaction.
229
210
  const queries = [
@@ -7,7 +7,7 @@ import { CUSTOM_GAS_TOKENS } from "../../constants";
7
7
  import { chainIsOPStack, isDefined, chainIsSvm, SvmAddress } from "../../utils";
8
8
  import { QueryBase } from "./baseQuery";
9
9
  import { SVMProvider as svmProvider } from "../../arch/svm";
10
- import { DEFAULT_LOGGER, getDefaultRelayer, Logger } from "../relayFeeCalculator";
10
+ import { DEFAULT_LOGGER, getDefaultSimulatedRelayerAddress, Logger } from "../relayFeeCalculator";
11
11
  import { CustomGasTokenQueries } from "./customGasToken";
12
12
  import { SvmQuery } from "./svmQuery";
13
13
 
@@ -25,7 +25,7 @@ export class QueryBase__factory {
25
25
  provider: providers.Provider | svmProvider,
26
26
  symbolMapping = TOKEN_SYMBOLS_MAP,
27
27
  spokePoolAddress = getDeployedAddress("SpokePool", chainId),
28
- simulatedRelayerAddress = getDefaultRelayer(chainId),
28
+ simulatedRelayerAddress = getDefaultSimulatedRelayerAddress(chainId),
29
29
  coingeckoProApiKey?: string,
30
30
  logger: Logger = DEFAULT_LOGGER,
31
31
  coingeckoBaseCurrency = "eth"
@@ -1,4 +1,3 @@
1
- import assert from "assert";
2
1
  import { SvmSpokeClient } from "@across-protocol/contracts";
3
2
  import { intToU8Array32 } from "@across-protocol/contracts/dist/src/svm/web3-v1/conversionUtils";
4
3
  import { SYSTEM_PROGRAM_ADDRESS } from "@solana-program/system";
@@ -18,7 +17,7 @@ import {
18
17
  import { Coingecko } from "../../coingecko";
19
18
  import { CHAIN_IDs } from "../../constants";
20
19
  import { getGasPriceEstimate } from "../../gasPriceOracle";
21
- import { RelayData } from "../../interfaces";
20
+ import { Deposit } from "../../interfaces";
22
21
  import {
23
22
  BigNumber,
24
23
  BigNumberish,
@@ -28,7 +27,7 @@ import {
28
27
  toAddressType,
29
28
  toBN,
30
29
  } from "../../utils";
31
- import { Logger, QueryInterface, getDefaultRelayer } from "../relayFeeCalculator";
30
+ import { Logger, QueryInterface, getDefaultSimulatedRelayerAddress } from "../relayFeeCalculator";
32
31
  import { SymbolMappingType } from "./";
33
32
 
34
33
  /**
@@ -66,7 +65,7 @@ export class SvmQuery implements QueryInterface {
66
65
 
67
66
  /**
68
67
  * Retrieves the current gas costs of performing a fillRelay contract at the referenced SpokePool.
69
- * @param relayData RelayData instance, supplemented with destinationChainId
68
+ * @param deposit V3 deposit instance.
70
69
  * @param _relayer Relayer address to simulate with.
71
70
  * @param options
72
71
  * @param options.gasPrice Optional gas price to use for the simulation.
@@ -75,8 +74,8 @@ export class SvmQuery implements QueryInterface {
75
74
  * @returns The gas estimate for this function call (multiplied with the optional buffer).
76
75
  */
77
76
  async getGasCosts(
78
- relayData: RelayData & { destinationChainId: number },
79
- relayer = toAddressType(getDefaultRelayer(relayData.destinationChainId), relayData.destinationChainId),
77
+ deposit: Omit<Deposit, "messageHash">,
78
+ _relayer = getDefaultSimulatedRelayerAddress(deposit.destinationChainId),
80
79
  options: Partial<{
81
80
  gasPrice: BigNumberish;
82
81
  gasUnits: BigNumberish;
@@ -84,12 +83,10 @@ export class SvmQuery implements QueryInterface {
84
83
  priorityFeeMultiplier: BigNumber;
85
84
  }> = {}
86
85
  ): Promise<TransactionCostEstimate> {
87
- const { recipient, outputToken, exclusiveRelayer } = relayData;
88
- assert(recipient.isSVM(), `getGasCosts: recipient not an SVM address (${recipient})`);
89
- assert(outputToken.isSVM(), `getGasCosts: outputToken not an SVM address (${outputToken})`);
90
- assert(exclusiveRelayer.isSVM(), `getGasCosts: exclusiveRelayer not an SVM address (${exclusiveRelayer})`);
91
-
92
- const fillRelayTx = await this.getFillRelayTx({ ...relayData, recipient, outputToken, exclusiveRelayer }, relayer);
86
+ const relayer = _relayer
87
+ ? toAddressType(_relayer, deposit.destinationChainId).forceSvmAddress()
88
+ : this.simulatedRelayerAddress;
89
+ const fillRelayTx = await this.getFillRelayTx(deposit, relayer.toBase58());
93
90
 
94
91
  const [computeUnitsConsumed, gasPriceEstimate] = await Promise.all([
95
92
  toBN(await this.computeUnitEstimator(fillRelayTx)),
@@ -120,75 +117,77 @@ export class SvmQuery implements QueryInterface {
120
117
  * @returns Estimated gas cost in compute units
121
118
  */
122
119
  async getNativeGasCost(
123
- deposit: RelayData & { destinationChainId: number },
124
- _relayer = toAddressType(getDefaultRelayer(deposit.destinationChainId), deposit.destinationChainId)
120
+ deposit: Omit<Deposit, "messageHash">,
121
+ _relayer = getDefaultSimulatedRelayerAddress(deposit.destinationChainId)
125
122
  ): Promise<BigNumber> {
126
- const { recipient, outputToken, exclusiveRelayer } = deposit;
127
- assert(recipient.isSVM(), `getNativeGasCost: recipient not an SVM address (${recipient})`);
128
- assert(outputToken.isSVM(), `getNativeGasCost: outputToken not an SVM address (${outputToken})`);
129
- assert(exclusiveRelayer.isSVM(), `getNativeGasCost: exclusiveRelayer not an SVM address (${exclusiveRelayer})`);
130
-
131
- const fillRelayTx = await this.getFillRelayTx({ ...deposit, recipient, outputToken, exclusiveRelayer }, _relayer);
123
+ const fillRelayTx = await this.getFillRelayTx(deposit, _relayer);
132
124
  return toBN(await this.computeUnitEstimator(fillRelayTx));
133
125
  }
134
126
 
135
127
  /**
136
128
  * @notice Return the fillRelay transaction for a given deposit
137
- * @param relayData RelayData instance, supplemented with destinationChainId
129
+ * @param deposit
138
130
  * @param relayer SVM address of the relayer
139
131
  * @returns FillRelay transaction
140
132
  */
141
133
  async getFillRelayTx(
142
- relayData: Omit<RelayData, "recipent" | "outputToken"> & {
143
- destinationChainId: number;
144
- recipient: SvmAddress;
145
- outputToken: SvmAddress;
146
- },
147
- relayer = toAddressType(getDefaultRelayer(relayData.destinationChainId), relayData.destinationChainId),
148
- repaymentChainId = relayData.destinationChainId,
149
- repaymentAddress = toAddressType(getDefaultRelayer(relayData.destinationChainId), relayData.destinationChainId)
134
+ deposit: Omit<Deposit, "messageHash">,
135
+ _relayer = getDefaultSimulatedRelayerAddress(deposit.destinationChainId),
136
+ repaymentChainId = deposit.destinationChainId,
137
+ repaymentAddress = getDefaultSimulatedRelayerAddress(deposit.destinationChainId)
150
138
  ) {
151
- const { depositor, recipient, inputToken, outputToken, exclusiveRelayer, destinationChainId } = relayData;
139
+ const toSvmAddress = (address: string, chainId: number) =>
140
+ toAddress(toAddressType(address, chainId).forceSvmAddress());
152
141
 
153
- // tsc appeasement...should be unnecessary, but isn't. @todo Identify why.
154
- assert(recipient.isSVM(), `getFillRelayTx: recipient not an SVM address (${recipient})`);
155
- assert(
156
- repaymentAddress.isValidOn(repaymentChainId),
157
- `getFillRelayTx: repayment address ${repaymentAddress} not valid on chain ${repaymentChainId})`
158
- );
142
+ const { depositor, recipient, inputToken, outputToken, exclusiveRelayer, originChainId, destinationChainId } =
143
+ deposit;
159
144
 
160
145
  const program = toAddress(this.spokePool);
161
- const _relayDataHash = getRelayDataHash(relayData, destinationChainId);
146
+ const relayer = _relayer
147
+ ? toAddressType(_relayer, deposit.destinationChainId).forceSvmAddress()
148
+ : this.simulatedRelayerAddress;
149
+
150
+ const _relayDataHash = getRelayDataHash(deposit, destinationChainId);
162
151
  const relayDataHash = new Uint8Array(Buffer.from(_relayDataHash.slice(2), "hex"));
163
152
 
164
153
  const [state, delegate] = await Promise.all([
165
154
  getStatePda(program),
166
- getFillRelayDelegatePda(relayDataHash, BigInt(repaymentChainId), toAddress(repaymentAddress), program),
155
+ getFillRelayDelegatePda(
156
+ relayDataHash,
157
+ BigInt(repaymentChainId),
158
+ toSvmAddress(repaymentAddress, repaymentChainId),
159
+ program
160
+ ),
167
161
  ]);
168
162
 
169
- const mint = toAddress(outputToken);
163
+ const _mint = toAddressType(outputToken, destinationChainId).forceSvmAddress();
164
+ const mint = toAddress(_mint);
170
165
  const mintInfo = await fetchMint(this.provider, mint);
171
166
 
172
167
  const [recipientAta, relayerAta, fillStatus, eventAuthority] = await Promise.all([
173
- getAssociatedTokenAddress(recipient, outputToken, mintInfo.programAddress),
174
- getAssociatedTokenAddress(SvmAddress.from(relayer.toBase58()), outputToken, mintInfo.programAddress),
175
- getFillStatusPda(program, relayData, destinationChainId),
176
- getEventAuthority(program),
168
+ getAssociatedTokenAddress(
169
+ toAddressType(deposit.recipient, destinationChainId).forceSvmAddress(),
170
+ _mint,
171
+ mintInfo.programAddress
172
+ ),
173
+ getAssociatedTokenAddress(SvmAddress.from(relayer.toBase58()), _mint, mintInfo.programAddress),
174
+ getFillStatusPda(program, deposit, destinationChainId),
175
+ getEventAuthority(),
177
176
  ]);
178
177
 
179
- const svmRelayData: SvmSpokeClient.FillRelayInput["relayData"] = {
180
- depositor: toAddress(depositor),
181
- recipient: toAddress(recipient),
182
- exclusiveRelayer: toAddress(exclusiveRelayer),
183
- inputToken: toAddress(inputToken),
178
+ const relayData: SvmSpokeClient.FillRelayInput["relayData"] = {
179
+ depositor: toSvmAddress(depositor, originChainId),
180
+ recipient: toSvmAddress(recipient, destinationChainId),
181
+ exclusiveRelayer: toSvmAddress(exclusiveRelayer, destinationChainId),
182
+ inputToken: toSvmAddress(inputToken, originChainId),
184
183
  outputToken: mint,
185
- inputAmount: relayData.inputAmount.toBigInt(),
186
- outputAmount: relayData.outputAmount.toBigInt(),
187
- originChainId: relayData.originChainId,
188
- depositId: new Uint8Array(intToU8Array32(relayData.depositId.toNumber())),
189
- fillDeadline: relayData.fillDeadline,
190
- exclusivityDeadline: relayData.exclusivityDeadline,
191
- message: new Uint8Array(Buffer.from(relayData.message, "hex")),
184
+ inputAmount: deposit.inputAmount.toBigInt(),
185
+ outputAmount: deposit.outputAmount.toBigInt(),
186
+ originChainId: deposit.originChainId,
187
+ depositId: new Uint8Array(intToU8Array32(deposit.depositId.toNumber())),
188
+ fillDeadline: deposit.fillDeadline,
189
+ exclusivityDeadline: deposit.exclusivityDeadline,
190
+ message: new Uint8Array(Buffer.from(deposit.message, "hex")),
192
191
  };
193
192
 
194
193
  const simulatedSigner = SolanaVoidSigner(relayer.toBase58());
@@ -206,9 +205,9 @@ export class SvmQuery implements QueryInterface {
206
205
  eventAuthority,
207
206
  program,
208
207
  relayHash: relayDataHash,
209
- relayData: svmRelayData,
208
+ relayData,
210
209
  repaymentChainId: BigInt(repaymentChainId),
211
- repaymentAddress: toAddress(repaymentAddress),
210
+ repaymentAddress: toSvmAddress(repaymentAddress, repaymentChainId),
212
211
  };
213
212
  // Pass createRecipientAtaIfNeeded =true to the createFillInstruction function to create the recipient token account
214
213
  // if it doesn't exist.
@@ -9,9 +9,12 @@ import { Deposit } from "../interfaces";
9
9
  import {
10
10
  BigNumber,
11
11
  BigNumberish,
12
+ ConvertDecimals,
12
13
  MAX_BIG_INT,
13
14
  TransactionCostEstimate,
14
15
  bnZero,
16
+ chainIsSvm,
17
+ compareAddressesSimple,
15
18
  fixedPointAdjustment,
16
19
  getTokenInfo,
17
20
  isDefined,
@@ -22,18 +25,13 @@ import {
22
25
  percent,
23
26
  toBN,
24
27
  toBNWei,
25
- compareAddressesSimple,
26
- ConvertDecimals,
27
- chainIsSvm,
28
- toAddressType,
29
- Address,
30
28
  } from "../utils";
31
29
 
32
30
  // This needs to be implemented for every chain and passed into RelayFeeCalculator
33
31
  export interface QueryInterface {
34
32
  getGasCosts: (
35
33
  deposit: Omit<Deposit, "messageHash">,
36
- relayer: Address,
34
+ relayer: string,
37
35
  options?: Partial<{
38
36
  gasPrice: BigNumberish;
39
37
  gasUnits: BigNumberish;
@@ -44,7 +42,7 @@ export interface QueryInterface {
44
42
  }>
45
43
  ) => Promise<TransactionCostEstimate>;
46
44
  getTokenPrice: (tokenSymbol: string) => Promise<number>;
47
- getNativeGasCost: (deposit: Omit<Deposit, "messageHash">, relayer: Address) => Promise<BigNumber>;
45
+ getNativeGasCost: (deposit: Omit<Deposit, "messageHash">, relayer: string) => Promise<BigNumber>;
48
46
  }
49
47
 
50
48
  export const expectedCapitalCostsKeys = ["lowerBound", "upperBound", "cutoff", "decimals"];
@@ -114,7 +112,7 @@ export const DEFAULT_LOGGER: Logger = {
114
112
  error: (...args) => console.error(args),
115
113
  };
116
114
 
117
- export function getDefaultRelayer(chainId?: number) {
115
+ export function getDefaultSimulatedRelayerAddress(chainId?: number) {
118
116
  return isDefined(chainId) && chainIsSvm(chainId)
119
117
  ? DEFAULT_SIMULATED_RELAYER_ADDRESS_SVM
120
118
  : DEFAULT_SIMULATED_RELAYER_ADDRESS;
@@ -256,7 +254,7 @@ export class RelayFeeCalculator {
256
254
  deposit: Deposit,
257
255
  outputAmount: BigNumberish,
258
256
  simulateZeroFill = false,
259
- relayerAddress = toAddressType(getDefaultRelayer(deposit.destinationChainId), deposit.destinationChainId),
257
+ relayerAddress = getDefaultSimulatedRelayerAddress(deposit.destinationChainId),
260
258
  _tokenPrice?: number,
261
259
  tokenMapping = TOKEN_SYMBOLS_MAP,
262
260
  gasPrice?: BigNumberish,
@@ -273,14 +271,14 @@ export class RelayFeeCalculator {
273
271
  // undefined address on destination.
274
272
  const destinationChainTokenDetails = Object.values(tokenMapping).find(
275
273
  (details) =>
276
- compareAddressesSimple(details.addresses[originChainId], inputToken.toNative()) &&
274
+ compareAddressesSimple(details.addresses[originChainId], inputToken) &&
277
275
  isDefined(details.addresses[destinationChainId])
278
276
  );
279
277
  const outputToken = isZeroAddress(deposit.outputToken)
280
278
  ? destinationChainTokenDetails!.addresses[destinationChainId]
281
- : deposit.outputToken.toNative();
279
+ : deposit.outputToken;
282
280
  const outputTokenInfo = getTokenInfo(outputToken, destinationChainId, tokenMapping);
283
- const inputTokenInfo = getTokenInfo(inputToken.toNative(), originChainId, tokenMapping);
281
+ const inputTokenInfo = getTokenInfo(inputToken, originChainId, tokenMapping);
284
282
  if (!isDefined(outputTokenInfo) || !isDefined(inputTokenInfo)) {
285
283
  throw new Error(`Could not find token information for ${inputToken} or ${outputToken}`);
286
284
  }
@@ -495,7 +493,7 @@ export class RelayFeeCalculator {
495
493
  deposit: Deposit,
496
494
  outputAmount?: BigNumberish,
497
495
  simulateZeroFill = false,
498
- relayerAddress = toAddressType(getDefaultRelayer(deposit.destinationChainId), deposit.destinationChainId),
496
+ relayerAddress = getDefaultSimulatedRelayerAddress(deposit.destinationChainId),
499
497
  _tokenPrice?: number,
500
498
  gasPrice?: BigNumberish,
501
499
  gasUnits?: BigNumberish,
@@ -507,8 +505,8 @@ export class RelayFeeCalculator {
507
505
  const { inputToken, originChainId, outputToken, destinationChainId } = deposit;
508
506
  // We can perform a simple lookup with `getTokenInfo` here without resolving the exact token to resolve since we only need to
509
507
  // resolve the L1 token symbol and not the L2 token decimals.
510
- const inputTokenInfo = getTokenInfo(inputToken.toNative(), originChainId);
511
- const outputTokenInfo = getTokenInfo(outputToken.toNative(), destinationChainId);
508
+ const inputTokenInfo = getTokenInfo(inputToken, originChainId);
509
+ const outputTokenInfo = getTokenInfo(outputToken, destinationChainId);
512
510
  if (!isDefined(inputTokenInfo) || !isDefined(outputTokenInfo)) {
513
511
  throw new Error(`Could not find token information for ${inputToken} or ${outputToken}`);
514
512
  }