@wormhole-foundation/wormhole-connect 3.0.1-beta.6-development → 3.0.1-beta.7-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.
- package/dist/assets/{evm-CP2QogPh.js → evm-Daw1hnd1.js} +1 -1
- package/dist/assets/{tokens-p0GcG7JT.js → tokens-CD1l6Xjr.js} +13 -13
- package/dist/main.js +81 -81
- package/dist/src/AppRouter.d.ts.map +1 -1
- package/dist/src/components/AssetBadge.d.ts.map +1 -1
- package/dist/src/components/ConfigurablePageHeader.d.ts +4 -0
- package/dist/src/components/ConfigurablePageHeader.d.ts.map +1 -0
- package/dist/src/components/SampleApp/index.d.ts.map +1 -1
- package/dist/src/components/v3/AlertBanner.d.ts +14 -0
- package/dist/src/components/v3/AlertBanner.d.ts.map +1 -0
- package/dist/src/components/v3/Button.d.ts +22 -0
- package/dist/src/components/v3/Button.d.ts.map +1 -0
- package/dist/src/config/ui.d.ts +1 -1
- package/dist/src/config/ui.d.ts.map +1 -1
- package/dist/src/hooks/useAmountValidation.d.ts +2 -2
- package/dist/src/hooks/useAmountValidation.d.ts.map +1 -1
- package/dist/src/icons/Clock.d.ts +5 -0
- package/dist/src/icons/Clock.d.ts.map +1 -0
- package/dist/src/icons/SwapVertical.d.ts +5 -0
- package/dist/src/icons/SwapVertical.d.ts.map +1 -0
- package/dist/src/icons/TokenIcons.d.ts +1 -1
- package/dist/src/icons/TokenIcons.d.ts.map +1 -1
- package/dist/src/theme.d.ts +10 -3
- package/dist/src/theme.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/AmountInput/index.d.ts +21 -0
- package/dist/src/views/v3/Bridge/AmountInput/index.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/AmountValidationError.d.ts +11 -0
- package/dist/src/views/v3/Bridge/AmountValidationError.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/AssetPicker/ChainList.d.ts +16 -0
- package/dist/src/views/v3/Bridge/AssetPicker/ChainList.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/AssetPicker/PickerBottomSheet.d.ts +31 -0
- package/dist/src/views/v3/Bridge/AssetPicker/PickerBottomSheet.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/AssetPicker/PickerModal.d.ts +32 -0
- package/dist/src/views/v3/Bridge/AssetPicker/PickerModal.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/AssetPicker/SearchableList/SearchInput.d.ts +11 -0
- package/dist/src/views/v3/Bridge/AssetPicker/SearchableList/SearchInput.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/AssetPicker/SearchableList/index.d.ts +20 -0
- package/dist/src/views/v3/Bridge/AssetPicker/SearchableList/index.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/AssetPicker/TokenItem.d.ts +16 -0
- package/dist/src/views/v3/Bridge/AssetPicker/TokenItem.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/AssetPicker/TokenList.d.ts +24 -0
- package/dist/src/views/v3/Bridge/AssetPicker/TokenList.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/AssetPicker/index.d.ts +32 -0
- package/dist/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/GasSlider/index.d.ts +11 -0
- package/dist/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/Routes/RouteBadge.d.ts +9 -0
- package/dist/src/views/v3/Bridge/Routes/RouteBadge.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts +26 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesList.d.ts +20 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesList.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesModal.d.ts +25 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesModal.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/Routes/SingleRoute.d.ts +17 -0
- package/dist/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/Routes/index.d.ts +13 -0
- package/dist/src/views/v3/Bridge/Routes/index.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/SwapInputs/index.d.ts +5 -0
- package/dist/src/views/v3/Bridge/SwapInputs/index.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/WalletConnector/Controller.d.ts +8 -0
- package/dist/src/views/v3/Bridge/WalletConnector/Controller.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/WalletConnector/ExplorerLink.d.ts +10 -0
- package/dist/src/views/v3/Bridge/WalletConnector/ExplorerLink.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/WalletConnector/Sidebar.d.ts +11 -0
- package/dist/src/views/v3/Bridge/WalletConnector/Sidebar.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/WalletConnector/index.d.ts +11 -0
- package/dist/src/views/v3/Bridge/WalletConnector/index.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/index.d.ts +5 -0
- package/dist/src/views/v3/Bridge/index.d.ts.map +1 -0
- package/dist/src/views/v3/Redeem/TransactionDetails/index.d.ts +4 -0
- package/dist/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -0
- package/dist/src/views/v3/Redeem/index.d.ts +5 -0
- package/dist/src/views/v3/Redeem/index.d.ts.map +1 -0
- package/dist/src/views/v3/TxHistory/Item/index.d.ts +8 -0
- package/dist/src/views/v3/TxHistory/Item/index.d.ts.map +1 -0
- package/dist/src/views/v3/TxHistory/Widget/Item.d.ts +9 -0
- package/dist/src/views/v3/TxHistory/Widget/Item.d.ts.map +1 -0
- package/dist/src/views/v3/TxHistory/Widget/index.d.ts +6 -0
- package/dist/src/views/v3/TxHistory/Widget/index.d.ts.map +1 -0
- package/dist/src/views/v3/TxHistory/index.d.ts +4 -0
- package/dist/src/views/v3/TxHistory/index.d.ts.map +1 -0
- package/lib/{account-DtI49BC9.mjs → account-BXlWsVcD.mjs} +1 -1
- package/lib/{account-BNVdeY3i.js → account-D3Whnyky.js} +1 -1
- package/lib/address-B2sdpJNe.js +1 -0
- package/lib/{address-DHjpQ41W.js → address-CFAt6HNS.js} +1 -1
- package/lib/{address-C4qO2bMD.mjs → address-CZArADcj.mjs} +1 -1
- package/lib/{address-BJhcbdG9.mjs → address-DPWm1fbw.mjs} +212 -205
- package/lib/{address-XxuWo72f.js → address-DpQlJQKV.js} +7 -7
- package/lib/{address-QpeLv2yn.mjs → address-YYxpimx3.mjs} +277 -276
- package/lib/{aptos-BPPwy9CZ.js → aptos-BQFrxLpU.js} +1 -1
- package/lib/{aptos-b3ytowip.js → aptos-C6eC7BKq.js} +2 -2
- package/lib/{aptos-C8FBg3S2.mjs → aptos-DNhNK-_f.mjs} +7 -7
- package/lib/{aptos-ButqYPXo.mjs → aptos-YbewU4Io.mjs} +3 -3
- package/lib/{basic-YNjcoRfK.js → basic-BH3rU0o2.js} +1 -1
- package/lib/{basic-BDC-Dz2c.mjs → basic-CVEIWCYi.mjs} +2 -2
- package/lib/{basic-B5VNsnap.mjs → basic-D3Mgm4Qb.mjs} +2 -2
- package/lib/{basic-BR_WJgiZ.js → basic-kfvhCLeC.js} +1 -1
- package/lib/{blake2b-5ZGBTE8v.mjs → blake2b-BFJ9US29.mjs} +7 -7
- package/lib/{blake2b-BJ4wVK7V.js → blake2b-aUiblHhG.js} +1 -1
- package/lib/{browser-ponyfill-C53najnL.js → browser-ponyfill-BeX4lPJd.js} +1 -1
- package/lib/{browser-ponyfill-CuZzL5JS.mjs → browser-ponyfill-Cn2t1qf7.mjs} +1 -1
- package/lib/{chain-B7MIR9_r.mjs → chain-D5okRkwk.mjs} +1 -1
- package/lib/{chain-CSpjwyBt.js → chain-Dme8n2tA.js} +1 -1
- package/lib/{chunk-KJH4KKG6-qC3BvugF.mjs → chunk-KJH4KKG6-DTOJZuhY.mjs} +144 -144
- package/lib/{chunk-KJH4KKG6-B9iq51o1.js → chunk-KJH4KKG6-HfCF1Kt-.js} +1 -1
- package/lib/{constants-DWhraRof.mjs → constants-BHQAYN6w.mjs} +3 -3
- package/lib/{constants-BA7a60_u.js → constants-BsKTcZQ3.js} +1 -1
- package/lib/{contract-D4Vzf62E.mjs → contract-CjL0DzEO.mjs} +39 -39
- package/lib/{contract-CQnkFb54.js → contract-DPL0fm8A.js} +1 -1
- package/lib/{core-DY8-r2Jo.mjs → core-C67jLszg.mjs} +7 -7
- package/lib/{core-DzA-Itto.js → core-DmZlgGHj.js} +3 -3
- package/lib/{create-CtvZoy0X.mjs → create-BlfwwO0_.mjs} +3 -3
- package/lib/{create-DCJBhyHG.js → create-CovWyutZ.js} +1 -1
- package/lib/{evm-BvQ1H4_y.js → evm-BWTWGvAv.js} +2 -2
- package/lib/{evm-Dn0xYGMV.mjs → evm-BohuNM6V.mjs} +9 -9
- package/lib/{evm-CrfP3Qfk.js → evm-CqywsvEZ.js} +2 -2
- package/lib/{evm-BfefVZFh.mjs → evm-M0ImOGaN.mjs} +7 -7
- package/lib/executor.js +1 -1
- package/lib/executor.mjs +46 -46
- package/lib/hosted.js +1 -1
- package/lib/hosted.mjs +1 -1
- package/lib/{index-CnCmR4Uj.js → index-2CmAUr-U.js} +1 -1
- package/lib/{index-DF2WGKez.js → index-85b_tiAE.js} +1 -1
- package/lib/{index-Ct88Toxl.mjs → index-95FB4Qgc.mjs} +3 -3
- package/lib/{index-lN-puZih.js → index-B7ho7Pb6.js} +1 -1
- package/lib/{index-DbPhljz1.mjs → index-BAUIp5vX.mjs} +15 -15
- package/lib/{index-DQp_O8iB.mjs → index-BCZtiDee.mjs} +4 -4
- package/lib/{index-BiS8vv7E.mjs → index-BGq4wC4S.mjs} +1 -1
- package/lib/{index-CBHIr2qc.mjs → index-BQuPDPUZ.mjs} +14 -14
- package/lib/{index-C1NzL1cw.mjs → index-BSj3tfTR.mjs} +3 -3
- package/lib/{index-CbVRI3aO.mjs → index-BV1jWLbR.mjs} +40 -40
- package/lib/{index-CXwf1C77.mjs → index-BXk8QNCQ.mjs} +6 -6
- package/lib/{index-DwX86vgy.mjs → index-BcAk5RDV.mjs} +31 -31
- package/lib/{index-BarjntIo.mjs → index-BgOkhLJ5.mjs} +4 -4
- package/lib/{index-BjbPJ-9w.js → index-BkPAiliF.js} +1 -1
- package/lib/{index-DLilRB-O.js → index-Bn-q9qez.js} +1 -1
- package/lib/{index-3pNz5RJC.js → index-Bt7K1A1Q.js} +1 -1
- package/lib/{index-BrjiGZLN.mjs → index-C-NwpT7M.mjs} +4 -4
- package/lib/{index-B2oGf_0Z.js → index-C7dcnZ_Y.js} +1 -1
- package/lib/{index-BuxGl_Bi.js → index-C9Mdci2_.js} +1 -1
- package/lib/index-CBBfcDND.js +335 -0
- package/lib/{index-BGsoGuxr.js → index-CGjibiRn.js} +1 -1
- package/lib/{index-Yra08X_i.js → index-CJ_ewe88.js} +1 -1
- package/lib/{index-CS1x3lLl.mjs → index-CMyIX4q3.mjs} +1 -1
- package/lib/{index-C6plXYir.mjs → index-CPq5TByt.mjs} +31052 -27169
- package/lib/{index-Czoo2lwG.mjs → index-Cd2G9Q0O.mjs} +2 -2
- package/lib/{index-iXUxUBar.js → index-D8YqkJyN.js} +1 -1
- package/lib/{index-BG9uNreI.js → index-DMtTF3lo.js} +1 -1
- package/lib/{index-DrcGXX5n.mjs → index-DRZtHRGC.mjs} +5 -5
- package/lib/{index-BZsgCHbh.js → index-DSFtUxH1.js} +1 -1
- package/lib/{index-B9Jj-myq.mjs → index-DYspQsyV.mjs} +4 -4
- package/lib/{index-BPdR4VSR.mjs → index-Difh_8Uq.mjs} +35 -35
- package/lib/{index-D2-kSqKC.mjs → index-Dl11esS0.mjs} +12 -12
- package/lib/{index-Dg1FDsF7.js → index-DlZQ535U.js} +1 -1
- package/lib/{index-DPZNqrkJ.mjs → index-DnaDROoD.mjs} +3 -3
- package/lib/{index-C6deIq6M.js → index-DocFg1hF.js} +1 -1
- package/lib/{index-BHv9flJb.js → index-DpEQBLtA.js} +1 -1
- package/lib/{index-OjOZm9KZ.mjs → index-DpSdWR-Q.mjs} +19 -19
- package/lib/{index-DCIXsPdt.js → index-DzxRHhWq.js} +1 -1
- package/lib/{index-BYNs7o4U.js → index-LMdITOCB.js} +1 -1
- package/lib/{index-C3JpIduu.js → index-cT-KFIxA.js} +1 -1
- package/lib/{index-TWJ3iDnH.js → index-k6e49slq.js} +1 -1
- package/lib/{index-t4mLpVUg.mjs → index-uuu1viWa.mjs} +1 -1
- package/lib/{index.es-CGmlPDhv.js → index.es-BYFwv7lT.js} +1 -1
- package/lib/{index.es-Cv23C4D_.mjs → index.es-BhhigIOQ.mjs} +3 -3
- package/lib/{index.es-C-nP3Wu4.mjs → index.es-DGqzeimm.mjs} +5 -5
- package/lib/{index.es-DOcp1QIZ.js → index.es-Fc3_m80E.js} +3 -3
- package/lib/index.js +1 -1
- package/lib/index.mjs +2 -2
- package/lib/mayan.js +9 -2
- package/lib/mayan.mjs +21900 -18117
- package/lib/{mint-DDRe5tvc.js → mint-C2AsTCD2.js} +1 -1
- package/lib/{mint-CwWYApOB.mjs → mint-CLB7p3ZL.mjs} +2 -2
- package/lib/ntt.js +1 -1
- package/lib/ntt.mjs +2370 -2323
- package/lib/{platform-Cdz3d-G9.js → platform-Cl1b31bn.js} +1 -1
- package/lib/{platform-C2My6P6V.js → platform-DV62YjSS.js} +1 -1
- package/lib/{platform-CkZe-n0U.js → platform-Dw5tN12f.js} +1 -1
- package/lib/{platform-B0QvkHbE.mjs → platform-bCY3DvqI.mjs} +14 -14
- package/lib/{platform-lg76WojY.mjs → platform-mkzPOtcO.mjs} +42 -21
- package/lib/{platform-IW8iV_CA.mjs → platform-pX0KL6zm.mjs} +6 -6
- package/lib/{provider-jsonrpc-Bd_Ha8XL.js → provider-jsonrpc-B0bAKP-a.js} +1 -1
- package/lib/{provider-jsonrpc-BXNY8lbA.mjs → provider-jsonrpc-DwKu1fjn.mjs} +120 -120
- package/lib/{secp256k1-BaYwfoJI.js → secp256k1-1EcPGQYM.js} +1 -1
- package/lib/{secp256k1-etdIygIN.mjs → secp256k1-6Zr6y_zm.mjs} +1 -1
- package/lib/{secp256k1-D3q9LbdQ.js → secp256k1-7IiVcfA7.js} +1 -1
- package/lib/{secp256k1-luy_3ZLQ.mjs → secp256k1-BeZAjIBs.mjs} +1 -1
- package/lib/{secp256k1-Cplgnjin.mjs → secp256k1-DXI-6Erh.mjs} +1 -1
- package/lib/{secp256k1-CuaGNRQC.js → secp256k1-Y38qxq0y.js} +1 -1
- package/lib/{signer-DKbAIeFy.mjs → signer-CzGPDOMI.mjs} +20 -20
- package/lib/{signer-BrSuBAB7.js → signer-D6-3r3Sp.js} +1 -1
- package/lib/{solana-BnirZbTQ.js → solana-Da7iWCux.js} +4 -4
- package/lib/solana-mjJtTggS.js +1 -0
- package/lib/{solana-DR8_Oms-.mjs → solana-os3Osxo6.mjs} +10 -10
- package/lib/solana-vo_l-zLm.mjs +18 -0
- package/lib/{solanaEmbed.esm-fUPiKqY3.mjs → solanaEmbed.esm-BBnVqCsz.mjs} +2 -2
- package/lib/{solanaEmbed.esm-BKWwcEou.js → solanaEmbed.esm-RhVD6vLR.js} +1 -1
- package/lib/src/AppRouter.d.ts.map +1 -1
- package/lib/src/components/AssetBadge.d.ts.map +1 -1
- package/lib/src/components/ConfigurablePageHeader.d.ts +4 -0
- package/lib/src/components/ConfigurablePageHeader.d.ts.map +1 -0
- package/lib/src/components/SampleApp/index.d.ts.map +1 -1
- package/lib/src/components/v3/AlertBanner.d.ts +14 -0
- package/lib/src/components/v3/AlertBanner.d.ts.map +1 -0
- package/lib/src/components/v3/Button.d.ts +22 -0
- package/lib/src/components/v3/Button.d.ts.map +1 -0
- package/lib/src/config/ui.d.ts +1 -1
- package/lib/src/config/ui.d.ts.map +1 -1
- package/lib/src/hooks/useAmountValidation.d.ts +2 -2
- package/lib/src/hooks/useAmountValidation.d.ts.map +1 -1
- package/lib/src/icons/Clock.d.ts +5 -0
- package/lib/src/icons/Clock.d.ts.map +1 -0
- package/lib/src/icons/SwapVertical.d.ts +5 -0
- package/lib/src/icons/SwapVertical.d.ts.map +1 -0
- package/lib/src/icons/TokenIcons.d.ts +1 -1
- package/lib/src/icons/TokenIcons.d.ts.map +1 -1
- package/lib/src/theme.d.ts +10 -3
- package/lib/src/theme.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/AmountInput/index.d.ts +21 -0
- package/lib/src/views/v3/Bridge/AmountInput/index.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/AmountValidationError.d.ts +11 -0
- package/lib/src/views/v3/Bridge/AmountValidationError.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/AssetPicker/ChainList.d.ts +16 -0
- package/lib/src/views/v3/Bridge/AssetPicker/ChainList.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/AssetPicker/PickerBottomSheet.d.ts +31 -0
- package/lib/src/views/v3/Bridge/AssetPicker/PickerBottomSheet.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/AssetPicker/PickerModal.d.ts +32 -0
- package/lib/src/views/v3/Bridge/AssetPicker/PickerModal.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/AssetPicker/SearchableList/SearchInput.d.ts +11 -0
- package/lib/src/views/v3/Bridge/AssetPicker/SearchableList/SearchInput.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/AssetPicker/SearchableList/index.d.ts +20 -0
- package/lib/src/views/v3/Bridge/AssetPicker/SearchableList/index.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/AssetPicker/TokenItem.d.ts +16 -0
- package/lib/src/views/v3/Bridge/AssetPicker/TokenItem.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/AssetPicker/TokenList.d.ts +24 -0
- package/lib/src/views/v3/Bridge/AssetPicker/TokenList.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/AssetPicker/index.d.ts +32 -0
- package/lib/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/GasSlider/index.d.ts +11 -0
- package/lib/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/Routes/RouteBadge.d.ts +9 -0
- package/lib/src/views/v3/Bridge/Routes/RouteBadge.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts +26 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesList.d.ts +20 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesList.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesModal.d.ts +25 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesModal.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/Routes/SingleRoute.d.ts +17 -0
- package/lib/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/Routes/index.d.ts +13 -0
- package/lib/src/views/v3/Bridge/Routes/index.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/SwapInputs/index.d.ts +5 -0
- package/lib/src/views/v3/Bridge/SwapInputs/index.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/WalletConnector/Controller.d.ts +8 -0
- package/lib/src/views/v3/Bridge/WalletConnector/Controller.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/WalletConnector/ExplorerLink.d.ts +10 -0
- package/lib/src/views/v3/Bridge/WalletConnector/ExplorerLink.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/WalletConnector/Sidebar.d.ts +11 -0
- package/lib/src/views/v3/Bridge/WalletConnector/Sidebar.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/WalletConnector/index.d.ts +11 -0
- package/lib/src/views/v3/Bridge/WalletConnector/index.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/index.d.ts +5 -0
- package/lib/src/views/v3/Bridge/index.d.ts.map +1 -0
- package/lib/src/views/v3/Redeem/TransactionDetails/index.d.ts +4 -0
- package/lib/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -0
- package/lib/src/views/v3/Redeem/index.d.ts +5 -0
- package/lib/src/views/v3/Redeem/index.d.ts.map +1 -0
- package/lib/src/views/v3/TxHistory/Item/index.d.ts +8 -0
- package/lib/src/views/v3/TxHistory/Item/index.d.ts.map +1 -0
- package/lib/src/views/v3/TxHistory/Widget/Item.d.ts +9 -0
- package/lib/src/views/v3/TxHistory/Widget/Item.d.ts.map +1 -0
- package/lib/src/views/v3/TxHistory/Widget/index.d.ts +6 -0
- package/lib/src/views/v3/TxHistory/Widget/index.d.ts.map +1 -0
- package/lib/src/views/v3/TxHistory/index.d.ts +4 -0
- package/lib/src/views/v3/TxHistory/index.d.ts.map +1 -0
- package/lib/{sui-BTGAAvA9.js → sui-BCWT_MP3.js} +1 -1
- package/lib/{sui-BBqJwRM0.mjs → sui-CFKprzku.mjs} +3 -3
- package/lib/{sui-DTftSE5y.js → sui-CO5gTC2j.js} +1 -1
- package/lib/{sui-DAYuRjfB.mjs → sui-rzSF8U-3.mjs} +33 -33
- package/lib/{tokens-tq3iPasz.js → tokens-D2BbVV4x.js} +1 -1
- package/lib/{tokens-Bdu7ORRI.mjs → tokens-D74pLzp3.mjs} +3 -3
- package/lib/{units-Brhe0Yro.mjs → units-BGcsq4mJ.mjs} +24 -24
- package/lib/{units-CMwYFpwc.js → units-CFxZtEkH.js} +1 -1
- package/lib/{unsignedTransaction-Brbbx5Uc.mjs → unsignedTransaction-BHbKxuLa.mjs} +14 -14
- package/lib/{unsignedTransaction-q5Fk1S0o.js → unsignedTransaction-D14ic9We.js} +1 -1
- package/lib/{w3m-modal-BfRfCY9F.js → w3m-modal-253PNp3t.js} +1 -1
- package/lib/{w3m-modal-CtPzALaO.mjs → w3m-modal-BXoUHiVS.mjs} +2 -2
- package/lib/{w3m-modal-BhCXAHBR.js → w3m-modal-Dr98fjep.js} +1 -1
- package/lib/{w3m-modal-Dbhbe_NS.mjs → w3m-modal-vJ0TMybJ.mjs} +2 -2
- package/lib/{web3-Atnj-SZ3.mjs → web3-C7dEQmtr.mjs} +6 -6
- package/lib/{web3-DinKgkT9.js → web3-Co7tl8ed.js} +1 -1
- package/package.json +32 -33
- package/lib/address-BWzhA9di.js +0 -1
- package/lib/index-BjP-grbs.js +0 -299
- package/lib/solana-D_QkC8QG.mjs +0 -18
- package/lib/solana-pu7cIYt0.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var l = (m, t, a) =>
|
|
4
|
-
import { G as
|
|
1
|
+
var yt = Object.defineProperty;
|
|
2
|
+
var vt = (m, t, a) => t in m ? yt(m, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : m[t] = a;
|
|
3
|
+
var l = (m, t, a) => vt(m, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
+
import { G as Z, u as C, b9 as nt, T as w, O as Pt, B as ct, Q as b, C as dt, ak as bt, ad as I, ba as it, m as R, bb as f, F as h, af as q, N as st, aP as _, q as xt, W as g, bc as Dt, o as P, V as Bt, t as Et, aS as S, bd as L, be as mt, bf as ot, bg as $, bh as St, bi as ut, aQ as lt, al as ht, am as ft, bj as Q, D as F, A as D, bk as A, bl as zt, bm as Ft, I as v, aR as Gt, bn as Ot, aD as It, ab as Nt, aO as Rt, R as Mt, bo as Ut, bp as _t, ae as Qt, bq as Vt, r as Lt, U as rt, k as H } from "./address-YYxpimx3.mjs";
|
|
5
5
|
class tt {
|
|
6
6
|
constructor(t, a, e, n, i) {
|
|
7
7
|
l(this, "source");
|
|
@@ -12,21 +12,21 @@ class tt {
|
|
|
12
12
|
this.fromChain = t, this.toChain = a, this.source = e, this.destination = n, this.recipient = i;
|
|
13
13
|
}
|
|
14
14
|
parseAmount(t) {
|
|
15
|
-
return
|
|
15
|
+
return Z(t, this.source.decimals);
|
|
16
16
|
}
|
|
17
17
|
amountFromBaseUnits(t) {
|
|
18
|
-
return
|
|
18
|
+
return C(t, this.source.decimals);
|
|
19
19
|
}
|
|
20
20
|
async displayQuote(t, a, e) {
|
|
21
21
|
let n = {
|
|
22
22
|
success: !0,
|
|
23
23
|
sourceToken: {
|
|
24
24
|
token: t.sourceToken.token,
|
|
25
|
-
amount:
|
|
25
|
+
amount: C(t.sourceToken.amount, this.source.decimals)
|
|
26
26
|
},
|
|
27
27
|
destinationToken: {
|
|
28
28
|
token: t.destinationToken.token,
|
|
29
|
-
amount:
|
|
29
|
+
amount: C(t.destinationToken.amount, this.destination.decimals)
|
|
30
30
|
},
|
|
31
31
|
params: a
|
|
32
32
|
};
|
|
@@ -34,12 +34,12 @@ class tt {
|
|
|
34
34
|
const s = await (t.relayFee.token.chain === this.fromChain.chain ? this.fromChain : this.toChain).getDecimals(t.relayFee.token.address);
|
|
35
35
|
n.relayFee = {
|
|
36
36
|
token: t.relayFee.token,
|
|
37
|
-
amount:
|
|
37
|
+
amount: C(t.relayFee.amount, s)
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
if (t.destinationNativeGas) {
|
|
41
41
|
const i = await this.toChain.getDecimals("native");
|
|
42
|
-
n.destinationNativeGas =
|
|
42
|
+
n.destinationNativeGas = C(t.destinationNativeGas, i);
|
|
43
43
|
}
|
|
44
44
|
return t.warnings && t.warnings.length > 0 && (n.warnings = [...t.warnings]), n.eta = t.eta, n.expires = t.expires, e && (n.details = e), n;
|
|
45
45
|
}
|
|
@@ -49,27 +49,27 @@ class tt {
|
|
|
49
49
|
return new tt(e, n, i, s, a.recipient);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
async function
|
|
52
|
+
async function wt(m, t, a, e = 120 * 1e3, n = console.log) {
|
|
53
53
|
const i = Date.now();
|
|
54
54
|
n("Checking transfer state...");
|
|
55
55
|
for await (t of m.track(t, 120 * 1e3))
|
|
56
|
-
n("Current Transfer State: ",
|
|
57
|
-
if (
|
|
56
|
+
n("Current Transfer State: ", w[t.state]);
|
|
57
|
+
if (Pt(t))
|
|
58
58
|
return t;
|
|
59
59
|
if (ct(m) && b(t) && a) {
|
|
60
60
|
n("Completing transfer...");
|
|
61
61
|
const o = await m.complete(a, t);
|
|
62
62
|
n("Completed transfer with txids: ", o);
|
|
63
63
|
}
|
|
64
|
-
if (dt(m) &&
|
|
64
|
+
if (dt(m) && bt(t) && a) {
|
|
65
65
|
n("Finalizing transfer...");
|
|
66
66
|
const o = await m.finalize(a, t);
|
|
67
67
|
n("Finalized transfer with txids: ", o);
|
|
68
68
|
}
|
|
69
69
|
const s = e - (Date.now() - i);
|
|
70
|
-
return s > 0 ? (n("Transfer not complete, trying again in a 2000ms..."), await new Promise((r) => setTimeout(r, 2e3)),
|
|
70
|
+
return s > 0 ? (n("Transfer not complete, trying again in a 2000ms..."), await new Promise((r) => setTimeout(r, 2e3)), wt(m, t, a, s)) : t;
|
|
71
71
|
}
|
|
72
|
-
class
|
|
72
|
+
class j extends I {
|
|
73
73
|
static supportedNetworks() {
|
|
74
74
|
return ["Mainnet", "Testnet"];
|
|
75
75
|
}
|
|
@@ -80,7 +80,7 @@ class H extends I {
|
|
|
80
80
|
// get the list of destination tokens that may be received on the destination chain
|
|
81
81
|
static async supportedDestinationTokens(t, a, e) {
|
|
82
82
|
try {
|
|
83
|
-
if (!
|
|
83
|
+
if (!R(t) && !await (await a.getAutomaticTokenBridge()).isRegisteredToken(t.address))
|
|
84
84
|
return [];
|
|
85
85
|
const n = await f.lookupDestinationToken(a, e, t);
|
|
86
86
|
return await (await e.getAutomaticTokenBridge()).isRegisteredToken(n.address) ? [n] : [];
|
|
@@ -97,7 +97,7 @@ class H extends I {
|
|
|
97
97
|
if (e.nativeGas && (e.nativeGas > 1 || e.nativeGas < 0))
|
|
98
98
|
throw new Error("Native gas must be between 0.0 and 1.0 (0% and 100%)");
|
|
99
99
|
const { destination: n } = t;
|
|
100
|
-
|
|
100
|
+
R(n.id.address) && e.nativeGas === 0 && (e.nativeGas = 0);
|
|
101
101
|
const i = { ...a, options: e };
|
|
102
102
|
return { valid: !0, params: {
|
|
103
103
|
...i,
|
|
@@ -108,27 +108,27 @@ class H extends I {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
async normalizeTransferParams(t, a) {
|
|
111
|
-
const e = t.parseAmount(a.amount), n =
|
|
111
|
+
const e = t.parseAmount(a.amount), n = R(t.source.id.address) ? await t.fromChain.getNativeWrappedTokenId() : t.source.id, s = await (await t.fromChain.getAutomaticTokenBridge()).getRelayerFee(t.toChain.chain, n.address), o = s * 105n / 100n;
|
|
112
112
|
if (h(e) < o)
|
|
113
|
-
throw new
|
|
113
|
+
throw new q(C(o, e.decimals));
|
|
114
114
|
const r = h(e) - s;
|
|
115
|
-
let c =
|
|
115
|
+
let c = C(0n, t.source.decimals);
|
|
116
116
|
if (a.options && a.options.nativeGas > 0) {
|
|
117
117
|
let u = await (await t.toChain.getAutomaticTokenBridge()).maxSwapAmount(t.destination.id.address);
|
|
118
|
-
const p = st(
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
c =
|
|
118
|
+
const p = st(C(r, e.decimals), f.MAX_DECIMALS), T = await t.toChain.getDecimals(t.destination.id.address), k = h(_(p, T));
|
|
119
|
+
k < u && (u = k);
|
|
120
|
+
const G = 1e4, N = BigInt(Math.floor(a.options.nativeGas * G)), W = u * N / BigInt(G), O = C(W, t.destination.decimals);
|
|
121
|
+
c = _(st(O, f.MAX_DECIMALS), t.source.decimals), h(c) > r && (c = C(r, t.source.decimals));
|
|
122
122
|
}
|
|
123
123
|
return {
|
|
124
|
-
fee:
|
|
124
|
+
fee: C(s, t.source.decimals),
|
|
125
125
|
amount: e,
|
|
126
126
|
nativeGasAmount: c
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
async quote(t, a) {
|
|
130
130
|
const e = await t.fromChain.getAutomaticTokenBridge();
|
|
131
|
-
if (
|
|
131
|
+
if (xt(t.source.id) && !await e.isRegisteredToken(t.source.id.address))
|
|
132
132
|
return {
|
|
133
133
|
success: !1,
|
|
134
134
|
error: new Error("Source token is not registered")
|
|
@@ -149,11 +149,11 @@ class H extends I {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
async initiate(t, a, e, n) {
|
|
152
|
-
const { params: i } = e, s = this.toTransferDetails(t, i,
|
|
152
|
+
const { params: i } = e, s = this.toTransferDetails(t, i, g.chainAddress(a.chain(), a.address()), n), o = await f.transfer(t.fromChain, s, a);
|
|
153
153
|
return {
|
|
154
154
|
from: s.from.chain,
|
|
155
155
|
to: s.to.chain,
|
|
156
|
-
state:
|
|
156
|
+
state: w.SourceInitiated,
|
|
157
157
|
originTxs: o
|
|
158
158
|
};
|
|
159
159
|
}
|
|
@@ -175,15 +175,15 @@ class H extends I {
|
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
l(
|
|
178
|
+
l(j, "NATIVE_GAS_DROPOFF_SUPPORTED", !0), l(j, "meta", {
|
|
179
179
|
name: "AutomaticTokenBridge"
|
|
180
180
|
});
|
|
181
|
-
function
|
|
182
|
-
class t extends
|
|
181
|
+
function Wt(m = {}) {
|
|
182
|
+
class t extends V {
|
|
183
183
|
}
|
|
184
184
|
return l(t, "config", m), t;
|
|
185
185
|
}
|
|
186
|
-
class
|
|
186
|
+
const B = class B extends I {
|
|
187
187
|
constructor() {
|
|
188
188
|
super(...arguments);
|
|
189
189
|
// @ts-ignore
|
|
@@ -195,7 +195,7 @@ class z extends I {
|
|
|
195
195
|
return ["Mainnet", "Testnet"];
|
|
196
196
|
}
|
|
197
197
|
static supportedChains(a) {
|
|
198
|
-
return
|
|
198
|
+
return a === "Devnet" ? [] : Dt(a);
|
|
199
199
|
}
|
|
200
200
|
static async supportedDestinationTokens(a, e, n) {
|
|
201
201
|
try {
|
|
@@ -208,7 +208,7 @@ class z extends I {
|
|
|
208
208
|
return { nativeGas: 0 };
|
|
209
209
|
}
|
|
210
210
|
async validate(a, e) {
|
|
211
|
-
const n =
|
|
211
|
+
const n = Z(e.amount, a.source.decimals), i = e.options ?? this.getDefaultOptions();
|
|
212
212
|
if (i.nativeGas && (i.nativeGas > 1 || i.nativeGas < 0))
|
|
213
213
|
throw new Error("Native gas must be between 0.0 and 1.0 (0% and 100%)");
|
|
214
214
|
return { valid: !0, params: {
|
|
@@ -218,78 +218,84 @@ class z extends I {
|
|
|
218
218
|
} };
|
|
219
219
|
}
|
|
220
220
|
async quote(a, e) {
|
|
221
|
-
var
|
|
221
|
+
var i, s, o, r, c, d, u, p, T;
|
|
222
|
+
const n = B.supportedChains(a.fromChain.network);
|
|
223
|
+
if (!n.includes(a.fromChain.chain) || !n.includes(a.toChain.chain))
|
|
224
|
+
return {
|
|
225
|
+
success: !1,
|
|
226
|
+
error: new Error(`Executor Token Bridge does not support transfers from ${a.fromChain.chain} to ${a.toChain.chain}`)
|
|
227
|
+
};
|
|
222
228
|
try {
|
|
223
|
-
let
|
|
224
|
-
const
|
|
225
|
-
let { gasLimit:
|
|
226
|
-
if (((
|
|
227
|
-
const
|
|
228
|
-
x !== void 0 && (
|
|
229
|
+
let k;
|
|
230
|
+
const G = await a.toChain.getExecutorTokenBridge();
|
|
231
|
+
let { gasLimit: N, msgValue: W } = await G.estimateMsgValueAndGasLimit(a.destination.id, a.recipient);
|
|
232
|
+
if (((i = this.staticConfig.referrerFee) == null ? void 0 : i.referrerFeeDbps) !== void 0 && (k = this.staticConfig.referrerFee.referrerFeeDbps), (s = this.staticConfig.referrerFee) != null && s.tokenFeeOverrides) {
|
|
233
|
+
const y = P(a.source.id), x = (r = (o = this.staticConfig.referrerFee.tokenFeeOverrides[this.wh.network]) == null ? void 0 : o[a.fromChain.chain]) == null ? void 0 : r[y];
|
|
234
|
+
x !== void 0 && (k = x);
|
|
229
235
|
}
|
|
230
236
|
if (this.staticConfig.tokenOverrides) {
|
|
231
|
-
const
|
|
232
|
-
(x == null ? void 0 : x.gasLimit) !== void 0 && (
|
|
237
|
+
const y = P(a.destination.id), x = (d = (c = this.staticConfig.tokenOverrides[this.wh.network]) == null ? void 0 : c[a.destination.id.chain]) == null ? void 0 : d[y];
|
|
238
|
+
(x == null ? void 0 : x.gasLimit) !== void 0 && (N = x.gasLimit);
|
|
233
239
|
}
|
|
234
240
|
let O;
|
|
235
|
-
if (
|
|
236
|
-
const
|
|
237
|
-
if (!
|
|
241
|
+
if (k !== void 0 && k > 0n) {
|
|
242
|
+
const y = (T = (p = (u = this.staticConfig.referrerFee) == null ? void 0 : u.referrerAddresses) == null ? void 0 : p[this.wh.network]) == null ? void 0 : T[a.fromChain.chain];
|
|
243
|
+
if (!y)
|
|
238
244
|
throw new Error(`No referrer address configured for network ${this.wh.network} and chain ${a.fromChain.chain}`);
|
|
239
|
-
O =
|
|
245
|
+
O = g.chainAddress(a.fromChain.chain, y);
|
|
240
246
|
}
|
|
241
|
-
const
|
|
247
|
+
const At = k !== void 0 && O !== void 0 ? { feeDbps: k, referrer: O } : void 0;
|
|
242
248
|
let at;
|
|
243
249
|
if (e.options.nativeGas !== void 0) {
|
|
244
|
-
const
|
|
245
|
-
at =
|
|
250
|
+
const y = await f.getExecutorGasDropOffLimit(this.wh, a.toChain);
|
|
251
|
+
at = y > 0n ? BigInt(Math.round(e.options.nativeGas * 100)) * y / 100n : 0n;
|
|
246
252
|
}
|
|
247
253
|
const et = await f.quoteTransfer(this.wh, a.fromChain, a.toChain, {
|
|
248
254
|
token: a.source.id,
|
|
249
255
|
amount: h(e.normalizedParams.amount),
|
|
250
256
|
protocol: "ExecutorTokenBridge",
|
|
251
257
|
nativeGas: at,
|
|
252
|
-
msgValue:
|
|
253
|
-
gasLimit:
|
|
254
|
-
referrerFee:
|
|
258
|
+
msgValue: W,
|
|
259
|
+
gasLimit: N,
|
|
260
|
+
referrerFee: At
|
|
255
261
|
});
|
|
256
262
|
return a.displayQuote(et, e, et.details);
|
|
257
|
-
} catch (
|
|
263
|
+
} catch (k) {
|
|
258
264
|
return {
|
|
259
265
|
success: !1,
|
|
260
|
-
error:
|
|
266
|
+
error: k
|
|
261
267
|
};
|
|
262
268
|
}
|
|
263
269
|
}
|
|
264
270
|
async initiate(a, e, n, i) {
|
|
265
|
-
const { fromChain: s, toChain: o } = a, { params: r } = n, c = await f.destinationOverrides(s, o, this.toTransferDetails(a, r,
|
|
271
|
+
const { fromChain: s, toChain: o } = a, { params: r } = n, c = await f.destinationOverrides(s, o, this.toTransferDetails(a, r, g.chainAddress(e.chain(), e.address()), i, n)), d = await f.transfer(s, c, e);
|
|
266
272
|
let u = 0;
|
|
267
273
|
return (async () => {
|
|
268
274
|
for (; u < 20; ) {
|
|
269
275
|
try {
|
|
270
|
-
const [
|
|
271
|
-
if (
|
|
276
|
+
const [T] = await this.wh.getExecutorTxStatus(d.at(-1).txid, s.chain);
|
|
277
|
+
if (T)
|
|
272
278
|
break;
|
|
273
279
|
} catch {
|
|
274
280
|
}
|
|
275
|
-
u++, await new Promise((
|
|
281
|
+
u++, await new Promise((T) => setTimeout(T, 2e3));
|
|
276
282
|
}
|
|
277
283
|
})(), {
|
|
278
284
|
from: c.from.chain,
|
|
279
285
|
to: c.to.chain,
|
|
280
|
-
state:
|
|
286
|
+
state: w.SourceInitiated,
|
|
281
287
|
originTxs: d
|
|
282
288
|
};
|
|
283
289
|
}
|
|
284
290
|
async complete(a, e) {
|
|
285
|
-
if (!b(e) && !
|
|
291
|
+
if (!b(e) && !Bt(e))
|
|
286
292
|
throw new Error("The source must be finalized in order to complete the transfer");
|
|
287
293
|
if (!e.attestation)
|
|
288
294
|
throw new Error("The receipt must have an attestation to complete the transfer");
|
|
289
|
-
const n = this.wh.getChain(e.to), i = await n.getExecutorTokenBridge(), s =
|
|
295
|
+
const n = this.wh.getChain(e.to), i = await n.getExecutorTokenBridge(), s = Et(a.chain(), a.address()), o = i.redeem(s, e.attestation.attestation), r = await S(n, o, a);
|
|
290
296
|
return {
|
|
291
297
|
...e,
|
|
292
|
-
state:
|
|
298
|
+
state: w.DestinationInitiated,
|
|
293
299
|
attestation: e.attestation,
|
|
294
300
|
destinationTxs: r
|
|
295
301
|
};
|
|
@@ -317,17 +323,18 @@ class z extends I {
|
|
|
317
323
|
referrerFee: s.details.referrerFee
|
|
318
324
|
};
|
|
319
325
|
}
|
|
320
|
-
}
|
|
321
|
-
l(
|
|
326
|
+
};
|
|
327
|
+
l(B, "IS_EXECUTOR_ROUTE", !0), l(B, "NATIVE_GAS_DROPOFF_SUPPORTED", !0), l(B, "config", {}), l(B, "meta", {
|
|
322
328
|
name: "TokenBridgeExecutorRoute"
|
|
323
329
|
});
|
|
324
|
-
|
|
330
|
+
let V = B;
|
|
331
|
+
class gt extends L {
|
|
325
332
|
static supportedNetworks() {
|
|
326
333
|
return ["Mainnet", "Testnet"];
|
|
327
334
|
}
|
|
328
335
|
// get the list of chains this route supports
|
|
329
336
|
static supportedChains(t) {
|
|
330
|
-
return
|
|
337
|
+
return mt(t);
|
|
331
338
|
}
|
|
332
339
|
// get the list of destination tokens that may be received on the destination chain
|
|
333
340
|
static async supportedDestinationTokens(t, a, e) {
|
|
@@ -341,7 +348,7 @@ class wt extends Q {
|
|
|
341
348
|
return { payload: void 0 };
|
|
342
349
|
}
|
|
343
350
|
async validate(t, a) {
|
|
344
|
-
const e =
|
|
351
|
+
const e = Z(a.amount, t.source.decimals);
|
|
345
352
|
return { valid: !0, params: {
|
|
346
353
|
amount: a.amount,
|
|
347
354
|
normalizedParams: { amount: e },
|
|
@@ -364,11 +371,11 @@ class wt extends Q {
|
|
|
364
371
|
}
|
|
365
372
|
}
|
|
366
373
|
async initiate(t, a, e, n) {
|
|
367
|
-
const { params: i } = e, s = await f.destinationOverrides(t.fromChain, t.toChain, this.toTransferDetails(t, i,
|
|
374
|
+
const { params: i } = e, s = await f.destinationOverrides(t.fromChain, t.toChain, this.toTransferDetails(t, i, g.chainAddress(a.chain(), a.address()), n)), o = await f.transfer(t.fromChain, s, a);
|
|
368
375
|
return {
|
|
369
376
|
from: s.from.chain,
|
|
370
377
|
to: s.to.chain,
|
|
371
|
-
state:
|
|
378
|
+
state: w.SourceInitiated,
|
|
372
379
|
originTxs: o
|
|
373
380
|
};
|
|
374
381
|
}
|
|
@@ -378,7 +385,7 @@ class wt extends Q {
|
|
|
378
385
|
const e = this.wh.getChain(a.to), n = await f.redeem(e, a.attestation.attestation, t);
|
|
379
386
|
return {
|
|
380
387
|
...a,
|
|
381
|
-
state:
|
|
388
|
+
state: w.DestinationInitiated,
|
|
382
389
|
destinationTxs: n
|
|
383
390
|
};
|
|
384
391
|
}
|
|
@@ -402,10 +409,10 @@ class wt extends Q {
|
|
|
402
409
|
};
|
|
403
410
|
}
|
|
404
411
|
}
|
|
405
|
-
l(
|
|
412
|
+
l(gt, "meta", {
|
|
406
413
|
name: "ManualTokenBridge"
|
|
407
414
|
});
|
|
408
|
-
const
|
|
415
|
+
const X = 15n, Tt = 100n, M = 10000n, z = class z extends I {
|
|
409
416
|
static supportedNetworks() {
|
|
410
417
|
return ["Mainnet"];
|
|
411
418
|
}
|
|
@@ -413,7 +420,7 @@ const j = 15n, gt = 100n, R = 10000n, F = class F extends I {
|
|
|
413
420
|
return ot.has(t) ? ot.get(t) : [];
|
|
414
421
|
}
|
|
415
422
|
static async supportedDestinationTokens(t, a, e) {
|
|
416
|
-
const [, n] =
|
|
423
|
+
const [, n] = $(a.network, a.chain, t), i = P(n), s = await a.getPorticoBridge();
|
|
417
424
|
if (!s.supportedTokens().some((u) => P(u.token) === i))
|
|
418
425
|
return [];
|
|
419
426
|
try {
|
|
@@ -424,23 +431,23 @@ const j = 15n, gt = 100n, R = 10000n, F = class F extends I {
|
|
|
424
431
|
}
|
|
425
432
|
const r = (await e.getPorticoBridge()).supportedTokens(), { tokenMap: c } = e.config, d = s.getTokenGroup(i);
|
|
426
433
|
return r.filter((u) => (u.group === d || // ETH/WETH supports wrapping/unwrapping
|
|
427
|
-
u.group === "ETH" && d === "WETH" || u.group === "WETH" && d === "ETH") && (!c ||
|
|
434
|
+
u.group === "ETH" && d === "WETH" || u.group === "WETH" && d === "ETH") && (!c || St.byAddress(c, P(u.token)))).map((u) => u.token);
|
|
428
435
|
}
|
|
429
436
|
getDefaultOptions() {
|
|
430
437
|
return {};
|
|
431
438
|
}
|
|
432
439
|
async validate(t, a) {
|
|
433
440
|
try {
|
|
434
|
-
if (!
|
|
441
|
+
if (!z.supportedChains(t.fromChain.network).includes(t.fromChain.chain) || !z.supportedChains(t.toChain.network).includes(t.toChain.chain))
|
|
435
442
|
throw new Error("Protocol not supported");
|
|
436
|
-
const { fromChain: e, toChain: n, source: i, destination: s } = t, { network: o } = e, [, r] =
|
|
443
|
+
const { fromChain: e, toChain: n, source: i, destination: s } = t, { network: o } = e, [, r] = $(o, e.chain, i.id), [, c] = $(o, n.chain, s.id), d = await e.getPorticoBridge(), u = await n.getPorticoBridge(), p = await d.getTransferrableToken(P(r)), T = await u.getTransferrableToken(P(c));
|
|
437
444
|
return { valid: !0, params: {
|
|
438
445
|
amount: a.amount,
|
|
439
446
|
options: a.options ?? this.getDefaultOptions(),
|
|
440
447
|
normalizedParams: {
|
|
441
448
|
amount: t.parseAmount(a.amount),
|
|
442
449
|
canonicalSourceToken: p,
|
|
443
|
-
canonicalDestinationToken:
|
|
450
|
+
canonicalDestinationToken: T,
|
|
444
451
|
sourceToken: r,
|
|
445
452
|
destinationToken: c
|
|
446
453
|
}
|
|
@@ -451,8 +458,8 @@ const j = 15n, gt = 100n, R = 10000n, F = class F extends I {
|
|
|
451
458
|
}
|
|
452
459
|
async quote(t, a) {
|
|
453
460
|
try {
|
|
454
|
-
const e = await this.fetchSwapQuote(t, a), n = Math.max(t.source.decimals, t.destination.decimals), i = h(
|
|
455
|
-
if (h(
|
|
461
|
+
const e = await this.fetchSwapQuote(t, a), n = Math.max(t.source.decimals, t.destination.decimals), i = h(_(a.normalizedParams.amount, n));
|
|
462
|
+
if (h(_(C(e.minAmountFinish, t.destination.decimals), n)) < i - i * Tt / M)
|
|
456
463
|
throw new Error("Slippage too high");
|
|
457
464
|
const r = await (await t.toChain.getPorticoBridge()).quoteRelay(a.normalizedParams.canonicalDestinationToken.address, a.normalizedParams.destinationToken.address), c = {
|
|
458
465
|
swapAmounts: e,
|
|
@@ -474,8 +481,8 @@ const j = 15n, gt = 100n, R = 10000n, F = class F extends I {
|
|
|
474
481
|
token: a.normalizedParams.destinationToken,
|
|
475
482
|
amount: r
|
|
476
483
|
},
|
|
477
|
-
eta:
|
|
478
|
-
expires:
|
|
484
|
+
eta: lt(t.fromChain.chain),
|
|
485
|
+
expires: ut(0, 5, 0)
|
|
479
486
|
}, a, c);
|
|
480
487
|
} catch (e) {
|
|
481
488
|
return {
|
|
@@ -485,16 +492,16 @@ const j = 15n, gt = 100n, R = 10000n, F = class F extends I {
|
|
|
485
492
|
}
|
|
486
493
|
}
|
|
487
494
|
async initiate(t, a, e, n) {
|
|
488
|
-
const { params: i, details: s } = e, o = t.source.id.address, r = t.destination.id, c = await t.fromChain.getPorticoBridge(), d = c.getTokenGroup(o.toString()), p = (await t.toChain.getPorticoBridge()).getPorticoAddress(d),
|
|
495
|
+
const { params: i, details: s } = e, o = t.source.id.address, r = t.destination.id, c = await t.fromChain.getPorticoBridge(), d = c.getTokenGroup(o.toString()), p = (await t.toChain.getPorticoBridge()).getPorticoAddress(d), T = c.transfer(g.parseAddress(a.chain(), a.address()), n, o, h(i.normalizedParams.amount), r, p, s);
|
|
489
496
|
return {
|
|
490
|
-
originTxs: await
|
|
491
|
-
state:
|
|
497
|
+
originTxs: await S(t.fromChain, T, a),
|
|
498
|
+
state: w.SourceInitiated,
|
|
492
499
|
from: t.fromChain.chain,
|
|
493
500
|
to: t.toChain.chain
|
|
494
501
|
};
|
|
495
502
|
}
|
|
496
503
|
async *track(t, a) {
|
|
497
|
-
if (
|
|
504
|
+
if (ht(t) || ft(t)) {
|
|
498
505
|
const { txid: e } = t.originTxs[t.originTxs.length - 1], n = await this.wh.getVaa(e, "PorticoBridge:Transfer", a);
|
|
499
506
|
if (!n)
|
|
500
507
|
throw new Error("No VAA found for transaction: " + e);
|
|
@@ -505,7 +512,7 @@ const j = 15n, gt = 100n, R = 10000n, F = class F extends I {
|
|
|
505
512
|
};
|
|
506
513
|
t = {
|
|
507
514
|
...t,
|
|
508
|
-
state:
|
|
515
|
+
state: w.Attested,
|
|
509
516
|
attestation: {
|
|
510
517
|
id: i,
|
|
511
518
|
attestation: n
|
|
@@ -514,20 +521,20 @@ const j = 15n, gt = 100n, R = 10000n, F = class F extends I {
|
|
|
514
521
|
}
|
|
515
522
|
b(t) && await (await this.wh.getChain(t.to).getPorticoBridge()).isTransferCompleted(t.attestation.attestation) && (t = {
|
|
516
523
|
...t,
|
|
517
|
-
state:
|
|
524
|
+
state: w.DestinationFinalized
|
|
518
525
|
}, yield t), yield t;
|
|
519
526
|
}
|
|
520
527
|
async complete(t, a) {
|
|
521
528
|
if (!b(a))
|
|
522
529
|
throw new Error("Source must be attested");
|
|
523
|
-
const e = await this.wh.getChain(a.to), n = await e.getPorticoBridge(), i =
|
|
524
|
-
return await
|
|
530
|
+
const e = await this.wh.getChain(a.to), n = await e.getPorticoBridge(), i = g.chainAddress(t.chain(), t.address()), s = n.redeem(i.address, a.attestation.attestation);
|
|
531
|
+
return await S(e, s, t);
|
|
525
532
|
}
|
|
526
533
|
async fetchSwapQuote(t, a) {
|
|
527
|
-
const e = await t.fromChain.getPorticoBridge(), n = h(a.normalizedParams.amount), i = e.getTokenGroup(P(a.normalizedParams.sourceToken)), s = await e.quoteSwap(a.normalizedParams.sourceToken.address, a.normalizedParams.canonicalSourceToken.address, i, n), o = s *
|
|
534
|
+
const e = await t.fromChain.getPorticoBridge(), n = h(a.normalizedParams.amount), i = e.getTokenGroup(P(a.normalizedParams.sourceToken)), s = await e.quoteSwap(a.normalizedParams.sourceToken.address, a.normalizedParams.canonicalSourceToken.address, i, n), o = s * X / M;
|
|
528
535
|
if (o >= s)
|
|
529
536
|
throw new Error("Start slippage too high");
|
|
530
|
-
const r = await t.toChain.getPorticoBridge(), c = s - o, d = await r.quoteSwap(a.normalizedParams.canonicalDestinationToken.address, a.normalizedParams.destinationToken.address, i, c), u = d *
|
|
537
|
+
const r = await t.toChain.getPorticoBridge(), c = s - o, d = await r.quoteSwap(a.normalizedParams.canonicalDestinationToken.address, a.normalizedParams.destinationToken.address, i, c), u = d * X / M;
|
|
531
538
|
if (u >= d)
|
|
532
539
|
throw new Error("Finish slippage too high");
|
|
533
540
|
const p = d - u;
|
|
@@ -537,27 +544,27 @@ const j = 15n, gt = 100n, R = 10000n, F = class F extends I {
|
|
|
537
544
|
};
|
|
538
545
|
}
|
|
539
546
|
};
|
|
540
|
-
l(
|
|
547
|
+
l(z, "NATIVE_GAS_DROPOFF_SUPPORTED", !1), l(z, "meta", {
|
|
541
548
|
name: "AutomaticPortico"
|
|
542
549
|
});
|
|
543
|
-
let
|
|
544
|
-
class
|
|
550
|
+
let J = z;
|
|
551
|
+
class pt extends L {
|
|
545
552
|
static supportedNetworks() {
|
|
546
553
|
return ["Mainnet", "Testnet"];
|
|
547
554
|
}
|
|
548
555
|
// get the list of chains this route supports
|
|
549
556
|
static supportedChains(t) {
|
|
550
|
-
return
|
|
557
|
+
return Q.has(t) ? Q.get(t) : [];
|
|
551
558
|
}
|
|
552
559
|
// get the list of destination tokens that may be received on the destination chain
|
|
553
560
|
static async supportedDestinationTokens(t, a, e) {
|
|
554
|
-
const n =
|
|
561
|
+
const n = F.get(a.network, a.chain);
|
|
555
562
|
if (!n)
|
|
556
563
|
return [];
|
|
557
|
-
if (!D(t,
|
|
564
|
+
if (!D(t, g.tokenId(a.chain, n)))
|
|
558
565
|
return [];
|
|
559
566
|
const { network: i, chain: s } = e;
|
|
560
|
-
return
|
|
567
|
+
return F.has(i, s) ? [g.chainAddress(s, F.get(i, s))] : [];
|
|
561
568
|
}
|
|
562
569
|
getDefaultOptions() {
|
|
563
570
|
return {
|
|
@@ -575,7 +582,7 @@ class Tt extends Q {
|
|
|
575
582
|
}
|
|
576
583
|
async quote(t, a) {
|
|
577
584
|
try {
|
|
578
|
-
return t.displayQuote(await
|
|
585
|
+
return t.displayQuote(await A.quoteTransfer(t.fromChain, t.toChain, {
|
|
579
586
|
automatic: !1,
|
|
580
587
|
amount: h(a.normalizedParams.amount),
|
|
581
588
|
...a.options
|
|
@@ -588,11 +595,11 @@ class Tt extends Q {
|
|
|
588
595
|
}
|
|
589
596
|
}
|
|
590
597
|
async initiate(t, a, e, n) {
|
|
591
|
-
const { params: i } = e, s = await
|
|
598
|
+
const { params: i } = e, s = await A.destinationOverrides(t.fromChain, t.toChain, this.toTransferDetails(i, g.chainAddress(a.chain(), a.address()), n)), o = await A.transfer(t.fromChain, s, a), r = await A.getTransferMessage(t.fromChain, o[o.length - 1].txid);
|
|
592
599
|
return {
|
|
593
600
|
from: s.from.chain,
|
|
594
601
|
to: s.to.chain,
|
|
595
|
-
state:
|
|
602
|
+
state: w.SourceFinalized,
|
|
596
603
|
originTxs: o,
|
|
597
604
|
attestation: { id: r.id, attestation: { message: r.message } }
|
|
598
605
|
};
|
|
@@ -601,25 +608,25 @@ class Tt extends Q {
|
|
|
601
608
|
if (!b(a))
|
|
602
609
|
throw new Error("The source must be finalized in order to complete the transfer");
|
|
603
610
|
const { id: e, attestation: n } = a.attestation;
|
|
604
|
-
if (
|
|
611
|
+
if (zt.isCircleAttestation(n)) {
|
|
605
612
|
const { message: i, attestation: s } = n;
|
|
606
613
|
if (!s)
|
|
607
614
|
throw new Error(`No Circle attestation for ${e}`);
|
|
608
|
-
const o = this.wh.getChain(a.to), r = await o.getCircleBridge(), c =
|
|
615
|
+
const o = this.wh.getChain(a.to), r = await o.getCircleBridge(), c = g.parseAddress(t.chain(), t.address()), d = r.redeem(c, i, s), u = await S(o, d, t);
|
|
609
616
|
return {
|
|
610
617
|
...a,
|
|
611
|
-
state:
|
|
618
|
+
state: w.DestinationInitiated,
|
|
612
619
|
destinationTxs: u
|
|
613
620
|
};
|
|
614
621
|
} else
|
|
615
622
|
return a;
|
|
616
623
|
}
|
|
617
624
|
async resume(t) {
|
|
618
|
-
const a = await
|
|
619
|
-
return
|
|
625
|
+
const a = await A.from(this.wh, t, 1e4);
|
|
626
|
+
return A.getReceipt(a);
|
|
620
627
|
}
|
|
621
628
|
async *track(t, a) {
|
|
622
|
-
yield*
|
|
629
|
+
yield* A.track(this.wh, t, a);
|
|
623
630
|
}
|
|
624
631
|
toTransferDetails(t, a, e) {
|
|
625
632
|
return {
|
|
@@ -631,30 +638,30 @@ class Tt extends Q {
|
|
|
631
638
|
};
|
|
632
639
|
}
|
|
633
640
|
}
|
|
634
|
-
l(
|
|
641
|
+
l(pt, "meta", {
|
|
635
642
|
name: "ManualCCTP",
|
|
636
643
|
provider: "Circle"
|
|
637
644
|
});
|
|
638
|
-
class
|
|
645
|
+
class K extends I {
|
|
639
646
|
static supportedNetworks() {
|
|
640
647
|
return ["Mainnet", "Testnet"];
|
|
641
648
|
}
|
|
642
649
|
// get the list of chains this route supports
|
|
643
650
|
static supportedChains(t) {
|
|
644
|
-
return
|
|
651
|
+
return Q.has(t) ? Q.get(t).filter((e) => {
|
|
645
652
|
var n;
|
|
646
|
-
return (n =
|
|
653
|
+
return (n = Ft.get(t, e)) == null ? void 0 : n.wormholeRelayer;
|
|
647
654
|
}) : [];
|
|
648
655
|
}
|
|
649
656
|
// get the list of destination tokens that may be received on the destination chain
|
|
650
657
|
static async supportedDestinationTokens(t, a, e) {
|
|
651
|
-
const n =
|
|
658
|
+
const n = F.get(a.network, a.chain);
|
|
652
659
|
if (!n)
|
|
653
660
|
return [];
|
|
654
|
-
if (!D(t,
|
|
661
|
+
if (!D(t, g.tokenId(a.chain, n)))
|
|
655
662
|
return [];
|
|
656
663
|
const { network: i, chain: s } = e;
|
|
657
|
-
return
|
|
664
|
+
return F.has(i, s) ? [g.chainAddress(s, F.get(i, s))] : [];
|
|
658
665
|
}
|
|
659
666
|
getDefaultOptions() {
|
|
660
667
|
return {
|
|
@@ -679,7 +686,7 @@ class J extends I {
|
|
|
679
686
|
}
|
|
680
687
|
async quote(t, a) {
|
|
681
688
|
try {
|
|
682
|
-
return t.displayQuote(await
|
|
689
|
+
return t.displayQuote(await A.quoteTransfer(t.fromChain, t.toChain, {
|
|
683
690
|
automatic: !0,
|
|
684
691
|
amount: h(a.normalizedParams.amount),
|
|
685
692
|
nativeGas: h(a.normalizedParams.nativeGasAmount)
|
|
@@ -694,7 +701,7 @@ class J extends I {
|
|
|
694
701
|
async normalizeTransferParams(t, a) {
|
|
695
702
|
const e = t.parseAmount(a.amount), i = await (await t.fromChain.getAutomaticCircleBridge()).getRelayerFee(t.toChain.chain), s = i * 105n / 100n;
|
|
696
703
|
if (h(e) < s)
|
|
697
|
-
throw new
|
|
704
|
+
throw new q(C(s, e.decimals));
|
|
698
705
|
const o = h(e) - i, c = (a.options ?? this.getDefaultOptions()).nativeGas ?? 0;
|
|
699
706
|
if (c > 1 || c < 0)
|
|
700
707
|
throw new Error("Native gas must be between 0.0 and 1.0 (0% and 100%)");
|
|
@@ -702,8 +709,8 @@ class J extends I {
|
|
|
702
709
|
if (c > 0) {
|
|
703
710
|
let p = await (await t.toChain.getAutomaticCircleBridge()).maxSwapAmount();
|
|
704
711
|
o < p && (p = o);
|
|
705
|
-
const
|
|
706
|
-
d = p *
|
|
712
|
+
const T = 1e4, k = BigInt(Math.floor(c * T));
|
|
713
|
+
d = p * k / BigInt(T), d === o && d > 0n && (d -= 1n);
|
|
707
714
|
}
|
|
708
715
|
return {
|
|
709
716
|
fee: t.amountFromBaseUnits(i),
|
|
@@ -722,41 +729,41 @@ class J extends I {
|
|
|
722
729
|
}
|
|
723
730
|
async initiate(t, a, e, n) {
|
|
724
731
|
const { params: i } = e;
|
|
725
|
-
let s = this.toTransferDetails(i,
|
|
726
|
-
const r = await
|
|
732
|
+
let s = this.toTransferDetails(i, g.chainAddress(a.chain(), a.address()), n), o = await A.transfer(t.fromChain, s, a);
|
|
733
|
+
const r = await A.getTransferMessage(t.fromChain, o[o.length - 1].txid);
|
|
727
734
|
return {
|
|
728
735
|
from: s.from.chain,
|
|
729
736
|
to: s.to.chain,
|
|
730
|
-
state:
|
|
737
|
+
state: w.SourceFinalized,
|
|
731
738
|
originTxs: o,
|
|
732
739
|
attestation: { id: r.id, attestation: { message: r.message } }
|
|
733
740
|
};
|
|
734
741
|
}
|
|
735
742
|
async *track(t, a) {
|
|
736
|
-
yield*
|
|
743
|
+
yield* A.track(this.wh, t, a);
|
|
737
744
|
}
|
|
738
745
|
}
|
|
739
|
-
l(
|
|
746
|
+
l(K, "NATIVE_GAS_DROPOFF_SUPPORTED", !0), l(K, "meta", {
|
|
740
747
|
name: "AutomaticCCTP",
|
|
741
748
|
provider: "Circle"
|
|
742
749
|
});
|
|
743
|
-
class
|
|
750
|
+
class kt extends L {
|
|
744
751
|
static supportedNetworks() {
|
|
745
752
|
return ["Mainnet"];
|
|
746
753
|
}
|
|
747
754
|
static supportedChains(t) {
|
|
748
|
-
return
|
|
755
|
+
return mt(t);
|
|
749
756
|
}
|
|
750
757
|
static async supportedDestinationTokens(t, a, e) {
|
|
751
758
|
if (!await this.isSourceTokenSupported(t, a))
|
|
752
759
|
return [];
|
|
753
|
-
const n =
|
|
760
|
+
const n = v.getNativeTbtcToken(e.chain);
|
|
754
761
|
if (n)
|
|
755
762
|
return [n];
|
|
756
|
-
const i = await e.getTokenBridge(), s =
|
|
763
|
+
const i = await e.getTokenBridge(), s = v.getNativeTbtcToken("Ethereum");
|
|
757
764
|
try {
|
|
758
765
|
const o = await i.getWrappedAsset(s);
|
|
759
|
-
return [
|
|
766
|
+
return [g.tokenId(e.chain, o.toString())];
|
|
760
767
|
} catch (o) {
|
|
761
768
|
if (o.message.includes("not a wrapped asset"))
|
|
762
769
|
return [];
|
|
@@ -776,7 +783,7 @@ class pt extends Q {
|
|
|
776
783
|
} };
|
|
777
784
|
}
|
|
778
785
|
async quote(t, a) {
|
|
779
|
-
const e =
|
|
786
|
+
const e = lt(t.fromChain.chain) + Gt;
|
|
780
787
|
return {
|
|
781
788
|
success: !0,
|
|
782
789
|
params: a,
|
|
@@ -789,44 +796,44 @@ class pt extends Q {
|
|
|
789
796
|
amount: a.normalizedParams.amount
|
|
790
797
|
},
|
|
791
798
|
eta: e,
|
|
792
|
-
expires:
|
|
799
|
+
expires: ut(24, 0, 0)
|
|
793
800
|
};
|
|
794
801
|
}
|
|
795
802
|
async initiate(t, a, e, n) {
|
|
796
|
-
const i = h(e.params.normalizedParams.amount), s = t.fromChain.chain === "Ethereum", o =
|
|
803
|
+
const i = h(e.params.normalizedParams.amount), s = t.fromChain.chain === "Ethereum", o = v.getNativeTbtcToken(t.fromChain.chain), r = o && D(e.sourceToken.token, o);
|
|
797
804
|
if (r && !s)
|
|
798
805
|
return await this.transferNative(t, a, n, i);
|
|
799
806
|
if (!r && s)
|
|
800
807
|
throw new Error("Only tbtc can be transferred on Ethereum");
|
|
801
808
|
if (!r) {
|
|
802
|
-
const d = await (await t.fromChain.getTokenBridge()).getOriginalAsset(e.sourceToken.token.address), u =
|
|
809
|
+
const d = await (await t.fromChain.getTokenBridge()).getOriginalAsset(e.sourceToken.token.address), u = v.getNativeTbtcToken("Ethereum");
|
|
803
810
|
if (!D(d, u))
|
|
804
811
|
throw new Error("Can only transfer wrapped tbtc");
|
|
805
812
|
}
|
|
806
813
|
return await this.transferWrapped(t, a, n, i);
|
|
807
814
|
}
|
|
808
815
|
async transferNative(t, a, e, n) {
|
|
809
|
-
const i =
|
|
816
|
+
const i = g.parseAddress(a.chain(), a.address()), o = (await t.fromChain.getTBTCBridge()).transfer(i, e, n);
|
|
810
817
|
return {
|
|
811
|
-
originTxs: await
|
|
812
|
-
state:
|
|
818
|
+
originTxs: await S(t.fromChain, o, a),
|
|
819
|
+
state: w.SourceInitiated,
|
|
813
820
|
from: t.fromChain.chain,
|
|
814
821
|
to: t.toChain.chain
|
|
815
822
|
};
|
|
816
823
|
}
|
|
817
824
|
async transferWrapped(t, a, e, n) {
|
|
818
|
-
const i =
|
|
825
|
+
const i = g.parseAddress(a.chain(), a.address()), s = Ot.get(t.fromChain.network, e.chain), o = await t.fromChain.getTokenBridge();
|
|
819
826
|
let r;
|
|
820
827
|
return s ? r = o.transfer(
|
|
821
828
|
i,
|
|
822
|
-
|
|
829
|
+
g.chainAddress(t.toChain.chain, s),
|
|
823
830
|
t.source.id.address,
|
|
824
831
|
n,
|
|
825
832
|
// payload is the recipient address
|
|
826
833
|
e.address.toUniversalAddress().toUint8Array()
|
|
827
834
|
) : r = o.transfer(i, e, t.source.id.address, n), {
|
|
828
|
-
originTxs: await
|
|
829
|
-
state:
|
|
835
|
+
originTxs: await S(t.fromChain, r, a),
|
|
836
|
+
state: w.SourceInitiated,
|
|
830
837
|
from: t.fromChain.chain,
|
|
831
838
|
to: t.toChain.chain
|
|
832
839
|
};
|
|
@@ -834,31 +841,31 @@ class pt extends Q {
|
|
|
834
841
|
async complete(t, a) {
|
|
835
842
|
if (!b(a))
|
|
836
843
|
throw new Error("The source must be finalized in order to complete the transfer");
|
|
837
|
-
const e =
|
|
844
|
+
const e = g.parseAddress(t.chain(), t.address()), n = a.attestation.attestation, i = this.wh.getChain(a.to);
|
|
838
845
|
let s;
|
|
839
846
|
if (n.payloadLiteral === "TBTCBridge:GatewayTransfer")
|
|
840
847
|
s = (await i.getTBTCBridge()).redeem(e, n);
|
|
841
848
|
else {
|
|
842
|
-
const r = await i.getTokenBridge(), c =
|
|
849
|
+
const r = await i.getTokenBridge(), c = It(n), d = Nt("TokenBridge:Transfer", c);
|
|
843
850
|
s = r.redeem(e, d);
|
|
844
851
|
}
|
|
845
|
-
const o = await
|
|
852
|
+
const o = await S(i, s, t);
|
|
846
853
|
return {
|
|
847
854
|
...a,
|
|
848
|
-
state:
|
|
855
|
+
state: w.DestinationInitiated,
|
|
849
856
|
destinationTxs: o
|
|
850
857
|
};
|
|
851
858
|
}
|
|
852
859
|
async resume(t) {
|
|
853
|
-
const a = await this.wh.getVaa(t.txid,
|
|
860
|
+
const a = await this.wh.getVaa(t.txid, v.getTransferDiscriminator());
|
|
854
861
|
if (!a)
|
|
855
862
|
throw new Error("No VAA found for transaction: " + t);
|
|
856
|
-
const e =
|
|
863
|
+
const e = v.getNativeTbtcToken("Ethereum"), { chain: n, address: i } = a.payload.token;
|
|
857
864
|
if (!D(e, { chain: n, address: i }))
|
|
858
865
|
throw new Error("Can only resume tbtc transfers");
|
|
859
866
|
return {
|
|
860
867
|
originTxs: [t],
|
|
861
|
-
state:
|
|
868
|
+
state: w.Attested,
|
|
862
869
|
from: a.emitterChain,
|
|
863
870
|
to: a.payload.to.chain,
|
|
864
871
|
attestation: {
|
|
@@ -872,8 +879,8 @@ class pt extends Q {
|
|
|
872
879
|
};
|
|
873
880
|
}
|
|
874
881
|
async *track(t, a) {
|
|
875
|
-
if (
|
|
876
|
-
const { txid: e } = t.originTxs[t.originTxs.length - 1], n = await this.wh.getVaa(e,
|
|
882
|
+
if (ht(t) || ft(t)) {
|
|
883
|
+
const { txid: e } = t.originTxs[t.originTxs.length - 1], n = await this.wh.getVaa(e, v.getTransferDiscriminator(), a);
|
|
877
884
|
if (!n)
|
|
878
885
|
throw new Error("No VAA found for transaction: " + e);
|
|
879
886
|
const i = {
|
|
@@ -883,7 +890,7 @@ class pt extends Q {
|
|
|
883
890
|
};
|
|
884
891
|
t = {
|
|
885
892
|
...t,
|
|
886
|
-
state:
|
|
893
|
+
state: w.Attested,
|
|
887
894
|
attestation: {
|
|
888
895
|
id: i,
|
|
889
896
|
attestation: n
|
|
@@ -892,19 +899,19 @@ class pt extends Q {
|
|
|
892
899
|
}
|
|
893
900
|
b(t) && await (await this.wh.getChain(t.to).getTokenBridge()).isTransferCompleted(t.attestation.attestation) && (t = {
|
|
894
901
|
...t,
|
|
895
|
-
state:
|
|
902
|
+
state: w.DestinationFinalized
|
|
896
903
|
}, yield t), yield t;
|
|
897
904
|
}
|
|
898
905
|
static async isSourceTokenSupported(t, a) {
|
|
899
|
-
if (
|
|
906
|
+
if (R(t.address))
|
|
900
907
|
return !1;
|
|
901
|
-
const e =
|
|
908
|
+
const e = v.getNativeTbtcToken(a.chain);
|
|
902
909
|
if (e && D(t, e))
|
|
903
910
|
return !0;
|
|
904
911
|
const n = await a.getTokenBridge();
|
|
905
912
|
try {
|
|
906
913
|
const i = await n.getOriginalAsset(t.address);
|
|
907
|
-
return D(i,
|
|
914
|
+
return D(i, v.getNativeTbtcToken("Ethereum"));
|
|
908
915
|
} catch (i) {
|
|
909
916
|
if (i.message.includes("not a wrapped asset"))
|
|
910
917
|
return !1;
|
|
@@ -912,63 +919,63 @@ class pt extends Q {
|
|
|
912
919
|
}
|
|
913
920
|
}
|
|
914
921
|
}
|
|
915
|
-
l(
|
|
922
|
+
l(kt, "meta", {
|
|
916
923
|
name: "ManualTBTC"
|
|
917
924
|
});
|
|
918
|
-
const
|
|
925
|
+
const Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
919
926
|
__proto__: null,
|
|
920
|
-
AutomaticCCTPRoute:
|
|
921
|
-
AutomaticPorticoRoute:
|
|
927
|
+
AutomaticCCTPRoute: K,
|
|
928
|
+
AutomaticPorticoRoute: J,
|
|
922
929
|
AutomaticRoute: I,
|
|
923
|
-
AutomaticTokenBridgeRoute:
|
|
924
|
-
BPS_PER_HUNDRED_PERCENT:
|
|
925
|
-
CCTPRoute:
|
|
926
|
-
ExecutorTokenBridgeRoute:
|
|
927
|
-
FinalizableRoute:
|
|
928
|
-
MAX_SLIPPAGE_BPS:
|
|
929
|
-
ManualRoute:
|
|
930
|
-
MinAmountError:
|
|
931
|
-
RelayFailedError:
|
|
932
|
-
Route:
|
|
933
|
-
RouteResolver:
|
|
930
|
+
AutomaticTokenBridgeRoute: j,
|
|
931
|
+
BPS_PER_HUNDRED_PERCENT: M,
|
|
932
|
+
CCTPRoute: pt,
|
|
933
|
+
ExecutorTokenBridgeRoute: V,
|
|
934
|
+
FinalizableRoute: Rt,
|
|
935
|
+
MAX_SLIPPAGE_BPS: Tt,
|
|
936
|
+
ManualRoute: L,
|
|
937
|
+
MinAmountError: q,
|
|
938
|
+
RelayFailedError: Mt,
|
|
939
|
+
Route: Ut,
|
|
940
|
+
RouteResolver: _t,
|
|
934
941
|
RouteTransferRequest: tt,
|
|
935
|
-
SLIPPAGE_BPS:
|
|
936
|
-
TBTCRoute:
|
|
937
|
-
TokenBridgeRoute:
|
|
938
|
-
UnavailableError:
|
|
939
|
-
checkAndCompleteTransfer:
|
|
940
|
-
executorTokenBridgeRoute:
|
|
941
|
-
isAutomatic:
|
|
942
|
+
SLIPPAGE_BPS: X,
|
|
943
|
+
TBTCRoute: kt,
|
|
944
|
+
TokenBridgeRoute: gt,
|
|
945
|
+
UnavailableError: Qt,
|
|
946
|
+
checkAndCompleteTransfer: wt,
|
|
947
|
+
executorTokenBridgeRoute: Wt,
|
|
948
|
+
isAutomatic: Vt,
|
|
942
949
|
isFinalizable: dt,
|
|
943
950
|
isManual: ct
|
|
944
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
945
|
-
function
|
|
951
|
+
}, Symbol.toStringTag, { value: "Module" })), Kt = "0x1::aptos_coin::AptosCoin", U = "::", Ct = "Aptos", $t = (m) => /^(0x)?[0-9a-fA-F]+::\w+::\w+$/.test(m), Yt = (m) => m.split(U)[0];
|
|
952
|
+
function Ht(m) {
|
|
946
953
|
return m.length % 2 !== 0 || m.length < 66 ? (m = m.startsWith("0x") ? m.slice(2) : m, "0x" + m.padStart(64, "0")) : m;
|
|
947
954
|
}
|
|
948
|
-
const
|
|
955
|
+
const E = class E {
|
|
949
956
|
constructor(t) {
|
|
950
957
|
l(this, "type", "Native");
|
|
951
958
|
// Full 32 bytes of Address
|
|
952
959
|
l(this, "address");
|
|
953
960
|
// Optional module and contract name
|
|
954
961
|
l(this, "module");
|
|
955
|
-
if (
|
|
962
|
+
if (E.instanceof(t))
|
|
956
963
|
this.address = t.address, this.module = t.module;
|
|
957
964
|
else if (rt.instanceof(t))
|
|
958
965
|
this.address = t.toUint8Array();
|
|
959
966
|
else if (typeof t == "string") {
|
|
960
|
-
if (
|
|
961
|
-
const a = t.split(
|
|
962
|
-
this.module = a.slice(1).join(
|
|
967
|
+
if ($t(t)) {
|
|
968
|
+
const a = t.split(U);
|
|
969
|
+
this.module = a.slice(1).join(U), t = a[0];
|
|
963
970
|
}
|
|
964
|
-
if (t =
|
|
971
|
+
if (t = Ht(t), !H.valid(t))
|
|
965
972
|
throw new Error("Invalid Aptos address: " + t);
|
|
966
|
-
this.address =
|
|
973
|
+
this.address = H.decode(t);
|
|
967
974
|
} else
|
|
968
975
|
this.address = t;
|
|
969
976
|
}
|
|
970
977
|
unwrap() {
|
|
971
|
-
const t =
|
|
978
|
+
const t = H.encode(this.address).replace(/^0+/, ""), a = this.module ? U + this.module : "";
|
|
972
979
|
return `0x${t}${a}`;
|
|
973
980
|
}
|
|
974
981
|
toString() {
|
|
@@ -984,28 +991,28 @@ const B = class B {
|
|
|
984
991
|
return new rt(this.toUint8Array());
|
|
985
992
|
}
|
|
986
993
|
static instanceof(t) {
|
|
987
|
-
return t.constructor.platform ===
|
|
994
|
+
return t.constructor.platform === E.platform;
|
|
988
995
|
}
|
|
989
996
|
equals(t) {
|
|
990
|
-
return
|
|
997
|
+
return E.instanceof(t) ? t.unwrap() === this.unwrap() : this.toUniversalAddress().equals(t);
|
|
991
998
|
}
|
|
992
999
|
};
|
|
993
|
-
l(
|
|
994
|
-
let
|
|
995
|
-
|
|
1000
|
+
l(E, "byteSize", 32), l(E, "platform", Ct);
|
|
1001
|
+
let Y = E;
|
|
1002
|
+
Lt(Ct, Y);
|
|
996
1003
|
export {
|
|
997
|
-
|
|
998
|
-
|
|
1004
|
+
K as A,
|
|
1005
|
+
pt as C,
|
|
999
1006
|
tt as R,
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1007
|
+
gt as T,
|
|
1008
|
+
Ct as _,
|
|
1009
|
+
j as a,
|
|
1010
|
+
J as b,
|
|
1011
|
+
kt as c,
|
|
1012
|
+
Y as d,
|
|
1013
|
+
Kt as e,
|
|
1014
|
+
U as f,
|
|
1015
|
+
Yt as g,
|
|
1016
|
+
$t as i,
|
|
1017
|
+
Jt as r
|
|
1011
1018
|
};
|