@wormhole-foundation/wormhole-connect 4.1.0-beta.1-development → 4.2.0-beta.0-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 (350) hide show
  1. package/dist/assets/{aptos-C9pj8h2Q.js → aptos-DgUCX7ng.js} +3 -3
  2. package/dist/assets/{evm-DCydYqBI.js → evm-B6bqAPTR.js} +4 -4
  3. package/dist/assets/{evm-CJXv6IQV.js → evm-Ve5nG8Fs.js} +1 -1
  4. package/dist/assets/{index-LvDsy6wR.js → index-BJokXZAc.js} +1 -1
  5. package/dist/assets/{index-BqxX-Ey7.js → index-BJv9sngo.js} +1 -1
  6. package/dist/assets/{index-C9cy4cDs.js → index-BjZMFLjq.js} +1 -1
  7. package/dist/assets/{index-FJ-n91Op.js → index-BwbPlAQZ.js} +1 -1
  8. package/dist/assets/{index-Clu5I99l.js → index-Bzg4DNh9.js} +1 -1
  9. package/dist/assets/{index-ezhfpCvx.js → index-CKXa657f.js} +1 -1
  10. package/dist/assets/index-CXiuP738.js +1 -0
  11. package/dist/assets/{index-CNExx9Zb.js → index-CvTvoHH-.js} +1 -1
  12. package/dist/assets/{index-C25bHdOM.js → index-D1ULRVbZ.js} +1 -1
  13. package/dist/assets/{index-DpabQJOX.js → index-DlH9IMQl.js} +1 -1
  14. package/dist/assets/{index-C8u74RER.js → index-Dsb-5apv.js} +1 -1
  15. package/dist/assets/{index-D9ApKauA.js → index-_YFUWLUM.js} +1 -1
  16. package/dist/assets/{index-CoIvdDsX.js → index-jg26xdEi.js} +1 -1
  17. package/dist/assets/{provider-jsonrpc-DuMpLBV0.js → provider-jsonrpc-DNgUKjG6.js} +1 -1
  18. package/dist/assets/{solana-DWuIx6gK.js → solana-D4RepnSA.js} +2 -2
  19. package/dist/assets/{sui-BcTGBE_4.js → sui-Du5h-f8S.js} +3 -3
  20. package/dist/main.mjs +185 -140
  21. package/dist/src/components/ConfigurablePageHeader.d.ts +1 -1
  22. package/dist/src/components/ConfigurablePageHeader.d.ts.map +1 -1
  23. package/dist/src/components/Header.d.ts +1 -0
  24. package/dist/src/components/Header.d.ts.map +1 -1
  25. package/dist/src/components/PageHeader.d.ts +1 -3
  26. package/dist/src/components/PageHeader.d.ts.map +1 -1
  27. package/dist/src/components/SampleApp/index.d.ts.map +1 -1
  28. package/dist/src/components/v3/BackButton.d.ts +6 -0
  29. package/dist/src/components/v3/BackButton.d.ts.map +1 -0
  30. package/dist/src/components/v3/FormContent.d.ts +5 -0
  31. package/dist/src/components/v3/FormContent.d.ts.map +1 -0
  32. package/dist/src/config/constants.d.ts.map +1 -1
  33. package/dist/src/config/events.d.ts +2 -1
  34. package/dist/src/config/events.d.ts.map +1 -1
  35. package/dist/src/config/mainnet/chains.d.ts.map +1 -1
  36. package/dist/src/config/mainnet/rpcs.d.ts.map +1 -1
  37. package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
  38. package/dist/src/config/mainnet/wrappedTokens.d.ts +6 -0
  39. package/dist/src/config/mainnet/wrappedTokens.d.ts.map +1 -1
  40. package/dist/src/config/types.d.ts +6 -11
  41. package/dist/src/config/types.d.ts.map +1 -1
  42. package/dist/src/config/ui.d.ts +9 -0
  43. package/dist/src/config/ui.d.ts.map +1 -1
  44. package/dist/src/consts/wallet.d.ts.map +1 -1
  45. package/dist/src/hooks/useAutoEnableGasDropoff.d.ts +3 -1
  46. package/dist/src/hooks/useAutoEnableGasDropoff.d.ts.map +1 -1
  47. package/dist/src/hooks/useConnectToLastUsedWallet.d.ts.map +1 -1
  48. package/dist/src/hooks/useSortedRoutesWithQuotes.d.ts.map +1 -1
  49. package/dist/src/hooks/useTransactionHistory.d.ts.map +1 -1
  50. package/dist/src/hooks/useTransactionHistoryLiFi.d.ts +2 -0
  51. package/dist/src/hooks/useTransactionHistoryLiFi.d.ts.map +1 -1
  52. package/dist/src/hooks/useTransactionHistoryMayan.d.ts +2 -0
  53. package/dist/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
  54. package/dist/src/hooks/useTransactionHistoryWHScan.d.ts +2 -1
  55. package/dist/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
  56. package/dist/src/icons/PoweredBy.d.ts.map +1 -1
  57. package/dist/src/icons/TokenIcons.d.ts.map +1 -1
  58. package/dist/src/icons/Tokens/AUSD.d.ts +4 -0
  59. package/dist/src/icons/Tokens/AUSD.d.ts.map +1 -0
  60. package/dist/src/routes/lifi/LiFiRoute.d.ts.map +1 -1
  61. package/dist/src/routes/mayan/utils.d.ts.map +1 -1
  62. package/dist/src/routes/monad/consts.d.ts +1 -0
  63. package/dist/src/routes/monad/consts.d.ts.map +1 -1
  64. package/dist/src/routes/monad/monad.test.d.ts +1 -0
  65. package/dist/src/routes/monad/monad.test.d.ts.map +1 -0
  66. package/dist/src/routes/monad/utils.d.ts.map +1 -1
  67. package/dist/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
  68. package/dist/src/telemetry/types.d.ts +4 -2
  69. package/dist/src/telemetry/types.d.ts.map +1 -1
  70. package/dist/src/theme.d.ts +4 -3
  71. package/dist/src/theme.d.ts.map +1 -1
  72. package/dist/src/utils/errors.d.ts.map +1 -1
  73. package/dist/src/utils/fees.d.ts.map +1 -1
  74. package/dist/src/utils/index.d.ts.map +1 -1
  75. package/dist/src/utils/sdkv2.d.ts.map +1 -1
  76. package/dist/src/utils/wallet/index.d.ts +1 -0
  77. package/dist/src/utils/wallet/index.d.ts.map +1 -1
  78. package/dist/src/views/Terms.d.ts.map +1 -1
  79. package/dist/src/views/TxSearch.d.ts.map +1 -1
  80. package/dist/src/views/v3/Bridge/AssetPicker/PickerModal.d.ts.map +1 -1
  81. package/dist/src/views/v3/Bridge/AssetPicker/TokenPickerButton.d.ts +17 -0
  82. package/dist/src/views/v3/Bridge/AssetPicker/TokenPickerButton.d.ts.map +1 -0
  83. package/dist/src/views/v3/Bridge/AssetPicker/TokenPickerButtonContent.d.ts +8 -0
  84. package/dist/src/views/v3/Bridge/AssetPicker/TokenPickerButtonContent.d.ts.map +1 -0
  85. package/dist/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButton.test.d.ts +2 -0
  86. package/dist/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButton.test.d.ts.map +1 -0
  87. package/dist/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButtonContent.test.d.ts +2 -0
  88. package/dist/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButtonContent.test.d.ts.map +1 -0
  89. package/dist/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -1
  90. package/dist/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -1
  91. package/dist/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  92. package/dist/src/views/v3/Bridge/Routes/index.d.ts +2 -1
  93. package/dist/src/views/v3/Bridge/Routes/index.d.ts.map +1 -1
  94. package/dist/src/views/v3/Bridge/WalletConnector/Controller.d.ts.map +1 -1
  95. package/dist/src/views/v3/Bridge/WalletConnector/ExplorerLink.d.ts.map +1 -1
  96. package/dist/src/views/v3/Bridge/WalletConnector/WalletAddress.d.ts +9 -0
  97. package/dist/src/views/v3/Bridge/WalletConnector/WalletAddress.d.ts.map +1 -0
  98. package/dist/src/views/v3/Bridge/WalletConnector/WalletPickerContent.d.ts.map +1 -1
  99. package/dist/src/views/v3/Bridge/WalletConnector/__tests__/WalletAddress.test.d.ts +2 -0
  100. package/dist/src/views/v3/Bridge/WalletConnector/__tests__/WalletAddress.test.d.ts.map +1 -0
  101. package/dist/src/views/v3/Bridge/index.d.ts.map +1 -1
  102. package/dist/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -1
  103. package/dist/src/views/v3/Redeem/index.d.ts.map +1 -1
  104. package/dist/src/views/v3/TxHistory/Item/index.d.ts.map +1 -1
  105. package/dist/src/views/v3/TxHistory/Widget/Item.d.ts.map +1 -1
  106. package/lib/{account-cIQhxn1E.js → account-K005OXgL.js} +1 -1
  107. package/lib/{account-BVl6Reot.mjs → account-TXlxMyv4.mjs} +2 -2
  108. package/lib/{address-rVHWlcKQ.mjs → address-CX0E32ut.mjs} +1 -1
  109. package/lib/{address-W9jn6Qdk.js → address-DqbIfKOu.js} +1 -1
  110. package/lib/{aptos-B84P9rJZ.mjs → aptos-B1Gf2eCD.mjs} +5 -5
  111. package/lib/{aptos-CNHYHK9c.js → aptos-CnswqE-C.js} +2 -2
  112. package/lib/{aptos-D1WFzBMy.mjs → aptos-DRfXJ8Ba.mjs} +7 -7
  113. package/lib/{aptos-DWDR5o78.js → aptos-DcdKyekw.js} +1 -1
  114. package/lib/{associatedTokenAccount-C4vEEbG5.js → associatedTokenAccount-CeqdaO2m.js} +1 -1
  115. package/lib/{associatedTokenAccount-DF6phO3l.mjs → associatedTokenAccount-Dsm4Hq32.mjs} +3 -3
  116. package/lib/{basic-DJXXfABO.js → basic-BS7Z1PMG.js} +1 -1
  117. package/lib/{basic-NhXxxbR1.js → basic-C6VXQ7m-.js} +1 -1
  118. package/lib/{basic-CukRIaOD.mjs → basic-CFbslwLM.mjs} +3 -3
  119. package/lib/{basic-BERCwt2M.mjs → basic-DnhL0oWa.mjs} +3 -3
  120. package/lib/{chunk-KJH4KKG6-Brt4fyqz.mjs → chunk-KJH4KKG6-BfVMUPsB.mjs} +3 -3
  121. package/lib/{chunk-KJH4KKG6-BbF5W1_N.js → chunk-KJH4KKG6-CJx-rDa6.js} +1 -1
  122. package/lib/constants-BCFTvlgh.js +1 -0
  123. package/lib/{constants-VaoVbllu.mjs → constants-CTJ_-E0d.mjs} +2 -1
  124. package/lib/{core-BCZrVb_s.mjs → core-DT6TBPQP.mjs} +6 -6
  125. package/lib/{core-BE6SS7Ye.js → core-RRp0K__1.js} +3 -3
  126. package/lib/{create-CChLkbGc.mjs → create-C5dhTMHL.mjs} +1 -1
  127. package/lib/{create-4w0DrcRO.js → create-bA3Gyivs.js} +1 -1
  128. package/lib/{evm--K7mr7Kr.js → evm-BwCfQIyJ.js} +2 -2
  129. package/lib/{evm-DKaWm7eC.mjs → evm-BxF9XPn4.mjs} +7 -7
  130. package/lib/{evm-C5BixKBn.js → evm-C3B8jHD7.js} +1 -1
  131. package/lib/{evm-CmmnpcFD.mjs → evm-DlOCiplA.mjs} +5 -5
  132. package/lib/executor.js +1 -1
  133. package/lib/executor.mjs +13 -15
  134. package/lib/hosted.js +1 -1
  135. package/lib/hosted.mjs +1 -1
  136. package/lib/hypercore-DbqOAqKF.js +4 -0
  137. package/lib/{hypercore-birmbh9T.mjs → hypercore-H7pw_pN4.mjs} +4858 -3107
  138. package/lib/{index-qL4D-cpk.js → index-1T4sIL8n.js} +1 -1
  139. package/lib/{index-Ap7250Gf.mjs → index-39tU5Y5t.mjs} +6 -6
  140. package/lib/{index-D7gCsil9.js → index-6m7yero0.js} +1 -1
  141. package/lib/{index-C5I7QiZ7.mjs → index-B6Ppg6EZ.mjs} +3 -3
  142. package/lib/{index-xvG6cxNx.js → index-BEIFBxtP.js} +1 -1
  143. package/lib/{index-zIzzPp6D.mjs → index-BHpJUZne.mjs} +3 -3
  144. package/lib/{index-BTcij9Np.js → index-BJ0xVutl.js} +1 -1
  145. package/lib/{index-Bs28m4ya.js → index-BNpkgexR.js} +1 -1
  146. package/lib/{index-C61IKE_V.mjs → index-BSIPYyeZ.mjs} +2 -2
  147. package/lib/{index-EbSw7SbC.js → index-BTjUHY0e.js} +1 -1
  148. package/lib/{index-BuHdMHLz.mjs → index-Ba1zbu3Q.mjs} +2 -2
  149. package/lib/{index-HrZv1SyT.js → index-BbE02hdW.js} +8 -8
  150. package/lib/{index-BU35GfG0.mjs → index-Bdtj4LUz.mjs} +2 -2
  151. package/lib/{index-pYTU7pQK.mjs → index-BmP0jPVN.mjs} +12 -11
  152. package/lib/{index-CR1itkLl.mjs → index-BnKf2rOm.mjs} +3225 -3035
  153. package/lib/{index-Txz5xwr6.mjs → index-BtU67kjy.mjs} +1 -1
  154. package/lib/{index-CH0iw38J.mjs → index-BuEKhdrW.mjs} +3 -3
  155. package/lib/{index-CN7M4gwf.mjs → index-BviSNDV7.mjs} +5 -5
  156. package/lib/{index-Cys9e11O.js → index-C-SMuVS3.js} +1 -1
  157. package/lib/{index-Cg1Xo1eZ.js → index-C85u3Gj5.js} +1 -1
  158. package/lib/{index-BN_2mA2n.mjs → index-CGqJokTg.mjs} +1 -1
  159. package/lib/{index-Da9rvmCc.js → index-Cb0UWLGI.js} +1 -1
  160. package/lib/{index-DHnmtpvA.mjs → index-CcbY14s5.mjs} +4 -4
  161. package/lib/{index-BKgliEPZ.mjs → index-CrWTw0Se.mjs} +2 -2
  162. package/lib/{index-C8YhpD9T.mjs → index-CsLyPoC6.mjs} +4 -4
  163. package/lib/{index-B_JJ50Y-.mjs → index-D-HUNEka.mjs} +4 -4
  164. package/lib/index-DAJZN12d.js +1 -0
  165. package/lib/{index-BhMcIAHt.js → index-DJ2w1fz1.js} +1 -1
  166. package/lib/{index-BRFbmsc_.js → index-DVm_f5E1.js} +1 -1
  167. package/lib/{index-CO4ZoIAU.mjs → index-DjmVBSGQ.mjs} +4 -4
  168. package/lib/{index-Co3mm7UN.mjs → index-DrJE8udd.mjs} +1 -1
  169. package/lib/{index-fTUcaKb4.js → index-DuhYwr0t.js} +1 -1
  170. package/lib/{index-BQ0lWQfT.mjs → index-DwEx1Hn-.mjs} +2 -2
  171. package/lib/{index-DBofyYkS.js → index-DziujHu1.js} +1 -1
  172. package/lib/{index-Dou5sFku.js → index-JWbF-m3e.js} +1 -1
  173. package/lib/{index-N4FkpEh9.mjs → index-NAUBlFLG.mjs} +4 -4
  174. package/lib/{index-D1odbjeH.mjs → index-VnJcNK62.mjs} +3 -3
  175. package/lib/{index-DVxmRy4C.js → index-WrXSs0ic.js} +1 -1
  176. package/lib/{index-CsdD1TNi.js → index-aMKUba1k.js} +1 -1
  177. package/lib/{index-DSnylejH.mjs → index-dufPAW5T.mjs} +292 -269
  178. package/lib/{index-lZY5fTXF.js → index-lAqXlt-a.js} +1 -1
  179. package/lib/{index-BUbUhbMe.js → index-mikg85u5.js} +1 -1
  180. package/lib/{index-BScgBddV.mjs → index-o1SAPXm_.mjs} +3 -3
  181. package/lib/{index-CED5jdrg.js → index-pn6NZmOS.js} +1 -1
  182. package/lib/{index-DNZ-Pkpm.mjs → index-rxQSA9t0.mjs} +6 -6
  183. package/lib/{index-Cw0jWBks.js → index-t_koRpGi.js} +1 -1
  184. package/lib/{index-DALvn9lg.js → index-v7w8krM0.js} +1 -1
  185. package/lib/{index-japympio.js → index-wadjmD_G.js} +1 -1
  186. package/lib/{index.es-CDqFguL5.mjs → index.es-3KAM8l3G.mjs} +4 -4
  187. package/lib/{index.es-DmmqAOLD.js → index.es-B3FwsRfN.js} +3 -3
  188. package/lib/{index.es-B0fk_42a.mjs → index.es-CYyuSfPG.mjs} +4 -4
  189. package/lib/{index.es-Dg6IFrL4.js → index.es-ClIr5Gv-.js} +1 -1
  190. package/lib/index.js +78 -33
  191. package/lib/index.mjs +9157 -8833
  192. package/lib/{keypair-DWucLGoA.js → keypair-DCgXFOw5.js} +1 -1
  193. package/lib/{keypair-CP7syX9B.mjs → keypair-vpG2fl-q.mjs} +3 -3
  194. package/lib/lifi.js +1 -1
  195. package/lib/lifi.mjs +75 -76
  196. package/lib/mayan.js +2 -2
  197. package/lib/mayan.mjs +11 -10
  198. package/lib/{mint-CoNdQTGM.mjs → mint-BPrKG-Zc.mjs} +3 -3
  199. package/lib/{mint-CxQ6P5lT.js → mint-DW-XgF68.js} +1 -1
  200. package/lib/monad.js +1 -1
  201. package/lib/monad.mjs +91 -58
  202. package/lib/multiToken-B9BoSxdr.js +1 -0
  203. package/lib/{multiToken-Bm-K5dRJ.mjs → multiToken-DMllgxzT.mjs} +4 -3
  204. package/lib/ntt.js +2 -2
  205. package/lib/ntt.mjs +77 -86
  206. package/lib/{platform-Cil_UtAQ.mjs → platform-CSpAb386.mjs} +2788 -2748
  207. package/lib/{platform-BMKYxqvv.js → platform-Csj1Outc.js} +1 -1
  208. package/lib/platform-DCcL7jHP.js +11 -0
  209. package/lib/{platform-vRQufc6j.mjs → platform-YzJZdSCf.mjs} +3 -3
  210. package/lib/{secp256k1-CglUNI04.js → secp256k1-B2G0zB-5.js} +1 -1
  211. package/lib/{secp256k1-LTcmQEQ5.mjs → secp256k1-BZFiBDHQ.mjs} +1 -1
  212. package/lib/{secp256k1-CcVQkYNr.js → secp256k1-Bz-QjKBU.js} +1 -1
  213. package/lib/{secp256k1-DROP2Lhv.mjs → secp256k1-Cteng3v9.mjs} +1 -1
  214. package/lib/{secp256k1-BkoM1Jum.js → secp256k1-CxjctkO3.js} +1 -1
  215. package/lib/{secp256k1-DzRCmd6a.mjs → secp256k1-D3i7kc2M.mjs} +1 -1
  216. package/lib/{signer-0hWrZ5BZ.mjs → signer-D2GRgRrw.mjs} +2 -2
  217. package/lib/{signer-DyqulDUM.js → signer-gjSiV5v3.js} +1 -1
  218. package/lib/{solana-C4k_Yg7w.js → solana-BE2DAanS.js} +4 -4
  219. package/lib/{solana-D1LVIhGd.mjs → solana-Df231Yni.mjs} +10 -10
  220. package/lib/solana-DfW5T_64.mjs +18 -0
  221. package/lib/solana-Edd9tIkX.js +1 -0
  222. package/lib/{solanaEmbed.esm-AvWQUA9e.mjs → solanaEmbed.esm-B9WG-Afi.mjs} +4 -4
  223. package/lib/{solanaEmbed.esm--Ac-IlRA.js → solanaEmbed.esm-BqcrHrhl.js} +1 -1
  224. package/lib/{solidity-CbDkqHjE.js → solidity-BW7c8rFv.js} +1 -1
  225. package/lib/{solidity-Dk_mvceo.mjs → solidity-D9gSgFcp.mjs} +1 -1
  226. package/lib/src/components/ConfigurablePageHeader.d.ts +1 -1
  227. package/lib/src/components/ConfigurablePageHeader.d.ts.map +1 -1
  228. package/lib/src/components/Header.d.ts +1 -0
  229. package/lib/src/components/Header.d.ts.map +1 -1
  230. package/lib/src/components/PageHeader.d.ts +1 -3
  231. package/lib/src/components/PageHeader.d.ts.map +1 -1
  232. package/lib/src/components/SampleApp/index.d.ts.map +1 -1
  233. package/lib/src/components/v3/BackButton.d.ts +6 -0
  234. package/lib/src/components/v3/BackButton.d.ts.map +1 -0
  235. package/lib/src/components/v3/FormContent.d.ts +5 -0
  236. package/lib/src/components/v3/FormContent.d.ts.map +1 -0
  237. package/lib/src/config/constants.d.ts.map +1 -1
  238. package/lib/src/config/events.d.ts +2 -1
  239. package/lib/src/config/events.d.ts.map +1 -1
  240. package/lib/src/config/mainnet/chains.d.ts.map +1 -1
  241. package/lib/src/config/mainnet/rpcs.d.ts.map +1 -1
  242. package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
  243. package/lib/src/config/mainnet/wrappedTokens.d.ts +6 -0
  244. package/lib/src/config/mainnet/wrappedTokens.d.ts.map +1 -1
  245. package/lib/src/config/types.d.ts +6 -11
  246. package/lib/src/config/types.d.ts.map +1 -1
  247. package/lib/src/config/ui.d.ts +9 -0
  248. package/lib/src/config/ui.d.ts.map +1 -1
  249. package/lib/src/consts/wallet.d.ts.map +1 -1
  250. package/lib/src/hooks/useAutoEnableGasDropoff.d.ts +3 -1
  251. package/lib/src/hooks/useAutoEnableGasDropoff.d.ts.map +1 -1
  252. package/lib/src/hooks/useConnectToLastUsedWallet.d.ts.map +1 -1
  253. package/lib/src/hooks/useSortedRoutesWithQuotes.d.ts.map +1 -1
  254. package/lib/src/hooks/useTransactionHistory.d.ts.map +1 -1
  255. package/lib/src/hooks/useTransactionHistoryLiFi.d.ts +2 -0
  256. package/lib/src/hooks/useTransactionHistoryLiFi.d.ts.map +1 -1
  257. package/lib/src/hooks/useTransactionHistoryMayan.d.ts +2 -0
  258. package/lib/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
  259. package/lib/src/hooks/useTransactionHistoryWHScan.d.ts +2 -1
  260. package/lib/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
  261. package/lib/src/icons/PoweredBy.d.ts.map +1 -1
  262. package/lib/src/icons/TokenIcons.d.ts.map +1 -1
  263. package/lib/src/icons/Tokens/AUSD.d.ts +4 -0
  264. package/lib/src/icons/Tokens/AUSD.d.ts.map +1 -0
  265. package/lib/src/routes/lifi/LiFiRoute.d.ts.map +1 -1
  266. package/lib/src/routes/mayan/utils.d.ts.map +1 -1
  267. package/lib/src/routes/monad/consts.d.ts +1 -0
  268. package/lib/src/routes/monad/consts.d.ts.map +1 -1
  269. package/lib/src/routes/monad/monad.test.d.ts +1 -0
  270. package/lib/src/routes/monad/monad.test.d.ts.map +1 -0
  271. package/lib/src/routes/monad/utils.d.ts.map +1 -1
  272. package/lib/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
  273. package/lib/src/telemetry/types.d.ts +4 -2
  274. package/lib/src/telemetry/types.d.ts.map +1 -1
  275. package/lib/src/theme.d.ts +4 -3
  276. package/lib/src/theme.d.ts.map +1 -1
  277. package/lib/src/utils/errors.d.ts.map +1 -1
  278. package/lib/src/utils/fees.d.ts.map +1 -1
  279. package/lib/src/utils/index.d.ts.map +1 -1
  280. package/lib/src/utils/sdkv2.d.ts.map +1 -1
  281. package/lib/src/utils/wallet/index.d.ts +1 -0
  282. package/lib/src/utils/wallet/index.d.ts.map +1 -1
  283. package/lib/src/views/Terms.d.ts.map +1 -1
  284. package/lib/src/views/TxSearch.d.ts.map +1 -1
  285. package/lib/src/views/v3/Bridge/AssetPicker/PickerModal.d.ts.map +1 -1
  286. package/lib/src/views/v3/Bridge/AssetPicker/TokenPickerButton.d.ts +17 -0
  287. package/lib/src/views/v3/Bridge/AssetPicker/TokenPickerButton.d.ts.map +1 -0
  288. package/lib/src/views/v3/Bridge/AssetPicker/TokenPickerButtonContent.d.ts +8 -0
  289. package/lib/src/views/v3/Bridge/AssetPicker/TokenPickerButtonContent.d.ts.map +1 -0
  290. package/lib/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButton.test.d.ts +2 -0
  291. package/lib/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButton.test.d.ts.map +1 -0
  292. package/lib/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButtonContent.test.d.ts +2 -0
  293. package/lib/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButtonContent.test.d.ts.map +1 -0
  294. package/lib/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -1
  295. package/lib/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -1
  296. package/lib/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  297. package/lib/src/views/v3/Bridge/Routes/index.d.ts +2 -1
  298. package/lib/src/views/v3/Bridge/Routes/index.d.ts.map +1 -1
  299. package/lib/src/views/v3/Bridge/WalletConnector/Controller.d.ts.map +1 -1
  300. package/lib/src/views/v3/Bridge/WalletConnector/ExplorerLink.d.ts.map +1 -1
  301. package/lib/src/views/v3/Bridge/WalletConnector/WalletAddress.d.ts +9 -0
  302. package/lib/src/views/v3/Bridge/WalletConnector/WalletAddress.d.ts.map +1 -0
  303. package/lib/src/views/v3/Bridge/WalletConnector/WalletPickerContent.d.ts.map +1 -1
  304. package/lib/src/views/v3/Bridge/WalletConnector/__tests__/WalletAddress.test.d.ts +2 -0
  305. package/lib/src/views/v3/Bridge/WalletConnector/__tests__/WalletAddress.test.d.ts.map +1 -0
  306. package/lib/src/views/v3/Bridge/index.d.ts.map +1 -1
  307. package/lib/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -1
  308. package/lib/src/views/v3/Redeem/index.d.ts.map +1 -1
  309. package/lib/src/views/v3/TxHistory/Item/index.d.ts.map +1 -1
  310. package/lib/src/views/v3/TxHistory/Widget/Item.d.ts.map +1 -1
  311. package/lib/{sui-BPAb7kcs.mjs → sui-B9tYcgyb.mjs} +4 -4
  312. package/lib/{sui-CgmDTkXK.js → sui-BVwNcgQT.js} +1 -1
  313. package/lib/{sui-LiXjD27c.js → sui-BtyZE8YC.js} +1 -1
  314. package/lib/{sui-cpCvd7RC.mjs → sui-QP4AZGNc.mjs} +6 -6
  315. package/lib/{tokenHelpers-DvWQs1tu.mjs → tokenHelpers-C53sepsl.mjs} +1 -1
  316. package/lib/{tokenHelpers-CbE0g9BP.js → tokenHelpers-DITWDel1.js} +1 -1
  317. package/lib/{tokens-BJDttoCp.mjs → tokens-CO0YQ3R2.mjs} +3 -3
  318. package/lib/{tokens-CvZuVW-g.js → tokens-CiSHS7oi.js} +1 -1
  319. package/lib/types-CgveSjsw.js +1 -0
  320. package/lib/{types-iFgwQ7vG.mjs → types-Dxx2g1wS.mjs} +170 -168
  321. package/lib/{unsignedTransaction-DCDxTFq8.mjs → unsignedTransaction-D2Ja0SuN.mjs} +2 -2
  322. package/lib/{unsignedTransaction-DA4tlY5u.js → unsignedTransaction-qRBv5Cnd.js} +2 -2
  323. package/lib/{utils-DMf7wRGI.js → utils-BEljbqMf.js} +1 -1
  324. package/lib/{utils-BSxsyW2c.mjs → utils-mBHX3Jpu.mjs} +4 -4
  325. package/lib/{w3m-modal-CtQ0TPA4.mjs → w3m-modal-5v-rsnN8.mjs} +2 -2
  326. package/lib/{w3m-modal-k23UDiov.js → w3m-modal-B0Lu-6W8.js} +1 -1
  327. package/lib/{w3m-modal-ByamyZny.js → w3m-modal-B2xHxAWg.js} +1 -1
  328. package/lib/{w3m-modal-DM5Pf8SH.mjs → w3m-modal-SlcSCSnx.mjs} +2 -2
  329. package/lib/{wallet-CMTEE6Oa.mjs → wallet-Cyosy4Hc.mjs} +1 -1
  330. package/lib/{wallet-BMli0fbu.js → wallet-a0_jwP8j.js} +1 -1
  331. package/lib/{web3-CUwFm9Lx.mjs → web3-CdErAVj5.mjs} +2 -2
  332. package/lib/{web3-DdUeM7iQ.js → web3-x1WCGDiy.js} +1 -1
  333. package/package.json +49 -47
  334. package/dist/assets/index-_UMHESh0.js +0 -1
  335. package/dist/src/components/Button.d.ts +0 -13
  336. package/dist/src/components/Button.d.ts.map +0 -1
  337. package/dist/src/icons/Down.d.ts +0 -5
  338. package/dist/src/icons/Down.d.ts.map +0 -1
  339. package/lib/constants-B9TBfA4z.js +0 -1
  340. package/lib/hypercore-4R7JGmbr.js +0 -4
  341. package/lib/index-C8eqQ_7p.js +0 -1
  342. package/lib/multiToken-YoNvxjur.js +0 -1
  343. package/lib/platform-CCG_jgOO.js +0 -11
  344. package/lib/solana-DKFJvqX8.mjs +0 -18
  345. package/lib/solana-Dmje_Si8.js +0 -1
  346. package/lib/src/components/Button.d.ts +0 -13
  347. package/lib/src/components/Button.d.ts.map +0 -1
  348. package/lib/src/icons/Down.d.ts +0 -5
  349. package/lib/src/icons/Down.d.ts.map +0 -1
  350. package/lib/types-CjNs2oB0.js +0 -1
@@ -1 +1 @@
1
- "use strict";const n=require("./platform-CCG_jgOO.js"),T=require("./address-W9jn6Qdk.js");async function p(m,t,e,a=120*1e3,o=console.log){const i=Date.now();o("Checking transfer state...");for await(t of m.track(t,120*1e3))o("Current Transfer State: ",n.TransferState[t.state]);if(n.isCompleted(t))return t;if(n.isManual(m)&&n.isAttested(t)&&e){o("Completing transfer...");const c=await m.complete(e,t);o("Completed transfer with txids: ",c)}if(n.isFinalizable(m)&&n.isRedeemed(t)&&e){o("Finalizing transfer...");const c=await m.finalize(e,t);o("Finalized transfer with txids: ",c)}const r=a-(Date.now()-i);return r>0?(o("Transfer not complete, trying again in a 2000ms..."),await new Promise(s=>setTimeout(s,2e3)),p(m,t,e,r)):t}function E(m={}){class t extends k{static config=m}return t}class k extends n.AutomaticRoute{static IS_EXECUTOR_ROUTE=!0;static NATIVE_GAS_DROPOFF_SUPPORTED=!0;staticConfig=this.constructor.config;static config={};static meta={name:"TokenBridgeExecutorRoute"};static supportedNetworks(){return["Mainnet","Testnet"]}static supportedChains(t){return t==="Devnet"?[]:n.executorTokenBridgeChains(t)}static async supportedDestinationTokens(t,e,a){try{return[await n.TokenTransfer.lookupDestinationToken(e,a,t)]}catch{return[]}}getDefaultOptions(){return{nativeGas:0}}async validate(t,e){if(t.fromChain.chain===t.toChain.chain)return{valid:!1,params:e,error:new Error("Source and destination chains cannot be the same")};const a=n.parse(e.amount,t.source.decimals),o=e.options??this.getDefaultOptions();if(o.nativeGas&&(o.nativeGas>1||o.nativeGas<0))throw new Error("Native gas must be between 0.0 and 1.0 (0% and 100%)");return{valid:!0,params:{amount:e.amount,normalizedParams:{amount:a},options:o}}}async quote(t,e){const a=k.supportedChains(t.fromChain.network);if(!a.includes(t.fromChain.chain)||!a.includes(t.toChain.chain))return{success:!1,error:new Error(`Executor Token Bridge does not support transfers from ${t.fromChain.chain} to ${t.toChain.chain}`)};try{let o;const i=await t.toChain.getExecutorTokenBridge();let{gasLimit:r,msgValue:c}=await i.estimateMsgValueAndGasLimit(t.destination.id,t.recipient);if(this.staticConfig.referrerFee?.referrerFeeDbps!==void 0&&(o=this.staticConfig.referrerFee.referrerFeeDbps),this.staticConfig.referrerFee?.tokenFeeOverrides){const l=n.canonicalAddress(t.source.id),h=this.staticConfig.referrerFee.tokenFeeOverrides[this.wh.network]?.[t.fromChain.chain]?.[l];h!==void 0&&(o=h)}if(this.staticConfig.tokenOverrides){const l=n.canonicalAddress(t.destination.id),h=this.staticConfig.tokenOverrides[this.wh.network]?.[t.destination.id.chain]?.[l];h?.gasLimit!==void 0&&(r=h.gasLimit)}let s;if(o!==void 0&&o>0n){const l=this.staticConfig.referrerFee?.referrerAddresses?.[this.wh.network]?.[t.fromChain.chain];if(!l)throw new Error(`No referrer address configured for network ${this.wh.network} and chain ${t.fromChain.chain}`);s=n.Wormhole.chainAddress(t.fromChain.chain,l)}const d=o!==void 0&&s!==void 0?{feeDbps:o,referrer:s}:void 0;let u;if(e.options.nativeGas!==void 0){const l=await n.TokenTransfer.getExecutorGasDropOffLimit(this.wh,t.toChain);u=l>0n?BigInt(Math.round(e.options.nativeGas*100))*l/100n:0n}const f=await n.TokenTransfer.quoteTransfer(this.wh,t.fromChain,t.toChain,{token:t.source.id,amount:n.units(e.normalizedParams.amount),protocol:"ExecutorTokenBridge",nativeGas:u,msgValue:c,gasLimit:r,referrerFee:d});return t.displayQuote(f,e,f.details)}catch(o){return{success:!1,error:o}}}async initiate(t,e,a,o){const{fromChain:i,toChain:r}=t,{params:c}=a,s=await n.TokenTransfer.destinationOverrides(i,r,this.toTransferDetails(t,c,n.Wormhole.chainAddress(e.chain(),e.address()),o,a)),d=await n.TokenTransfer.transfer(i,s,e);let u=0;return(async()=>{for(;u<20;){try{const[l]=await this.wh.getExecutorTxStatus(d.at(-1).txid,i.chain);if(l)break}catch{}u++,await new Promise(l=>setTimeout(l,2e3))}})(),{from:s.from.chain,to:s.to.chain,state:n.TransferState.SourceInitiated,originTxs:d}}async complete(t,e){if(!n.isAttested(e)&&!n.isFailed(e))throw new Error("The source must be finalized in order to complete the transfer");if(!e.attestation)throw new Error("The receipt must have an attestation to complete the transfer");const a=this.wh.getChain(e.to),o=await a.getExecutorTokenBridge(),i=n.toNative(t.chain(),t.address()),r=o.redeem(i,e.attestation.attestation),c=await n.signSendWait(a,r,t);return{...e,state:n.TransferState.DestinationInitiated,attestation:e.attestation,destinationTxs:c}}async resume(t){const e=await n.TokenTransfer.from(this.wh,t,1e4);if(e.transfer.protocol!=="ExecutorTokenBridge")throw new Error("Can only resume ExecutorTokenBridge transfers");return n.TokenTransfer.getReceipt(e)}async*track(t,e){for await(const a of n.TokenTransfer.track(this.wh,t,e))yield a}toTransferDetails(t,e,a,o,i){if(!i.details)throw new Error("Missing quote details");return{from:a,to:o,token:t.source.id,amount:n.units(e.normalizedParams.amount),protocol:"ExecutorTokenBridge",executorQuote:i.details.executorQuote,referrerFee:i.details.referrerFee}}}const C=15n,P=100n,w=10000n;class g extends n.AutomaticRoute{static NATIVE_GAS_DROPOFF_SUPPORTED=!1;static meta={name:"AutomaticPortico"};static supportedNetworks(){return["Mainnet"]}static supportedChains(t){return n.porticoContractChains.has(t)?n.porticoContractChains.get(t):[]}static async supportedDestinationTokens(t,e,a){const[,o]=n.resolveWrappedToken(e.network,e.chain,t),i=n.canonicalAddress(o),r=await e.getPorticoBridge();if(!r.supportedTokens().some(f=>n.canonicalAddress(f.token)===i))return[];try{const f=await r.getTransferrableToken(i);await n.TokenTransfer.lookupDestinationToken(e,a,f)}catch{return[]}const s=(await a.getPorticoBridge()).supportedTokens(),{tokenMap:d}=a.config,u=r.getTokenGroup(i);return s.filter(f=>(f.group===u||f.group==="ETH"&&u==="WETH"||f.group==="WETH"&&u==="ETH")&&(!d||n.filters.byAddress(d,n.canonicalAddress(f.token)))).map(f=>f.token)}getDefaultOptions(){return{}}async validate(t,e){try{if(t.fromChain.chain===t.toChain.chain)return{valid:!1,params:e,error:new Error("Source and destination chains cannot be the same")};if(!g.supportedChains(t.fromChain.network).includes(t.fromChain.chain)||!g.supportedChains(t.toChain.network).includes(t.toChain.chain))throw new Error("Protocol not supported");const{fromChain:a,toChain:o,source:i,destination:r}=t,{network:c}=a,[,s]=n.resolveWrappedToken(c,a.chain,i.id),[,d]=n.resolveWrappedToken(c,o.chain,r.id),u=await a.getPorticoBridge(),f=await o.getPorticoBridge(),l=await u.getTransferrableToken(n.canonicalAddress(s)),h=await f.getTransferrableToken(n.canonicalAddress(d));return{valid:!0,params:{amount:e.amount,options:e.options??this.getDefaultOptions(),normalizedParams:{amount:t.parseAmount(e.amount),canonicalSourceToken:l,canonicalDestinationToken:h,sourceToken:s,destinationToken:d}}}}catch(a){return{valid:!1,error:a,params:e}}}async quote(t,e){try{const a=await this.fetchSwapQuote(t,e),o=Math.max(t.source.decimals,t.destination.decimals),i=n.units(n.scale(e.normalizedParams.amount,o));if(n.units(n.scale(n.fromBaseUnits(a.minAmountFinish,t.destination.decimals),o))<i-i*P/w)throw new Error("Slippage too high");const s=await(await t.toChain.getPorticoBridge()).quoteRelay(e.normalizedParams.canonicalDestinationToken.address,e.normalizedParams.destinationToken.address),d={swapAmounts:a,relayerFee:s},u=d.swapAmounts.minAmountFinish-s;return u<0n?{success:!1,error:new Error(`Amount too low for slippage and fee, would result in negative destination amount (${u})`)}:await t.displayQuote({sourceToken:{token:e.normalizedParams.sourceToken,amount:n.units(e.normalizedParams.amount)},destinationToken:{token:e.normalizedParams.destinationToken,amount:d.swapAmounts.minAmountFinish-s},relayFee:{token:e.normalizedParams.destinationToken,amount:s},eta:n.estimateFinalityTime(t.fromChain.chain),expires:n.expiration(0,5,0)},e,d)}catch(a){return{success:!1,error:a}}}async initiate(t,e,a,o){const{params:i,details:r}=a,c=t.source.id.address,s=t.destination.id,d=await t.fromChain.getPorticoBridge(),u=d.getTokenGroup(c.toString()),l=(await t.toChain.getPorticoBridge()).getPorticoAddress(u),h=d.transfer(n.Wormhole.parseAddress(e.chain(),e.address()),o,c,n.units(i.normalizedParams.amount),s,l,r);return{originTxs:await n.signSendWait(t.fromChain,h,e),state:n.TransferState.SourceInitiated,from:t.fromChain.chain,to:t.toChain.chain}}async*track(t,e){if(n.isSourceInitiated(t)||n.isSourceFinalized(t)){const{txid:a}=t.originTxs[t.originTxs.length-1],o=await this.wh.getVaa(a,"PorticoBridge:Transfer",e);if(!o)throw new Error("No VAA found for transaction: "+a);const i={chain:o.emitterChain,emitter:o.emitterAddress,sequence:o.sequence};t={...t,state:n.TransferState.Attested,attestation:{id:i,attestation:o}},yield t}n.isAttested(t)&&await(await this.wh.getChain(t.to).getPorticoBridge()).isTransferCompleted(t.attestation.attestation)&&(t={...t,state:n.TransferState.DestinationFinalized},yield t),yield t}async complete(t,e){if(!n.isAttested(e))throw new Error("Source must be attested");const a=await this.wh.getChain(e.to),o=await a.getPorticoBridge(),i=n.Wormhole.chainAddress(t.chain(),t.address()),r=o.redeem(i.address,e.attestation.attestation);return await n.signSendWait(a,r,t)}async fetchSwapQuote(t,e){const a=await t.fromChain.getPorticoBridge(),o=n.units(e.normalizedParams.amount),i=a.getTokenGroup(n.canonicalAddress(e.normalizedParams.sourceToken)),r=await a.quoteSwap(e.normalizedParams.sourceToken.address,e.normalizedParams.canonicalSourceToken.address,i,o),c=r*C/w;if(c>=r)throw new Error("Start slippage too high");const s=await t.toChain.getPorticoBridge(),d=r-c,u=await s.quoteSwap(e.normalizedParams.canonicalDestinationToken.address,e.normalizedParams.destinationToken.address,i,d),f=u*C/w;if(f>=u)throw new Error("Finish slippage too high");const l=u-f;return{minAmountStart:d,minAmountFinish:l}}}const x=Object.freeze(Object.defineProperty({__proto__:null,AutomaticCCTPRoute:T.AutomaticCCTPRoute,AutomaticPorticoRoute:g,AutomaticRoute:n.AutomaticRoute,AutomaticTokenBridgeRoute:T.AutomaticTokenBridgeRoute,BPS_PER_HUNDRED_PERCENT:w,CCTPRoute:T.CCTPRoute,ExecutorTokenBridgeRoute:k,FinalizableRoute:n.FinalizableRoute,MAX_SLIPPAGE_BPS:P,ManualRoute:n.ManualRoute,MinAmountError:n.MinAmountError,RelayFailedError:n.RelayFailedError,Route:n.Route,RouteResolver:n.RouteResolver,RouteTransferRequest:T.RouteTransferRequest,SLIPPAGE_BPS:C,TBTCRoute:T.TBTCRoute,TokenBridgeRoute:T.TokenBridgeRoute,UnavailableError:n.UnavailableError,checkAndCompleteTransfer:p,executorTokenBridgeRoute:E,isAutomatic:n.isAutomatic,isFinalizable:n.isFinalizable,isManual:n.isManual},Symbol.toStringTag,{value:"Module"}));exports.routes=x;
1
+ "use strict";const n=require("./platform-DCcL7jHP.js"),T=require("./address-DqbIfKOu.js");async function p(m,t,e,a=120*1e3,o=console.log){const i=Date.now();o("Checking transfer state...");for await(t of m.track(t,120*1e3))o("Current Transfer State: ",n.TransferState[t.state]);if(n.isCompleted(t))return t;if(n.isManual(m)&&n.isAttested(t)&&e){o("Completing transfer...");const c=await m.complete(e,t);o("Completed transfer with txids: ",c)}if(n.isFinalizable(m)&&n.isRedeemed(t)&&e){o("Finalizing transfer...");const c=await m.finalize(e,t);o("Finalized transfer with txids: ",c)}const r=a-(Date.now()-i);return r>0?(o("Transfer not complete, trying again in a 2000ms..."),await new Promise(s=>setTimeout(s,2e3)),p(m,t,e,r)):t}function E(m={}){class t extends k{static config=m}return t}class k extends n.AutomaticRoute{static IS_EXECUTOR_ROUTE=!0;static NATIVE_GAS_DROPOFF_SUPPORTED=!0;staticConfig=this.constructor.config;static config={};static meta={name:"TokenBridgeExecutorRoute"};static supportedNetworks(){return["Mainnet","Testnet"]}static supportedChains(t){return t==="Devnet"?[]:n.executorTokenBridgeChains(t)}static async supportedDestinationTokens(t,e,a){try{return[await n.TokenTransfer.lookupDestinationToken(e,a,t)]}catch{return[]}}getDefaultOptions(){return{nativeGas:0}}async validate(t,e){if(t.fromChain.chain===t.toChain.chain)return{valid:!1,params:e,error:new Error("Source and destination chains cannot be the same")};const a=n.parse(e.amount,t.source.decimals),o=e.options??this.getDefaultOptions();if(o.nativeGas&&(o.nativeGas>1||o.nativeGas<0))throw new Error("Native gas must be between 0.0 and 1.0 (0% and 100%)");return{valid:!0,params:{amount:e.amount,normalizedParams:{amount:a},options:o}}}async quote(t,e){const a=k.supportedChains(t.fromChain.network);if(!a.includes(t.fromChain.chain)||!a.includes(t.toChain.chain))return{success:!1,error:new Error(`Executor Token Bridge does not support transfers from ${t.fromChain.chain} to ${t.toChain.chain}`)};try{let o;const i=await t.toChain.getExecutorTokenBridge();let{gasLimit:r,msgValue:c}=await i.estimateMsgValueAndGasLimit(t.destination.id,t.recipient);if(this.staticConfig.referrerFee?.referrerFeeDbps!==void 0&&(o=this.staticConfig.referrerFee.referrerFeeDbps),this.staticConfig.referrerFee?.tokenFeeOverrides){const l=n.canonicalAddress(t.source.id),h=this.staticConfig.referrerFee.tokenFeeOverrides[this.wh.network]?.[t.fromChain.chain]?.[l];h!==void 0&&(o=h)}if(this.staticConfig.tokenOverrides){const l=n.canonicalAddress(t.destination.id),h=this.staticConfig.tokenOverrides[this.wh.network]?.[t.destination.id.chain]?.[l];h?.gasLimit!==void 0&&(r=h.gasLimit)}let s;if(o!==void 0&&o>0n){const l=this.staticConfig.referrerFee?.referrerAddresses?.[this.wh.network]?.[t.fromChain.chain];if(!l)throw new Error(`No referrer address configured for network ${this.wh.network} and chain ${t.fromChain.chain}`);s=n.Wormhole.chainAddress(t.fromChain.chain,l)}const d=o!==void 0&&s!==void 0?{feeDbps:o,referrer:s}:void 0;let u;if(e.options.nativeGas!==void 0){const l=await n.TokenTransfer.getExecutorGasDropOffLimit(this.wh,t.toChain);u=l>0n?BigInt(Math.round(e.options.nativeGas*100))*l/100n:0n}const f=await n.TokenTransfer.quoteTransfer(this.wh,t.fromChain,t.toChain,{token:t.source.id,amount:n.units(e.normalizedParams.amount),protocol:"ExecutorTokenBridge",nativeGas:u,msgValue:c,gasLimit:r,referrerFee:d});return t.displayQuote(f,e,f.details)}catch(o){return{success:!1,error:o}}}async initiate(t,e,a,o){const{fromChain:i,toChain:r}=t,{params:c}=a,s=await n.TokenTransfer.destinationOverrides(i,r,this.toTransferDetails(t,c,n.Wormhole.chainAddress(e.chain(),e.address()),o,a)),d=await n.TokenTransfer.transfer(i,s,e);let u=0;return(async()=>{for(;u<20;){try{const[l]=await this.wh.getExecutorTxStatus(d.at(-1).txid,i.chain);if(l)break}catch{}u++,await new Promise(l=>setTimeout(l,2e3))}})(),{from:s.from.chain,to:s.to.chain,state:n.TransferState.SourceInitiated,originTxs:d}}async complete(t,e){if(!n.isAttested(e)&&!n.isFailed(e))throw new Error("The source must be finalized in order to complete the transfer");if(!e.attestation)throw new Error("The receipt must have an attestation to complete the transfer");const a=this.wh.getChain(e.to),o=await a.getExecutorTokenBridge(),i=n.toNative(t.chain(),t.address()),r=o.redeem(i,e.attestation.attestation),c=await n.signSendWait(a,r,t);return{...e,state:n.TransferState.DestinationInitiated,attestation:e.attestation,destinationTxs:c}}async resume(t){const e=await n.TokenTransfer.from(this.wh,t,1e4);if(e.transfer.protocol!=="ExecutorTokenBridge")throw new Error("Can only resume ExecutorTokenBridge transfers");return n.TokenTransfer.getReceipt(e)}async*track(t,e){for await(const a of n.TokenTransfer.track(this.wh,t,e))yield a}toTransferDetails(t,e,a,o,i){if(!i.details)throw new Error("Missing quote details");return{from:a,to:o,token:t.source.id,amount:n.units(e.normalizedParams.amount),protocol:"ExecutorTokenBridge",executorQuote:i.details.executorQuote,referrerFee:i.details.referrerFee}}}const C=15n,P=100n,w=10000n;class g extends n.AutomaticRoute{static NATIVE_GAS_DROPOFF_SUPPORTED=!1;static meta={name:"AutomaticPortico"};static supportedNetworks(){return["Mainnet"]}static supportedChains(t){return n.porticoContractChains.has(t)?n.porticoContractChains.get(t):[]}static async supportedDestinationTokens(t,e,a){const[,o]=n.resolveWrappedToken(e.network,e.chain,t),i=n.canonicalAddress(o),r=await e.getPorticoBridge();if(!r.supportedTokens().some(f=>n.canonicalAddress(f.token)===i))return[];try{const f=await r.getTransferrableToken(i);await n.TokenTransfer.lookupDestinationToken(e,a,f)}catch{return[]}const s=(await a.getPorticoBridge()).supportedTokens(),{tokenMap:d}=a.config,u=r.getTokenGroup(i);return s.filter(f=>(f.group===u||f.group==="ETH"&&u==="WETH"||f.group==="WETH"&&u==="ETH")&&(!d||n.filters.byAddress(d,n.canonicalAddress(f.token)))).map(f=>f.token)}getDefaultOptions(){return{}}async validate(t,e){try{if(t.fromChain.chain===t.toChain.chain)return{valid:!1,params:e,error:new Error("Source and destination chains cannot be the same")};if(!g.supportedChains(t.fromChain.network).includes(t.fromChain.chain)||!g.supportedChains(t.toChain.network).includes(t.toChain.chain))throw new Error("Protocol not supported");const{fromChain:a,toChain:o,source:i,destination:r}=t,{network:c}=a,[,s]=n.resolveWrappedToken(c,a.chain,i.id),[,d]=n.resolveWrappedToken(c,o.chain,r.id),u=await a.getPorticoBridge(),f=await o.getPorticoBridge(),l=await u.getTransferrableToken(n.canonicalAddress(s)),h=await f.getTransferrableToken(n.canonicalAddress(d));return{valid:!0,params:{amount:e.amount,options:e.options??this.getDefaultOptions(),normalizedParams:{amount:t.parseAmount(e.amount),canonicalSourceToken:l,canonicalDestinationToken:h,sourceToken:s,destinationToken:d}}}}catch(a){return{valid:!1,error:a,params:e}}}async quote(t,e){try{const a=await this.fetchSwapQuote(t,e),o=Math.max(t.source.decimals,t.destination.decimals),i=n.units(n.scale(e.normalizedParams.amount,o));if(n.units(n.scale(n.fromBaseUnits(a.minAmountFinish,t.destination.decimals),o))<i-i*P/w)throw new Error("Slippage too high");const s=await(await t.toChain.getPorticoBridge()).quoteRelay(e.normalizedParams.canonicalDestinationToken.address,e.normalizedParams.destinationToken.address),d={swapAmounts:a,relayerFee:s},u=d.swapAmounts.minAmountFinish-s;return u<0n?{success:!1,error:new Error(`Amount too low for slippage and fee, would result in negative destination amount (${u})`)}:await t.displayQuote({sourceToken:{token:e.normalizedParams.sourceToken,amount:n.units(e.normalizedParams.amount)},destinationToken:{token:e.normalizedParams.destinationToken,amount:d.swapAmounts.minAmountFinish-s},relayFee:{token:e.normalizedParams.destinationToken,amount:s},eta:n.estimateFinalityTime(t.fromChain.chain),expires:n.expiration(0,5,0)},e,d)}catch(a){return{success:!1,error:a}}}async initiate(t,e,a,o){const{params:i,details:r}=a,c=t.source.id.address,s=t.destination.id,d=await t.fromChain.getPorticoBridge(),u=d.getTokenGroup(c.toString()),l=(await t.toChain.getPorticoBridge()).getPorticoAddress(u),h=d.transfer(n.Wormhole.parseAddress(e.chain(),e.address()),o,c,n.units(i.normalizedParams.amount),s,l,r);return{originTxs:await n.signSendWait(t.fromChain,h,e),state:n.TransferState.SourceInitiated,from:t.fromChain.chain,to:t.toChain.chain}}async*track(t,e){if(n.isSourceInitiated(t)||n.isSourceFinalized(t)){const{txid:a}=t.originTxs[t.originTxs.length-1],o=await this.wh.getVaa(a,"PorticoBridge:Transfer",e);if(!o)throw new Error("No VAA found for transaction: "+a);const i={chain:o.emitterChain,emitter:o.emitterAddress,sequence:o.sequence};t={...t,state:n.TransferState.Attested,attestation:{id:i,attestation:o}},yield t}n.isAttested(t)&&await(await this.wh.getChain(t.to).getPorticoBridge()).isTransferCompleted(t.attestation.attestation)&&(t={...t,state:n.TransferState.DestinationFinalized},yield t),yield t}async complete(t,e){if(!n.isAttested(e))throw new Error("Source must be attested");const a=await this.wh.getChain(e.to),o=await a.getPorticoBridge(),i=n.Wormhole.chainAddress(t.chain(),t.address()),r=o.redeem(i.address,e.attestation.attestation);return await n.signSendWait(a,r,t)}async fetchSwapQuote(t,e){const a=await t.fromChain.getPorticoBridge(),o=n.units(e.normalizedParams.amount),i=a.getTokenGroup(n.canonicalAddress(e.normalizedParams.sourceToken)),r=await a.quoteSwap(e.normalizedParams.sourceToken.address,e.normalizedParams.canonicalSourceToken.address,i,o),c=r*C/w;if(c>=r)throw new Error("Start slippage too high");const s=await t.toChain.getPorticoBridge(),d=r-c,u=await s.quoteSwap(e.normalizedParams.canonicalDestinationToken.address,e.normalizedParams.destinationToken.address,i,d),f=u*C/w;if(f>=u)throw new Error("Finish slippage too high");const l=u-f;return{minAmountStart:d,minAmountFinish:l}}}const x=Object.freeze(Object.defineProperty({__proto__:null,AutomaticCCTPRoute:T.AutomaticCCTPRoute,AutomaticPorticoRoute:g,AutomaticRoute:n.AutomaticRoute,AutomaticTokenBridgeRoute:T.AutomaticTokenBridgeRoute,BPS_PER_HUNDRED_PERCENT:w,CCTPRoute:T.CCTPRoute,ExecutorTokenBridgeRoute:k,FinalizableRoute:n.FinalizableRoute,MAX_SLIPPAGE_BPS:P,ManualRoute:n.ManualRoute,MinAmountError:n.MinAmountError,RelayFailedError:n.RelayFailedError,Route:n.Route,RouteResolver:n.RouteResolver,RouteTransferRequest:T.RouteTransferRequest,SLIPPAGE_BPS:C,TBTCRoute:T.TBTCRoute,TokenBridgeRoute:T.TokenBridgeRoute,UnavailableError:n.UnavailableError,checkAndCompleteTransfer:p,executorTokenBridgeRoute:E,isAutomatic:n.isAutomatic,isFinalizable:n.isFinalizable,isManual:n.isManual},Symbol.toStringTag,{value:"Module"}));exports.routes=x;
@@ -1,4 +1,4 @@
1
- "use strict";const c=require("./lit-element-Cpy16KIW.js"),s=require("./class-map-BMhmY7P2.js"),d=require("./core-BE6SS7Ye.js"),p={getSpacingStyles(t,e){if(Array.isArray(t))return t[e]?`var(--wui-spacing-${t[e]})`:void 0;if(typeof t=="string")return`var(--wui-spacing-${t})`},getFormattedDate(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(t)},getHostName(t){try{return new URL(t).hostname}catch{return""}},getTruncateString({string:t,charsStart:e,charsEnd:r,truncate:o}){return t.length<=e+r?t:o==="end"?`${t.substring(0,e)}...`:o==="start"?`...${t.substring(t.length-r)}`:`${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(r))}`},generateAvatarColors(t){const r=t.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),o=this.hexToRgb(r),n=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),a=100-3*Number(n?.replace("px","")),l=`${a}% ${a}% at 65% 40%`,v=[];for(let m=0;m<5;m+=1){const C=this.tintColor(o,.15*m);v.push(`rgb(${C[0]}, ${C[1]}, ${C[2]})`)}return`
1
+ "use strict";const c=require("./lit-element-Cpy16KIW.js"),s=require("./class-map-BMhmY7P2.js"),d=require("./core-RRp0K__1.js"),p={getSpacingStyles(t,e){if(Array.isArray(t))return t[e]?`var(--wui-spacing-${t[e]})`:void 0;if(typeof t=="string")return`var(--wui-spacing-${t})`},getFormattedDate(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(t)},getHostName(t){try{return new URL(t).hostname}catch{return""}},getTruncateString({string:t,charsStart:e,charsEnd:r,truncate:o}){return t.length<=e+r?t:o==="end"?`${t.substring(0,e)}...`:o==="start"?`...${t.substring(t.length-r)}`:`${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(r))}`},generateAvatarColors(t){const r=t.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),o=this.hexToRgb(r),n=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),a=100-3*Number(n?.replace("px","")),l=`${a}% ${a}% at 65% 40%`,v=[];for(let m=0;m<5;m+=1){const C=this.tintColor(o,.15*m);v.push(`rgb(${C[0]}, ${C[1]}, ${C[2]})`)}return`
2
2
  --local-color-1: ${v[0]};
3
3
  --local-color-2: ${v[1]};
4
4
  --local-color-3: ${v[2]};
@@ -1,7 +1,7 @@
1
- import { av as f, aw as c, P as o, L as t } from "./unsignedTransaction-DCDxTFq8.mjs";
2
- import { ax as x } from "./unsignedTransaction-DCDxTFq8.mjs";
3
- import "./platform-Cil_UtAQ.mjs";
4
- import { p as s, u as p, b as O } from "./web3-CUwFm9Lx.mjs";
1
+ import { av as f, aw as c, P as o, L as t } from "./unsignedTransaction-D2Ja0SuN.mjs";
2
+ import { ax as x } from "./unsignedTransaction-D2Ja0SuN.mjs";
3
+ import "./platform-CSpAb386.mjs";
4
+ import { p as s, u as p, b as O } from "./web3-CdErAVj5.mjs";
5
5
  class d extends Error {
6
6
  constructor(r) {
7
7
  super(r);
@@ -1,4 +1,4 @@
1
- import { cV as L, d9 as g, da as T, bK as k, db as h, cX as F, bI as K, bx as P } from "./platform-Cil_UtAQ.mjs";
1
+ import { cV as L, d9 as g, da as T, bK as k, db as h, cX as F, bI as K, bx as P } from "./platform-CSpAb386.mjs";
2
2
  function R(n, t, e, s) {
3
3
  g(n);
4
4
  const i = T({ dkLen: 32, asyncTick: 10 }, s), { c: u, dkLen: c, asyncTick: o } = i;
@@ -1 +1 @@
1
- "use strict";const t=require("./platform-CCG_jgOO.js");function b(n,e,o,s){t.ahash(n);const a=t.checkOpts$1({dkLen:32,asyncTick:10},s),{c:d,dkLen:i,asyncTick:r}=a;if(t.anumber(d),t.anumber(i),t.anumber(r),d<1)throw new Error("iterations (c) should be >= 1");const f=t.kdfInputToBytes(e),u=t.kdfInputToBytes(o),l=new Uint8Array(i),p=t.hmac.create(n,f),c=p._cloneInto().update(u);return{c:d,dkLen:i,asyncTick:r,DK:l,PRF:p,PRFSalt:c}}function T(n,e,o,s,a){return n.destroy(),e.destroy(),s&&s.destroy(),t.clean(a),o}function L(n,e,o,s){const{c:a,dkLen:d,DK:i,PRF:r,PRFSalt:f}=b(n,e,o,s);let u;const l=new Uint8Array(4),p=t.createView(l),c=new Uint8Array(r.outputLen);for(let w=1,m=0;m<d;w++,m+=r.outputLen){const y=i.subarray(m,m+r.outputLen);p.setInt32(0,w,!1),(u=f._cloneInto(u)).update(l).digestInto(c),y.set(c.subarray(0,y.length));for(let h=1;h<a;h++){r._cloneInto(u).update(c).digestInto(c);for(let k=0;k<y.length;k++)y[k]^=c[k]}}return T(r,f,i,u,c)}/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */function I(n){if(typeof n!="string")throw new TypeError("invalid mnemonic type: "+typeof n);return n.normalize("NFKD")}function g(n){const e=I(n),o=e.split(" ");if(![12,15,18,21,24].includes(o.length))throw new Error("Invalid mnemonic");return{nfkd:e,words:o}}const S=n=>I("mnemonic"+n);function F(n,e=""){return L(t.sha512,g(n).nfkd,S(e),{c:2048,dkLen:64})}exports.mnemonicToSeedSync=F;
1
+ "use strict";const t=require("./platform-DCcL7jHP.js");function b(n,e,o,s){t.ahash(n);const a=t.checkOpts$1({dkLen:32,asyncTick:10},s),{c:d,dkLen:i,asyncTick:r}=a;if(t.anumber(d),t.anumber(i),t.anumber(r),d<1)throw new Error("iterations (c) should be >= 1");const f=t.kdfInputToBytes(e),u=t.kdfInputToBytes(o),l=new Uint8Array(i),p=t.hmac.create(n,f),c=p._cloneInto().update(u);return{c:d,dkLen:i,asyncTick:r,DK:l,PRF:p,PRFSalt:c}}function T(n,e,o,s,a){return n.destroy(),e.destroy(),s&&s.destroy(),t.clean(a),o}function L(n,e,o,s){const{c:a,dkLen:d,DK:i,PRF:r,PRFSalt:f}=b(n,e,o,s);let u;const l=new Uint8Array(4),p=t.createView(l),c=new Uint8Array(r.outputLen);for(let w=1,m=0;m<d;w++,m+=r.outputLen){const y=i.subarray(m,m+r.outputLen);p.setInt32(0,w,!1),(u=f._cloneInto(u)).update(l).digestInto(c),y.set(c.subarray(0,y.length));for(let h=1;h<a;h++){r._cloneInto(u).update(c).digestInto(c);for(let k=0;k<y.length;k++)y[k]^=c[k]}}return T(r,f,i,u,c)}/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */function I(n){if(typeof n!="string")throw new TypeError("invalid mnemonic type: "+typeof n);return n.normalize("NFKD")}function g(n){const e=I(n),o=e.split(" ");if(![12,15,18,21,24].includes(o.length))throw new Error("Invalid mnemonic");return{nfkd:e,words:o}}const S=n=>I("mnemonic"+n);function F(n,e=""){return L(t.sha512,g(n).nfkd,S(e),{c:2048,dkLen:64})}exports.mnemonicToSeedSync=F;
@@ -1,5 +1,5 @@
1
- import { e as T, q as O, A as b, v as C, B as S, Y as G, M as B, aS as _, aT as m, a as I, N as w, W as p, u as g, y as M, t as N, ag as x, aU as v, aV as E, aW as U, ad as F, f as L, aX as Q, ae as $, _ as V, $ as W, ac as H, aY as X, P as j, R as Y, aZ as Z, a_ as J, U as K, a$ as q } from "./platform-Cil_UtAQ.mjs";
2
- import { a as tt, b as et, C as nt, R as at, T as ot, c as it } from "./address-rVHWlcKQ.mjs";
1
+ import { e as T, q as O, A as b, v as C, B as S, Y as G, M as B, aS as _, aT as m, a as I, N as w, W as p, u as g, y as M, t as N, ag as x, aU as v, aV as E, aW as U, ad as F, f as L, aX as Q, ae as $, _ as V, $ as W, ac as H, aY as X, P as j, R as Y, aZ as Z, a_ as J, U as K, a$ as q } from "./platform-CSpAb386.mjs";
2
+ import { a as tt, b as et, C as nt, R as at, T as ot, c as it } from "./address-CX0E32ut.mjs";
3
3
  async function D(l, t, e, a = 120 * 1e3, n = console.log) {
4
4
  const o = Date.now();
5
5
  n("Checking transfer state...");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./chunk-KJH4KKG6-BbF5W1_N.js"),a=require("./platform-CCG_jgOO.js"),v=require("./platform-BMKYxqvv.js"),k=require("./unsignedTransaction-BXJ9Cpni.js"),M=[["Mainnet",{depositForBurn:"0xa11ceb0b0700000a0701000802080e031614042a04052e30075e870108e5014000000001000201030004000001050701000100060b0001070304010801020805060108010309080900010002010205060c030e05050208000b010108020108020105010b0101090003060c0b01010900030108000004060c08000e0501030e66756e6769626c655f6173736574066f626a656374167072696d6172795f66756e6769626c655f73746f72650f746f6b656e5f6d657373656e6765720d46756e6769626c654173736574064f626a656374084d6574616461746111616464726573735f746f5f6f626a656374087769746864726177106465706f7369745f666f725f6275726e00000000000000000000000000000000000000000000000000000000000000019bce6734f7b63e835108e3bd8c36743d4709fe435f44791918801d0989640a9d0000010f0b0438000c060a000b060b0138010c050b000b050b020b0311020102",handleReceiveMessage:"0xa11ceb0b0700000a0601000402040403080c051416072a53087d40000001010002000000030203000101040304000103060c0a020a020003060c060a02060a020108000101136d6573736167655f7472616e736d69747465720f746f6b656e5f6d657373656e67657207526563656970740f726563656976655f6d6573736167651668616e646c655f726563656976655f6d657373616765177e17751820e4b4371873ca8c30279be63bdea63b88ed0f2239c2eea10f17729bce6734f7b63e835108e3bd8c36743d4709fe435f44791918801d0989640a9d000001070b000e010e02110011010102"}],["Testnet",{depositForBurn:"0xa11ceb0b0700000a0701000802080e031614042a04052e30075e870108e5014000000001000201030004000001050701000100060b0001070304010801020805060108010309080900010002010205060c030e05050208000b010108020108020105010b0101090003060c0b01010900030108000004060c08000e0501030e66756e6769626c655f6173736574066f626a656374167072696d6172795f66756e6769626c655f73746f72650f746f6b656e5f6d657373656e6765720d46756e6769626c654173736574064f626a656374084d6574616461746111616464726573735f746f5f6f626a656374087769746864726177106465706f7369745f666f725f6275726e00000000000000000000000000000000000000000000000000000000000000015f9b937419dda90aa06c1836b7847f65bbbe3f1217567758dc2488be31a477b90000010f0b0438000c060a000b060b0138010c050b000b050b020b0311020102",handleReceiveMessage:"0xa11ceb0b0700000a0601000402040403080c051416072a53087d40000001010002000000030203000101040304000103060c0a020a020003060c060a02060a020108000101136d6573736167655f7472616e736d69747465720f746f6b656e5f6d657373656e67657207526563656970740f726563656976655f6d6573736167651668616e646c655f726563656976655f6d657373616765081e86cebf457a0c6004f35bd648a2794698f52e0dde09a48619dcd3d4cc23d95f9b937419dda90aa06c1836b7847f65bbbe3f1217567758dc2488be31a477b9000001070b000e010e02110011010102"}]],p=a.constMap(M,[0,1]);class b{network;chain;provider;contracts;usdcId;tokenMessengerId;messageTransmitterId;moveScripts;constructor(t,n,r,e){if(this.network=t,this.chain=n,this.provider=r,this.contracts=e,t==="Devnet")throw new Error("CircleBridge not supported on Devnet");const s=a.usdcContract.get(this.network,this.chain);if(!s)throw new Error(`No USDC contract configured for network=${this.network} chain=${this.chain}`);if(!e.cctp?.tokenMessenger)throw new Error(`Circle Token Messenger contract for domain ${n} not found`);if(!e.cctp?.messageTransmitter)throw new Error(`Circle Message Transmitter contract for domain ${n} not found`);if(!p.has(t))throw new Error("No Aptos CCTP move scripts found");this.usdcId=s,this.tokenMessengerId=e.cctp?.tokenMessenger,this.messageTransmitterId=e.cctp.messageTransmitter,this.moveScripts=p.get(t)}async*transfer(t,n,r){const e=new c.y(a.circleChainId.get(this.network,n.chain)),s=c.l.from(this.usdcId),i=c.l.from(n.address.toUniversalAddress().toUint8Array()),o=[new c.m$1(r),e,i,s],h={bytecode:this.moveScripts.depositForBurn,functionArguments:o};yield this.createUnsignedTx(h,"Aptos.CircleBridge.Transfer")}async isTransferCompleted(t){const n=new c.y(t.sourceDomain).bcsToBytes(),r=new c.m$1(t.nonce).bcsToBytes(),e=a.keccak_256(new Uint8Array([...n,45,...r])),s=a.hex.encode(e);return(await this.provider.view({payload:{function:`${this.messageTransmitterId}::message_transmitter::is_nonce_used`,functionArguments:[s]}}))[0]}async*redeem(t,n,r){const e=[c.t$1.U8(a.CircleBridge.serialize(n)),c.t$1.U8(a.hex.decode(r))],s={bytecode:this.moveScripts.handleReceiveMessage,functionArguments:e};yield this.createUnsignedTx(s,"Aptos.CircleBridge.Redeem")}async parseTransactionDetails(t){let e,s;for(let f=0;f<5;f++)try{const m=await this.provider.getTransactionByHash({transactionHash:t}),g=this.messageTransmitterId.replace(/^0x0+/,"0x");if(s=m.events?.find(u=>u.type===`${g}::message_transmitter::MessageSent`),s)break;e=new Error(`MessageSent event not found in transaction ${t}`),f<4&&await new Promise(u=>setTimeout(u,1e3))}catch(m){e=m,f<4&&await new Promise(g=>setTimeout(g,1e3))}if(!s)throw e||new Error("No MessageSent event found after 5 attempts");const i=a.hex.decode(s.data.message),[o,h]=a.CircleBridge.deserialize(i),{payload:d}=o,w=d.messageSender,T=d.mintRecipient,l=a.toCircleChain(this.network,o.sourceDomain),y=a.toCircleChain(this.network,o.destinationDomain),C={chain:l,address:d.burnToken};return{from:{chain:l,address:w},to:{chain:y,address:T},token:C,amount:d.amount,message:o,id:{hash:h}}}static async fromRpc(t,n){const[r,e]=await v.AptosPlatform.chainFromRpc(t),s=n[e];if(s.network!==r)throw new Error(`Network mismatch: ${s.network} != ${r}`);return new b(r,e,t,s.contracts)}createUnsignedTx(t,n,r=!1){return new k.AptosUnsignedTransaction(t,this.network,this.chain,n,r)}}a.registerProtocol("Aptos","CircleBridge",b);exports.AptosCircleBridge=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./chunk-KJH4KKG6-CJx-rDa6.js"),a=require("./platform-DCcL7jHP.js"),v=require("./platform-Csj1Outc.js"),k=require("./unsignedTransaction-BXJ9Cpni.js"),M=[["Mainnet",{depositForBurn:"0xa11ceb0b0700000a0701000802080e031614042a04052e30075e870108e5014000000001000201030004000001050701000100060b0001070304010801020805060108010309080900010002010205060c030e05050208000b010108020108020105010b0101090003060c0b01010900030108000004060c08000e0501030e66756e6769626c655f6173736574066f626a656374167072696d6172795f66756e6769626c655f73746f72650f746f6b656e5f6d657373656e6765720d46756e6769626c654173736574064f626a656374084d6574616461746111616464726573735f746f5f6f626a656374087769746864726177106465706f7369745f666f725f6275726e00000000000000000000000000000000000000000000000000000000000000019bce6734f7b63e835108e3bd8c36743d4709fe435f44791918801d0989640a9d0000010f0b0438000c060a000b060b0138010c050b000b050b020b0311020102",handleReceiveMessage:"0xa11ceb0b0700000a0601000402040403080c051416072a53087d40000001010002000000030203000101040304000103060c0a020a020003060c060a02060a020108000101136d6573736167655f7472616e736d69747465720f746f6b656e5f6d657373656e67657207526563656970740f726563656976655f6d6573736167651668616e646c655f726563656976655f6d657373616765177e17751820e4b4371873ca8c30279be63bdea63b88ed0f2239c2eea10f17729bce6734f7b63e835108e3bd8c36743d4709fe435f44791918801d0989640a9d000001070b000e010e02110011010102"}],["Testnet",{depositForBurn:"0xa11ceb0b0700000a0701000802080e031614042a04052e30075e870108e5014000000001000201030004000001050701000100060b0001070304010801020805060108010309080900010002010205060c030e05050208000b010108020108020105010b0101090003060c0b01010900030108000004060c08000e0501030e66756e6769626c655f6173736574066f626a656374167072696d6172795f66756e6769626c655f73746f72650f746f6b656e5f6d657373656e6765720d46756e6769626c654173736574064f626a656374084d6574616461746111616464726573735f746f5f6f626a656374087769746864726177106465706f7369745f666f725f6275726e00000000000000000000000000000000000000000000000000000000000000015f9b937419dda90aa06c1836b7847f65bbbe3f1217567758dc2488be31a477b90000010f0b0438000c060a000b060b0138010c050b000b050b020b0311020102",handleReceiveMessage:"0xa11ceb0b0700000a0601000402040403080c051416072a53087d40000001010002000000030203000101040304000103060c0a020a020003060c060a02060a020108000101136d6573736167655f7472616e736d69747465720f746f6b656e5f6d657373656e67657207526563656970740f726563656976655f6d6573736167651668616e646c655f726563656976655f6d657373616765081e86cebf457a0c6004f35bd648a2794698f52e0dde09a48619dcd3d4cc23d95f9b937419dda90aa06c1836b7847f65bbbe3f1217567758dc2488be31a477b9000001070b000e010e02110011010102"}]],p=a.constMap(M,[0,1]);class b{network;chain;provider;contracts;usdcId;tokenMessengerId;messageTransmitterId;moveScripts;constructor(t,n,r,e){if(this.network=t,this.chain=n,this.provider=r,this.contracts=e,t==="Devnet")throw new Error("CircleBridge not supported on Devnet");const s=a.usdcContract.get(this.network,this.chain);if(!s)throw new Error(`No USDC contract configured for network=${this.network} chain=${this.chain}`);if(!e.cctp?.tokenMessenger)throw new Error(`Circle Token Messenger contract for domain ${n} not found`);if(!e.cctp?.messageTransmitter)throw new Error(`Circle Message Transmitter contract for domain ${n} not found`);if(!p.has(t))throw new Error("No Aptos CCTP move scripts found");this.usdcId=s,this.tokenMessengerId=e.cctp?.tokenMessenger,this.messageTransmitterId=e.cctp.messageTransmitter,this.moveScripts=p.get(t)}async*transfer(t,n,r){const e=new c.y(a.circleChainId.get(this.network,n.chain)),s=c.l.from(this.usdcId),i=c.l.from(n.address.toUniversalAddress().toUint8Array()),o=[new c.m$1(r),e,i,s],h={bytecode:this.moveScripts.depositForBurn,functionArguments:o};yield this.createUnsignedTx(h,"Aptos.CircleBridge.Transfer")}async isTransferCompleted(t){const n=new c.y(t.sourceDomain).bcsToBytes(),r=new c.m$1(t.nonce).bcsToBytes(),e=a.keccak_256(new Uint8Array([...n,45,...r])),s=a.hex.encode(e);return(await this.provider.view({payload:{function:`${this.messageTransmitterId}::message_transmitter::is_nonce_used`,functionArguments:[s]}}))[0]}async*redeem(t,n,r){const e=[c.t$1.U8(a.CircleBridge.serialize(n)),c.t$1.U8(a.hex.decode(r))],s={bytecode:this.moveScripts.handleReceiveMessage,functionArguments:e};yield this.createUnsignedTx(s,"Aptos.CircleBridge.Redeem")}async parseTransactionDetails(t){let e,s;for(let f=0;f<5;f++)try{const m=await this.provider.getTransactionByHash({transactionHash:t}),g=this.messageTransmitterId.replace(/^0x0+/,"0x");if(s=m.events?.find(u=>u.type===`${g}::message_transmitter::MessageSent`),s)break;e=new Error(`MessageSent event not found in transaction ${t}`),f<4&&await new Promise(u=>setTimeout(u,1e3))}catch(m){e=m,f<4&&await new Promise(g=>setTimeout(g,1e3))}if(!s)throw e||new Error("No MessageSent event found after 5 attempts");const i=a.hex.decode(s.data.message),[o,h]=a.CircleBridge.deserialize(i),{payload:d}=o,w=d.messageSender,T=d.mintRecipient,l=a.toCircleChain(this.network,o.sourceDomain),y=a.toCircleChain(this.network,o.destinationDomain),C={chain:l,address:d.burnToken};return{from:{chain:l,address:w},to:{chain:y,address:T},token:C,amount:d.amount,message:o,id:{hash:h}}}static async fromRpc(t,n){const[r,e]=await v.AptosPlatform.chainFromRpc(t),s=n[e];if(s.network!==r)throw new Error(`Network mismatch: ${s.network} != ${r}`);return new b(r,e,t,s.contracts)}createUnsignedTx(t,n,r=!1){return new k.AptosUnsignedTransaction(t,this.network,this.chain,n,r)}}a.registerProtocol("Aptos","CircleBridge",b);exports.AptosCircleBridge=b;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./platform-CCG_jgOO.js"),i=require("./address-W9jn6Qdk.js"),p=require("./chunk-KJH4KKG6-BbF5W1_N.js"),y=require("./platform-BMKYxqvv.js"),g=require("./unsignedTransaction-BXJ9Cpni.js"),f=[{name:"tokenBridgeAddress",...r.universalAddressItem},{name:"chain",...r.chainItem()},{name:"domainSeparator",binary:"bytes",custom:r.bytes.encode(i.APTOS_SEPARATOR),omit:!0},{name:"tokenId",...r.universalAddressItem},{name:"domainSeparator",binary:"bytes",custom:new Uint8Array([255]),omit:!0}],w=l=>r.serialize(f,l);class d{network;chain;connection;contracts;chainId;tokenBridgeAddress;constructor(e,t,s,n){this.network=e,this.chain=t,this.connection=s,this.contracts=n,this.chainId=r.toChainId(t);const a=n.tokenBridge;if(!a)throw new Error(`TokenBridge contract Address for chain ${t} not found`);this.tokenBridgeAddress=a}static async fromRpc(e,t){const[s,n]=await y.AptosPlatform.chainFromRpc(e),a=t[n];if(a.network!==s)throw new Error("Network mismatch "+a.network+" !== "+s);return new d(s,n,e,a.contracts)}async isWrappedAsset(e){try{return await this.getOriginalAsset(e),!0}catch{return!1}}async getOriginalAsset(e){const t=e.toString().split(i.APTOS_SEPARATOR);let s=null;try{s=await this.connection.getAccountResource({accountAddress:t[0],resourceType:`${this.tokenBridgeAddress}::state::OriginInfo`})}catch(o){throw o instanceof p.T&&o.data?.error_code==="resource_not_found"?r.ErrNotWrapped(e.toString()):o}if(!s)throw r.ErrNotWrapped(e.toString());const n=r.toChain(parseInt(s.token_chain.number)),a=new r.UniversalAddress(s.token_address.external_address);return{chain:n,address:a}}async getTokenUniversalAddress(e){return new r.UniversalAddress(r.hex.encode(r.sha3_256(e.toString()),!0))}async getTokenNativeAddress(e,t){const s=e===this.chain?await this.getTypeFromExternalAddress(t.toString()):await this.getAssetFullyQualifiedType({chain:e,address:t});if(!s)throw new Error("Invalid asset address.");return new i.AptosAddress(s)}async hasWrappedAsset(e){try{return await this.getWrappedAsset(e),!0}catch{}return!1}async getWrappedAsset(e){if(r.isNative(e.address))throw new Error("native asset cannot be a wrapped asset");const t=await this.getAssetFullyQualifiedType(e);if(!t)throw new Error("Invalid asset address.");return await this.connection.getAccountResource({accountAddress:i.coalesceModuleAddress(t),resourceType:`${this.tokenBridgeAddress}::state::OriginInfo`}),r.toNative(this.chain,t)}async isTransferCompleted(e){const s=(await this.connection.getAccountResource({accountAddress:this.tokenBridgeAddress,resourceType:`${this.tokenBridgeAddress}::state::State`})).consumed_vaas.elems.handle;try{return await this.connection.getTableItem({handle:s,data:{key_type:"vector<u8>",value_type:"u8",key:`0x${r.Buffer.from(r.keccak_256(e.hash)).toString("hex")}`}}),!0}catch{return!1}}async getWrappedNative(){return r.toNative(this.chain,i.APTOS_COIN)}async*createAttestation(e,t){const s={chain:this.chain,address:new i.AptosAddress(e)},n=await this.getAssetFullyQualifiedType(s);if(!n)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::attest_token::attest_token_entry`,typeArguments:[n],functionArguments:[]},"Aptos.AttestToken")}async*submitAttestation(e,t){yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin_type`,typeArguments:[],functionArguments:[r.serialize$1(e)]},"Aptos.CreateWrappedCoinType");const s=await this.getAssetFullyQualifiedType(e.payload.token);if(!s)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin`,typeArguments:[s],functionArguments:[r.serialize$1(e)]},"Aptos.CreateWrappedCoin")}async*transfer(e,t,s,n,a){const o=0n,c=0n,h=r.isNative(s)?i.APTOS_COIN:s.toString(),u=t.address.toUniversalAddress().toUint8Array(),A=r.toChainId(t.chain);a?yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_with_payload_entry`,typeArguments:[h],functionArguments:[n,A,u,c,a]},"Aptos.TransferTokensWithPayload"):yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_entry`,typeArguments:[h],functionArguments:[n,A,u,o,c]},"Aptos.TransferTokens")}async*redeem(e,t,s=!0){const n=t.payload.token.chain===this.chain?await this.getTypeFromExternalAddress(t.payload.token.address.toString()):await this.getAssetFullyQualifiedType(t.payload.token);if(!n)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::complete_transfer::submit_vaa_and_register_entry`,typeArguments:[n],functionArguments:[r.serialize$1(t)]},"Aptos.CompleteTransfer")}async getAssetFullyQualifiedType(e){return e.chain===this.chain?i.isValidAptosType(e.address.toString())?e.address.toString():null:`${d.getForeignAssetAddress(this.chain,this.tokenBridgeAddress,e)}::coin::T`}async getTypeFromExternalAddress(e){try{const t=await this.connection.getAccountResource({accountAddress:this.tokenBridgeAddress,resourceType:`${this.tokenBridgeAddress}::state::State`}),{handle:s}=t.native_infos,n=await this.connection.getTableItem({handle:s,data:{key_type:`${this.tokenBridgeAddress}::token_hash::TokenHash`,value_type:"0x1::type_info::TypeInfo",key:{hash:e}}});return n?[n.account_address,String.fromCharCode(...r.hex.decode(n.module_name)),String.fromCharCode(...r.hex.decode(n.struct_name))].join(i.APTOS_SEPARATOR):null}catch{return null}}static getForeignAssetAddress(e,t,s){if(r.isNative(s.address))throw new Error("Invalid token address");const n=w({chain:s.chain,tokenBridgeAddress:new i.AptosAddress(t).toUniversalAddress(),tokenId:s.address.toUniversalAddress()});return r.hex.encode(r.sha3_256(n),!0)}createUnsignedTx(e,t,s=!1){return new g.AptosUnsignedTransaction(e,this.network,this.chain,t,s)}}r.registerProtocol("Aptos","TokenBridge",d);exports.AptosTokenBridge=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./platform-DCcL7jHP.js"),i=require("./address-DqbIfKOu.js"),p=require("./chunk-KJH4KKG6-CJx-rDa6.js"),y=require("./platform-Csj1Outc.js"),g=require("./unsignedTransaction-BXJ9Cpni.js"),f=[{name:"tokenBridgeAddress",...r.universalAddressItem},{name:"chain",...r.chainItem()},{name:"domainSeparator",binary:"bytes",custom:r.bytes.encode(i.APTOS_SEPARATOR),omit:!0},{name:"tokenId",...r.universalAddressItem},{name:"domainSeparator",binary:"bytes",custom:new Uint8Array([255]),omit:!0}],w=l=>r.serialize(f,l);class d{network;chain;connection;contracts;chainId;tokenBridgeAddress;constructor(e,t,s,n){this.network=e,this.chain=t,this.connection=s,this.contracts=n,this.chainId=r.toChainId(t);const a=n.tokenBridge;if(!a)throw new Error(`TokenBridge contract Address for chain ${t} not found`);this.tokenBridgeAddress=a}static async fromRpc(e,t){const[s,n]=await y.AptosPlatform.chainFromRpc(e),a=t[n];if(a.network!==s)throw new Error("Network mismatch "+a.network+" !== "+s);return new d(s,n,e,a.contracts)}async isWrappedAsset(e){try{return await this.getOriginalAsset(e),!0}catch{return!1}}async getOriginalAsset(e){const t=e.toString().split(i.APTOS_SEPARATOR);let s=null;try{s=await this.connection.getAccountResource({accountAddress:t[0],resourceType:`${this.tokenBridgeAddress}::state::OriginInfo`})}catch(o){throw o instanceof p.T&&o.data?.error_code==="resource_not_found"?r.ErrNotWrapped(e.toString()):o}if(!s)throw r.ErrNotWrapped(e.toString());const n=r.toChain(parseInt(s.token_chain.number)),a=new r.UniversalAddress(s.token_address.external_address);return{chain:n,address:a}}async getTokenUniversalAddress(e){return new r.UniversalAddress(r.hex.encode(r.sha3_256(e.toString()),!0))}async getTokenNativeAddress(e,t){const s=e===this.chain?await this.getTypeFromExternalAddress(t.toString()):await this.getAssetFullyQualifiedType({chain:e,address:t});if(!s)throw new Error("Invalid asset address.");return new i.AptosAddress(s)}async hasWrappedAsset(e){try{return await this.getWrappedAsset(e),!0}catch{}return!1}async getWrappedAsset(e){if(r.isNative(e.address))throw new Error("native asset cannot be a wrapped asset");const t=await this.getAssetFullyQualifiedType(e);if(!t)throw new Error("Invalid asset address.");return await this.connection.getAccountResource({accountAddress:i.coalesceModuleAddress(t),resourceType:`${this.tokenBridgeAddress}::state::OriginInfo`}),r.toNative(this.chain,t)}async isTransferCompleted(e){const s=(await this.connection.getAccountResource({accountAddress:this.tokenBridgeAddress,resourceType:`${this.tokenBridgeAddress}::state::State`})).consumed_vaas.elems.handle;try{return await this.connection.getTableItem({handle:s,data:{key_type:"vector<u8>",value_type:"u8",key:`0x${r.Buffer.from(r.keccak_256(e.hash)).toString("hex")}`}}),!0}catch{return!1}}async getWrappedNative(){return r.toNative(this.chain,i.APTOS_COIN)}async*createAttestation(e,t){const s={chain:this.chain,address:new i.AptosAddress(e)},n=await this.getAssetFullyQualifiedType(s);if(!n)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::attest_token::attest_token_entry`,typeArguments:[n],functionArguments:[]},"Aptos.AttestToken")}async*submitAttestation(e,t){yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin_type`,typeArguments:[],functionArguments:[r.serialize$1(e)]},"Aptos.CreateWrappedCoinType");const s=await this.getAssetFullyQualifiedType(e.payload.token);if(!s)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin`,typeArguments:[s],functionArguments:[r.serialize$1(e)]},"Aptos.CreateWrappedCoin")}async*transfer(e,t,s,n,a){const o=0n,c=0n,h=r.isNative(s)?i.APTOS_COIN:s.toString(),u=t.address.toUniversalAddress().toUint8Array(),A=r.toChainId(t.chain);a?yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_with_payload_entry`,typeArguments:[h],functionArguments:[n,A,u,c,a]},"Aptos.TransferTokensWithPayload"):yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_entry`,typeArguments:[h],functionArguments:[n,A,u,o,c]},"Aptos.TransferTokens")}async*redeem(e,t,s=!0){const n=t.payload.token.chain===this.chain?await this.getTypeFromExternalAddress(t.payload.token.address.toString()):await this.getAssetFullyQualifiedType(t.payload.token);if(!n)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::complete_transfer::submit_vaa_and_register_entry`,typeArguments:[n],functionArguments:[r.serialize$1(t)]},"Aptos.CompleteTransfer")}async getAssetFullyQualifiedType(e){return e.chain===this.chain?i.isValidAptosType(e.address.toString())?e.address.toString():null:`${d.getForeignAssetAddress(this.chain,this.tokenBridgeAddress,e)}::coin::T`}async getTypeFromExternalAddress(e){try{const t=await this.connection.getAccountResource({accountAddress:this.tokenBridgeAddress,resourceType:`${this.tokenBridgeAddress}::state::State`}),{handle:s}=t.native_infos,n=await this.connection.getTableItem({handle:s,data:{key_type:`${this.tokenBridgeAddress}::token_hash::TokenHash`,value_type:"0x1::type_info::TypeInfo",key:{hash:e}}});return n?[n.account_address,String.fromCharCode(...r.hex.decode(n.module_name)),String.fromCharCode(...r.hex.decode(n.struct_name))].join(i.APTOS_SEPARATOR):null}catch{return null}}static getForeignAssetAddress(e,t,s){if(r.isNative(s.address))throw new Error("Invalid token address");const n=w({chain:s.chain,tokenBridgeAddress:new i.AptosAddress(t).toUniversalAddress(),tokenId:s.address.toUniversalAddress()});return r.hex.encode(r.sha3_256(n),!0)}createUnsignedTx(e,t,s=!1){return new g.AptosUnsignedTransaction(e,this.network,this.chain,t,s)}}r.registerProtocol("Aptos","TokenBridge",d);exports.AptosTokenBridge=d;
@@ -1,7 +1,7 @@
1
- import "./index-pYTU7pQK.mjs";
2
- import { EvmWormholeCore as q } from "./index-BKgliEPZ.mjs";
3
- import { l as D, aJ as C, V as T, aK as v, bd as I, m as S, aL as p, b as F, H as j, de as $, X as N, aM as U, ah as V, c as J, c1 as k, I as R, E as x, au as P, aN as W } from "./platform-Cil_UtAQ.mjs";
4
- import { a as K } from "./solidity-Dk_mvceo.mjs";
1
+ import "./index-BmP0jPVN.mjs";
2
+ import { EvmWormholeCore as q } from "./index-CrWTw0Se.mjs";
3
+ import { l as D, aJ as C, V as T, aK as v, bd as I, m as S, aL as p, b as F, H as j, de as $, X as N, aM as U, ah as V, c as J, c1 as k, I as R, E as x, au as P, aN as W } from "./platform-CSpAb386.mjs";
4
+ import { a as K } from "./solidity-D9gSgFcp.mjs";
5
5
  class _ {
6
6
  network;
7
7
  chain;
@@ -1,6 +1,6 @@
1
- import { ag as D, aD as x, aE as ne, aF as Q, aG as N, aH as S, aI as E, k as m, aJ as y, G as _, e as v, h as B, aK as se, aL as oe, aM as F, aN as ae, f as R, H as Y, aO as ie, aP as P, aQ as ce, aR as de, m as X, aS as le, aT as ge, aU as ue, aV as K } from "./unsignedTransaction-DCDxTFq8.mjs";
2
- import "./index-zIzzPp6D.mjs";
3
- import { l as fe, di as M, ai as H, L as he, ah as I, i as b, N as pe, t as q, ap as we, at as V, ar as ye, m as $, an as me, ao as G, au as Z } from "./platform-Cil_UtAQ.mjs";
1
+ import { ag as D, aD as x, aE as ne, aF as Q, aG as N, aH as S, aI as E, k as m, aJ as y, G as _, e as v, h as B, aK as se, aL as oe, aM as F, aN as ae, f as R, H as Y, aO as ie, aP as P, aQ as ce, aR as de, m as X, aS as le, aT as ge, aU as ue, aV as K } from "./unsignedTransaction-D2Ja0SuN.mjs";
2
+ import "./index-BHpJUZne.mjs";
3
+ import { l as fe, di as M, ai as H, L as he, ah as I, i as b, N as pe, t as q, ap as we, at as V, ar as ye, m as $, an as me, ao as G, au as Z } from "./platform-CSpAb386.mjs";
4
4
  const L = async (A, t, e) => {
5
5
  if (!D(e))
6
6
  throw new Error(`Invalid Sui type: ${e}`);