@across-protocol/sdk 4.2.15 → 4.2.16-alpha.2

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 (202) hide show
  1. package/dist/cjs/arch/evm/SpokeUtils.d.ts +6 -2
  2. package/dist/cjs/arch/evm/SpokeUtils.js +21 -6
  3. package/dist/cjs/arch/evm/SpokeUtils.js.map +1 -1
  4. package/dist/cjs/arch/svm/SpokeUtils.d.ts +6 -2
  5. package/dist/cjs/arch/svm/SpokeUtils.js +66 -67
  6. package/dist/cjs/arch/svm/SpokeUtils.js.map +1 -1
  7. package/dist/cjs/arch/svm/utils.d.ts +3 -1
  8. package/dist/cjs/arch/svm/utils.js +20 -14
  9. package/dist/cjs/arch/svm/utils.js.map +1 -1
  10. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +3 -3
  11. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +4 -2
  12. package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
  13. package/dist/cjs/clients/BundleDataClient/BundleDataClient.d.ts +4 -4
  14. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js +60 -56
  15. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  16. package/dist/cjs/clients/BundleDataClient/utils/DataworkerUtils.js +13 -13
  17. package/dist/cjs/clients/BundleDataClient/utils/DataworkerUtils.js.map +1 -1
  18. package/dist/cjs/clients/BundleDataClient/utils/FillUtils.d.ts +2 -1
  19. package/dist/cjs/clients/BundleDataClient/utils/FillUtils.js +3 -2
  20. package/dist/cjs/clients/BundleDataClient/utils/FillUtils.js.map +1 -1
  21. package/dist/cjs/clients/BundleDataClient/utils/MerkleTreeUtils.js +5 -1
  22. package/dist/cjs/clients/BundleDataClient/utils/MerkleTreeUtils.js.map +1 -1
  23. package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js +3 -3
  24. package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
  25. package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.d.ts +63 -63
  26. package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.js +11 -8
  27. package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.js.map +1 -1
  28. package/dist/cjs/clients/HubPoolClient.d.ts +21 -21
  29. package/dist/cjs/clients/HubPoolClient.js +83 -58
  30. package/dist/cjs/clients/HubPoolClient.js.map +1 -1
  31. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js +1 -1
  32. package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
  33. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.d.ts +2 -2
  34. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js +64 -45
  35. package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
  36. package/dist/cjs/clients/mocks/MockHubPoolClient.d.ts +9 -9
  37. package/dist/cjs/clients/mocks/MockHubPoolClient.js +15 -9
  38. package/dist/cjs/clients/mocks/MockHubPoolClient.js.map +1 -1
  39. package/dist/cjs/clients/mocks/MockSpokePoolClient.d.ts +5 -3
  40. package/dist/cjs/clients/mocks/MockSpokePoolClient.js +40 -36
  41. package/dist/cjs/clients/mocks/MockSpokePoolClient.js.map +1 -1
  42. package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.d.ts +2 -2
  43. package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.js +2 -2
  44. package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.js.map +1 -1
  45. package/dist/cjs/interfaces/HubPool.d.ts +19 -14
  46. package/dist/cjs/interfaces/SpokePool.d.ts +13 -13
  47. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.d.ts +6 -6
  48. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js +10 -10
  49. package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
  50. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.d.ts +5 -5
  51. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js +41 -48
  52. package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js.map +1 -1
  53. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +5 -5
  54. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js +7 -7
  55. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
  56. package/dist/cjs/utils/AddressUtils.d.ts +12 -13
  57. package/dist/cjs/utils/AddressUtils.js +44 -46
  58. package/dist/cjs/utils/AddressUtils.js.map +1 -1
  59. package/dist/cjs/utils/EventUtils.js +1 -1
  60. package/dist/cjs/utils/EventUtils.js.map +1 -1
  61. package/dist/cjs/utils/SpokeUtils.d.ts +3 -3
  62. package/dist/cjs/utils/SpokeUtils.js +4 -22
  63. package/dist/cjs/utils/SpokeUtils.js.map +1 -1
  64. package/dist/cjs/utils/TokenUtils.d.ts +4 -4
  65. package/dist/cjs/utils/TokenUtils.js +4 -6
  66. package/dist/cjs/utils/TokenUtils.js.map +1 -1
  67. package/dist/esm/arch/evm/SpokeUtils.d.ts +6 -2
  68. package/dist/esm/arch/evm/SpokeUtils.js +22 -7
  69. package/dist/esm/arch/evm/SpokeUtils.js.map +1 -1
  70. package/dist/esm/arch/svm/SpokeUtils.d.ts +6 -2
  71. package/dist/esm/arch/svm/SpokeUtils.js +70 -71
  72. package/dist/esm/arch/svm/SpokeUtils.js.map +1 -1
  73. package/dist/esm/arch/svm/utils.d.ts +6 -1
  74. package/dist/esm/arch/svm/utils.js +21 -13
  75. package/dist/esm/arch/svm/utils.js.map +1 -1
  76. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +3 -3
  77. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +4 -2
  78. package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
  79. package/dist/esm/clients/BundleDataClient/BundleDataClient.d.ts +4 -4
  80. package/dist/esm/clients/BundleDataClient/BundleDataClient.js +61 -57
  81. package/dist/esm/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  82. package/dist/esm/clients/BundleDataClient/utils/DataworkerUtils.js +14 -14
  83. package/dist/esm/clients/BundleDataClient/utils/DataworkerUtils.js.map +1 -1
  84. package/dist/esm/clients/BundleDataClient/utils/FillUtils.d.ts +2 -1
  85. package/dist/esm/clients/BundleDataClient/utils/FillUtils.js +5 -3
  86. package/dist/esm/clients/BundleDataClient/utils/FillUtils.js.map +1 -1
  87. package/dist/esm/clients/BundleDataClient/utils/MerkleTreeUtils.js +5 -1
  88. package/dist/esm/clients/BundleDataClient/utils/MerkleTreeUtils.js.map +1 -1
  89. package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js +4 -4
  90. package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
  91. package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.d.ts +63 -63
  92. package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.js +12 -9
  93. package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.js.map +1 -1
  94. package/dist/esm/clients/HubPoolClient.d.ts +23 -22
  95. package/dist/esm/clients/HubPoolClient.js +97 -63
  96. package/dist/esm/clients/HubPoolClient.js.map +1 -1
  97. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js +2 -2
  98. package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
  99. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.d.ts +2 -2
  100. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js +67 -47
  101. package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
  102. package/dist/esm/clients/mocks/MockHubPoolClient.d.ts +9 -9
  103. package/dist/esm/clients/mocks/MockHubPoolClient.js +16 -10
  104. package/dist/esm/clients/mocks/MockHubPoolClient.js.map +1 -1
  105. package/dist/esm/clients/mocks/MockSpokePoolClient.d.ts +5 -3
  106. package/dist/esm/clients/mocks/MockSpokePoolClient.js +42 -38
  107. package/dist/esm/clients/mocks/MockSpokePoolClient.js.map +1 -1
  108. package/dist/esm/clients/mocks/MockSvmSpokePoolClient.d.ts +2 -2
  109. package/dist/esm/clients/mocks/MockSvmSpokePoolClient.js +3 -3
  110. package/dist/esm/clients/mocks/MockSvmSpokePoolClient.js.map +1 -1
  111. package/dist/esm/interfaces/HubPool.d.ts +19 -14
  112. package/dist/esm/interfaces/SpokePool.d.ts +13 -13
  113. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.d.ts +6 -6
  114. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js +11 -11
  115. package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
  116. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.d.ts +6 -6
  117. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js +43 -50
  118. package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js.map +1 -1
  119. package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +5 -5
  120. package/dist/esm/relayFeeCalculator/relayFeeCalculator.js +8 -8
  121. package/dist/esm/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
  122. package/dist/esm/utils/AddressUtils.d.ts +13 -14
  123. package/dist/esm/utils/AddressUtils.js +50 -56
  124. package/dist/esm/utils/AddressUtils.js.map +1 -1
  125. package/dist/esm/utils/EventUtils.js +2 -2
  126. package/dist/esm/utils/EventUtils.js.map +1 -1
  127. package/dist/esm/utils/SpokeUtils.d.ts +3 -8
  128. package/dist/esm/utils/SpokeUtils.js +4 -26
  129. package/dist/esm/utils/SpokeUtils.js.map +1 -1
  130. package/dist/esm/utils/TokenUtils.d.ts +4 -16
  131. package/dist/esm/utils/TokenUtils.js +5 -7
  132. package/dist/esm/utils/TokenUtils.js.map +1 -1
  133. package/dist/types/arch/evm/SpokeUtils.d.ts +6 -2
  134. package/dist/types/arch/evm/SpokeUtils.d.ts.map +1 -1
  135. package/dist/types/arch/svm/SpokeUtils.d.ts +6 -2
  136. package/dist/types/arch/svm/SpokeUtils.d.ts.map +1 -1
  137. package/dist/types/arch/svm/utils.d.ts +6 -1
  138. package/dist/types/arch/svm/utils.d.ts.map +1 -1
  139. package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +3 -3
  140. package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts.map +1 -1
  141. package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts +4 -4
  142. package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts.map +1 -1
  143. package/dist/types/clients/BundleDataClient/utils/DataworkerUtils.d.ts.map +1 -1
  144. package/dist/types/clients/BundleDataClient/utils/FillUtils.d.ts +2 -1
  145. package/dist/types/clients/BundleDataClient/utils/FillUtils.d.ts.map +1 -1
  146. package/dist/types/clients/BundleDataClient/utils/MerkleTreeUtils.d.ts.map +1 -1
  147. package/dist/types/clients/BundleDataClient/utils/PoolRebalanceUtils.d.ts.map +1 -1
  148. package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts +63 -63
  149. package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts.map +1 -1
  150. package/dist/types/clients/HubPoolClient.d.ts +23 -22
  151. package/dist/types/clients/HubPoolClient.d.ts.map +1 -1
  152. package/dist/types/clients/SpokePoolClient/EVMSpokePoolClient.d.ts.map +1 -1
  153. package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts +2 -2
  154. package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts.map +1 -1
  155. package/dist/types/clients/mocks/MockHubPoolClient.d.ts +9 -9
  156. package/dist/types/clients/mocks/MockHubPoolClient.d.ts.map +1 -1
  157. package/dist/types/clients/mocks/MockSpokePoolClient.d.ts +5 -3
  158. package/dist/types/clients/mocks/MockSpokePoolClient.d.ts.map +1 -1
  159. package/dist/types/clients/mocks/MockSvmSpokePoolClient.d.ts +2 -2
  160. package/dist/types/clients/mocks/MockSvmSpokePoolClient.d.ts.map +1 -1
  161. package/dist/types/interfaces/HubPool.d.ts +19 -14
  162. package/dist/types/interfaces/HubPool.d.ts.map +1 -1
  163. package/dist/types/interfaces/SpokePool.d.ts +13 -13
  164. package/dist/types/interfaces/SpokePool.d.ts.map +1 -1
  165. package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts +6 -6
  166. package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts.map +1 -1
  167. package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts +6 -6
  168. package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts.map +1 -1
  169. package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +5 -5
  170. package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
  171. package/dist/types/utils/AddressUtils.d.ts +13 -14
  172. package/dist/types/utils/AddressUtils.d.ts.map +1 -1
  173. package/dist/types/utils/SpokeUtils.d.ts +3 -8
  174. package/dist/types/utils/SpokeUtils.d.ts.map +1 -1
  175. package/dist/types/utils/TokenUtils.d.ts +4 -16
  176. package/dist/types/utils/TokenUtils.d.ts.map +1 -1
  177. package/package.json +1 -2
  178. package/src/arch/evm/SpokeUtils.ts +52 -12
  179. package/src/arch/svm/SpokeUtils.ts +102 -51
  180. package/src/arch/svm/utils.ts +11 -4
  181. package/src/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.ts +7 -4
  182. package/src/clients/BundleDataClient/BundleDataClient.ts +57 -53
  183. package/src/clients/BundleDataClient/utils/DataworkerUtils.ts +28 -13
  184. package/src/clients/BundleDataClient/utils/FillUtils.ts +10 -4
  185. package/src/clients/BundleDataClient/utils/MerkleTreeUtils.ts +7 -1
  186. package/src/clients/BundleDataClient/utils/PoolRebalanceUtils.ts +4 -4
  187. package/src/clients/BundleDataClient/utils/SuperstructUtils.ts +13 -9
  188. package/src/clients/HubPoolClient.ts +126 -82
  189. package/src/clients/SpokePoolClient/EVMSpokePoolClient.ts +6 -0
  190. package/src/clients/SpokePoolClient/SpokePoolClient.ts +118 -35
  191. package/src/clients/mocks/MockHubPoolClient.ts +24 -19
  192. package/src/clients/mocks/MockSpokePoolClient.ts +39 -27
  193. package/src/clients/mocks/MockSvmSpokePoolClient.ts +12 -3
  194. package/src/interfaces/HubPool.ts +23 -14
  195. package/src/interfaces/SpokePool.ts +13 -13
  196. package/src/relayFeeCalculator/chain-queries/baseQuery.ts +14 -12
  197. package/src/relayFeeCalculator/chain-queries/svmQuery.ts +41 -44
  198. package/src/relayFeeCalculator/relayFeeCalculator.ts +20 -12
  199. package/src/utils/AddressUtils.ts +58 -60
  200. package/src/utils/EventUtils.ts +2 -2
  201. package/src/utils/SpokeUtils.ts +11 -33
  202. package/src/utils/TokenUtils.ts +10 -11
@@ -1 +1 @@
1
- {"version":3,"file":"relayFeeCalculator.d.ts","sourceRoot":"","sources":["../../../src/relayFeeCalculator/relayFeeCalculator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAMjC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,SAAS,EACT,YAAY,EAGZ,uBAAuB,EAcxB,MAAM,UAAU,CAAC;AAGlB,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,CACX,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,EACrC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,OAAO,CAAC;QAChB,QAAQ,EAAE,YAAY,CAAC;QACvB,QAAQ,EAAE,YAAY,CAAC;QACvB,iBAAiB,EAAE,SAAS,CAAC;QAC7B,qBAAqB,EAAE,SAAS,CAAC;QACjC,0BAA0B,EAAE,SAAS,CAAC;QACtC,SAAS,EAAE,SAAS,CAAC;KACtB,CAAC,KACC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,aAA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ACvB,QAAQ,CAAC,EAAE,YAAY,EACvB,aAAa,CAAC,EAAE,YAAY,EAC5B,SAAS,CAAC,EAAE,SAAS,GACpB,OAAO,CAAC,SAAS,CAAC;IA2DrB,iBAAiB,CACf,aAAa,EAAE,YAAY,EAC3B,YAAY,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE,eAAe,EAC9B,iBAAiB,CAAC,EAAE,eAAe,GAClC,SAAS;IAmEZ;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;IA0C/B;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IA8B7B;;;;;;;;;;;;;;OAcG;IACG,iBAAiB,CACrB,OAAO,EAAE,OAAO,EAChB,YAAY,CAAC,EAAE,YAAY,EAC3B,gBAAgB,UAAQ,EACxB,cAAc,UAGb,EACD,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,YAAY,EACvB,QAAQ,CAAC,EAAE,YAAY,EACvB,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,iBAAiB,CAAC;CAuE9B"}
@@ -1,6 +1,4 @@
1
- /// <reference types="node" />
2
1
  import { providers } from "ethers";
3
- import { Address as V2Address } from "@solana/kit";
4
2
  import { BigNumber } from "./";
5
3
  /**
6
4
  * Checks if a contract is deployed at the given address
@@ -12,16 +10,16 @@ export declare function isContractDeployedToAddress(address: string, provider: p
12
10
  export declare function compareAddresses(addressA: string, addressB: string): 1 | -1 | 0;
13
11
  export declare function compareAddressesSimple(addressA?: string, addressB?: string): boolean;
14
12
  export declare function toBytes32(address: string): string;
15
- export declare function toAddress(hexString: string): string;
13
+ export declare function toEvmAddress(hexString: string): string;
16
14
  export declare function isValidEvmAddress(address: string): boolean;
17
15
  /**
18
16
  * Creates the proper address type given the input chain ID corresponding to the address's origin network.
19
17
  * @param address Stringified address type to convert. Can be either hex encoded or base58 encoded.
20
- * @param chainId Network ID corresponding to the input address, used to determine which address type to output.
18
+ * @param chainId Chain ID for the intended use of the address.
21
19
  * @returns a child `Address` type most fitting for the chain ID.
22
20
  * @todo: Change this to `toAddress` once we remove the other `toAddress` function.
23
21
  */
24
- export declare function toAddressType(address: string): Address | EvmAddress | SvmAddress;
22
+ export declare function toAddressType(address: string, chainId: number): Address;
25
23
  export declare class Address {
26
24
  readonly rawAddress: Uint8Array;
27
25
  evmAddress: string | undefined;
@@ -29,33 +27,34 @@ export declare class Address {
29
27
  svmAddress: string | undefined;
30
28
  bnAddress: BigNumber | undefined;
31
29
  constructor(_rawAddress: Uint8Array);
30
+ static __unsafeConstruct(_rawAddress: Uint8Array): Address;
32
31
  toBytes32(): string;
32
+ truncateToBytes20(): string;
33
33
  toBase58(): string;
34
- toBigNumber(): BigNumber;
34
+ private toBigNumber;
35
35
  toEvmAddress(): string;
36
- toAddress(): string;
37
- toBuffer(): Buffer;
36
+ toNative(): string;
38
37
  toHexString(): string;
39
- isValidEvmAddress(): boolean;
40
38
  isValidOn(chainId: number): boolean;
41
39
  static isAddress(obj: unknown): boolean;
42
40
  toString(): string;
43
41
  isZeroAddress(): boolean;
44
42
  forceSvmAddress(): SvmAddress;
45
- forceEvmAddress(): EvmAddress;
46
43
  eq(other: Address): boolean;
47
44
  compare(otherAddress: Address): 1 | -1 | 0;
45
+ static isEvmAddress(address: Address): boolean;
46
+ static isSvmAddress(address: Address): boolean;
48
47
  }
49
48
  export declare class EvmAddress extends Address {
50
49
  constructor(rawAddress: Uint8Array);
51
- toAddress(): string;
50
+ static validate(rawAddress: Uint8Array): boolean;
51
+ toNative(): string;
52
52
  static from(address: string, encoding?: "base16" | "base58"): EvmAddress;
53
53
  }
54
54
  export declare class SvmAddress extends Address {
55
55
  constructor(rawAddress: Uint8Array);
56
- toAddress(): string;
57
- toV2Address(): V2Address<string>;
58
- toEvmAddress(): string;
56
+ static validate(rawAddress: Uint8Array): boolean;
57
+ toNative(): string;
59
58
  static from(address: string, encoding?: "base58" | "base16"): SvmAddress;
60
59
  }
61
60
  //# sourceMappingURL=AddressUtils.d.ts.map
@@ -1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e,IAAI,UAAU;IAK7B,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAK3B,OAAO,CAAC,YAAY,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;IAc1C,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;IAI9C,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;CAG/C;AAGD,qBAAa,UAAW,SAAQ,OAAO;gBAEzB,UAAU,EAAE,UAAU;IAQlC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO;IAOvC,QAAQ,IAAI,MAAM;IAK3B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,QAAQ,GAAG,QAAmB,GAAG,UAAU;CAenF;AAGD,qBAAa,UAAW,SAAQ,OAAO;gBAEzB,UAAU,EAAE,UAAU;IAQlC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO;IAMvC,QAAQ,IAAI,MAAM;IAK3B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,QAAQ,GAAG,QAAmB,GAAG,UAAU;CAYnF"}
@@ -1,13 +1,8 @@
1
- import { Deposit, Fill, RelayData, SlowFillLeaf } from "../interfaces";
1
+ import { Fill, RelayData, SlowFillLeaf } from "../interfaces";
2
2
  import { BigNumber } from "./BigNumberUtils";
3
+ import { Address } from "./AddressUtils";
3
4
  export declare function isSlowFill(fill: Fill): boolean;
4
5
  export declare function getSlowFillLeafLpFeePct(leaf: SlowFillLeaf): BigNumber;
5
- /**
6
- * Produce the RelayData for a Deposit.
7
- * @param deposit Deposit instance.
8
- * @returns The corresponding RelayData object.
9
- */
10
- export declare function getDepositRelayData(deposit: Omit<Deposit, "messageHash">): RelayData;
11
6
  /**
12
7
  * Compute the RelayData hash for a fill. This can be used to determine the fill status.
13
8
  * @param relayData RelayData information that is used to complete a fill.
@@ -19,6 +14,6 @@ export declare function getRelayHashFromEvent(e: RelayData & {
19
14
  destinationChainId: number;
20
15
  }): string;
21
16
  export declare function isUnsafeDepositId(depositId: BigNumber): boolean;
22
- export declare function isZeroAddress(address: string): boolean;
17
+ export declare function isZeroAddress(address: Address): boolean;
23
18
  export declare function getMessageHash(message: string): string;
24
19
  //# sourceMappingURL=SpokeUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpokeUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/SpokeUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAY,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAK7C,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAE9C;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,CAGrE;AACD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,GAAG,SAAS,CAepF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAkCzF;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,SAAS,GAAG;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE3F;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAQ/D;AAGD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD"}
1
+ {"version":3,"file":"SpokeUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/SpokeUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAY,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAKzC,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAE9C;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,CAGrE;AACD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAkCzF;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,SAAS,GAAG;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE3F;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAQ/D;AAGD,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEvD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD"}
@@ -1,9 +1,9 @@
1
1
  import { BlockTag } from "@ethersproject/abstract-provider";
2
2
  import { providers, Signer } from "ethers";
3
- import { L1Token } from "../interfaces";
3
+ import { L1TokenInfo, TokenInfo } from "../interfaces";
4
4
  import { BigNumber } from "./BigNumberUtils";
5
5
  type SignerOrProvider = providers.Provider | Signer;
6
- export declare function fetchTokenInfo(address: string, signerOrProvider: SignerOrProvider): Promise<L1Token>;
6
+ export declare function fetchTokenInfo(address: string, signerOrProvider: SignerOrProvider): Promise<TokenInfo>;
7
7
  export declare const getL2TokenAddresses: (l1TokenAddress: string, l1ChainId?: number) => {
8
8
  [chainId: number]: string;
9
9
  } | undefined;
@@ -14,7 +14,7 @@ export declare const getL2TokenAddresses: (l1TokenAddress: string, l1ChainId?: n
14
14
  * @param chainId Chain ID to query on.
15
15
  * @returns Symbol, decimals and contract address on the requested chain.
16
16
  */
17
- export declare function resolveSymbolOnChain(chainId: number, symbol: string): L1Token;
17
+ export declare function resolveSymbolOnChain(chainId: number, symbol: string): TokenInfo;
18
18
  /**
19
19
  * Returns the contract address for a given token symbol and chainId.
20
20
  * @param symbol A case-insensitive token symbol.
@@ -296,12 +296,6 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
296
296
  l1TokenDecimals: number;
297
297
  coingeckoId: string;
298
298
  };
299
- /**
300
- * Get the USDC symbol for the given token address and chain ID.
301
- * @param l2Token A Web3 token address (not case sensitive)
302
- * @param chainId A chain Id to reference
303
- * @returns Either USDC (if native) or USDbC/USDC.e (if bridged) or undefined if the token address is not recognized.
304
- */
305
299
  USDT: {
306
300
  name: string;
307
301
  symbol: string;
@@ -717,12 +711,6 @@ export declare function getTokenInfo(l2TokenAddress: string, chainId: number, to
717
711
  l1TokenDecimals: number;
718
712
  coingeckoId: string;
719
713
  };
720
- /**
721
- * Get the USDC symbol for the given token address and chain ID.
722
- * @param l2Token A Web3 token address (not case sensitive)
723
- * @param chainId A chain Id to reference
724
- * @returns Either USDC (if native) or USDbC/USDC.e (if bridged) or undefined if the token address is not recognized.
725
- */
726
714
  USDT: {
727
715
  name: string;
728
716
  symbol: string;
@@ -842,7 +830,7 @@ export declare function getTokenInfo(l2TokenAddress: string, chainId: number, to
842
830
  };
843
831
  coingeckoId: string;
844
832
  };
845
- }): L1Token;
833
+ }): L1TokenInfo;
846
834
  /**
847
835
  * Get the USDC symbol for the given token address and chain ID.
848
836
  * @param l2Token A Web3 token address (not case sensitive)
@@ -1 +1 @@
1
- {"version":3,"file":"TokenUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/TokenUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAY,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE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AC,CAGpB;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAI1D;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAIzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoB,GAAG,WAAW,CAoBnH;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOlF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAUjF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@across-protocol/sdk",
3
3
  "author": "UMA Team",
4
- "version": "4.2.15",
4
+ "version": "4.2.16-alpha.2",
5
5
  "license": "AGPL-3.0",
6
6
  "homepage": "https://docs.across.to/reference/sdk",
7
7
  "files": [
@@ -111,7 +111,6 @@
111
111
  "@ethersproject/bignumber": "^5.7.0",
112
112
  "@pinata/sdk": "^2.1.0",
113
113
  "@solana-program/system": "^0.7.0",
114
- "@solana-program/token": "^0.5.1",
115
114
  "@solana-program/token-2022": "^0.4.0",
116
115
  "@solana/kit": "^2.1.0",
117
116
  "@solana/web3.js": "^1.31.0",
@@ -1,8 +1,9 @@
1
1
  import assert from "assert";
2
2
  import { BytesLike, Contract, PopulatedTransaction, providers } from "ethers";
3
3
  import { CHAIN_IDs } from "../../constants";
4
- import { Deposit, FillStatus, FillWithBlock, RelayData } from "../../interfaces";
4
+ import { Deposit, FillStatus, FillWithBlock, RelayData, RelayExecutionEventInfo } from "../../interfaces";
5
5
  import {
6
+ EvmAddress,
6
7
  bnUint32Max,
7
8
  BigNumber,
8
9
  toBN,
@@ -13,11 +14,11 @@ import {
13
14
  isDefined,
14
15
  isUnsafeDepositId,
15
16
  isZeroAddress,
16
- getDepositRelayData,
17
17
  getNetworkName,
18
18
  paginatedEventQuery,
19
19
  spreadEventWithBlockNumber,
20
- toBytes32,
20
+ Address,
21
+ toAddressType,
21
22
  } from "../../utils";
22
23
 
23
24
  type BlockTag = providers.BlockTag;
@@ -30,11 +31,32 @@ type BlockTag = providers.BlockTag;
30
31
  */
31
32
  export function populateV3Relay(
32
33
  spokePool: Contract,
33
- deposit: Omit<Deposit, "messageHash">,
34
- relayer: string,
34
+ deposit: Omit<Deposit, "messageHash" | "fromLiteChain" | "toLiteChain"> & {
35
+ recipient: EvmAddress;
36
+ outputToken: EvmAddress;
37
+ exclusiveRelayer: EvmAddress;
38
+ },
39
+ repaymentAddress: Address,
35
40
  repaymentChainId = deposit.destinationChainId
36
41
  ): Promise<PopulatedTransaction> {
37
- const relayData = getDepositRelayData(deposit);
42
+ assert(
43
+ repaymentAddress.isValidOn(repaymentChainId),
44
+ `Invalid repayment address for chain ${repaymentChainId}: ${repaymentAddress.toNative()}.`
45
+ );
46
+ const relayData = {
47
+ depositor: deposit.depositor.toBytes32(),
48
+ recipient: deposit.recipient.toBytes32(),
49
+ inputToken: deposit.inputToken.toBytes32(),
50
+ outputToken: deposit.outputToken.toBytes32(),
51
+ inputAmount: deposit.inputAmount,
52
+ outputAmount: deposit.outputAmount,
53
+ originChainId: deposit.originChainId,
54
+ depositId: deposit.depositId,
55
+ fillDeadline: deposit.fillDeadline,
56
+ exclusivityDeadline: deposit.exclusivityDeadline,
57
+ message: deposit.message,
58
+ exclusiveRelayer: deposit.exclusiveRelayer.toBytes32(),
59
+ };
38
60
 
39
61
  if (isDefined(deposit.speedUpSignature)) {
40
62
  assert(isDefined(deposit.updatedRecipient) && !isZeroAddress(deposit.updatedRecipient));
@@ -43,16 +65,15 @@ export function populateV3Relay(
43
65
  return spokePool.populateTransaction.fillRelayWithUpdatedDeposit(
44
66
  relayData,
45
67
  repaymentChainId,
46
- toBytes32(relayer),
68
+ repaymentAddress.toBytes32(),
47
69
  deposit.updatedOutputAmount,
48
- toBytes32(deposit.updatedRecipient),
70
+ deposit.updatedRecipient.toBytes32(),
49
71
  deposit.updatedMessage,
50
- deposit.speedUpSignature,
51
- { from: relayer }
72
+ deposit.speedUpSignature
52
73
  );
53
74
  }
54
75
 
55
- return spokePool.populateTransaction.fillRelay(relayData, repaymentChainId, toBytes32(relayer), { from: relayer });
76
+ return spokePool.populateTransaction.fillRelay(relayData, repaymentChainId, repaymentAddress.toBytes32());
56
77
  }
57
78
 
58
79
  /**
@@ -315,8 +336,27 @@ export async function findFillEvent(
315
336
  const destinationChainId = Object.values(CHAIN_IDs).includes(relayData.originChainId)
316
337
  ? (await spokePool.provider.getNetwork()).chainId
317
338
  : Number(await spokePool.chainId());
339
+ const fillEvent = spreadEventWithBlockNumber(event) as FillWithBlock & {
340
+ depositor: string;
341
+ recipient: string;
342
+ inputToken: string;
343
+ outputToken: string;
344
+ exclusiveRelayer: string;
345
+ relayer: string;
346
+ relayExecutionInfo: RelayExecutionEventInfo & { updatedRecipient: string };
347
+ };
318
348
  const fill = {
319
- ...spreadEventWithBlockNumber(event),
349
+ ...fillEvent,
350
+ inputToken: toAddressType(fillEvent.inputToken, relayData.originChainId),
351
+ outputToken: toAddressType(fillEvent.outputToken, destinationChainId),
352
+ depositor: toAddressType(fillEvent.depositor, relayData.originChainId),
353
+ recipient: toAddressType(fillEvent.recipient, destinationChainId),
354
+ exclusiveRelayer: toAddressType(fillEvent.exclusiveRelayer, destinationChainId),
355
+ relayer: toAddressType(fillEvent.relayer, destinationChainId),
356
+ relayExecutionInfo: {
357
+ ...fillEvent.relayExecutionInfo,
358
+ updatedRecipient: toAddressType(fillEvent.relayExecutionInfo.updatedRecipient, destinationChainId),
359
+ },
320
360
  destinationChainId,
321
361
  messageHash: getMessageHash(event.args.message),
322
362
  } as FillWithBlock;
@@ -10,7 +10,6 @@ import {
10
10
  } from "@solana-program/token";
11
11
  import {
12
12
  Address,
13
- address,
14
13
  appendTransactionMessageInstruction,
15
14
  fetchEncodedAccount,
16
15
  fetchEncodedAccounts,
@@ -25,18 +24,35 @@ import {
25
24
  import assert from "assert";
26
25
  import { arrayify, hexZeroPad, hexlify } from "ethers/lib/utils";
27
26
  import { Logger } from "winston";
28
-
29
27
  import { SYSTEM_PROGRAM_ADDRESS } from "@solana-program/system";
30
- import { Deposit, DepositWithBlock, FillStatus, FillWithBlock, RelayData } from "../../interfaces";
31
- import { BigNumber, SvmAddress, chainIsSvm, chunk, isUnsafeDepositId, keccak256, toAddressType } from "../../utils";
28
+ import {
29
+ Deposit,
30
+ DepositWithBlock,
31
+ FillStatus,
32
+ FillWithBlock,
33
+ RelayData,
34
+ RelayExecutionEventInfo,
35
+ } from "../../interfaces";
36
+ import {
37
+ BigNumber,
38
+ EvmAddress,
39
+ SvmAddress,
40
+ chainIsSvm,
41
+ chunk,
42
+ isUnsafeDepositId,
43
+ keccak256,
44
+ toAddressType,
45
+ } from "../../utils";
32
46
  import {
33
47
  SvmCpiEventsClient,
34
48
  createDefaultTransaction,
35
49
  getEventAuthority,
36
50
  getFillStatusPda,
37
51
  getStatePda,
52
+ toAddress,
38
53
  unwrapEventData,
39
54
  } from "./";
55
+ import { CHAIN_IDs } from "../../constants";
40
56
  import { SVMEventNames, SVMProvider } from "./types";
41
57
 
42
58
  /**
@@ -136,13 +152,20 @@ export async function findDeposit(
136
152
  return undefined;
137
153
  }
138
154
 
155
+ const unwrappedDepositEvent = unwrapEventData(depositEvent.data) as Record<string, unknown>;
156
+ const destinationChainId = unwrappedDepositEvent.destinationChainId as number;
139
157
  // Return the deposit event with block info
140
158
  return {
141
159
  txnRef: depositEvent.signature.toString(),
142
160
  blockNumber: Number(depositEvent.slot),
143
161
  txnIndex: 0,
144
162
  logIndex: 0,
145
- ...(unwrapEventData(depositEvent.data) as Record<string, unknown>),
163
+ ...unwrappedDepositEvent,
164
+ depositor: toAddressType(unwrappedDepositEvent.depositor as string, CHAIN_IDs.SOLANA),
165
+ recipient: toAddressType(unwrappedDepositEvent.recipient as string, destinationChainId),
166
+ inputToken: toAddressType(unwrappedDepositEvent.inputToken as string, CHAIN_IDs.SOLANA),
167
+ outputToken: toAddressType(unwrappedDepositEvent.outputToken as string, destinationChainId),
168
+ exclusiveRelayer: toAddressType(unwrappedDepositEvent.exclusiveRelayer as string, destinationChainId),
146
169
  } as DepositWithBlock;
147
170
  }
148
171
 
@@ -318,14 +341,34 @@ export async function findFillEvent(
318
341
 
319
342
  if (fillEvents.length > 0) {
320
343
  const rawFillEvent = fillEvents[0];
344
+ const eventData = unwrapEventData(rawFillEvent.data) as FillWithBlock & {
345
+ depositor: string;
346
+ recipient: string;
347
+ inputToken: string;
348
+ outputToken: string;
349
+ exclusiveRelayer: string;
350
+ relayer: string;
351
+ relayExecutionInfo: RelayExecutionEventInfo & { updatedRecipient: string };
352
+ };
353
+ const originChainId = eventData.originChainId;
321
354
  const parsedFillEvent = {
355
+ ...eventData,
322
356
  transactionHash: rawFillEvent.signature,
323
357
  blockNumber: Number(rawFillEvent.slot),
324
358
  transactionIndex: 0,
325
359
  logIndex: 0,
326
360
  destinationChainId,
327
- ...(unwrapEventData(rawFillEvent.data) as Record<string, unknown>),
328
- } as unknown as FillWithBlock;
361
+ inputToken: toAddressType(eventData.inputToken, originChainId),
362
+ outputToken: toAddressType(eventData.outputToken, destinationChainId),
363
+ relayer: toAddressType(eventData.relayer, destinationChainId),
364
+ exclusiveRelayer: toAddressType(eventData.exclusiveRelayer, destinationChainId),
365
+ depositor: toAddressType(eventData.depositor, originChainId),
366
+ recipient: toAddressType(eventData.recipient, destinationChainId),
367
+ relayExecutionInfo: {
368
+ ...eventData.relayExecutionInfo,
369
+ updatedRecipient: eventData.relayExecutionInfo.updatedRecipient,
370
+ },
371
+ } as FillWithBlock;
329
372
  return parsedFillEvent;
330
373
  }
331
374
 
@@ -341,35 +384,36 @@ export async function findFillEvent(
341
384
  */
342
385
  export async function fillRelayInstruction(
343
386
  spokePool: SvmAddress,
344
- deposit: Omit<Deposit, "messageHash">,
345
- relayer: TransactionSigner<string>,
387
+ deposit: Omit<Deposit, "messageHash" | "fromLiteChain" | "toLiteChain"> & {
388
+ recipient: SvmAddress;
389
+ outputToken: SvmAddress;
390
+ exclusiveRelayer: SvmAddress;
391
+ },
392
+ signer: TransactionSigner<string>,
346
393
  recipientTokenAccount: Address<string>,
394
+ repaymentAddress: EvmAddress | SvmAddress = SvmAddress.from(signer.address),
347
395
  repaymentChainId = deposit.destinationChainId
348
396
  ) {
349
- const programId = spokePool.toBase58();
350
- const relayerAddress = SvmAddress.from(relayer.address);
397
+ const program = toAddress(spokePool);
351
398
 
352
- // @todo we need to convert the deposit's relayData to svm-like since the interface assumes the data originates from an EVM Spoke pool.
353
- // Once we migrate to `Address` types, this can be modified/removed.
354
- const [depositor, recipient, exclusiveRelayer, inputToken, outputToken] = [
355
- deposit.depositor,
356
- deposit.recipient,
357
- deposit.exclusiveRelayer,
358
- deposit.inputToken,
359
- deposit.outputToken,
360
- ].map((addr) => toAddressType(addr).forceSvmAddress());
399
+ assert(
400
+ repaymentAddress.isValidOn(repaymentChainId),
401
+ `Invalid repayment address for chain ${repaymentChainId}: ${repaymentAddress.toNative()}.`
402
+ );
361
403
 
362
404
  const _relayDataHash = getRelayDataHash(deposit, deposit.destinationChainId);
363
405
  const relayDataHash = new Uint8Array(Buffer.from(_relayDataHash.slice(2), "hex"));
364
406
 
407
+ const relayer = SvmAddress.from(signer.address);
365
408
  // Create ATA for the relayer and recipient token accounts
366
- const relayerTokenAccount = await getAssociatedTokenAddress(relayerAddress, outputToken);
409
+ const relayerTokenAccount = await getAssociatedTokenAddress(relayer, deposit.outputToken);
367
410
 
368
411
  const [statePda, fillStatusPda, eventAuthority] = await Promise.all([
369
- getStatePda(spokePool.toV2Address()),
370
- getFillStatusPda(spokePool.toV2Address(), deposit, deposit.destinationChainId),
371
- getEventAuthority(),
412
+ getStatePda(program),
413
+ getFillStatusPda(program, deposit, deposit.destinationChainId),
414
+ getEventAuthority(program),
372
415
  ]);
416
+
373
417
  const depositIdBuffer = new Uint8Array(32);
374
418
  const shortenedBuffer = new Uint8Array(Buffer.from(deposit.depositId.toHexString().slice(2), "hex"));
375
419
  depositIdBuffer.set(shortenedBuffer, 32 - shortenedBuffer.length);
@@ -377,27 +421,36 @@ export async function fillRelayInstruction(
377
421
  const delegatePda = await getFillRelayDelegatePda(
378
422
  relayDataHash,
379
423
  BigInt(repaymentChainId),
380
- relayerAddress.toV2Address(),
381
- spokePool.toV2Address()
424
+ toAddress(relayer),
425
+ program
382
426
  );
383
427
 
428
+ // @todo we need to convert the deposit's relayData to svm-like since the interface assumes the data originates
429
+ // from an EVM Spoke pool. Once we migrate to `Address` types, this can be modified/removed.
430
+ const [depositor, inputToken] = [deposit.depositor, deposit.inputToken].map(toAddress);
431
+ const [recipient, outputToken, exclusiveRelayer] = [
432
+ deposit.recipient,
433
+ deposit.outputToken,
434
+ deposit.exclusiveRelayer,
435
+ ].map(toAddress);
436
+
384
437
  return SvmSpokeClient.getFillRelayInstruction({
385
- signer: relayer,
438
+ signer,
386
439
  state: statePda,
387
- delegate: SvmAddress.from(delegatePda.toString()).toV2Address(),
388
- mint: outputToken.toV2Address(),
440
+ delegate: toAddress(SvmAddress.from(delegatePda.toString())),
441
+ mint: outputToken,
389
442
  relayerTokenAccount: relayerTokenAccount,
390
443
  recipientTokenAccount: recipientTokenAccount,
391
444
  fillStatus: fillStatusPda,
392
445
  eventAuthority,
393
- program: address(programId),
446
+ program,
394
447
  relayHash: relayDataHash,
395
448
  relayData: some({
396
- depositor: depositor.toV2Address(),
397
- recipient: recipient.toV2Address(),
398
- exclusiveRelayer: exclusiveRelayer.toV2Address(),
399
- inputToken: inputToken.toV2Address(),
400
- outputToken: outputToken.toV2Address(),
449
+ depositor,
450
+ recipient,
451
+ exclusiveRelayer,
452
+ inputToken,
453
+ outputToken,
401
454
  inputAmount: deposit.inputAmount.toBigInt(),
402
455
  outputAmount: deposit.outputAmount.toBigInt(),
403
456
  originChainId: BigInt(deposit.originChainId),
@@ -407,7 +460,7 @@ export async function fillRelayInstruction(
407
460
  message: new Uint8Array(Buffer.from(deposit.message.slice(2), "hex")),
408
461
  }),
409
462
  repaymentChainId: some(BigInt(repaymentChainId)),
410
- repaymentAddress: some(relayerAddress.toV2Address()),
463
+ repaymentAddress: toAddress(repaymentAddress),
411
464
  });
412
465
  }
413
466
 
@@ -422,7 +475,7 @@ export function createTokenAccountsInstruction(
422
475
  ): SvmSpokeClient.CreateTokenAccountsInstruction {
423
476
  return SvmSpokeClient.getCreateTokenAccountsInstruction({
424
477
  signer: relayer,
425
- mint: mint.toV2Address(),
478
+ mint: toAddress(mint),
426
479
  });
427
480
  }
428
481
 
@@ -467,7 +520,7 @@ export const createFillInstruction = async (
467
520
  tokenProgram: fillInput.tokenProgram,
468
521
  });
469
522
 
470
- const createFillIx = await SvmSpokeClient.getFillRelayInstruction(fillInput);
523
+ const createFillIx = SvmSpokeClient.getFillRelayInstruction(fillInput);
471
524
 
472
525
  return pipe(
473
526
  await createDefaultTransaction(solanaClient, signer),
@@ -517,7 +570,7 @@ export const createDepositInstruction = async (
517
570
  programAddress: mintInfo.programAddress,
518
571
  }
519
572
  );
520
- const depositIx = await SvmSpokeClient.getDepositInstruction(depositInput);
573
+ const depositIx = SvmSpokeClient.getDepositInstruction(depositInput);
521
574
  return pipe(
522
575
  await createDefaultTransaction(solanaClient, signer),
523
576
  (tx) =>
@@ -539,7 +592,7 @@ export const createRequestSlowFillInstruction = async (
539
592
  solanaClient: SVMProvider,
540
593
  depositInput: SvmSpokeClient.RequestSlowFillInput
541
594
  ) => {
542
- const requestSlowFillIx = await SvmSpokeClient.getRequestSlowFillInstruction(depositInput);
595
+ const requestSlowFillIx = SvmSpokeClient.getRequestSlowFillInstruction(depositInput);
543
596
 
544
597
  return pipe(await createDefaultTransaction(solanaClient, signer), (tx) =>
545
598
  appendTransactionMessageInstruction(requestSlowFillIx, tx)
@@ -558,7 +611,7 @@ export const createCloseFillPdaInstruction = async (
558
611
  solanaClient: SVMProvider,
559
612
  fillStatusPda: Address
560
613
  ) => {
561
- const closeFillPdaIx = await SvmSpokeClient.getCloseFillPdaInstruction({
614
+ const closeFillPdaIx = SvmSpokeClient.getCloseFillPdaInstruction({
562
615
  signer,
563
616
  state: await getStatePda(SvmSpokeClient.SVM_SPOKE_PROGRAM_ADDRESS),
564
617
  fillStatus: fillStatusPda,
@@ -572,13 +625,10 @@ export async function getAssociatedTokenAddress(
572
625
  mint: SvmAddress,
573
626
  tokenProgramId: Address<string> = TOKEN_PROGRAM_ADDRESS
574
627
  ): Promise<Address<string>> {
628
+ const encoder = getAddressEncoder();
575
629
  const [associatedToken] = await getProgramDerivedAddress({
576
630
  programAddress: ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
577
- seeds: [
578
- new Uint8Array(owner.toBuffer()),
579
- new Uint8Array(SvmAddress.from(tokenProgramId).toBuffer()),
580
- new Uint8Array(mint.toBuffer()),
581
- ],
631
+ seeds: [encoder.encode(toAddress(owner)), encoder.encode(tokenProgramId), encoder.encode(toAddress(mint))],
582
632
  });
583
633
  return associatedToken;
584
634
  }
@@ -589,13 +639,14 @@ export function getRelayDataHash(relayData: RelayData, destinationChainId: numbe
589
639
  const uint32Encoder = getU32Encoder();
590
640
 
591
641
  assert(relayData.message.startsWith("0x"), "Message must be a hex string");
642
+ const encodeAddress = (data: SvmAddress) => Uint8Array.from(addressEncoder.encode(toAddress(data)));
592
643
 
593
644
  const contentToHash = Buffer.concat([
594
- Uint8Array.from(addressEncoder.encode(SvmAddress.from(relayData.depositor, "base16").toV2Address())),
595
- Uint8Array.from(addressEncoder.encode(SvmAddress.from(relayData.recipient, "base16").toV2Address())),
596
- Uint8Array.from(addressEncoder.encode(SvmAddress.from(relayData.exclusiveRelayer, "base16").toV2Address())),
597
- Uint8Array.from(addressEncoder.encode(SvmAddress.from(relayData.inputToken, "base16").toV2Address())),
598
- Uint8Array.from(addressEncoder.encode(SvmAddress.from(relayData.outputToken, "base16").toV2Address())),
645
+ encodeAddress(relayData.depositor),
646
+ encodeAddress(relayData.recipient),
647
+ encodeAddress(relayData.exclusiveRelayer),
648
+ encodeAddress(relayData.inputToken),
649
+ encodeAddress(relayData.outputToken),
599
650
  Uint8Array.from(uint64Encoder.encode(BigInt(relayData.inputAmount.toString()))),
600
651
  Uint8Array.from(uint64Encoder.encode(BigInt(relayData.outputAmount.toString()))),
601
652
  Uint8Array.from(uint64Encoder.encode(BigInt(relayData.originChainId.toString()))),