@wormhole-foundation/wormhole-connect 3.0.0-beta.12-development → 3.0.0-beta.13-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/{tokens-BjeNFBPV.js → tokens-CrPLX1jh.js} +13 -13
- package/dist/main.js +75 -75
- package/dist/src/components/SampleApp/index.d.ts.map +1 -1
- package/dist/src/config/mainnet/rpcs.d.ts.map +1 -1
- package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
- package/dist/src/config/testnet/rpcs.d.ts.map +1 -1
- package/dist/src/config/testnet/tokens.d.ts.map +1 -1
- package/dist/src/config/types.d.ts +2 -1
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/contexts/TokensContext.d.ts.map +1 -1
- package/dist/src/exports/executor.d.ts +1 -1
- package/dist/src/exports/executor.d.ts.map +1 -1
- package/dist/src/icons/ChainIcons.d.ts.map +1 -1
- package/dist/src/icons/Chains/LINEA.d.ts +4 -0
- package/dist/src/icons/Chains/LINEA.d.ts.map +1 -0
- package/dist/src/icons/Chains/POLY.d.ts +2 -2
- package/dist/src/icons/Chains/POLY.d.ts.map +1 -1
- package/dist/src/icons/Chains/SONIC.d.ts +4 -0
- package/dist/src/icons/Chains/SONIC.d.ts.map +1 -0
- package/dist/src/icons/SvgDefs.d.ts.map +1 -1
- package/dist/src/icons/TokenIcons.d.ts.map +1 -1
- package/dist/src/icons/Tokens/POLY.d.ts.map +1 -1
- package/dist/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
- package/dist/src/sdklegacy/config/TESTNET.d.ts.map +1 -1
- package/dist/src/utils/coingecko.d.ts.map +1 -1
- package/dist/src/utils/sdkv2.d.ts +1 -1
- package/dist/src/utils/sdkv2.d.ts.map +1 -1
- package/dist/src/utils/wallet/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/GasSlider/index.d.ts +1 -0
- package/dist/src/views/v2/Bridge/GasSlider/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/dist/src/views/v2/Redeem/index.d.ts.map +1 -1
- package/lib/{account-k-CXVcvA.mjs → account-DRrQuG9b.mjs} +1 -1
- package/lib/{account-gVjkECaX.js → account-nmHnnwf-.js} +1 -1
- package/lib/{add-Bgr8Uh8B.mjs → add-B3TOzisV.mjs} +1 -1
- package/lib/{add-CgyvYm-l.js → add-PboF8xOA.js} +1 -1
- package/lib/{address-CrYNZ_Nj.mjs → address-BkeBsCZD.mjs} +1837 -1809
- package/lib/{address-ByLIzxVb.mjs → address-CHEvC20V.mjs} +1 -1
- package/lib/{address-DfgK_jn7.js → address-CslafWGT.js} +1 -1
- package/lib/address-DKM11kf_.js +15 -0
- package/lib/{address-DGYJWkFz.js → address-vHTAfgt6.js} +1 -1
- package/lib/{address-BJNAPSnr.mjs → address-xvE59bSC.mjs} +1 -1
- package/lib/{all-wallets-BeYsJiCM.js → all-wallets-C3KaOAtR.js} +1 -1
- package/lib/{all-wallets-DdRIEq-V.mjs → all-wallets-i8sBvyse.mjs} +1 -1
- package/lib/{app-store-C9yZzH2t.js → app-store-DMPxp7LI.js} +1 -1
- package/lib/{app-store-eKRqPW4N.mjs → app-store-D_gEJYR-.mjs} +1 -1
- package/lib/{apple-DQcCTOa_.mjs → apple-C7dx7WbA.mjs} +1 -1
- package/lib/{apple-B3Aps_l8.js → apple-CBv-wD_N.js} +1 -1
- package/lib/{aptos-DySrgy5u.mjs → aptos-5WdoBDe7.mjs} +3 -3
- package/lib/{aptos-IciOSw-S.js → aptos-7NDR_C5e.js} +2 -2
- package/lib/{aptos-CxfKcGPe.js → aptos-BHb4m4xc.js} +1 -1
- package/lib/{aptos-M18090BQ.mjs → aptos-DjCb_S8U.mjs} +7 -7
- package/lib/{arrow-bottom-CUgsoqql.js → arrow-bottom-JVAM2flH.js} +1 -1
- package/lib/{arrow-bottom-circle-CvfJ5p_y.mjs → arrow-bottom-circle-CNlCzI_j.mjs} +1 -1
- package/lib/{arrow-bottom-circle-u8tFbHrW.js → arrow-bottom-circle-Cwm4Epf6.js} +1 -1
- package/lib/{arrow-bottom-Duiu5Tg_.mjs → arrow-bottom-dGyduTnX.mjs} +1 -1
- package/lib/{arrow-left-IZiFrwcP.js → arrow-left-BCNUIhF5.js} +1 -1
- package/lib/{arrow-left-avYXBHF4.mjs → arrow-left-PKOB36Bh.mjs} +1 -1
- package/lib/{arrow-right-Cbunep5L.mjs → arrow-right-CS5PKMHz.mjs} +1 -1
- package/lib/{arrow-right-CF-NNN4L.js → arrow-right-DmYVvh1l.js} +1 -1
- package/lib/{arrow-top-DBWWW9Oy.mjs → arrow-top-BkM6S1a6.mjs} +1 -1
- package/lib/{arrow-top-DCGkz6k-.js → arrow-top-Bo7YKrfd.js} +1 -1
- package/lib/{bank-C2jhIapN.mjs → bank-CCF3DOdG.mjs} +1 -1
- package/lib/{bank-C-CLDGG9.js → bank-DLZl3tlW.js} +1 -1
- package/lib/{basic-CIBqPAeW.mjs → basic-B3TQQ8Sq.mjs} +2 -2
- package/lib/{basic-DVsxPr6-.js → basic-DVoqEslQ.js} +1 -1
- package/lib/{blake2b-GH2Zzt65.mjs → blake2b-CAi92fbu.mjs} +17 -17
- package/lib/{blake2b-CCJ4LnEi.js → blake2b-DQdnnomV.js} +1 -1
- package/lib/{browser-DFX8bJKi.mjs → browser-8x7RJ5du.mjs} +1 -1
- package/lib/{browser-BQ2hKa4j.js → browser-CRt_zD3Q.js} +1 -1
- package/lib/{browser-ponyfill-JlME40Yz.mjs → browser-ponyfill-B32wgiqZ.mjs} +1 -1
- package/lib/{browser-ponyfill-DqqaJGv_.js → browser-ponyfill-UnUv8h3i.js} +1 -1
- package/lib/{card-CUMXwdG1.js → card-B4Tu3QQo.js} +1 -1
- package/lib/{card-4-u9SA69.mjs → card-CXjBQX3v.mjs} +1 -1
- package/lib/{ccip-FetjJVFw.mjs → ccip-CIIU_fEJ.mjs} +2 -2
- package/lib/{ccip-BTGJ_kF8.js → ccip-DaWU7YTU.js} +1 -1
- package/lib/{chain-DTh9H2Cq.js → chain-CJuQGMF5.js} +1 -1
- package/lib/{chain-Dq8acwHq.mjs → chain-uXEmLNMk.mjs} +1 -1
- package/lib/{checkmark-DDLHlQQ9.mjs → checkmark-BAUqIoTm.mjs} +1 -1
- package/lib/{checkmark-BaLFRM45.js → checkmark-C7_13-xW.js} +1 -1
- package/lib/{checkmark-bold-COMu2UxE.js → checkmark-bold-BAPMY9Va.js} +1 -1
- package/lib/{checkmark-bold-CuRoxeU8.mjs → checkmark-bold-DdxcN-xa.mjs} +1 -1
- package/lib/{chevron-bottom-C4e9WRar.js → chevron-bottom-BhliKUSk.js} +1 -1
- package/lib/{chevron-bottom-BWzCLrD5.mjs → chevron-bottom-DPs0vktV.mjs} +1 -1
- package/lib/{chevron-left-CGVLc133.js → chevron-left-CmxD6cz4.js} +1 -1
- package/lib/{chevron-left--LyUtyQT.mjs → chevron-left-Dk6PhtGR.mjs} +1 -1
- package/lib/{chevron-right-kMciDMkJ.mjs → chevron-right-CkGXlHcz.mjs} +1 -1
- package/lib/{chevron-right-BwKWUL52.js → chevron-right-CsZm-r4d.js} +1 -1
- package/lib/{chevron-top-CAHxogoB.js → chevron-top-COxXTPhY.js} +1 -1
- package/lib/{chevron-top-DwIXDDfD.mjs → chevron-top-Cckcz4Qs.mjs} +1 -1
- package/lib/{chrome-store-KsYwGQZ1.js → chrome-store-BQDKjVx4.js} +1 -1
- package/lib/{chrome-store-BtgUtu2e.mjs → chrome-store-BWCBtyqY.mjs} +1 -1
- package/lib/{chunk-KJH4KKG6-DOESg_ru.js → chunk-KJH4KKG6-CAnNL4lj.js} +1 -1
- package/lib/{chunk-KJH4KKG6-cfe1Zo7n.mjs → chunk-KJH4KKG6-CCerRpgp.mjs} +2 -2
- package/lib/{clock-CeP_x_KK.mjs → clock-BVouBwH-.mjs} +1 -1
- package/lib/{clock-DZ0ehwc-.js → clock-DyD0fxqO.js} +1 -1
- package/lib/{close-fTN6nBRu.mjs → close-BWXb69Wl.mjs} +1 -1
- package/lib/{close-DQfNwzpp.js → close-Cw0rUieJ.js} +1 -1
- package/lib/{coinPlaceholder-DetWjpMK.mjs → coinPlaceholder-BMScJe5r.mjs} +1 -1
- package/lib/{coinPlaceholder-Dg3gZsJM.js → coinPlaceholder-cDwG015N.js} +1 -1
- package/lib/{compass-BNDqAmOT.js → compass-BEkdaonl.js} +1 -1
- package/lib/{compass-Bi1bPHDM.mjs → compass-Ck1hdMBP.mjs} +1 -1
- package/lib/{constants-CoxhiYrX.js → constants-84--TxnQ.js} +1 -1
- package/lib/{constants-CPx3n7t3.mjs → constants-DL79O3Cw.mjs} +4 -4
- package/lib/{contract-D8VzaUQJ.mjs → contract-C26uilM9.mjs} +171 -171
- package/lib/{contract-DYtnmT6F.js → contract-C2wJ6LwN.js} +1 -1
- package/lib/{copy-CYLp0MkE.js → copy-BLHxb-RP.js} +1 -1
- package/lib/{copy-C0ChGAOX.mjs → copy-Db7Dj1yY.mjs} +1 -1
- package/lib/{create-BRB2U1qV.js → create-D2vX2bRe.js} +1 -1
- package/lib/create-OmEBpMgv.mjs +18 -0
- package/lib/{cursor-DsUEeeMn.js → cursor-C1Sin6tb.js} +1 -1
- package/lib/{cursor-C0wqoNp_.mjs → cursor-CNsWvtzA.mjs} +1 -1
- package/lib/{cursor-transparent-DOFMlNyt.mjs → cursor-transparent-BunBBBx5.mjs} +1 -1
- package/lib/{cursor-transparent-Dgi2QAXz.js → cursor-transparent-SER8uk9I.js} +1 -1
- package/lib/{desktop-DvAIpuqU.mjs → desktop-B6mJxAHq.mjs} +1 -1
- package/lib/{desktop-7XDZ1UeO.js → desktop-BxtmfVtX.js} +1 -1
- package/lib/{disconnect-BPZFeB_X.js → disconnect-C41yMwSb.js} +1 -1
- package/lib/{disconnect-CVe77kqf.mjs → disconnect-D7XSHnMT.mjs} +1 -1
- package/lib/{discord-BQnoDtpm.js → discord-B03i6OzP.js} +1 -1
- package/lib/{discord-C8tW30M4.mjs → discord-BYp6ZBO5.mjs} +1 -1
- package/lib/{etherscan-XnmA1DYM.js → etherscan-DLF8GRx-.js} +1 -1
- package/lib/{etherscan-BbTgK2kR.mjs → etherscan-Db4s0bfM.mjs} +1 -1
- package/lib/{evm-BcBUJ9Y7.js → evm-BmUWgBnJ.js} +2 -2
- package/lib/{evm-B1mLJPQm.mjs → evm-Cfbj-u_x.mjs} +9 -9
- package/lib/{evm-B92-10xg.js → evm-DT7UH6jw.js} +3 -3
- package/lib/{evm-DDTF3fsK.mjs → evm-JX0NqvCN.mjs} +9 -9
- package/lib/{exclamation-triangle-BSU-BEmm.js → exclamation-triangle-Bnq3BTWj.js} +1 -1
- package/lib/{exclamation-triangle-CDPTA2Zq.mjs → exclamation-triangle-QwUrQkZz.mjs} +1 -1
- package/lib/executor.js +1 -1
- package/lib/executor.mjs +1130 -487
- package/lib/{extension-BoRmu23R.mjs → extension-BJ8ReR_0.mjs} +1 -1
- package/lib/{extension-JoJqEx2q.js → extension-CgcYwI-C.js} +1 -1
- package/lib/{external-link-BmVFZxUx.mjs → external-link-C-xXuK-w.mjs} +1 -1
- package/lib/{external-link-CDpvnIKV.js → external-link-DyvDlcrJ.js} +1 -1
- package/lib/{facebook-BU0IgAsn.mjs → facebook-0DLWcqgY.mjs} +1 -1
- package/lib/{facebook-DVG-Of9i.js → facebook-BpyxMifX.js} +1 -1
- package/lib/{farcaster-EqU1YhWT.mjs → farcaster-7pF76-yJ.mjs} +1 -1
- package/lib/{farcaster-HjCoTneu.js → farcaster-CWG8svoe.js} +1 -1
- package/lib/{filters-9uiEFQFc.mjs → filters-B13ud8_A.mjs} +1 -1
- package/lib/{filters-Dj4vA-oO.js → filters-QScvFA3B.js} +1 -1
- package/lib/{github-CHTQ7Hhb.js → github-B1QukX4i.js} +1 -1
- package/lib/{github-Bv36prmZ.mjs → github-D82vkMzo.mjs} +1 -1
- package/lib/{google-D4be9Rni.js → google-C6E4oHHf.js} +1 -1
- package/lib/{google-CIdoM_ZL.mjs → google-D4wJMU48.mjs} +1 -1
- package/lib/{help-circle-Cp-RWM01.js → help-circle-C4PprAiX.js} +1 -1
- package/lib/{help-circle-Di6XLLqm.mjs → help-circle-DoiMsREG.mjs} +1 -1
- package/lib/hosted.js +1 -1
- package/lib/hosted.mjs +1 -1
- package/lib/{id-zzAVAbpV.js → id-D6HBBibn.js} +1 -1
- package/lib/{id-BKRrmUYA.mjs → id-DOZCSctU.mjs} +1 -1
- package/lib/{image-CHXv-pfQ.mjs → image-Bz-sq4zu.mjs} +1 -1
- package/lib/{image-D0lV7yfg.js → image-DwgrdoFE.js} +1 -1
- package/lib/{index-CbF5x2NI.js → index-AZ65joOD.js} +1 -1
- package/lib/{index-BsqWniHZ.mjs → index-B0H8aSyJ.mjs} +2 -2
- package/lib/{index-CreVTM0z.mjs → index-B1YHtJKf.mjs} +32 -32
- package/lib/{index-6NFOdkn_.mjs → index-B2v8cGyE.mjs} +5 -5
- package/lib/{index-Bn829hfx.js → index-B586QVP1.js} +1 -1
- package/lib/{index-CjojdPoR.js → index-BOiHIPRm.js} +1 -1
- package/lib/{index-CSf9Xnts.mjs → index-BgvV5NF2.mjs} +5 -5
- package/lib/{index-BxR9BQdY.mjs → index-BjeolB9D.mjs} +5 -5
- package/lib/{index-WR7oDg9u.mjs → index-Bv-BZXf_.mjs} +6 -6
- package/lib/{index-T00Tc9JN.js → index-C2EKjwxb.js} +1 -1
- package/lib/{index-D4dCJIWy.js → index-C2oYdtY8.js} +1 -1
- package/lib/{index-Cj6R9JbK.js → index-CFfjoJR9.js} +1 -1
- package/lib/{index-B6QoC8kC.mjs → index-CIGkn9tA.mjs} +1 -1
- package/lib/{index-D0eLvswO.mjs → index-CNWcuxPc.mjs} +1 -1
- package/lib/{index-Dy8-WjNf.mjs → index-CNhD4Iu8.mjs} +14 -14
- package/lib/{index-Cv26ujGL.js → index-CP6-WHfp.js} +1 -1
- package/lib/{index-BuMERF6V.mjs → index-CRYNS9pm.mjs} +3 -3
- package/lib/{index-CMRsE6Rx.js → index-CZhOgoed.js} +2 -2
- package/lib/{index-C9CCEaud.js → index-Cet7Wvc5.js} +1 -1
- package/lib/{index-CpYW6xKB.mjs → index-Cg5Ko9uq.mjs} +12 -12
- package/lib/{index-iIndJffV.js → index-CjI7Vey3.js} +1 -1
- package/lib/{index-C_DPPfkk.js → index-Cjz6EL9G.js} +1 -1
- package/lib/{index-CJXywlFV.mjs → index-CrKGOs08.mjs} +5 -5
- package/lib/{index-Dg_iItNp.js → index-Cy_GmZ1K.js} +1 -1
- package/lib/{index-B8CSnOaL.mjs → index-D1vSocUD.mjs} +4 -4
- package/lib/{index-Co1W4Raf.mjs → index-D4WbU33f.mjs} +10 -10
- package/lib/{index-B4yQb6w1.mjs → index-DInWB5Ku.mjs} +78 -78
- package/lib/{index-BJjgo7T5.js → index-DQXzR255.js} +1 -1
- package/lib/{index-FyK0K3it.mjs → index-DSGGuRHs.mjs} +7 -7
- package/lib/{index-BOmzGtQH.mjs → index-DVj58Xn9.mjs} +13 -13
- package/lib/{index-CAZoTTeF.js → index-DXD0qvNV.js} +1 -1
- package/lib/{index-DLyteqgH.js → index-Dd0zXo9p.js} +1 -1
- package/lib/{index-BDN9fAFf.js → index-DflOc1lz.js} +1 -1
- package/lib/{index-DZ0LaYyC.js → index-DoubjpWw.js} +1 -1
- package/lib/{index-BBXzsMzy.mjs → index-Dpefdrdb.mjs} +3296 -3074
- package/lib/{index-0V2bg9Sg.mjs → index-DuXi1xNY.mjs} +2 -2
- package/lib/{index-Csb-_vqa.js → index-Dw8nyQGf.js} +1 -1
- package/lib/{index-DUoona4h.mjs → index-Naa9NLXw.mjs} +4 -4
- package/lib/{index-BBwY_mLw.mjs → index-UZaBhUoD.mjs} +4 -4
- package/lib/{index-D5Wl9ZPE.mjs → index-XkPtmd0r.mjs} +7 -7
- package/lib/{index-CFikcYS0.js → index-XrGXGqnM.js} +1 -1
- package/lib/{index--rEdlHs9.js → index-sIkHg4mO.js} +1 -1
- package/lib/{index-w1W7oltR.js → index-tVbvQzum.js} +60 -60
- package/lib/{index-Cvt-EnSZ.mjs → index-wFZO7Yy8.mjs} +19 -19
- package/lib/{index-uqZQu-qU.js → index-yI1a3BCl.js} +1 -1
- package/lib/{index-aoDDl5Bh.js → index-zrsGesGr.js} +1 -1
- package/lib/{index.es-Buu5D0rZ.mjs → index.es-CTerQ-xd.mjs} +6 -6
- package/lib/{index.es-SeoKSGri.js → index.es-DW-Rbcpg.js} +1 -1
- package/lib/{index.es-BjmsZFfK.mjs → index.es-FblCdfpc.mjs} +4 -4
- package/lib/{index.es-B-gAV41L.js → index.es-tq-RvjG8.js} +2 -2
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{info-Bro13JOm.js → info-BifZFc7t.js} +1 -1
- package/lib/{info-circle-B1XYC5VH.js → info-circle-2P1Yxg4Q.js} +1 -1
- package/lib/{info-circle-Ysma0RJy.mjs → info-circle-BAC0QRkt.mjs} +1 -1
- package/lib/{info-DI_ShZXM.mjs → info-sSeB9YE8.mjs} +1 -1
- package/lib/{lightbulb-llAiUdyo.mjs → lightbulb-EmWyHxHf.mjs} +1 -1
- package/lib/{lightbulb-BWSob509.js → lightbulb-MtN8FDGi.js} +1 -1
- package/lib/{mail-rZToesAW.js → mail-CqXkLFqA.js} +1 -1
- package/lib/{mail-DoQE8IHx.mjs → mail-Kn0E2IkG.mjs} +1 -1
- package/lib/mayan.js +1 -1
- package/lib/mayan.mjs +9 -9
- package/lib/{mint-CyFSbOaj.js → mint-DzKeNBRo.js} +1 -1
- package/lib/{mint-CDUlLJB4.mjs → mint-WjTAjh-p.mjs} +2 -2
- package/lib/{mobile-BbcVkbmr.js → mobile-BE2FxzUq.js} +1 -1
- package/lib/{mobile-EtRDQH27.mjs → mobile-Dj3WE71d.mjs} +1 -1
- package/lib/{more-BK6O3COI.js → more-BGlDHap-.js} +1 -1
- package/lib/{more-DVrhZdB3.mjs → more-D4DDIvdG.mjs} +1 -1
- package/lib/{native-Bdd5l9MQ.js → native-CGkMKXpm.js} +1 -1
- package/lib/{native-D6oc9ERK.mjs → native-DCc4sjxb.mjs} +1 -1
- package/lib/{network-placeholder-BbB6hX07.mjs → network-placeholder-BBNnq4LJ.mjs} +1 -1
- package/lib/{network-placeholder-K8zio41s.js → network-placeholder-DZ6qNrD8.js} +1 -1
- package/lib/{nftPlaceholder-BMuE_429.mjs → nftPlaceholder-BGK-mcGP.mjs} +1 -1
- package/lib/{nftPlaceholder-L3ThVWUO.js → nftPlaceholder-t3eyvw1E.js} +1 -1
- package/lib/ntt.js +1 -1
- package/lib/ntt.mjs +10 -10
- package/lib/{off-CHM9QBcy.js → off-BBGwptS5.js} +1 -1
- package/lib/{off-CUzDZ7SQ.mjs → off-f4sOrEaa.mjs} +1 -1
- package/lib/{platform-CyoDzIPB.mjs → platform-BVScq6Cn.mjs} +6 -6
- package/lib/{platform-Ck9W87gm.mjs → platform-ByoVE-An.mjs} +4 -4
- package/lib/{platform-DbvllBcy.js → platform-DHBUZeaO.js} +1 -1
- package/lib/{platform-C7YwgvxU.js → platform-Yk6Fw43J.js} +1 -1
- package/lib/{platform-CgqczEeE.js → platform-_YLyrJdi.js} +1 -1
- package/lib/{platform-DkmFvjoG.mjs → platform-tSU41623.mjs} +16 -16
- package/lib/{play-store-DodlKRO8.js → play-store-BbN0jXQh.js} +1 -1
- package/lib/{play-store-B_TfUWJP.mjs → play-store-D8C6HS_a.mjs} +1 -1
- package/lib/{plus-BY6E-gA7.mjs → plus-CbTzHTic.mjs} +1 -1
- package/lib/{plus-DVGYUzNZ.js → plus-DmTKVIYx.js} +1 -1
- package/lib/{provider-jsonrpc-D033z3Mz.js → provider-jsonrpc-B0U6Ij-n.js} +1 -1
- package/lib/{provider-jsonrpc-BVvalXMV.mjs → provider-jsonrpc-pHUX5SqN.mjs} +155 -155
- package/lib/{qr-code-MKK1K7_f.js → qr-code-B6qlbkUI.js} +1 -1
- package/lib/{qr-code-DkdB4YWU.mjs → qr-code-BWVtySSk.mjs} +1 -1
- package/lib/{recycle-horizontal-Bg37UVPn.mjs → recycle-horizontal-Bs5gf79m.mjs} +1 -1
- package/lib/{recycle-horizontal-Bjn-ZLNs.js → recycle-horizontal-DzBA56-s.js} +1 -1
- package/lib/{refresh-dRlw97C1.js → refresh-62hm4k6x.js} +1 -1
- package/lib/{refresh-D6TcjIU1.mjs → refresh-ivbjdSCV.mjs} +1 -1
- package/lib/{reown-logo-Kc70GqDZ.js → reown-logo-CVyCROZP.js} +1 -1
- package/lib/{reown-logo-Dk82Zy5_.mjs → reown-logo-DkbDD804.mjs} +1 -1
- package/lib/{search-Dv-LI1Vx.js → search-BAemvNq7.js} +1 -1
- package/lib/{search-D83RKxoH.mjs → search-By1CMDmb.mjs} +1 -1
- package/lib/{secp256k1-BrfK8uV1.mjs → secp256k1-Cgk0g7W_.mjs} +1 -1
- package/lib/{secp256k1-DV6Qne0v.mjs → secp256k1-ClYndPcJ.mjs} +1 -1
- package/lib/{secp256k1-DXHZqO4S.js → secp256k1-DboBd6yN.js} +1 -1
- package/lib/{secp256k1-sf_P35Lc.js → secp256k1-uAsXZq5d.js} +1 -1
- package/lib/{send-Cyopk79y.mjs → send-BIKE35sd.mjs} +1 -1
- package/lib/{send-BSMIYys9.js → send-BQNTa-AX.js} +1 -1
- package/lib/{signer-DIpGs_9B.mjs → signer-CinqaaXD.mjs} +10 -10
- package/lib/{signer-BZ3rTVnM.js → signer-D-HjSIgq.js} +1 -1
- package/lib/{solana-DS2ZcUpG.js → solana-BUWSwHur.js} +4 -4
- package/lib/{solana-CrMvdvfl.mjs → solana-C2S4i5Ij.mjs} +11 -11
- package/lib/solana-CEz8hIFa.mjs +18 -0
- package/lib/solana-Dohpdke6.js +1 -0
- package/lib/{solanaEmbed.esm-Dj8UZAI5.mjs → solanaEmbed.esm-Dk8f6vW0.mjs} +2 -2
- package/lib/{solanaEmbed.esm-1oBtzdki.js → solanaEmbed.esm-lyjsfmH_.js} +1 -1
- package/lib/src/components/SampleApp/index.d.ts.map +1 -1
- package/lib/src/config/mainnet/rpcs.d.ts.map +1 -1
- package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
- package/lib/src/config/testnet/rpcs.d.ts.map +1 -1
- package/lib/src/config/testnet/tokens.d.ts.map +1 -1
- package/lib/src/config/types.d.ts +2 -1
- package/lib/src/config/types.d.ts.map +1 -1
- package/lib/src/contexts/TokensContext.d.ts.map +1 -1
- package/lib/src/exports/executor.d.ts +1 -1
- package/lib/src/exports/executor.d.ts.map +1 -1
- package/lib/src/icons/ChainIcons.d.ts.map +1 -1
- package/lib/src/icons/Chains/LINEA.d.ts +4 -0
- package/lib/src/icons/Chains/LINEA.d.ts.map +1 -0
- package/lib/src/icons/Chains/POLY.d.ts +2 -2
- package/lib/src/icons/Chains/POLY.d.ts.map +1 -1
- package/lib/src/icons/Chains/SONIC.d.ts +4 -0
- package/lib/src/icons/Chains/SONIC.d.ts.map +1 -0
- package/lib/src/icons/SvgDefs.d.ts.map +1 -1
- package/lib/src/icons/TokenIcons.d.ts.map +1 -1
- package/lib/src/icons/Tokens/POLY.d.ts.map +1 -1
- package/lib/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
- package/lib/src/sdklegacy/config/TESTNET.d.ts.map +1 -1
- package/lib/src/utils/coingecko.d.ts.map +1 -1
- package/lib/src/utils/sdkv2.d.ts +1 -1
- package/lib/src/utils/sdkv2.d.ts.map +1 -1
- package/lib/src/utils/wallet/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/GasSlider/index.d.ts +1 -0
- package/lib/src/views/v2/Bridge/GasSlider/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/lib/src/views/v2/Redeem/index.d.ts.map +1 -1
- package/lib/{sui-wX1yJDdB.js → sui-BCJA_cYx.js} +1 -1
- package/lib/{sui-C6UUvjyd.mjs → sui-BJC_JOkP.mjs} +3 -3
- package/lib/{sui-jsmS--zo.mjs → sui-B_AxArCa.mjs} +31 -31
- package/lib/{sui-mpRuHBm9.js → sui-Bdmfxpd2.js} +1 -1
- package/lib/{swapHorizontal-BiNrGmxY.mjs → swapHorizontal-CGVqXEEp.mjs} +1 -1
- package/lib/{swapHorizontal-Bg8dDuE0.js → swapHorizontal-Wp81JSgX.js} +1 -1
- package/lib/{swapHorizontalBold-DeCMOo5R.js → swapHorizontalBold-D70amlcg.js} +1 -1
- package/lib/{swapHorizontalBold-CNvg6Zjx.mjs → swapHorizontalBold-DfykA661.mjs} +1 -1
- package/lib/{swapHorizontalMedium-DClbbhUH.js → swapHorizontalMedium-B92n1mhC.js} +1 -1
- package/lib/{swapHorizontalMedium-TUPMHawi.mjs → swapHorizontalMedium-C39AY5jR.mjs} +1 -1
- package/lib/{swapHorizontalRoundedBold-Cwu5ydTm.js → swapHorizontalRoundedBold-CWEgSWL3.js} +1 -1
- package/lib/{swapHorizontalRoundedBold-BAlHBaC3.mjs → swapHorizontalRoundedBold-DHWf4C2R.mjs} +1 -1
- package/lib/{swapVertical-DDYEDCbu.mjs → swapVertical-BpTJ-r5m.mjs} +1 -1
- package/lib/{swapVertical-cn4noOLO.js → swapVertical-DbS3f5xB.js} +1 -1
- package/lib/{telegram-BGnemuS8.mjs → telegram-CNeTqCXy.mjs} +1 -1
- package/lib/{telegram-sBtcJjCa.js → telegram-DK-OaZof.js} +1 -1
- package/lib/{three-dots-BS-tA53X.mjs → three-dots-BK0Ca5f9.mjs} +1 -1
- package/lib/{three-dots-Ci3M242Y.js → three-dots-CLOJZeqn.js} +1 -1
- package/lib/{tokens-DprimVrG.js → tokens-BVFCrwUI.js} +1 -1
- package/lib/{tokens-ZJvnv3ye.mjs → tokens-BtPkpuCj.mjs} +3 -3
- package/lib/{twitch-kde2nyWc.js → twitch-6sCGBDD_.js} +1 -1
- package/lib/{twitch-DwEOOcQc.mjs → twitch-RQqv2Pha.mjs} +1 -1
- package/lib/{twitterIcon-EX3YrhMm.js → twitterIcon-A2SY7Ljz.js} +1 -1
- package/lib/{twitterIcon-D-aL497o.mjs → twitterIcon-C8wIxAQv.mjs} +1 -1
- package/lib/{units-BVg9f9bp.js → units-BrJ4CYDZ.js} +1 -1
- package/lib/{units-De4Es9C-.mjs → units-CLOrp1Nk.mjs} +24 -24
- package/lib/{unsignedTransaction-3gDumn1W.js → unsignedTransaction-BwT180qj.js} +1 -1
- package/lib/{unsignedTransaction-DmrfJNQf.mjs → unsignedTransaction-DkC9OIgh.mjs} +17 -17
- package/lib/{verify-DPJd26j0.mjs → verify-CXS0qPBz.mjs} +1 -1
- package/lib/{verify-BuD5oE0Y.js → verify-DnxzVYqj.js} +1 -1
- package/lib/{verify-filled-DgfMnLnW.js → verify-filled-BOz9hX3w.js} +1 -1
- package/lib/{verify-filled-BSJMiVyN.mjs → verify-filled-DOsmzDzC.mjs} +1 -1
- package/lib/{w3m-modal-vqqsLuJC.mjs → w3m-modal-Cdafmb0Z.mjs} +2 -2
- package/lib/{w3m-modal-jDCMhVYM.js → w3m-modal-CpYUxfVT.js} +1 -1
- package/lib/{wallet-DlsCAJmu.js → wallet-Bc87h19O.js} +1 -1
- package/lib/{wallet-CiaeeygI.mjs → wallet-D3sDbpnL.mjs} +1 -1
- package/lib/{wallet-placeholder-DhQ6l48d.mjs → wallet-placeholder-CsEk6mnJ.mjs} +1 -1
- package/lib/{wallet-placeholder-CWeGWgUL.js → wallet-placeholder-D60KEgcO.js} +1 -1
- package/lib/{walletconnect-CHFqRNg_.mjs → walletconnect-D44C2RUp.mjs} +1 -1
- package/lib/{walletconnect-YkYiOGcA.js → walletconnect-isfAM6mU.js} +1 -1
- package/lib/{warning-circle-z__jbYAZ.mjs → warning-circle-D6V7bjdk.mjs} +1 -1
- package/lib/{warning-circle-BKWEaDK7.js → warning-circle-DKsp8DlH.js} +1 -1
- package/lib/{web3-IDpqtkwB.js → web3-DgUW0FuE.js} +1 -1
- package/lib/{web3-CevzYKNd.mjs → web3-L0yKkQfC.mjs} +1 -1
- package/lib/{x-DXPEHEVV.mjs → x-CfYfR6N2.mjs} +1 -1
- package/lib/{x-De5ksSKs.js → x-D1ju5P9d.js} +1 -1
- package/package.json +30 -28
- package/lib/address-CSWlEusF.js +0 -15
- package/lib/create-CRa9FZnZ.mjs +0 -18
- package/lib/solana-BHr-TCKL.js +0 -1
- package/lib/solana-Dhrl0nvx.mjs +0 -18
package/lib/executor.mjs
CHANGED
|
@@ -1,28 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var c = (
|
|
4
|
-
import {
|
|
5
|
-
import { r as
|
|
6
|
-
import { l as
|
|
7
|
-
import { A as
|
|
8
|
-
import { A as
|
|
9
|
-
import { A as
|
|
10
|
-
import { E as
|
|
11
|
-
import { C as
|
|
12
|
-
import { E as
|
|
13
|
-
import { b as
|
|
14
|
-
import { suiCircleObjects as
|
|
15
|
-
import { S as
|
|
16
|
-
import { S as
|
|
17
|
-
import { createDepositForBurnInstruction as
|
|
18
|
-
import { P as
|
|
19
|
-
import { p as
|
|
20
|
-
import { a as
|
|
21
|
-
import { d as
|
|
22
|
-
const
|
|
1
|
+
var pt = Object.defineProperty;
|
|
2
|
+
var wt = (a, t, e) => t in a ? pt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var c = (a, t, e) => wt(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { b4 as Ct, aL as bt, b5 as Et, b6 as At, b7 as yt, b8 as xt, b9 as Dt, ba as Ft, bb as vt, bc as Bt, bd as St, aJ as Oe, D as E, be as W, aP as A, ac as Le, aR as te, aU as T, aV as Ge, aN as Qe, a_ as q, a3 as k, aW as je, q as Tt, af as C, as as We, aG as Ie, av as qe, d as O, ao as It, at as Ke, b1 as ne, b2 as Mt, ap as Pt, aX as kt, b3 as Ut, E as zt, W as B, aA as v, bf as Xe, u as ue, p as Ze, bg as He, _ as Vt, y as Je, T as b, A as Ye, x as et, f as x, ag as fe, i as L, ak as I, z as ae, B as se, c as R } from "./address-BkeBsCZD.mjs";
|
|
5
|
+
import { r as U } from "./chain-uXEmLNMk.mjs";
|
|
6
|
+
import { l as Me } from "./chunk-KJH4KKG6-CCerRpgp.mjs";
|
|
7
|
+
import { A as $t } from "./platform-BVScq6Cn.mjs";
|
|
8
|
+
import { A as Pe, _ as Rt } from "./address-xvE59bSC.mjs";
|
|
9
|
+
import { A as Nt } from "./unsignedTransaction-BDOQhqcZ.mjs";
|
|
10
|
+
import { E as G } from "./platform-tSU41623.mjs";
|
|
11
|
+
import { C as N } from "./contract-C26uilM9.mjs";
|
|
12
|
+
import { E as tt } from "./unsignedTransaction-C0V0UbsS.mjs";
|
|
13
|
+
import { b as ke, T as _t, a as Ot, _ as Lt } from "./platform-ByoVE-An.mjs";
|
|
14
|
+
import { suiCircleObjects as Gt } from "./index-CRYNS9pm.mjs";
|
|
15
|
+
import { S as Qt, R as nt } from "./address-CHEvC20V.mjs";
|
|
16
|
+
import { S as jt } from "./unsignedTransaction-BD81leu1.mjs";
|
|
17
|
+
import { createDepositForBurnInstruction as Wt } from "./index-B2v8cGyE.mjs";
|
|
18
|
+
import { P as qt } from "./index-CIGkn9tA.mjs";
|
|
19
|
+
import { p as Ue, u as at, b as Kt } from "./web3-L0yKkQfC.mjs";
|
|
20
|
+
import { a as Xt, S as Zt } from "./unsignedTransaction-DkC9OIgh.mjs";
|
|
21
|
+
import { d as Ht } from "./account-DRrQuG9b.mjs";
|
|
22
|
+
const Jt = {
|
|
23
|
+
binary: "uint",
|
|
24
|
+
size: 1,
|
|
25
|
+
custom: {
|
|
26
|
+
to: (a) => a > 0,
|
|
27
|
+
from: (a) => a ? 1 : 0
|
|
28
|
+
}
|
|
29
|
+
}, Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
30
|
+
__proto__: null,
|
|
31
|
+
amountItem: Ct,
|
|
32
|
+
boolItem: Jt,
|
|
33
|
+
chainItem: bt,
|
|
34
|
+
circleDomainItem: Et,
|
|
35
|
+
circleNonceItem: At,
|
|
36
|
+
fixedChainItem: yt,
|
|
37
|
+
fixedLengthStringItem: xt,
|
|
38
|
+
guardianSetItem: Dt,
|
|
39
|
+
payloadIdItem: Ft,
|
|
40
|
+
sequenceItem: vt,
|
|
41
|
+
signatureItem: Bt,
|
|
42
|
+
stringConversion: St,
|
|
43
|
+
universalAddressItem: Oe
|
|
44
|
+
}, Symbol.toStringTag, { value: "Module" })), me = {
|
|
23
45
|
Testnet: "https://executor-testnet.labsapis.com",
|
|
24
46
|
Mainnet: "https://executor.labsapis.com"
|
|
25
|
-
},
|
|
47
|
+
}, le = {
|
|
26
48
|
Testnet: {
|
|
27
49
|
Aptos: "0x14a12d1fd6ef371b70c2113155534ec152ec7f779e281b54866c796c9a4a58d3",
|
|
28
50
|
Avalanche: "0x2cfEC91B50f657Cc86Ec693542527ac3e03bF742",
|
|
@@ -41,7 +63,21 @@ const G = {
|
|
|
41
63
|
Unichain: "0xA7aBDb8f2108901c586543BD5e10E4fA263F4A47",
|
|
42
64
|
Solana: "CXGRA5SCc8jxDbaQPZrmmZNu2JV34DP7gFW4m31uC1zs"
|
|
43
65
|
}
|
|
44
|
-
},
|
|
66
|
+
}, en = {
|
|
67
|
+
Testnet: {
|
|
68
|
+
Avalanche: "0x4058F0C3924eDaB19c15597C438968ed49C1a213",
|
|
69
|
+
BaseSepolia: "0xC400FcC0e92d3406747FBb6f513D3aa8B038fcE9",
|
|
70
|
+
Sepolia: "0x0F18DD26D0B41fb1eaa9cF34D1Ec6022aA69a8e2"
|
|
71
|
+
},
|
|
72
|
+
Mainnet: {
|
|
73
|
+
Arbitrum: "0x8442d68524217601ed126f6859694E4B0C7c66A1",
|
|
74
|
+
Avalanche: "0x3952914628650Ca510404872D84DfF10A844C5B5",
|
|
75
|
+
Base: "0xbd8d42f40a11b37bD1b3770D754f9629F7cd5679",
|
|
76
|
+
Ethereum: "0x2cCf230467FE7387674BAa657747F0B5485c7fEC",
|
|
77
|
+
Linea: "0xc48c126468BE919068dE1983F00F65af759a4E87",
|
|
78
|
+
Sonic: "0xc39BF082ec91D9bC385F956D24a8D66C0c26223d"
|
|
79
|
+
}
|
|
80
|
+
}, ze = {
|
|
45
81
|
Testnet: {
|
|
46
82
|
executorId: "0x4000cfe2955d8355b3d3cf186f854fea9f787a457257056926fde1ec977670eb",
|
|
47
83
|
executorRequestsId: "0x2d9ccf3cce3f7dce408e5455e90b80a8161ad9673d1366c2a5def60ad93657a8"
|
|
@@ -50,16 +86,19 @@ const G = {
|
|
|
50
86
|
executorId: "0xdb0fe8bb1e2b5be628adbea0636063325073e1070ee11e4281457dfd7f158235",
|
|
51
87
|
executorRequestsId: "0xc030df7a3eed1494fa4b64aa8ab63a79041cf1114f4ff2b7ab5aca1c684a21a7"
|
|
52
88
|
}
|
|
53
|
-
},
|
|
89
|
+
}, tn = {
|
|
54
90
|
Testnet: "execXUrAsMnqMmTHj5m7N1YQgsDz3cwGLYCYyuDRciV",
|
|
55
91
|
Mainnet: "execXUrAsMnqMmTHj5m7N1YQgsDz3cwGLYCYyuDRciV"
|
|
56
|
-
},
|
|
92
|
+
}, nn = 5001n, an = {
|
|
57
93
|
Testnet: {
|
|
58
94
|
Aptos: 5000n,
|
|
95
|
+
ArbitrumSepolia: 500000n,
|
|
59
96
|
Avalanche: 200000n,
|
|
60
97
|
BaseSepolia: 200000n,
|
|
98
|
+
Linea: 250000n,
|
|
61
99
|
Sepolia: 200000n,
|
|
62
100
|
Solana: 250000n,
|
|
101
|
+
Sonic: 250000n,
|
|
63
102
|
Sui: 8000000n
|
|
64
103
|
},
|
|
65
104
|
Mainnet: {
|
|
@@ -68,13 +107,15 @@ const G = {
|
|
|
68
107
|
Avalanche: 250000n,
|
|
69
108
|
Base: 250000n,
|
|
70
109
|
Ethereum: 250000n,
|
|
110
|
+
Linea: 250000n,
|
|
71
111
|
Optimism: 250000n,
|
|
72
112
|
Polygon: 250000n,
|
|
73
113
|
Unichain: 250000n,
|
|
74
114
|
Solana: 250000n,
|
|
115
|
+
Sonic: 250000n,
|
|
75
116
|
Sui: 8000000n
|
|
76
117
|
}
|
|
77
|
-
},
|
|
118
|
+
}, sn = {
|
|
78
119
|
Testnet: {
|
|
79
120
|
Aptos: "0x23b54f6e29bba7f4123d088f4cfcd83f5e23a049de15895b119ce5a6cb5faa91",
|
|
80
121
|
Avalanche: "0x8F26A0025dcCc6Cfc07A7d38756280a10E295ad7",
|
|
@@ -85,97 +126,313 @@ const G = {
|
|
|
85
126
|
},
|
|
86
127
|
Mainnet: {
|
|
87
128
|
Aptos: "0x1f177e724a874ab6267172a3049291c480fc665883e6a3ac95d0909492c09dc8",
|
|
88
|
-
Solana: "JB3rmygUVuVZzgkxvMdV8mSKLJeQAkSXEK284Dqsziah",
|
|
89
|
-
Sui: "0xbfa1240e48c622d97881473953be730091161b7931d89bd6afe667841cf69ef4",
|
|
90
129
|
Arbitrum: "0xF11e0efF8b11Ce382645dd75352fC16b3aB3551E",
|
|
91
130
|
Avalanche: "0xF11e0efF8b11Ce382645dd75352fC16b3aB3551E",
|
|
92
131
|
Base: "0xF11e0efF8b11Ce382645dd75352fC16b3aB3551E",
|
|
93
132
|
Ethereum: "0xF11e0efF8b11Ce382645dd75352fC16b3aB3551E",
|
|
94
133
|
Optimism: "0xF11e0efF8b11Ce382645dd75352fC16b3aB3551E",
|
|
134
|
+
Linea: "0xF11e0efF8b11Ce382645dd75352fC16b3aB3551E",
|
|
95
135
|
Polygon: "0xF11e0efF8b11Ce382645dd75352fC16b3aB3551E",
|
|
96
|
-
Unichain: "0xF11e0efF8b11Ce382645dd75352fC16b3aB3551E"
|
|
136
|
+
Unichain: "0xF11e0efF8b11Ce382645dd75352fC16b3aB3551E",
|
|
137
|
+
Solana: "JB3rmygUVuVZzgkxvMdV8mSKLJeQAkSXEK284Dqsziah",
|
|
138
|
+
Sonic: "0xF11e0efF8b11Ce382645dd75352fC16b3aB3551E",
|
|
139
|
+
Sui: "0xbfa1240e48c622d97881473953be730091161b7931d89bd6afe667841cf69ef4"
|
|
97
140
|
}
|
|
141
|
+
}, rn = {
|
|
142
|
+
Testnet: {
|
|
143
|
+
ArbitrumSepolia: {
|
|
144
|
+
tokenMessengerV2: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA",
|
|
145
|
+
messageTransmitterV2: "0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275"
|
|
146
|
+
},
|
|
147
|
+
Avalanche: {
|
|
148
|
+
tokenMessengerV2: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA",
|
|
149
|
+
messageTransmitterV2: "0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275"
|
|
150
|
+
},
|
|
151
|
+
BaseSepolia: {
|
|
152
|
+
tokenMessengerV2: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA",
|
|
153
|
+
messageTransmitterV2: "0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275"
|
|
154
|
+
},
|
|
155
|
+
Linea: {
|
|
156
|
+
tokenMessengerV2: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA",
|
|
157
|
+
messageTransmitterV2: "0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275"
|
|
158
|
+
},
|
|
159
|
+
Sepolia: {
|
|
160
|
+
tokenMessengerV2: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA",
|
|
161
|
+
messageTransmitterV2: "0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275"
|
|
162
|
+
},
|
|
163
|
+
Sonic: {
|
|
164
|
+
tokenMessengerV2: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA",
|
|
165
|
+
messageTransmitterV2: "0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
Mainnet: {
|
|
169
|
+
Arbitrum: {
|
|
170
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
171
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
172
|
+
},
|
|
173
|
+
Avalanche: {
|
|
174
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
175
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
176
|
+
},
|
|
177
|
+
Base: {
|
|
178
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
179
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
180
|
+
},
|
|
181
|
+
Ethereum: {
|
|
182
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
183
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
184
|
+
},
|
|
185
|
+
Linea: {
|
|
186
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
187
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
188
|
+
},
|
|
189
|
+
Sonic: {
|
|
190
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
191
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}, st = {
|
|
195
|
+
Testnet: {
|
|
196
|
+
Sepolia: 0,
|
|
197
|
+
Avalanche: 1,
|
|
198
|
+
OptimismSepolia: 2,
|
|
199
|
+
ArbitrumSepolia: 3,
|
|
200
|
+
Solana: 5,
|
|
201
|
+
BaseSepolia: 6,
|
|
202
|
+
Polygon: 7,
|
|
203
|
+
Sui: 8,
|
|
204
|
+
Aptos: 9,
|
|
205
|
+
Unichain: 10
|
|
206
|
+
},
|
|
207
|
+
Mainnet: {
|
|
208
|
+
Ethereum: 0,
|
|
209
|
+
Avalanche: 1,
|
|
210
|
+
Optimism: 2,
|
|
211
|
+
Arbitrum: 3,
|
|
212
|
+
Solana: 5,
|
|
213
|
+
Base: 6,
|
|
214
|
+
Polygon: 7,
|
|
215
|
+
Sui: 8,
|
|
216
|
+
Aptos: 9,
|
|
217
|
+
Unichain: 10
|
|
218
|
+
}
|
|
219
|
+
}, z = (a, t) => {
|
|
220
|
+
var e;
|
|
221
|
+
return ((e = st[a]) == null ? void 0 : e[t]) !== void 0;
|
|
222
|
+
}, K = {
|
|
223
|
+
Testnet: {
|
|
224
|
+
Sepolia: 0,
|
|
225
|
+
Avalanche: 1,
|
|
226
|
+
ArbitrumSepolia: 3,
|
|
227
|
+
BaseSepolia: 6,
|
|
228
|
+
Linea: 11,
|
|
229
|
+
Sonic: 13
|
|
230
|
+
},
|
|
231
|
+
Mainnet: {
|
|
232
|
+
Ethereum: 0,
|
|
233
|
+
Avalanche: 1,
|
|
234
|
+
Arbitrum: 3,
|
|
235
|
+
Base: 6,
|
|
236
|
+
Linea: 11,
|
|
237
|
+
Sonic: 13
|
|
238
|
+
}
|
|
239
|
+
}, re = (a, t) => {
|
|
240
|
+
var e;
|
|
241
|
+
return ((e = K[a]) == null ? void 0 : e[t]) !== void 0;
|
|
242
|
+
}, Q = (a, t) => {
|
|
243
|
+
var n;
|
|
244
|
+
const e = (n = K[a]) == null ? void 0 : n[t];
|
|
245
|
+
if (e === void 0)
|
|
246
|
+
throw new Error(`CircleV2 domain not found for network ${a} and chain ${t}`);
|
|
247
|
+
return e;
|
|
248
|
+
}, rt = (a, t) => {
|
|
249
|
+
var n;
|
|
250
|
+
const e = (n = Object.entries(K[a] ?? {}).find(([, s]) => s === t)) == null ? void 0 : n[0];
|
|
251
|
+
if (e === void 0)
|
|
252
|
+
throw new Error(`CircleV2 chain not found for network ${a} and domain ${t}`);
|
|
253
|
+
return e;
|
|
254
|
+
}, X = {
|
|
255
|
+
Testnet: "https://iris-api-sandbox.circle.com/v2",
|
|
256
|
+
Mainnet: "https://iris-api.circle.com/v2"
|
|
98
257
|
};
|
|
99
|
-
var
|
|
100
|
-
(function(
|
|
101
|
-
|
|
102
|
-
})(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
258
|
+
var j;
|
|
259
|
+
(function(a) {
|
|
260
|
+
a[a.CONFIRMED = 1e3] = "CONFIRMED", a[a.FINALIZED = 2e3] = "FINALIZED";
|
|
261
|
+
})(j || (j = {}));
|
|
262
|
+
const it = {
|
|
263
|
+
// milliseconds
|
|
264
|
+
Testnet: {
|
|
265
|
+
ArbitrumSepolia: 8e3,
|
|
266
|
+
BaseSepolia: 8e3,
|
|
267
|
+
Sepolia: 2e4,
|
|
268
|
+
Linea: 8e3
|
|
269
|
+
},
|
|
270
|
+
Mainnet: {
|
|
271
|
+
Arbitrum: 8e3,
|
|
272
|
+
Base: 8e3,
|
|
273
|
+
Ethereum: 2e4,
|
|
274
|
+
Linea: 8e3
|
|
109
275
|
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
276
|
+
}, on = (a, t) => {
|
|
277
|
+
var e;
|
|
278
|
+
return ((e = it[a]) == null ? void 0 : e[t]) !== void 0;
|
|
279
|
+
};
|
|
280
|
+
class he {
|
|
281
|
+
constructor(t, e, n, s) {
|
|
282
|
+
c(this, "network");
|
|
283
|
+
c(this, "chain");
|
|
284
|
+
c(this, "provider");
|
|
285
|
+
c(this, "contracts");
|
|
286
|
+
c(this, "usdcId");
|
|
287
|
+
c(this, "shimContract");
|
|
288
|
+
var o;
|
|
289
|
+
if (this.network = t, this.chain = e, this.provider = n, this.contracts = s, t === "Devnet")
|
|
290
|
+
throw new Error("CCTPExecutor not supported on Devnet");
|
|
291
|
+
const r = E.get(this.network, this.chain);
|
|
292
|
+
if (!r)
|
|
293
|
+
throw new Error(`No USDC contract configured for network=${this.network} chain=${this.chain}`);
|
|
294
|
+
this.usdcId = r;
|
|
295
|
+
const i = (o = le[t]) == null ? void 0 : o[e];
|
|
296
|
+
if (!i)
|
|
297
|
+
throw new Error(`Shim contract for ${e} not found`);
|
|
298
|
+
this.shimContract = i;
|
|
121
299
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
})).data;
|
|
130
|
-
} catch {
|
|
131
|
-
throw new Error(`Failed to fetch status for txHash: ${n}.`);
|
|
300
|
+
static async fromRpc(t, e) {
|
|
301
|
+
const [n, s] = await $t.chainFromRpc(t), r = e[s];
|
|
302
|
+
if (!r)
|
|
303
|
+
throw new Error(`No config found for ${s}`);
|
|
304
|
+
if (r.network !== n)
|
|
305
|
+
throw new Error(`Network mismatch: ${r.network} != ${n}`);
|
|
306
|
+
return new he(n, s, t, r.contracts);
|
|
132
307
|
}
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
308
|
+
async *transfer(t, e, n) {
|
|
309
|
+
const s = new Pe(t).unwrap(), r = Me.from(e.address.toUniversalAddress().toUint8Array()), i = Me.from(this.usdcId), o = n.remainingAmount + n.referrerFee, d = W.get(this.network, e.chain), u = s, f = new Pe(n.referrer.address.toString()).unwrap(), m = [
|
|
310
|
+
o,
|
|
311
|
+
d,
|
|
312
|
+
r.toString(),
|
|
313
|
+
i.toString(),
|
|
314
|
+
n.estimatedCost,
|
|
315
|
+
A(e.chain),
|
|
316
|
+
u,
|
|
317
|
+
n.signedQuote,
|
|
318
|
+
n.relayInstructions,
|
|
319
|
+
n.referrerFeeDbps,
|
|
320
|
+
f
|
|
321
|
+
], l = {
|
|
322
|
+
function: `${this.shimContract}::cctp_v1_with_executor::deposit_for_burn_entry`,
|
|
323
|
+
functionArguments: m
|
|
324
|
+
};
|
|
325
|
+
yield this.createUnsignedTx(l, "AtposCCTPExecutor.Transfer");
|
|
326
|
+
}
|
|
327
|
+
createUnsignedTx(t, e, n = !1) {
|
|
328
|
+
return new Nt(t, this.network, this.chain, e, n);
|
|
141
329
|
}
|
|
142
|
-
return { referrerFee: 0n, remainingAmount: e };
|
|
143
330
|
}
|
|
144
|
-
|
|
145
|
-
|
|
331
|
+
U(Rt, "CCTPExecutor", he);
|
|
332
|
+
class ge {
|
|
333
|
+
constructor(t, e, n, s) {
|
|
334
|
+
c(this, "network");
|
|
335
|
+
c(this, "chain");
|
|
336
|
+
c(this, "provider");
|
|
337
|
+
c(this, "contracts");
|
|
338
|
+
c(this, "chainId");
|
|
339
|
+
c(this, "shimContract");
|
|
340
|
+
var i;
|
|
341
|
+
if (this.network = t, this.chain = e, this.provider = n, this.contracts = s, t === "Devnet")
|
|
342
|
+
throw new Error("CCTPExecutor not supported on Devnet");
|
|
343
|
+
this.chainId = Le.get(t, e);
|
|
344
|
+
const r = (i = le[t]) == null ? void 0 : i[e];
|
|
345
|
+
if (!r)
|
|
346
|
+
throw new Error(`Shim contract for ${e} not found`);
|
|
347
|
+
this.shimContract = r;
|
|
348
|
+
}
|
|
349
|
+
static async fromRpc(t, e) {
|
|
350
|
+
const [n, s] = await G.chainFromRpc(t), r = e[s];
|
|
351
|
+
if (r.network !== n)
|
|
352
|
+
throw new Error(`Network mismatch: ${r.network} != ${n}`);
|
|
353
|
+
return new ge(n, s, t, r.contracts);
|
|
354
|
+
}
|
|
355
|
+
async *transfer(t, e, n) {
|
|
356
|
+
const s = new te(t).toString(), r = e.address.toUniversalAddress().toUint8Array(), i = n.remainingAmount + n.referrerFee, o = E.get(this.network, this.chain), d = G.getTokenImplementation(this.provider, o);
|
|
357
|
+
if (await d.allowance(s, this.shimContract) < i) {
|
|
358
|
+
const h = await d.approve.populateTransaction(this.shimContract, i);
|
|
359
|
+
yield this.createUnsignedTx(T(h, s), "ERC20.approve of EvmCCTPExecutor", !1);
|
|
360
|
+
}
|
|
361
|
+
const f = [
|
|
362
|
+
"function depositForBurn(uint256 amount, uint16 destinationChain, uint32 destinationDomain, bytes32 mintRecipient, address burnToken, (address refundAddress, bytes signedQuote, bytes instructions) executorArgs, (uint16 dbps, address payee) feeArgs) external payable returns (uint64 nonce)"
|
|
363
|
+
], l = await new N(this.shimContract, f, this.provider).getFunction("depositForBurn").populateTransaction(i, A(e.chain), W.get(this.network, e.chain), r, o, {
|
|
364
|
+
refundAddress: s,
|
|
365
|
+
signedQuote: n.signedQuote,
|
|
366
|
+
instructions: n.relayInstructions
|
|
367
|
+
}, {
|
|
368
|
+
dbps: n.referrerFeeDbps,
|
|
369
|
+
payee: n.referrer.address.toString()
|
|
370
|
+
});
|
|
371
|
+
l.value = n.estimatedCost, yield this.createUnsignedTx(T(l, s), "EvmCCTPExecutor.depositForBurn");
|
|
372
|
+
}
|
|
373
|
+
createUnsignedTx(t, e, n = !1) {
|
|
374
|
+
return new tt(Ge(t, this.chainId), this.network, this.chain, e, n);
|
|
375
|
+
}
|
|
146
376
|
}
|
|
147
|
-
const
|
|
377
|
+
const { amountItem: V, circleDomainItem: Ve, universalAddressItem: S } = Yt, ot = {
|
|
378
|
+
binary: "uint",
|
|
379
|
+
size: 4,
|
|
380
|
+
custom: 1,
|
|
381
|
+
omit: !1
|
|
382
|
+
}, cn = {
|
|
383
|
+
binary: "bytes",
|
|
384
|
+
size: 32
|
|
385
|
+
}, $e = {
|
|
386
|
+
binary: "uint",
|
|
387
|
+
size: 4
|
|
388
|
+
}, dn = [
|
|
389
|
+
{ name: "version", ...ot },
|
|
390
|
+
{ name: "burnToken", ...S },
|
|
391
|
+
{ name: "mintRecipient", ...S },
|
|
392
|
+
{ name: "amount", ...V },
|
|
393
|
+
{ name: "messageSender", ...S },
|
|
394
|
+
{ name: "maxFee", ...V },
|
|
395
|
+
{ name: "feeExecuted", ...V },
|
|
396
|
+
{ name: "expirationBlock", ...V },
|
|
397
|
+
{ name: "hookData", binary: "bytes" }
|
|
398
|
+
], ct = [
|
|
399
|
+
{ name: "version", ...ot },
|
|
400
|
+
{ name: "sourceDomain", ...Ve },
|
|
401
|
+
{ name: "destinationDomain", ...Ve },
|
|
402
|
+
{ name: "nonce", ...cn },
|
|
403
|
+
{ name: "sender", ...S },
|
|
404
|
+
{ name: "recipient", ...S },
|
|
405
|
+
{ name: "destinationCaller", ...S },
|
|
406
|
+
{ name: "minFinalityThreshold", ...$e },
|
|
407
|
+
{ name: "finalityThresholdExecuted", ...$e },
|
|
408
|
+
{ name: "messageBody", binary: "bytes", layout: dn }
|
|
409
|
+
], un = (a) => q(ct, a), fn = (a) => Qe(ct, a), mn = [
|
|
148
410
|
{ name: "gasLimit", binary: "uint", size: 16 },
|
|
149
411
|
{ name: "msgValue", binary: "uint", size: 16 }
|
|
150
|
-
],
|
|
412
|
+
], ln = [
|
|
151
413
|
{ name: "dropOff", binary: "uint", size: 16 },
|
|
152
|
-
{ name: "recipient", ...
|
|
153
|
-
],
|
|
414
|
+
{ name: "recipient", ...Oe }
|
|
415
|
+
], hn = [
|
|
154
416
|
{
|
|
155
417
|
name: "request",
|
|
156
418
|
binary: "switch",
|
|
157
419
|
idSize: 1,
|
|
158
420
|
idTag: "type",
|
|
159
421
|
layouts: [
|
|
160
|
-
[[1, "GasInstruction"],
|
|
161
|
-
[[2, "GasDropOffInstruction"],
|
|
422
|
+
[[1, "GasInstruction"], mn],
|
|
423
|
+
[[2, "GasDropOffInstruction"], ln]
|
|
162
424
|
]
|
|
163
425
|
}
|
|
164
|
-
],
|
|
426
|
+
], dt = [
|
|
165
427
|
{
|
|
166
428
|
name: "requests",
|
|
167
429
|
binary: "array",
|
|
168
|
-
layout:
|
|
430
|
+
layout: hn
|
|
169
431
|
}
|
|
170
|
-
]
|
|
171
|
-
|
|
172
|
-
(
|
|
173
|
-
|
|
174
|
-
})(ge || (ge = {}));
|
|
175
|
-
const It = {
|
|
176
|
-
to: (e) => new Date(Number(e * 1000n)),
|
|
177
|
-
from: (e) => BigInt(e.getTime()) / 1000n
|
|
178
|
-
}, Bt = [
|
|
432
|
+
], gn = {
|
|
433
|
+
to: (a) => new Date(Number(a * 1000n)),
|
|
434
|
+
from: (a) => BigInt(a.getTime()) / 1000n
|
|
435
|
+
}, pn = [
|
|
179
436
|
{
|
|
180
437
|
name: "quote",
|
|
181
438
|
binary: "switch",
|
|
@@ -201,7 +458,7 @@ const It = {
|
|
|
201
458
|
name: "expiryTime",
|
|
202
459
|
binary: "uint",
|
|
203
460
|
size: 8,
|
|
204
|
-
custom:
|
|
461
|
+
custom: gn
|
|
205
462
|
},
|
|
206
463
|
{ name: "baseFee", binary: "uint", size: 8 },
|
|
207
464
|
{ name: "dstGasPrice", binary: "uint", size: 8 },
|
|
@@ -211,110 +468,79 @@ const It = {
|
|
|
211
468
|
]
|
|
212
469
|
]
|
|
213
470
|
}
|
|
214
|
-
],
|
|
215
|
-
...
|
|
471
|
+
], ut = [
|
|
472
|
+
...pn,
|
|
216
473
|
{ name: "signature", binary: "bytes", size: 65 }
|
|
217
474
|
];
|
|
218
|
-
class
|
|
219
|
-
constructor(
|
|
475
|
+
class pe {
|
|
476
|
+
constructor(t, e, n, s) {
|
|
220
477
|
c(this, "network");
|
|
221
478
|
c(this, "chain");
|
|
222
479
|
c(this, "provider");
|
|
223
480
|
c(this, "contracts");
|
|
224
|
-
c(this, "
|
|
481
|
+
c(this, "chainId");
|
|
225
482
|
c(this, "shimContract");
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
483
|
+
c(this, "messageTransmitter");
|
|
484
|
+
c(this, "usdcContract");
|
|
485
|
+
var d, u, f;
|
|
486
|
+
if (this.network = t, this.chain = e, this.provider = n, this.contracts = s, t === "Devnet")
|
|
487
|
+
throw new Error("CCTPv2Executor not supported on Devnet");
|
|
488
|
+
this.chainId = Le.get(t, e);
|
|
489
|
+
const r = (d = en[t]) == null ? void 0 : d[e];
|
|
490
|
+
if (!r)
|
|
491
|
+
throw new Error(`Shim contract for ${e} not found`);
|
|
492
|
+
this.shimContract = r;
|
|
493
|
+
const i = (f = (u = rn[t]) == null ? void 0 : u[e]) == null ? void 0 : f.messageTransmitterV2;
|
|
234
494
|
if (!i)
|
|
235
|
-
throw new Error(`
|
|
236
|
-
this.
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
throw new Error(`No config found for ${s}`);
|
|
242
|
-
if (a.network !== r)
|
|
243
|
-
throw new Error(`Network mismatch: ${a.network} != ${r}`);
|
|
244
|
-
return new Q(r, s, n, a.contracts);
|
|
245
|
-
}
|
|
246
|
-
async *transfer(n, t, r) {
|
|
247
|
-
const s = new ce(n).unwrap(), a = oe.from(t.address.toUniversalAddress().toUint8Array()), i = oe.from(this.usdcId), o = r.remainingAmount + r.referrerFee, d = P.get(this.network, t.chain), u = s, m = new ce(r.referrer.address.toString()).unwrap(), l = [
|
|
248
|
-
o,
|
|
249
|
-
d,
|
|
250
|
-
a.toString(),
|
|
251
|
-
i.toString(),
|
|
252
|
-
r.estimatedCost,
|
|
253
|
-
C(t.chain),
|
|
254
|
-
u,
|
|
255
|
-
r.signedQuote,
|
|
256
|
-
r.relayInstructions,
|
|
257
|
-
r.referrerFeeDbps,
|
|
258
|
-
m
|
|
259
|
-
], f = {
|
|
260
|
-
function: `${this.shimContract}::cctp_v1_with_executor::deposit_for_burn_entry`,
|
|
261
|
-
functionArguments: l
|
|
262
|
-
};
|
|
263
|
-
yield this.createUnsignedTx(f, "AtposCCTPExecutor.Transfer");
|
|
495
|
+
throw new Error(`MessageTransmitter contract for ${e} not found`);
|
|
496
|
+
this.messageTransmitter = i;
|
|
497
|
+
const o = E.get(t, e);
|
|
498
|
+
if (!o)
|
|
499
|
+
throw new Error(`USDC contract for ${e} not found`);
|
|
500
|
+
this.usdcContract = o;
|
|
264
501
|
}
|
|
265
|
-
|
|
266
|
-
|
|
502
|
+
static async fromRpc(t, e) {
|
|
503
|
+
const [n, s] = await G.chainFromRpc(t), r = e[s];
|
|
504
|
+
if (r.network !== n)
|
|
505
|
+
throw new Error(`Network mismatch: ${r.network} != ${n}`);
|
|
506
|
+
return new pe(n, s, t, r.contracts);
|
|
267
507
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
c(this, "chain");
|
|
274
|
-
c(this, "provider");
|
|
275
|
-
c(this, "contracts");
|
|
276
|
-
c(this, "chainId");
|
|
277
|
-
c(this, "shimContract");
|
|
278
|
-
var i;
|
|
279
|
-
if (this.network = n, this.chain = t, this.provider = r, this.contracts = s, n === "Devnet")
|
|
280
|
-
throw new Error("CCTPExecutor not supported on Devnet");
|
|
281
|
-
this.chainId = ze.get(n, t);
|
|
282
|
-
const a = (i = L[n]) == null ? void 0 : i[t];
|
|
283
|
-
if (!a)
|
|
284
|
-
throw new Error(`Shim contract for ${t} not found`);
|
|
285
|
-
this.shimContract = a;
|
|
286
|
-
}
|
|
287
|
-
static async fromRpc(n, t) {
|
|
288
|
-
const [r, s] = await de.chainFromRpc(n), a = t[s];
|
|
289
|
-
if (a.network !== r)
|
|
290
|
-
throw new Error(`Network mismatch: ${a.network} != ${r}`);
|
|
291
|
-
return new q(r, s, n, a.contracts);
|
|
292
|
-
}
|
|
293
|
-
async *transfer(n, t, r) {
|
|
294
|
-
const s = new Ue(n).toString(), a = t.address.toUniversalAddress().toUint8Array(), i = r.remainingAmount + r.referrerFee, o = w.get(this.network, this.chain), d = de.getTokenImplementation(this.provider, o);
|
|
295
|
-
if (await d.allowance(s, this.shimContract) < i) {
|
|
296
|
-
const g = await d.approve.populateTransaction(this.shimContract, i);
|
|
297
|
-
yield this.createUnsignedTx(te(g, s), "ERC20.approve of EvmCCTPExecutor", !1);
|
|
508
|
+
async *transfer(t, e, n) {
|
|
509
|
+
const s = new te(t).toString(), r = e.address.toUniversalAddress().toUint8Array(), i = n.remainingAmount + n.referrerFee, o = G.getTokenImplementation(this.provider, this.usdcContract);
|
|
510
|
+
if (await o.allowance(s, this.shimContract) < i) {
|
|
511
|
+
const g = await o.approve.populateTransaction(this.shimContract, i);
|
|
512
|
+
yield this.createUnsignedTx(T(g, s), "ERC20.approve of EvmCCTPv2Executor", !1);
|
|
298
513
|
}
|
|
299
|
-
const
|
|
300
|
-
"function depositForBurn(uint256 amount, uint16 destinationChain, uint32 destinationDomain, bytes32 mintRecipient, address burnToken, (address refundAddress, bytes signedQuote, bytes instructions) executorArgs, (uint16 dbps, address payee) feeArgs) external payable returns (uint64 nonce)"
|
|
301
|
-
], f =
|
|
514
|
+
const u = [
|
|
515
|
+
"function depositForBurn(uint256 amount, uint16 destinationChain, uint32 destinationDomain, bytes32 mintRecipient, address burnToken, bytes32 destinationCaller, uint256 maxFee, uint32 minFinalityThreshold, (address refundAddress, bytes signedQuote, bytes instructions) executorArgs, (uint16 dbps, address payee) feeArgs) external payable returns (uint64 nonce)"
|
|
516
|
+
], f = new Uint8Array(32), m = new N(this.shimContract, u, this.provider), l = Q(this.network, e.chain), h = await m.getFunction("depositForBurn").populateTransaction(i, A(e.chain), l, r, this.usdcContract, f, n.fastTransferMaxFee, n.minFinalityThreshold, {
|
|
302
517
|
refundAddress: s,
|
|
303
|
-
signedQuote:
|
|
304
|
-
instructions:
|
|
518
|
+
signedQuote: n.signedQuote,
|
|
519
|
+
instructions: n.relayInstructions
|
|
305
520
|
}, {
|
|
306
|
-
dbps:
|
|
307
|
-
payee:
|
|
521
|
+
dbps: n.referrerFeeDbps,
|
|
522
|
+
payee: n.referrer.address.toString()
|
|
308
523
|
});
|
|
309
|
-
|
|
524
|
+
h.value = n.estimatedCost, yield this.createUnsignedTx(T(h, s), "EvmCCTPv2Executor.depositForBurn");
|
|
525
|
+
}
|
|
526
|
+
async isTransferCompleted(t) {
|
|
527
|
+
return await new N(this.messageTransmitter, ["function usedNonces(bytes32) public view returns (uint256)"], this.provider).getFunction("usedNonces").staticCall(t.nonce) === 1n;
|
|
528
|
+
}
|
|
529
|
+
async *redeem(t, e, n) {
|
|
530
|
+
const s = new te(t).toString(), i = await new N(this.messageTransmitter, ["function receiveMessage(bytes message, bytes attestation)"], this.provider).getFunction("receiveMessage").populateTransaction(fn(e), k.decode(n));
|
|
531
|
+
yield this.createUnsignedTx(T(i, s), "MessageTransmitterV2.receiveMessage");
|
|
310
532
|
}
|
|
311
|
-
|
|
312
|
-
return
|
|
533
|
+
async getCurrentBlock() {
|
|
534
|
+
return BigInt(await this.provider.getBlockNumber());
|
|
535
|
+
}
|
|
536
|
+
createUnsignedTx(t, e, n = !1) {
|
|
537
|
+
return new tt(Ge(t, this.chainId), this.network, this.chain, e, n);
|
|
313
538
|
}
|
|
314
539
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
540
|
+
U(je, "CCTPExecutor", ge);
|
|
541
|
+
U(je, "CCTPv2Executor", pe);
|
|
542
|
+
class we {
|
|
543
|
+
constructor(t, e, n, s) {
|
|
318
544
|
c(this, "network");
|
|
319
545
|
c(this, "chain");
|
|
320
546
|
c(this, "provider");
|
|
@@ -327,50 +553,50 @@ class W {
|
|
|
327
553
|
c(this, "messageTransmitterStateId");
|
|
328
554
|
c(this, "executorId");
|
|
329
555
|
c(this, "executorRequestsId");
|
|
330
|
-
var u, m, l
|
|
331
|
-
if (this.network =
|
|
556
|
+
var u, f, m, l;
|
|
557
|
+
if (this.network = t, this.chain = e, this.provider = n, this.contracts = s, t === "Devnet")
|
|
332
558
|
throw new Error("CCTPExecutor not supported on Devnet");
|
|
333
|
-
const
|
|
334
|
-
if (!
|
|
335
|
-
throw new Error(
|
|
336
|
-
return
|
|
559
|
+
const r = (h, g) => {
|
|
560
|
+
if (!h)
|
|
561
|
+
throw new Error(g);
|
|
562
|
+
return h;
|
|
337
563
|
};
|
|
338
|
-
this.usdcId =
|
|
339
|
-
const { tokenMessengerState: i, messageTransmitterState: o, usdcTreasury: d } =
|
|
340
|
-
this.usdcTreasuryId = d, this.tokenMessengerId =
|
|
341
|
-
}
|
|
342
|
-
static async fromRpc(
|
|
343
|
-
const [
|
|
344
|
-
if (
|
|
345
|
-
throw new Error(`Network mismatch: ${
|
|
346
|
-
return new
|
|
347
|
-
}
|
|
348
|
-
async *transfer(
|
|
349
|
-
const s = new
|
|
564
|
+
this.usdcId = r(E.get(this.network, this.chain), `No USDC contract configured for network=${this.network} chain=${this.chain}`);
|
|
565
|
+
const { tokenMessengerState: i, messageTransmitterState: o, usdcTreasury: d } = Gt(t);
|
|
566
|
+
this.usdcTreasuryId = d, this.tokenMessengerId = r((u = s.cctp) == null ? void 0 : u.tokenMessenger, `Circle Token Messenger contract for domain ${e} not found`), this.messageTransmitterId = r((f = s.cctp) == null ? void 0 : f.messageTransmitter, `Circle Message Transmitter contract for domain ${e} not found`), this.tokenMessengerStateId = i, this.messageTransmitterStateId = o, this.executorId = r((m = ze[t]) == null ? void 0 : m.executorId, `Executor contract for ${t} not found`), this.executorRequestsId = r((l = ze[t]) == null ? void 0 : l.executorRequestsId, `Executor requests contract for ${t} not found`);
|
|
567
|
+
}
|
|
568
|
+
static async fromRpc(t, e) {
|
|
569
|
+
const [n, s] = await ke.chainFromRpc(t), r = e[s];
|
|
570
|
+
if (r.network !== n)
|
|
571
|
+
throw new Error(`Network mismatch: ${r.network} != ${n}`);
|
|
572
|
+
return new we(n, s, t, r.contracts);
|
|
573
|
+
}
|
|
574
|
+
async *transfer(t, e, n) {
|
|
575
|
+
const s = new _t(), r = new Qt(t).unwrap(), i = W.get(this.network, e.chain), [o, ...d] = await ke.getCoins(this.provider, t, this.usdcId);
|
|
350
576
|
if (o === void 0)
|
|
351
577
|
throw new Error("No USDC in wallet");
|
|
352
578
|
const u = s.object(o.coinObjectId);
|
|
353
|
-
d.length > 0 && s.mergeCoins(u, d.map((
|
|
354
|
-
let
|
|
355
|
-
if (
|
|
356
|
-
const [
|
|
357
|
-
|
|
358
|
-
|
|
579
|
+
d.length > 0 && s.mergeCoins(u, d.map((p) => s.object(p.coinObjectId)));
|
|
580
|
+
let f;
|
|
581
|
+
if (n.referrerFee > 0n) {
|
|
582
|
+
const [p, F] = s.splitCoins(u, [
|
|
583
|
+
n.remainingAmount,
|
|
584
|
+
n.referrerFee
|
|
359
585
|
]);
|
|
360
|
-
|
|
586
|
+
f = p, s.transferObjects([F], Tt(n.referrer));
|
|
361
587
|
} else {
|
|
362
|
-
const [
|
|
363
|
-
|
|
588
|
+
const [p] = s.splitCoins(u, [
|
|
589
|
+
n.remainingAmount
|
|
364
590
|
]);
|
|
365
|
-
|
|
591
|
+
f = p;
|
|
366
592
|
}
|
|
367
|
-
const [
|
|
593
|
+
const [m, l] = s.moveCall({
|
|
368
594
|
target: `${this.tokenMessengerId}::deposit_for_burn::deposit_for_burn`,
|
|
369
595
|
arguments: [
|
|
370
|
-
|
|
596
|
+
f,
|
|
371
597
|
s.pure.u32(i),
|
|
372
598
|
// destination_domain
|
|
373
|
-
s.pure.address(
|
|
599
|
+
s.pure.address(e.address.toUniversalAddress().toString()),
|
|
374
600
|
// mint_recipient
|
|
375
601
|
s.object(this.tokenMessengerStateId),
|
|
376
602
|
// token_messenger_minter state
|
|
@@ -382,115 +608,115 @@ class W {
|
|
|
382
608
|
// treasury object Treasury<USDC>
|
|
383
609
|
],
|
|
384
610
|
typeArguments: [this.usdcId]
|
|
385
|
-
}), [g] = s.moveCall({
|
|
386
|
-
target: `${this.messageTransmitterId}::message::source_domain`,
|
|
387
|
-
arguments: [f]
|
|
388
611
|
}), [h] = s.moveCall({
|
|
612
|
+
target: `${this.messageTransmitterId}::message::source_domain`,
|
|
613
|
+
arguments: [l]
|
|
614
|
+
}), [g] = s.moveCall({
|
|
389
615
|
target: `${this.messageTransmitterId}::message::nonce`,
|
|
390
|
-
arguments: [
|
|
616
|
+
arguments: [l]
|
|
391
617
|
}), [y] = s.moveCall({
|
|
392
618
|
target: `${this.executorRequestsId}::executor_requests::make_cctp_v1_request`,
|
|
393
|
-
arguments: [
|
|
394
|
-
}), [
|
|
395
|
-
s.pure.u64(
|
|
619
|
+
arguments: [h, g]
|
|
620
|
+
}), [D] = s.splitCoins(s.gas, [
|
|
621
|
+
s.pure.u64(n.estimatedCost)
|
|
396
622
|
]);
|
|
397
623
|
s.moveCall({
|
|
398
624
|
target: `${this.executorId}::executor::request_execution`,
|
|
399
625
|
arguments: [
|
|
400
|
-
|
|
401
|
-
s.object(
|
|
402
|
-
s.pure.u16(
|
|
626
|
+
D,
|
|
627
|
+
s.object(Ot),
|
|
628
|
+
s.pure.u16(A(e.chain)),
|
|
403
629
|
s.pure.address("0x0"),
|
|
404
|
-
s.pure.address(
|
|
405
|
-
s.pure.vector("u8",
|
|
630
|
+
s.pure.address(r),
|
|
631
|
+
s.pure.vector("u8", n.signedQuote),
|
|
406
632
|
y,
|
|
407
|
-
s.pure.vector("u8",
|
|
633
|
+
s.pure.vector("u8", n.relayInstructions)
|
|
408
634
|
]
|
|
409
635
|
}), yield this.createUnsignedTx(s, "SuiCCTPExecutor.Transfer");
|
|
410
636
|
}
|
|
411
|
-
createUnsignedTx(
|
|
412
|
-
return new
|
|
637
|
+
createUnsignedTx(t, e, n = !1) {
|
|
638
|
+
return new jt(t, this.network, this.chain, e, n);
|
|
413
639
|
}
|
|
414
640
|
}
|
|
415
|
-
|
|
416
|
-
const
|
|
417
|
-
new
|
|
418
|
-
const
|
|
419
|
-
new
|
|
420
|
-
new
|
|
421
|
-
class
|
|
422
|
-
constructor(
|
|
423
|
-
super(
|
|
641
|
+
U(Lt, "CCTPExecutor", we);
|
|
642
|
+
const Z = new C("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
|
|
643
|
+
new C("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
|
644
|
+
const Ce = new C("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
|
|
645
|
+
new C("So11111111111111111111111111111111111111112");
|
|
646
|
+
new C("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");
|
|
647
|
+
class wn extends Error {
|
|
648
|
+
constructor(t) {
|
|
649
|
+
super(t);
|
|
424
650
|
}
|
|
425
651
|
}
|
|
426
|
-
class
|
|
652
|
+
class Cn extends wn {
|
|
427
653
|
constructor() {
|
|
428
654
|
super(...arguments), this.name = "TokenOwnerOffCurveError";
|
|
429
655
|
}
|
|
430
656
|
}
|
|
431
|
-
var
|
|
432
|
-
(function(
|
|
433
|
-
|
|
434
|
-
})(
|
|
435
|
-
function
|
|
436
|
-
if (
|
|
437
|
-
|
|
438
|
-
for (const
|
|
439
|
-
|
|
440
|
-
pubkey:
|
|
657
|
+
var ie;
|
|
658
|
+
(function(a) {
|
|
659
|
+
a[a.InitializeMint = 0] = "InitializeMint", a[a.InitializeAccount = 1] = "InitializeAccount", a[a.InitializeMultisig = 2] = "InitializeMultisig", a[a.Transfer = 3] = "Transfer", a[a.Approve = 4] = "Approve", a[a.Revoke = 5] = "Revoke", a[a.SetAuthority = 6] = "SetAuthority", a[a.MintTo = 7] = "MintTo", a[a.Burn = 8] = "Burn", a[a.CloseAccount = 9] = "CloseAccount", a[a.FreezeAccount = 10] = "FreezeAccount", a[a.ThawAccount = 11] = "ThawAccount", a[a.TransferChecked = 12] = "TransferChecked", a[a.ApproveChecked = 13] = "ApproveChecked", a[a.MintToChecked = 14] = "MintToChecked", a[a.BurnChecked = 15] = "BurnChecked", a[a.InitializeAccount2 = 16] = "InitializeAccount2", a[a.SyncNative = 17] = "SyncNative", a[a.InitializeAccount3 = 18] = "InitializeAccount3", a[a.InitializeMultisig2 = 19] = "InitializeMultisig2", a[a.InitializeMint2 = 20] = "InitializeMint2", a[a.GetAccountDataSize = 21] = "GetAccountDataSize", a[a.InitializeImmutableOwner = 22] = "InitializeImmutableOwner", a[a.AmountToUiAmount = 23] = "AmountToUiAmount", a[a.UiAmountToAmount = 24] = "UiAmountToAmount", a[a.InitializeMintCloseAuthority = 25] = "InitializeMintCloseAuthority", a[a.TransferFeeExtension = 26] = "TransferFeeExtension", a[a.ConfidentialTransferExtension = 27] = "ConfidentialTransferExtension", a[a.DefaultAccountStateExtension = 28] = "DefaultAccountStateExtension", a[a.Reallocate = 29] = "Reallocate", a[a.MemoTransferExtension = 30] = "MemoTransferExtension", a[a.CreateNativeMint = 31] = "CreateNativeMint", a[a.InitializeNonTransferableMint = 32] = "InitializeNonTransferableMint", a[a.InterestBearingMintExtension = 33] = "InterestBearingMintExtension", a[a.CpiGuardExtension = 34] = "CpiGuardExtension", a[a.InitializePermanentDelegate = 35] = "InitializePermanentDelegate", a[a.TransferHookExtension = 36] = "TransferHookExtension", a[a.MetadataPointerExtension = 39] = "MetadataPointerExtension";
|
|
660
|
+
})(ie || (ie = {}));
|
|
661
|
+
function bn(a, t, e) {
|
|
662
|
+
if (e.length) {
|
|
663
|
+
a.push({ pubkey: t, isSigner: !1, isWritable: !1 });
|
|
664
|
+
for (const n of e)
|
|
665
|
+
a.push({
|
|
666
|
+
pubkey: n instanceof C ? n : n.publicKey,
|
|
441
667
|
isSigner: !0,
|
|
442
668
|
isWritable: !1
|
|
443
669
|
});
|
|
444
670
|
} else
|
|
445
|
-
|
|
446
|
-
return
|
|
671
|
+
a.push({ pubkey: t, isSigner: !0, isWritable: !1 });
|
|
672
|
+
return a;
|
|
447
673
|
}
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
674
|
+
const En = We([
|
|
675
|
+
Ie("mintAuthorityOption"),
|
|
676
|
+
Ue("mintAuthority"),
|
|
677
|
+
at("supply"),
|
|
678
|
+
qe("decimals"),
|
|
679
|
+
Kt("isInitialized"),
|
|
680
|
+
Ie("freezeAuthorityOption"),
|
|
681
|
+
Ue("freezeAuthority")
|
|
456
682
|
]);
|
|
457
|
-
|
|
458
|
-
function
|
|
459
|
-
if (!
|
|
460
|
-
throw new
|
|
461
|
-
const [
|
|
462
|
-
return
|
|
683
|
+
En.span;
|
|
684
|
+
function Re(a, t, e = !1, n = Z, s = Ce) {
|
|
685
|
+
if (!e && !C.isOnCurve(t.toBuffer()))
|
|
686
|
+
throw new Cn();
|
|
687
|
+
const [r] = C.findProgramAddressSync([t.toBuffer(), n.toBuffer(), a.toBuffer()], s);
|
|
688
|
+
return r;
|
|
463
689
|
}
|
|
464
|
-
function
|
|
465
|
-
return
|
|
690
|
+
function An(a, t, e, n, s = Z, r = Ce) {
|
|
691
|
+
return yn(a, t, e, n, O.Buffer.from([1]), s, r);
|
|
466
692
|
}
|
|
467
|
-
function
|
|
693
|
+
function yn(a, t, e, n, s, r = Z, i = Ce) {
|
|
468
694
|
const o = [
|
|
469
|
-
{ pubkey:
|
|
470
|
-
{ pubkey:
|
|
471
|
-
{ pubkey:
|
|
472
|
-
{ pubkey:
|
|
473
|
-
{ pubkey:
|
|
474
|
-
{ pubkey:
|
|
695
|
+
{ pubkey: a, isSigner: !0, isWritable: !0 },
|
|
696
|
+
{ pubkey: t, isSigner: !1, isWritable: !0 },
|
|
697
|
+
{ pubkey: e, isSigner: !1, isWritable: !1 },
|
|
698
|
+
{ pubkey: n, isSigner: !1, isWritable: !1 },
|
|
699
|
+
{ pubkey: It.programId, isSigner: !1, isWritable: !1 },
|
|
700
|
+
{ pubkey: r, isSigner: !1, isWritable: !1 }
|
|
475
701
|
];
|
|
476
|
-
return new
|
|
702
|
+
return new Ke({
|
|
477
703
|
keys: o,
|
|
478
704
|
programId: i,
|
|
479
705
|
data: s
|
|
480
706
|
});
|
|
481
707
|
}
|
|
482
|
-
const
|
|
483
|
-
function
|
|
484
|
-
const i =
|
|
485
|
-
{ pubkey:
|
|
486
|
-
{ pubkey:
|
|
487
|
-
],
|
|
488
|
-
return
|
|
489
|
-
instruction:
|
|
490
|
-
amount: BigInt(
|
|
491
|
-
}, o), new
|
|
708
|
+
const Ne = We([qe("instruction"), at("amount")]);
|
|
709
|
+
function xn(a, t, e, n, s = [], r = Z) {
|
|
710
|
+
const i = bn([
|
|
711
|
+
{ pubkey: a, isSigner: !1, isWritable: !0 },
|
|
712
|
+
{ pubkey: t, isSigner: !1, isWritable: !0 }
|
|
713
|
+
], e, s), o = O.Buffer.alloc(Ne.span);
|
|
714
|
+
return Ne.encode({
|
|
715
|
+
instruction: ie.Transfer,
|
|
716
|
+
amount: BigInt(n)
|
|
717
|
+
}, o), new Ke({ keys: i, programId: r, data: o });
|
|
492
718
|
}
|
|
493
|
-
const
|
|
719
|
+
const Dn = {
|
|
494
720
|
version: "0.1.0",
|
|
495
721
|
name: "example_cctp_with_executor",
|
|
496
722
|
instructions: [
|
|
@@ -560,8 +786,8 @@ const kt = {
|
|
|
560
786
|
}
|
|
561
787
|
]
|
|
562
788
|
};
|
|
563
|
-
class
|
|
564
|
-
constructor(
|
|
789
|
+
class be {
|
|
790
|
+
constructor(t, e, n, s) {
|
|
565
791
|
c(this, "network");
|
|
566
792
|
c(this, "chain");
|
|
567
793
|
c(this, "connection");
|
|
@@ -571,56 +797,267 @@ class j {
|
|
|
571
797
|
c(this, "shimProgramId");
|
|
572
798
|
c(this, "executorProgramId");
|
|
573
799
|
var i, o, d;
|
|
574
|
-
if (this.network =
|
|
800
|
+
if (this.network = t, this.chain = e, this.connection = n, this.contracts = s, t === "Devnet")
|
|
575
801
|
throw new Error("CCTPExecutor not supported on Devnet");
|
|
576
|
-
const
|
|
802
|
+
const r = (u, f) => {
|
|
577
803
|
if (!u)
|
|
578
|
-
throw new Error(
|
|
579
|
-
return new
|
|
804
|
+
throw new Error(f);
|
|
805
|
+
return new C(u);
|
|
580
806
|
};
|
|
581
|
-
this.tokenMessengerProgramId =
|
|
582
|
-
}
|
|
583
|
-
static async fromRpc(
|
|
584
|
-
const [
|
|
585
|
-
if (
|
|
586
|
-
throw new Error(`Network mismatch: ${
|
|
587
|
-
return new
|
|
588
|
-
}
|
|
589
|
-
async *transfer(
|
|
590
|
-
const s = new
|
|
591
|
-
if (d.feePayer =
|
|
592
|
-
const y =
|
|
593
|
-
await this.connection.getAccountInfo(y) || d.add(
|
|
807
|
+
this.tokenMessengerProgramId = r((i = s.cctp) == null ? void 0 : i.tokenMessenger, `Circle Token Messenger contract for domain ${e} not found`), this.messageTransmitterProgramId = r((o = s.cctp) == null ? void 0 : o.messageTransmitter, `Circle Message Transmitter contract for domain ${e} not found`), this.shimProgramId = r((d = le[t]) == null ? void 0 : d[e], `Shim contract for ${e} not found`), this.executorProgramId = r(tn[t], `Executor contract for ${t} not found`);
|
|
808
|
+
}
|
|
809
|
+
static async fromRpc(t, e) {
|
|
810
|
+
const [n, s] = await Xt.chainFromRpc(t), r = e[s];
|
|
811
|
+
if (r.network !== n)
|
|
812
|
+
throw new Error(`Network mismatch: ${r.network} != ${n}`);
|
|
813
|
+
return new be(n, s, t, r.contracts);
|
|
814
|
+
}
|
|
815
|
+
async *transfer(t, e, n) {
|
|
816
|
+
const s = new C(E.get(this.network, this.chain)), r = new ne(t).unwrap(), i = Re(s, r), o = new ne(n.referrer.address).unwrap(), d = new Mt();
|
|
817
|
+
if (d.feePayer = r, n.referrerFee > 0n) {
|
|
818
|
+
const y = Re(s, o, !0);
|
|
819
|
+
await this.connection.getAccountInfo(y) || d.add(An(r, y, o, s)), d.add(xn(i, y, r, n.referrerFee));
|
|
594
820
|
}
|
|
595
|
-
const u =
|
|
596
|
-
d.add(await
|
|
597
|
-
const
|
|
598
|
-
d.add(await
|
|
599
|
-
execAmount: new
|
|
600
|
-
recipientChain:
|
|
601
|
-
signedQuoteBytes:
|
|
602
|
-
relayInstructions:
|
|
821
|
+
const u = W.get(this.network, e.chain), f = e.address.toUniversalAddress(), m = Pt.generate();
|
|
822
|
+
d.add(await Wt(this.messageTransmitterProgramId, this.tokenMessengerProgramId, s, u, r, i, f, n.remainingAmount, m.publicKey));
|
|
823
|
+
const l = new qt(Dn, this.shimProgramId, { connection: null }), h = q(ut, n.signedQuote), g = Ht("message_transmitter", this.messageTransmitterProgramId);
|
|
824
|
+
d.add(await l.methods.relayLastMessage({
|
|
825
|
+
execAmount: new kt(n.estimatedCost.toString()),
|
|
826
|
+
recipientChain: A(e.chain),
|
|
827
|
+
signedQuoteBytes: O.Buffer.from(n.signedQuote),
|
|
828
|
+
relayInstructions: O.Buffer.from(n.relayInstructions)
|
|
603
829
|
}).accounts({
|
|
604
|
-
payer:
|
|
605
|
-
messageTransmitter:
|
|
606
|
-
payee: new
|
|
830
|
+
payer: r,
|
|
831
|
+
messageTransmitter: g,
|
|
832
|
+
payee: new C(h.quote.payeeAddress),
|
|
607
833
|
executorProgram: this.executorProgramId
|
|
608
|
-
}).instruction()), yield this.createUnsignedTx({ transaction: d, signers: [
|
|
834
|
+
}).instruction()), yield this.createUnsignedTx({ transaction: d, signers: [m] }, "SvmCCTPExecutor.Transfer");
|
|
609
835
|
}
|
|
610
|
-
createUnsignedTx(
|
|
611
|
-
return new
|
|
836
|
+
createUnsignedTx(t, e, n = !1) {
|
|
837
|
+
return new Zt(t, this.network, this.chain, e, n);
|
|
612
838
|
}
|
|
613
839
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
function
|
|
617
|
-
|
|
840
|
+
U(Ut, "CCTPExecutor", be);
|
|
841
|
+
var w;
|
|
842
|
+
(function(a) {
|
|
843
|
+
a.Pending = "pending", a.Failed = "failed", a.Unsupported = "unsupported", a.Submitted = "submitted", a.Underpaid = "underpaid", a.Aborted = "aborted";
|
|
844
|
+
})(w || (w = {}));
|
|
845
|
+
var _e;
|
|
846
|
+
(function(a) {
|
|
847
|
+
a.ERM1 = "ERM1", a.ERV1 = "ERV1", a.ERN1 = "ERN1", a.ERC1 = "ERC1", a.ERC2 = "ERC2";
|
|
848
|
+
})(_e || (_e = {}));
|
|
849
|
+
async function Fn(a) {
|
|
850
|
+
const t = `${me[a]}/v0/capabilities`;
|
|
851
|
+
try {
|
|
852
|
+
return (await v.get(t)).data;
|
|
853
|
+
} catch {
|
|
854
|
+
throw new Error(`Failed to fetch capabilities for network: ${a}.`);
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
async function vn(a, t, e, n) {
|
|
858
|
+
const s = `${me[a]}/v0/quote`;
|
|
859
|
+
try {
|
|
860
|
+
return (await v.post(s, {
|
|
861
|
+
srcChain: A(t),
|
|
862
|
+
dstChain: A(e),
|
|
863
|
+
relayInstructions: n
|
|
864
|
+
})).data;
|
|
865
|
+
} catch {
|
|
866
|
+
throw new Error("Failed to fetch signed quote.");
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
async function Ee(a, t, e) {
|
|
870
|
+
const n = `${me[a]}/v0/status/tx`;
|
|
871
|
+
try {
|
|
872
|
+
return (await v.post(n, {
|
|
873
|
+
txHash: t,
|
|
874
|
+
chainId: A(e)
|
|
875
|
+
})).data;
|
|
876
|
+
} catch {
|
|
877
|
+
throw new Error(`Failed to fetch status for txHash: ${t}.`);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
const Bn = 65535n;
|
|
881
|
+
function Sn(a, t, e) {
|
|
882
|
+
if (t > Bn)
|
|
883
|
+
throw new Error("dBps exceeds max u16");
|
|
884
|
+
let n = t, s = a, r = 0n;
|
|
885
|
+
if (t > 0) {
|
|
886
|
+
if (e !== void 0 && a > 0) {
|
|
887
|
+
const i = Ze(e.toString(), 6), o = ue(i) / a, d = t < o ? t : o;
|
|
888
|
+
r = a * d / 100000n, n = d;
|
|
889
|
+
} else
|
|
890
|
+
r = a * t / 100000n;
|
|
891
|
+
s = a - r;
|
|
892
|
+
}
|
|
893
|
+
return { referrerFee: r, remainingAmount: s, referrerFeeDbps: n };
|
|
894
|
+
}
|
|
895
|
+
function Tn(a) {
|
|
896
|
+
return new Promise((t) => setTimeout(t, a));
|
|
897
|
+
}
|
|
898
|
+
async function oe(a, t, e = Xe) {
|
|
899
|
+
const n = Q(t, a.chain);
|
|
900
|
+
return He(async () => {
|
|
901
|
+
var r;
|
|
902
|
+
const s = `${X[t]}/messages/${n}?transactionHash=${a.txid}`;
|
|
903
|
+
try {
|
|
904
|
+
const o = (await v.get(s)).data.messages[0];
|
|
905
|
+
if (!o)
|
|
906
|
+
return null;
|
|
907
|
+
if (o.cctpVersion !== 2)
|
|
908
|
+
throw new Error("CCTPv1 attestation found");
|
|
909
|
+
return o.status === "pending_confirmations" ? null : {
|
|
910
|
+
message: un(k.decode(o.message)),
|
|
911
|
+
attestation: o.attestation
|
|
912
|
+
};
|
|
913
|
+
} catch (i) {
|
|
914
|
+
if (!i || typeof i == "object" && (v.isAxiosError(i) && ((r = i.response) == null ? void 0 : r.status) === 404 || "status" in i && i.status === 404))
|
|
915
|
+
return null;
|
|
916
|
+
throw i;
|
|
917
|
+
}
|
|
918
|
+
}, 2e3, e, "CCTPv2:GetMessage");
|
|
919
|
+
}
|
|
920
|
+
async function In(a, t, e) {
|
|
921
|
+
const n = Q(a, t), s = Q(a, e), r = `${X[a]}/fastBurn/USDC/fees/${n}/${s}`, i = await v.get(r);
|
|
922
|
+
return BigInt(i.data.minimumFee);
|
|
923
|
+
}
|
|
924
|
+
async function Mn(a, t) {
|
|
925
|
+
const e = k.encode(t.attestation.message.nonce, !0), n = `${X[a]}/reattest/${e}`, s = await v.post(n);
|
|
926
|
+
if (s.data.error) {
|
|
927
|
+
if (s.data.error.includes("Message is already finalized"))
|
|
928
|
+
return t.attestation;
|
|
929
|
+
throw new Error(`Error re-attesting message: ${s.data.error}`);
|
|
930
|
+
}
|
|
931
|
+
const r = rt(a, t.attestation.message.sourceDomain);
|
|
932
|
+
return He(async () => {
|
|
933
|
+
const i = await oe({ txid: t.id, chain: r }, a);
|
|
934
|
+
return !i || i.message.messageBody.expirationBlock !== 0n ? null : i;
|
|
935
|
+
}, 2e3, Xe, "CCTPv2:Reattest");
|
|
936
|
+
}
|
|
937
|
+
async function Pn(a) {
|
|
938
|
+
const t = `${X[a]}/fastBurn/USDC/allowance`, e = await v.get(t);
|
|
939
|
+
return ue(Ze(e.data.allowance, 6));
|
|
940
|
+
}
|
|
941
|
+
function Ae(a, t, e) {
|
|
942
|
+
const n = E.get(t.network, t.chain);
|
|
943
|
+
if (!(n && zt(a, B.tokenId(t.chain, n))))
|
|
944
|
+
return [];
|
|
945
|
+
const { network: s, chain: r } = e, i = E.get(s, r);
|
|
946
|
+
return i ? [B.chainAddress(r, i)] : [];
|
|
947
|
+
}
|
|
948
|
+
let $;
|
|
949
|
+
async function ye(a, t, e, n) {
|
|
950
|
+
var Be, Se;
|
|
951
|
+
const { fromChain: s, toChain: r } = a;
|
|
952
|
+
if (!E.get(s.network, s.chain))
|
|
953
|
+
throw new Error("Invalid transfer, no USDC contract on source");
|
|
954
|
+
const o = E.get(r.network, r.chain);
|
|
955
|
+
if (!o)
|
|
956
|
+
throw new Error("Invalid transfer, no USDC contract on destination");
|
|
957
|
+
const d = (Be = sn[s.network]) == null ? void 0 : Be[s.chain];
|
|
958
|
+
if (!d)
|
|
959
|
+
throw new Error("No referrer address found");
|
|
960
|
+
const u = B.chainAddress(s.chain, d), { referrerFee: f, remainingAmount: m, referrerFeeDbps: l } = Sn(ue(t.normalizedParams.amount), e.referrerFeeDbps, e.referrerFeeThreshold);
|
|
961
|
+
if (m <= 0n)
|
|
962
|
+
throw new Error("Amount after fee <= 0");
|
|
963
|
+
const h = (Se = an[r.network]) == null ? void 0 : Se[r.chain];
|
|
964
|
+
if (!h)
|
|
965
|
+
throw new Error("Gas limit not found");
|
|
966
|
+
const g = await Fn(s.network);
|
|
967
|
+
if (!g[A(s.chain)])
|
|
968
|
+
throw new Error("Unsupported source chain");
|
|
969
|
+
const D = g[A(r.chain)];
|
|
970
|
+
if (!D || !D.requestPrefixes.includes(n))
|
|
971
|
+
throw new Error("Unsupported destination chain");
|
|
972
|
+
const { recipient: p } = a;
|
|
973
|
+
let F = !0;
|
|
974
|
+
if (p && r.chain === "Solana") {
|
|
975
|
+
const ht = B.parseAddress("Solana", o), gt = await r.getTokenAccount(p.address, ht), Te = await r.getRpc();
|
|
976
|
+
F = await Te.getAccountInfo(new ne(gt.address).unwrap()) !== null, !F && !$ && ($ = BigInt(await Te.getMinimumBalanceForRentExemption(165)));
|
|
977
|
+
}
|
|
978
|
+
let H = 0n;
|
|
979
|
+
r.chain === "Solana" && (H += nn, !F && $ && (H += $));
|
|
980
|
+
const J = [];
|
|
981
|
+
J.push({
|
|
982
|
+
request: {
|
|
983
|
+
type: "GasInstruction",
|
|
984
|
+
gasLimit: h,
|
|
985
|
+
msgValue: H
|
|
986
|
+
}
|
|
987
|
+
});
|
|
988
|
+
const De = BigInt(D.gasDropOffLimit), Y = t.options.nativeGas && De > 0n ? BigInt(Math.round(t.options.nativeGas * 100)) * De / 100n : 0n;
|
|
989
|
+
(Y > 0n || !F) && J.push({
|
|
990
|
+
request: {
|
|
991
|
+
type: "GasDropOffInstruction",
|
|
992
|
+
dropOff: Y,
|
|
993
|
+
// If the recipient is undefined (e.g. the user hasn’t connected their wallet yet),
|
|
994
|
+
// we temporarily use a dummy address to fetch a quote.
|
|
995
|
+
// The recipient address is validated later in the `initiate` method, which will throw if it's still missing.
|
|
996
|
+
recipient: p ? p.address.toUniversalAddress() : new Vt(new Uint8Array(32))
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
const Fe = Qe(dt, {
|
|
1000
|
+
requests: J
|
|
1001
|
+
}), ee = await vn(s.network, s.chain, r.chain, k.encode(Fe, !0));
|
|
1002
|
+
if (!ee.estimatedCost)
|
|
1003
|
+
throw new Error("No estimated cost");
|
|
1004
|
+
const ve = k.decode(ee.signedQuote), mt = q(ut, ve), lt = BigInt(ee.estimatedCost);
|
|
1005
|
+
return {
|
|
1006
|
+
signedQuote: ve,
|
|
1007
|
+
relayInstructions: Fe,
|
|
1008
|
+
estimatedCost: lt,
|
|
1009
|
+
referrer: u,
|
|
1010
|
+
referrerFee: f,
|
|
1011
|
+
remainingAmount: m,
|
|
1012
|
+
referrerFeeDbps: l,
|
|
1013
|
+
expiryTime: mt.quote.expiryTime,
|
|
1014
|
+
gasDropOff: Y
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
async function ft(a, t, e, n) {
|
|
1018
|
+
q(dt, n.details.relayInstructions).requests.forEach(({ request: m }) => {
|
|
1019
|
+
if (m.type === "GasDropOffInstruction" && !m.recipient.equals(e.address.toUniversalAddress()))
|
|
1020
|
+
throw new Error("Gas drop-off recipient does not match");
|
|
1021
|
+
});
|
|
1022
|
+
const r = B.parseAddress(t.chain(), t.address()), i = await kn(e, a);
|
|
1023
|
+
let o;
|
|
1024
|
+
n.protocol === "CCTPExecutor" ? o = await (await a.fromChain.getProtocol(n.protocol)).transfer(r, i, n.details) : o = await (await a.fromChain.getProtocol(n.protocol)).transfer(r, i, n.details);
|
|
1025
|
+
const d = await Je(a.fromChain, o, t);
|
|
1026
|
+
let u = 0;
|
|
1027
|
+
return (async () => {
|
|
1028
|
+
for (; u < 20; ) {
|
|
1029
|
+
try {
|
|
1030
|
+
const [m] = await Ee(a.fromChain.network, d.at(-1).txid, a.fromChain.chain);
|
|
1031
|
+
if (m)
|
|
1032
|
+
break;
|
|
1033
|
+
} catch {
|
|
1034
|
+
}
|
|
1035
|
+
u++, await Tn(2e3);
|
|
1036
|
+
}
|
|
1037
|
+
})(), {
|
|
1038
|
+
from: a.fromChain.chain,
|
|
1039
|
+
to: a.toChain.chain,
|
|
1040
|
+
state: b.SourceInitiated,
|
|
1041
|
+
originTxs: d
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
async function kn(a, t) {
|
|
1045
|
+
if (a.chain !== "Solana")
|
|
1046
|
+
return a;
|
|
1047
|
+
const e = E.get(t.toChain.network, t.toChain.chain);
|
|
1048
|
+
if (!e)
|
|
1049
|
+
throw new Error("No USDC contract found for Solana");
|
|
1050
|
+
const n = B.parseAddress("Solana", e);
|
|
1051
|
+
return t.toChain.getTokenAccount(a.address, n);
|
|
1052
|
+
}
|
|
1053
|
+
function ta(a = { referrerFeeDbps: 0n }) {
|
|
1054
|
+
if (a.referrerFeeDbps < 0 || a.referrerFeeDbps > 65535n)
|
|
618
1055
|
throw new Error("Referrer fee must be between 0 and 65535");
|
|
619
|
-
class
|
|
1056
|
+
class t extends _ {
|
|
620
1057
|
}
|
|
621
|
-
return c(
|
|
1058
|
+
return c(t, "config", a), t;
|
|
622
1059
|
}
|
|
623
|
-
class
|
|
1060
|
+
class _ extends Ye {
|
|
624
1061
|
constructor() {
|
|
625
1062
|
super(...arguments);
|
|
626
1063
|
// @ts-ignore
|
|
@@ -631,212 +1068,418 @@ class F extends Qe {
|
|
|
631
1068
|
static supportedNetworks() {
|
|
632
1069
|
return ["Mainnet", "Testnet"];
|
|
633
1070
|
}
|
|
634
|
-
static supportedChains(
|
|
635
|
-
return
|
|
1071
|
+
static supportedChains(e) {
|
|
1072
|
+
return [...Object.keys(st[e] ?? {})];
|
|
636
1073
|
}
|
|
637
|
-
static async supportedDestinationTokens(
|
|
638
|
-
|
|
639
|
-
if (!(a && qe(t, S.tokenId(r.chain, a))))
|
|
640
|
-
return [];
|
|
641
|
-
const { network: i, chain: o } = s;
|
|
642
|
-
return w.has(i, o) ? [
|
|
643
|
-
S.chainAddress(o, w.get(i, o))
|
|
644
|
-
] : [];
|
|
1074
|
+
static async supportedDestinationTokens(e, n, s) {
|
|
1075
|
+
return !z(n.network, n.chain) || !z(s.network, s.chain) ? [] : Ae(e, n, s);
|
|
645
1076
|
}
|
|
646
1077
|
getDefaultOptions() {
|
|
647
1078
|
return {
|
|
648
1079
|
nativeGas: 0
|
|
649
1080
|
};
|
|
650
1081
|
}
|
|
651
|
-
async validate(
|
|
652
|
-
var
|
|
653
|
-
|
|
1082
|
+
async validate(e, n) {
|
|
1083
|
+
var o;
|
|
1084
|
+
const { fromChain: s, toChain: r } = e;
|
|
1085
|
+
return !z(s.network, s.chain) || !z(r.network, r.chain) ? {
|
|
1086
|
+
valid: !1,
|
|
1087
|
+
error: new Error("Unsupported source or destination chain"),
|
|
1088
|
+
params: n
|
|
1089
|
+
} : (o = n.options) != null && o.nativeGas && (n.options.nativeGas < 0 || n.options.nativeGas > 1) ? {
|
|
654
1090
|
valid: !1,
|
|
655
1091
|
error: new Error("Invalid native gas percentage"),
|
|
656
|
-
params:
|
|
1092
|
+
params: n
|
|
657
1093
|
} : { valid: !0, params: {
|
|
658
1094
|
normalizedParams: {
|
|
659
|
-
amount:
|
|
1095
|
+
amount: e.parseAmount(n.amount)
|
|
660
1096
|
},
|
|
661
|
-
options:
|
|
662
|
-
...
|
|
1097
|
+
options: n.options ?? this.getDefaultOptions(),
|
|
1098
|
+
...n
|
|
663
1099
|
} };
|
|
664
1100
|
}
|
|
665
|
-
async quote(
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
throw new Error("Invalid transfer, no USDC contract on destination");
|
|
673
|
-
const d = (Z = yt[s.network]) == null ? void 0 : Z[s.chain];
|
|
674
|
-
if (!d)
|
|
675
|
-
return {
|
|
676
|
-
success: !1,
|
|
677
|
-
error: new Error("No referrer address found")
|
|
678
|
-
};
|
|
679
|
-
const u = S.chainAddress(s.chain, d), m = this.staticConfig.referrerFeeDbps, { referrerFee: l, remainingAmount: f } = vt(We(r.normalizedParams.amount), this.staticConfig.referrerFeeDbps);
|
|
680
|
-
if (f <= 0n)
|
|
681
|
-
return {
|
|
682
|
-
success: !1,
|
|
683
|
-
error: new Error("Amount after fee <= 0")
|
|
684
|
-
};
|
|
685
|
-
const g = (Y = At[s.network]) == null ? void 0 : Y[a.chain];
|
|
686
|
-
if (!g)
|
|
687
|
-
return {
|
|
688
|
-
success: !1,
|
|
689
|
-
error: new Error("Gas limit not found")
|
|
690
|
-
};
|
|
691
|
-
const h = await xt(s.network);
|
|
692
|
-
if (!h[C(s.chain)])
|
|
1101
|
+
async quote(e, n) {
|
|
1102
|
+
const { fromChain: s, toChain: r } = e;
|
|
1103
|
+
try {
|
|
1104
|
+
const i = await ye(e, n, this.staticConfig, "ERC1"), { remainingAmount: o, estimatedCost: d, gasDropOff: u, expiryTime: f } = i, m = s.chain === "Polygon" ? 2e3 * 200 : et(s.chain) + 1e3, [l, h] = await Promise.all([
|
|
1105
|
+
s.getDecimals("native"),
|
|
1106
|
+
r.getDecimals("native")
|
|
1107
|
+
]);
|
|
693
1108
|
return {
|
|
694
|
-
success: !
|
|
695
|
-
|
|
1109
|
+
success: !0,
|
|
1110
|
+
params: n,
|
|
1111
|
+
sourceToken: {
|
|
1112
|
+
token: e.source.id,
|
|
1113
|
+
amount: n.normalizedParams.amount
|
|
1114
|
+
},
|
|
1115
|
+
destinationToken: {
|
|
1116
|
+
token: e.destination.id,
|
|
1117
|
+
amount: x(o, e.destination.decimals)
|
|
1118
|
+
},
|
|
1119
|
+
relayFee: {
|
|
1120
|
+
token: fe(s.chain),
|
|
1121
|
+
amount: x(d, l)
|
|
1122
|
+
},
|
|
1123
|
+
destinationNativeGas: x(u, h),
|
|
1124
|
+
eta: m,
|
|
1125
|
+
expires: f,
|
|
1126
|
+
details: i
|
|
696
1127
|
};
|
|
697
|
-
|
|
698
|
-
if (!x || !x.requestPrefixes.includes("ERC1"))
|
|
1128
|
+
} catch (i) {
|
|
699
1129
|
return {
|
|
700
1130
|
success: !1,
|
|
701
|
-
error: new Error(
|
|
1131
|
+
error: new Error(i instanceof Error ? i.message : `${i}`)
|
|
702
1132
|
};
|
|
703
|
-
const { recipient: b } = t;
|
|
704
|
-
let E = !0;
|
|
705
|
-
if (b && a.chain === "Solana") {
|
|
706
|
-
const Pe = S.parseAddress("Solana", o), Me = await a.getTokenAccount(b.address, Pe), ee = await a.getRpc();
|
|
707
|
-
E = await ee.getAccountInfo(new N(Me.address).unwrap()) !== null, !E && !v && (v = BigInt(await ee.getMinimumBalanceForRentExemption(165)));
|
|
708
1133
|
}
|
|
709
|
-
let B = 0n;
|
|
710
|
-
a.chain === "Solana" && (B += Ct, !E && v && (B += v));
|
|
711
|
-
const T = [];
|
|
712
|
-
T.push({
|
|
713
|
-
request: {
|
|
714
|
-
type: "GasInstruction",
|
|
715
|
-
gasLimit: g,
|
|
716
|
-
msgValue: B
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
const K = BigInt(x.gasDropOffLimit), z = r.options.nativeGas && K > 0n ? BigInt(Math.round(r.options.nativeGas * 100)) * K / 100n : 0n;
|
|
720
|
-
(z > 0n || !E) && T.push({
|
|
721
|
-
request: {
|
|
722
|
-
type: "GasDropOffInstruction",
|
|
723
|
-
dropOff: z,
|
|
724
|
-
// If the recipient is undefined (e.g. the user hasn’t connected their wallet yet),
|
|
725
|
-
// we temporarily use a dummy address to fetch a quote.
|
|
726
|
-
// The recipient address is validated later in the `initiate` method, which will throw if it's still missing.
|
|
727
|
-
recipient: b ? b.address.toUniversalAddress() : new Ve(new Uint8Array(32))
|
|
728
|
-
}
|
|
729
|
-
});
|
|
730
|
-
const X = je(le, {
|
|
731
|
-
requests: T
|
|
732
|
-
}), U = await Et(s.network, s.chain, a.chain, ne.encode(X, !0));
|
|
733
|
-
if (!U.estimatedCost)
|
|
734
|
-
return {
|
|
735
|
-
success: !1,
|
|
736
|
-
error: new Error("No estimated cost")
|
|
737
|
-
};
|
|
738
|
-
const J = ne.decode(U.signedQuote), Ee = $(xe, J), Se = s.chain === "Polygon" ? 2e3 * 200 : Ke(s.chain) + 1e3, H = BigInt(U.estimatedCost), ve = {
|
|
739
|
-
signedQuote: J,
|
|
740
|
-
relayInstructions: X,
|
|
741
|
-
estimatedCost: H,
|
|
742
|
-
referrer: u,
|
|
743
|
-
referrerFee: l,
|
|
744
|
-
remainingAmount: f,
|
|
745
|
-
referrerFeeDbps: m
|
|
746
|
-
}, [Fe, De] = await Promise.all([
|
|
747
|
-
s.getDecimals("native"),
|
|
748
|
-
a.getDecimals("native")
|
|
749
|
-
]);
|
|
750
|
-
return {
|
|
751
|
-
success: !0,
|
|
752
|
-
params: r,
|
|
753
|
-
sourceToken: {
|
|
754
|
-
token: t.source.id,
|
|
755
|
-
amount: r.normalizedParams.amount
|
|
756
|
-
},
|
|
757
|
-
destinationToken: {
|
|
758
|
-
token: t.destination.id,
|
|
759
|
-
amount: R(f, t.destination.decimals)
|
|
760
|
-
},
|
|
761
|
-
relayFee: {
|
|
762
|
-
token: Xe(s.chain),
|
|
763
|
-
amount: R(H, Fe)
|
|
764
|
-
},
|
|
765
|
-
destinationNativeGas: R(z, De),
|
|
766
|
-
eta: Se,
|
|
767
|
-
expires: Ee.quote.expiryTime,
|
|
768
|
-
details: ve
|
|
769
|
-
};
|
|
770
1134
|
}
|
|
771
|
-
async initiate(
|
|
1135
|
+
async initiate(e, n, s, r) {
|
|
772
1136
|
if (!s.details)
|
|
773
1137
|
throw new Error("Missing quote details");
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
1138
|
+
return await ft(e, n, r, {
|
|
1139
|
+
protocol: "CCTPExecutor",
|
|
1140
|
+
details: s.details
|
|
777
1141
|
});
|
|
778
|
-
const o = await t.fromChain.getProtocol("CCTPExecutor"), d = S.parseAddress(r.chain(), r.address());
|
|
779
|
-
let u = a;
|
|
780
|
-
if (a.chain === "Solana") {
|
|
781
|
-
const h = S.parseAddress("Solana", w.get(t.toChain.network, t.toChain.chain));
|
|
782
|
-
u = await t.toChain.getTokenAccount(a.address, h);
|
|
783
|
-
}
|
|
784
|
-
const m = await o.transfer(d, u, s.details), l = await Je(t.fromChain, m, r);
|
|
785
|
-
let f = 0;
|
|
786
|
-
return (async () => {
|
|
787
|
-
for (; f < 20; ) {
|
|
788
|
-
try {
|
|
789
|
-
const [h] = await he(this.wh.network, l.at(-1).txid, t.fromChain.chain);
|
|
790
|
-
if (h)
|
|
791
|
-
break;
|
|
792
|
-
} catch {
|
|
793
|
-
}
|
|
794
|
-
f++, await Ft(2e3);
|
|
795
|
-
}
|
|
796
|
-
})(), {
|
|
797
|
-
from: t.fromChain.chain,
|
|
798
|
-
to: t.toChain.chain,
|
|
799
|
-
state: _.SourceInitiated,
|
|
800
|
-
originTxs: l
|
|
801
|
-
};
|
|
802
1142
|
}
|
|
803
|
-
async *track(
|
|
804
|
-
if (
|
|
805
|
-
return
|
|
806
|
-
let s =
|
|
1143
|
+
async *track(e, n) {
|
|
1144
|
+
if (L(e) || I(e))
|
|
1145
|
+
return e;
|
|
1146
|
+
let s = n || 60 * 60 * 1e3;
|
|
807
1147
|
for (; s > 0; ) {
|
|
808
|
-
const
|
|
809
|
-
if (
|
|
1148
|
+
const r = Date.now();
|
|
1149
|
+
if (ae(e) || se(e) || R(e))
|
|
810
1150
|
try {
|
|
811
|
-
const [i] = await
|
|
1151
|
+
const [i] = await Ee(this.wh.network, e.originTxs.at(-1).txid, e.from);
|
|
812
1152
|
if (!i)
|
|
813
1153
|
throw new Error("No transaction status found");
|
|
814
1154
|
const o = i == null ? void 0 : i.status;
|
|
815
|
-
if ((o ===
|
|
816
|
-
o ===
|
|
817
|
-
o ===
|
|
818
|
-
o ===
|
|
819
|
-
...
|
|
820
|
-
state:
|
|
821
|
-
error: new
|
|
822
|
-
}), o ===
|
|
823
|
-
...
|
|
824
|
-
state:
|
|
1155
|
+
if ((o === w.Failed || // this could happen if simulation fails
|
|
1156
|
+
o === w.Underpaid || // only happens if you don't pay at least the costEstimate
|
|
1157
|
+
o === w.Unsupported || // capabilities check didn't pass
|
|
1158
|
+
o === w.Aborted) && (e = {
|
|
1159
|
+
...e,
|
|
1160
|
+
state: b.Failed,
|
|
1161
|
+
error: new nt(`Relay failed with status: ${o}`)
|
|
1162
|
+
}), o === w.Submitted && (e = {
|
|
1163
|
+
...e,
|
|
1164
|
+
state: b.DestinationFinalized,
|
|
825
1165
|
attestation: { id: i.id, attestation: {} }
|
|
826
|
-
}), yield
|
|
827
|
-
return
|
|
1166
|
+
}), yield e, L(e) || I(e))
|
|
1167
|
+
return e;
|
|
828
1168
|
} catch (i) {
|
|
829
1169
|
console.error(`Error fetching transaction status: ${i.message || i}`);
|
|
830
1170
|
}
|
|
831
|
-
await new Promise((i) => setTimeout(i, 3e3)), s -= Date.now() -
|
|
1171
|
+
await new Promise((i) => setTimeout(i, 3e3)), s -= Date.now() - r;
|
|
832
1172
|
}
|
|
833
|
-
return
|
|
1173
|
+
return e;
|
|
834
1174
|
}
|
|
835
1175
|
}
|
|
836
|
-
c(
|
|
1176
|
+
c(_, "NATIVE_GAS_DROPOFF_SUPPORTED", !0), c(_, "config", { referrerFeeDbps: 0n }), c(_, "meta", {
|
|
837
1177
|
name: "CCTPExecutorRoute",
|
|
838
1178
|
provider: "Circle"
|
|
839
1179
|
});
|
|
1180
|
+
class xe extends Ye {
|
|
1181
|
+
static supportedNetworks() {
|
|
1182
|
+
return ["Mainnet", "Testnet"];
|
|
1183
|
+
}
|
|
1184
|
+
static supportedChains(t) {
|
|
1185
|
+
return Object.keys(K[t] ?? {});
|
|
1186
|
+
}
|
|
1187
|
+
getDefaultOptions() {
|
|
1188
|
+
return {
|
|
1189
|
+
nativeGas: 0
|
|
1190
|
+
};
|
|
1191
|
+
}
|
|
1192
|
+
async initiate(t, e, n, s) {
|
|
1193
|
+
if (!n.details)
|
|
1194
|
+
throw new Error("Missing quote details");
|
|
1195
|
+
return await ft(t, e, s, {
|
|
1196
|
+
protocol: "CCTPv2Executor",
|
|
1197
|
+
details: n.details
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
async *track(t, e) {
|
|
1201
|
+
if (L(t))
|
|
1202
|
+
return t;
|
|
1203
|
+
let n = e || 60 * 60 * 1e3;
|
|
1204
|
+
for (; n > 0; ) {
|
|
1205
|
+
const s = Date.now();
|
|
1206
|
+
if (ae(t) || se(t) || R(t) || I(t))
|
|
1207
|
+
try {
|
|
1208
|
+
const r = t.originTxs.at(-1).txid;
|
|
1209
|
+
if (ae(t) || se(t)) {
|
|
1210
|
+
const i = await oe({ chain: t.from, txid: r }, this.wh.network);
|
|
1211
|
+
i && (t = {
|
|
1212
|
+
...t,
|
|
1213
|
+
state: b.Attested,
|
|
1214
|
+
attestation: {
|
|
1215
|
+
id: r,
|
|
1216
|
+
attestation: i
|
|
1217
|
+
}
|
|
1218
|
+
}), yield t;
|
|
1219
|
+
}
|
|
1220
|
+
if (R(t)) {
|
|
1221
|
+
const [i] = await Ee(this.wh.network, r, t.from);
|
|
1222
|
+
if (!i)
|
|
1223
|
+
throw new Error("No transaction status found");
|
|
1224
|
+
const o = i == null ? void 0 : i.status;
|
|
1225
|
+
o === w.Submitted ? t = {
|
|
1226
|
+
...t,
|
|
1227
|
+
state: b.DestinationFinalized
|
|
1228
|
+
} : (o === w.Failed || // this could happen if simulation fails
|
|
1229
|
+
o === w.Underpaid || // only happens if you don't pay at least the costEstimate
|
|
1230
|
+
o === w.Unsupported || // capabilities check didn't pass
|
|
1231
|
+
o === w.Aborted) && (t = {
|
|
1232
|
+
...t,
|
|
1233
|
+
state: b.Failed,
|
|
1234
|
+
error: new nt(`Relay failed with status: ${o}`)
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
if (I(t)) {
|
|
1238
|
+
if (!t.attestation)
|
|
1239
|
+
throw new Error("Receipt is missing attestation");
|
|
1240
|
+
const i = t.attestation;
|
|
1241
|
+
await (await this.wh.getChain(t.to).getProtocol("CCTPv2Executor")).isTransferCompleted(i.attestation.message) && (t = {
|
|
1242
|
+
...t,
|
|
1243
|
+
state: b.DestinationFinalized,
|
|
1244
|
+
attestation: i
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
if (yield t, L(t))
|
|
1248
|
+
return t;
|
|
1249
|
+
} catch (r) {
|
|
1250
|
+
console.error(`Error fetching transaction status: ${r.message || r}`);
|
|
1251
|
+
}
|
|
1252
|
+
await new Promise((r) => setTimeout(r, 3e3)), n -= Date.now() - s;
|
|
1253
|
+
}
|
|
1254
|
+
return t;
|
|
1255
|
+
}
|
|
1256
|
+
async complete(t, e) {
|
|
1257
|
+
if (!R(e) && !I(e))
|
|
1258
|
+
throw new Error("Transfer is not attested");
|
|
1259
|
+
if (!e.attestation)
|
|
1260
|
+
throw new Error("No attestation found");
|
|
1261
|
+
const n = this.wh.getChain(e.to), s = await n.getProtocol("CCTPv2Executor");
|
|
1262
|
+
let { attestation: r, message: i } = e.attestation.attestation;
|
|
1263
|
+
const { expirationBlock: o } = i.messageBody, d = await s.getCurrentBlock();
|
|
1264
|
+
if (o !== 0n && o < d) {
|
|
1265
|
+
const l = await Mn(n.network, e.attestation);
|
|
1266
|
+
if (!l)
|
|
1267
|
+
throw new Error("Failed to reattest message");
|
|
1268
|
+
r = l.attestation, i = l.message;
|
|
1269
|
+
}
|
|
1270
|
+
const u = B.parseAddress(t.chain(), t.address()), f = s.redeem(u, i, r), m = await Je(this.wh.getChain(e.to), f, t);
|
|
1271
|
+
return {
|
|
1272
|
+
...e,
|
|
1273
|
+
state: b.DestinationInitiated,
|
|
1274
|
+
attestation: e.attestation,
|
|
1275
|
+
destinationTxs: m
|
|
1276
|
+
};
|
|
1277
|
+
}
|
|
1278
|
+
async resume(t) {
|
|
1279
|
+
const e = await oe(t, this.wh.network);
|
|
1280
|
+
if (!e)
|
|
1281
|
+
throw new Error("No attestation found");
|
|
1282
|
+
const { message: n } = e, s = rt(this.wh.network, n.destinationDomain);
|
|
1283
|
+
return await (await this.wh.getChain(s).getProtocol("CCTPv2Executor")).isTransferCompleted(n) ? {
|
|
1284
|
+
from: t.chain,
|
|
1285
|
+
to: s,
|
|
1286
|
+
state: b.DestinationFinalized,
|
|
1287
|
+
originTxs: [t],
|
|
1288
|
+
attestation: { id: t.txid, attestation: e }
|
|
1289
|
+
} : {
|
|
1290
|
+
from: t.chain,
|
|
1291
|
+
to: s,
|
|
1292
|
+
state: b.Attested,
|
|
1293
|
+
originTxs: [t],
|
|
1294
|
+
attestation: { id: t.txid, attestation: e }
|
|
1295
|
+
};
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
c(xe, "NATIVE_GAS_DROPOFF_SUPPORTED", !0);
|
|
1299
|
+
function na(a = { referrerFeeDbps: 0n }) {
|
|
1300
|
+
if (a.referrerFeeDbps < 0 || a.referrerFeeDbps > 65535n)
|
|
1301
|
+
throw new Error("Referrer fee must be between 0 and 65535");
|
|
1302
|
+
class t extends ce {
|
|
1303
|
+
}
|
|
1304
|
+
return c(t, "config", a), t;
|
|
1305
|
+
}
|
|
1306
|
+
const M = class M extends xe {
|
|
1307
|
+
constructor() {
|
|
1308
|
+
super(...arguments);
|
|
1309
|
+
// @ts-ignore
|
|
1310
|
+
// Since we set the config on the static class, access it with this param
|
|
1311
|
+
// the CCTPv2FastExecutorRoute.config will always be empty
|
|
1312
|
+
c(this, "staticConfig", this.constructor.config);
|
|
1313
|
+
}
|
|
1314
|
+
static isPathSupported(e, n) {
|
|
1315
|
+
return on(e.network, e.chain) && re(n.network, n.chain);
|
|
1316
|
+
}
|
|
1317
|
+
static async supportedDestinationTokens(e, n, s) {
|
|
1318
|
+
return this.isPathSupported(n, s) ? Ae(e, n, s) : [];
|
|
1319
|
+
}
|
|
1320
|
+
async validate(e, n) {
|
|
1321
|
+
var r;
|
|
1322
|
+
return M.isPathSupported(e.fromChain, e.toChain) ? (r = n.options) != null && r.nativeGas && (n.options.nativeGas < 0 || n.options.nativeGas > 1) ? {
|
|
1323
|
+
valid: !1,
|
|
1324
|
+
error: new Error("Invalid native gas percentage"),
|
|
1325
|
+
params: n
|
|
1326
|
+
} : { valid: !0, params: {
|
|
1327
|
+
normalizedParams: {
|
|
1328
|
+
amount: e.parseAmount(n.amount)
|
|
1329
|
+
},
|
|
1330
|
+
options: n.options ?? this.getDefaultOptions(),
|
|
1331
|
+
...n
|
|
1332
|
+
} } : {
|
|
1333
|
+
valid: !1,
|
|
1334
|
+
error: new Error("Can only transfer from a Circle V2 fast chain to a Circle V2 chain"),
|
|
1335
|
+
params: n
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
async quote(e, n) {
|
|
1339
|
+
var i;
|
|
1340
|
+
const { fromChain: s, toChain: r } = e;
|
|
1341
|
+
try {
|
|
1342
|
+
const o = await ye(e, n, this.staticConfig, "ERC2"), { remainingAmount: d, estimatedCost: u, gasDropOff: f, expiryTime: m } = o;
|
|
1343
|
+
if (await Pn(s.network) <= d)
|
|
1344
|
+
return {
|
|
1345
|
+
success: !1,
|
|
1346
|
+
error: new Error("Insufficient allowance for fast transfer")
|
|
1347
|
+
};
|
|
1348
|
+
const h = await In(s.network, s.chain, r.chain), g = (d * h + 10000n - 1n) / 10000n, y = d - g;
|
|
1349
|
+
if (y <= 0n)
|
|
1350
|
+
return {
|
|
1351
|
+
success: !1,
|
|
1352
|
+
error: new Error("Amount after fast transfer fee <= 0")
|
|
1353
|
+
};
|
|
1354
|
+
const D = (i = it[s.network]) == null ? void 0 : i[s.chain], [p, F] = await Promise.all([
|
|
1355
|
+
s.getDecimals("native"),
|
|
1356
|
+
r.getDecimals("native")
|
|
1357
|
+
]);
|
|
1358
|
+
return {
|
|
1359
|
+
success: !0,
|
|
1360
|
+
params: n,
|
|
1361
|
+
sourceToken: {
|
|
1362
|
+
token: e.source.id,
|
|
1363
|
+
amount: n.normalizedParams.amount
|
|
1364
|
+
},
|
|
1365
|
+
destinationToken: {
|
|
1366
|
+
token: e.destination.id,
|
|
1367
|
+
amount: x(y, e.destination.decimals)
|
|
1368
|
+
},
|
|
1369
|
+
relayFee: {
|
|
1370
|
+
token: fe(s.chain),
|
|
1371
|
+
amount: x(u, p)
|
|
1372
|
+
},
|
|
1373
|
+
destinationNativeGas: x(f, F),
|
|
1374
|
+
eta: D,
|
|
1375
|
+
expires: m,
|
|
1376
|
+
details: {
|
|
1377
|
+
...o,
|
|
1378
|
+
minFinalityThreshold: j.CONFIRMED,
|
|
1379
|
+
fastTransferMaxFee: g
|
|
1380
|
+
}
|
|
1381
|
+
};
|
|
1382
|
+
} catch (o) {
|
|
1383
|
+
return {
|
|
1384
|
+
success: !1,
|
|
1385
|
+
error: new Error(o instanceof Error ? o.message : `${o}`)
|
|
1386
|
+
};
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
};
|
|
1390
|
+
c(M, "config", { referrerFeeDbps: 0n }), c(M, "meta", {
|
|
1391
|
+
name: "CCTPv2FastExecutorRoute",
|
|
1392
|
+
provider: "Circle"
|
|
1393
|
+
});
|
|
1394
|
+
let ce = M;
|
|
1395
|
+
function aa(a = { referrerFeeDbps: 0n }) {
|
|
1396
|
+
if (a.referrerFeeDbps < 0 || a.referrerFeeDbps > 65535n)
|
|
1397
|
+
throw new Error("Referrer fee must be between 0 and 65535");
|
|
1398
|
+
class t extends de {
|
|
1399
|
+
}
|
|
1400
|
+
return c(t, "config", a), t;
|
|
1401
|
+
}
|
|
1402
|
+
const P = class P extends xe {
|
|
1403
|
+
constructor() {
|
|
1404
|
+
super(...arguments);
|
|
1405
|
+
// @ts-ignore
|
|
1406
|
+
// Since we set the config on the static class, access it with this param
|
|
1407
|
+
// the CCTPv2StandardExecutorRoute.config will always be empty
|
|
1408
|
+
c(this, "staticConfig", this.constructor.config);
|
|
1409
|
+
}
|
|
1410
|
+
static isPathSupported(e, n) {
|
|
1411
|
+
return re(e.network, e.chain) && re(n.network, n.chain) && // We don't support slow transfers from Linea because the attestation time
|
|
1412
|
+
// can be anywhere between 6 and 32 hours! Fast transfer should be used instead.
|
|
1413
|
+
e.chain !== "Linea";
|
|
1414
|
+
}
|
|
1415
|
+
static async supportedDestinationTokens(e, n, s) {
|
|
1416
|
+
return this.isPathSupported(n, s) ? Ae(e, n, s) : [];
|
|
1417
|
+
}
|
|
1418
|
+
async validate(e, n) {
|
|
1419
|
+
var r;
|
|
1420
|
+
return P.isPathSupported(e.fromChain, e.toChain) ? (r = n.options) != null && r.nativeGas && (n.options.nativeGas < 0 || n.options.nativeGas > 1) ? {
|
|
1421
|
+
valid: !1,
|
|
1422
|
+
error: new Error("Invalid native gas percentage"),
|
|
1423
|
+
params: n
|
|
1424
|
+
} : { valid: !0, params: {
|
|
1425
|
+
normalizedParams: {
|
|
1426
|
+
amount: e.parseAmount(n.amount)
|
|
1427
|
+
},
|
|
1428
|
+
options: n.options ?? this.getDefaultOptions(),
|
|
1429
|
+
...n
|
|
1430
|
+
} } : {
|
|
1431
|
+
valid: !1,
|
|
1432
|
+
error: new Error("Can only transfer between Circle V2 chains"),
|
|
1433
|
+
params: n
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
async quote(e, n) {
|
|
1437
|
+
const { fromChain: s, toChain: r } = e;
|
|
1438
|
+
try {
|
|
1439
|
+
const i = await ye(e, n, this.staticConfig, "ERC2"), { remainingAmount: o, estimatedCost: d, gasDropOff: u, expiryTime: f } = i, m = s.chain === "Polygon" ? 2e3 * 200 : et(s.chain) + 1e3, [l, h] = await Promise.all([
|
|
1440
|
+
s.getDecimals("native"),
|
|
1441
|
+
r.getDecimals("native")
|
|
1442
|
+
]);
|
|
1443
|
+
return {
|
|
1444
|
+
success: !0,
|
|
1445
|
+
params: n,
|
|
1446
|
+
sourceToken: {
|
|
1447
|
+
token: e.source.id,
|
|
1448
|
+
amount: n.normalizedParams.amount
|
|
1449
|
+
},
|
|
1450
|
+
destinationToken: {
|
|
1451
|
+
token: e.destination.id,
|
|
1452
|
+
amount: x(o, e.destination.decimals)
|
|
1453
|
+
},
|
|
1454
|
+
relayFee: {
|
|
1455
|
+
token: fe(s.chain),
|
|
1456
|
+
amount: x(d, l)
|
|
1457
|
+
},
|
|
1458
|
+
destinationNativeGas: x(u, h),
|
|
1459
|
+
eta: m,
|
|
1460
|
+
expires: f,
|
|
1461
|
+
details: {
|
|
1462
|
+
...i,
|
|
1463
|
+
minFinalityThreshold: j.FINALIZED,
|
|
1464
|
+
fastTransferMaxFee: 0n
|
|
1465
|
+
// no fee for standard / slow transfer
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
1468
|
+
} catch (i) {
|
|
1469
|
+
return {
|
|
1470
|
+
success: !1,
|
|
1471
|
+
error: new Error(i instanceof Error ? i.message : `${i}`)
|
|
1472
|
+
};
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
};
|
|
1476
|
+
c(P, "config", { referrerFeeDbps: 0n }), c(P, "meta", {
|
|
1477
|
+
name: "CCTPv2StandardExecutorRoute",
|
|
1478
|
+
provider: "Circle"
|
|
1479
|
+
});
|
|
1480
|
+
let de = P;
|
|
840
1481
|
export {
|
|
841
|
-
|
|
1482
|
+
ta as cctpExecutorRoute,
|
|
1483
|
+
na as cctpV2FastExecutorRoute,
|
|
1484
|
+
aa as cctpV2StandardExecutorRoute
|
|
842
1485
|
};
|