@wormhole-foundation/wormhole-connect 4.0.0-beta.0-development → 4.0.0-beta.1-development

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 (205) hide show
  1. package/dist/assets/{aptos-CIKjhZ5R.js → aptos-CaGPw7HM.js} +2 -2
  2. package/dist/assets/create-54a95t1x.js +1 -0
  3. package/dist/assets/{evm-Ky_mCHhS.js → evm-Bv0RsFka.js} +2 -2
  4. package/dist/assets/{index-DW7sWcdW.js → index-B5JfIVKE.js} +1 -1
  5. package/dist/assets/{index-DHLr3HmO.js → index-BCD-VOiF.js} +1 -1
  6. package/dist/assets/index-BwhO0jGm.js +1 -0
  7. package/dist/assets/{index-DpM61P6H.js → index-CMULoTsT.js} +1 -1
  8. package/dist/assets/{index-DZpeOp3V.js → index-CO4HXUmy.js} +1 -1
  9. package/dist/assets/{index-Bg3NWSHL.js → index-COw2RtBx.js} +1 -1
  10. package/dist/assets/{index-DRk-Cj0P.js → index-ClrVAZUa.js} +1 -1
  11. package/dist/assets/{index-D7RgFG0F.js → index-CzQeh-hT.js} +1 -1
  12. package/dist/assets/{index-Csghphw2.js → index-DC4mZtDw.js} +1 -1
  13. package/dist/assets/{index-Cqs_fFht.js → index-DI-xN_q3.js} +1 -1
  14. package/dist/assets/{index-DVbfoP0w.js → index-DRsHBjoG.js} +1 -1
  15. package/dist/assets/{index-CdAFGcxx.js → index-DXcQbQ8r.js} +1 -1
  16. package/dist/assets/{index-DJ52h-dV.js → index-DxHhcWFS.js} +1 -1
  17. package/dist/assets/{index-g9iLhWvp.js → index-GKTf0CV7.js} +1 -1
  18. package/dist/assets/{index-DuR9wYhp.js → index-aoYIFErC.js} +1 -1
  19. package/dist/assets/{index-DfNgilHG.js → index-jixjwN_L.js} +1 -1
  20. package/dist/assets/{solana-jYIeIu4B.js → solana-DpD0VkQS.js} +2 -2
  21. package/dist/assets/{sui-B96bqBVv.js → sui-7K04yY2U.js} +2 -2
  22. package/dist/main.js +75 -75
  23. package/dist/src/components/TokenBalance.d.ts.map +1 -1
  24. package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
  25. package/dist/src/config/testnet/tokens.d.ts.map +1 -1
  26. package/dist/src/contexts/wallet/WalletProvider.d.ts.map +1 -1
  27. package/dist/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
  28. package/dist/src/hooks/useTokenListWithSearch.d.ts +1 -4
  29. package/dist/src/hooks/useTokenListWithSearch.d.ts.map +1 -1
  30. package/dist/src/routes/operator.d.ts.map +1 -1
  31. package/dist/src/routes/sdkv2/route.d.ts +2 -2
  32. package/dist/src/routes/sdkv2/route.d.ts.map +1 -1
  33. package/dist/src/telemetry/types.d.ts +1 -0
  34. package/dist/src/telemetry/types.d.ts.map +1 -1
  35. package/dist/src/utils/sdkv2.d.ts.map +1 -1
  36. package/dist/src/utils/wrappedNativeTokens.d.ts +12 -0
  37. package/dist/src/utils/wrappedNativeTokens.d.ts.map +1 -0
  38. package/dist/src/views/Terms.d.ts.map +1 -1
  39. package/dist/src/views/v2/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
  40. package/dist/src/views/v3/Bridge/AssetPicker/SearchableList/index.d.ts.map +1 -1
  41. package/dist/src/views/v3/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
  42. package/dist/src/views/v3/Bridge/AssetPicker/TokenSectionHeader.d.ts +2 -4
  43. package/dist/src/views/v3/Bridge/AssetPicker/TokenSectionHeader.d.ts.map +1 -1
  44. package/lib/{account-D0Q4K1CI.js → account-24z6tDMM.js} +1 -1
  45. package/lib/{account-BdDruAAr.mjs → account-BcnWVXmg.mjs} +1 -1
  46. package/lib/{address-fSXS9iww.mjs → address-BX2fIOro.mjs} +1 -1
  47. package/lib/{address-BO6rj6uK.js → address-Bc-5yO4D.js} +1 -1
  48. package/lib/{aptos-B1VSCmD9.mjs → aptos-5b4F4UXd.mjs} +4 -4
  49. package/lib/{aptos-DG7QN21P.js → aptos-B_Yz-0gh.js} +1 -1
  50. package/lib/{aptos-BnKScTtI.mjs → aptos-DO_Sexq-.mjs} +7 -7
  51. package/lib/{aptos-B3C7cnvM.js → aptos-DffuIzI0.js} +2 -2
  52. package/lib/{basic-BRYkcAmD.mjs → basic-BclwqsOq.mjs} +4 -4
  53. package/lib/{basic-CN2jAqvS.js → basic-BdiYk8Hf.js} +1 -1
  54. package/lib/{basic-DufHOLGA.js → basic-CuO6iz8a.js} +1 -1
  55. package/lib/{basic-Cw13RoYq.mjs → basic-HasHL_DG.mjs} +4 -4
  56. package/lib/{blake2b-CT6EW399.mjs → blake2b-CVpPk5O9.mjs} +1 -1
  57. package/lib/{blake2b-B_Q_lTGN.js → blake2b-DXExLbRg.js} +1 -1
  58. package/lib/{browser-ponyfill-CnfcLhK-.mjs → browser-ponyfill-DeOApqpH.mjs} +1 -1
  59. package/lib/{browser-ponyfill-DbGoEOBo.js → browser-ponyfill-VhIu9z_I.js} +1 -1
  60. package/lib/{chain-BCKkYvDb.js → chain-BxNUWKZE.js} +1 -1
  61. package/lib/{chain-_dXKRkCE.mjs → chain-CvZsIsLh.mjs} +1 -1
  62. package/lib/{chunk-KJH4KKG6-RA0hChr8.mjs → chunk-KJH4KKG6-BgebMATq.mjs} +2 -2
  63. package/lib/{chunk-KJH4KKG6-BXBLZwfY.js → chunk-KJH4KKG6-DNlN4p21.js} +1 -1
  64. package/lib/{constants-QsbOfMbk.mjs → constants-DnbaS3cF.mjs} +3 -3
  65. package/lib/constants-abC7FLXq.js +1 -0
  66. package/lib/{contract-MkLF5rqi.js → contract-CTycrpaK.js} +1 -1
  67. package/lib/{contract-C_4H8x77.mjs → contract-KYuIk_vR.mjs} +1 -1
  68. package/lib/{core-Cpb3gtg_.js → core-COM78LTW.js} +3 -3
  69. package/lib/{core-ntLR7o2S.mjs → core-DT_3gIqi.mjs} +6 -6
  70. package/lib/{create-naslyPfU.mjs → create-BvzkkBPW.mjs} +1 -1
  71. package/lib/{create-CfgTxAS-.js → create-CGZYy2vu.js} +1 -1
  72. package/lib/{evm-C6xp3v8Z.mjs → evm-CUR4-a7F.mjs} +9 -9
  73. package/lib/{evm-B3G2Vkzg.js → evm-CoLwXequ.js} +2 -2
  74. package/lib/{evm-B20n3mf_.mjs → evm-DoVrPE_X.mjs} +7 -7
  75. package/lib/{evm-aSG_vFbw.js → evm-Dv-WYu07.js} +2 -2
  76. package/lib/executor.js +1 -1
  77. package/lib/executor.mjs +815 -572
  78. package/lib/hosted.js +1 -1
  79. package/lib/hosted.mjs +1 -1
  80. package/lib/{index-DSmKiYkD.mjs → index-B1KwS33G.mjs} +5 -5
  81. package/lib/{index-vhQ5Q8ov.mjs → index-B2sVzSwb.mjs} +52 -97
  82. package/lib/{index-Bz7ogqhR.mjs → index-B3idKQJG.mjs} +1 -1
  83. package/lib/index-B7Afz_5P.js +1 -0
  84. package/lib/{index-Dq7WWqFe.js → index-B7HBnPLP.js} +1 -1
  85. package/lib/{index-DQX74QAE.js → index-BFBwRlid.js} +1 -1
  86. package/lib/{index-C6XNAQ4w.js → index-BZZZ8OeS.js} +1 -1
  87. package/lib/{index-C3LC73WN.js → index-BaYN-RHF.js} +1 -1
  88. package/lib/{index-BTUx12aa.js → index-Bhwzpq1T.js} +1 -1
  89. package/lib/{index-MsaML_Ju.mjs → index-Bicx897u.mjs} +2 -2
  90. package/lib/{index-Dajw3Alx.mjs → index-BlWksu-f.mjs} +1 -1
  91. package/lib/{index-DS8bl8fA.mjs → index-Bn0hkKKz.mjs} +4 -4
  92. package/lib/{index-BojkMsXD.js → index-BoKTcLq-.js} +1 -1
  93. package/lib/{index-BRYq_Nt2.mjs → index-Bp4ojxz6.mjs} +4 -4
  94. package/lib/{index-Cnznwcdb.js → index-BqabgGIh.js} +1 -1
  95. package/lib/{index-DxYgNWMY.mjs → index-BtEjOWoP.mjs} +3 -3
  96. package/lib/{index-BJcbyvof.js → index-C8HxYDNY.js} +1 -1
  97. package/lib/{index-Bhd_YhUf.js → index-C9Bk-rKp.js} +1 -1
  98. package/lib/{index-YAL4zolc.js → index-C9uGqcwH.js} +1 -1
  99. package/lib/{index-BQvEIlB2.mjs → index-CBGUPQXa.mjs} +3 -3
  100. package/lib/{index-IHxtA-NL.js → index-CGpn3INM.js} +1 -1
  101. package/lib/{index-BRyW-hBN.mjs → index-CTpINVAG.mjs} +2 -2
  102. package/lib/{index-bNUantLb.js → index-CjjP3Qp5.js} +1 -1
  103. package/lib/{index-CU73EUQW.js → index-CkGYgQTz.js} +1 -1
  104. package/lib/{index-DqzqJgVc.mjs → index-CkvxfaqA.mjs} +3 -3
  105. package/lib/{index-DfDB5FLw.js → index-ClMpLrxa.js} +1 -1
  106. package/lib/{index-B7VNYedX.mjs → index-CtU_hkYp.mjs} +4 -4
  107. package/lib/{index-DMOY218i.js → index-CzRVzbTC.js} +1 -1
  108. package/lib/{index-B4S4sz6p.mjs → index-Czxl_5Tr.mjs} +5 -5
  109. package/lib/{index-D0XQIiQn.js → index-D6qJDbzm.js} +1 -1
  110. package/lib/{index-D-H8WyKb.mjs → index-DGzoIr_I.mjs} +1 -1
  111. package/lib/{index-BD0gcmCp.mjs → index-DPpi4Don.mjs} +5 -5
  112. package/lib/{index-7_BfcP8x.mjs → index-DZaOh3F9.mjs} +2105 -2021
  113. package/lib/{index-QlIJYJce.js → index-DaY7_eQ6.js} +66 -66
  114. package/lib/{index-C3L-xKvN.mjs → index-DlmQ0_RF.mjs} +4839 -4850
  115. package/lib/{index-D5ENAOm3.js → index-DmsirrTI.js} +1 -1
  116. package/lib/{index-DnO0ZdKy.mjs → index-DpN0dULN.mjs} +1 -1
  117. package/lib/{index-BNuKzxGJ.js → index-DydXCN0v.js} +1 -1
  118. package/lib/{index-CSMunRpZ.mjs → index-NKV6j8zE.mjs} +3 -3
  119. package/lib/{index-BIYx5IBr.mjs → index-OlMuNft9.mjs} +3 -3
  120. package/lib/{index-tztRp3yJ.js → index-P9DbJOzh.js} +1 -1
  121. package/lib/{index-D1y-l93C.js → index-UbeUI3Ir.js} +1 -1
  122. package/lib/{index-BZYEbYGY.mjs → index-ZGgSxaDf.mjs} +3 -3
  123. package/lib/{index-DFpSbD7R.mjs → index-_e8uUnEK.mjs} +5 -5
  124. package/lib/{index-Cb9lswnP.js → index-cCBQV2Yv.js} +8 -8
  125. package/lib/{index-B9ybSY9R.mjs → index-cggXdVJu.mjs} +5 -5
  126. package/lib/{index.es-C476iHvN.mjs → index.es-5ecqX8B9.mjs} +4 -4
  127. package/lib/{index.es-CU6nhwJO.js → index.es-LBG64XJ6.js} +1 -1
  128. package/lib/{index.es-CkGpObng.js → index.es-owVcNlof.js} +3 -3
  129. package/lib/{index.es-CtiAoQ78.mjs → index.es-zNH_KzcH.mjs} +3 -3
  130. package/lib/index.js +1 -1
  131. package/lib/index.mjs +5 -5
  132. package/lib/mayan.js +1 -1
  133. package/lib/mayan.mjs +11 -11
  134. package/lib/{mint-zy6P38iu.js → mint-B4t2SvV6.js} +1 -1
  135. package/lib/{mint-DyoU9X22.mjs → mint-BGuU5y5m.mjs} +1 -1
  136. package/lib/ntt.js +1 -1
  137. package/lib/ntt.mjs +14 -12
  138. package/lib/{platform-x3ZBJ0YM.js → platform-Bkbg7A9d.js} +1 -1
  139. package/lib/{platform-BqpAMtgx.mjs → platform-C5gJAqtZ.mjs} +3 -3
  140. package/lib/{platform-BhspUaMJ.js → platform-C6QB7aIN.js} +1 -1
  141. package/lib/{platform-DQfpyXSV.mjs → platform-DBNvSsue.mjs} +4 -4
  142. package/lib/{platform-BHAZvZ_O.mjs → platform-DtB8gGMl.mjs} +4 -4
  143. package/lib/{platform-4nANkJAM.js → platform-qdbxkhTI.js} +1 -1
  144. package/lib/{provider-jsonrpc-DIXcAw4Q.mjs → provider-jsonrpc-BIIDy-Aw.mjs} +2 -2
  145. package/lib/{provider-jsonrpc-BCKoIijx.js → provider-jsonrpc-DHzam3ud.js} +1 -1
  146. package/lib/{secp256k1-CaaRyr2C.mjs → secp256k1-BF6Vm50D.mjs} +1 -1
  147. package/lib/{secp256k1-C60XBS-e.js → secp256k1-Bb6lbAjK.js} +1 -1
  148. package/lib/{secp256k1-UnRv5Suy.mjs → secp256k1-BfK5OWRP.mjs} +1 -1
  149. package/lib/{secp256k1-BWFGSbjt.mjs → secp256k1-CqT-a-I8.mjs} +1 -1
  150. package/lib/{secp256k1-CFt7TfEF.js → secp256k1-DRTQ6WrU.js} +1 -1
  151. package/lib/{secp256k1-BIiWvuxu.js → secp256k1-D_GNj8sK.js} +1 -1
  152. package/lib/{signer-DhO2iGae.mjs → signer-BH3gAHuj.mjs} +2 -2
  153. package/lib/{signer-BFY1Ytf6.js → signer-MBixef_P.js} +1 -1
  154. package/lib/{solana-CQk4ocg8.mjs → solana-C1puc64V.mjs} +11 -11
  155. package/lib/solana-C8xK8qJY.mjs +18 -0
  156. package/lib/solana-CRSliekb.js +1 -0
  157. package/lib/{solana-Cp49k9--.js → solana-CtBdJ6Wt.js} +4 -4
  158. package/lib/{solanaEmbed.esm-Cwa6cl_R.js → solanaEmbed.esm-BpIKVhXq.js} +1 -1
  159. package/lib/{solanaEmbed.esm-DBOqO9Ii.mjs → solanaEmbed.esm-NdE_DQuw.mjs} +3 -3
  160. package/lib/src/components/TokenBalance.d.ts.map +1 -1
  161. package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
  162. package/lib/src/config/testnet/tokens.d.ts.map +1 -1
  163. package/lib/src/contexts/wallet/WalletProvider.d.ts.map +1 -1
  164. package/lib/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
  165. package/lib/src/hooks/useTokenListWithSearch.d.ts +1 -4
  166. package/lib/src/hooks/useTokenListWithSearch.d.ts.map +1 -1
  167. package/lib/src/routes/operator.d.ts.map +1 -1
  168. package/lib/src/routes/sdkv2/route.d.ts +2 -2
  169. package/lib/src/routes/sdkv2/route.d.ts.map +1 -1
  170. package/lib/src/telemetry/types.d.ts +1 -0
  171. package/lib/src/telemetry/types.d.ts.map +1 -1
  172. package/lib/src/utils/sdkv2.d.ts.map +1 -1
  173. package/lib/src/utils/wrappedNativeTokens.d.ts +12 -0
  174. package/lib/src/utils/wrappedNativeTokens.d.ts.map +1 -0
  175. package/lib/src/views/Terms.d.ts.map +1 -1
  176. package/lib/src/views/v2/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
  177. package/lib/src/views/v3/Bridge/AssetPicker/SearchableList/index.d.ts.map +1 -1
  178. package/lib/src/views/v3/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
  179. package/lib/src/views/v3/Bridge/AssetPicker/TokenSectionHeader.d.ts +2 -4
  180. package/lib/src/views/v3/Bridge/AssetPicker/TokenSectionHeader.d.ts.map +1 -1
  181. package/lib/{sui-C2a1eehP.mjs → sui-BW7tMLZs.mjs} +4 -4
  182. package/lib/{sui-9gsoM56W.js → sui-DdujB9Bc.js} +1 -1
  183. package/lib/{sui-Cr98JBgS.js → sui-QcDjGW68.js} +1 -1
  184. package/lib/{sui-B4RvzEXx.mjs → sui-euceXgYf.mjs} +7 -7
  185. package/lib/{tokens-BbFKf6Hv.mjs → tokens-DI-tPIbd.mjs} +3 -3
  186. package/lib/{tokens-LVHsSbYG.js → tokens-DJos2DwM.js} +1 -1
  187. package/lib/{transfer-DZ-wNocj.js → transfer-BinEH6ml.js} +1 -1
  188. package/lib/{transfer-BV1ou1GP.mjs → transfer-DTvv5m_5.mjs} +2 -2
  189. package/lib/{units-BqUlbZ46.mjs → units-CVEv4txp.mjs} +2 -2
  190. package/lib/{units-D-oRQjOa.js → units-DtldPRXy.js} +1 -1
  191. package/lib/{unsignedTransaction-BmxD6VsY.mjs → unsignedTransaction-CVE7GUdC.mjs} +3 -3
  192. package/lib/{unsignedTransaction-CiPKh85X.js → unsignedTransaction-DL3WyIkF.js} +1 -1
  193. package/lib/{w3m-modal-3qLkbPfi.mjs → w3m-modal-B2VF8j7W.mjs} +2 -2
  194. package/lib/{w3m-modal-D4-nrnEK.mjs → w3m-modal-C32eQxEe.mjs} +2 -2
  195. package/lib/{w3m-modal-CoTG8Zu4.js → w3m-modal-DSY2qJYP.js} +1 -1
  196. package/lib/{w3m-modal-xqVExHU-.js → w3m-modal-DgqSQLqZ.js} +1 -1
  197. package/lib/{web3-C1wK6wIV.js → web3-BKaP497Y.js} +1 -1
  198. package/lib/{web3-BkEb7AgB.mjs → web3-BifDBsFp.mjs} +8 -4
  199. package/package.json +49 -44
  200. package/dist/assets/create-q7V6muDT.js +0 -1
  201. package/dist/assets/index-B59bCuJJ.js +0 -1
  202. package/lib/constants-BR_zyzqY.js +0 -1
  203. package/lib/index-CXsUtRJQ.js +0 -1
  204. package/lib/solana-Dv_mUYcl.mjs +0 -18
  205. package/lib/solana-g3YsP966.js +0 -1
package/lib/executor.mjs CHANGED
@@ -1,46 +1,46 @@
1
- import { aZ as ct, av as dt, a_ as ut, a$ as mt, b0 as ft, b1 as lt, b2 as ht, b3 as gt, b4 as Ct, b5 as pt, b6 as wt, b7 as bt, at as Re, d as b, b8 as G, az as E, aH as M, m as Ue, aB as J, aE as S, aF as Ve, ax as ze, aL as Q, q as I, aI as $e, aR as Et, _ as At, P as g, L as B, ar as De, aq as _e, as as xt, ac as $, S as yt, N as Ne, aO as Y, aP as Dt, K as vt, b9 as Ft, aQ as Bt, j as Tt, W as v, V as D, ba as Oe, u as re, b as Le, bb as Ge, af as St, aW as Qe, e as w, Z as We, aU as je, f as A, n as ie, v as _, z as P, a7 as ee, a8 as te, x as V, R as qe } from "./web3-BkEb7AgB.mjs";
2
- import { l as ve } from "./chunk-KJH4KKG6-RA0hChr8.mjs";
3
- import { A as Pt } from "./platform-DQfpyXSV.mjs";
4
- import { c as Fe, _ as It } from "./address-fSXS9iww.mjs";
5
- import { A as Mt } from "./unsignedTransaction-BJi-f5xi.mjs";
6
- import { E as N } from "./platform-BHAZvZ_O.mjs";
7
- import { C as z } from "./contract-C_4H8x77.mjs";
8
- import { E as Ke } from "./unsignedTransaction-Efb4L-cb.mjs";
9
- import { b as Be, T as kt, a as Rt, _ as Ut } from "./platform-BqpAMtgx.mjs";
10
- import { suiCircleObjects as Vt } from "./index-MsaML_Ju.mjs";
11
- import { S as zt } from "./unsignedTransaction-YrtWU1ft.mjs";
12
- import { createDepositForBurnInstruction as $t } from "./index-DqzqJgVc.mjs";
13
- import { P as _t } from "./index-Dajw3Alx.mjs";
14
- import { S as Nt, a as Ot } from "./unsignedTransaction-BmxD6VsY.mjs";
15
- import { d as Lt } from "./account-BdDruAAr.mjs";
16
- import { r as Gt } from "./index-BRyW-hBN.mjs";
17
- const Qt = {
1
+ import { aZ as At, av as xt, a_ as Dt, a$ as St, b0 as vt, b1 as Ft, b2 as Tt, b3 as Bt, b4 as Pt, b5 as It, b6 as Mt, b7 as kt, at as ze, d as y, b8 as X, az as A, aH as k, m as Ne, aB as ne, aE as _, aF as Oe, ax as Le, aL as O, q as z, aI as We, aR as Vt, _ as Ut, P as h, L as P, ar as Pe, aq as Qe, as as Rt, ac as l, S as se, N as ue, aO as I, aP as re, K as Ge, b9 as je, aQ as qe, j as _t, W as F, V as v, ba as Ze, u as me, b as He, bb as Ke, af as $t, aW as Ye, e as x, Z as Je, aU as Xe, f as S, n as fe, v as H, z as $, a7 as ae, a8 as ie, x as q, R as et } from "./web3-BifDBsFp.mjs";
2
+ import { l as Ie } from "./chunk-KJH4KKG6-BgebMATq.mjs";
3
+ import { A as zt } from "./platform-DBNvSsue.mjs";
4
+ import { c as Me, _ as Nt } from "./address-BX2fIOro.mjs";
5
+ import { A as Ot } from "./unsignedTransaction-BJi-f5xi.mjs";
6
+ import { E as K } from "./platform-DtB8gGMl.mjs";
7
+ import { C as Z } from "./contract-KYuIk_vR.mjs";
8
+ import { E as tt } from "./unsignedTransaction-Efb4L-cb.mjs";
9
+ import { b as ke, T as Lt, a as Wt, _ as Qt } from "./platform-C5gJAqtZ.mjs";
10
+ import { suiCircleObjects as Gt } from "./index-Bicx897u.mjs";
11
+ import { S as jt } from "./unsignedTransaction-YrtWU1ft.mjs";
12
+ import { createDepositForBurnInstruction as qt, createReceiveMessageInstruction as Zt } from "./index-CkvxfaqA.mjs";
13
+ import { P as nt } from "./index-BlWksu-f.mjs";
14
+ import { S as st, a as rt } from "./unsignedTransaction-CVE7GUdC.mjs";
15
+ import { d as Ht } from "./account-BcnWVXmg.mjs";
16
+ import { r as Kt } from "./index-CTpINVAG.mjs";
17
+ const Yt = {
18
18
  binary: "uint",
19
19
  size: 1,
20
20
  custom: {
21
- to: (n) => n > 0,
22
- from: (n) => n ? 1 : 0
21
+ to: (s) => s > 0,
22
+ from: (s) => s ? 1 : 0
23
23
  }
24
- }, Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
24
+ }, Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
25
25
  __proto__: null,
26
- amountItem: ct,
27
- boolItem: Qt,
28
- chainItem: dt,
29
- circleDomainItem: ut,
30
- circleNonceItem: mt,
31
- dateConversion: ft,
32
- fixedChainItem: lt,
33
- fixedLengthStringItem: ht,
34
- guardianSetItem: gt,
35
- payloadIdItem: Ct,
36
- sequenceItem: pt,
37
- signatureItem: wt,
38
- stringConversion: bt,
39
- universalAddressItem: Re
40
- }, Symbol.toStringTag, { value: "Module" })), oe = {
26
+ amountItem: At,
27
+ boolItem: Yt,
28
+ chainItem: xt,
29
+ circleDomainItem: Dt,
30
+ circleNonceItem: St,
31
+ dateConversion: vt,
32
+ fixedChainItem: Ft,
33
+ fixedLengthStringItem: Tt,
34
+ guardianSetItem: Bt,
35
+ payloadIdItem: Pt,
36
+ sequenceItem: It,
37
+ signatureItem: Mt,
38
+ stringConversion: kt,
39
+ universalAddressItem: ze
40
+ }, Symbol.toStringTag, { value: "Module" })), le = {
41
41
  Testnet: "https://executor-testnet.labsapis.com",
42
42
  Mainnet: "https://executor.labsapis.com"
43
- }, ce = {
43
+ }, he = {
44
44
  Testnet: {
45
45
  Aptos: "0x14a12d1fd6ef371b70c2113155534ec152ec7f779e281b54866c796c9a4a58d3",
46
46
  Avalanche: "0x2cfEC91B50f657Cc86Ec693542527ac3e03bF742",
@@ -59,7 +59,7 @@ const Qt = {
59
59
  Unichain: "0xA7aBDb8f2108901c586543BD5e10E4fA263F4A47",
60
60
  Solana: "CXGRA5SCc8jxDbaQPZrmmZNu2JV34DP7gFW4m31uC1zs"
61
61
  }
62
- }, jt = {
62
+ }, Xt = {
63
63
  Testnet: {
64
64
  Avalanche: "0x4058F0C3924eDaB19c15597C438968ed49C1a213",
65
65
  BaseSepolia: "0xC400FcC0e92d3406747FBb6f513D3aa8B038fcE9",
@@ -70,6 +70,7 @@ const Qt = {
70
70
  Avalanche: "0x3952914628650Ca510404872D84DfF10A844C5B5",
71
71
  Base: "0xbd8d42f40a11b37bD1b3770D754f9629F7cd5679",
72
72
  Ethereum: "0x2cCf230467FE7387674BAa657747F0B5485c7fEC",
73
+ HyperEVM: "0xACD054f83c0b852d02503191e2c26527A7E72B1f",
73
74
  Linea: "0xc48c126468BE919068dE1983F00F65af759a4E87",
74
75
  Optimism: "0xd0a8940b2e743e33b682daec4d52b46713606c9d",
75
76
  Polygon: "0xc8a8e6d760dcbd5d6746e2f66cd2ffa722dd1e59",
@@ -78,7 +79,7 @@ const Qt = {
78
79
  Sonic: "0xc39BF082ec91D9bC385F956D24a8D66C0c26223d",
79
80
  Worldchain: "0x789f2b91f7B35D5B890983328340c4600339B354"
80
81
  }
81
- }, Te = {
82
+ }, Ve = {
82
83
  Testnet: {
83
84
  executorId: "0x4000cfe2955d8355b3d3cf186f854fea9f787a457257056926fde1ec977670eb",
84
85
  executorRequestsId: "0x2d9ccf3cce3f7dce408e5455e90b80a8161ad9673d1366c2a5def60ad93657a8"
@@ -87,10 +88,10 @@ const Qt = {
87
88
  executorId: "0xdb0fe8bb1e2b5be628adbea0636063325073e1070ee11e4281457dfd7f158235",
88
89
  executorRequestsId: "0xc030df7a3eed1494fa4b64aa8ab63a79041cf1114f4ff2b7ab5aca1c684a21a7"
89
90
  }
90
- }, qt = {
91
+ }, at = {
91
92
  Testnet: "execXUrAsMnqMmTHj5m7N1YQgsDz3cwGLYCYyuDRciV",
92
93
  Mainnet: "execXUrAsMnqMmTHj5m7N1YQgsDz3cwGLYCYyuDRciV"
93
- }, Kt = 5001n, Zt = {
94
+ }, en = 5001n, tn = {
94
95
  Testnet: {
95
96
  Aptos: 5000n,
96
97
  ArbitrumSepolia: 800000n,
@@ -108,6 +109,7 @@ const Qt = {
108
109
  Avalanche: 250000n,
109
110
  Base: 250000n,
110
111
  Ethereum: 250000n,
112
+ HyperEVM: 250000n,
111
113
  Linea: 250000n,
112
114
  Optimism: 250000n,
113
115
  Polygon: 250000n,
@@ -118,7 +120,7 @@ const Qt = {
118
120
  Sui: 8000000n,
119
121
  Worldchain: 250000n
120
122
  }
121
- }, Ht = {
123
+ }, it = {
122
124
  Testnet: {
123
125
  ArbitrumSepolia: {
124
126
  tokenMessengerV2: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA",
@@ -140,6 +142,10 @@ const Qt = {
140
142
  tokenMessengerV2: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA",
141
143
  messageTransmitterV2: "0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275"
142
144
  },
145
+ Solana: {
146
+ tokenMessengerV2: "CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe",
147
+ messageTransmitterV2: "CCTPV2Sm4AdWt5296sk4P66VBZ7bEhcARwFaaS9YPbeC"
148
+ },
143
149
  Sonic: {
144
150
  tokenMessengerV2: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA",
145
151
  messageTransmitterV2: "0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275"
@@ -162,6 +168,10 @@ const Qt = {
162
168
  tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
163
169
  messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
164
170
  },
171
+ HyperEVM: {
172
+ tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
173
+ messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
174
+ },
165
175
  Linea: {
166
176
  tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
167
177
  messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
@@ -174,6 +184,10 @@ const Qt = {
174
184
  tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
175
185
  messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
176
186
  },
187
+ Solana: {
188
+ tokenMessengerV2: "CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe",
189
+ messageTransmitterV2: "CCTPV2Sm4AdWt5296sk4P66VBZ7bEhcARwFaaS9YPbeC"
190
+ },
177
191
  Unichain: {
178
192
  tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
179
193
  messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
@@ -191,7 +205,7 @@ const Qt = {
191
205
  messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
192
206
  }
193
207
  }
194
- }, Ze = {
208
+ }, ot = {
195
209
  Testnet: {
196
210
  Sepolia: 0,
197
211
  Avalanche: 1,
@@ -216,11 +230,12 @@ const Qt = {
216
230
  Aptos: 9,
217
231
  Unichain: 10
218
232
  }
219
- }, k = (n, e) => Ze[n]?.[e] !== void 0, W = {
233
+ }, Q = (s, e) => ot[s]?.[e] !== void 0, ee = {
220
234
  Testnet: {
221
235
  Sepolia: 0,
222
236
  Avalanche: 1,
223
237
  ArbitrumSepolia: 3,
238
+ Solana: 5,
224
239
  BaseSepolia: 6,
225
240
  Linea: 11,
226
241
  Sonic: 13
@@ -230,33 +245,35 @@ const Qt = {
230
245
  Avalanche: 1,
231
246
  Optimism: 2,
232
247
  Arbitrum: 3,
248
+ Solana: 5,
233
249
  Base: 6,
234
250
  Polygon: 7,
235
251
  Unichain: 10,
236
252
  Linea: 11,
237
253
  Sonic: 13,
238
254
  Worldchain: 14,
239
- Seievm: 16
255
+ Seievm: 16,
256
+ HyperEVM: 19
240
257
  }
241
- }, ne = (n, e) => W[n]?.[e] !== void 0, O = (n, e) => {
242
- const t = W[n]?.[e];
258
+ }, oe = (s, e) => ee[s]?.[e] !== void 0, N = (s, e) => {
259
+ const t = ee[s]?.[e];
243
260
  if (t === void 0)
244
- throw new Error(`CircleV2 domain not found for network ${n} and chain ${e}`);
261
+ throw new Error(`CircleV2 domain not found for network ${s} and chain ${e}`);
245
262
  return t;
246
- }, He = (n, e) => {
247
- const t = Object.entries(W[n] ?? {}).find(([, a]) => a === e)?.[0];
263
+ }, ct = (s, e) => {
264
+ const t = Object.entries(ee[s] ?? {}).find(([, n]) => n === e)?.[0];
248
265
  if (t === void 0)
249
- throw new Error(`CircleV2 chain not found for network ${n} and domain ${e}`);
266
+ throw new Error(`CircleV2 chain not found for network ${s} and domain ${e}`);
250
267
  return t;
251
- }, j = {
268
+ }, te = {
252
269
  Testnet: "https://iris-api-sandbox.circle.com/v2",
253
270
  Mainnet: "https://iris-api.circle.com/v2"
254
271
  };
255
- var L;
256
- (function(n) {
257
- n[n.CONFIRMED = 1e3] = "CONFIRMED", n[n.FINALIZED = 2e3] = "FINALIZED";
258
- })(L || (L = {}));
259
- const Xe = {
272
+ var Y;
273
+ (function(s) {
274
+ s[s.CONFIRMED = 1e3] = "CONFIRMED", s[s.FINALIZED = 2e3] = "FINALIZED";
275
+ })(Y || (Y = {}));
276
+ const dt = {
260
277
  // milliseconds
261
278
  Testnet: {
262
279
  ArbitrumSepolia: 8e3,
@@ -275,46 +292,46 @@ const Xe = {
275
292
  Seievm: 8e3,
276
293
  Worldchain: 8e3
277
294
  }
278
- }, Xt = (n, e) => Xe[n]?.[e] !== void 0;
279
- class de {
295
+ }, nn = (s, e) => dt[s]?.[e] !== void 0;
296
+ class ge {
280
297
  network;
281
298
  chain;
282
299
  provider;
283
300
  contracts;
284
301
  usdcId;
285
302
  shimContract;
286
- constructor(e, t, a, r) {
287
- if (this.network = e, this.chain = t, this.provider = a, this.contracts = r, e === "Devnet")
303
+ constructor(e, t, n, a) {
304
+ if (this.network = e, this.chain = t, this.provider = n, this.contracts = a, e === "Devnet")
288
305
  throw new Error("CCTPExecutor not supported on Devnet");
289
- const s = b.get(this.network, this.chain);
290
- if (!s)
306
+ const r = y.get(this.network, this.chain);
307
+ if (!r)
291
308
  throw new Error(`No USDC contract configured for network=${this.network} chain=${this.chain}`);
292
- this.usdcId = s;
293
- const i = ce[e]?.[t];
309
+ this.usdcId = r;
310
+ const i = he[e]?.[t];
294
311
  if (!i)
295
312
  throw new Error(`Shim contract for ${t} not found`);
296
313
  this.shimContract = i;
297
314
  }
298
315
  static async fromRpc(e, t) {
299
- const [a, r] = await Pt.chainFromRpc(e), s = t[r];
300
- if (!s)
301
- throw new Error(`No config found for ${r}`);
302
- if (s.network !== a)
303
- throw new Error(`Network mismatch: ${s.network} != ${a}`);
304
- return new de(a, r, e, s.contracts);
305
- }
306
- async *transfer(e, t, a) {
307
- const r = new Fe(e).unwrap(), s = ve.from(t.address.toUniversalAddress().toUint8Array()), i = ve.from(this.usdcId), o = a.remainingAmount + a.referrerFee, c = G.get(this.network, t.chain), u = r, f = new Fe(a.referrer?.address?.toString() ?? r).unwrap(), d = [
316
+ const [n, a] = await zt.chainFromRpc(e), r = t[a];
317
+ if (!r)
318
+ throw new Error(`No config found for ${a}`);
319
+ if (r.network !== n)
320
+ throw new Error(`Network mismatch: ${r.network} != ${n}`);
321
+ return new ge(n, a, e, r.contracts);
322
+ }
323
+ async *transfer(e, t, n) {
324
+ const a = new Me(e).unwrap(), r = Ie.from(t.address.toUniversalAddress().toUint8Array()), i = Ie.from(this.usdcId), o = n.remainingAmount + n.referrerFee, c = X.get(this.network, t.chain), u = a, f = new Me(n.referrer?.address?.toString() ?? a).unwrap(), d = [
308
325
  o,
309
326
  c,
310
- s.toString(),
327
+ r.toString(),
311
328
  i.toString(),
312
- a.estimatedCost,
313
- E(t.chain),
329
+ n.estimatedCost,
330
+ A(t.chain),
314
331
  u,
315
- a.signedQuote,
316
- a.relayInstructions,
317
- a.referrerFeeDbps,
332
+ n.signedQuote,
333
+ n.relayInstructions,
334
+ n.referrerFeeDbps,
318
335
  f
319
336
  ], m = {
320
337
  function: `${this.shimContract}::cctp_v1_with_executor::deposit_for_burn_entry`,
@@ -322,114 +339,114 @@ class de {
322
339
  };
323
340
  yield this.createUnsignedTx(m, "AtposCCTPExecutor.Transfer");
324
341
  }
325
- createUnsignedTx(e, t, a = !1) {
326
- return new Mt(e, this.network, this.chain, t, a);
342
+ createUnsignedTx(e, t, n = !1) {
343
+ return new Ot(e, this.network, this.chain, t, n);
327
344
  }
328
345
  }
329
- M(It, "CCTPExecutor", de);
330
- class ue {
346
+ k(Nt, "CCTPExecutor", ge);
347
+ class pe {
331
348
  network;
332
349
  chain;
333
350
  provider;
334
351
  contracts;
335
352
  chainId;
336
353
  shimContract;
337
- constructor(e, t, a, r) {
338
- if (this.network = e, this.chain = t, this.provider = a, this.contracts = r, e === "Devnet")
354
+ constructor(e, t, n, a) {
355
+ if (this.network = e, this.chain = t, this.provider = n, this.contracts = a, e === "Devnet")
339
356
  throw new Error("CCTPExecutor not supported on Devnet");
340
- this.chainId = Ue.get(e, t);
341
- const s = ce[e]?.[t];
342
- if (!s)
357
+ this.chainId = Ne.get(e, t);
358
+ const r = he[e]?.[t];
359
+ if (!r)
343
360
  throw new Error(`Shim contract for ${t} not found`);
344
- this.shimContract = s;
361
+ this.shimContract = r;
345
362
  }
346
363
  static async fromRpc(e, t) {
347
- const [a, r] = await N.chainFromRpc(e), s = t[r];
348
- if (s.network !== a)
349
- throw new Error(`Network mismatch: ${s.network} != ${a}`);
350
- return new ue(a, r, e, s.contracts);
351
- }
352
- async *transfer(e, t, a) {
353
- const r = new J(e).toString(), s = t.address.toUniversalAddress().toUint8Array(), i = a.remainingAmount + a.referrerFee, o = b.get(this.network, this.chain), c = N.getTokenImplementation(this.provider, o);
354
- if (await c.allowance(r, this.shimContract) < i) {
355
- const l = await c.approve.populateTransaction(this.shimContract, i);
356
- yield this.createUnsignedTx(S(l, r), "ERC20.approve of EvmCCTPExecutor", !1);
364
+ const [n, a] = await K.chainFromRpc(e), r = t[a];
365
+ if (r.network !== n)
366
+ throw new Error(`Network mismatch: ${r.network} != ${n}`);
367
+ return new pe(n, a, e, r.contracts);
368
+ }
369
+ async *transfer(e, t, n) {
370
+ const a = new ne(e).toString(), r = t.address.toUniversalAddress().toUint8Array(), i = n.remainingAmount + n.referrerFee, o = y.get(this.network, this.chain), c = K.getTokenImplementation(this.provider, o);
371
+ if (await c.allowance(a, this.shimContract) < i) {
372
+ const g = await c.approve.populateTransaction(this.shimContract, i);
373
+ yield this.createUnsignedTx(_(g, a), "ERC20.approve of EvmCCTPExecutor", !1);
357
374
  }
358
375
  const f = [
359
376
  "function depositForBurn(uint256 amount, uint16 destinationChain, uint32 destinationDomain, bytes32 mintRecipient, address burnToken, (address refundAddress, bytes signedQuote, bytes instructions) executorArgs, (uint16 dbps, address payee) feeArgs) external payable returns (uint64 nonce)"
360
- ], m = await new z(this.shimContract, f, this.provider).getFunction("depositForBurn").populateTransaction(i, E(t.chain), G.get(this.network, t.chain), s, o, {
361
- refundAddress: r,
362
- signedQuote: a.signedQuote,
363
- instructions: a.relayInstructions
377
+ ], m = await new Z(this.shimContract, f, this.provider).getFunction("depositForBurn").populateTransaction(i, A(t.chain), X.get(this.network, t.chain), r, o, {
378
+ refundAddress: a,
379
+ signedQuote: n.signedQuote,
380
+ instructions: n.relayInstructions
364
381
  }, {
365
- dbps: a.referrerFeeDbps,
366
- payee: a.referrer?.address?.toString() ?? r
382
+ dbps: n.referrerFeeDbps,
383
+ payee: n.referrer?.address?.toString() ?? a
367
384
  });
368
- m.value = a.estimatedCost, yield this.createUnsignedTx(S(m, r), "EvmCCTPExecutor.depositForBurn");
385
+ m.value = n.estimatedCost, yield this.createUnsignedTx(_(m, a), "EvmCCTPExecutor.depositForBurn");
369
386
  }
370
- createUnsignedTx(e, t, a = !1) {
371
- return new Ke(Ve(e, this.chainId), this.network, this.chain, t, a);
387
+ createUnsignedTx(e, t, n = !1) {
388
+ return new tt(Oe(e, this.chainId), this.network, this.chain, t, n);
372
389
  }
373
390
  }
374
- const { amountItem: R, circleDomainItem: Se, universalAddressItem: T } = Wt, Je = {
391
+ const { amountItem: G, circleDomainItem: Ue, universalAddressItem: M } = Jt, ut = {
375
392
  binary: "uint",
376
393
  size: 4,
377
394
  custom: 1,
378
395
  omit: !1
379
- }, Jt = {
396
+ }, sn = {
380
397
  binary: "bytes",
381
398
  size: 32
382
- }, Pe = {
399
+ }, Re = {
383
400
  binary: "uint",
384
401
  size: 4
385
- }, Yt = [
386
- { name: "version", ...Je },
387
- { name: "burnToken", ...T },
388
- { name: "mintRecipient", ...T },
389
- { name: "amount", ...R },
390
- { name: "messageSender", ...T },
391
- { name: "maxFee", ...R },
392
- { name: "feeExecuted", ...R },
393
- { name: "expirationBlock", ...R },
402
+ }, rn = [
403
+ { name: "version", ...ut },
404
+ { name: "burnToken", ...M },
405
+ { name: "mintRecipient", ...M },
406
+ { name: "amount", ...G },
407
+ { name: "messageSender", ...M },
408
+ { name: "maxFee", ...G },
409
+ { name: "feeExecuted", ...G },
410
+ { name: "expirationBlock", ...G },
394
411
  { name: "hookData", binary: "bytes" }
395
- ], Ye = [
396
- { name: "version", ...Je },
397
- { name: "sourceDomain", ...Se },
398
- { name: "destinationDomain", ...Se },
399
- { name: "nonce", ...Jt },
400
- { name: "sender", ...T },
401
- { name: "recipient", ...T },
402
- { name: "destinationCaller", ...T },
403
- { name: "minFinalityThreshold", ...Pe },
404
- { name: "finalityThresholdExecuted", ...Pe },
405
- { name: "messageBody", binary: "bytes", layout: Yt }
406
- ], en = (n) => Q(Ye, n), tn = (n) => ze(Ye, n), nn = [
412
+ ], mt = [
413
+ { name: "version", ...ut },
414
+ { name: "sourceDomain", ...Ue },
415
+ { name: "destinationDomain", ...Ue },
416
+ { name: "nonce", ...sn },
417
+ { name: "sender", ...M },
418
+ { name: "recipient", ...M },
419
+ { name: "destinationCaller", ...M },
420
+ { name: "minFinalityThreshold", ...Re },
421
+ { name: "finalityThresholdExecuted", ...Re },
422
+ { name: "messageBody", binary: "bytes", layout: rn }
423
+ ], an = (s) => O(mt, s), ft = (s) => Le(mt, s), on = [
407
424
  { name: "gasLimit", binary: "uint", size: 16 },
408
425
  { name: "msgValue", binary: "uint", size: 16 }
409
- ], an = [
426
+ ], cn = [
410
427
  { name: "dropOff", binary: "uint", size: 16 },
411
- { name: "recipient", ...Re }
412
- ], sn = [
428
+ { name: "recipient", ...ze }
429
+ ], dn = [
413
430
  {
414
431
  name: "request",
415
432
  binary: "switch",
416
433
  idSize: 1,
417
434
  idTag: "type",
418
435
  layouts: [
419
- [[1, "GasInstruction"], nn],
420
- [[2, "GasDropOffInstruction"], an]
436
+ [[1, "GasInstruction"], on],
437
+ [[2, "GasDropOffInstruction"], cn]
421
438
  ]
422
439
  }
423
- ], et = [
440
+ ], lt = [
424
441
  {
425
442
  name: "requests",
426
443
  binary: "array",
427
- layout: sn
444
+ layout: dn
428
445
  }
429
- ], rn = {
430
- to: (n) => new Date(Number(n * 1000n)),
431
- from: (n) => BigInt(n.getTime()) / 1000n
432
- }, on = [
446
+ ], un = {
447
+ to: (s) => new Date(Number(s * 1000n)),
448
+ from: (s) => BigInt(s.getTime()) / 1000n
449
+ }, mn = [
433
450
  {
434
451
  name: "quote",
435
452
  binary: "switch",
@@ -455,7 +472,7 @@ const { amountItem: R, circleDomainItem: Se, universalAddressItem: T } = Wt, Je
455
472
  name: "expiryTime",
456
473
  binary: "uint",
457
474
  size: 8,
458
- custom: rn
475
+ custom: un
459
476
  },
460
477
  { name: "baseFee", binary: "uint", size: 8 },
461
478
  { name: "dstGasPrice", binary: "uint", size: 8 },
@@ -465,11 +482,11 @@ const { amountItem: R, circleDomainItem: Se, universalAddressItem: T } = Wt, Je
465
482
  ]
466
483
  ]
467
484
  }
468
- ], tt = [
469
- ...on,
485
+ ], Ce = [
486
+ ...mn,
470
487
  { name: "signature", binary: "bytes", size: 65 }
471
488
  ];
472
- class me {
489
+ class we {
473
490
  network;
474
491
  chain;
475
492
  provider;
@@ -478,64 +495,64 @@ class me {
478
495
  shimContract;
479
496
  messageTransmitter;
480
497
  usdcContract;
481
- constructor(e, t, a, r) {
482
- if (this.network = e, this.chain = t, this.provider = a, this.contracts = r, e === "Devnet")
498
+ constructor(e, t, n, a) {
499
+ if (this.network = e, this.chain = t, this.provider = n, this.contracts = a, e === "Devnet")
483
500
  throw new Error("CCTPv2Executor not supported on Devnet");
484
- this.chainId = Ue.get(e, t);
485
- const s = jt[e]?.[t];
486
- if (!s)
501
+ this.chainId = Ne.get(e, t);
502
+ const r = Xt[e]?.[t];
503
+ if (!r)
487
504
  throw new Error(`Shim contract for ${t} not found`);
488
- this.shimContract = s;
489
- const i = Ht[e]?.[t]?.messageTransmitterV2;
505
+ this.shimContract = r;
506
+ const i = it[e]?.[t]?.messageTransmitterV2;
490
507
  if (!i)
491
508
  throw new Error(`MessageTransmitter contract for ${t} not found`);
492
509
  this.messageTransmitter = i;
493
- const o = b.get(e, t);
510
+ const o = y.get(e, t);
494
511
  if (!o)
495
512
  throw new Error(`USDC contract for ${t} not found`);
496
513
  this.usdcContract = o;
497
514
  }
498
515
  static async fromRpc(e, t) {
499
- const [a, r] = await N.chainFromRpc(e), s = t[r];
500
- if (s.network !== a)
501
- throw new Error(`Network mismatch: ${s.network} != ${a}`);
502
- return new me(a, r, e, s.contracts);
503
- }
504
- async *transfer(e, t, a) {
505
- const r = new J(e).toString(), s = t.address.toUniversalAddress().toUint8Array(), i = a.remainingAmount + a.referrerFee, o = N.getTokenImplementation(this.provider, this.usdcContract);
506
- if (await o.allowance(r, this.shimContract) < i) {
507
- const C = await o.approve.populateTransaction(this.shimContract, i);
508
- yield this.createUnsignedTx(S(C, r), "ERC20.approve of EvmCCTPv2Executor", !1);
516
+ const [n, a] = await K.chainFromRpc(e), r = t[a];
517
+ if (r.network !== n)
518
+ throw new Error(`Network mismatch: ${r.network} != ${n}`);
519
+ return new we(n, a, e, r.contracts);
520
+ }
521
+ async *transfer(e, t, n) {
522
+ const a = new ne(e).toString(), r = t.address.toUniversalAddress().toUint8Array(), i = n.remainingAmount + n.referrerFee, o = K.getTokenImplementation(this.provider, this.usdcContract);
523
+ if (await o.allowance(a, this.shimContract) < i) {
524
+ const p = await o.approve.populateTransaction(this.shimContract, i);
525
+ yield this.createUnsignedTx(_(p, a), "ERC20.approve of EvmCCTPv2Executor", !1);
509
526
  }
510
527
  const u = [
511
528
  "function depositForBurn(uint256 amount, uint16 destinationChain, uint32 destinationDomain, bytes32 mintRecipient, address burnToken, bytes32 destinationCaller, uint256 maxFee, uint32 minFinalityThreshold, (address refundAddress, bytes signedQuote, bytes instructions) executorArgs, (uint16 dbps, address payee) feeArgs) external payable returns (uint64 nonce)"
512
- ], f = new Uint8Array(32), d = new z(this.shimContract, u, this.provider), m = O(this.network, t.chain), l = await d.getFunction("depositForBurn").populateTransaction(i, E(t.chain), m, s, this.usdcContract, f, a.fastTransferMaxFee, a.minFinalityThreshold, {
513
- refundAddress: r,
514
- signedQuote: a.signedQuote,
515
- instructions: a.relayInstructions
529
+ ], f = new Uint8Array(32), d = new Z(this.shimContract, u, this.provider), m = N(this.network, t.chain), g = await d.getFunction("depositForBurn").populateTransaction(i, A(t.chain), m, r, this.usdcContract, f, n.fastTransferMaxFee, n.minFinalityThreshold, {
530
+ refundAddress: a,
531
+ signedQuote: n.signedQuote,
532
+ instructions: n.relayInstructions
516
533
  }, {
517
- dbps: a.referrerFeeDbps,
518
- payee: a.referrer?.address?.toString() ?? r
534
+ dbps: n.referrerFeeDbps,
535
+ payee: n.referrer?.address?.toString() ?? a
519
536
  });
520
- l.value = a.estimatedCost, yield this.createUnsignedTx(S(l, r), "EvmCCTPv2Executor.depositForBurn");
537
+ g.value = n.estimatedCost, yield this.createUnsignedTx(_(g, a), "EvmCCTPv2Executor.depositForBurn");
521
538
  }
522
539
  async isTransferCompleted(e) {
523
- return await new z(this.messageTransmitter, ["function usedNonces(bytes32) public view returns (uint256)"], this.provider).getFunction("usedNonces").staticCall(e.nonce) === 1n;
540
+ return await new Z(this.messageTransmitter, ["function usedNonces(bytes32) public view returns (uint256)"], this.provider).getFunction("usedNonces").staticCall(e.nonce) === 1n;
524
541
  }
525
- async *redeem(e, t, a) {
526
- const r = new J(e).toString(), i = await new z(this.messageTransmitter, ["function receiveMessage(bytes message, bytes attestation)"], this.provider).getFunction("receiveMessage").populateTransaction(tn(t), I.decode(a));
527
- yield this.createUnsignedTx(S(i, r), "MessageTransmitterV2.receiveMessage");
542
+ async *redeem(e, t, n) {
543
+ const a = new ne(e).toString(), i = await new Z(this.messageTransmitter, ["function receiveMessage(bytes message, bytes attestation)"], this.provider).getFunction("receiveMessage").populateTransaction(ft(t), z.decode(n));
544
+ yield this.createUnsignedTx(_(i, a), "MessageTransmitterV2.receiveMessage");
528
545
  }
529
546
  async getCurrentBlock() {
530
547
  return BigInt(await this.provider.getBlockNumber());
531
548
  }
532
- createUnsignedTx(e, t, a = !1) {
533
- return new Ke(Ve(e, this.chainId), this.network, this.chain, t, a);
549
+ createUnsignedTx(e, t, n = !1) {
550
+ return new tt(Oe(e, this.chainId), this.network, this.chain, t, n);
534
551
  }
535
552
  }
536
- M($e, "CCTPExecutor", ue);
537
- M($e, "CCTPv2Executor", me);
538
- class fe {
553
+ k(We, "CCTPExecutor", pe);
554
+ k(We, "CCTPv2Executor", we);
555
+ class be {
539
556
  network;
540
557
  chain;
541
558
  provider;
@@ -548,170 +565,170 @@ class fe {
548
565
  messageTransmitterStateId;
549
566
  executorId;
550
567
  executorRequestsId;
551
- constructor(e, t, a, r) {
552
- if (this.network = e, this.chain = t, this.provider = a, this.contracts = r, e === "Devnet")
568
+ constructor(e, t, n, a) {
569
+ if (this.network = e, this.chain = t, this.provider = n, this.contracts = a, e === "Devnet")
553
570
  throw new Error("CCTPExecutor not supported on Devnet");
554
- const s = (u, f) => {
571
+ const r = (u, f) => {
555
572
  if (!u)
556
573
  throw new Error(f);
557
574
  return u;
558
575
  };
559
- this.usdcId = s(b.get(this.network, this.chain), `No USDC contract configured for network=${this.network} chain=${this.chain}`);
560
- const { tokenMessengerState: i, messageTransmitterState: o, usdcTreasury: c } = Vt(e);
561
- this.usdcTreasuryId = c, this.tokenMessengerId = s(r.cctp?.tokenMessenger, `Circle Token Messenger contract for domain ${t} not found`), this.messageTransmitterId = s(r.cctp?.messageTransmitter, `Circle Message Transmitter contract for domain ${t} not found`), this.tokenMessengerStateId = i, this.messageTransmitterStateId = o, this.executorId = s(Te[e]?.executorId, `Executor contract for ${e} not found`), this.executorRequestsId = s(Te[e]?.executorRequestsId, `Executor requests contract for ${e} not found`);
576
+ this.usdcId = r(y.get(this.network, this.chain), `No USDC contract configured for network=${this.network} chain=${this.chain}`);
577
+ const { tokenMessengerState: i, messageTransmitterState: o, usdcTreasury: c } = Gt(e);
578
+ this.usdcTreasuryId = c, this.tokenMessengerId = r(a.cctp?.tokenMessenger, `Circle Token Messenger contract for domain ${t} not found`), this.messageTransmitterId = r(a.cctp?.messageTransmitter, `Circle Message Transmitter contract for domain ${t} not found`), this.tokenMessengerStateId = i, this.messageTransmitterStateId = o, this.executorId = r(Ve[e]?.executorId, `Executor contract for ${e} not found`), this.executorRequestsId = r(Ve[e]?.executorRequestsId, `Executor requests contract for ${e} not found`);
562
579
  }
563
580
  static async fromRpc(e, t) {
564
- const [a, r] = await Be.chainFromRpc(e), s = t[r];
565
- if (s.network !== a)
566
- throw new Error(`Network mismatch: ${s.network} != ${a}`);
567
- return new fe(a, r, e, s.contracts);
581
+ const [n, a] = await ke.chainFromRpc(e), r = t[a];
582
+ if (r.network !== n)
583
+ throw new Error(`Network mismatch: ${r.network} != ${n}`);
584
+ return new be(n, a, e, r.contracts);
568
585
  }
569
- async *transfer(e, t, a) {
570
- const r = new kt(), s = new Et(e).unwrap(), i = G.get(this.network, t.chain), [o, ...c] = await Be.getCoins(this.provider, e, this.usdcId);
586
+ async *transfer(e, t, n) {
587
+ const a = new Lt(), r = new Vt(e).unwrap(), i = X.get(this.network, t.chain), [o, ...c] = await ke.getCoins(this.provider, e, this.usdcId);
571
588
  if (o === void 0)
572
589
  throw new Error("No USDC in wallet");
573
- const u = r.object(o.coinObjectId);
574
- c.length > 0 && r.mergeCoins(u, c.map((p) => r.object(p.coinObjectId)));
590
+ const u = a.object(o.coinObjectId);
591
+ c.length > 0 && a.mergeCoins(u, c.map((w) => a.object(w.coinObjectId)));
575
592
  let f;
576
- if (a.referrerFee > 0n) {
577
- const [p, F] = r.splitCoins(u, [
578
- a.remainingAmount,
579
- a.referrerFee
593
+ if (n.referrerFee > 0n) {
594
+ const [w, D] = a.splitCoins(u, [
595
+ n.remainingAmount,
596
+ n.referrerFee
580
597
  ]);
581
- f = p, r.transferObjects([F], a.referrer ? At(a.referrer) : s);
598
+ f = w, a.transferObjects([D], n.referrer ? Ut(n.referrer) : r);
582
599
  } else {
583
- const [p] = r.splitCoins(u, [
584
- a.remainingAmount
600
+ const [w] = a.splitCoins(u, [
601
+ n.remainingAmount
585
602
  ]);
586
- f = p;
603
+ f = w;
587
604
  }
588
- const [d, m] = r.moveCall({
605
+ const [d, m] = a.moveCall({
589
606
  target: `${this.tokenMessengerId}::deposit_for_burn::deposit_for_burn`,
590
607
  arguments: [
591
608
  f,
592
- r.pure.u32(i),
609
+ a.pure.u32(i),
593
610
  // destination_domain
594
- r.pure.address(t.address.toUniversalAddress().toString()),
611
+ a.pure.address(t.address.toUniversalAddress().toString()),
595
612
  // mint_recipient
596
- r.object(this.tokenMessengerStateId),
613
+ a.object(this.tokenMessengerStateId),
597
614
  // token_messenger_minter state
598
- r.object(this.messageTransmitterStateId),
615
+ a.object(this.messageTransmitterStateId),
599
616
  // message_transmitter state
600
- r.object("0x403"),
617
+ a.object("0x403"),
601
618
  // deny_list id, fixed address
602
- r.object(this.usdcTreasuryId)
619
+ a.object(this.usdcTreasuryId)
603
620
  // treasury object Treasury<USDC>
604
621
  ],
605
622
  typeArguments: [this.usdcId]
606
- }), [l] = r.moveCall({
623
+ }), [g] = a.moveCall({
607
624
  target: `${this.messageTransmitterId}::message::source_domain`,
608
625
  arguments: [m]
609
- }), [C] = r.moveCall({
626
+ }), [p] = a.moveCall({
610
627
  target: `${this.messageTransmitterId}::message::nonce`,
611
628
  arguments: [m]
612
- }), [x] = r.moveCall({
629
+ }), [C] = a.moveCall({
613
630
  target: `${this.executorRequestsId}::executor_requests::make_cctp_v1_request`,
614
- arguments: [l, C]
615
- }), [y] = r.splitCoins(r.gas, [
616
- r.pure.u64(a.estimatedCost)
631
+ arguments: [g, p]
632
+ }), [E] = a.splitCoins(a.gas, [
633
+ a.pure.u64(n.estimatedCost)
617
634
  ]);
618
- r.moveCall({
635
+ a.moveCall({
619
636
  target: `${this.executorId}::executor::request_execution`,
620
637
  arguments: [
621
- y,
622
- r.object(Rt),
623
- r.pure.u16(E(t.chain)),
624
- r.pure.address("0x0"),
625
- r.pure.address(s),
626
- r.pure.vector("u8", a.signedQuote),
627
- x,
628
- r.pure.vector("u8", a.relayInstructions)
638
+ E,
639
+ a.object(Wt),
640
+ a.pure.u16(A(t.chain)),
641
+ a.pure.address("0x0"),
642
+ a.pure.address(r),
643
+ a.pure.vector("u8", n.signedQuote),
644
+ C,
645
+ a.pure.vector("u8", n.relayInstructions)
629
646
  ]
630
- }), yield this.createUnsignedTx(r, "SuiCCTPExecutor.Transfer");
647
+ }), yield this.createUnsignedTx(a, "SuiCCTPExecutor.Transfer");
631
648
  }
632
- createUnsignedTx(e, t, a = !1) {
633
- return new zt(e, this.network, this.chain, t, a);
649
+ createUnsignedTx(e, t, n = !1) {
650
+ return new jt(e, this.network, this.chain, t, n);
634
651
  }
635
652
  }
636
- M(Ut, "CCTPExecutor", fe);
637
- const q = new g("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
638
- new g("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
639
- const le = new g("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
640
- new g("So11111111111111111111111111111111111111112");
641
- new g("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");
642
- class cn extends Error {
653
+ k(Qt, "CCTPExecutor", be);
654
+ const L = new h("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
655
+ new h("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
656
+ const ye = new h("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
657
+ new h("So11111111111111111111111111111111111111112");
658
+ new h("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");
659
+ class fn extends Error {
643
660
  constructor(e) {
644
661
  super(e);
645
662
  }
646
663
  }
647
- class dn extends cn {
664
+ class ln extends fn {
648
665
  constructor() {
649
666
  super(...arguments), this.name = "TokenOwnerOffCurveError";
650
667
  }
651
668
  }
652
- var ae;
653
- (function(n) {
654
- n[n.InitializeMint = 0] = "InitializeMint", n[n.InitializeAccount = 1] = "InitializeAccount", n[n.InitializeMultisig = 2] = "InitializeMultisig", n[n.Transfer = 3] = "Transfer", n[n.Approve = 4] = "Approve", n[n.Revoke = 5] = "Revoke", n[n.SetAuthority = 6] = "SetAuthority", n[n.MintTo = 7] = "MintTo", n[n.Burn = 8] = "Burn", n[n.CloseAccount = 9] = "CloseAccount", n[n.FreezeAccount = 10] = "FreezeAccount", n[n.ThawAccount = 11] = "ThawAccount", n[n.TransferChecked = 12] = "TransferChecked", n[n.ApproveChecked = 13] = "ApproveChecked", n[n.MintToChecked = 14] = "MintToChecked", n[n.BurnChecked = 15] = "BurnChecked", n[n.InitializeAccount2 = 16] = "InitializeAccount2", n[n.SyncNative = 17] = "SyncNative", n[n.InitializeAccount3 = 18] = "InitializeAccount3", n[n.InitializeMultisig2 = 19] = "InitializeMultisig2", n[n.InitializeMint2 = 20] = "InitializeMint2", n[n.GetAccountDataSize = 21] = "GetAccountDataSize", n[n.InitializeImmutableOwner = 22] = "InitializeImmutableOwner", n[n.AmountToUiAmount = 23] = "AmountToUiAmount", n[n.UiAmountToAmount = 24] = "UiAmountToAmount", n[n.InitializeMintCloseAuthority = 25] = "InitializeMintCloseAuthority", n[n.TransferFeeExtension = 26] = "TransferFeeExtension", n[n.ConfidentialTransferExtension = 27] = "ConfidentialTransferExtension", n[n.DefaultAccountStateExtension = 28] = "DefaultAccountStateExtension", n[n.Reallocate = 29] = "Reallocate", n[n.MemoTransferExtension = 30] = "MemoTransferExtension", n[n.CreateNativeMint = 31] = "CreateNativeMint", n[n.InitializeNonTransferableMint = 32] = "InitializeNonTransferableMint", n[n.InterestBearingMintExtension = 33] = "InterestBearingMintExtension", n[n.CpiGuardExtension = 34] = "CpiGuardExtension", n[n.InitializePermanentDelegate = 35] = "InitializePermanentDelegate", n[n.TransferHookExtension = 36] = "TransferHookExtension", n[n.MetadataPointerExtension = 39] = "MetadataPointerExtension";
655
- })(ae || (ae = {}));
656
- function un(n, e, t) {
669
+ var ce;
670
+ (function(s) {
671
+ s[s.InitializeMint = 0] = "InitializeMint", s[s.InitializeAccount = 1] = "InitializeAccount", s[s.InitializeMultisig = 2] = "InitializeMultisig", s[s.Transfer = 3] = "Transfer", s[s.Approve = 4] = "Approve", s[s.Revoke = 5] = "Revoke", s[s.SetAuthority = 6] = "SetAuthority", s[s.MintTo = 7] = "MintTo", s[s.Burn = 8] = "Burn", s[s.CloseAccount = 9] = "CloseAccount", s[s.FreezeAccount = 10] = "FreezeAccount", s[s.ThawAccount = 11] = "ThawAccount", s[s.TransferChecked = 12] = "TransferChecked", s[s.ApproveChecked = 13] = "ApproveChecked", s[s.MintToChecked = 14] = "MintToChecked", s[s.BurnChecked = 15] = "BurnChecked", s[s.InitializeAccount2 = 16] = "InitializeAccount2", s[s.SyncNative = 17] = "SyncNative", s[s.InitializeAccount3 = 18] = "InitializeAccount3", s[s.InitializeMultisig2 = 19] = "InitializeMultisig2", s[s.InitializeMint2 = 20] = "InitializeMint2", s[s.GetAccountDataSize = 21] = "GetAccountDataSize", s[s.InitializeImmutableOwner = 22] = "InitializeImmutableOwner", s[s.AmountToUiAmount = 23] = "AmountToUiAmount", s[s.UiAmountToAmount = 24] = "UiAmountToAmount", s[s.InitializeMintCloseAuthority = 25] = "InitializeMintCloseAuthority", s[s.TransferFeeExtension = 26] = "TransferFeeExtension", s[s.ConfidentialTransferExtension = 27] = "ConfidentialTransferExtension", s[s.DefaultAccountStateExtension = 28] = "DefaultAccountStateExtension", s[s.Reallocate = 29] = "Reallocate", s[s.MemoTransferExtension = 30] = "MemoTransferExtension", s[s.CreateNativeMint = 31] = "CreateNativeMint", s[s.InitializeNonTransferableMint = 32] = "InitializeNonTransferableMint", s[s.InterestBearingMintExtension = 33] = "InterestBearingMintExtension", s[s.CpiGuardExtension = 34] = "CpiGuardExtension", s[s.InitializePermanentDelegate = 35] = "InitializePermanentDelegate", s[s.TransferHookExtension = 36] = "TransferHookExtension", s[s.MetadataPointerExtension = 39] = "MetadataPointerExtension";
672
+ })(ce || (ce = {}));
673
+ function hn(s, e, t) {
657
674
  if (t.length) {
658
- n.push({ pubkey: e, isSigner: !1, isWritable: !1 });
659
- for (const a of t)
660
- n.push({
661
- pubkey: a instanceof g ? a : a.publicKey,
675
+ s.push({ pubkey: e, isSigner: !1, isWritable: !1 });
676
+ for (const n of t)
677
+ s.push({
678
+ pubkey: n instanceof h ? n : n.publicKey,
662
679
  isSigner: !0,
663
680
  isWritable: !1
664
681
  });
665
682
  } else
666
- n.push({ pubkey: e, isSigner: !0, isWritable: !1 });
667
- return n;
683
+ s.push({ pubkey: e, isSigner: !0, isWritable: !1 });
684
+ return s;
668
685
  }
669
- const mn = B.struct([
670
- B.u32("mintAuthorityOption"),
671
- De("mintAuthority"),
672
- _e("supply"),
673
- B.u8("decimals"),
674
- xt("isInitialized"),
675
- B.u32("freezeAuthorityOption"),
676
- De("freezeAuthority")
686
+ const gn = P.struct([
687
+ P.u32("mintAuthorityOption"),
688
+ Pe("mintAuthority"),
689
+ Qe("supply"),
690
+ P.u8("decimals"),
691
+ Rt("isInitialized"),
692
+ P.u32("freezeAuthorityOption"),
693
+ Pe("freezeAuthority")
677
694
  ]);
678
- mn.span;
679
- function Ie(n, e, t = !1, a = q, r = le) {
680
- if (!t && !g.isOnCurve(e.toBuffer()))
681
- throw new dn();
682
- const [s] = g.findProgramAddressSync([e.toBuffer(), a.toBuffer(), n.toBuffer()], r);
683
- return s;
695
+ gn.span;
696
+ function J(s, e, t = !1, n = L, a = ye) {
697
+ if (!t && !h.isOnCurve(e.toBuffer()))
698
+ throw new ln();
699
+ const [r] = h.findProgramAddressSync([e.toBuffer(), n.toBuffer(), s.toBuffer()], a);
700
+ return r;
684
701
  }
685
- function fn(n, e, t, a, r = q, s = le) {
686
- return ln(n, e, t, a, $.from([1]), r, s);
702
+ function ht(s, e, t, n, a = L, r = ye) {
703
+ return pn(s, e, t, n, l.from([1]), a, r);
687
704
  }
688
- function ln(n, e, t, a, r, s = q, i = le) {
705
+ function pn(s, e, t, n, a, r = L, i = ye) {
689
706
  const o = [
690
- { pubkey: n, isSigner: !0, isWritable: !0 },
707
+ { pubkey: s, isSigner: !0, isWritable: !0 },
691
708
  { pubkey: e, isSigner: !1, isWritable: !0 },
692
709
  { pubkey: t, isSigner: !1, isWritable: !1 },
693
- { pubkey: a, isSigner: !1, isWritable: !1 },
694
- { pubkey: yt.programId, isSigner: !1, isWritable: !1 },
695
- { pubkey: s, isSigner: !1, isWritable: !1 }
710
+ { pubkey: n, isSigner: !1, isWritable: !1 },
711
+ { pubkey: se.programId, isSigner: !1, isWritable: !1 },
712
+ { pubkey: r, isSigner: !1, isWritable: !1 }
696
713
  ];
697
- return new Ne({
714
+ return new ue({
698
715
  keys: o,
699
716
  programId: i,
700
- data: r
717
+ data: a
701
718
  });
702
719
  }
703
- const Me = B.struct([B.u8("instruction"), _e("amount")]);
704
- function hn(n, e, t, a, r = [], s = q) {
705
- const i = un([
706
- { pubkey: n, isSigner: !1, isWritable: !0 },
720
+ const _e = P.struct([P.u8("instruction"), Qe("amount")]);
721
+ function gt(s, e, t, n, a = [], r = L) {
722
+ const i = hn([
723
+ { pubkey: s, isSigner: !1, isWritable: !0 },
707
724
  { pubkey: e, isSigner: !1, isWritable: !0 }
708
- ], t, r), o = $.alloc(Me.span);
709
- return Me.encode({
710
- instruction: ae.Transfer,
711
- amount: BigInt(a)
712
- }, o), new Ne({ keys: i, programId: s, data: o });
725
+ ], t, a), o = l.alloc(_e.span);
726
+ return _e.encode({
727
+ instruction: ce.Transfer,
728
+ amount: BigInt(n)
729
+ }, o), new ue({ keys: i, programId: r, data: o });
713
730
  }
714
- const gn = {
731
+ const Cn = {
715
732
  version: "0.1.0",
716
733
  name: "example_cctp_with_executor",
717
734
  instructions: [
@@ -781,7 +798,7 @@ const gn = {
781
798
  }
782
799
  ]
783
800
  };
784
- class he {
801
+ class Ee {
785
802
  network;
786
803
  chain;
787
804
  connection;
@@ -790,267 +807,493 @@ class he {
790
807
  messageTransmitterProgramId;
791
808
  shimProgramId;
792
809
  executorProgramId;
793
- constructor(e, t, a, r) {
794
- if (this.network = e, this.chain = t, this.connection = a, this.contracts = r, e === "Devnet")
810
+ constructor(e, t, n, a) {
811
+ if (this.network = e, this.chain = t, this.connection = n, this.contracts = a, e === "Devnet")
795
812
  throw new Error("CCTPExecutor not supported on Devnet");
796
- const s = (i, o) => {
813
+ const r = (i, o) => {
797
814
  if (!i)
798
815
  throw new Error(o);
799
- return new g(i);
816
+ return new h(i);
800
817
  };
801
- this.tokenMessengerProgramId = s(r.cctp?.tokenMessenger, `Circle Token Messenger contract for domain ${t} not found`), this.messageTransmitterProgramId = s(r.cctp?.messageTransmitter, `Circle Message Transmitter contract for domain ${t} not found`), this.shimProgramId = s(ce[e]?.[t], `Shim contract for ${t} not found`), this.executorProgramId = s(qt[e], `Executor contract for ${e} not found`);
818
+ this.tokenMessengerProgramId = r(a.cctp?.tokenMessenger, `Circle Token Messenger contract for domain ${t} not found`), this.messageTransmitterProgramId = r(a.cctp?.messageTransmitter, `Circle Message Transmitter contract for domain ${t} not found`), this.shimProgramId = r(he[e]?.[t], `Shim contract for ${t} not found`), this.executorProgramId = r(at[e], `Executor contract for ${e} not found`);
802
819
  }
803
820
  static async fromRpc(e, t) {
804
- const [a, r] = await Nt.chainFromRpc(e), s = t[r];
805
- if (s.network !== a)
806
- throw new Error(`Network mismatch: ${s.network} != ${a}`);
807
- return new he(a, r, e, s.contracts);
808
- }
809
- async *transfer(e, t, a) {
810
- const r = new g(b.get(this.network, this.chain)), s = new Y(e).unwrap(), i = Ie(r, s), o = new Y(a.referrer?.address?.toString() ?? s).unwrap(), c = new Dt();
811
- if (c.feePayer = s, a.referrerFee > 0n) {
812
- const x = Ie(r, o, !0);
813
- await this.connection.getAccountInfo(x) || c.add(fn(s, x, o, r)), c.add(hn(i, x, s, a.referrerFee));
821
+ const [n, a] = await st.chainFromRpc(e), r = t[a];
822
+ if (r.network !== n)
823
+ throw new Error(`Network mismatch: ${r.network} != ${n}`);
824
+ return new Ee(n, a, e, r.contracts);
825
+ }
826
+ async *transfer(e, t, n) {
827
+ const a = new h(y.get(this.network, this.chain)), r = new I(e).unwrap(), i = J(a, r), o = new I(n.referrer?.address?.toString() ?? r).unwrap(), c = new re();
828
+ if (c.feePayer = r, n.referrerFee > 0n) {
829
+ const C = J(a, o, !0);
830
+ await this.connection.getAccountInfo(C) || c.add(ht(r, C, o, a)), c.add(gt(i, C, r, n.referrerFee));
814
831
  }
815
- const u = G.get(this.network, t.chain), f = t.address.toUniversalAddress(), d = vt.generate();
816
- c.add(await $t(this.messageTransmitterProgramId, this.tokenMessengerProgramId, r, u, s, i, f, a.remainingAmount, d.publicKey));
817
- const m = new _t(gn, this.shimProgramId, { connection: null }), l = Q(tt, a.signedQuote), C = Lt("message_transmitter", this.messageTransmitterProgramId);
832
+ const u = X.get(this.network, t.chain), f = t.address.toUniversalAddress(), d = Ge.generate();
833
+ c.add(await qt(this.messageTransmitterProgramId, this.tokenMessengerProgramId, a, u, r, i, f, n.remainingAmount, d.publicKey));
834
+ const m = new nt(Cn, this.shimProgramId, { connection: null }), g = O(Ce, n.signedQuote), p = Ht("message_transmitter", this.messageTransmitterProgramId);
818
835
  c.add(await m.methods.relayLastMessage({
819
- execAmount: new Ft(a.estimatedCost.toString()),
820
- recipientChain: E(t.chain),
821
- signedQuoteBytes: $.from(a.signedQuote),
822
- relayInstructions: $.from(a.relayInstructions)
836
+ execAmount: new je(n.estimatedCost.toString()),
837
+ recipientChain: A(t.chain),
838
+ signedQuoteBytes: l.from(n.signedQuote),
839
+ relayInstructions: l.from(n.relayInstructions)
823
840
  }).accounts({
824
- payer: s,
825
- messageTransmitter: C,
826
- payee: new g(l.quote.payeeAddress),
841
+ payer: r,
842
+ messageTransmitter: p,
843
+ payee: new h(g.quote.payeeAddress),
827
844
  executorProgram: this.executorProgramId
828
845
  }).instruction()), yield this.createUnsignedTx({ transaction: c, signers: [d] }, "SvmCCTPExecutor.Transfer");
829
846
  }
830
- createUnsignedTx(e, t, a = !1) {
831
- return new Ot(e, this.network, this.chain, t, a);
847
+ createUnsignedTx(e, t, n = !1) {
848
+ return new rt(e, this.network, this.chain, t, n);
849
+ }
850
+ }
851
+ const wn = {
852
+ version: "0.1.0",
853
+ name: "executor",
854
+ instructions: [
855
+ {
856
+ name: "requestForExecution",
857
+ accounts: [
858
+ {
859
+ name: "payer",
860
+ isMut: !0,
861
+ isSigner: !0
862
+ },
863
+ {
864
+ name: "payee",
865
+ isMut: !0,
866
+ isSigner: !1
867
+ },
868
+ {
869
+ name: "systemProgram",
870
+ isMut: !1,
871
+ isSigner: !1
872
+ }
873
+ ],
874
+ args: [
875
+ {
876
+ name: "args",
877
+ type: {
878
+ defined: "RequestForExecutionArgs"
879
+ }
880
+ }
881
+ ]
882
+ }
883
+ ],
884
+ types: [
885
+ {
886
+ name: "RequestForExecutionArgs",
887
+ type: {
888
+ kind: "struct",
889
+ fields: [
890
+ {
891
+ name: "amount",
892
+ type: "u64"
893
+ },
894
+ {
895
+ name: "dstChain",
896
+ type: "u16"
897
+ },
898
+ {
899
+ name: "dstAddr",
900
+ type: {
901
+ array: ["u8", 32]
902
+ }
903
+ },
904
+ {
905
+ name: "refundAddr",
906
+ type: "publicKey"
907
+ },
908
+ {
909
+ name: "signedQuoteBytes",
910
+ type: "bytes"
911
+ },
912
+ {
913
+ name: "requestBytes",
914
+ type: "bytes"
915
+ },
916
+ {
917
+ name: "relayInstructions",
918
+ type: "bytes"
919
+ }
920
+ ]
921
+ }
922
+ }
923
+ ],
924
+ errors: [
925
+ {
926
+ code: 6e3,
927
+ name: "InvalidArguments",
928
+ msg: "InvalidArguments"
929
+ },
930
+ {
931
+ code: 6001,
932
+ name: "QuoteSrcChainMismatch",
933
+ msg: "QuoteSrcChainMismatch"
934
+ },
935
+ {
936
+ code: 6002,
937
+ name: "QuoteDstChainMismatch",
938
+ msg: "QuoteDstChainMismatch"
939
+ },
940
+ {
941
+ code: 6003,
942
+ name: "QuoteExpired",
943
+ msg: "QuoteExpired"
944
+ },
945
+ {
946
+ code: 6004,
947
+ name: "QuotePayeeMismatch",
948
+ msg: "QuotePayeeMismatch"
949
+ }
950
+ ]
951
+ }, bn = l.from("4552433201", "hex");
952
+ class Ae {
953
+ network;
954
+ chain;
955
+ connection;
956
+ contracts;
957
+ tokenMessengerV2ProgramId;
958
+ messageTransmitterV2ProgramId;
959
+ executorProgramId;
960
+ constructor(e, t, n, a) {
961
+ this.network = e, this.chain = t, this.connection = n, this.contracts = a;
962
+ const r = (o, c) => {
963
+ if (!o)
964
+ throw new Error(c);
965
+ return new h(o);
966
+ }, i = it[e]?.[t];
967
+ if (!i)
968
+ throw new Error(`Circle V2 contracts not found for ${e} ${t}`);
969
+ this.tokenMessengerV2ProgramId = r(i.tokenMessengerV2, `Circle Token Messenger V2 contract for domain ${t} not found`), this.messageTransmitterV2ProgramId = r(i.messageTransmitterV2, `Circle Message Transmitter V2 contract for domain ${t} not found`), this.executorProgramId = r(at[e], `Executor contract for ${e} not found`);
970
+ }
971
+ static async fromRpc(e, t) {
972
+ const [n, a] = await st.chainFromRpc(e), r = t[a];
973
+ if (r.network !== n)
974
+ throw new Error(`Network mismatch: ${r.network} != ${n}`);
975
+ return new Ae(n, a, e, r.contracts);
976
+ }
977
+ async *transfer(e, t, n) {
978
+ const a = new h(y.get(this.network, this.chain)), r = new I(e).unwrap(), i = J(a, r), o = new I(n.referrer?.address?.toString() ?? r).unwrap(), c = new re();
979
+ if (c.feePayer = r, n.referrerFee > 0n) {
980
+ const C = J(a, o, !0);
981
+ await this.connection.getAccountInfo(C) || c.add(ht(r, C, o, a)), c.add(gt(i, C, r, n.referrerFee));
982
+ }
983
+ const u = N(this.network, t.chain), f = t.address.toUniversalAddress(), d = Ge.generate(), m = await this.createCCTPv2DepositInstruction(a, u, r, i, f, n.remainingAmount, d.publicKey);
984
+ c.add(m);
985
+ const g = new nt(wn, this.executorProgramId, { connection: null }), p = O(Ce, n.signedQuote);
986
+ c.add(await g.methods.requestForExecution({
987
+ amount: new je(n.estimatedCost.toString()),
988
+ dstChain: A(t.chain),
989
+ dstAddr: [...t.address.toUniversalAddress().toUint8Array()],
990
+ refundAddr: r,
991
+ signedQuoteBytes: l.from(n.signedQuote),
992
+ requestBytes: bn,
993
+ relayInstructions: l.from(n.relayInstructions)
994
+ }).accounts({
995
+ payer: r,
996
+ payee: new h(p.quote.payeeAddress),
997
+ systemProgram: se.programId
998
+ }).instruction()), yield this.createUnsignedTx({ transaction: c, signers: [d] }, "SvmCCTPv2Executor.Transfer");
999
+ }
1000
+ async isTransferCompleted(e) {
1001
+ const t = l.alloc(4);
1002
+ t.writeUInt32LE(e.sourceDomain, 0);
1003
+ const n = l.from(e.nonce).subarray(0, 8), [a] = h.findProgramAddressSync([l.from("used_nonces"), t, n], this.messageTransmitterV2ProgramId);
1004
+ try {
1005
+ return await this.connection.getAccountInfo(a) !== null;
1006
+ } catch {
1007
+ return !1;
1008
+ }
1009
+ }
1010
+ async *redeem(e, t, n) {
1011
+ const a = new I(e).unwrap(), r = new re();
1012
+ r.feePayer = a, r.add(await Zt(this.messageTransmitterV2ProgramId, this.tokenMessengerV2ProgramId, new h(y.get(this.network, this.chain)), ft(t), n, a)), yield this.createUnsignedTx({ transaction: r, signers: [] }, "SvmCCTPv2Executor.Redeem");
1013
+ }
1014
+ async getCurrentBlock() {
1015
+ const e = await this.connection.getSlot();
1016
+ return BigInt(e);
1017
+ }
1018
+ async createCCTPv2DepositInstruction(e, t, n, a, r, i, o) {
1019
+ const [c] = h.findProgramAddressSync([l.from("token_messenger")], this.tokenMessengerV2ProgramId), [u] = h.findProgramAddressSync([l.from("local_token"), e.toBuffer()], this.tokenMessengerV2ProgramId), [f] = h.findProgramAddressSync([
1020
+ l.from("remote_token_messenger"),
1021
+ l.from(t.toString())
1022
+ ], this.tokenMessengerV2ProgramId), [d] = h.findProgramAddressSync([l.from("token_minter")], this.tokenMessengerV2ProgramId), [m] = h.findProgramAddressSync([l.from("sender_authority")], this.tokenMessengerV2ProgramId), [g] = h.findProgramAddressSync([l.from("__event_authority")], this.tokenMessengerV2ProgramId), [p] = h.findProgramAddressSync([l.from("denylist_account"), n.toBuffer()], this.tokenMessengerV2ProgramId), [C] = h.findProgramAddressSync([l.from("message_transmitter")], this.messageTransmitterV2ProgramId), E = l.from([215, 60, 61, 46, 114, 55, 128, 176]), w = l.alloc(8);
1023
+ w.writeBigUInt64LE(i);
1024
+ const D = l.alloc(4);
1025
+ D.writeUInt32LE(t);
1026
+ const T = l.from(r.toUint8Array()), V = l.alloc(32), U = l.alloc(8);
1027
+ U.writeBigUInt64LE(0n);
1028
+ const B = l.alloc(4);
1029
+ B.writeUInt32LE(0);
1030
+ const W = l.concat([
1031
+ E,
1032
+ w,
1033
+ D,
1034
+ T,
1035
+ V,
1036
+ U,
1037
+ B
1038
+ ]), R = [
1039
+ { pubkey: n, isSigner: !0, isWritable: !1 },
1040
+ { pubkey: n, isSigner: !0, isWritable: !0 },
1041
+ { pubkey: m, isSigner: !1, isWritable: !1 },
1042
+ { pubkey: a, isSigner: !1, isWritable: !0 },
1043
+ { pubkey: p, isSigner: !1, isWritable: !1 },
1044
+ { pubkey: C, isSigner: !1, isWritable: !0 },
1045
+ { pubkey: c, isSigner: !1, isWritable: !1 },
1046
+ { pubkey: f, isSigner: !1, isWritable: !1 },
1047
+ { pubkey: d, isSigner: !1, isWritable: !1 },
1048
+ { pubkey: u, isSigner: !1, isWritable: !0 },
1049
+ { pubkey: e, isSigner: !1, isWritable: !0 },
1050
+ { pubkey: o, isSigner: !0, isWritable: !0 },
1051
+ {
1052
+ pubkey: this.messageTransmitterV2ProgramId,
1053
+ isSigner: !1,
1054
+ isWritable: !1
1055
+ },
1056
+ {
1057
+ pubkey: this.tokenMessengerV2ProgramId,
1058
+ isSigner: !1,
1059
+ isWritable: !1
1060
+ },
1061
+ { pubkey: L, isSigner: !1, isWritable: !1 },
1062
+ { pubkey: se.programId, isSigner: !1, isWritable: !1 },
1063
+ { pubkey: g, isSigner: !1, isWritable: !1 },
1064
+ { pubkey: this.tokenMessengerV2ProgramId, isSigner: !1, isWritable: !1 }
1065
+ ];
1066
+ return new ue({
1067
+ keys: R,
1068
+ programId: this.tokenMessengerV2ProgramId,
1069
+ data: W
1070
+ });
1071
+ }
1072
+ createUnsignedTx(e, t, n = !1) {
1073
+ return new rt(e, this.network, this.chain, t, n);
832
1074
  }
833
1075
  }
834
- M(Bt, "CCTPExecutor", he);
835
- var h;
836
- (function(n) {
837
- n.Pending = "pending", n.Failed = "failed", n.Unsupported = "unsupported", n.Submitted = "submitted", n.Underpaid = "underpaid", n.Aborted = "aborted";
838
- })(h || (h = {}));
839
- var ke;
840
- (function(n) {
841
- n.ERM1 = "ERM1", n.ERV1 = "ERV1", n.ERN1 = "ERN1", n.ERC1 = "ERC1", n.ERC2 = "ERC2";
842
- })(ke || (ke = {}));
843
- async function Cn(n) {
844
- const e = `${oe[n]}/v0/capabilities`;
1076
+ k(qe, "CCTPExecutor", Ee);
1077
+ k(qe, "CCTPv2Executor", Ae);
1078
+ var b;
1079
+ (function(s) {
1080
+ s.Pending = "pending", s.Failed = "failed", s.Unsupported = "unsupported", s.Submitted = "submitted", s.Underpaid = "underpaid", s.Aborted = "aborted";
1081
+ })(b || (b = {}));
1082
+ var $e;
1083
+ (function(s) {
1084
+ s.ERM1 = "ERM1", s.ERV1 = "ERV1", s.ERN1 = "ERN1", s.ERC1 = "ERC1", s.ERC2 = "ERC2";
1085
+ })($e || ($e = {}));
1086
+ async function yn(s) {
1087
+ const e = `${le[s]}/v0/capabilities`;
845
1088
  try {
846
- return (await D.get(e)).data;
1089
+ return (await v.get(e)).data;
847
1090
  } catch {
848
- throw new Error(`Failed to fetch capabilities for network: ${n}.`);
1091
+ throw new Error(`Failed to fetch capabilities for network: ${s}.`);
849
1092
  }
850
1093
  }
851
- async function pn(n, e, t, a) {
852
- const r = `${oe[n]}/v0/quote`;
1094
+ async function En(s, e, t, n) {
1095
+ const a = `${le[s]}/v0/quote`;
853
1096
  try {
854
- return (await D.post(r, {
855
- srcChain: E(e),
856
- dstChain: E(t),
857
- relayInstructions: a
1097
+ return (await v.post(a, {
1098
+ srcChain: A(e),
1099
+ dstChain: A(t),
1100
+ relayInstructions: n
858
1101
  })).data;
859
1102
  } catch {
860
1103
  throw new Error("Failed to fetch signed quote.");
861
1104
  }
862
1105
  }
863
- async function ge(n, e, t) {
864
- const a = `${oe[n]}/v0/status/tx`;
1106
+ async function xe(s, e, t) {
1107
+ const n = `${le[s]}/v0/status/tx`;
865
1108
  try {
866
- return (await D.post(a, {
1109
+ return (await v.post(n, {
867
1110
  txHash: e,
868
- chainId: E(t)
1111
+ chainId: A(t)
869
1112
  })).data;
870
1113
  } catch {
871
1114
  throw new Error(`Failed to fetch status for txHash: ${e}.`);
872
1115
  }
873
1116
  }
874
- const wn = 65535n;
875
- function bn(n, e, t) {
876
- if (e > wn)
1117
+ const An = 65535n;
1118
+ function xn(s, e, t) {
1119
+ if (e > An)
877
1120
  throw new Error("dBps exceeds max u16");
878
- let a = e, r = n, s = 0n;
1121
+ let n = e, a = s, r = 0n;
879
1122
  if (e > 0) {
880
- if (t !== void 0 && n > 0) {
881
- const i = Le(t.toString(), 6), o = re(i) / n, c = e < o ? e : o;
882
- s = n * c / 100000n, a = c;
1123
+ if (t !== void 0 && s > 0) {
1124
+ const i = He(t.toString(), 6), o = me(i) / s, c = e < o ? e : o;
1125
+ r = s * c / 100000n, n = c;
883
1126
  } else
884
- s = n * e / 100000n;
885
- r = n - s;
1127
+ r = s * e / 100000n;
1128
+ a = s - r;
886
1129
  }
887
- return { referrerFee: s, remainingAmount: r, referrerFeeDbps: a };
1130
+ return { referrerFee: r, remainingAmount: a, referrerFeeDbps: n };
888
1131
  }
889
- function En(n) {
890
- return new Promise((e) => setTimeout(e, n));
1132
+ function Dn(s) {
1133
+ return new Promise((e) => setTimeout(e, s));
891
1134
  }
892
- async function se(n, e, t = Oe) {
893
- const a = O(e, n.chain);
894
- return Ge(async () => {
895
- const r = `${j[e]}/messages/${a}?transactionHash=${n.txid}`;
1135
+ async function de(s, e, t = Ze) {
1136
+ const n = N(e, s.chain);
1137
+ return Ke(async () => {
1138
+ const a = `${te[e]}/messages/${n}?transactionHash=${s.txid}`;
896
1139
  try {
897
- const i = (await D.get(r)).data.messages[0];
1140
+ const i = (await v.get(a)).data.messages[0];
898
1141
  if (!i)
899
1142
  return null;
900
1143
  if (i.cctpVersion !== 2)
901
1144
  throw new Error("CCTPv1 attestation found");
902
1145
  return i.status === "pending_confirmations" ? null : {
903
- message: en(I.decode(i.message)),
1146
+ message: an(z.decode(i.message)),
904
1147
  attestation: i.attestation
905
1148
  };
906
- } catch (s) {
907
- if (!s || typeof s == "object" && (D.isAxiosError(s) && s.response?.status === 404 || "status" in s && s.status === 404))
1149
+ } catch (r) {
1150
+ if (!r || typeof r == "object" && (v.isAxiosError(r) && r.response?.status === 404 || "status" in r && r.status === 404))
908
1151
  return null;
909
- throw s;
1152
+ throw r;
910
1153
  }
911
1154
  }, 2e3, t, "CCTPv2:GetMessage");
912
1155
  }
913
- async function An(n, e, t) {
914
- const a = O(n, e), r = O(n, t), s = `${j[n]}/fastBurn/USDC/fees/${a}/${r}`, i = await D.get(s);
1156
+ async function Sn(s, e, t) {
1157
+ const n = N(s, e), a = N(s, t), r = `${te[s]}/fastBurn/USDC/fees/${n}/${a}`, i = await v.get(r);
915
1158
  return BigInt(i.data.minimumFee);
916
1159
  }
917
- async function xn(n, e) {
918
- const t = I.encode(e.attestation.message.nonce, !0), a = `${j[n]}/reattest/${t}`, r = await D.post(a);
919
- if (r.data.error) {
920
- if (r.data.error.includes("Message is already finalized"))
1160
+ async function vn(s, e) {
1161
+ const t = z.encode(e.attestation.message.nonce, !0), n = `${te[s]}/reattest/${t}`, a = await v.post(n);
1162
+ if (a.data.error) {
1163
+ if (a.data.error.includes("Message is already finalized"))
921
1164
  return e.attestation;
922
- throw new Error(`Error re-attesting message: ${r.data.error}`);
1165
+ throw new Error(`Error re-attesting message: ${a.data.error}`);
923
1166
  }
924
- const s = He(n, e.attestation.message.sourceDomain);
925
- return Ge(async () => {
926
- const i = await se({ txid: e.id, chain: s }, n);
1167
+ const r = ct(s, e.attestation.message.sourceDomain);
1168
+ return Ke(async () => {
1169
+ const i = await de({ txid: e.id, chain: r }, s);
927
1170
  return !i || i.message.messageBody.expirationBlock !== 0n ? null : i;
928
- }, 2e3, Oe, "CCTPv2:Reattest");
1171
+ }, 2e3, Ze, "CCTPv2:Reattest");
929
1172
  }
930
- async function yn(n) {
931
- const e = `${j[n]}/fastBurn/USDC/allowance`, t = await D.get(e);
932
- return re(Le(t.data.allowance, 6));
1173
+ async function Fn(s) {
1174
+ const e = `${te[s]}/fastBurn/USDC/allowance`, t = await v.get(e);
1175
+ return me(He(t.data.allowance, 6));
933
1176
  }
934
- function Ce(n, e, t) {
935
- const a = b.get(e.network, e.chain);
936
- if (!(a && Tt(n, v.tokenId(e.chain, a))))
1177
+ function De(s, e, t) {
1178
+ const n = y.get(e.network, e.chain);
1179
+ if (!(n && _t(s, F.tokenId(e.chain, n))))
937
1180
  return [];
938
- const { network: r, chain: s } = t, i = b.get(r, s);
939
- return i ? [v.chainAddress(s, i)] : [];
1181
+ const { network: a, chain: r } = t, i = y.get(a, r);
1182
+ return i ? [F.chainAddress(r, i)] : [];
940
1183
  }
941
- let U;
942
- async function pe(n, e, t, a) {
943
- const { fromChain: r, toChain: s } = n;
944
- if (!b.get(r.network, r.chain))
1184
+ let j;
1185
+ async function Se(s, e, t, n) {
1186
+ const { fromChain: a, toChain: r } = s;
1187
+ if (!y.get(a.network, a.chain))
945
1188
  throw new Error("Invalid transfer, no USDC contract on source");
946
- const o = b.get(s.network, s.chain);
1189
+ const o = y.get(r.network, r.chain);
947
1190
  if (!o)
948
1191
  throw new Error("Invalid transfer, no USDC contract on destination");
949
1192
  let c;
950
- if (t.referrerFeeDbps > 0n && (c = t.referrerAddresses?.[r.network]?.[r.chain], !c))
951
- throw new Error(`Referrer address not configured for ${r.chain}`);
952
- const u = c ? v.chainAddress(r.chain, c) : void 0, { referrerFee: f, remainingAmount: d, referrerFeeDbps: m } = bn(re(e.normalizedParams.amount), t.referrerFeeDbps, t.referrerFeeThreshold);
1193
+ if (t.referrerFeeDbps > 0n && (c = t.referrerAddresses?.[a.network]?.[a.chain], !c))
1194
+ throw new Error(`Referrer address not configured for ${a.chain}`);
1195
+ const u = c ? F.chainAddress(a.chain, c) : void 0, { referrerFee: f, remainingAmount: d, referrerFeeDbps: m } = xn(me(e.normalizedParams.amount), t.referrerFeeDbps, t.referrerFeeThreshold);
953
1196
  if (d <= 0n)
954
1197
  throw new Error("Amount after fee <= 0");
955
- const l = Zt[s.network]?.[s.chain];
956
- if (!l)
1198
+ const g = tn[r.network]?.[r.chain];
1199
+ if (!g)
957
1200
  throw new Error("Gas limit not found");
958
- const C = await Cn(r.network);
959
- if (!C[E(r.chain)])
1201
+ const p = await yn(a.network);
1202
+ if (!p[A(a.chain)])
960
1203
  throw new Error("Unsupported source chain");
961
- const y = C[E(s.chain)];
962
- if (!y || !y.requestPrefixes.includes(a))
1204
+ const E = p[A(r.chain)];
1205
+ if (!E || !E.requestPrefixes.includes(n))
963
1206
  throw new Error("Unsupported destination chain");
964
- const { recipient: p } = n;
965
- let F = !0;
966
- if (p && s.chain === "Solana") {
967
- const it = v.parseAddress("Solana", o), ot = await s.getTokenAccount(p.address, it), ye = await s.getRpc();
968
- F = await ye.getAccountInfo(new Y(ot.address).unwrap()) !== null, !F && !U && (U = BigInt(await ye.getMinimumBalanceForRentExemption(165)));
969
- }
970
- let K = 0n;
971
- s.chain === "Solana" && (K += Kt, !F && U && (K += U));
972
- const Z = [];
973
- Z.push({
1207
+ const { recipient: w } = s;
1208
+ let D = !0;
1209
+ if (w && r.chain === "Solana") {
1210
+ const yt = F.parseAddress("Solana", o), Et = await r.getTokenAccount(w.address, yt), Be = await r.getRpc();
1211
+ D = await Be.getAccountInfo(new I(Et.address).unwrap()) !== null, !D && !j && (j = BigInt(await Be.getMinimumBalanceForRentExemption(165)));
1212
+ }
1213
+ let T = 0n;
1214
+ r.chain === "Solana" && (T += en, !D && j && (T += j), n === "ERC2" && (T += 1200000n));
1215
+ const V = [];
1216
+ V.push({
974
1217
  request: {
975
1218
  type: "GasInstruction",
976
- gasLimit: l,
977
- msgValue: K
1219
+ gasLimit: g,
1220
+ msgValue: T
978
1221
  }
979
1222
  });
980
- const Ee = BigInt(y.gasDropOffLimit), H = e.options.nativeGas && Ee > 0n ? BigInt(Math.round(e.options.nativeGas * 100)) * Ee / 100n : 0n;
981
- (H > 0n || !F) && Z.push({
1223
+ const U = BigInt(E.gasDropOffLimit), B = e.options.nativeGas && U > 0n ? BigInt(Math.round(e.options.nativeGas * 100)) * U / 100n : 0n;
1224
+ (B > 0n || !D) && V.push({
982
1225
  request: {
983
1226
  type: "GasDropOffInstruction",
984
- dropOff: H,
1227
+ dropOff: B,
985
1228
  // If the recipient is undefined (e.g. the user hasn’t connected their wallet yet),
986
1229
  // we temporarily use a dummy address to fetch a quote.
987
1230
  // The recipient address is validated later in the `initiate` method, which will throw if it's still missing.
988
- recipient: p ? p.address.toUniversalAddress() : new St(new Uint8Array(32))
1231
+ recipient: w ? w.address.toUniversalAddress() : new $t(new Uint8Array(32))
989
1232
  }
990
1233
  });
991
- const Ae = ze(et, {
992
- requests: Z
993
- }), X = await pn(r.network, r.chain, s.chain, I.encode(Ae, !0));
994
- if (!X.estimatedCost)
1234
+ const W = Le(lt, {
1235
+ requests: V
1236
+ }), R = await En(a.network, a.chain, r.chain, z.encode(W, !0));
1237
+ if (!R.estimatedCost)
995
1238
  throw new Error("No estimated cost");
996
- const xe = I.decode(X.signedQuote), st = Q(tt, xe), rt = BigInt(X.estimatedCost);
1239
+ const Te = z.decode(R.signedQuote), wt = O(Ce, Te), bt = BigInt(R.estimatedCost);
997
1240
  return {
998
- signedQuote: xe,
999
- relayInstructions: Ae,
1000
- estimatedCost: rt,
1241
+ signedQuote: Te,
1242
+ relayInstructions: W,
1243
+ estimatedCost: bt,
1001
1244
  referrer: u,
1002
1245
  referrerFee: f,
1003
1246
  remainingAmount: d,
1004
1247
  referrerFeeDbps: m,
1005
- expiryTime: st.quote.expiryTime,
1006
- gasDropOff: H
1248
+ expiryTime: wt.quote.expiryTime,
1249
+ gasDropOff: B
1007
1250
  };
1008
1251
  }
1009
- async function nt(n, e, t, a) {
1010
- Q(et, a.details.relayInstructions).requests.forEach(({ request: d }) => {
1252
+ async function pt(s, e, t, n) {
1253
+ O(lt, n.details.relayInstructions).requests.forEach(({ request: d }) => {
1011
1254
  if (d.type === "GasDropOffInstruction" && !d.recipient.equals(t.address.toUniversalAddress()))
1012
1255
  throw new Error("Gas drop-off recipient does not match");
1013
1256
  });
1014
- const s = v.parseAddress(e.chain(), e.address()), i = await Dn(t, n);
1257
+ const r = F.parseAddress(e.chain(), e.address()), i = await Tn(t, s);
1015
1258
  let o;
1016
- a.protocol === "CCTPExecutor" ? o = await (await n.fromChain.getProtocol(a.protocol)).transfer(s, i, a.details) : o = await (await n.fromChain.getProtocol(a.protocol)).transfer(s, i, a.details);
1017
- const c = await Qe(n.fromChain, o, e);
1259
+ n.protocol === "CCTPExecutor" ? o = await (await s.fromChain.getProtocol(n.protocol)).transfer(r, i, n.details) : o = await (await s.fromChain.getProtocol(n.protocol)).transfer(r, i, n.details);
1260
+ const c = await Ye(s.fromChain, o, e);
1018
1261
  let u = 0;
1019
1262
  return (async () => {
1020
1263
  for (; u < 20; ) {
1021
1264
  try {
1022
- const [d] = await ge(n.fromChain.network, c.at(-1).txid, n.fromChain.chain);
1265
+ const [d] = await xe(s.fromChain.network, c.at(-1).txid, s.fromChain.chain);
1023
1266
  if (d)
1024
1267
  break;
1025
1268
  } catch {
1026
1269
  }
1027
- u++, await En(2e3);
1270
+ u++, await Dn(2e3);
1028
1271
  }
1029
1272
  })(), {
1030
- from: n.fromChain.chain,
1031
- to: n.toChain.chain,
1032
- state: w.SourceInitiated,
1273
+ from: s.fromChain.chain,
1274
+ to: s.toChain.chain,
1275
+ state: x.SourceInitiated,
1033
1276
  originTxs: c
1034
1277
  };
1035
1278
  }
1036
- async function Dn(n, e) {
1037
- if (n.chain !== "Solana")
1038
- return n;
1039
- const t = b.get(e.toChain.network, e.toChain.chain);
1279
+ async function Tn(s, e) {
1280
+ if (s.chain !== "Solana")
1281
+ return s;
1282
+ const t = y.get(e.toChain.network, e.toChain.chain);
1040
1283
  if (!t)
1041
1284
  throw new Error("No USDC contract found for Solana");
1042
- const a = v.parseAddress("Solana", t);
1043
- return e.toChain.getTokenAccount(n.address, a);
1285
+ const n = F.parseAddress("Solana", t);
1286
+ return e.toChain.getTokenAccount(s.address, n);
1044
1287
  }
1045
- function Qn(n = { referrerFeeDbps: 0n }) {
1046
- if (n.referrerFeeDbps < 0 || n.referrerFeeDbps > 65535n)
1288
+ function Zn(s = { referrerFeeDbps: 0n }) {
1289
+ if (s.referrerFeeDbps < 0 || s.referrerFeeDbps > 65535n)
1047
1290
  throw new Error("Referrer fee must be between 0 and 65535");
1048
- class e extends vn {
1049
- static config = n;
1291
+ class e extends Bn {
1292
+ static config = s;
1050
1293
  }
1051
1294
  return e;
1052
1295
  }
1053
- class vn extends We {
1296
+ class Bn extends Je {
1054
1297
  static NATIVE_GAS_DROPOFF_SUPPORTED = !0;
1055
1298
  // @ts-ignore
1056
1299
  // Since we set the config on the static class, access it with this param
@@ -1065,10 +1308,10 @@ class vn extends We {
1065
1308
  return ["Mainnet", "Testnet"];
1066
1309
  }
1067
1310
  static supportedChains(e) {
1068
- return [...Object.keys(Ze[e] ?? {})];
1311
+ return [...Object.keys(ot[e] ?? {})];
1069
1312
  }
1070
- static async supportedDestinationTokens(e, t, a) {
1071
- return !k(t.network, t.chain) || !k(a.network, a.chain) ? [] : Ce(e, t, a);
1313
+ static async supportedDestinationTokens(e, t, n) {
1314
+ return !Q(t.network, t.chain) || !Q(n.network, n.chain) ? [] : De(e, t, n);
1072
1315
  }
1073
1316
  getDefaultOptions() {
1074
1317
  return {
@@ -1076,8 +1319,8 @@ class vn extends We {
1076
1319
  };
1077
1320
  }
1078
1321
  async validate(e, t) {
1079
- const { fromChain: a, toChain: r } = e;
1080
- return !k(a.network, a.chain) || !k(r.network, r.chain) ? {
1322
+ const { fromChain: n, toChain: a } = e;
1323
+ return !Q(n.network, n.chain) || !Q(a.network, a.chain) ? {
1081
1324
  valid: !1,
1082
1325
  error: new Error("Unsupported source or destination chain"),
1083
1326
  params: t
@@ -1094,11 +1337,11 @@ class vn extends We {
1094
1337
  } };
1095
1338
  }
1096
1339
  async quote(e, t) {
1097
- const { fromChain: a, toChain: r } = e;
1340
+ const { fromChain: n, toChain: a } = e;
1098
1341
  try {
1099
- const s = await pe(e, t, this.staticConfig, "ERC1"), { remainingAmount: i, estimatedCost: o, gasDropOff: c, expiryTime: u } = s, f = a.chain === "Polygon" ? 2e3 * 200 : je(a.chain) + 1e3, [d, m] = await Promise.all([
1100
- a.getDecimals("native"),
1101
- r.getDecimals("native")
1342
+ const r = await Se(e, t, this.staticConfig, "ERC1"), { remainingAmount: i, estimatedCost: o, gasDropOff: c, expiryTime: u } = r, f = n.chain === "Polygon" ? 2e3 * 200 : Xe(n.chain) + 1e3, [d, m] = await Promise.all([
1343
+ n.getDecimals("native"),
1344
+ a.getDecimals("native")
1102
1345
  ]);
1103
1346
  return {
1104
1347
  success: !0,
@@ -1109,193 +1352,193 @@ class vn extends We {
1109
1352
  },
1110
1353
  destinationToken: {
1111
1354
  token: e.destination.id,
1112
- amount: A(i, e.destination.decimals)
1355
+ amount: S(i, e.destination.decimals)
1113
1356
  },
1114
1357
  relayFee: {
1115
- token: ie(a.chain),
1116
- amount: A(o, d)
1358
+ token: fe(n.chain),
1359
+ amount: S(o, d)
1117
1360
  },
1118
- destinationNativeGas: A(c, m),
1361
+ destinationNativeGas: S(c, m),
1119
1362
  eta: f,
1120
1363
  expires: u,
1121
- details: s
1364
+ details: r
1122
1365
  };
1123
- } catch (s) {
1366
+ } catch (r) {
1124
1367
  return {
1125
1368
  success: !1,
1126
- error: new Error(s instanceof Error ? s.message : `${s}`)
1369
+ error: new Error(r instanceof Error ? r.message : `${r}`)
1127
1370
  };
1128
1371
  }
1129
1372
  }
1130
- async initiate(e, t, a, r) {
1131
- if (!a.details)
1373
+ async initiate(e, t, n, a) {
1374
+ if (!n.details)
1132
1375
  throw new Error("Missing quote details");
1133
- return await nt(e, t, r, {
1376
+ return await pt(e, t, a, {
1134
1377
  protocol: "CCTPExecutor",
1135
- details: a.details
1378
+ details: n.details
1136
1379
  });
1137
1380
  }
1138
1381
  async *track(e, t) {
1139
- if (_(e) || P(e))
1382
+ if (H(e) || $(e))
1140
1383
  return e;
1141
- let a = t || 3600 * 1e3;
1142
- for (; a > 0; ) {
1143
- const r = Date.now();
1144
- if (ee(e) || te(e) || V(e))
1384
+ let n = t || 3600 * 1e3;
1385
+ for (; n > 0; ) {
1386
+ const a = Date.now();
1387
+ if (ae(e) || ie(e) || q(e))
1145
1388
  try {
1146
- const [s] = await ge(this.wh.network, e.originTxs.at(-1).txid, e.from);
1147
- if (!s)
1389
+ const [r] = await xe(this.wh.network, e.originTxs.at(-1).txid, e.from);
1390
+ if (!r)
1148
1391
  throw new Error("No transaction status found");
1149
- const i = s?.status;
1150
- if ((i === h.Failed || // this could happen if simulation fails
1151
- i === h.Underpaid || // only happens if you don't pay at least the costEstimate
1152
- i === h.Unsupported || // capabilities check didn't pass
1153
- i === h.Aborted) && (e = {
1392
+ const i = r?.status;
1393
+ if ((i === b.Failed || // this could happen if simulation fails
1394
+ i === b.Underpaid || // only happens if you don't pay at least the costEstimate
1395
+ i === b.Unsupported || // capabilities check didn't pass
1396
+ i === b.Aborted) && (e = {
1154
1397
  ...e,
1155
- state: w.Failed,
1156
- error: new qe(`Relay failed with status: ${i}`)
1157
- }), i === h.Submitted && (e = {
1398
+ state: x.Failed,
1399
+ error: new et(`Relay failed with status: ${i}`)
1400
+ }), i === b.Submitted && (e = {
1158
1401
  ...e,
1159
- state: w.DestinationFinalized,
1160
- attestation: { id: s.id, attestation: {} }
1161
- }), yield e, _(e) || P(e))
1402
+ state: x.DestinationFinalized,
1403
+ attestation: { id: r.id, attestation: {} }
1404
+ }), yield e, H(e) || $(e))
1162
1405
  return e;
1163
- } catch (s) {
1164
- console.error(`Error fetching transaction status: ${s.message || s}`);
1406
+ } catch (r) {
1407
+ console.error(`Error fetching transaction status: ${r.message || r}`);
1165
1408
  }
1166
- await new Promise((s) => setTimeout(s, 3e3)), a -= Date.now() - r;
1409
+ await new Promise((r) => setTimeout(r, 3e3)), n -= Date.now() - a;
1167
1410
  }
1168
1411
  return e;
1169
1412
  }
1170
1413
  }
1171
- class at extends We {
1414
+ class Ct extends Je {
1172
1415
  static NATIVE_GAS_DROPOFF_SUPPORTED = !0;
1173
1416
  static supportedNetworks() {
1174
1417
  return ["Mainnet", "Testnet"];
1175
1418
  }
1176
1419
  static supportedChains(e) {
1177
- return Object.keys(W[e] ?? {});
1420
+ return Object.keys(ee[e] ?? {});
1178
1421
  }
1179
1422
  getDefaultOptions() {
1180
1423
  return {
1181
1424
  nativeGas: 0
1182
1425
  };
1183
1426
  }
1184
- async initiate(e, t, a, r) {
1185
- if (!a.details)
1427
+ async initiate(e, t, n, a) {
1428
+ if (!n.details)
1186
1429
  throw new Error("Missing quote details");
1187
- return await nt(e, t, r, {
1430
+ return await pt(e, t, a, {
1188
1431
  protocol: "CCTPv2Executor",
1189
- details: a.details
1432
+ details: n.details
1190
1433
  });
1191
1434
  }
1192
1435
  async *track(e, t) {
1193
- if (_(e))
1436
+ if (H(e))
1194
1437
  return e;
1195
- let a = t || 3600 * 1e3;
1196
- for (; a > 0; ) {
1197
- const r = Date.now();
1198
- if (ee(e) || te(e) || V(e) || P(e))
1438
+ let n = t || 3600 * 1e3;
1439
+ for (; n > 0; ) {
1440
+ const a = Date.now();
1441
+ if (ae(e) || ie(e) || q(e) || $(e))
1199
1442
  try {
1200
- const s = e.originTxs.at(-1).txid;
1201
- if (ee(e) || te(e)) {
1202
- const i = await se({ chain: e.from, txid: s }, this.wh.network);
1443
+ const r = e.originTxs.at(-1).txid;
1444
+ if (ae(e) || ie(e)) {
1445
+ const i = await de({ chain: e.from, txid: r }, this.wh.network);
1203
1446
  i && (e = {
1204
1447
  ...e,
1205
- state: w.Attested,
1448
+ state: x.Attested,
1206
1449
  attestation: {
1207
- id: s,
1450
+ id: r,
1208
1451
  attestation: i
1209
1452
  }
1210
1453
  }), yield e;
1211
1454
  }
1212
- if (V(e)) {
1213
- const [i] = await ge(this.wh.network, s, e.from);
1455
+ if (q(e)) {
1456
+ const [i] = await xe(this.wh.network, r, e.from);
1214
1457
  if (!i)
1215
1458
  throw new Error("No transaction status found");
1216
1459
  const o = i?.status;
1217
- o === h.Submitted ? e = {
1460
+ o === b.Submitted ? e = {
1218
1461
  ...e,
1219
- state: w.DestinationFinalized
1220
- } : (o === h.Failed || // this could happen if simulation fails
1221
- o === h.Underpaid || // only happens if you don't pay at least the costEstimate
1222
- o === h.Unsupported || // capabilities check didn't pass
1223
- o === h.Aborted) && (e = {
1462
+ state: x.DestinationFinalized
1463
+ } : (o === b.Failed || // this could happen if simulation fails
1464
+ o === b.Underpaid || // only happens if you don't pay at least the costEstimate
1465
+ o === b.Unsupported || // capabilities check didn't pass
1466
+ o === b.Aborted) && (e = {
1224
1467
  ...e,
1225
- state: w.Failed,
1226
- error: new qe(`Relay failed with status: ${o}`)
1468
+ state: x.Failed,
1469
+ error: new et(`Relay failed with status: ${o}`)
1227
1470
  });
1228
1471
  }
1229
- if (P(e)) {
1472
+ if ($(e)) {
1230
1473
  if (!e.attestation)
1231
1474
  throw new Error("Receipt is missing attestation");
1232
1475
  const i = e.attestation;
1233
1476
  await (await this.wh.getChain(e.to).getProtocol("CCTPv2Executor")).isTransferCompleted(i.attestation.message) && (e = {
1234
1477
  ...e,
1235
- state: w.DestinationFinalized,
1478
+ state: x.DestinationFinalized,
1236
1479
  attestation: i
1237
1480
  });
1238
1481
  }
1239
- if (yield e, _(e))
1482
+ if (yield e, H(e))
1240
1483
  return e;
1241
- } catch (s) {
1242
- console.error(`Error fetching transaction status: ${s.message || s}`);
1484
+ } catch (r) {
1485
+ console.error(`Error fetching transaction status: ${r.message || r}`);
1243
1486
  }
1244
- await new Promise((s) => setTimeout(s, 3e3)), a -= Date.now() - r;
1487
+ await new Promise((r) => setTimeout(r, 3e3)), n -= Date.now() - a;
1245
1488
  }
1246
1489
  return e;
1247
1490
  }
1248
1491
  async complete(e, t) {
1249
- if (!V(t) && !P(t))
1492
+ if (!q(t) && !$(t))
1250
1493
  throw new Error("Transfer is not attested");
1251
1494
  if (!t.attestation)
1252
1495
  throw new Error("No attestation found");
1253
- const a = this.wh.getChain(t.to), r = await a.getProtocol("CCTPv2Executor");
1254
- let { attestation: s, message: i } = t.attestation.attestation;
1255
- const { expirationBlock: o } = i.messageBody, c = await r.getCurrentBlock();
1496
+ const n = this.wh.getChain(t.to), a = await n.getProtocol("CCTPv2Executor");
1497
+ let { attestation: r, message: i } = t.attestation.attestation;
1498
+ const { expirationBlock: o } = i.messageBody, c = await a.getCurrentBlock();
1256
1499
  if (o !== 0n && o < c) {
1257
- const m = await xn(a.network, t.attestation);
1500
+ const m = await vn(n.network, t.attestation);
1258
1501
  if (!m)
1259
1502
  throw new Error("Failed to reattest message");
1260
- s = m.attestation, i = m.message;
1503
+ r = m.attestation, i = m.message;
1261
1504
  }
1262
- const u = v.parseAddress(e.chain(), e.address()), f = r.redeem(u, i, s), d = await Qe(this.wh.getChain(t.to), f, e);
1505
+ const u = F.parseAddress(e.chain(), e.address()), f = a.redeem(u, i, r), d = await Ye(this.wh.getChain(t.to), f, e);
1263
1506
  return {
1264
1507
  ...t,
1265
- state: w.DestinationInitiated,
1508
+ state: x.DestinationInitiated,
1266
1509
  attestation: t.attestation,
1267
1510
  destinationTxs: d
1268
1511
  };
1269
1512
  }
1270
1513
  async resume(e) {
1271
- const t = await se(e, this.wh.network);
1514
+ const t = await de(e, this.wh.network);
1272
1515
  if (!t)
1273
1516
  throw new Error("No attestation found");
1274
- const { message: a } = t, r = He(this.wh.network, a.destinationDomain);
1275
- return await (await this.wh.getChain(r).getProtocol("CCTPv2Executor")).isTransferCompleted(a) ? {
1517
+ const { message: n } = t, a = ct(this.wh.network, n.destinationDomain);
1518
+ return await (await this.wh.getChain(a).getProtocol("CCTPv2Executor")).isTransferCompleted(n) ? {
1276
1519
  from: e.chain,
1277
- to: r,
1278
- state: w.DestinationFinalized,
1520
+ to: a,
1521
+ state: x.DestinationFinalized,
1279
1522
  originTxs: [e],
1280
1523
  attestation: { id: e.txid, attestation: t }
1281
1524
  } : {
1282
1525
  from: e.chain,
1283
- to: r,
1284
- state: w.Attested,
1526
+ to: a,
1527
+ state: x.Attested,
1285
1528
  originTxs: [e],
1286
1529
  attestation: { id: e.txid, attestation: t }
1287
1530
  };
1288
1531
  }
1289
1532
  }
1290
- function Wn(n = { referrerFeeDbps: 0n }) {
1291
- if (n.referrerFeeDbps < 0 || n.referrerFeeDbps > 65535n)
1533
+ function Hn(s = { referrerFeeDbps: 0n }) {
1534
+ if (s.referrerFeeDbps < 0 || s.referrerFeeDbps > 65535n)
1292
1535
  throw new Error("Referrer fee must be between 0 and 65535");
1293
- class e extends we {
1294
- static config = n;
1536
+ class e extends ve {
1537
+ static config = s;
1295
1538
  }
1296
1539
  return e;
1297
1540
  }
1298
- class we extends at {
1541
+ class ve extends Ct {
1299
1542
  // @ts-ignore
1300
1543
  // Since we set the config on the static class, access it with this param
1301
1544
  // the CCTPv2FastExecutorRoute.config will always be empty
@@ -1306,13 +1549,13 @@ class we extends at {
1306
1549
  provider: "Circle CCTP"
1307
1550
  };
1308
1551
  static isPathSupported(e, t) {
1309
- return Xt(e.network, e.chain) && ne(t.network, t.chain);
1552
+ return nn(e.network, e.chain) && oe(t.network, t.chain);
1310
1553
  }
1311
- static async supportedDestinationTokens(e, t, a) {
1312
- return this.isPathSupported(t, a) ? Ce(e, t, a) : [];
1554
+ static async supportedDestinationTokens(e, t, n) {
1555
+ return this.isPathSupported(t, n) ? De(e, t, n) : [];
1313
1556
  }
1314
1557
  async validate(e, t) {
1315
- return we.isPathSupported(e.fromChain, e.toChain) ? t.options?.nativeGas && (t.options.nativeGas < 0 || t.options.nativeGas > 1) ? {
1558
+ return ve.isPathSupported(e.fromChain, e.toChain) ? t.options?.nativeGas && (t.options.nativeGas < 0 || t.options.nativeGas > 1) ? {
1316
1559
  valid: !1,
1317
1560
  error: new Error("Invalid native gas percentage"),
1318
1561
  params: t
@@ -1329,23 +1572,23 @@ class we extends at {
1329
1572
  };
1330
1573
  }
1331
1574
  async quote(e, t) {
1332
- const { fromChain: a, toChain: r } = e;
1575
+ const { fromChain: n, toChain: a } = e;
1333
1576
  try {
1334
- const s = await pe(e, t, this.staticConfig, "ERC2"), { remainingAmount: i, estimatedCost: o, gasDropOff: c, expiryTime: u } = s;
1335
- if (await yn(a.network) <= i)
1577
+ const r = await Se(e, t, this.staticConfig, "ERC2"), { remainingAmount: i, estimatedCost: o, gasDropOff: c, expiryTime: u } = r;
1578
+ if (await Fn(n.network) <= i)
1336
1579
  return {
1337
1580
  success: !1,
1338
1581
  error: new Error("Insufficient allowance for fast transfer")
1339
1582
  };
1340
- const d = await An(a.network, a.chain, r.chain), m = (i * d + 10000n - 1n) / 10000n, l = i - m;
1341
- if (l <= 0n)
1583
+ const d = await Sn(n.network, n.chain, a.chain), m = (i * d + 10000n - 1n) / 10000n, g = i - m;
1584
+ if (g <= 0n)
1342
1585
  return {
1343
1586
  success: !1,
1344
1587
  error: new Error("Amount after fast transfer fee <= 0")
1345
1588
  };
1346
- const C = Xe[a.network]?.[a.chain], [x, y] = await Promise.all([
1347
- a.getDecimals("native"),
1348
- r.getDecimals("native")
1589
+ const p = dt[n.network]?.[n.chain], [C, E] = await Promise.all([
1590
+ n.getDecimals("native"),
1591
+ a.getDecimals("native")
1349
1592
  ]);
1350
1593
  return {
1351
1594
  success: !0,
@@ -1356,38 +1599,38 @@ class we extends at {
1356
1599
  },
1357
1600
  destinationToken: {
1358
1601
  token: e.destination.id,
1359
- amount: A(l, e.destination.decimals)
1602
+ amount: S(g, e.destination.decimals)
1360
1603
  },
1361
1604
  relayFee: {
1362
- token: ie(a.chain),
1363
- amount: A(o, x)
1605
+ token: fe(n.chain),
1606
+ amount: S(o, C)
1364
1607
  },
1365
- destinationNativeGas: A(c, y),
1366
- eta: C,
1608
+ destinationNativeGas: S(c, E),
1609
+ eta: p,
1367
1610
  expires: u,
1368
1611
  details: {
1369
- ...s,
1370
- minFinalityThreshold: L.CONFIRMED,
1612
+ ...r,
1613
+ minFinalityThreshold: Y.CONFIRMED,
1371
1614
  fastTransferMaxFee: m
1372
1615
  }
1373
1616
  };
1374
- } catch (s) {
1617
+ } catch (r) {
1375
1618
  return {
1376
1619
  success: !1,
1377
- error: new Error(s instanceof Error ? s.message : `${s}`)
1620
+ error: new Error(r instanceof Error ? r.message : `${r}`)
1378
1621
  };
1379
1622
  }
1380
1623
  }
1381
1624
  }
1382
- function jn(n = { referrerFeeDbps: 0n }) {
1383
- if (n.referrerFeeDbps < 0 || n.referrerFeeDbps > 65535n)
1625
+ function Kn(s = { referrerFeeDbps: 0n }) {
1626
+ if (s.referrerFeeDbps < 0 || s.referrerFeeDbps > 65535n)
1384
1627
  throw new Error("Referrer fee must be between 0 and 65535");
1385
- class e extends be {
1386
- static config = n;
1628
+ class e extends Fe {
1629
+ static config = s;
1387
1630
  }
1388
1631
  return e;
1389
1632
  }
1390
- class be extends at {
1633
+ class Fe extends Ct {
1391
1634
  // @ts-ignore
1392
1635
  // Since we set the config on the static class, access it with this param
1393
1636
  // the CCTPv2StandardExecutorRoute.config will always be empty
@@ -1398,15 +1641,15 @@ class be extends at {
1398
1641
  provider: "Circle CCTP"
1399
1642
  };
1400
1643
  static isPathSupported(e, t) {
1401
- return ne(e.network, e.chain) && ne(t.network, t.chain) && // We don't support slow transfers from Linea because the attestation time
1644
+ return oe(e.network, e.chain) && oe(t.network, t.chain) && // We don't support slow transfers from Linea because the attestation time
1402
1645
  // can be anywhere between 6 and 32 hours! Fast transfer should be used instead.
1403
1646
  e.chain !== "Linea";
1404
1647
  }
1405
- static async supportedDestinationTokens(e, t, a) {
1406
- return this.isPathSupported(t, a) ? Ce(e, t, a) : [];
1648
+ static async supportedDestinationTokens(e, t, n) {
1649
+ return this.isPathSupported(t, n) ? De(e, t, n) : [];
1407
1650
  }
1408
1651
  async validate(e, t) {
1409
- return be.isPathSupported(e.fromChain, e.toChain) ? t.options?.nativeGas && (t.options.nativeGas < 0 || t.options.nativeGas > 1) ? {
1652
+ return Fe.isPathSupported(e.fromChain, e.toChain) ? t.options?.nativeGas && (t.options.nativeGas < 0 || t.options.nativeGas > 1) ? {
1410
1653
  valid: !1,
1411
1654
  error: new Error("Invalid native gas percentage"),
1412
1655
  params: t
@@ -1423,11 +1666,11 @@ class be extends at {
1423
1666
  };
1424
1667
  }
1425
1668
  async quote(e, t) {
1426
- const { fromChain: a, toChain: r } = e;
1669
+ const { fromChain: n, toChain: a } = e;
1427
1670
  try {
1428
- const s = await pe(e, t, this.staticConfig, "ERC2"), { remainingAmount: i, estimatedCost: o, gasDropOff: c, expiryTime: u } = s, f = a.chain === "Polygon" ? 2e3 * 200 : je(a.chain) + 1e3, [d, m] = await Promise.all([
1429
- a.getDecimals("native"),
1430
- r.getDecimals("native")
1671
+ const r = await Se(e, t, this.staticConfig, "ERC2"), { remainingAmount: i, estimatedCost: o, gasDropOff: c, expiryTime: u } = r, f = n.chain === "Polygon" ? 2e3 * 200 : Xe(n.chain) + 1e3, [d, m] = await Promise.all([
1672
+ n.getDecimals("native"),
1673
+ a.getDecimals("native")
1431
1674
  ]);
1432
1675
  return {
1433
1676
  success: !0,
@@ -1438,34 +1681,34 @@ class be extends at {
1438
1681
  },
1439
1682
  destinationToken: {
1440
1683
  token: e.destination.id,
1441
- amount: A(i, e.destination.decimals)
1684
+ amount: S(i, e.destination.decimals)
1442
1685
  },
1443
1686
  relayFee: {
1444
- token: ie(a.chain),
1445
- amount: A(o, d)
1687
+ token: fe(n.chain),
1688
+ amount: S(o, d)
1446
1689
  },
1447
- destinationNativeGas: A(c, m),
1690
+ destinationNativeGas: S(c, m),
1448
1691
  eta: f,
1449
1692
  expires: u,
1450
1693
  details: {
1451
- ...s,
1452
- minFinalityThreshold: L.FINALIZED,
1694
+ ...r,
1695
+ minFinalityThreshold: Y.FINALIZED,
1453
1696
  fastTransferMaxFee: 0n
1454
1697
  // no fee for standard / slow transfer
1455
1698
  }
1456
1699
  };
1457
- } catch (s) {
1700
+ } catch (r) {
1458
1701
  return {
1459
1702
  success: !1,
1460
- error: new Error(s instanceof Error ? s.message : `${s}`)
1703
+ error: new Error(r instanceof Error ? r.message : `${r}`)
1461
1704
  };
1462
1705
  }
1463
1706
  }
1464
1707
  }
1465
- const { executorTokenBridgeRoute: qn } = Gt;
1708
+ const { executorTokenBridgeRoute: Yn } = Kt;
1466
1709
  export {
1467
- Qn as cctpExecutorRoute,
1468
- Wn as cctpV2FastExecutorRoute,
1469
- jn as cctpV2StandardExecutorRoute,
1470
- qn as executorTokenBridgeRoute
1710
+ Zn as cctpExecutorRoute,
1711
+ Hn as cctpV2FastExecutorRoute,
1712
+ Kn as cctpV2StandardExecutorRoute,
1713
+ Yn as executorTokenBridgeRoute
1471
1714
  };