@wormhole-foundation/wormhole-connect 3.0.2-beta.0-development → 3.0.2-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 (290) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/{basic-ChNCp6rI.js → basic-PUjrTVXb.js} +1 -1
  3. package/dist/assets/{evm-DSirgd5b.js → evm-CO5UWnAY.js} +2 -2
  4. package/dist/assets/{index-L-lC4rqb.js → index-1lzfHdT2.js} +1 -1
  5. package/dist/assets/{index-CHfaLf5J.js → index-DBVZDYF7.js} +1 -1
  6. package/dist/assets/index-DKlPX3ZI.js +1 -0
  7. package/dist/assets/{index-BtCrMDAu.js → index-Ddk7n7Ti.js} +1 -1
  8. package/dist/assets/{index-HhyysXFu.js → index-DyUmO4PR.js} +1 -1
  9. package/dist/assets/{index-BiwA3Bbq.js → index-MMzKxP1N.js} +1 -1
  10. package/dist/assets/{secp256k1-Cd7rIav0.js → secp256k1-0LtSM2L1.js} +1 -1
  11. package/dist/assets/{secp256k1-BQBOR8e3.js → secp256k1-DwTU3j1N.js} +1 -1
  12. package/dist/assets/{solana-DcwLWeKT.js → solana-DlGdMBSL.js} +4 -4
  13. package/dist/assets/{w3m-modal-DdptuLHe.js → w3m-modal-DD9Jgepz.js} +1 -1
  14. package/dist/main.js +72 -70
  15. package/dist/src/AppRouter.d.ts.map +1 -1
  16. package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
  17. package/dist/src/config/testnet/tokens.d.ts.map +1 -1
  18. package/dist/src/config/tokens.d.ts +1 -1
  19. package/dist/src/config/tokens.d.ts.map +1 -1
  20. package/dist/src/exports/index.d.ts +2 -2
  21. package/dist/src/exports/index.d.ts.map +1 -1
  22. package/dist/src/hooks/useFetchQuotes.d.ts.map +1 -1
  23. package/dist/src/icons/Chains/PLUME.d.ts.map +1 -1
  24. package/dist/src/icons/PoweredBy.d.ts.map +1 -1
  25. package/dist/src/icons/Routing.d.ts +5 -0
  26. package/dist/src/icons/Routing.d.ts.map +1 -0
  27. package/dist/src/icons/Tokens/PLUME.d.ts.map +1 -1
  28. package/dist/src/store/transferInput.d.ts +1 -1
  29. package/dist/src/store/transferInput.d.ts.map +1 -1
  30. package/dist/src/utils/coingecko.d.ts.map +1 -1
  31. package/dist/src/utils/formatNumber.d.ts +23 -0
  32. package/dist/src/utils/formatNumber.d.ts.map +1 -0
  33. package/dist/src/utils/index.d.ts +3 -1
  34. package/dist/src/utils/index.d.ts.map +1 -1
  35. package/dist/src/utils/routes.d.ts +12 -0
  36. package/dist/src/utils/routes.d.ts.map +1 -0
  37. package/dist/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
  38. package/dist/src/views/v2/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
  39. package/dist/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  40. package/dist/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
  41. package/dist/src/views/v3/Bridge/AmountInput/index.d.ts.map +1 -1
  42. package/dist/src/views/v3/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
  43. package/dist/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -1
  44. package/dist/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -1
  45. package/dist/src/views/v3/Bridge/Routes/Eta.d.ts +6 -0
  46. package/dist/src/views/v3/Bridge/Routes/Eta.d.ts.map +1 -0
  47. package/dist/src/views/v3/Bridge/Routes/RouteBadge.d.ts.map +1 -1
  48. package/dist/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts +7 -6
  49. package/dist/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts.map +1 -1
  50. package/dist/src/views/v3/Bridge/Routes/RoutesLink.d.ts +7 -0
  51. package/dist/src/views/v3/Bridge/Routes/RoutesLink.d.ts.map +1 -0
  52. package/dist/src/views/v3/Bridge/Routes/RoutesList.d.ts +2 -1
  53. package/dist/src/views/v3/Bridge/Routes/RoutesList.d.ts.map +1 -1
  54. package/dist/src/views/v3/Bridge/Routes/RoutesLoader.d.ts +4 -0
  55. package/dist/src/views/v3/Bridge/Routes/RoutesLoader.d.ts.map +1 -0
  56. package/dist/src/views/v3/Bridge/Routes/RoutesModal.d.ts +6 -5
  57. package/dist/src/views/v3/Bridge/Routes/RoutesModal.d.ts.map +1 -1
  58. package/dist/src/views/v3/Bridge/Routes/SingleRoute.d.ts +1 -0
  59. package/dist/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  60. package/dist/src/views/v3/Bridge/Routes/index.d.ts.map +1 -1
  61. package/dist/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -1
  62. package/lib/account-Br8E7RB6.js +1 -0
  63. package/lib/{account-BTK2b2Fv.mjs → account-CVa_3S2g.mjs} +1 -1
  64. package/lib/{address-8wLqn60W.mjs → address-BApwdEpr.mjs} +96 -96
  65. package/lib/address-BwQqFkyh.js +1 -0
  66. package/lib/address-C2pxq9b2.js +1 -0
  67. package/lib/{address-n0gAFMrZ.mjs → address-f6joE_ig.mjs} +12 -12
  68. package/lib/aptos-CMRGggVs.js +2 -0
  69. package/lib/{aptos-CK-j196x.js → aptos-CTKQNmlP.js} +1 -1
  70. package/lib/{aptos-B-DJQlwt.mjs → aptos-CfFbx7uf.mjs} +9 -9
  71. package/lib/{aptos-Bwcz9wZX.mjs → aptos-fozuppXh.mjs} +3 -3
  72. package/lib/{basic-DHWVLmCq.mjs → basic-BA2aRJJn.mjs} +2 -2
  73. package/lib/{basic-B5ZFelC_.js → basic-DUWaF2I0.js} +1 -1
  74. package/lib/{basic-E2M-9h1u.js → basic-DeiUayOA.js} +1 -1
  75. package/lib/{basic-Pour9Ggp.mjs → basic-DoC8u7J8.mjs} +2 -2
  76. package/lib/{blake2b-C5HyObld.mjs → blake2b-BGxWUAjG.mjs} +23 -23
  77. package/lib/blake2b-Fj1aPKgL.js +1 -0
  78. package/lib/{browser-ponyfill-jK8MKVVg.mjs → browser-ponyfill-D5AN8ZPp.mjs} +1 -1
  79. package/lib/browser-ponyfill-Dn6gsMYK.js +2 -0
  80. package/lib/{chain-Bm6u6eUF.mjs → chain-DAw2I5H8.mjs} +1 -1
  81. package/lib/chain-DnPXlO8g.js +1 -0
  82. package/lib/chunk-KJH4KKG6-BjF7YUcU.js +470 -0
  83. package/lib/{chunk-KJH4KKG6-DJsu-Y-X.mjs → chunk-KJH4KKG6-DmVjhXO7.mjs} +144 -144
  84. package/lib/{constants-Cf2YMjNo.js → constants-BtNs_2F4.js} +1 -1
  85. package/lib/{constants-B7AbX6qr.mjs → constants-Dcc2nVaW.mjs} +3 -3
  86. package/lib/contract-BEHYQLvJ.js +1 -0
  87. package/lib/{contract-llnN6ki0.mjs → contract-BkMAZomO.mjs} +123 -123
  88. package/lib/{core-CF5c7Vev.mjs → core-BHV42Qa0.mjs} +25 -26
  89. package/lib/core-CV23yxnG.js +889 -0
  90. package/lib/create-CHcGblj6.js +1 -0
  91. package/lib/{create-Dm87_0zG.mjs → create-CKLtL7hr.mjs} +1 -1
  92. package/lib/{evm-BYIGg8e4.mjs → evm-Bf7qbM19.mjs} +42 -42
  93. package/lib/{evm-B2hUWkt7.js → evm-ClWkquRx.js} +2 -2
  94. package/lib/{evm-fvvpk-li.mjs → evm-DhMoy8cH.mjs} +6 -6
  95. package/lib/{evm-DFNbMHoa.js → evm-tXmzU9Xp.js} +2 -2
  96. package/lib/executor.js +1 -1
  97. package/lib/executor.mjs +145 -138
  98. package/lib/hosted.js +1 -1
  99. package/lib/hosted.mjs +1 -1
  100. package/lib/{index-Cwo5AKUC.mjs → index-1rCCpdwd.mjs} +5 -5
  101. package/lib/{index-DBCa3k0j.mjs → index-3HvzWPL7.mjs} +9 -9
  102. package/lib/{index-MOwE6ses.mjs → index-B7ztYPhr.mjs} +21 -22
  103. package/lib/index-BM-0SeYB.js +1 -0
  104. package/lib/{index-DiQ8Ytrt.mjs → index-BTnpftLz.mjs} +1 -1
  105. package/lib/{index-BiCMaXJS.js → index-BWQMi6Rj.js} +1 -1
  106. package/lib/index-BbgKw2pu.js +1 -0
  107. package/lib/index-BblcpkoK.js +1 -0
  108. package/lib/index-Bfblsmud.js +1 -0
  109. package/lib/{index-C_0yAOSX.mjs → index-BfkFXEnG.mjs} +25082 -24072
  110. package/lib/{index-fi1sh8vr.mjs → index-BijBPDRn.mjs} +2 -2
  111. package/lib/index-BoquY9R2.js +337 -0
  112. package/lib/index-C2NtsO9Q.js +1 -0
  113. package/lib/{index-CNuk-XLX.mjs → index-C4JmrizV.mjs} +4 -4
  114. package/lib/index-C8TtXpOf.js +1 -0
  115. package/lib/index-CB8kOyIP.js +1 -0
  116. package/lib/index-CInVjUCW.js +1 -0
  117. package/lib/{index-BF11RebI.mjs → index-CLTklDbp.mjs} +1 -1
  118. package/lib/index-CQvgeH_r.js +1 -0
  119. package/lib/{index-DzYjoSJp.mjs → index-CUnOYRFQ.mjs} +23 -24
  120. package/lib/{index-DGh9LzN1.mjs → index-CWe_BTdo.mjs} +31 -31
  121. package/lib/{index-2Bz1Np4K.mjs → index-CZ91lJ9M.mjs} +5 -5
  122. package/lib/{index-Dgy1FO7C.js → index-CgyVnj6U.js} +1 -1
  123. package/lib/{index-BzJcFdt_.mjs → index-Clr2JjoJ.mjs} +44 -44
  124. package/lib/index-CnnCCv6Q.js +1 -0
  125. package/lib/{index-CJnRWlFf.mjs → index-CwxGLNEk.mjs} +48 -49
  126. package/lib/index-D7BLfz05.js +1 -0
  127. package/lib/index-DM7C-wvQ.js +3 -0
  128. package/lib/{index-DhIh3xiW.mjs → index-DNy_sNGr.mjs} +8 -8
  129. package/lib/{index-BZaRg0yd.mjs → index-DVcaDWmz.mjs} +1 -1
  130. package/lib/{index-CsAigASU.mjs → index-DWOP9OBp.mjs} +17 -17
  131. package/lib/{index-CTLz8Fz0.mjs → index-Dda5qc2t.mjs} +13 -14
  132. package/lib/{index-CLBXF_zH.mjs → index-DeaiBvpG.mjs} +16 -16
  133. package/lib/index-HOuGP-7b.js +1 -0
  134. package/lib/{index-Dt2uNp-N.mjs → index-KZve3tYJ.mjs} +4 -4
  135. package/lib/{index-CJDBidKv.mjs → index-SIyXqCAN.mjs} +41 -41
  136. package/lib/index-WhVYPMUr.js +1 -0
  137. package/lib/index-hmjT4xa7.js +1 -0
  138. package/lib/index-ledagFNU.js +1 -0
  139. package/lib/index-pbRVlgcN.js +1 -0
  140. package/lib/{index-BpQXUhR4.mjs → index-qK7AyMAk.mjs} +23 -27
  141. package/lib/index-ttZu99PZ.js +1 -0
  142. package/lib/{index.es-BqRBGIq6.mjs → index.es-BXRQf6Oi.mjs} +25 -26
  143. package/lib/index.es-BjGaOok5.js +11 -0
  144. package/lib/index.es-D6S74vhi.js +27 -0
  145. package/lib/{index.es-DgCZuUzB.mjs → index.es-cOw8juwf.mjs} +741 -737
  146. package/lib/index.js +1 -1
  147. package/lib/index.mjs +17 -16
  148. package/lib/mayan.js +3 -3
  149. package/lib/mayan.mjs +918 -891
  150. package/lib/mint-CL36R6ED.js +1 -0
  151. package/lib/{mint-Dc-VsiAn.mjs → mint-DunEG1jV.mjs} +32 -33
  152. package/lib/ntt.js +1 -1
  153. package/lib/ntt.mjs +2332 -2373
  154. package/lib/platform-7vCWzCny.js +1 -0
  155. package/lib/platform-BKhoO9So.js +1 -0
  156. package/lib/{platform-B95L0Vxv.mjs → platform-BN6LFtXE.mjs} +16 -16
  157. package/lib/{platform-DnP_1wGA.mjs → platform-BYLu9SzP.mjs} +4 -4
  158. package/lib/platform-Bbe26nx7.js +1 -0
  159. package/lib/{platform-DiG7WY9Z.mjs → platform-DCgWqmh1.mjs} +4 -4
  160. package/lib/{provider-jsonrpc-CRABh2gN.mjs → provider-jsonrpc-Bmgnrmpy.mjs} +155 -155
  161. package/lib/provider-jsonrpc-CbtP2Ffg.js +1 -0
  162. package/lib/{secp256k1-zHHDNAlH.mjs → secp256k1-BDQEvyHq.mjs} +1 -1
  163. package/lib/{secp256k1-obBDPYM-.mjs → secp256k1-C77Oh9AA.mjs} +1 -1
  164. package/lib/{secp256k1-2hq3Jk4g.mjs → secp256k1-CCn2vlXj.mjs} +1 -1
  165. package/lib/{secp256k1-B94G4gyy.js → secp256k1-CHAR40au.js} +1 -1
  166. package/lib/{secp256k1-DCcAh19h.js → secp256k1-D-DmPYcJ.js} +1 -1
  167. package/lib/{secp256k1-CjndBUS7.js → secp256k1-DYWDlveU.js} +1 -1
  168. package/lib/{signer-N_ccpPOz.mjs → signer-BIcn81N5.mjs} +18 -18
  169. package/lib/signer-H7atraks.js +1 -0
  170. package/lib/{solana-_Ha4YgiP.mjs → solana-B0QSg7B3.mjs} +30 -30
  171. package/lib/solana-Cs5VyB20.js +900 -0
  172. package/lib/solana-uvHG8JV5.js +1 -0
  173. package/lib/solana-zyfOlbhb.mjs +18 -0
  174. package/lib/{solanaEmbed.esm-DK5RIquB.mjs → solanaEmbed.esm-BqdznDuW.mjs} +623 -622
  175. package/lib/solanaEmbed.esm-D8vtESE6.js +10 -0
  176. package/lib/src/AppRouter.d.ts.map +1 -1
  177. package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
  178. package/lib/src/config/testnet/tokens.d.ts.map +1 -1
  179. package/lib/src/config/tokens.d.ts +1 -1
  180. package/lib/src/config/tokens.d.ts.map +1 -1
  181. package/lib/src/exports/index.d.ts +2 -2
  182. package/lib/src/exports/index.d.ts.map +1 -1
  183. package/lib/src/hooks/useFetchQuotes.d.ts.map +1 -1
  184. package/lib/src/icons/Chains/PLUME.d.ts.map +1 -1
  185. package/lib/src/icons/PoweredBy.d.ts.map +1 -1
  186. package/lib/src/icons/Routing.d.ts +5 -0
  187. package/lib/src/icons/Routing.d.ts.map +1 -0
  188. package/lib/src/icons/Tokens/PLUME.d.ts.map +1 -1
  189. package/lib/src/store/transferInput.d.ts +1 -1
  190. package/lib/src/store/transferInput.d.ts.map +1 -1
  191. package/lib/src/utils/coingecko.d.ts.map +1 -1
  192. package/lib/src/utils/formatNumber.d.ts +23 -0
  193. package/lib/src/utils/formatNumber.d.ts.map +1 -0
  194. package/lib/src/utils/index.d.ts +3 -1
  195. package/lib/src/utils/index.d.ts.map +1 -1
  196. package/lib/src/utils/routes.d.ts +12 -0
  197. package/lib/src/utils/routes.d.ts.map +1 -0
  198. package/lib/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
  199. package/lib/src/views/v2/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
  200. package/lib/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  201. package/lib/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
  202. package/lib/src/views/v3/Bridge/AmountInput/index.d.ts.map +1 -1
  203. package/lib/src/views/v3/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
  204. package/lib/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -1
  205. package/lib/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -1
  206. package/lib/src/views/v3/Bridge/Routes/Eta.d.ts +6 -0
  207. package/lib/src/views/v3/Bridge/Routes/Eta.d.ts.map +1 -0
  208. package/lib/src/views/v3/Bridge/Routes/RouteBadge.d.ts.map +1 -1
  209. package/lib/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts +7 -6
  210. package/lib/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts.map +1 -1
  211. package/lib/src/views/v3/Bridge/Routes/RoutesLink.d.ts +7 -0
  212. package/lib/src/views/v3/Bridge/Routes/RoutesLink.d.ts.map +1 -0
  213. package/lib/src/views/v3/Bridge/Routes/RoutesList.d.ts +2 -1
  214. package/lib/src/views/v3/Bridge/Routes/RoutesList.d.ts.map +1 -1
  215. package/lib/src/views/v3/Bridge/Routes/RoutesLoader.d.ts +4 -0
  216. package/lib/src/views/v3/Bridge/Routes/RoutesLoader.d.ts.map +1 -0
  217. package/lib/src/views/v3/Bridge/Routes/RoutesModal.d.ts +6 -5
  218. package/lib/src/views/v3/Bridge/Routes/RoutesModal.d.ts.map +1 -1
  219. package/lib/src/views/v3/Bridge/Routes/SingleRoute.d.ts +1 -0
  220. package/lib/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  221. package/lib/src/views/v3/Bridge/Routes/index.d.ts.map +1 -1
  222. package/lib/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -1
  223. package/lib/{sui-CQcQ6w_P.mjs → sui-B38DyOqM.mjs} +44 -44
  224. package/lib/{sui-BplKFZQu.mjs → sui-BpfnZR4f.mjs} +3 -3
  225. package/lib/sui-CT9MWY38.js +1 -0
  226. package/lib/{sui-_hvmCvD8.js → sui-DXQAMRQJ.js} +1 -1
  227. package/lib/{tokens-DNv0ZNvU.js → tokens-CmINcwKk.js} +31 -31
  228. package/lib/{tokens-Dl4YwW18.mjs → tokens-YxAPPVy3.mjs} +1726 -1724
  229. package/lib/transfer-BQ72fByU.js +1 -0
  230. package/lib/transfer-bTW0j9yh.mjs +58 -0
  231. package/lib/units-Ckije3Qv.js +1 -0
  232. package/lib/{units-DPWUSE6J.mjs → units-CtyvuzxQ.mjs} +13 -13
  233. package/lib/unsignedTransaction-C6Qp42VS.js +1 -0
  234. package/lib/{unsignedTransaction-DwcUilyN.mjs → unsignedTransaction-CXB-QCUC.mjs} +18 -18
  235. package/lib/{w3m-modal-BJILsxDp.mjs → w3m-modal-B7LUHLWC.mjs} +2 -2
  236. package/lib/{w3m-modal-D4CpFxO2.mjs → w3m-modal-BOTzBqbc.mjs} +2 -2
  237. package/lib/{w3m-modal-CrfHWSrF.js → w3m-modal-BTb03-7B.js} +1 -1
  238. package/lib/{w3m-modal-CBG2MSPp.js → w3m-modal-xmdf4r6V.js} +1 -1
  239. package/lib/web3-COTIsLs8.js +22 -0
  240. package/lib/{address-B-XN4tFw.mjs → web3-DYVeiqSa.mjs} +6599 -6576
  241. package/package.json +32 -32
  242. package/dist/assets/index-BWPgrXHs.js +0 -1
  243. package/lib/account-cRt2xMoW.js +0 -1
  244. package/lib/address-BGujeWtN.js +0 -22
  245. package/lib/address-C7DIAk4M.js +0 -1
  246. package/lib/address-KNhRm6oe.js +0 -1
  247. package/lib/aptos-f5TqmvqV.js +0 -2
  248. package/lib/blake2b-B-MRXUPb.js +0 -1
  249. package/lib/browser-ponyfill-CE6vRkjp.js +0 -2
  250. package/lib/chain-Hsn22HAP.js +0 -1
  251. package/lib/chunk-KJH4KKG6-CoyI75Ig.js +0 -470
  252. package/lib/contract-D2fTrJgn.js +0 -1
  253. package/lib/core-v0G9f7LX.js +0 -889
  254. package/lib/create-DoZZ7ciL.js +0 -1
  255. package/lib/index-B8-KKWD-.js +0 -1
  256. package/lib/index-BHbvgOMD.js +0 -1
  257. package/lib/index-BHfUgvSV.js +0 -1
  258. package/lib/index-BTKC7Hou.js +0 -1
  259. package/lib/index-BWXglAWd.js +0 -1
  260. package/lib/index-Bpp8C4u8.js +0 -1
  261. package/lib/index-CF2fHBHJ.js +0 -3
  262. package/lib/index-CTPz98nv.js +0 -1
  263. package/lib/index-ClMoiji-.js +0 -1
  264. package/lib/index-ClsVcH6F.js +0 -1
  265. package/lib/index-CqOI6LVu.js +0 -1
  266. package/lib/index-DCz_4mcz.js +0 -1
  267. package/lib/index-DKksdvND.js +0 -335
  268. package/lib/index-DRv3ZpVL.js +0 -1
  269. package/lib/index-DYqo8IhM.js +0 -1
  270. package/lib/index-DZubce9o.js +0 -1
  271. package/lib/index-DprM_IpB.js +0 -1
  272. package/lib/index-DshEQYMA.js +0 -1
  273. package/lib/index-JrM783SN.js +0 -1
  274. package/lib/index.es-C6YhioMN.js +0 -27
  275. package/lib/index.es-D3Xxxr8I.js +0 -11
  276. package/lib/mint-DlXC3sGi.js +0 -1
  277. package/lib/platform-B1XoDKoN.js +0 -1
  278. package/lib/platform-COuZC5Zc.js +0 -1
  279. package/lib/platform-NG3efAb2.js +0 -1
  280. package/lib/provider-jsonrpc-pXNHQF7n.js +0 -1
  281. package/lib/signer-CCa6npZ3.js +0 -1
  282. package/lib/solana-BJ3aReZw.mjs +0 -18
  283. package/lib/solana-BwyVgP30.js +0 -1
  284. package/lib/solana-CanFuMgA.js +0 -900
  285. package/lib/solanaEmbed.esm-C--1F7Lx.js +0 -10
  286. package/lib/sui-Bs83Gy5Z.js +0 -1
  287. package/lib/units-BvcKDiAx.js +0 -1
  288. package/lib/unsignedTransaction-dN_5EJf5.js +0 -1
  289. package/lib/web3-Bu_6UejS.mjs +0 -67
  290. package/lib/web3-Doz_0RHD.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";var _=Object.defineProperty;var M=(t,e,n)=>e in t?_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var U=(t,e,n)=>M(t,typeof e!="symbol"?e+"":e,n);const w=require("./address-BGujeWtN.js");function q(t){if(t.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);for(let r=0;r<e.length;r++)e[r]=255;for(let r=0;r<t.length;r++){const o=t.charAt(r),f=o.charCodeAt(0);if(e[f]!==255)throw new TypeError(o+" is ambiguous");e[f]=r}const n=t.length,i=t.charAt(0),l=Math.log(n)/Math.log(256),u=Math.log(256)/Math.log(n);function y(r){if(r instanceof Uint8Array||(ArrayBuffer.isView(r)?r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength):Array.isArray(r)&&(r=Uint8Array.from(r))),!(r instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(r.length===0)return"";let o=0,f=0,s=0;const h=r.length;for(;s!==h&&r[s]===0;)s++,o++;const d=(h-s)*u+1>>>0,a=new Uint8Array(d);for(;s!==h;){let p=r[s],c=0;for(let m=d-1;(p!==0||c<f)&&m!==-1;m--,c++)p+=256*a[m]>>>0,a[m]=p%n>>>0,p=p/n>>>0;if(p!==0)throw new Error("Non-zero carry");f=c,s++}let g=d-f;for(;g!==d&&a[g]===0;)g++;let b=i.repeat(o);for(;g<d;++g)b+=t.charAt(a[g]);return b}function A(r){if(typeof r!="string")throw new TypeError("Expected String");if(r.length===0)return new Uint8Array;let o=0,f=0,s=0;for(;r[o]===i;)f++,o++;const h=(r.length-o)*l+1>>>0,d=new Uint8Array(h);for(;o<r.length;){const p=r.charCodeAt(o);if(p>255)return;let c=e[p];if(c===255)return;let m=0;for(let E=h-1;(c!==0||m<s)&&E!==-1;E--,m++)c+=n*d[E]>>>0,d[E]=c%256>>>0,c=c/256>>>0;if(c!==0)throw new Error("Non-zero carry");s=m,o++}let a=h-s;for(;a!==h&&d[a]===0;)a++;const g=new Uint8Array(f+(h-a));let b=f;for(;a!==h;)g[b++]=d[a++];return g}function I(r){const o=A(r);if(o)return o;throw new Error("Non-base"+n+" character")}return{encode:y,decodeUnsafe:A,decode:I}}var K="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const N=q(K),B=t=>N.encode(t),F=t=>N.decode(t);function L(t){return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}const C=8192;function P(t){if(t.length<C)return btoa(String.fromCharCode(...t));let e="";for(var n=0;n<t.length;n+=C){const i=t.slice(n,n+C);e+=String.fromCharCode(...i)}return btoa(e)}function W(t){var l;const e=t.startsWith("0x")?t.slice(2):t,n=e.length%2===0?e:`0${e}`,i=((l=n.match(/[0-9a-fA-F]{2}/g))==null?void 0:l.map(u=>parseInt(u,16)))??[];if(i.length!==n.length/2)throw new Error(`Invalid hex string ${t}`);return Uint8Array.from(i)}function R(t){return t.reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function X(t,e){switch(e){case"base58":return B(t);case"base64":return P(t);case"hex":return R(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function V(t,e=["<",">"]){const[n,i]=e,l=[];let u="",y=0;for(let A=0;A<t.length;A++){const I=t[A];if(I===n&&y++,I===i&&y--,y===0&&I===","){l.push(u.trim()),u="";continue}u+=I}return l.push(u.trim()),l}const Z=32;function J(t){try{return F(t).length===Z}catch{return!1}}const k=32;function j(t){return tt(t)&&et(t)===k}function Q(t){return j(t)}function Y(t){return t.includes("::")?D(t):t}function D(t){const[e,n]=t.split("::"),i=t.slice(e.length+n.length+4),l=i.includes("<")?i.slice(0,i.indexOf("<")):i,u=i.includes("<")?V(i.slice(i.indexOf("<")+1,i.lastIndexOf(">"))).map(y=>Y(y.trim())):[];return{address:z(e),module:n,name:l,typeParams:u}}function z(t,e=!1){let n=t.toLowerCase();return!e&&n.startsWith("0x")&&(n=n.slice(2)),`0x${n.padStart(k*2,"0")}`}function $(t,e=!1){return z(t,e)}function tt(t){return/^(0x|0X)?[a-fA-F0-9]+$/.test(t)&&t.length%2===0}function et(t){return/^(0x|0X)/.test(t)?(t.length-2)/2:t.length/2}const T="::",G="0x2::sui::SUI",v=t=>/^(0x)?[0-9a-fA-F]+::\w+::\w+$/.test(t),H=t=>t.replace(/(0x)(0*)/g,"0x");function O(t){return t=t.startsWith("0x")?t.slice(2):t,t=t.length%2===0?t:"0"+t,`0x${t.length===64?t:w.hex.encode(w.bytes.zpad(w.hex.decode(t),32))}`}const nt=t=>{const e=t.split(T);if(e.length!==3)throw new Error(`Invalid Sui type: ${t}`);return[z(e[0]),e[1],e[2]].join(T)},rt=t=>new x(t).getCoinType(),it=t=>new x(t).getPackageId(),ot=t=>{const e=H(t).match(/0x2::table::Table<(.*)>/);if(!e)throw new Error(`Invalid table type: ${t}`);if(e.length<2)throw new Error(`Invalid table type: ${t}`);const[n]=e[1].split(",");if(!n||!v(n))throw new Error(`Invalid key type: ${n}`);return n},S=class S{constructor(e){U(this,"address");U(this,"module");if(S.instanceof(e))this.address=e.address,this.module=e.module;else if(w.UniversalAddress.instanceof(e))this.address=e.toUint8Array();else if(typeof e=="string"){if(v(e)){const n=e.split(T);this.module=n.slice(1).join(T),e=n[0]}if(e=O(e),!w.hex.valid(e))throw new Error("Invalid Sui address: "+e);this.address=w.hex.decode(e)}else this.address=e}unwrap(){const e=this.getPackageId(),n=this.module?T+this.module:"";return`${e}${n}`}toString(){return this.unwrap()}toNative(){return this}toUint8Array(){return this.address}toUniversalAddress(){return new w.UniversalAddress(this.toUint8Array())}getPackageId(){return O(w.hex.encode(this.address))}getCoinType(){if(this.module==="sui::SUI")return G;if(!this.module)throw new Error("No module present in Sui token address");return this.unwrap()}static instanceof(e){return e.constructor.platform===S.platform}equals(e){return S.instanceof(e)?e.unwrap()===this.unwrap():this.toUniversalAddress().equals(e)}};U(S,"byteSize",32),U(S,"platform","Sui");let x=S;w.registerNative("Sui",x);exports.SUI_ADDRESS_LENGTH=k;exports.SUI_COIN=G;exports.SUI_SEPARATOR=T;exports.SuiAddress=x;exports.encodeStr=X;exports.fromBase58=F;exports.fromBase64=L;exports.fromHex=W;exports.getCoinTypeFromPackageId=rt;exports.getPackageIdFromType=it;exports.getTableKeyType=ot;exports.isValidSuiAddress=j;exports.isValidSuiObjectId=Q;exports.isValidSuiType=v;exports.isValidTransactionDigest=J;exports.normalizeSuiAddress=z;exports.normalizeSuiObjectId=$;exports.normalizeSuiType=nt;exports.parseStructTag=D;exports.splitGenericParameters=V;exports.toBase58=B;exports.toBase64=P;exports.toHex=R;exports.trimSuiType=H;
@@ -1 +0,0 @@
1
- "use strict";var H=Object.defineProperty;var X=(l,t,e)=>t in l?H(l,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[t]=e;var f=(l,t,e)=>X(l,typeof t!="symbol"?t+"":t,e);const a=require("./address-BGujeWtN.js");class z{constructor(t,e,n,i,s){f(this,"source");f(this,"destination");f(this,"fromChain");f(this,"toChain");f(this,"recipient");this.fromChain=t,this.toChain=e,this.source=n,this.destination=i,this.recipient=s}parseAmount(t){return a.parse(t,this.source.decimals)}amountFromBaseUnits(t){return a.fromBaseUnits(t,this.source.decimals)}async displayQuote(t,e,n){let i={success:!0,sourceToken:{token:t.sourceToken.token,amount:a.fromBaseUnits(t.sourceToken.amount,this.source.decimals)},destinationToken:{token:t.destinationToken.token,amount:a.fromBaseUnits(t.destinationToken.amount,this.destination.decimals)},params:e};if(t.relayFee){const o=await(t.relayFee.token.chain===this.fromChain.chain?this.fromChain:this.toChain).getDecimals(t.relayFee.token.address);i.relayFee={token:t.relayFee.token,amount:a.fromBaseUnits(t.relayFee.amount,o)}}if(t.destinationNativeGas){const s=await this.toChain.getDecimals("native");i.destinationNativeGas=a.fromBaseUnits(t.destinationNativeGas,s)}return t.warnings&&t.warnings.length>0&&(i.warnings=[...t.warnings]),i.eta=t.eta,i.expires=t.expires,n&&(i.details=n),i}static async create(t,e,n,i){n=n??t.getChain(e.source.chain),i=i??t.getChain(e.destination.chain);const s=await a.getTokenDetails(n,e.source,e.sourceDecimals),o=await a.getTokenDetails(i,e.destination,e.destinationDecimals);return new z(n,i,s,o,e.recipient)}}async function _(l,t,e,n=120*1e3,i=console.log){const s=Date.now();i("Checking transfer state...");for await(t of l.track(t,120*1e3))i("Current Transfer State: ",a.TransferState[t.state]);if(a.isCompleted(t))return t;if(a.isManual(l)&&a.isAttested(t)&&e){i("Completing transfer...");const r=await l.complete(e,t);i("Completed transfer with txids: ",r)}if(a.isFinalizable(l)&&a.isRedeemed(t)&&e){i("Finalizing transfer...");const r=await l.finalize(e,t);i("Finalized transfer with txids: ",r)}const o=n-(Date.now()-s);return o>0?(i("Transfer not complete, trying again in a 2000ms..."),await new Promise(c=>setTimeout(c,2e3)),_(l,t,e,o)):t}class b extends a.AutomaticRoute{static supportedNetworks(){return["Mainnet","Testnet"]}static supportedChains(t){return a.tokenBridgeRelayerChains.has(t)?a.tokenBridgeRelayerChains.get(t):[]}static async supportedDestinationTokens(t,e,n){try{if(!a.isNative(t)&&!await(await e.getAutomaticTokenBridge()).isRegisteredToken(t.address))return[];const i=await a.TokenTransfer.lookupDestinationToken(e,n,t);return await(await n.getAutomaticTokenBridge()).isRegisteredToken(i.address)?[i]:[]}catch{return[]}}getDefaultOptions(){return{nativeGas:0}}async validate(t,e){try{const n=e.options??this.getDefaultOptions();if(n.nativeGas&&(n.nativeGas>1||n.nativeGas<0))throw new Error("Native gas must be between 0.0 and 1.0 (0% and 100%)");const{destination:i}=t;a.isNative(i.id.address)&&n.nativeGas===0&&(n.nativeGas=0);const s={...e,options:n};return{valid:!0,params:{...s,normalizedParams:await this.normalizeTransferParams(t,s)}}}catch(n){return{valid:!1,params:e,error:n}}}async normalizeTransferParams(t,e){const n=t.parseAmount(e.amount),i=a.isNative(t.source.id.address)?await t.fromChain.getNativeWrappedTokenId():t.source.id,o=await(await t.fromChain.getAutomaticTokenBridge()).getRelayerFee(t.toChain.chain,i.address),r=o*105n/100n;if(a.units(n)<r)throw new a.MinAmountError(a.fromBaseUnits(r,n.decimals));const c=a.units(n)-o;let d=a.fromBaseUnits(0n,t.source.decimals);if(e.options&&e.options.nativeGas>0){let m=await(await t.toChain.getAutomaticTokenBridge()).maxSwapAmount(t.destination.id.address);const T=a.truncate(a.fromBaseUnits(c,n.decimals),a.TokenTransfer.MAX_DECIMALS),h=await t.toChain.getDecimals(t.destination.id.address),w=a.units(a.scale(T,h));w<m&&(m=w);const y=1e4,B=BigInt(Math.floor(e.options.nativeGas*y)),F=m*B/BigInt(y),v=a.fromBaseUnits(F,t.destination.decimals);d=a.scale(a.truncate(v,a.TokenTransfer.MAX_DECIMALS),t.source.decimals),a.units(d)>c&&(d=a.fromBaseUnits(c,t.source.decimals))}return{fee:a.fromBaseUnits(o,t.source.decimals),amount:n,nativeGasAmount:d}}async quote(t,e){const n=await t.fromChain.getAutomaticTokenBridge();if(a.isTokenId(t.source.id)&&!await n.isRegisteredToken(t.source.id.address))return{success:!1,error:new Error("Source token is not registered")};try{let i=await a.TokenTransfer.quoteTransfer(this.wh,t.fromChain,t.toChain,{protocol:"AutomaticTokenBridge",amount:a.units(e.normalizedParams.amount),token:t.source.id,nativeGas:a.units(e.normalizedParams.nativeGasAmount)});return t.displayQuote(i,e)}catch(i){return{success:!1,error:i}}}async initiate(t,e,n,i){const{params:s}=n,o=this.toTransferDetails(t,s,a.Wormhole.chainAddress(e.chain(),e.address()),i),r=await a.TokenTransfer.transfer(t.fromChain,o,e);return{from:o.from.chain,to:o.to.chain,state:a.TransferState.SourceInitiated,originTxs:r}}async*track(t,e){try{yield*a.TokenTransfer.track(this.wh,t,e)}catch(n){throw n}}toTransferDetails(t,e,n,i){return{from:n,to:i,protocol:"AutomaticTokenBridge",amount:a.units(e.normalizedParams.amount),token:t.source.id,nativeGas:a.units(e.normalizedParams.nativeGasAmount)}}}f(b,"NATIVE_GAS_DROPOFF_SUPPORTED",!0),f(b,"meta",{name:"AutomaticTokenBridge"});function j(l={}){class t extends x{}return f(t,"config",l),t}const p=class p extends a.AutomaticRoute{constructor(){super(...arguments);f(this,"staticConfig",this.constructor.config)}static supportedNetworks(){return["Mainnet","Testnet"]}static supportedChains(e){return e==="Devnet"?[]:a.executorTokenBridgeChains(e)}static async supportedDestinationTokens(e,n,i){try{return[await a.TokenTransfer.lookupDestinationToken(n,i,e)]}catch{return[]}}getDefaultOptions(){return{nativeGas:0}}async validate(e,n){const i=a.parse(n.amount,e.source.decimals),s=n.options??this.getDefaultOptions();if(s.nativeGas&&(s.nativeGas>1||s.nativeGas<0))throw new Error("Native gas must be between 0.0 and 1.0 (0% and 100%)");return{valid:!0,params:{amount:n.amount,normalizedParams:{amount:i},options:s}}}async quote(e,n){var s,o,r,c,d,u,m,T,h;const i=p.supportedChains(e.fromChain.network);if(!i.includes(e.fromChain.chain)||!i.includes(e.toChain.chain))return{success:!1,error:new Error(`Executor Token Bridge does not support transfers from ${e.fromChain.chain} to ${e.toChain.chain}`)};try{let w;const y=await e.toChain.getExecutorTokenBridge();let{gasLimit:B,msgValue:F}=await y.estimateMsgValueAndGasLimit(e.destination.id,e.recipient);if(((s=this.staticConfig.referrerFee)==null?void 0:s.referrerFeeDbps)!==void 0&&(w=this.staticConfig.referrerFee.referrerFeeDbps),(o=this.staticConfig.referrerFee)!=null&&o.tokenFeeOverrides){const g=a.canonicalAddress(e.source.id),k=(c=(r=this.staticConfig.referrerFee.tokenFeeOverrides[this.wh.network])==null?void 0:r[e.fromChain.chain])==null?void 0:c[g];k!==void 0&&(w=k)}if(this.staticConfig.tokenOverrides){const g=a.canonicalAddress(e.destination.id),k=(u=(d=this.staticConfig.tokenOverrides[this.wh.network])==null?void 0:d[e.destination.id.chain])==null?void 0:u[g];(k==null?void 0:k.gasLimit)!==void 0&&(B=k.gasLimit)}let v;if(w!==void 0&&w>0n){const g=(h=(T=(m=this.staticConfig.referrerFee)==null?void 0:m.referrerAddresses)==null?void 0:T[this.wh.network])==null?void 0:h[e.fromChain.chain];if(!g)throw new Error(`No referrer address configured for network ${this.wh.network} and chain ${e.fromChain.chain}`);v=a.Wormhole.chainAddress(e.fromChain.chain,g)}const L=w!==void 0&&v!==void 0?{feeDbps:w,referrer:v}:void 0;let U;if(n.options.nativeGas!==void 0){const g=await a.TokenTransfer.getExecutorGasDropOffLimit(this.wh,e.toChain);U=g>0n?BigInt(Math.round(n.options.nativeGas*100))*g/100n:0n}const W=await a.TokenTransfer.quoteTransfer(this.wh,e.fromChain,e.toChain,{token:e.source.id,amount:a.units(n.normalizedParams.amount),protocol:"ExecutorTokenBridge",nativeGas:U,msgValue:F,gasLimit:B,referrerFee:L});return e.displayQuote(W,n,W.details)}catch(w){return{success:!1,error:w}}}async initiate(e,n,i,s){const{fromChain:o,toChain:r}=e,{params:c}=i,d=await a.TokenTransfer.destinationOverrides(o,r,this.toTransferDetails(e,c,a.Wormhole.chainAddress(n.chain(),n.address()),s,i)),u=await a.TokenTransfer.transfer(o,d,n);let m=0;return(async()=>{for(;m<20;){try{const[h]=await this.wh.getExecutorTxStatus(u.at(-1).txid,o.chain);if(h)break}catch{}m++,await new Promise(h=>setTimeout(h,2e3))}})(),{from:d.from.chain,to:d.to.chain,state:a.TransferState.SourceInitiated,originTxs:u}}async complete(e,n){if(!a.isAttested(n)&&!a.isFailed(n))throw new Error("The source must be finalized in order to complete the transfer");if(!n.attestation)throw new Error("The receipt must have an attestation to complete the transfer");const i=this.wh.getChain(n.to),s=await i.getExecutorTokenBridge(),o=a.toNative(e.chain(),e.address()),r=s.redeem(o,n.attestation.attestation),c=await a.signSendWait(i,r,e);return{...n,state:a.TransferState.DestinationInitiated,attestation:n.attestation,destinationTxs:c}}async resume(e){const n=await a.TokenTransfer.from(this.wh,e,1e4);if(n.transfer.protocol!=="ExecutorTokenBridge")throw new Error("Can only resume ExecutorTokenBridge transfers");return a.TokenTransfer.getReceipt(n)}async*track(e,n){for await(const i of a.TokenTransfer.track(this.wh,e,n))yield i}toTransferDetails(e,n,i,s,o){if(!o.details)throw new Error("Missing quote details");return{from:i,to:s,token:e.source.id,amount:a.units(n.normalizedParams.amount),protocol:"ExecutorTokenBridge",executorQuote:o.details.executorQuote,referrerFee:o.details.referrerFee}}};f(p,"IS_EXECUTOR_ROUTE",!0),f(p,"NATIVE_GAS_DROPOFF_SUPPORTED",!0),f(p,"config",{}),f(p,"meta",{name:"TokenBridgeExecutorRoute"});let x=p;class O extends a.ManualRoute{static supportedNetworks(){return["Mainnet","Testnet"]}static supportedChains(t){return a.tokenBridgeChains(t)}static async supportedDestinationTokens(t,e,n){try{return[await a.TokenTransfer.lookupDestinationToken(e,n,t)]}catch{return[]}}getDefaultOptions(){return{payload:void 0}}async validate(t,e){const n=a.parse(e.amount,t.source.decimals);return{valid:!0,params:{amount:e.amount,normalizedParams:{amount:n},options:{}}}}async quote(t,e){try{return t.displayQuote(await a.TokenTransfer.quoteTransfer(this.wh,t.fromChain,t.toChain,{token:t.source.id,amount:a.units(e.normalizedParams.amount),protocol:"TokenBridge",...e.options}),e)}catch(n){return{success:!1,error:n}}}async initiate(t,e,n,i){const{params:s}=n,o=await a.TokenTransfer.destinationOverrides(t.fromChain,t.toChain,this.toTransferDetails(t,s,a.Wormhole.chainAddress(e.chain(),e.address()),i)),r=await a.TokenTransfer.transfer(t.fromChain,o,e);return{from:o.from.chain,to:o.to.chain,state:a.TransferState.SourceInitiated,originTxs:r}}async complete(t,e){if(!a.isAttested(e))throw new Error("The source must be finalized in order to complete the transfer");const n=this.wh.getChain(e.to),i=await a.TokenTransfer.redeem(n,e.attestation.attestation,t);return{...e,state:a.TransferState.DestinationInitiated,destinationTxs:i}}async resume(t){const e=await a.TokenTransfer.from(this.wh,t,1e4);if(e.transfer.protocol!=="TokenBridge")throw new Error("Transfer is not a TokenBridge transfer");return a.TokenTransfer.getReceipt(e)}async*track(t,e){yield*a.TokenTransfer.track(this.wh,t,e)}toTransferDetails(t,e,n,i){return{from:n,to:i,protocol:"TokenBridge",token:t.source.id,amount:a.units(e.normalizedParams.amount),...e.options}}}f(O,"meta",{name:"ManualTokenBridge"});const R=15n,V=100n,S=10000n,A=class A extends a.AutomaticRoute{static supportedNetworks(){return["Mainnet"]}static supportedChains(t){return a.porticoContractChains.has(t)?a.porticoContractChains.get(t):[]}static async supportedDestinationTokens(t,e,n){const[,i]=a.resolveWrappedToken(e.network,e.chain,t),s=a.canonicalAddress(i),o=await e.getPorticoBridge();if(!o.supportedTokens().some(m=>a.canonicalAddress(m.token)===s))return[];try{const m=await o.getTransferrableToken(s);await a.TokenTransfer.lookupDestinationToken(e,n,m)}catch{return[]}const c=(await n.getPorticoBridge()).supportedTokens(),{tokenMap:d}=n.config,u=o.getTokenGroup(s);return c.filter(m=>(m.group===u||m.group==="ETH"&&u==="WETH"||m.group==="WETH"&&u==="ETH")&&(!d||a.filters.byAddress(d,a.canonicalAddress(m.token)))).map(m=>m.token)}getDefaultOptions(){return{}}async validate(t,e){try{if(!A.supportedChains(t.fromChain.network).includes(t.fromChain.chain)||!A.supportedChains(t.toChain.network).includes(t.toChain.chain))throw new Error("Protocol not supported");const{fromChain:n,toChain:i,source:s,destination:o}=t,{network:r}=n,[,c]=a.resolveWrappedToken(r,n.chain,s.id),[,d]=a.resolveWrappedToken(r,i.chain,o.id),u=await n.getPorticoBridge(),m=await i.getPorticoBridge(),T=await u.getTransferrableToken(a.canonicalAddress(c)),h=await m.getTransferrableToken(a.canonicalAddress(d));return{valid:!0,params:{amount:e.amount,options:e.options??this.getDefaultOptions(),normalizedParams:{amount:t.parseAmount(e.amount),canonicalSourceToken:T,canonicalDestinationToken:h,sourceToken:c,destinationToken:d}}}}catch(n){return{valid:!1,error:n,params:e}}}async quote(t,e){try{const n=await this.fetchSwapQuote(t,e),i=Math.max(t.source.decimals,t.destination.decimals),s=a.units(a.scale(e.normalizedParams.amount,i));if(a.units(a.scale(a.fromBaseUnits(n.minAmountFinish,t.destination.decimals),i))<s-s*V/S)throw new Error("Slippage too high");const c=await(await t.toChain.getPorticoBridge()).quoteRelay(e.normalizedParams.canonicalDestinationToken.address,e.normalizedParams.destinationToken.address),d={swapAmounts:n,relayerFee:c},u=d.swapAmounts.minAmountFinish-c;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:a.units(e.normalizedParams.amount)},destinationToken:{token:e.normalizedParams.destinationToken,amount:d.swapAmounts.minAmountFinish-c},relayFee:{token:e.normalizedParams.destinationToken,amount:c},eta:a.estimateFinalityTime(t.fromChain.chain),expires:a.expiration(0,5,0)},e,d)}catch(n){return{success:!1,error:n}}}async initiate(t,e,n,i){const{params:s,details:o}=n,r=t.source.id.address,c=t.destination.id,d=await t.fromChain.getPorticoBridge(),u=d.getTokenGroup(r.toString()),T=(await t.toChain.getPorticoBridge()).getPorticoAddress(u),h=d.transfer(a.Wormhole.parseAddress(e.chain(),e.address()),i,r,a.units(s.normalizedParams.amount),c,T,o);return{originTxs:await a.signSendWait(t.fromChain,h,e),state:a.TransferState.SourceInitiated,from:t.fromChain.chain,to:t.toChain.chain}}async*track(t,e){if(a.isSourceInitiated(t)||a.isSourceFinalized(t)){const{txid:n}=t.originTxs[t.originTxs.length-1],i=await this.wh.getVaa(n,"PorticoBridge:Transfer",e);if(!i)throw new Error("No VAA found for transaction: "+n);const s={chain:i.emitterChain,emitter:i.emitterAddress,sequence:i.sequence};t={...t,state:a.TransferState.Attested,attestation:{id:s,attestation:i}},yield t}a.isAttested(t)&&await(await this.wh.getChain(t.to).getPorticoBridge()).isTransferCompleted(t.attestation.attestation)&&(t={...t,state:a.TransferState.DestinationFinalized},yield t),yield t}async complete(t,e){if(!a.isAttested(e))throw new Error("Source must be attested");const n=await this.wh.getChain(e.to),i=await n.getPorticoBridge(),s=a.Wormhole.chainAddress(t.chain(),t.address()),o=i.redeem(s.address,e.attestation.attestation);return await a.signSendWait(n,o,t)}async fetchSwapQuote(t,e){const n=await t.fromChain.getPorticoBridge(),i=a.units(e.normalizedParams.amount),s=n.getTokenGroup(a.canonicalAddress(e.normalizedParams.sourceToken)),o=await n.quoteSwap(e.normalizedParams.sourceToken.address,e.normalizedParams.canonicalSourceToken.address,s,i),r=o*R/S;if(r>=o)throw new Error("Start slippage too high");const c=await t.toChain.getPorticoBridge(),d=o-r,u=await c.quoteSwap(e.normalizedParams.canonicalDestinationToken.address,e.normalizedParams.destinationToken.address,s,d),m=u*R/S;if(m>=u)throw new Error("Finish slippage too high");const T=u-m;return{minAmountStart:d,minAmountFinish:T}}};f(A,"NATIVE_GAS_DROPOFF_SUPPORTED",!1),f(A,"meta",{name:"AutomaticPortico"});let G=A;class N extends a.ManualRoute{static supportedNetworks(){return["Mainnet","Testnet"]}static supportedChains(t){return a.circleContractChains.has(t)?a.circleContractChains.get(t):[]}static async supportedDestinationTokens(t,e,n){const i=a.usdcContract.get(e.network,e.chain);if(!i)return[];if(!a.isSameToken(t,a.Wormhole.tokenId(e.chain,i)))return[];const{network:s,chain:o}=n;return a.usdcContract.has(s,o)?[a.Wormhole.chainAddress(o,a.usdcContract.get(s,o))]:[]}getDefaultOptions(){return{payload:void 0}}async validate(t,e){return{valid:!0,params:{normalizedParams:{amount:t.parseAmount(e.amount)},options:e.options??this.getDefaultOptions(),...e}}}async quote(t,e){try{return t.displayQuote(await a.CircleTransfer.quoteTransfer(t.fromChain,t.toChain,{automatic:!1,amount:a.units(e.normalizedParams.amount),...e.options}),e)}catch(n){return{success:!1,error:n}}}async initiate(t,e,n,i){const{params:s}=n,o=await a.CircleTransfer.destinationOverrides(t.fromChain,t.toChain,this.toTransferDetails(s,a.Wormhole.chainAddress(e.chain(),e.address()),i)),r=await a.CircleTransfer.transfer(t.fromChain,o,e),c=await a.CircleTransfer.getTransferMessage(t.fromChain,r[r.length-1].txid);return{from:o.from.chain,to:o.to.chain,state:a.TransferState.SourceFinalized,originTxs:r,attestation:{id:c.id,attestation:{message:c.message}}}}async complete(t,e){if(!a.isAttested(e))throw new Error("The source must be finalized in order to complete the transfer");const{id:n,attestation:i}=e.attestation;if(a.CircleBridge.isCircleAttestation(i)){const{message:s,attestation:o}=i;if(!o)throw new Error(`No Circle attestation for ${n}`);const r=this.wh.getChain(e.to),c=await r.getCircleBridge(),d=a.Wormhole.parseAddress(t.chain(),t.address()),u=c.redeem(d,s,o),m=await a.signSendWait(r,u,t);return{...e,state:a.TransferState.DestinationInitiated,destinationTxs:m}}else return e}async resume(t){const e=await a.CircleTransfer.from(this.wh,t,1e4);return a.CircleTransfer.getReceipt(e)}async*track(t,e){yield*a.CircleTransfer.track(this.wh,t,e)}toTransferDetails(t,e,n){return{from:e,to:n,amount:a.units(t.normalizedParams.amount),automatic:!1,...t.options}}}f(N,"meta",{name:"ManualCCTP",provider:"Circle"});class D extends a.AutomaticRoute{static supportedNetworks(){return["Mainnet","Testnet"]}static supportedChains(t){return a.circleContractChains.has(t)?a.circleContractChains.get(t).filter(n=>{var i;return(i=a.circleContracts.get(t,n))==null?void 0:i.wormholeRelayer}):[]}static async supportedDestinationTokens(t,e,n){const i=a.usdcContract.get(e.network,e.chain);if(!i)return[];if(!a.isSameToken(t,a.Wormhole.tokenId(e.chain,i)))return[];const{network:s,chain:o}=n;return a.usdcContract.has(s,o)?[a.Wormhole.chainAddress(o,a.usdcContract.get(s,o))]:[]}getDefaultOptions(){return{nativeGas:0}}async validate(t,e){try{const n=e.options??this.getDefaultOptions();return{valid:!0,params:{normalizedParams:await this.normalizeTransferParams(t,e),options:n,...e}}}catch(n){return{valid:!1,params:e,error:n}}}async quote(t,e){try{return t.displayQuote(await a.CircleTransfer.quoteTransfer(t.fromChain,t.toChain,{automatic:!0,amount:a.units(e.normalizedParams.amount),nativeGas:a.units(e.normalizedParams.nativeGasAmount)}),e)}catch(n){return{success:!1,error:n}}}async normalizeTransferParams(t,e){const n=t.parseAmount(e.amount),s=await(await t.fromChain.getAutomaticCircleBridge()).getRelayerFee(t.toChain.chain),o=s*105n/100n;if(a.units(n)<o)throw new a.MinAmountError(a.fromBaseUnits(o,n.decimals));const r=a.units(n)-s,d=(e.options??this.getDefaultOptions()).nativeGas??0;if(d>1||d<0)throw new Error("Native gas must be between 0.0 and 1.0 (0% and 100%)");let u=0n;if(d>0){let T=await(await t.toChain.getAutomaticCircleBridge()).maxSwapAmount();r<T&&(T=r);const h=1e4,w=BigInt(Math.floor(d*h));u=T*w/BigInt(h),u===r&&u>0n&&(u-=1n)}return{fee:t.amountFromBaseUnits(s),amount:n,nativeGasAmount:t.amountFromBaseUnits(u)}}toTransferDetails(t,e,n){return{from:e,to:n,amount:a.units(t.normalizedParams.amount),automatic:!0,nativeGas:a.units(t.normalizedParams.nativeGasAmount)}}async initiate(t,e,n,i){const{params:s}=n;let o=this.toTransferDetails(s,a.Wormhole.chainAddress(e.chain(),e.address()),i),r=await a.CircleTransfer.transfer(t.fromChain,o,e);const c=await a.CircleTransfer.getTransferMessage(t.fromChain,r[r.length-1].txid);return{from:o.from.chain,to:o.to.chain,state:a.TransferState.SourceFinalized,originTxs:r,attestation:{id:c.id,attestation:{message:c.message}}}}async*track(t,e){yield*a.CircleTransfer.track(this.wh,t,e)}}f(D,"NATIVE_GAS_DROPOFF_SUPPORTED",!0),f(D,"meta",{name:"AutomaticCCTP",provider:"Circle"});class I extends a.ManualRoute{static supportedNetworks(){return["Mainnet"]}static supportedChains(t){return a.tokenBridgeChains(t)}static async supportedDestinationTokens(t,e,n){if(!await this.isSourceTokenSupported(t,e))return[];const i=a.TBTCBridge.getNativeTbtcToken(n.chain);if(i)return[i];const s=await n.getTokenBridge(),o=a.TBTCBridge.getNativeTbtcToken("Ethereum");try{const r=await s.getWrappedAsset(o);return[a.Wormhole.tokenId(n.chain,r.toString())]}catch(r){if(r.message.includes("not a wrapped asset"))return[];throw r}}getDefaultOptions(){return{}}async validate(t,e){return{valid:!0,params:{normalizedParams:{amount:t.parseAmount(e.amount)},options:e.options??this.getDefaultOptions(),...e}}}async quote(t,e){const n=a.estimateFinalityTime(t.fromChain.chain)+a.guardianAttestationEta;return{success:!0,params:e,sourceToken:{token:t.source.id,amount:e.normalizedParams.amount},destinationToken:{token:t.destination.id,amount:e.normalizedParams.amount},eta:n,expires:a.expiration(24,0,0)}}async initiate(t,e,n,i){const s=a.units(n.params.normalizedParams.amount),o=t.fromChain.chain==="Ethereum",r=a.TBTCBridge.getNativeTbtcToken(t.fromChain.chain),c=r&&a.isSameToken(n.sourceToken.token,r);if(c&&!o)return await this.transferNative(t,e,i,s);if(!c&&o)throw new Error("Only tbtc can be transferred on Ethereum");if(!c){const u=await(await t.fromChain.getTokenBridge()).getOriginalAsset(n.sourceToken.token.address),m=a.TBTCBridge.getNativeTbtcToken("Ethereum");if(!a.isSameToken(u,m))throw new Error("Can only transfer wrapped tbtc")}return await this.transferWrapped(t,e,i,s)}async transferNative(t,e,n,i){const s=a.Wormhole.parseAddress(e.chain(),e.address()),r=(await t.fromChain.getTBTCBridge()).transfer(s,n,i);return{originTxs:await a.signSendWait(t.fromChain,r,e),state:a.TransferState.SourceInitiated,from:t.fromChain.chain,to:t.toChain.chain}}async transferWrapped(t,e,n,i){const s=a.Wormhole.parseAddress(e.chain(),e.address()),o=a.tbtc.get(t.fromChain.network,n.chain),r=await t.fromChain.getTokenBridge();let c;return o?c=r.transfer(s,a.Wormhole.chainAddress(t.toChain.chain,o),t.source.id.address,i,n.address.toUniversalAddress().toUint8Array()):c=r.transfer(s,n,t.source.id.address,i),{originTxs:await a.signSendWait(t.fromChain,c,e),state:a.TransferState.SourceInitiated,from:t.fromChain.chain,to:t.toChain.chain}}async complete(t,e){if(!a.isAttested(e))throw new Error("The source must be finalized in order to complete the transfer");const n=a.Wormhole.parseAddress(t.chain(),t.address()),i=e.attestation.attestation,s=this.wh.getChain(e.to);let o;if(i.payloadLiteral==="TBTCBridge:GatewayTransfer")o=(await s.getTBTCBridge()).redeem(n,i);else{const c=await s.getTokenBridge(),d=a.serialize$1(i),u=a.deserialize("TokenBridge:Transfer",d);o=c.redeem(n,u)}const r=await a.signSendWait(s,o,t);return{...e,state:a.TransferState.DestinationInitiated,destinationTxs:r}}async resume(t){const e=await this.wh.getVaa(t.txid,a.TBTCBridge.getTransferDiscriminator());if(!e)throw new Error("No VAA found for transaction: "+t);const n=a.TBTCBridge.getNativeTbtcToken("Ethereum"),{chain:i,address:s}=e.payload.token;if(!a.isSameToken(n,{chain:i,address:s}))throw new Error("Can only resume tbtc transfers");return{originTxs:[t],state:a.TransferState.Attested,from:e.emitterChain,to:e.payload.to.chain,attestation:{id:{chain:e.emitterChain,emitter:e.emitterAddress,sequence:e.sequence},attestation:e}}}async*track(t,e){if(a.isSourceInitiated(t)||a.isSourceFinalized(t)){const{txid:n}=t.originTxs[t.originTxs.length-1],i=await this.wh.getVaa(n,a.TBTCBridge.getTransferDiscriminator(),e);if(!i)throw new Error("No VAA found for transaction: "+n);const s={chain:i.emitterChain,emitter:i.emitterAddress,sequence:i.sequence};t={...t,state:a.TransferState.Attested,attestation:{id:s,attestation:i}},yield t}a.isAttested(t)&&await(await this.wh.getChain(t.to).getTokenBridge()).isTransferCompleted(t.attestation.attestation)&&(t={...t,state:a.TransferState.DestinationFinalized},yield t),yield t}static async isSourceTokenSupported(t,e){if(a.isNative(t.address))return!1;const n=a.TBTCBridge.getNativeTbtcToken(e.chain);if(n&&a.isSameToken(t,n))return!0;const i=await e.getTokenBridge();try{const s=await i.getOriginalAsset(t.address);return a.isSameToken(s,a.TBTCBridge.getNativeTbtcToken("Ethereum"))}catch(s){if(s.message.includes("not a wrapped asset"))return!1;throw s}}}f(I,"meta",{name:"ManualTBTC"});const J=Object.freeze(Object.defineProperty({__proto__:null,AutomaticCCTPRoute:D,AutomaticPorticoRoute:G,AutomaticRoute:a.AutomaticRoute,AutomaticTokenBridgeRoute:b,BPS_PER_HUNDRED_PERCENT:S,CCTPRoute:N,ExecutorTokenBridgeRoute:x,FinalizableRoute:a.FinalizableRoute,MAX_SLIPPAGE_BPS:V,ManualRoute:a.ManualRoute,MinAmountError:a.MinAmountError,RelayFailedError:a.RelayFailedError,Route:a.Route,RouteResolver:a.RouteResolver,RouteTransferRequest:z,SLIPPAGE_BPS:R,TBTCRoute:I,TokenBridgeRoute:O,UnavailableError:a.UnavailableError,checkAndCompleteTransfer:_,executorTokenBridgeRoute:j,isAutomatic:a.isAutomatic,isFinalizable:a.isFinalizable,isManual:a.isManual},Symbol.toStringTag,{value:"Module"})),K="0x1::aptos_coin::AptosCoin",P="::",M="Aptos",Q=l=>/^(0x)?[0-9a-fA-F]+::\w+::\w+$/.test(l),Y=l=>l.split(P)[0];function Z(l){return l.length%2!==0||l.length<66?(l=l.startsWith("0x")?l.slice(2):l,"0x"+l.padStart(64,"0")):l}const C=class C{constructor(t){f(this,"type","Native");f(this,"address");f(this,"module");if(C.instanceof(t))this.address=t.address,this.module=t.module;else if(a.UniversalAddress.instanceof(t))this.address=t.toUint8Array();else if(typeof t=="string"){if(Q(t)){const e=t.split(P);this.module=e.slice(1).join(P),t=e[0]}if(t=Z(t),!a.hex.valid(t))throw new Error("Invalid Aptos address: "+t);this.address=a.hex.decode(t)}else this.address=t}unwrap(){const t=a.hex.encode(this.address).replace(/^0+/,""),e=this.module?P+this.module:"";return`0x${t}${e}`}toString(){return this.unwrap()}toNative(){return this}toUint8Array(){return this.address}toUniversalAddress(){return new a.UniversalAddress(this.toUint8Array())}static instanceof(t){return t.constructor.platform===C.platform}equals(t){return C.instanceof(t)?t.unwrap()===this.unwrap():this.toUniversalAddress().equals(t)}};f(C,"byteSize",32),f(C,"platform",M);let E=C;a.registerNative(M,E);exports.APTOS_COIN=K;exports.APTOS_SEPARATOR=P;exports.AptosAddress=E;exports.AutomaticCCTPRoute=D;exports.AutomaticTokenBridgeRoute=b;exports.CCTPRoute=N;exports.RouteTransferRequest=z;exports.TBTCRoute=I;exports.TokenBridgeRoute=O;exports._platform=M;exports.coalesceModuleAddress=Y;exports.isValidAptosType=Q;exports.routes=J;
@@ -1,2 +0,0 @@
1
- "use strict";var g=Object.defineProperty;var p=(n,t,s)=>t in n?g(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s;var i=(n,t,s)=>p(n,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./platform-NG3efAb2.js"),a=require("./chunk-KJH4KKG6-CoyI75Ig.js"),h=require("./address-BGujeWtN.js"),c=require("./address-KNhRm6oe.js");async function _(n,t){const[s,e]=await o.AptosPlatform.chainFromRpc(n),r=a.ze.fromPrivateKey({privateKey:new a.z(h.hex.decode(t))});return new f(e,r,n)}class f{constructor(t,s,e,r){i(this,"_chain");i(this,"_account");i(this,"_rpc");i(this,"_debug");this._chain=t,this._account=s,this._rpc=e,this._debug=r}chain(){return this._chain}address(){return this._account.accountAddress.toString()}async signAndSend(t){const s=[];for(const e of t){const{description:r,transaction:u}=e;this._debug&&console.log(`Signing: ${r} for ${this.address()}`);const d=await this._rpc.transaction.build.simple({sender:this._account.accountAddress,data:u}),{hash:l}=await this._simSignSend(d);s.push(l)}return s}async _simSignSend(t){return await this._rpc.transaction.simulate.simple({signerPublicKey:this._account.publicKey,transaction:t}).then(s=>s.forEach(e=>{if(!e.success)throw new Error(`Transaction failed: ${e.vm_status}
2
- ${JSON.stringify(e,null,2)}`)})),this._rpc.signAndSubmitTransaction({signer:this._account,transaction:t}).then(s=>this._rpc.waitForTransaction({transactionHash:s.hash}))}}const m={Address:c.AptosAddress,Platform:o.AptosPlatform,getSigner:_,protocols:{WormholeCore:()=>Promise.resolve().then(()=>require("./index-ClsVcH6F.js")),TokenBridge:()=>Promise.resolve().then(()=>require("./index-DCz_4mcz.js")),CircleBridge:()=>Promise.resolve().then(()=>require("./index-BWXglAWd.js"))},getChain:(n,t,s)=>new o.AptosChain(t,new o.AptosPlatform(n,h.applyChainsConfigConfigOverrides(n,c._platform,{[t]:s})))};exports.default=m;
@@ -1 +0,0 @@
1
- "use strict";const e=require("./address-BGujeWtN.js"),x=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),d=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),t=new Uint32Array(32);function y(p,s,h,l,v,r){const n=v[r],i=v[r+1];let o=t[2*p],u=t[2*p+1],a=t[2*s],f=t[2*s+1],b=t[2*h],w=t[2*h+1],B=t[2*l],c=t[2*l+1],E=e.add3L(o,a,n);u=e.add3H(E,u,f,i),o=E|0,{Dh:c,Dl:B}={Dh:c^u,Dl:B^o},{Dh:c,Dl:B}={Dh:e.rotr32H(c,B),Dl:e.rotr32L(c)},{h:w,l:b}=e.add(w,b,c,B),{Bh:f,Bl:a}={Bh:f^w,Bl:a^b},{Bh:f,Bl:a}={Bh:e.rotrSH(f,a,24),Bl:e.rotrSL(f,a,24)},t[2*p]=o,t[2*p+1]=u,t[2*s]=a,t[2*s+1]=f,t[2*h]=b,t[2*h+1]=w,t[2*l]=B,t[2*l+1]=c}function I(p,s,h,l,v,r){const n=v[r],i=v[r+1];let o=t[2*p],u=t[2*p+1],a=t[2*s],f=t[2*s+1],b=t[2*h],w=t[2*h+1],B=t[2*l],c=t[2*l+1],E=e.add3L(o,a,n);u=e.add3H(E,u,f,i),o=E|0,{Dh:c,Dl:B}={Dh:c^u,Dl:B^o},{Dh:c,Dl:B}={Dh:e.rotrSH(c,B,16),Dl:e.rotrSL(c,B,16)},{h:w,l:b}=e.add(w,b,c,B),{Bh:f,Bl:a}={Bh:f^w,Bl:a^b},{Bh:f,Bl:a}={Bh:e.rotrBH(f,a,63),Bl:e.rotrBL(f,a,63)},t[2*p]=o,t[2*p+1]=u,t[2*s]=a,t[2*s+1]=f,t[2*h]=b,t[2*h+1]=w,t[2*l]=B,t[2*l+1]=c}function A(p,s={},h,l,v){if(e.anumber(h),p<0||p>h)throw new Error("outputLen bigger than keyLen");const{key:r,salt:n,personalization:i}=s;if(r!==void 0&&(r.length<1||r.length>h))throw new Error("key length must be undefined or 1.."+h);if(n!==void 0&&n.length!==l)throw new Error("salt must be undefined or "+l);if(i!==void 0&&i.length!==v)throw new Error("personalization must be undefined or "+v)}class L extends e.Hash$1{constructor(s,h){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,e.anumber(s),e.anumber(h),this.blockLen=s,this.outputLen=h,this.buffer=new Uint8Array(s),this.buffer32=e.u32$2(this.buffer)}update(s){e.aexists(this),s=e.toBytes$1(s),e.abytes(s);const{blockLen:h,buffer:l,buffer32:v}=this,r=s.length,n=s.byteOffset,i=s.buffer;for(let o=0;o<r;){this.pos===h&&(e.swap32IfBE(v),this.compress(v,0,!1),e.swap32IfBE(v),this.pos=0);const u=Math.min(h-this.pos,r-o),a=n+o;if(u===h&&!(a%4)&&o+u<r){const f=new Uint32Array(i,a,Math.floor((r-o)/4));e.swap32IfBE(f);for(let b=0;o+h<r;b+=v.length,o+=h)this.length+=h,this.compress(f,b,!1);e.swap32IfBE(f);continue}l.set(s.subarray(o,o+u),this.pos),this.pos+=u,this.length+=u,o+=u}return this}digestInto(s){e.aexists(this),e.aoutput(s,this);const{pos:h,buffer32:l}=this;this.finished=!0,e.clean(this.buffer.subarray(h)),e.swap32IfBE(l),this.compress(l,0,!0),e.swap32IfBE(l);const v=e.u32$2(s);this.get().forEach((r,n)=>v[n]=e.swap8IfBE(r))}digest(){const{buffer:s,outputLen:h}=this;this.digestInto(s);const l=s.slice(0,h);return this.destroy(),l}_cloneInto(s){const{buffer:h,length:l,finished:v,destroyed:r,outputLen:n,pos:i}=this;return s||(s=new this.constructor({dkLen:n})),s.set(...this.get()),s.buffer.set(h),s.destroyed=r,s.finished=v,s.length=l,s.pos=i,s.outputLen=n,s}clone(){return this._cloneInto()}}class k extends L{constructor(s={}){const h=s.dkLen===void 0?64:s.dkLen;super(128,h),this.v0l=d[0]|0,this.v0h=d[1]|0,this.v1l=d[2]|0,this.v1h=d[3]|0,this.v2l=d[4]|0,this.v2h=d[5]|0,this.v3l=d[6]|0,this.v3h=d[7]|0,this.v4l=d[8]|0,this.v4h=d[9]|0,this.v5l=d[10]|0,this.v5h=d[11]|0,this.v6l=d[12]|0,this.v6h=d[13]|0,this.v7l=d[14]|0,this.v7h=d[15]|0,A(h,s,64,16,16);let{key:l,personalization:v,salt:r}=s,n=0;if(l!==void 0&&(l=e.toBytes$1(l),n=l.length),this.v0l^=this.outputLen|n<<8|65536|1<<24,r!==void 0){r=e.toBytes$1(r);const i=e.u32$2(r);this.v4l^=e.swap8IfBE(i[0]),this.v4h^=e.swap8IfBE(i[1]),this.v5l^=e.swap8IfBE(i[2]),this.v5h^=e.swap8IfBE(i[3])}if(v!==void 0){v=e.toBytes$1(v);const i=e.u32$2(v);this.v6l^=e.swap8IfBE(i[0]),this.v6h^=e.swap8IfBE(i[1]),this.v7l^=e.swap8IfBE(i[2]),this.v7h^=e.swap8IfBE(i[3])}if(l!==void 0){const i=new Uint8Array(this.blockLen);i.set(l),this.update(i)}}get(){let{v0l:s,v0h:h,v1l:l,v1h:v,v2l:r,v2h:n,v3l:i,v3h:o,v4l:u,v4h:a,v5l:f,v5h:b,v6l:w,v6h:B,v7l:c,v7h:E}=this;return[s,h,l,v,r,n,i,o,u,a,f,b,w,B,c,E]}set(s,h,l,v,r,n,i,o,u,a,f,b,w,B,c,E){this.v0l=s|0,this.v0h=h|0,this.v1l=l|0,this.v1h=v|0,this.v2l=r|0,this.v2h=n|0,this.v3l=i|0,this.v3h=o|0,this.v4l=u|0,this.v4h=a|0,this.v5l=f|0,this.v5h=b|0,this.v6l=w|0,this.v6h=B|0,this.v7l=c|0,this.v7h=E|0}compress(s,h,l){this.get().forEach((o,u)=>t[u]=o),t.set(d,16);let{h:v,l:r}=e.fromBig(BigInt(this.length));t[24]=d[8]^r,t[25]=d[9]^v,l&&(t[28]=~t[28],t[29]=~t[29]);let n=0;const i=x;for(let o=0;o<12;o++)y(0,4,8,12,s,h+2*i[n++]),I(0,4,8,12,s,h+2*i[n++]),y(1,5,9,13,s,h+2*i[n++]),I(1,5,9,13,s,h+2*i[n++]),y(2,6,10,14,s,h+2*i[n++]),I(2,6,10,14,s,h+2*i[n++]),y(3,7,11,15,s,h+2*i[n++]),I(3,7,11,15,s,h+2*i[n++]),y(0,5,10,15,s,h+2*i[n++]),I(0,5,10,15,s,h+2*i[n++]),y(1,6,11,12,s,h+2*i[n++]),I(1,6,11,12,s,h+2*i[n++]),y(2,7,8,13,s,h+2*i[n++]),I(2,7,8,13,s,h+2*i[n++]),y(3,4,9,14,s,h+2*i[n++]),I(3,4,9,14,s,h+2*i[n++]);this.v0l^=t[0]^t[16],this.v0h^=t[1]^t[17],this.v1l^=t[2]^t[18],this.v1h^=t[3]^t[19],this.v2l^=t[4]^t[20],this.v2h^=t[5]^t[21],this.v3l^=t[6]^t[22],this.v3h^=t[7]^t[23],this.v4l^=t[8]^t[24],this.v4h^=t[9]^t[25],this.v5l^=t[10]^t[26],this.v5h^=t[11]^t[27],this.v6l^=t[12]^t[28],this.v6h^=t[13]^t[29],this.v7l^=t[14]^t[30],this.v7h^=t[15]^t[31],e.clean(t)}destroy(){this.destroyed=!0,e.clean(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const D=e.createOptHasher(p=>new k(p)),$=D;exports.blake2b=$;
@@ -1,2 +0,0 @@
1
- "use strict";const w=require("./address-BGujeWtN.js");var D={exports:{}};(function(j,d){var v=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof w.commonjsGlobal<"u"&&w.commonjsGlobal,E=function(){function m(){this.fetch=!1,this.DOMException=v.DOMException}return m.prototype=v,new m}();(function(m){(function(h){var a=typeof m<"u"&&m||typeof self<"u"&&self||typeof w.commonjsGlobal<"u"&&w.commonjsGlobal||{},u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function H(e){return e&&DataView.prototype.isPrototypeOf(e)}if(u.arrayBuffer)var F=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],S=ArrayBuffer.isView||function(e){return e&&F.indexOf(Object.prototype.toString.call(e))>-1};function b(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function A(e){return typeof e!="string"&&(e=String(e)),e}function g(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return u.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}i.prototype.append=function(e,t){e=b(e),t=A(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},i.prototype.delete=function(e){delete this.map[b(e)]},i.prototype.get=function(e){return e=b(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(b(e))},i.prototype.set=function(e,t){this.map[b(e)]=A(t)},i.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),g(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),g(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),g(e)},u.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);function T(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function P(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function C(e){var t=new FileReader,r=P(t);return t.readAsArrayBuffer(e),r}function I(e){var t=new FileReader,r=P(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=n?n[1]:"utf-8";return t.readAsText(e,s),r}function M(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function x(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:u.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:u.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u.arrayBuffer&&u.blob&&H(e)?(this._bodyArrayBuffer=x(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||S(e))?this._bodyArrayBuffer=x(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var e=T(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=T(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(u.blob)return this.blob().then(C);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=T(this);if(e)return e;if(this._bodyBlob)return I(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(M(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(G)}),this.json=function(){return this.text().then(JSON.parse)},this}var q=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function L(e){var t=e.toUpperCase();return q.indexOf(t)>-1?t:e}function l(e,t){if(!(this instanceof l))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof l){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new i(t.headers)),this.method=L(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in a){var o=new AbortController;return o.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var s=/\?/;this.url+=(s.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}l.prototype.clone=function(){return new l(this,{body:this._bodyInit})};function G(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),s=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),decodeURIComponent(o))}}),t}function N(e){var t=new i,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
2
- `)===0?n.substr(1,n.length):n}).forEach(function(n){var s=n.split(":"),o=s.shift().trim();if(o){var _=s.join(":").trim();try{t.append(o,_)}catch(O){console.warn("Response "+O.message)}}}),t}R.call(l.prototype);function c(e,t){if(!(this instanceof c))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}R.call(c.prototype),c.prototype.clone=function(){return new c(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},c.error=function(){var e=new c(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var k=[301,302,303,307,308];c.redirect=function(e,t){if(k.indexOf(t)===-1)throw new RangeError("Invalid status code");return new c(null,{status:t,headers:{location:e}})},h.DOMException=a.DOMException;try{new h.DOMException}catch{h.DOMException=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},h.DOMException.prototype=Object.create(Error.prototype),h.DOMException.prototype.constructor=h.DOMException}function B(e,t){return new Promise(function(r,n){var s=new l(e,t);if(s.signal&&s.signal.aborted)return n(new h.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function _(){o.abort()}o.onload=function(){var f={statusText:o.statusText,headers:N(o.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(o.status<200||o.status>599)?f.status=200:f.status=o.status,f.url="responseURL"in o?o.responseURL:f.headers.get("X-Request-URL");var y="response"in o?o.response:o.responseText;setTimeout(function(){r(new c(y,f))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){n(new h.DOMException("Aborted","AbortError"))},0)};function O(f){try{return f===""&&a.location.href?a.location.href:f}catch{return f}}if(o.open(s.method,O(s.url),!0),s.credentials==="include"?o.withCredentials=!0:s.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(u.blob?o.responseType="blob":u.arrayBuffer&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof i||a.Headers&&t.headers instanceof a.Headers)){var U=[];Object.getOwnPropertyNames(t.headers).forEach(function(f){U.push(b(f)),o.setRequestHeader(f,A(t.headers[f]))}),s.headers.forEach(function(f,y){U.indexOf(y)===-1&&o.setRequestHeader(y,f)})}else s.headers.forEach(function(f,y){o.setRequestHeader(y,f)});s.signal&&(s.signal.addEventListener("abort",_),o.onreadystatechange=function(){o.readyState===4&&s.signal.removeEventListener("abort",_)}),o.send(typeof s._bodyInit>"u"?null:s._bodyInit)})}return B.polyfill=!0,a.fetch||(a.fetch=B,a.Headers=i,a.Request=l,a.Response=c),h.Headers=i,h.Request=l,h.Response=c,h.fetch=B,Object.defineProperty(h,"__esModule",{value:!0}),h})({})})(E),E.fetch.ponyfill=!0,delete E.fetch.polyfill;var p=v.fetch?v:E;d=p.fetch,d.default=p.fetch,d.fetch=p.fetch,d.Headers=p.Headers,d.Request=p.Request,d.Response=p.Response,j.exports=d})(D,D.exports);var V=D.exports;const z=w.getDefaultExportFromCjs(V);exports.o=z;
@@ -1 +0,0 @@
1
- "use strict";var p=Object.defineProperty;var l=(r,t,o)=>t in r?p(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o;var i=(r,t,o)=>l(r,typeof t!="symbol"?t+"":t,o);const s=require("./address-BGujeWtN.js");class d{constructor(t,o,e){i(this,"network");i(this,"chain");i(this,"config");i(this,"platform");i(this,"rpc");i(this,"protocols",new Map);i(this,"supportsWormholeCore",()=>this.supportsProtocol("WormholeCore"));i(this,"getWormholeCore",()=>this.getProtocol("WormholeCore"));i(this,"supportsTokenBridge",()=>this.supportsProtocol("TokenBridge"));i(this,"getTokenBridge",()=>this.getProtocol("TokenBridge"));i(this,"supportsAutomaticTokenBridge",()=>this.supportsProtocol("AutomaticTokenBridge"));i(this,"getAutomaticTokenBridge",()=>this.getProtocol("AutomaticTokenBridge"));i(this,"supportsExecutorTokenBridge",()=>this.supportsProtocol("ExecutorTokenBridge"));i(this,"getExecutorTokenBridge",()=>this.getProtocol("ExecutorTokenBridge"));i(this,"supportsCircleBridge",()=>this.supportsProtocol("CircleBridge"));i(this,"getCircleBridge",()=>this.getProtocol("CircleBridge"));i(this,"supportsAutomaticCircleBridge",()=>this.supportsProtocol("AutomaticCircleBridge"));i(this,"getAutomaticCircleBridge",()=>this.getProtocol("AutomaticCircleBridge"));i(this,"supportsIbcBridge",()=>this.supportsProtocol("IbcBridge"));i(this,"getIbcBridge",()=>this.getProtocol("IbcBridge"));i(this,"supportsPorticoBridge",()=>this.supportsProtocol("PorticoBridge"));i(this,"getPorticoBridge",()=>this.getProtocol("PorticoBridge"));i(this,"supportsTBTCBridge",()=>this.supportsProtocol("TBTCBridge"));i(this,"getTBTCBridge",()=>this.getProtocol("TBTCBridge"));this.config=o.config[t],this.platform=o,this.chain=this.config.key,this.network=this.config.network,this.rpc=e}getRpc(){return this.rpc=this.rpc?this.rpc:this.platform.getRpc(this.chain),this.rpc}async getDecimals(t){if(s.isNative(t))return this.config.nativeTokenDecimals;if(this.config.tokenMap){const o=s.canonicalAddress({chain:this.chain,address:t}),e=s.getTokenByAddress(this.network,this.chain,o);if(e)return e.decimals}return this.platform.utils().getDecimals(this.network,this.chain,await this.getRpc(),t)}async getBalance(t,o){return this.platform.utils().getBalance(this.network,this.chain,await this.getRpc(),t,o)}async getLatestBlock(){return this.platform.utils().getLatestBlock(await this.getRpc())}async getLatestFinalizedBlock(){return this.platform.utils().getLatestFinalizedBlock(await this.getRpc())}async parseTransaction(t){return this.platform.parseWormholeMessages(this.chain,await this.getRpc(),t)}async sendWait(t){return this.platform.utils().sendWait(this.chain,await this.getRpc(),t)}getToken(t){if(this.config.tokenMap&&t in this.config.tokenMap)return this.config.tokenMap[t]}async getNativeWrappedTokenId(){if(this.config.wrappedNative){const{address:o}=this.config.wrappedNative;return{chain:this.chain,address:s.toNative(this.chain,o)}}const t=await this.getTokenBridge();return{chain:this.chain,address:await t.getWrappedNative()}}async getTokenAccount(t,o){return{chain:this.chain,address:t}}supportsProtocol(t){return s.protocolIsRegistered(this.chain,t)}async getProtocol(t,o,e){if(!o&&this.protocols.has(t))return this.protocols.get(t);const h=o?{...this.config.contracts,...o}:this.config.contracts,n=e??await this.getRpc(),a=this.platform.getProtocolInitializer(t);let c;if(e){if(o)throw new Error("Custom contracts are currently not supported with custom rpc connection. Add the contracts to the base config.");c=await this.platform.getProtocol(t,n)}else if(s.isVersionedProtocolInitializer(a)){const g=await a.getVersion(n,h);c=new a(this.network,this.chain,n,h,g)}else c=new a(this.network,this.chain,n,h);return o||this.protocols.set(t,c),c}}exports.ChainContext=d;