@wormhole-foundation/wormhole-connect 3.0.2-beta.0-development → 3.0.2-beta.1-development
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/assets/{basic-ChNCp6rI.js → basic-PUjrTVXb.js} +1 -1
- package/dist/assets/{evm-DSirgd5b.js → evm-CO5UWnAY.js} +2 -2
- package/dist/assets/{index-L-lC4rqb.js → index-1lzfHdT2.js} +1 -1
- package/dist/assets/{index-CHfaLf5J.js → index-DBVZDYF7.js} +1 -1
- package/dist/assets/index-DKlPX3ZI.js +1 -0
- package/dist/assets/{index-BtCrMDAu.js → index-Ddk7n7Ti.js} +1 -1
- package/dist/assets/{index-HhyysXFu.js → index-DyUmO4PR.js} +1 -1
- package/dist/assets/{index-BiwA3Bbq.js → index-MMzKxP1N.js} +1 -1
- package/dist/assets/{secp256k1-Cd7rIav0.js → secp256k1-0LtSM2L1.js} +1 -1
- package/dist/assets/{secp256k1-BQBOR8e3.js → secp256k1-DwTU3j1N.js} +1 -1
- package/dist/assets/{solana-DcwLWeKT.js → solana-DlGdMBSL.js} +4 -4
- package/dist/assets/{w3m-modal-DdptuLHe.js → w3m-modal-DD9Jgepz.js} +1 -1
- package/dist/main.js +72 -70
- package/dist/src/AppRouter.d.ts.map +1 -1
- package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
- package/dist/src/config/testnet/tokens.d.ts.map +1 -1
- package/dist/src/config/tokens.d.ts +1 -1
- package/dist/src/config/tokens.d.ts.map +1 -1
- package/dist/src/exports/index.d.ts +2 -2
- package/dist/src/exports/index.d.ts.map +1 -1
- package/dist/src/hooks/useFetchQuotes.d.ts.map +1 -1
- package/dist/src/icons/Chains/PLUME.d.ts.map +1 -1
- package/dist/src/icons/PoweredBy.d.ts.map +1 -1
- package/dist/src/icons/Routing.d.ts +5 -0
- package/dist/src/icons/Routing.d.ts.map +1 -0
- package/dist/src/icons/Tokens/PLUME.d.ts.map +1 -1
- package/dist/src/store/transferInput.d.ts +1 -1
- package/dist/src/store/transferInput.d.ts.map +1 -1
- package/dist/src/utils/coingecko.d.ts.map +1 -1
- package/dist/src/utils/formatNumber.d.ts +23 -0
- package/dist/src/utils/formatNumber.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts +3 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/routes.d.ts +12 -0
- package/dist/src/utils/routes.d.ts.map +1 -0
- package/dist/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/dist/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/AmountInput/index.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/Eta.d.ts +6 -0
- package/dist/src/views/v3/Bridge/Routes/Eta.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/Routes/RouteBadge.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts +7 -6
- package/dist/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/RoutesLink.d.ts +7 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesLink.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesList.d.ts +2 -1
- package/dist/src/views/v3/Bridge/Routes/RoutesList.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/RoutesLoader.d.ts +4 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesLoader.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesModal.d.ts +6 -5
- package/dist/src/views/v3/Bridge/Routes/RoutesModal.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/SingleRoute.d.ts +1 -0
- package/dist/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/index.d.ts.map +1 -1
- package/dist/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/lib/account-Br8E7RB6.js +1 -0
- package/lib/{account-BTK2b2Fv.mjs → account-CVa_3S2g.mjs} +1 -1
- package/lib/{address-8wLqn60W.mjs → address-BApwdEpr.mjs} +96 -96
- package/lib/address-BwQqFkyh.js +1 -0
- package/lib/address-C2pxq9b2.js +1 -0
- package/lib/{address-n0gAFMrZ.mjs → address-f6joE_ig.mjs} +12 -12
- package/lib/aptos-CMRGggVs.js +2 -0
- package/lib/{aptos-CK-j196x.js → aptos-CTKQNmlP.js} +1 -1
- package/lib/{aptos-B-DJQlwt.mjs → aptos-CfFbx7uf.mjs} +9 -9
- package/lib/{aptos-Bwcz9wZX.mjs → aptos-fozuppXh.mjs} +3 -3
- package/lib/{basic-DHWVLmCq.mjs → basic-BA2aRJJn.mjs} +2 -2
- package/lib/{basic-B5ZFelC_.js → basic-DUWaF2I0.js} +1 -1
- package/lib/{basic-E2M-9h1u.js → basic-DeiUayOA.js} +1 -1
- package/lib/{basic-Pour9Ggp.mjs → basic-DoC8u7J8.mjs} +2 -2
- package/lib/{blake2b-C5HyObld.mjs → blake2b-BGxWUAjG.mjs} +23 -23
- package/lib/blake2b-Fj1aPKgL.js +1 -0
- package/lib/{browser-ponyfill-jK8MKVVg.mjs → browser-ponyfill-D5AN8ZPp.mjs} +1 -1
- package/lib/browser-ponyfill-Dn6gsMYK.js +2 -0
- package/lib/{chain-Bm6u6eUF.mjs → chain-DAw2I5H8.mjs} +1 -1
- package/lib/chain-DnPXlO8g.js +1 -0
- package/lib/chunk-KJH4KKG6-BjF7YUcU.js +470 -0
- package/lib/{chunk-KJH4KKG6-DJsu-Y-X.mjs → chunk-KJH4KKG6-DmVjhXO7.mjs} +144 -144
- package/lib/{constants-Cf2YMjNo.js → constants-BtNs_2F4.js} +1 -1
- package/lib/{constants-B7AbX6qr.mjs → constants-Dcc2nVaW.mjs} +3 -3
- package/lib/contract-BEHYQLvJ.js +1 -0
- package/lib/{contract-llnN6ki0.mjs → contract-BkMAZomO.mjs} +123 -123
- package/lib/{core-CF5c7Vev.mjs → core-BHV42Qa0.mjs} +25 -26
- package/lib/core-CV23yxnG.js +889 -0
- package/lib/create-CHcGblj6.js +1 -0
- package/lib/{create-Dm87_0zG.mjs → create-CKLtL7hr.mjs} +1 -1
- package/lib/{evm-BYIGg8e4.mjs → evm-Bf7qbM19.mjs} +42 -42
- package/lib/{evm-B2hUWkt7.js → evm-ClWkquRx.js} +2 -2
- package/lib/{evm-fvvpk-li.mjs → evm-DhMoy8cH.mjs} +6 -6
- package/lib/{evm-DFNbMHoa.js → evm-tXmzU9Xp.js} +2 -2
- package/lib/executor.js +1 -1
- package/lib/executor.mjs +145 -138
- package/lib/hosted.js +1 -1
- package/lib/hosted.mjs +1 -1
- package/lib/{index-Cwo5AKUC.mjs → index-1rCCpdwd.mjs} +5 -5
- package/lib/{index-DBCa3k0j.mjs → index-3HvzWPL7.mjs} +9 -9
- package/lib/{index-MOwE6ses.mjs → index-B7ztYPhr.mjs} +21 -22
- package/lib/index-BM-0SeYB.js +1 -0
- package/lib/{index-DiQ8Ytrt.mjs → index-BTnpftLz.mjs} +1 -1
- package/lib/{index-BiCMaXJS.js → index-BWQMi6Rj.js} +1 -1
- package/lib/index-BbgKw2pu.js +1 -0
- package/lib/index-BblcpkoK.js +1 -0
- package/lib/index-Bfblsmud.js +1 -0
- package/lib/{index-C_0yAOSX.mjs → index-BfkFXEnG.mjs} +25082 -24072
- package/lib/{index-fi1sh8vr.mjs → index-BijBPDRn.mjs} +2 -2
- package/lib/index-BoquY9R2.js +337 -0
- package/lib/index-C2NtsO9Q.js +1 -0
- package/lib/{index-CNuk-XLX.mjs → index-C4JmrizV.mjs} +4 -4
- package/lib/index-C8TtXpOf.js +1 -0
- package/lib/index-CB8kOyIP.js +1 -0
- package/lib/index-CInVjUCW.js +1 -0
- package/lib/{index-BF11RebI.mjs → index-CLTklDbp.mjs} +1 -1
- package/lib/index-CQvgeH_r.js +1 -0
- package/lib/{index-DzYjoSJp.mjs → index-CUnOYRFQ.mjs} +23 -24
- package/lib/{index-DGh9LzN1.mjs → index-CWe_BTdo.mjs} +31 -31
- package/lib/{index-2Bz1Np4K.mjs → index-CZ91lJ9M.mjs} +5 -5
- package/lib/{index-Dgy1FO7C.js → index-CgyVnj6U.js} +1 -1
- package/lib/{index-BzJcFdt_.mjs → index-Clr2JjoJ.mjs} +44 -44
- package/lib/index-CnnCCv6Q.js +1 -0
- package/lib/{index-CJnRWlFf.mjs → index-CwxGLNEk.mjs} +48 -49
- package/lib/index-D7BLfz05.js +1 -0
- package/lib/index-DM7C-wvQ.js +3 -0
- package/lib/{index-DhIh3xiW.mjs → index-DNy_sNGr.mjs} +8 -8
- package/lib/{index-BZaRg0yd.mjs → index-DVcaDWmz.mjs} +1 -1
- package/lib/{index-CsAigASU.mjs → index-DWOP9OBp.mjs} +17 -17
- package/lib/{index-CTLz8Fz0.mjs → index-Dda5qc2t.mjs} +13 -14
- package/lib/{index-CLBXF_zH.mjs → index-DeaiBvpG.mjs} +16 -16
- package/lib/index-HOuGP-7b.js +1 -0
- package/lib/{index-Dt2uNp-N.mjs → index-KZve3tYJ.mjs} +4 -4
- package/lib/{index-CJDBidKv.mjs → index-SIyXqCAN.mjs} +41 -41
- package/lib/index-WhVYPMUr.js +1 -0
- package/lib/index-hmjT4xa7.js +1 -0
- package/lib/index-ledagFNU.js +1 -0
- package/lib/index-pbRVlgcN.js +1 -0
- package/lib/{index-BpQXUhR4.mjs → index-qK7AyMAk.mjs} +23 -27
- package/lib/index-ttZu99PZ.js +1 -0
- package/lib/{index.es-BqRBGIq6.mjs → index.es-BXRQf6Oi.mjs} +25 -26
- package/lib/index.es-BjGaOok5.js +11 -0
- package/lib/index.es-D6S74vhi.js +27 -0
- package/lib/{index.es-DgCZuUzB.mjs → index.es-cOw8juwf.mjs} +741 -737
- package/lib/index.js +1 -1
- package/lib/index.mjs +17 -16
- package/lib/mayan.js +3 -3
- package/lib/mayan.mjs +918 -891
- package/lib/mint-CL36R6ED.js +1 -0
- package/lib/{mint-Dc-VsiAn.mjs → mint-DunEG1jV.mjs} +32 -33
- package/lib/ntt.js +1 -1
- package/lib/ntt.mjs +2332 -2373
- package/lib/platform-7vCWzCny.js +1 -0
- package/lib/platform-BKhoO9So.js +1 -0
- package/lib/{platform-B95L0Vxv.mjs → platform-BN6LFtXE.mjs} +16 -16
- package/lib/{platform-DnP_1wGA.mjs → platform-BYLu9SzP.mjs} +4 -4
- package/lib/platform-Bbe26nx7.js +1 -0
- package/lib/{platform-DiG7WY9Z.mjs → platform-DCgWqmh1.mjs} +4 -4
- package/lib/{provider-jsonrpc-CRABh2gN.mjs → provider-jsonrpc-Bmgnrmpy.mjs} +155 -155
- package/lib/provider-jsonrpc-CbtP2Ffg.js +1 -0
- package/lib/{secp256k1-zHHDNAlH.mjs → secp256k1-BDQEvyHq.mjs} +1 -1
- package/lib/{secp256k1-obBDPYM-.mjs → secp256k1-C77Oh9AA.mjs} +1 -1
- package/lib/{secp256k1-2hq3Jk4g.mjs → secp256k1-CCn2vlXj.mjs} +1 -1
- package/lib/{secp256k1-B94G4gyy.js → secp256k1-CHAR40au.js} +1 -1
- package/lib/{secp256k1-DCcAh19h.js → secp256k1-D-DmPYcJ.js} +1 -1
- package/lib/{secp256k1-CjndBUS7.js → secp256k1-DYWDlveU.js} +1 -1
- package/lib/{signer-N_ccpPOz.mjs → signer-BIcn81N5.mjs} +18 -18
- package/lib/signer-H7atraks.js +1 -0
- package/lib/{solana-_Ha4YgiP.mjs → solana-B0QSg7B3.mjs} +30 -30
- package/lib/solana-Cs5VyB20.js +900 -0
- package/lib/solana-uvHG8JV5.js +1 -0
- package/lib/solana-zyfOlbhb.mjs +18 -0
- package/lib/{solanaEmbed.esm-DK5RIquB.mjs → solanaEmbed.esm-BqdznDuW.mjs} +623 -622
- package/lib/solanaEmbed.esm-D8vtESE6.js +10 -0
- package/lib/src/AppRouter.d.ts.map +1 -1
- package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
- package/lib/src/config/testnet/tokens.d.ts.map +1 -1
- package/lib/src/config/tokens.d.ts +1 -1
- package/lib/src/config/tokens.d.ts.map +1 -1
- package/lib/src/exports/index.d.ts +2 -2
- package/lib/src/exports/index.d.ts.map +1 -1
- package/lib/src/hooks/useFetchQuotes.d.ts.map +1 -1
- package/lib/src/icons/Chains/PLUME.d.ts.map +1 -1
- package/lib/src/icons/PoweredBy.d.ts.map +1 -1
- package/lib/src/icons/Routing.d.ts +5 -0
- package/lib/src/icons/Routing.d.ts.map +1 -0
- package/lib/src/icons/Tokens/PLUME.d.ts.map +1 -1
- package/lib/src/store/transferInput.d.ts +1 -1
- package/lib/src/store/transferInput.d.ts.map +1 -1
- package/lib/src/utils/coingecko.d.ts.map +1 -1
- package/lib/src/utils/formatNumber.d.ts +23 -0
- package/lib/src/utils/formatNumber.d.ts.map +1 -0
- package/lib/src/utils/index.d.ts +3 -1
- package/lib/src/utils/index.d.ts.map +1 -1
- package/lib/src/utils/routes.d.ts +12 -0
- package/lib/src/utils/routes.d.ts.map +1 -0
- package/lib/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/lib/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/AmountInput/index.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/Eta.d.ts +6 -0
- package/lib/src/views/v3/Bridge/Routes/Eta.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/Routes/RouteBadge.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts +7 -6
- package/lib/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/RoutesLink.d.ts +7 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesLink.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesList.d.ts +2 -1
- package/lib/src/views/v3/Bridge/Routes/RoutesList.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/RoutesLoader.d.ts +4 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesLoader.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesModal.d.ts +6 -5
- package/lib/src/views/v3/Bridge/Routes/RoutesModal.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/SingleRoute.d.ts +1 -0
- package/lib/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/index.d.ts.map +1 -1
- package/lib/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/lib/{sui-CQcQ6w_P.mjs → sui-B38DyOqM.mjs} +44 -44
- package/lib/{sui-BplKFZQu.mjs → sui-BpfnZR4f.mjs} +3 -3
- package/lib/sui-CT9MWY38.js +1 -0
- package/lib/{sui-_hvmCvD8.js → sui-DXQAMRQJ.js} +1 -1
- package/lib/{tokens-DNv0ZNvU.js → tokens-CmINcwKk.js} +31 -31
- package/lib/{tokens-Dl4YwW18.mjs → tokens-YxAPPVy3.mjs} +1726 -1724
- package/lib/transfer-BQ72fByU.js +1 -0
- package/lib/transfer-bTW0j9yh.mjs +58 -0
- package/lib/units-Ckije3Qv.js +1 -0
- package/lib/{units-DPWUSE6J.mjs → units-CtyvuzxQ.mjs} +13 -13
- package/lib/unsignedTransaction-C6Qp42VS.js +1 -0
- package/lib/{unsignedTransaction-DwcUilyN.mjs → unsignedTransaction-CXB-QCUC.mjs} +18 -18
- package/lib/{w3m-modal-BJILsxDp.mjs → w3m-modal-B7LUHLWC.mjs} +2 -2
- package/lib/{w3m-modal-D4CpFxO2.mjs → w3m-modal-BOTzBqbc.mjs} +2 -2
- package/lib/{w3m-modal-CrfHWSrF.js → w3m-modal-BTb03-7B.js} +1 -1
- package/lib/{w3m-modal-CBG2MSPp.js → w3m-modal-xmdf4r6V.js} +1 -1
- package/lib/web3-COTIsLs8.js +22 -0
- package/lib/{address-B-XN4tFw.mjs → web3-DYVeiqSa.mjs} +6599 -6576
- package/package.json +32 -32
- package/dist/assets/index-BWPgrXHs.js +0 -1
- package/lib/account-cRt2xMoW.js +0 -1
- package/lib/address-BGujeWtN.js +0 -22
- package/lib/address-C7DIAk4M.js +0 -1
- package/lib/address-KNhRm6oe.js +0 -1
- package/lib/aptos-f5TqmvqV.js +0 -2
- package/lib/blake2b-B-MRXUPb.js +0 -1
- package/lib/browser-ponyfill-CE6vRkjp.js +0 -2
- package/lib/chain-Hsn22HAP.js +0 -1
- package/lib/chunk-KJH4KKG6-CoyI75Ig.js +0 -470
- package/lib/contract-D2fTrJgn.js +0 -1
- package/lib/core-v0G9f7LX.js +0 -889
- package/lib/create-DoZZ7ciL.js +0 -1
- package/lib/index-B8-KKWD-.js +0 -1
- package/lib/index-BHbvgOMD.js +0 -1
- package/lib/index-BHfUgvSV.js +0 -1
- package/lib/index-BTKC7Hou.js +0 -1
- package/lib/index-BWXglAWd.js +0 -1
- package/lib/index-Bpp8C4u8.js +0 -1
- package/lib/index-CF2fHBHJ.js +0 -3
- package/lib/index-CTPz98nv.js +0 -1
- package/lib/index-ClMoiji-.js +0 -1
- package/lib/index-ClsVcH6F.js +0 -1
- package/lib/index-CqOI6LVu.js +0 -1
- package/lib/index-DCz_4mcz.js +0 -1
- package/lib/index-DKksdvND.js +0 -335
- package/lib/index-DRv3ZpVL.js +0 -1
- package/lib/index-DYqo8IhM.js +0 -1
- package/lib/index-DZubce9o.js +0 -1
- package/lib/index-DprM_IpB.js +0 -1
- package/lib/index-DshEQYMA.js +0 -1
- package/lib/index-JrM783SN.js +0 -1
- package/lib/index.es-C6YhioMN.js +0 -27
- package/lib/index.es-D3Xxxr8I.js +0 -11
- package/lib/mint-DlXC3sGi.js +0 -1
- package/lib/platform-B1XoDKoN.js +0 -1
- package/lib/platform-COuZC5Zc.js +0 -1
- package/lib/platform-NG3efAb2.js +0 -1
- package/lib/provider-jsonrpc-pXNHQF7n.js +0 -1
- package/lib/signer-CCa6npZ3.js +0 -1
- package/lib/solana-BJ3aReZw.mjs +0 -18
- package/lib/solana-BwyVgP30.js +0 -1
- package/lib/solana-CanFuMgA.js +0 -900
- package/lib/solanaEmbed.esm-C--1F7Lx.js +0 -10
- package/lib/sui-Bs83Gy5Z.js +0 -1
- package/lib/units-BvcKDiAx.js +0 -1
- package/lib/unsignedTransaction-dN_5EJf5.js +0 -1
- package/lib/web3-Bu_6UejS.mjs +0 -67
- package/lib/web3-Doz_0RHD.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o="https://wormholescan.io/#/",
|
|
1
|
+
"use strict";const o="https://wormholescan.io/#/",a="3.0.2-beta.1-development",e="25f394a7a2bd7d490513149f8413b3664e96e5a9",n=["Ethereum","Solana","Arbitrum","Base","Sui","Bsc","Optimism","Unichain","Fantom","Polygon","Avalanche","Celo","Moonbeam","Klaytn","Scroll","Mantle","Berachain","Mezo","Fogo"];exports.CHAIN_ORDER=n;exports.CONNECT_GIT_HASH=e;exports.CONNECT_VERSION=a;exports.WORMSCAN=o;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a = "https://wormholescan.io/#/", o = "3.0.2-beta.1-development", e = "25f394a7a2bd7d490513149f8413b3664e96e5a9", n = [
|
|
2
2
|
"Ethereum",
|
|
3
3
|
"Solana",
|
|
4
4
|
"Arbitrum",
|
|
@@ -21,7 +21,7 @@ const o = "https://wormholescan.io/#/", a = "3.0.2-beta.0-development", e = "f60
|
|
|
21
21
|
];
|
|
22
22
|
export {
|
|
23
23
|
e as C,
|
|
24
|
-
|
|
25
|
-
a,
|
|
24
|
+
a as W,
|
|
25
|
+
o as a,
|
|
26
26
|
n as b
|
|
27
27
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var Cn=Object.defineProperty;var Be=s=>{throw TypeError(s)};var Fn=(s,t,e)=>t in s?Cn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var l=(s,t,e)=>Fn(s,typeof t!="symbol"?t+"":t,e),fe=(s,t,e)=>t.has(s)||Be("Cannot "+e);var d=(s,t,e)=>(fe(s,t,"read from private field"),e?e.call(s):t.get(s)),x=(s,t,e)=>t.has(s)?Be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),w=(s,t,e,n)=>(fe(s,t,"write to private field"),n?n.call(s,e):t.set(s,e),e),N=(s,t,e)=>(fe(s,t,"access private method"),e);var Se=(s,t,e,n)=>({set _(r){w(s,t,r,e)},get _(){return d(s,t,n)}});const o=require("./web3-COTIsLs8.js"),ae=BigInt(0),M=BigInt(1),Ot=9007199254740991;function tn(s,t){const e=oe(s,"value"),n=BigInt(Q(t,"width"));if(o.assert(e>>n===ae,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:s}),e>>n-M){const r=(M<<n)-M;return-((~e&r)+M)}return e}function en(s,t){let e=at(s,"value");const n=BigInt(Q(t,"width")),r=M<<n-M;if(e<ae){e=-e,o.assert(e<=r,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:s});const i=(M<<n)-M;return(~e&i)+M}else o.assert(e<r,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:s});return e}function Dt(s,t){const e=oe(s,"value"),n=BigInt(Q(t,"bits"));return e&(M<<n)-M}function at(s,t){switch(typeof s){case"bigint":return s;case"number":return o.assertArgument(Number.isInteger(s),"underflow",t||"value",s),o.assertArgument(s>=-Ot&&s<=Ot,"overflow",t||"value",s),BigInt(s);case"string":try{if(s==="")throw new Error("empty string");return s[0]==="-"&&s[1]!=="-"?-BigInt(s.substring(1)):BigInt(s)}catch(e){o.assertArgument(!1,`invalid BigNumberish string: ${e.message}`,t||"value",s)}}o.assertArgument(!1,"invalid BigNumberish value",t||"value",s)}function oe(s,t){const e=at(s,t);return o.assert(e>=ae,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:s}),e}const Ce="0123456789abcdef";function Pe(s){if(s instanceof Uint8Array){let t="0x0";for(const e of s)t+=Ce[e>>4],t+=Ce[e&15];return BigInt(t)}return at(s)}function Q(s,t){switch(typeof s){case"bigint":return o.assertArgument(s>=-Ot&&s<=Ot,"overflow",t||"value",s),Number(s);case"number":return o.assertArgument(Number.isInteger(s),"underflow",t||"value",s),o.assertArgument(s>=-Ot&&s<=Ot,"overflow",t||"value",s),s;case"string":try{if(s==="")throw new Error("empty string");return Q(BigInt(s),t)}catch(e){o.assertArgument(!1,`invalid numeric string: ${e.message}`,t||"value",s)}}o.assertArgument(!1,"invalid numeric value",t||"value",s)}function Ln(s){return Q(Pe(s))}function Ae(s,t){let n=oe(s,"value").toString(16);if(t==null)n.length%2&&(n="0"+n);else{const r=Q(t,"width");for(o.assert(r*2>=n.length,`value exceeds width (${r} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:s});n.length<r*2;)n="0"+n}return"0x"+n}function Ne(s){const t=oe(s,"value");if(t===ae)return new Uint8Array([]);let e=t.toString(16);e.length%2&&(e="0"+e);const n=new Uint8Array(e.length/2);for(let r=0;r<n.length;r++){const i=r*2;n[r]=parseInt(e.substring(i,i+2),16)}return n}function Dn(s){let t=o.hexlify(o.isBytesLike(s)?s:Ne(s)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return t===""&&(t="0"),"0x"+t}var kt;class nn{constructor(t,e,n){l(this,"filter");l(this,"emitter");x(this,kt);w(this,kt,e),o.defineProperties(this,{emitter:t,filter:n})}async removeListener(){d(this,kt)!=null&&await this.emitter.off(this.filter,d(this,kt))}}kt=new WeakMap;function $n(s,t,e,n,r){o.assertArgument(!1,`invalid codepoint at offset ${t}; ${s}`,"bytes",e)}function rn(s,t,e,n,r){if(s==="BAD_PREFIX"||s==="UNEXPECTED_CONTINUE"){let i=0;for(let a=t+1;a<e.length&&e[a]>>6===2;a++)i++;return i}return s==="OVERRUN"?e.length-t-1:0}function Gn(s,t,e,n,r){return s==="OVERLONG"?(o.assertArgument(typeof r=="number","invalid bad code point for replacement","badCodepoint",r),n.push(r),0):(n.push(65533),rn(s,t,e))}const _n=Object.freeze({error:$n,ignore:rn,replace:Gn});function Vn(s,t){t==null&&(t=_n.error);const e=o.getBytes(s,"bytes"),n=[];let r=0;for(;r<e.length;){const i=e[r++];if(!(i>>7)){n.push(i);continue}let a=null,c=null;if((i&224)===192)a=1,c=127;else if((i&240)===224)a=2,c=2047;else if((i&248)===240)a=3,c=65535;else{(i&192)===128?r+=t("UNEXPECTED_CONTINUE",r-1,e,n):r+=t("BAD_PREFIX",r-1,e,n);continue}if(r-1+a>=e.length){r+=t("OVERRUN",r-1,e,n);continue}let u=i&(1<<8-a-1)-1;for(let f=0;f<a;f++){let h=e[r];if((h&192)!=128){r+=t("MISSING_CONTINUE",r,e,n),u=null;break}u=u<<6|h&63,r++}if(u!==null){if(u>1114111){r+=t("OUT_OF_RANGE",r-1-a,e,n,u);continue}if(u>=55296&&u<=57343){r+=t("UTF16_SURROGATE",r-1-a,e,n,u);continue}if(u<=c){r+=t("OVERLONG",r-1-a,e,n,u);continue}n.push(u)}}return n}function ve(s,t){o.assertArgument(typeof s=="string","invalid string value","str",s),t!=null&&(o.assertNormalize(t),s=s.normalize(t));let e=[];for(let n=0;n<s.length;n++){const r=s.charCodeAt(n);if(r<128)e.push(r);else if(r<2048)e.push(r>>6|192),e.push(r&63|128);else if((r&64512)==55296){n++;const i=s.charCodeAt(n);o.assertArgument(n<s.length&&(i&64512)===56320,"invalid surrogate pair","str",s);const a=65536+((r&1023)<<10)+(i&1023);e.push(a>>18|240),e.push(a>>12&63|128),e.push(a>>6&63|128),e.push(a&63|128)}else e.push(r>>12|224),e.push(r>>6&63|128),e.push(r&63|128)}return new Uint8Array(e)}function Mn(s){return s.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function sn(s,t){return Mn(Vn(s,t))}const B=32,pe=new Uint8Array(B),Hn=["then"],Yt={},an=new WeakMap;function dt(s){return an.get(s)}function Fe(s,t){an.set(s,t)}function Lt(s,t){const e=new Error(`deferred error during ABI decoding triggered accessing ${s}`);throw e.error=t,e}function ge(s,t,e){return s.indexOf(null)>=0?t.map((n,r)=>n instanceof Ct?ge(dt(n),n,e):n):s.reduce((n,r,i)=>{let a=t.getValue(r);return r in n||(e&&a instanceof Ct&&(a=ge(dt(a),a,e)),n[r]=a),n},{})}var It;const Tt=class Tt extends Array{constructor(...e){const n=e[0];let r=e[1],i=(e[2]||[]).slice(),a=!0;n!==Yt&&(r=e,i=[],a=!1);super(r.length);x(this,It);r.forEach((f,h)=>{this[h]=f});const c=i.reduce((f,h)=>(typeof h=="string"&&f.set(h,(f.get(h)||0)+1),f),new Map);if(Fe(this,Object.freeze(r.map((f,h)=>{const p=i[h];return p!=null&&c.get(p)===1?p:null}))),w(this,It,[]),d(this,It)==null&&d(this,It),!a)return;Object.freeze(this);const u=new Proxy(this,{get:(f,h,p)=>{if(typeof h=="string"){if(h.match(/^[0-9]+$/)){const y=Q(h,"%index");if(y<0||y>=this.length)throw new RangeError("out of result range");const b=f[y];return b instanceof Error&&Lt(`index ${y}`,b),b}if(Hn.indexOf(h)>=0)return Reflect.get(f,h,p);const g=f[h];if(g instanceof Function)return function(...y){return g.apply(this===p?f:this,y)};if(!(h in f))return f.getValue.apply(this===p?f:this,[h])}return Reflect.get(f,h,p)}});return Fe(u,dt(this)),u}toArray(e){const n=[];return this.forEach((r,i)=>{r instanceof Error&&Lt(`index ${i}`,r),e&&r instanceof Tt&&(r=r.toArray(e)),n.push(r)}),n}toObject(e){const n=dt(this);return n.reduce((r,i,a)=>(o.assert(i!=null,`value at index ${a} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),ge(n,this,e)),{})}slice(e,n){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const r=dt(this),i=[],a=[];for(let c=e;c<n;c++)i.push(this[c]),a.push(r[c]);return new Tt(Yt,i,a)}filter(e,n){const r=dt(this),i=[],a=[];for(let c=0;c<this.length;c++){const u=this[c];u instanceof Error&&Lt(`index ${c}`,u),e.call(n,u,c,this)&&(i.push(u),a.push(r[c]))}return new Tt(Yt,i,a)}map(e,n){const r=[];for(let i=0;i<this.length;i++){const a=this[i];a instanceof Error&&Lt(`index ${i}`,a),r.push(e.call(n,a,i,this))}return r}getValue(e){const n=dt(this).indexOf(e);if(n===-1)return;const r=this[n];return r instanceof Error&&Lt(`property ${JSON.stringify(e)}`,r.error),r}static fromItems(e,n){return new Tt(Yt,e,n)}};It=new WeakMap;let Ct=Tt;function Le(s){let t=Ne(s);return o.assert(t.length<=B,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:B,offset:t.length}),t.length!==B&&(t=o.getBytesCopy(o.concat([pe.slice(t.length%B),t]))),t}class ot{constructor(t,e,n,r){l(this,"name");l(this,"type");l(this,"localName");l(this,"dynamic");o.defineProperties(this,{name:t,type:e,localName:n,dynamic:r},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,e){o.assertArgument(!1,t,this.localName,e)}}var et,mt,Ut,Qt;class me{constructor(){x(this,Ut);x(this,et);x(this,mt);w(this,et,[]),w(this,mt,0)}get data(){return o.concat(d(this,et))}get length(){return d(this,mt)}appendWriter(t){return N(this,Ut,Qt).call(this,o.getBytesCopy(t.data))}writeBytes(t){let e=o.getBytesCopy(t);const n=e.length%B;return n&&(e=o.getBytesCopy(o.concat([e,pe.slice(n)]))),N(this,Ut,Qt).call(this,e)}writeValue(t){return N(this,Ut,Qt).call(this,Le(t))}writeUpdatableValue(){const t=d(this,et).length;return d(this,et).push(pe),w(this,mt,d(this,mt)+B),e=>{d(this,et)[t]=Le(e)}}}et=new WeakMap,mt=new WeakMap,Ut=new WeakSet,Qt=function(t){return d(this,et).push(t),w(this,mt,d(this,mt)+t.length),t.length};var C,G,yt,wt,ct,Nt,we,on;const Ie=class Ie{constructor(t,e,n){x(this,Nt);l(this,"allowLoose");x(this,C);x(this,G);x(this,yt);x(this,wt);x(this,ct);o.defineProperties(this,{allowLoose:!!e}),w(this,C,o.getBytesCopy(t)),w(this,yt,0),w(this,wt,null),w(this,ct,n??1024),w(this,G,0)}get data(){return o.hexlify(d(this,C))}get dataLength(){return d(this,C).length}get consumed(){return d(this,G)}get bytes(){return new Uint8Array(d(this,C))}subReader(t){const e=new Ie(d(this,C).slice(d(this,G)+t),this.allowLoose,d(this,ct));return w(e,wt,this),e}readBytes(t,e){let n=N(this,Nt,on).call(this,0,t,!!e);return N(this,Nt,we).call(this,t),w(this,G,d(this,G)+n.length),n.slice(0,t)}readValue(){return Pe(this.readBytes(B))}readIndex(){return Ln(this.readBytes(B))}};C=new WeakMap,G=new WeakMap,yt=new WeakMap,wt=new WeakMap,ct=new WeakMap,Nt=new WeakSet,we=function(t){var e;if(d(this,wt))return N(e=d(this,wt),Nt,we).call(e,t);w(this,yt,d(this,yt)+t),o.assert(d(this,ct)<1||d(this,yt)<=d(this,ct)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${d(this,ct)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:o.getBytesCopy(d(this,C)),offset:d(this,G),length:t,info:{bytesRead:d(this,yt),dataLength:this.dataLength}})},on=function(t,e,n){let r=Math.ceil(e/B)*B;return d(this,G)+r>d(this,C).length&&(this.allowLoose&&n&&d(this,G)+e<=d(this,C).length?r=e:o.assert(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:o.getBytesCopy(d(this,C)),length:d(this,C).length,offset:d(this,G)+r})),d(this,C).slice(d(this,G),d(this,G)+r)};let ye=Ie;const q={};function m(s,t){let e=!1;return t<0&&(e=!0,t*=-1),new U(q,`${e?"":"u"}int${t}`,s,{signed:e,width:t})}function E(s,t){return new U(q,`bytes${t||""}`,s,{size:t})}const De=Symbol.for("_ethers_typed");var bt;const j=class j{constructor(t,e,n,r){l(this,"type");l(this,"value");x(this,bt);l(this,"_typedSymbol");r==null&&(r=null),o.assertPrivate(q,t,"Typed"),o.defineProperties(this,{_typedSymbol:De,type:e,value:n}),w(this,bt,r),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(t=>t.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return d(this,bt)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return d(this,bt)===!0?-1:d(this,bt)===!1?this.value.length:null}static from(t,e){return new j(q,t,e)}static uint8(t){return m(t,8)}static uint16(t){return m(t,16)}static uint24(t){return m(t,24)}static uint32(t){return m(t,32)}static uint40(t){return m(t,40)}static uint48(t){return m(t,48)}static uint56(t){return m(t,56)}static uint64(t){return m(t,64)}static uint72(t){return m(t,72)}static uint80(t){return m(t,80)}static uint88(t){return m(t,88)}static uint96(t){return m(t,96)}static uint104(t){return m(t,104)}static uint112(t){return m(t,112)}static uint120(t){return m(t,120)}static uint128(t){return m(t,128)}static uint136(t){return m(t,136)}static uint144(t){return m(t,144)}static uint152(t){return m(t,152)}static uint160(t){return m(t,160)}static uint168(t){return m(t,168)}static uint176(t){return m(t,176)}static uint184(t){return m(t,184)}static uint192(t){return m(t,192)}static uint200(t){return m(t,200)}static uint208(t){return m(t,208)}static uint216(t){return m(t,216)}static uint224(t){return m(t,224)}static uint232(t){return m(t,232)}static uint240(t){return m(t,240)}static uint248(t){return m(t,248)}static uint256(t){return m(t,256)}static uint(t){return m(t,256)}static int8(t){return m(t,-8)}static int16(t){return m(t,-16)}static int24(t){return m(t,-24)}static int32(t){return m(t,-32)}static int40(t){return m(t,-40)}static int48(t){return m(t,-48)}static int56(t){return m(t,-56)}static int64(t){return m(t,-64)}static int72(t){return m(t,-72)}static int80(t){return m(t,-80)}static int88(t){return m(t,-88)}static int96(t){return m(t,-96)}static int104(t){return m(t,-104)}static int112(t){return m(t,-112)}static int120(t){return m(t,-120)}static int128(t){return m(t,-128)}static int136(t){return m(t,-136)}static int144(t){return m(t,-144)}static int152(t){return m(t,-152)}static int160(t){return m(t,-160)}static int168(t){return m(t,-168)}static int176(t){return m(t,-176)}static int184(t){return m(t,-184)}static int192(t){return m(t,-192)}static int200(t){return m(t,-200)}static int208(t){return m(t,-208)}static int216(t){return m(t,-216)}static int224(t){return m(t,-224)}static int232(t){return m(t,-232)}static int240(t){return m(t,-240)}static int248(t){return m(t,-248)}static int256(t){return m(t,-256)}static int(t){return m(t,-256)}static bytes1(t){return E(t,1)}static bytes2(t){return E(t,2)}static bytes3(t){return E(t,3)}static bytes4(t){return E(t,4)}static bytes5(t){return E(t,5)}static bytes6(t){return E(t,6)}static bytes7(t){return E(t,7)}static bytes8(t){return E(t,8)}static bytes9(t){return E(t,9)}static bytes10(t){return E(t,10)}static bytes11(t){return E(t,11)}static bytes12(t){return E(t,12)}static bytes13(t){return E(t,13)}static bytes14(t){return E(t,14)}static bytes15(t){return E(t,15)}static bytes16(t){return E(t,16)}static bytes17(t){return E(t,17)}static bytes18(t){return E(t,18)}static bytes19(t){return E(t,19)}static bytes20(t){return E(t,20)}static bytes21(t){return E(t,21)}static bytes22(t){return E(t,22)}static bytes23(t){return E(t,23)}static bytes24(t){return E(t,24)}static bytes25(t){return E(t,25)}static bytes26(t){return E(t,26)}static bytes27(t){return E(t,27)}static bytes28(t){return E(t,28)}static bytes29(t){return E(t,29)}static bytes30(t){return E(t,30)}static bytes31(t){return E(t,31)}static bytes32(t){return E(t,32)}static address(t){return new j(q,"address",t)}static bool(t){return new j(q,"bool",!!t)}static bytes(t){return new j(q,"bytes",t)}static string(t){return new j(q,"string",t)}static array(t,e){throw new Error("not implemented yet")}static tuple(t,e){throw new Error("not implemented yet")}static overrides(t){return new j(q,"overrides",Object.assign({},t))}static isTyped(t){return t&&typeof t=="object"&&"_typedSymbol"in t&&t._typedSymbol===De}static dereference(t,e){if(j.isTyped(t)){if(t.type!==e)throw new Error(`invalid type: expecetd ${e}, got ${t.type}`);return t.value}return t}};bt=new WeakMap;let U=j;class zn extends ot{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){let n=U.dereference(e,"string");try{n=o.getAddress(n)}catch(r){return this._throwError(r.message,e)}return t.writeValue(n)}decode(t){return o.getAddress(Ae(t.readValue(),20))}}class Jn extends ot{constructor(e){super(e.name,e.type,"_",e.dynamic);l(this,"coder");this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,n){return this.coder.encode(e,n)}decode(e){return this.coder.decode(e)}}function cn(s,t,e){let n=[];if(Array.isArray(e))n=e;else if(e&&typeof e=="object"){let u={};n=t.map(f=>{const h=f.localName;return o.assert(h,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:f},value:e}),o.assert(!u[h],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:f},value:e}),u[h]=!0,e[h]})}else o.assertArgument(!1,"invalid tuple value","tuple",e);o.assertArgument(t.length===n.length,"types/value length mismatch","tuple",e);let r=new me,i=new me,a=[];t.forEach((u,f)=>{let h=n[f];if(u.dynamic){let p=i.length;u.encode(i,h);let g=r.writeUpdatableValue();a.push(y=>{g(y+p)})}else u.encode(r,h)}),a.forEach(u=>{u(r.length)});let c=s.appendWriter(r);return c+=s.appendWriter(i),c}function un(s,t){let e=[],n=[],r=s.subReader(0);return t.forEach(i=>{let a=null;if(i.dynamic){let c=s.readIndex(),u=r.subReader(c);try{a=i.decode(u)}catch(f){if(o.isError(f,"BUFFER_OVERRUN"))throw f;a=f,a.baseType=i.name,a.name=i.localName,a.type=i.type}}else try{a=i.decode(s)}catch(c){if(o.isError(c,"BUFFER_OVERRUN"))throw c;a=c,a.baseType=i.name,a.name=i.localName,a.type=i.type}if(a==null)throw new Error("investigate");e.push(a),n.push(i.localName||null)}),Ct.fromItems(e,n)}class Kn extends ot{constructor(e,n,r){const i=e.type+"["+(n>=0?n:"")+"]",a=n===-1||e.dynamic;super("array",i,r,a);l(this,"coder");l(this,"length");o.defineProperties(this,{coder:e,length:n})}defaultValue(){const e=this.coder.defaultValue(),n=[];for(let r=0;r<this.length;r++)n.push(e);return n}encode(e,n){const r=U.dereference(n,"array");Array.isArray(r)||this._throwError("expected array value",r);let i=this.length;i===-1&&(i=r.length,e.writeValue(r.length)),o.assertArgumentCount(r.length,i,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let c=0;c<r.length;c++)a.push(this.coder);return cn(e,a,r)}decode(e){let n=this.length;n===-1&&(n=e.readIndex(),o.assert(n*B<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:n*B,length:e.dataLength}));let r=[];for(let i=0;i<n;i++)r.push(new Jn(this.coder));return un(e,r)}}class Wn extends ot{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){const n=U.dereference(e,"bool");return t.writeValue(n?1:0)}decode(t){return!!t.readValue()}}class ln extends ot{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=o.getBytesCopy(e);let n=t.writeValue(e.length);return n+=t.writeBytes(e),n}decode(t){return t.readBytes(t.readIndex(),!0)}}class Yn extends ln{constructor(t){super("bytes",t)}decode(t){return o.hexlify(super.decode(t))}}class Xn extends ot{constructor(e,n){let r="bytes"+String(e);super(r,r,n,!1);l(this,"size");o.defineProperties(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,n){let r=o.getBytesCopy(U.dereference(n,this.type));return r.length!==this.size&&this._throwError("incorrect data length",n),e.writeBytes(r)}decode(e){return o.hexlify(e.readBytes(this.size))}}const Zn=new Uint8Array([]);class Qn extends ot{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return e!=null&&this._throwError("not null",e),t.writeBytes(Zn)}decode(t){return t.readBytes(0),null}}const qn=BigInt(0),jn=BigInt(1),tr=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class er extends ot{constructor(e,n,r){const i=(n?"int":"uint")+e*8;super(i,i,r,!1);l(this,"size");l(this,"signed");o.defineProperties(this,{size:e,signed:n},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,n){let r=at(U.dereference(n,this.type)),i=Dt(tr,B*8);if(this.signed){let a=Dt(i,this.size*8-1);(r>a||r<-(a+jn))&&this._throwError("value out-of-bounds",n),r=en(r,8*B)}else(r<qn||r>Dt(i,this.size*8))&&this._throwError("value out-of-bounds",n);return e.writeValue(r)}decode(e){let n=Dt(e.readValue(),this.size*8);return this.signed&&(n=tn(n,this.size*8)),n}}class nr extends ln{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,ve(U.dereference(e,"string")))}decode(t){return sn(super.decode(t))}}class Xt extends ot{constructor(e,n){let r=!1;const i=[];e.forEach(c=>{c.dynamic&&(r=!0),i.push(c.type)});const a="tuple("+i.join(",")+")";super("tuple",a,n,r);l(this,"coders");o.defineProperties(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(r=>{e.push(r.defaultValue())});const n=this.coders.reduce((r,i)=>{const a=i.localName;return a&&(r[a]||(r[a]=0),r[a]++),r},{});return this.coders.forEach((r,i)=>{let a=r.localName;!a||n[a]!==1||(a==="length"&&(a="_length"),e[a]==null&&(e[a]=e[i]))}),Object.freeze(e)}encode(e,n){const r=U.dereference(n,"tuple");return cn(e,this.coders,r)}decode(e){return un(e,this.coders)}}function Ft(s){return o.keccak256(ve(s))}function he(s,t){return{address:o.getAddress(s),storageKeys:t.map((e,n)=>(o.assertArgument(o.isHexString(e,32),"invalid slot",`storageKeys[${n}]`,e),e.toLowerCase()))}}function fn(s){if(Array.isArray(s))return s.map((e,n)=>Array.isArray(e)?(o.assertArgument(e.length===2,"invalid slot set",`value[${n}]`,e),he(e[0],e[1])):(o.assertArgument(e!=null&&typeof e=="object","invalid address-slot set","value",s),he(e.address,e.storageKeys)));o.assertArgument(s!=null&&typeof s=="object","invalid access list","value",s);const t=Object.keys(s).map(e=>{const n=s[e].reduce((r,i)=>(r[i]=!0,r),{});return he(e,Object.keys(n).sort())});return t.sort((e,n)=>e.address.localeCompare(n.address)),t}function S(s){const t=new Set;return s.forEach(e=>t.add(e)),Object.freeze(t)}const rr="external public payable override",sr=S(rr.split(" ")),hn="constant external internal payable private public pure view override",ir=S(hn.split(" ")),dn="constructor error event fallback function receive struct",pn=S(dn.split(" ")),gn="calldata memory storage payable indexed",ar=S(gn.split(" ")),or="tuple returns",cr=[dn,gn,or,hn].join(" "),ur=S(cr.split(" ")),lr={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},fr=new RegExp("^(\\s*)"),hr=new RegExp("^([0-9]+)"),dr=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),mn=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),yn=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var R,V,Ht,be;const se=class se{constructor(t){x(this,Ht);x(this,R);x(this,V);w(this,R,0),w(this,V,t.slice())}get offset(){return d(this,R)}get length(){return d(this,V).length-d(this,R)}clone(){return new se(d(this,V))}reset(){w(this,R,0)}popKeyword(t){const e=this.peek();if(e.type!=="KEYWORD"||!t.has(e.text))throw new Error(`expected keyword ${e.text}`);return this.pop().text}popType(t){if(this.peek().type!==t){const e=this.peek();throw new Error(`expected ${t}; got ${e.type} ${JSON.stringify(e.text)}`)}return this.pop().text}popParen(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const e=N(this,Ht,be).call(this,d(this,R)+1,t.match+1);return w(this,R,t.match+1),e}popParams(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const e=[];for(;d(this,R)<t.match-1;){const n=this.peek().linkNext;e.push(N(this,Ht,be).call(this,d(this,R)+1,n)),w(this,R,n)}return w(this,R,t.match+1),e}peek(){if(d(this,R)>=d(this,V).length)throw new Error("out-of-bounds");return d(this,V)[d(this,R)]}peekKeyword(t){const e=this.peekType("KEYWORD");return e!=null&&t.has(e)?e:null}peekType(t){if(this.length===0)return null;const e=this.peek();return e.type===t?e.text:null}pop(){const t=this.peek();return Se(this,R)._++,t}toString(){const t=[];for(let e=d(this,R);e<d(this,V).length;e++){const n=d(this,V)[e];t.push(`${n.type}:${n.text}`)}return`<TokenString ${t.join(" ")}>`}};R=new WeakMap,V=new WeakMap,Ht=new WeakSet,be=function(t=0,e=0){return new se(d(this,V).slice(t,e).map(n=>Object.freeze(Object.assign({},n,{match:n.match-t,linkBack:n.linkBack-t,linkNext:n.linkNext-t}))))};let H=se;function ft(s){const t=[],e=a=>{const c=i<s.length?JSON.stringify(s[i]):"$EOI";throw new Error(`invalid token ${c} at ${i}: ${a}`)};let n=[],r=[],i=0;for(;i<s.length;){let a=s.substring(i),c=a.match(fr);c&&(i+=c[1].length,a=s.substring(i));const u={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};t.push(u);let f=lr[a[0]]||"";if(f){if(u.type=f,u.text=a[0],i++,f==="OPEN_PAREN")n.push(t.length-1),r.push(t.length-1);else if(f=="CLOSE_PAREN")n.length===0&&e("no matching open bracket"),u.match=n.pop(),t[u.match].match=t.length-1,u.depth--,u.linkBack=r.pop(),t[u.linkBack].linkNext=t.length-1;else if(f==="COMMA")u.linkBack=r.pop(),t[u.linkBack].linkNext=t.length-1,r.push(t.length-1);else if(f==="OPEN_BRACKET")u.type="BRACKET";else if(f==="CLOSE_BRACKET"){let h=t.pop().text;if(t.length>0&&t[t.length-1].type==="NUMBER"){const p=t.pop().text;h=p+h,t[t.length-1].value=Q(p)}if(t.length===0||t[t.length-1].type!=="BRACKET")throw new Error("missing opening bracket");t[t.length-1].text+=h}continue}if(c=a.match(dr),c){if(u.text=c[1],i+=u.text.length,ur.has(u.text)){u.type="KEYWORD";continue}if(u.text.match(yn)){u.type="TYPE";continue}u.type="ID";continue}if(c=a.match(hr),c){u.text=c[1],u.type="NUMBER",i+=u.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${i}`)}return new H(t.map(a=>Object.freeze(a)))}function $e(s,t){let e=[];for(const n in t.keys())s.has(n)&&e.push(n);if(e.length>1)throw new Error(`conflicting types: ${e.join(", ")}`)}function ce(s,t){if(t.peekKeyword(pn)){const e=t.pop().text;if(e!==s)throw new Error(`expected ${s}, got ${e}`)}return t.popType("ID")}function it(s,t){const e=new Set;for(;;){const n=s.peekType("KEYWORD");if(n==null||t&&!t.has(n))break;if(s.pop(),e.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);e.add(n)}return Object.freeze(e)}function wn(s){let t=it(s,ir);return $e(t,S("constant payable nonpayable".split(" "))),$e(t,S("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function st(s,t){return s.popParams().map(e=>k.from(e,t))}function bn(s){if(s.peekType("AT")){if(s.pop(),s.peekType("NUMBER"))return at(s.pop().text);throw new Error("invalid gas")}return null}function xt(s){if(s.length)throw new Error(`unexpected tokens at offset ${s.offset}: ${s.toString()}`)}const pr=new RegExp(/^(.*)\[([0-9]*)\]$/);function Ge(s){const t=s.match(yn);if(o.assertArgument(t,"invalid type","type",s),s==="uint")return"uint256";if(s==="int")return"int256";if(t[2]){const e=parseInt(t[2]);o.assertArgument(e!==0&&e<=32,"invalid bytes length","type",s)}else if(t[3]){const e=parseInt(t[3]);o.assertArgument(e!==0&&e<=256&&e%8===0,"invalid numeric width","type",s)}return s}const v={},L=Symbol.for("_ethers_internal"),_e="_ParamTypeInternal",Ve="_ErrorInternal",Me="_EventInternal",He="_ConstructorInternal",ze="_FallbackInternal",Je="_FunctionInternal",Ke="_StructInternal";var Bt,qt;const _=class _{constructor(t,e,n,r,i,a,c,u){x(this,Bt);l(this,"name");l(this,"type");l(this,"baseType");l(this,"indexed");l(this,"components");l(this,"arrayLength");l(this,"arrayChildren");if(o.assertPrivate(t,v,"ParamType"),Object.defineProperty(this,L,{value:_e}),a&&(a=Object.freeze(a.slice())),r==="array"){if(c==null||u==null)throw new Error("")}else if(c!=null||u!=null)throw new Error("");if(r==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");o.defineProperties(this,{name:e,type:n,baseType:r,indexed:i,components:a,arrayLength:c,arrayChildren:u})}format(t){if(t==null&&(t="sighash"),t==="json"){const n=this.name||"";if(this.isArray()){const i=JSON.parse(this.arrayChildren.format("json"));return i.name=n,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}const r={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(r.indexed=this.indexed),this.isTuple()&&(r.components=this.components.map(i=>JSON.parse(i.format(t)))),JSON.stringify(r)}let e="";return this.isArray()?(e+=this.arrayChildren.format(t),e+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?e+="("+this.components.map(n=>n.format(t)).join(t==="full"?", ":",")+")":e+=this.type,t!=="sighash"&&(this.indexed===!0&&(e+=" indexed"),t==="full"&&this.name&&(e+=" "+this.name)),e}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(t,e){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return t.map(r=>n.arrayChildren.walk(r,e))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");const n=this;return t.map((r,i)=>n.components[i].walk(r,e))}return e(this.type,t)}async walkAsync(t,e){const n=[],r=[t];return N(this,Bt,qt).call(this,n,t,e,i=>{r[0]=i}),n.length&&await Promise.all(n),r[0]}static from(t,e){if(_.isParamType(t))return t;if(typeof t=="string")try{return _.from(ft(t),e)}catch{o.assertArgument(!1,"invalid param type","obj",t)}else if(t instanceof H){let c="",u="",f=null;it(t,S(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(u="tuple",f=t.popParams().map(A=>_.from(A)),c=`tuple(${f.map(A=>A.format()).join(",")})`):(c=Ge(t.popType("TYPE")),u=c);let h=null,p=null;for(;t.length&&t.peekType("BRACKET");){const A=t.pop();h=new _(v,"",c,u,null,f,p,h),p=A.value,c+=A.text,u="array",f=null}let g=null;if(it(t,ar).has("indexed")){if(!e)throw new Error("");g=!0}const b=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new _(v,b,c,u,g,f,p,h)}const n=t.name;o.assertArgument(!n||typeof n=="string"&&n.match(mn),"invalid name","obj.name",n);let r=t.indexed;r!=null&&(o.assertArgument(e,"parameter cannot be indexed","obj.indexed",t.indexed),r=!!r);let i=t.type,a=i.match(pr);if(a){const c=parseInt(a[2]||"-1"),u=_.from({type:a[1],components:t.components});return new _(v,n||"",i,"array",r,null,c,u)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){const c=t.components!=null?t.components.map(f=>_.from(f)):null;return new _(v,n||"",i,"tuple",r,c,null,null)}return i=Ge(t.type),new _(v,n||"",i,i,r,null,null,null)}static isParamType(t){return t&&t[L]===_e}};Bt=new WeakSet,qt=function(t,e,n,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,c=e.slice();c.forEach((u,f)=>{var h;N(h=a,Bt,qt).call(h,t,u,n,p=>{c[f]=p})}),r(c);return}if(this.isTuple()){const a=this.components;let c;if(Array.isArray(e))c=e.slice();else{if(e==null||typeof e!="object")throw new Error("invalid tuple value");c=a.map(u=>{if(!u.name)throw new Error("cannot use object value with unnamed components");if(!(u.name in e))throw new Error(`missing value for component ${u.name}`);return e[u.name]})}if(c.length!==this.components.length)throw new Error("array is wrong length");c.forEach((u,f)=>{var h;N(h=a[f],Bt,qt).call(h,t,u,n,p=>{c[f]=p})}),r(c);return}const i=n(this.type,e);i.then?t.push(async function(){r(await i)}()):r(i)};let k=_;class Pt{constructor(t,e,n){l(this,"type");l(this,"inputs");o.assertPrivate(t,v,"Fragment"),n=Object.freeze(n.slice()),o.defineProperties(this,{type:e,inputs:n})}static from(t){if(typeof t=="string"){try{Pt.from(JSON.parse(t))}catch{}return Pt.from(ft(t))}if(t instanceof H)switch(t.peekKeyword(pn)){case"constructor":return rt.from(t);case"error":return F.from(t);case"event":return Y.from(t);case"fallback":case"receive":return tt.from(t);case"function":return X.from(t);case"struct":return Et.from(t)}else if(typeof t=="object"){switch(t.type){case"constructor":return rt.from(t);case"error":return F.from(t);case"event":return Y.from(t);case"fallback":case"receive":return tt.from(t);case"function":return X.from(t);case"struct":return Et.from(t)}o.assert(!1,`unsupported type: ${t.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}o.assertArgument(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return rt.isFragment(t)}static isError(t){return F.isFragment(t)}static isEvent(t){return Y.isFragment(t)}static isFunction(t){return X.isFragment(t)}static isStruct(t){return Et.isFragment(t)}}class ue extends Pt{constructor(e,n,r,i){super(e,n,i);l(this,"name");o.assertArgument(typeof r=="string"&&r.match(mn),"invalid identifier","name",r),i=Object.freeze(i.slice()),o.defineProperties(this,{name:r})}}function _t(s,t){return"("+t.map(e=>e.format(s)).join(s==="full"?", ":",")+")"}class F extends ue{constructor(t,e,n){super(t,"error",e,n),Object.defineProperty(this,L,{value:Ve})}get selector(){return Ft(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});const e=[];return t!=="sighash"&&e.push("error"),e.push(this.name+_t(t,this.inputs)),e.join(" ")}static from(t){if(F.isFragment(t))return t;if(typeof t=="string")return F.from(ft(t));if(t instanceof H){const e=ce("error",t),n=st(t);return xt(t),new F(v,e,n)}return new F(v,t.name,t.inputs?t.inputs.map(k.from):[])}static isFragment(t){return t&&t[L]===Ve}}class Y extends ue{constructor(e,n,r,i){super(e,"event",n,r);l(this,"anonymous");Object.defineProperty(this,L,{value:Me}),o.defineProperties(this,{anonymous:i})}get topicHash(){return Ft(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("event"),n.push(this.name+_t(e,this.inputs)),e!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(e,n){return n=(n||[]).map(i=>k.from(i)),new Y(v,e,n,!1).topicHash}static from(e){if(Y.isFragment(e))return e;if(typeof e=="string")try{return Y.from(ft(e))}catch{o.assertArgument(!1,"invalid event fragment","obj",e)}else if(e instanceof H){const n=ce("event",e),r=st(e,!0),i=!!it(e,S(["anonymous"])).has("anonymous");return xt(e),new Y(v,n,r,i)}return new Y(v,e.name,e.inputs?e.inputs.map(n=>k.from(n,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[L]===Me}}class rt extends Pt{constructor(e,n,r,i,a){super(e,n,r);l(this,"payable");l(this,"gas");Object.defineProperty(this,L,{value:He}),o.defineProperties(this,{payable:i,gas:a})}format(e){if(o.assert(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[`constructor${_t(e,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(e){if(rt.isFragment(e))return e;if(typeof e=="string")try{return rt.from(ft(e))}catch{o.assertArgument(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof H){it(e,S(["constructor"]));const n=st(e),r=!!it(e,sr).has("payable"),i=bn(e);return xt(e),new rt(v,"constructor",n,r,i)}return new rt(v,"constructor",e.inputs?e.inputs.map(k.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[L]===He}}class tt extends Pt{constructor(e,n,r){super(e,"fallback",n);l(this,"payable");Object.defineProperty(this,L,{value:ze}),o.defineProperties(this,{payable:r})}format(e){const n=this.inputs.length===0?"receive":"fallback";if(e==="json"){const r=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:r})}return`${n}()${this.payable?" payable":""}`}static from(e){if(tt.isFragment(e))return e;if(typeof e=="string")try{return tt.from(ft(e))}catch{o.assertArgument(!1,"invalid fallback fragment","obj",e)}else if(e instanceof H){const n=e.toString(),r=e.peekKeyword(S(["fallback","receive"]));if(o.assertArgument(r,"type must be fallback or receive","obj",n),e.popKeyword(S(["fallback","receive"]))==="receive"){const u=st(e);return o.assertArgument(u.length===0,"receive cannot have arguments","obj.inputs",u),it(e,S(["payable"])),xt(e),new tt(v,[],!0)}let a=st(e);a.length?o.assertArgument(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(u=>u.format("minimal")).join(", ")):a=[k.from("bytes")];const c=wn(e);if(o.assertArgument(c==="nonpayable"||c==="payable","fallback cannot be constants","obj.stateMutability",c),it(e,S(["returns"])).has("returns")){const u=st(e);o.assertArgument(u.length===1&&u[0].type==="bytes","invalid fallback outputs","obj.outputs",u.map(f=>f.format("minimal")).join(", "))}return xt(e),new tt(v,a,c==="payable")}if(e.type==="receive")return new tt(v,[],!0);if(e.type==="fallback"){const n=[k.from("bytes")],r=e.stateMutability==="payable";return new tt(v,n,r)}o.assertArgument(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[L]===ze}}class X extends ue{constructor(e,n,r,i,a,c){super(e,"function",n,i);l(this,"constant");l(this,"outputs");l(this,"stateMutability");l(this,"payable");l(this,"gas");Object.defineProperty(this,L,{value:Je}),a=Object.freeze(a.slice());const u=r==="view"||r==="pure",f=r==="payable";o.defineProperties(this,{constant:u,gas:c,outputs:a,payable:f,stateMutability:r})}get selector(){return Ft(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(e))),outputs:this.outputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("function"),n.push(this.name+_t(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(_t(e,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(e,n){return n=(n||[]).map(i=>k.from(i)),new X(v,e,"view",n,[],null).selector}static from(e){if(X.isFragment(e))return e;if(typeof e=="string")try{return X.from(ft(e))}catch{o.assertArgument(!1,"invalid function fragment","obj",e)}else if(e instanceof H){const r=ce("function",e),i=st(e),a=wn(e);let c=[];it(e,S(["returns"])).has("returns")&&(c=st(e));const u=bn(e);return xt(e),new X(v,r,a,i,c,u)}let n=e.stateMutability;return n==null&&(n="payable",typeof e.constant=="boolean"?(n="view",e.constant||(n="payable",typeof e.payable=="boolean"&&!e.payable&&(n="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(n="nonpayable")),new X(v,e.name,n,e.inputs?e.inputs.map(k.from):[],e.outputs?e.outputs.map(k.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[L]===Je}}class Et extends ue{constructor(t,e,n){super(t,"struct",e,n),Object.defineProperty(this,L,{value:Ke})}format(){throw new Error("@TODO")}static from(t){if(typeof t=="string")try{return Et.from(ft(t))}catch{o.assertArgument(!1,"invalid struct fragment","obj",t)}else if(t instanceof H){const e=ce("struct",t),n=st(t);return xt(t),new Et(v,e,n)}return new Et(v,t.name,t.inputs?t.inputs.map(k.from):[])}static isFragment(t){return t&&t[L]===Ke}}const z=new Map;z.set(0,"GENERIC_PANIC");z.set(1,"ASSERT_FALSE");z.set(17,"OVERFLOW");z.set(18,"DIVIDE_BY_ZERO");z.set(33,"ENUM_RANGE_ERROR");z.set(34,"BAD_STORAGE_DATA");z.set(49,"STACK_UNDERFLOW");z.set(50,"ARRAY_RANGE_ERROR");z.set(65,"OUT_OF_MEMORY");z.set(81,"UNINITIALIZED_FUNCTION_CALL");const gr=new RegExp(/^bytes([0-9]*)$/),mr=new RegExp(/^(u?int)([0-9]*)$/);let de=null,We=1024;function yr(s,t,e,n){let r="missing revert data",i=null;const a=null;let c=null;if(e){r="execution reverted";const f=o.getBytes(e);if(e=o.hexlify(e),f.length===0)r+=" (no data present; likely require(false) occurred",i="require(false)";else if(f.length%32!==4)r+=" (could not decode reason; invalid data length)";else if(o.hexlify(f.slice(0,4))==="0x08c379a0")try{i=n.decode(["string"],f.slice(4))[0],c={signature:"Error(string)",name:"Error",args:[i]},r+=`: ${JSON.stringify(i)}`}catch{r+=" (could not decode reason; invalid string data)"}else if(o.hexlify(f.slice(0,4))==="0x4e487b71")try{const h=Number(n.decode(["uint256"],f.slice(4))[0]);c={signature:"Panic(uint256)",name:"Panic",args:[h]},i=`Panic due to ${z.get(h)||"UNKNOWN"}(${h})`,r+=`: ${i}`}catch{r+=" (could not decode panic code)"}else r+=" (unknown custom error)"}const u={to:t.to?o.getAddress(t.to):null,data:t.data||"0x"};return t.from&&(u.from=o.getAddress(t.from)),o.makeError(r,"CALL_EXCEPTION",{action:s,data:e,reason:i,transaction:u,invocation:a,revert:c})}var ut,vt;const ie=class ie{constructor(){x(this,ut)}getDefaultValue(t){const e=t.map(r=>N(this,ut,vt).call(this,k.from(r)));return new Xt(e,"_").defaultValue()}encode(t,e){o.assertArgumentCount(e.length,t.length,"types/values length mismatch");const n=t.map(a=>N(this,ut,vt).call(this,k.from(a))),r=new Xt(n,"_"),i=new me;return r.encode(i,e),i.data}decode(t,e,n){const r=t.map(a=>N(this,ut,vt).call(this,k.from(a)));return new Xt(r,"_").decode(new ye(e,n,We))}static _setDefaultMaxInflation(t){o.assertArgument(typeof t=="number"&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),We=t}static defaultAbiCoder(){return de==null&&(de=new ie),de}static getBuiltinCallException(t,e,n){return yr(t,e,n,ie.defaultAbiCoder())}};ut=new WeakSet,vt=function(t){if(t.isArray())return new Kn(N(this,ut,vt).call(this,t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new Xt(t.components.map(n=>N(this,ut,vt).call(this,n)),t.name);switch(t.baseType){case"address":return new zn(t.name);case"bool":return new Wn(t.name);case"string":return new nr(t.name);case"bytes":return new Yn(t.name);case"":return new Qn(t.name)}let e=t.type.match(mr);if(e){let n=parseInt(e[2]||"256");return o.assertArgument(n!==0&&n<=256&&n%8===0,"invalid "+e[1]+" bit length","param",t),new er(n/8,e[1]==="int",t.name)}if(e=t.type.match(gr),e){let n=parseInt(e[1]);return o.assertArgument(n!==0&&n<=32,"invalid bytes length","param",t),new Xn(n,t.name)}o.assertArgument(!1,"invalid type","type",t.type)};let Vt=ie;class wr{constructor(t,e,n){l(this,"fragment");l(this,"name");l(this,"signature");l(this,"topic");l(this,"args");const r=t.name,i=t.format();o.defineProperties(this,{fragment:t,name:r,signature:i,topic:e,args:n})}}class br{constructor(t,e,n,r){l(this,"fragment");l(this,"name");l(this,"args");l(this,"signature");l(this,"selector");l(this,"value");const i=t.name,a=t.format();o.defineProperties(this,{fragment:t,name:i,args:n,signature:a,selector:e,value:r})}}class Er{constructor(t,e,n){l(this,"fragment");l(this,"name");l(this,"args");l(this,"signature");l(this,"selector");const r=t.name,i=t.format();o.defineProperties(this,{fragment:t,name:r,args:n,signature:i,selector:e})}}class Ye{constructor(t){l(this,"hash");l(this,"_isIndexed");o.defineProperties(this,{hash:t,_isIndexed:!0})}static isIndexed(t){return!!(t&&t._isIndexed)}}const Xe={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},Ze={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:s=>`reverted with reason string ${JSON.stringify(s)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:s=>{let t="unknown panic code";return s>=0&&s<=255&&Xe[s.toString()]&&(t=Xe[s.toString()]),`reverted with panic code 0x${s.toString(16)} (${t})`}}};var J,K,W,I,Z,jt,te;const pt=class pt{constructor(t){x(this,Z);l(this,"fragments");l(this,"deploy");l(this,"fallback");l(this,"receive");x(this,J);x(this,K);x(this,W);x(this,I);let e=[];typeof t=="string"?e=JSON.parse(t):e=t,w(this,W,new Map),w(this,J,new Map),w(this,K,new Map);const n=[];for(const a of e)try{n.push(Pt.from(a))}catch(c){console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`,c.message)}o.defineProperties(this,{fragments:Object.freeze(n)});let r=null,i=!1;w(this,I,this.getAbiCoder()),this.fragments.forEach((a,c)=>{let u;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}o.defineProperties(this,{deploy:a});return;case"fallback":a.inputs.length===0?i=!0:(o.assertArgument(!r||a.payable!==r.payable,"conflicting fallback fragments",`fragments[${c}]`,a),r=a,i=r.payable);return;case"function":u=d(this,W);break;case"event":u=d(this,K);break;case"error":u=d(this,J);break;default:return}const f=a.format();u.has(f)||u.set(f,a)}),this.deploy||o.defineProperties(this,{deploy:rt.from("constructor()")}),o.defineProperties(this,{fallback:r,receive:i})}format(t){const e=t?"minimal":"full";return this.fragments.map(r=>r.format(e))}formatJson(){const t=this.fragments.map(e=>e.format("json"));return JSON.stringify(t.map(e=>JSON.parse(e)))}getAbiCoder(){return Vt.defaultAbiCoder()}getFunctionName(t){const e=N(this,Z,jt).call(this,t,null,!1);return o.assertArgument(e,"no matching function","key",t),e.name}hasFunction(t){return!!N(this,Z,jt).call(this,t,null,!1)}getFunction(t,e){return N(this,Z,jt).call(this,t,e||null,!0)}forEachFunction(t){const e=Array.from(d(this,W).keys());e.sort((n,r)=>n.localeCompare(r));for(let n=0;n<e.length;n++){const r=e[n];t(d(this,W).get(r),n)}}getEventName(t){const e=N(this,Z,te).call(this,t,null,!1);return o.assertArgument(e,"no matching event","key",t),e.name}hasEvent(t){return!!N(this,Z,te).call(this,t,null,!1)}getEvent(t,e){return N(this,Z,te).call(this,t,e||null,!0)}forEachEvent(t){const e=Array.from(d(this,K).keys());e.sort((n,r)=>n.localeCompare(r));for(let n=0;n<e.length;n++){const r=e[n];t(d(this,K).get(r),n)}}getError(t,e){if(o.isHexString(t)){const r=t.toLowerCase();if(Ze[r])return F.from(Ze[r].signature);for(const i of d(this,J).values())if(r===i.selector)return i;return null}if(t.indexOf("(")===-1){const r=[];for(const[i,a]of d(this,J))i.split("(")[0]===t&&r.push(a);if(r.length===0)return t==="Error"?F.from("error Error(string)"):t==="Panic"?F.from("error Panic(uint256)"):null;if(r.length>1){const i=r.map(a=>JSON.stringify(a.format())).join(", ");o.assertArgument(!1,`ambiguous error description (i.e. ${i})`,"name",t)}return r[0]}if(t=F.from(t).format(),t==="Error(string)")return F.from("error Error(string)");if(t==="Panic(uint256)")return F.from("error Panic(uint256)");const n=d(this,J).get(t);return n||null}forEachError(t){const e=Array.from(d(this,J).keys());e.sort((n,r)=>n.localeCompare(r));for(let n=0;n<e.length;n++){const r=e[n];t(d(this,J).get(r),n)}}_decodeParams(t,e){return d(this,I).decode(t,e)}_encodeParams(t,e){return d(this,I).encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){if(typeof t=="string"){const n=this.getError(t);o.assertArgument(n,"unknown error","fragment",t),t=n}return o.assertArgument(o.dataSlice(e,0,4)===t.selector,`data signature does not match error ${t.name}.`,"data",e),this._decodeParams(t.inputs,o.dataSlice(e,4))}encodeErrorResult(t,e){if(typeof t=="string"){const n=this.getError(t);o.assertArgument(n,"unknown error","fragment",t),t=n}return o.concat([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionData(t,e){if(typeof t=="string"){const n=this.getFunction(t);o.assertArgument(n,"unknown function","fragment",t),t=n}return o.assertArgument(o.dataSlice(e,0,4)===t.selector,`data signature does not match function ${t.name}.`,"data",e),this._decodeParams(t.inputs,o.dataSlice(e,4))}encodeFunctionData(t,e){if(typeof t=="string"){const n=this.getFunction(t);o.assertArgument(n,"unknown function","fragment",t),t=n}return o.concat([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionResult(t,e){if(typeof t=="string"){const i=this.getFunction(t);o.assertArgument(i,"unknown function","fragment",t),t=i}let n="invalid length for result data";const r=o.getBytesCopy(e);if(r.length%32===0)try{return d(this,I).decode(t.outputs,r)}catch{n="could not decode result data"}o.assert(!1,n,"BAD_DATA",{value:o.hexlify(r),info:{method:t.name,signature:t.format()}})}makeError(t,e){const n=o.getBytes(t,"data"),r=Vt.getBuiltinCallException("call",e,n);if(r.message.startsWith("execution reverted (unknown custom error)")){const c=o.hexlify(n.slice(0,4)),u=this.getError(c);if(u)try{const f=d(this,I).decode(u.inputs,n.slice(4));r.revert={name:u.name,signature:u.format(),args:f},r.reason=r.revert.signature,r.message=`execution reverted: ${r.reason}`}catch{r.message="execution reverted (coult not decode custom error)"}}const a=this.parseTransaction(e);return a&&(r.invocation={method:a.name,signature:a.signature,args:a.args}),r}encodeFunctionResult(t,e){if(typeof t=="string"){const n=this.getFunction(t);o.assertArgument(n,"unknown function","fragment",t),t=n}return o.hexlify(d(this,I).encode(t.outputs,e||[]))}encodeFilterTopics(t,e){if(typeof t=="string"){const i=this.getEvent(t);o.assertArgument(i,"unknown event","eventFragment",t),t=i}o.assert(e.length<=t.inputs.length,`too many arguments for ${t.format()}`,"UNEXPECTED_ARGUMENT",{count:e.length,expectedCount:t.inputs.length});const n=[];t.anonymous||n.push(t.topicHash);const r=(i,a)=>i.type==="string"?Ft(a):i.type==="bytes"?o.keccak256(o.hexlify(a)):(i.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":i.type.match(/^u?int/)?a=Ae(a):i.type.match(/^bytes/)?a=o.zeroPadBytes(a,32):i.type==="address"&&d(this,I).encode(["address"],[a]),o.zeroPadValue(o.hexlify(a),32));for(e.forEach((i,a)=>{const c=t.inputs[a];if(!c.indexed){o.assertArgument(i==null,"cannot filter non-indexed parameters; must be null","contract."+c.name,i);return}i==null?n.push(null):c.baseType==="array"||c.baseType==="tuple"?o.assertArgument(!1,"filtering with tuples or arrays not supported","contract."+c.name,i):Array.isArray(i)?n.push(i.map(u=>r(c,u))):n.push(r(c,i))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(t,e){if(typeof t=="string"){const a=this.getEvent(t);o.assertArgument(a,"unknown event","eventFragment",t),t=a}const n=[],r=[],i=[];return t.anonymous||n.push(t.topicHash),o.assertArgument(e.length===t.inputs.length,"event arguments/values mismatch","values",e),t.inputs.forEach((a,c)=>{const u=e[c];if(a.indexed)if(a.type==="string")n.push(Ft(u));else if(a.type==="bytes")n.push(o.keccak256(u));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");n.push(d(this,I).encode([a.type],[u]))}else r.push(a),i.push(u)}),{data:d(this,I).encode(r,i),topics:n}}decodeEventLog(t,e,n){if(typeof t=="string"){const y=this.getEvent(t);o.assertArgument(y,"unknown event","eventFragment",t),t=y}if(n!=null&&!t.anonymous){const y=t.topicHash;o.assertArgument(o.isHexString(n[0],32)&&n[0].toLowerCase()===y,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const r=[],i=[],a=[];t.inputs.forEach((y,b)=>{y.indexed?y.type==="string"||y.type==="bytes"||y.baseType==="tuple"||y.baseType==="array"?(r.push(k.from({type:"bytes32",name:y.name})),a.push(!0)):(r.push(y),a.push(!1)):(i.push(y),a.push(!1))});const c=n!=null?d(this,I).decode(r,o.concat(n)):null,u=d(this,I).decode(i,e,!0),f=[],h=[];let p=0,g=0;return t.inputs.forEach((y,b)=>{let A=null;if(y.indexed)if(c==null)A=new Ye(null);else if(a[b])A=new Ye(c[g++]);else try{A=c[g++]}catch(O){A=O}else try{A=u[p++]}catch(O){A=O}f.push(A),h.push(y.name||null)}),Ct.fromItems(f,h)}parseTransaction(t){const e=o.getBytes(t.data,"tx.data"),n=at(t.value!=null?t.value:0,"tx.value"),r=this.getFunction(o.hexlify(e.slice(0,4)));if(!r)return null;const i=d(this,I).decode(r.inputs,e.slice(4));return new br(r,r.selector,i,n)}parseCallResult(t){throw new Error("@TODO")}parseLog(t){const e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new wr(e,e.topicHash,this.decodeEventLog(e,t.data,t.topics))}parseError(t){const e=o.hexlify(t),n=this.getError(o.dataSlice(e,0,4));if(!n)return null;const r=d(this,I).decode(n.inputs,o.dataSlice(e,4));return new Er(n,n.selector,r)}static from(t){return t instanceof pt?t:typeof t=="string"?new pt(JSON.parse(t)):typeof t.formatJson=="function"?new pt(t.formatJson()):typeof t.format=="function"?new pt(t.format("json")):new pt(t)}};J=new WeakMap,K=new WeakMap,W=new WeakMap,I=new WeakMap,Z=new WeakSet,jt=function(t,e,n){if(o.isHexString(t)){const i=t.toLowerCase();for(const a of d(this,W).values())if(i===a.selector)return a;return null}if(t.indexOf("(")===-1){const i=[];for(const[a,c]of d(this,W))a.split("(")[0]===t&&i.push(c);if(e){const a=e.length>0?e[e.length-1]:null;let c=e.length,u=!0;U.isTyped(a)&&a.type==="overrides"&&(u=!1,c--);for(let f=i.length-1;f>=0;f--){const h=i[f].inputs.length;h!==c&&(!u||h!==c-1)&&i.splice(f,1)}for(let f=i.length-1;f>=0;f--){const h=i[f].inputs;for(let p=0;p<e.length;p++)if(U.isTyped(e[p])){if(p>=h.length){if(e[p].type==="overrides")continue;i.splice(f,1);break}if(e[p].type!==h[p].baseType){i.splice(f,1);break}}}}if(i.length===1&&e&&e.length!==i[0].inputs.length){const a=e[e.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&n){const a=i.map(c=>JSON.stringify(c.format())).join(", ");o.assertArgument(!1,`ambiguous function description (i.e. matches ${a})`,"key",t)}return i[0]}const r=d(this,W).get(X.from(t).format());return r||null},te=function(t,e,n){if(o.isHexString(t)){const i=t.toLowerCase();for(const a of d(this,K).values())if(i===a.topicHash)return a;return null}if(t.indexOf("(")===-1){const i=[];for(const[a,c]of d(this,K))a.split("(")[0]===t&&i.push(c);if(e){for(let a=i.length-1;a>=0;a--)i[a].inputs.length<e.length&&i.splice(a,1);for(let a=i.length-1;a>=0;a--){const c=i[a].inputs;for(let u=0;u<e.length;u++)if(U.isTyped(e[u])&&e[u].type!==c[u].baseType){i.splice(a,1);break}}}if(i.length===0)return null;if(i.length>1&&n){const a=i.map(c=>JSON.stringify(c.format())).join(", ");o.assertArgument(!1,`ambiguous event description (i.e. matches ${a})`,"key",t)}return i[0]}const r=d(this,K).get(Y.from(t).format());return r||null};let ee=pt;const En=BigInt(0);function Rt(s){return s??null}function T(s){return s==null?null:s.toString()}class xr{constructor(t,e,n){l(this,"gasPrice");l(this,"maxFeePerGas");l(this,"maxPriorityFeePerGas");o.defineProperties(this,{gasPrice:Rt(t),maxFeePerGas:Rt(e),maxPriorityFeePerGas:Rt(n)})}toJSON(){const{gasPrice:t,maxFeePerGas:e,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:T(t),maxFeePerGas:T(e),maxPriorityFeePerGas:T(n)}}}function xn(s){const t={};s.to&&(t.to=s.to),s.from&&(t.from=s.from),s.data&&(t.data=o.hexlify(s.data));const e="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const r of e)!(r in s)||s[r]==null||(t[r]=at(s[r],`request.${r}`));const n="type,nonce".split(/,/);for(const r of n)!(r in s)||s[r]==null||(t[r]=Q(s[r],`request.${r}`));return s.accessList&&(t.accessList=fn(s.accessList)),"blockTag"in s&&(t.blockTag=s.blockTag),"enableCcipRead"in s&&(t.enableCcipRead=!!s.enableCcipRead),"customData"in s&&(t.customData=s.customData),"blobVersionedHashes"in s&&s.blobVersionedHashes&&(t.blobVersionedHashes=s.blobVersionedHashes.slice()),"kzg"in s&&(t.kzg=s.kzg),"blobs"in s&&s.blobs&&(t.blobs=s.blobs.map(r=>o.isBytesLike(r)?o.hexlify(r):Object.assign({},r))),t}var nt;class Pr{constructor(t,e){l(this,"provider");l(this,"number");l(this,"hash");l(this,"timestamp");l(this,"parentHash");l(this,"parentBeaconBlockRoot");l(this,"nonce");l(this,"difficulty");l(this,"gasLimit");l(this,"gasUsed");l(this,"stateRoot");l(this,"receiptsRoot");l(this,"blobGasUsed");l(this,"excessBlobGas");l(this,"miner");l(this,"prevRandao");l(this,"extraData");l(this,"baseFeePerGas");x(this,nt);w(this,nt,t.transactions.map(n=>typeof n!="string"?new Mt(n,e):n)),o.defineProperties(this,{provider:e,hash:Rt(t.hash),number:t.number,timestamp:t.timestamp,parentHash:t.parentHash,parentBeaconBlockRoot:t.parentBeaconBlockRoot,nonce:t.nonce,difficulty:t.difficulty,gasLimit:t.gasLimit,gasUsed:t.gasUsed,blobGasUsed:t.blobGasUsed,excessBlobGas:t.excessBlobGas,miner:t.miner,prevRandao:Rt(t.prevRandao),extraData:t.extraData,baseFeePerGas:Rt(t.baseFeePerGas),stateRoot:t.stateRoot,receiptsRoot:t.receiptsRoot})}get transactions(){return d(this,nt).map(t=>typeof t=="string"?t:t.hash)}get prefetchedTransactions(){const t=d(this,nt).slice();return t.length===0?[]:(o.assert(typeof t[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),t)}toJSON(){const{baseFeePerGas:t,difficulty:e,extraData:n,gasLimit:r,gasUsed:i,hash:a,miner:c,prevRandao:u,nonce:f,number:h,parentHash:p,parentBeaconBlockRoot:g,stateRoot:y,receiptsRoot:b,timestamp:A,transactions:O}=this;return{_type:"Block",baseFeePerGas:T(t),difficulty:T(e),extraData:n,gasLimit:T(r),gasUsed:T(i),blobGasUsed:T(this.blobGasUsed),excessBlobGas:T(this.excessBlobGas),hash:a,miner:c,prevRandao:u,nonce:f,number:h,parentHash:p,timestamp:A,parentBeaconBlockRoot:g,stateRoot:y,receiptsRoot:b,transactions:O}}[Symbol.iterator](){let t=0;const e=this.transactions;return{next:()=>t<this.length?{value:e[t++],done:!1}:{value:void 0,done:!0}}}get length(){return d(this,nt).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(t){let e;if(typeof t=="number")e=d(this,nt)[t];else{const n=t.toLowerCase();for(const r of d(this,nt))if(typeof r=="string"){if(r!==n)continue;e=r;break}else{if(r.hash!==n)continue;e=r;break}}if(e==null)throw new Error("no such tx");return typeof e=="string"?await this.provider.getTransaction(e):e}getPrefetchedTransaction(t){const e=this.prefetchedTransactions;if(typeof t=="number")return e[t];t=t.toLowerCase();for(const n of e)if(n.hash===t)return n;o.assertArgument(!1,"no matching transaction","indexOrHash",t)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return Ar(this)}}nt=new WeakMap;class Wt{constructor(t,e){l(this,"provider");l(this,"transactionHash");l(this,"blockHash");l(this,"blockNumber");l(this,"removed");l(this,"address");l(this,"data");l(this,"topics");l(this,"index");l(this,"transactionIndex");this.provider=e;const n=Object.freeze(t.topics.slice());o.defineProperties(this,{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,removed:t.removed,address:t.address,data:t.data,topics:n,index:t.index,transactionIndex:t.transactionIndex})}toJSON(){const{address:t,blockHash:e,blockNumber:n,data:r,index:i,removed:a,topics:c,transactionHash:u,transactionIndex:f}=this;return{_type:"log",address:t,blockHash:e,blockNumber:n,data:r,index:i,removed:a,topics:c,transactionHash:u,transactionIndex:f}}async getBlock(){const t=await this.provider.getBlock(this.blockHash);return o.assert(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransaction(){const t=await this.provider.getTransaction(this.transactionHash);return o.assert(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransactionReceipt(){const t=await this.provider.getTransactionReceipt(this.transactionHash);return o.assert(!!t,"failed to find transaction receipt","UNKNOWN_ERROR",{}),t}removedEvent(){return Nr(this)}}var zt;class Pn{constructor(t,e){l(this,"provider");l(this,"to");l(this,"from");l(this,"contractAddress");l(this,"hash");l(this,"index");l(this,"blockHash");l(this,"blockNumber");l(this,"logsBloom");l(this,"gasUsed");l(this,"blobGasUsed");l(this,"cumulativeGasUsed");l(this,"gasPrice");l(this,"blobGasPrice");l(this,"type");l(this,"status");l(this,"root");x(this,zt);w(this,zt,Object.freeze(t.logs.map(r=>new Wt(r,e))));let n=En;t.effectiveGasPrice!=null?n=t.effectiveGasPrice:t.gasPrice!=null&&(n=t.gasPrice),o.defineProperties(this,{provider:e,to:t.to,from:t.from,contractAddress:t.contractAddress,hash:t.hash,index:t.index,blockHash:t.blockHash,blockNumber:t.blockNumber,logsBloom:t.logsBloom,gasUsed:t.gasUsed,cumulativeGasUsed:t.cumulativeGasUsed,blobGasUsed:t.blobGasUsed,gasPrice:n,blobGasPrice:t.blobGasPrice,type:t.type,status:t.status,root:t.root})}get logs(){return d(this,zt)}toJSON(){const{to:t,from:e,contractAddress:n,hash:r,index:i,blockHash:a,blockNumber:c,logsBloom:u,logs:f,status:h,root:p}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:c,contractAddress:n,cumulativeGasUsed:T(this.cumulativeGasUsed),from:e,gasPrice:T(this.gasPrice),blobGasUsed:T(this.blobGasUsed),blobGasPrice:T(this.blobGasPrice),gasUsed:T(this.gasUsed),hash:r,index:i,logs:f,logsBloom:u,root:p,status:h,to:t}}get length(){return this.logs.length}[Symbol.iterator](){let t=0;return{next:()=>t<this.length?{value:this.logs[t++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const t=await this.provider.getBlock(this.blockHash);if(t==null)throw new Error("TODO");return t}async getTransaction(){const t=await this.provider.getTransaction(this.hash);if(t==null)throw new Error("TODO");return t}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return Nn(this)}reorderedEvent(t){return o.assert(!t||t.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),An(this,t)}}zt=new WeakMap;var lt;const Ue=class Ue{constructor(t,e){l(this,"provider");l(this,"blockNumber");l(this,"blockHash");l(this,"index");l(this,"hash");l(this,"type");l(this,"to");l(this,"from");l(this,"nonce");l(this,"gasLimit");l(this,"gasPrice");l(this,"maxPriorityFeePerGas");l(this,"maxFeePerGas");l(this,"maxFeePerBlobGas");l(this,"data");l(this,"value");l(this,"chainId");l(this,"signature");l(this,"accessList");l(this,"blobVersionedHashes");x(this,lt);this.provider=e,this.blockNumber=t.blockNumber!=null?t.blockNumber:null,this.blockHash=t.blockHash!=null?t.blockHash:null,this.hash=t.hash,this.index=t.index,this.type=t.type,this.from=t.from,this.to=t.to||null,this.gasLimit=t.gasLimit,this.nonce=t.nonce,this.data=t.data,this.value=t.value,this.gasPrice=t.gasPrice,this.maxPriorityFeePerGas=t.maxPriorityFeePerGas!=null?t.maxPriorityFeePerGas:null,this.maxFeePerGas=t.maxFeePerGas!=null?t.maxFeePerGas:null,this.maxFeePerBlobGas=t.maxFeePerBlobGas!=null?t.maxFeePerBlobGas:null,this.chainId=t.chainId,this.signature=t.signature,this.accessList=t.accessList!=null?t.accessList:null,this.blobVersionedHashes=t.blobVersionedHashes!=null?t.blobVersionedHashes:null,w(this,lt,-1)}toJSON(){const{blockNumber:t,blockHash:e,index:n,hash:r,type:i,to:a,from:c,nonce:u,data:f,signature:h,accessList:p,blobVersionedHashes:g}=this;return{_type:"TransactionResponse",accessList:p,blockNumber:t,blockHash:e,blobVersionedHashes:g,chainId:T(this.chainId),data:f,from:c,gasLimit:T(this.gasLimit),gasPrice:T(this.gasPrice),hash:r,maxFeePerGas:T(this.maxFeePerGas),maxPriorityFeePerGas:T(this.maxPriorityFeePerGas),maxFeePerBlobGas:T(this.maxFeePerBlobGas),nonce:u,signature:h,to:a,index:n,type:i,value:T(this.value)}}async getBlock(){let t=this.blockNumber;if(t==null){const n=await this.getTransaction();n&&(t=n.blockNumber)}if(t==null)return null;const e=this.provider.getBlock(t);if(e==null)throw new Error("TODO");return e}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:e,blockNumber:n}=await o.resolveProperties({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return e==null||e.blockNumber==null?0:n-e.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(t,e){const n=t??1,r=e??0;let i=d(this,lt),a=-1,c=i===-1;const u=async()=>{if(c)return null;const{blockNumber:g,nonce:y}=await o.resolveProperties({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(y<this.nonce){i=g;return}if(c)return null;const b=await this.getTransaction();if(!(b&&b.blockNumber!=null))for(a===-1&&(a=i-3,a<d(this,lt)&&(a=d(this,lt)));a<=g;){if(c)return null;const A=await this.provider.getBlock(a,!0);if(A==null)return;for(const O of A)if(O===this.hash)return;for(let O=0;O<A.length;O++){const P=await A.getTransaction(O);if(P.from===this.from&&P.nonce===this.nonce){if(c)return null;const D=await this.provider.getTransactionReceipt(P.hash);if(D==null||g-D.blockNumber+1<n)return;let ht="replaced";P.data===this.data&&P.to===this.to&&P.value===this.value?ht="repriced":P.data==="0x"&&P.from===P.to&&P.value===En&&(ht="cancelled"),o.assert(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:ht==="replaced"||ht==="cancelled",reason:ht,replacement:P.replaceableTransaction(i),hash:P.hash,receipt:D})}}a++}},f=g=>{if(g==null||g.status!==0)return g;o.assert(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:g.to,from:g.from,data:""},receipt:g})},h=await this.provider.getTransactionReceipt(this.hash);if(n===0)return f(h);if(h){if(await h.confirmations()>=n)return f(h)}else if(await u(),n===0)return null;return await new Promise((g,y)=>{const b=[],A=()=>{b.forEach(P=>P())};if(b.push(()=>{c=!0}),r>0){const P=setTimeout(()=>{A(),y(o.makeError("wait for transaction timeout","TIMEOUT"))},r);b.push(()=>{clearTimeout(P)})}const O=async P=>{if(await P.confirmations()>=n){A();try{g(f(P))}catch(D){y(D)}}};if(b.push(()=>{this.provider.off(this.hash,O)}),this.provider.on(this.hash,O),i>=0){const P=async()=>{try{await u()}catch(D){if(o.isError(D,"TRANSACTION_REPLACED")){A(),y(D);return}}c||this.provider.once("block",P)};b.push(()=>{this.provider.off("block",P)}),this.provider.once("block",P)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return o.assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Nn(this)}reorderedEvent(t){return o.assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),o.assert(!t||t.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),An(this,t)}replaceableTransaction(t){o.assertArgument(Number.isInteger(t)&&t>=0,"invalid startBlock","startBlock",t);const e=new Ue(this,this.provider);return w(e,lt,t),e}};lt=new WeakMap;let Mt=Ue;function Ar(s){return{orphan:"drop-block",hash:s.hash,number:s.number}}function An(s,t){return{orphan:"reorder-transaction",tx:s,other:t}}function Nn(s){return{orphan:"drop-transaction",tx:s}}function Nr(s){return{orphan:"drop-log",log:{transactionHash:s.transactionHash,blockHash:s.blockHash,blockNumber:s.blockNumber,address:s.address,data:s.data,topics:Object.freeze(s.topics.slice()),index:s.index}}}class Oe extends Wt{constructor(e,n,r){super(e,e.provider);l(this,"interface");l(this,"fragment");l(this,"args");const i=n.decodeEventLog(r,e.data,e.topics);o.defineProperties(this,{args:i,fragment:r,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class vn extends Wt{constructor(e,n){super(e,e.provider);l(this,"error");o.defineProperties(this,{error:n})}}var St;class vr extends Pn{constructor(e,n,r){super(r,n);x(this,St);w(this,St,e)}get logs(){return super.logs.map(e=>{const n=e.topics.length?d(this,St).getEvent(e.topics[0]):null;if(n)try{return new Oe(e,d(this,St),n)}catch(r){return new vn(e,r)}return e})}}St=new WeakMap;var Jt;class Te extends Mt{constructor(e,n,r){super(r,n);x(this,Jt);w(this,Jt,e)}async wait(e,n){const r=await super.wait(e,n);return r==null?null:new vr(d(this,Jt),this.provider,r)}}Jt=new WeakMap;class On extends nn{constructor(e,n,r,i){super(e,n,r);l(this,"log");o.defineProperties(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class Or extends On{constructor(t,e,n,r,i){super(t,e,n,new Oe(i,t.interface,r));const a=t.interface.decodeEventLog(r,this.log.data,this.log.topics);o.defineProperties(this,{args:a,fragment:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const Qe=BigInt(0);function Tn(s){return s&&typeof s.call=="function"}function Rn(s){return s&&typeof s.estimateGas=="function"}function le(s){return s&&typeof s.resolveName=="function"}function kn(s){return s&&typeof s.sendTransaction=="function"}function In(s){if(s!=null){if(le(s))return s;if(s.provider)return s.provider}}var Kt;class Tr{constructor(t,e,n){x(this,Kt);l(this,"fragment");if(o.defineProperties(this,{fragment:e}),e.inputs.length<n.length)throw new Error("too many arguments");const r=At(t.runner,"resolveName"),i=le(r)?r:null;w(this,Kt,async function(){const a=await Promise.all(e.inputs.map((c,u)=>n[u]==null?null:c.walkAsync(n[u],(h,p)=>h==="address"?Array.isArray(p)?Promise.all(p.map(g=>o.resolveAddress(g,i))):o.resolveAddress(p,i):p)));return t.interface.encodeFilterTopics(e,a)}())}getTopicFilter(){return d(this,Kt)}}Kt=new WeakMap;function At(s,t){return s==null?null:typeof s[t]=="function"?s:s.provider&&typeof s.provider[t]=="function"?s.provider:null}function gt(s){return s==null?null:s.provider||null}async function Re(s,t){const e=U.dereference(s,"overrides");o.assertArgument(typeof e=="object","invalid overrides parameter","overrides",s);const n=xn(e);return o.assertArgument(n.to==null||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),o.assertArgument(n.data==null||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function Un(s,t,e){const n=At(s,"resolveName"),r=le(n)?n:null;return await Promise.all(t.map((i,a)=>i.walkAsync(e[a],(c,u)=>(u=U.dereference(u,c),c==="address"?o.resolveAddress(u,r):u))))}function Rr(s){const t=async function(a){const c=await Re(a,["data"]);c.to=await s.getAddress(),c.from&&(c.from=await o.resolveAddress(c.from,In(s.runner)));const u=s.interface,f=at(c.value||Qe,"overrides.value")===Qe,h=(c.data||"0x")==="0x";u.fallback&&!u.fallback.payable&&u.receive&&!h&&!f&&o.assertArgument(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),o.assertArgument(u.fallback||h,"cannot send data to receive-only contract","overrides.data",c.data);const p=u.receive||u.fallback&&u.fallback.payable;return o.assertArgument(p||f,"cannot send value to non-payable fallback","overrides.value",c.value),o.assertArgument(u.fallback||h,"cannot send data to receive-only contract","overrides.data",c.data),c},e=async function(a){const c=At(s.runner,"call");o.assert(Tn(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const u=await t(a);try{return await c.call(u)}catch(f){throw o.isCallException(f)&&f.data?s.interface.makeError(f.data,u):f}},n=async function(a){const c=s.runner;o.assert(kn(c),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const u=await c.sendTransaction(await t(a)),f=gt(s.runner);return new Te(s.interface,f,u)},r=async function(a){const c=At(s.runner,"estimateGas");return o.assert(Rn(c),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await c.estimateGas(await t(a))},i=async a=>await n(a);return o.defineProperties(i,{_contract:s,estimateGas:r,populateTransaction:t,send:n,staticCall:e}),i}function kr(s,t){const e=function(...f){const h=s.interface.getFunction(t,f);return o.assert(h,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:f}}),h},n=async function(...f){const h=e(...f);let p={};if(h.inputs.length+1===f.length&&(p=await Re(f.pop()),p.from&&(p.from=await o.resolveAddress(p.from,In(s.runner)))),h.inputs.length!==f.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const g=await Un(s.runner,h.inputs,f);return Object.assign({},p,await o.resolveProperties({to:s.getAddress(),data:s.interface.encodeFunctionData(h,g)}))},r=async function(...f){const h=await c(...f);return h.length===1?h[0]:h},i=async function(...f){const h=s.runner;o.assert(kn(h),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const p=await h.sendTransaction(await n(...f)),g=gt(s.runner);return new Te(s.interface,g,p)},a=async function(...f){const h=At(s.runner,"estimateGas");return o.assert(Rn(h),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await h.estimateGas(await n(...f))},c=async function(...f){const h=At(s.runner,"call");o.assert(Tn(h),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const p=await n(...f);let g="0x";try{g=await h.call(p)}catch(b){throw o.isCallException(b)&&b.data?s.interface.makeError(b.data,p):b}const y=e(...f);return s.interface.decodeFunctionResult(y,g)},u=async(...f)=>e(...f).constant?await r(...f):await i(...f);return o.defineProperties(u,{name:s.interface.getFunctionName(t),_contract:s,_key:t,getFragment:e,estimateGas:a,populateTransaction:n,send:i,staticCall:r,staticCallResult:c}),Object.defineProperty(u,"fragment",{configurable:!1,enumerable:!0,get:()=>{const f=s.interface.getFunction(t);return o.assert(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),f}}),u}function Ir(s,t){const e=function(...r){const i=s.interface.getEvent(t,r);return o.assert(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),i},n=function(...r){return new Tr(s,e(...r),r)};return o.defineProperties(n,{name:s.interface.getEventName(t),_contract:s,_key:t,getFragment:e}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=s.interface.getEvent(t);return o.assert(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),r}}),n}const ne=Symbol.for("_ethersInternal_contract"),Bn=new WeakMap;function Ur(s,t){Bn.set(s[ne],t)}function $(s){return Bn.get(s[ne])}function Br(s){return s&&typeof s=="object"&&"getTopicFilter"in s&&typeof s.getTopicFilter=="function"&&s.fragment}async function ke(s,t){let e,n=null;if(Array.isArray(t)){const i=function(a){if(o.isHexString(a,32))return a;const c=s.interface.getEvent(a);return o.assertArgument(c,"unknown fragment","name",a),c.topicHash};e=t.map(a=>a==null?null:Array.isArray(a)?a.map(i):i(a))}else t==="*"?e=[null]:typeof t=="string"?o.isHexString(t,32)?e=[t]:(n=s.interface.getEvent(t),o.assertArgument(n,"unknown fragment","event",t),e=[n.topicHash]):Br(t)?e=await t.getTopicFilter():"fragment"in t?(n=t.fragment,e=[n.topicHash]):o.assertArgument(!1,"unknown event name","event",t);e=e.map(i=>{if(i==null)return null;if(Array.isArray(i)){const a=Array.from(new Set(i.map(c=>c.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return i.toLowerCase()});const r=e.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:n,tag:r,topics:e}}async function $t(s,t){const{subs:e}=$(s);return e.get((await ke(s,t)).tag)||null}async function qe(s,t,e){const n=gt(s.runner);o.assert(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:r,tag:i,topics:a}=await ke(s,e),{addr:c,subs:u}=$(s);let f=u.get(i);if(!f){const p={address:c||s,topics:a},g=O=>{let P=r;if(P==null)try{P=s.interface.getEvent(O.topics[0])}catch{}if(P){const D=P,ht=r?s.interface.decodeEventLog(r,O.data,O.topics):[];xe(s,e,ht,Sn=>new Or(s,Sn,e,D,O))}else xe(s,e,[],D=>new On(s,D,e,O))};let y=[];f={tag:i,listeners:[],start:()=>{y.length||y.push(n.on(p,g))},stop:async()=>{if(y.length==0)return;let O=y;y=[],await Promise.all(O),n.off(p,g)}},u.set(i,f)}return f}let Ee=Promise.resolve();async function Sr(s,t,e,n){await Ee;const r=await $t(s,t);if(!r)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:c})=>{const u=Array.from(e);n&&u.push(n(c?null:a));try{a.call(s,...u)}catch{}return!c}),r.listeners.length===0&&(r.stop(),$(s).subs.delete(r.tag)),i>0}async function xe(s,t,e,n){try{await Ee}catch{}const r=Sr(s,t,e,n);return Ee=r,await r}const Zt=["then"];var je;je=ne;const Gt=class Gt{constructor(t,e,n,r){l(this,"target");l(this,"interface");l(this,"runner");l(this,"filters");l(this,je);l(this,"fallback");o.assertArgument(typeof t=="string"||o.isAddressable(t),"invalid value for Contract target","target",t),n==null&&(n=null);const i=ee.from(e);o.defineProperties(this,{target:t,runner:n,interface:i}),Object.defineProperty(this,ne,{value:{}});let a,c=null,u=null;if(r){const p=gt(n);u=new Te(this.interface,p,r)}let f=new Map;if(typeof t=="string")if(o.isHexString(t))c=t,a=Promise.resolve(t);else{const p=At(n,"resolveName");if(!le(p))throw o.makeError("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=p.resolveName(t).then(g=>{if(g==null)throw o.makeError("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:t});return $(this).addr=g,g})}else a=t.getAddress().then(p=>{if(p==null)throw new Error("TODO");return $(this).addr=p,p});Ur(this,{addrPromise:a,addr:c,deployTx:u,subs:f});const h=new Proxy({},{get:(p,g,y)=>{if(typeof g=="symbol"||Zt.indexOf(g)>=0)return Reflect.get(p,g,y);try{return this.getEvent(g)}catch(b){if(!o.isError(b,"INVALID_ARGUMENT")||b.argument!=="key")throw b}},has:(p,g)=>Zt.indexOf(g)>=0?Reflect.has(p,g):Reflect.has(p,g)||this.interface.hasEvent(String(g))});return o.defineProperties(this,{filters:h}),o.defineProperties(this,{fallback:i.receive||i.fallback?Rr(this):null}),new Proxy(this,{get:(p,g,y)=>{if(typeof g=="symbol"||g in p||Zt.indexOf(g)>=0)return Reflect.get(p,g,y);try{return p.getFunction(g)}catch(b){if(!o.isError(b,"INVALID_ARGUMENT")||b.argument!=="key")throw b}},has:(p,g)=>typeof g=="symbol"||g in p||Zt.indexOf(g)>=0?Reflect.has(p,g):p.interface.hasFunction(g)})}connect(t){return new Gt(this.target,this.interface,t)}attach(t){return new Gt(t,this.interface,this.runner)}async getAddress(){return await $(this).addrPromise}async getDeployedCode(){const t=gt(this.runner);o.assert(t,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const e=await t.getCode(await this.getAddress());return e==="0x"?null:e}async waitForDeployment(){const t=this.deploymentTransaction();if(t)return await t.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=gt(this.runner);return o.assert(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((r,i)=>{const a=async()=>{try{if(await this.getDeployedCode()!=null)return r(this);n.once("block",a)}catch(c){i(c)}};a()})}deploymentTransaction(){return $(this).deployTx}getFunction(t){return typeof t!="string"&&(t=t.format()),kr(this,t)}getEvent(t){return typeof t!="string"&&(t=t.format()),Ir(this,t)}async queryTransaction(t){throw new Error("@TODO")}async queryFilter(t,e,n){e==null&&(e=0),n==null&&(n="latest");const{addr:r,addrPromise:i}=$(this),a=r||await i,{fragment:c,topics:u}=await ke(this,t),f={address:a,topics:u,fromBlock:e,toBlock:n},h=gt(this.runner);return o.assert(h,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await h.getLogs(f)).map(p=>{let g=c;if(g==null)try{g=this.interface.getEvent(p.topics[0])}catch{}if(g)try{return new Oe(p,this.interface,g)}catch(y){return new vn(p,y)}return new Wt(p,h)})}async on(t,e){const n=await qe(this,"on",t);return n.listeners.push({listener:e,once:!1}),n.start(),this}async once(t,e){const n=await qe(this,"once",t);return n.listeners.push({listener:e,once:!0}),n.start(),this}async emit(t,...e){return await xe(this,t,e,null)}async listenerCount(t){if(t){const r=await $t(this,t);return r?r.listeners.length:0}const{subs:e}=$(this);let n=0;for(const{listeners:r}of e.values())n+=r.length;return n}async listeners(t){if(t){const r=await $t(this,t);return r?r.listeners.map(({listener:i})=>i):[]}const{subs:e}=$(this);let n=[];for(const{listeners:r}of e.values())n=n.concat(r.map(({listener:i})=>i));return n}async off(t,e){const n=await $t(this,t);if(!n)return this;if(e){const r=n.listeners.map(({listener:i})=>i).indexOf(e);r>=0&&n.listeners.splice(r,1)}return(e==null||n.listeners.length===0)&&(n.stop(),$(this).subs.delete(n.tag)),this}async removeAllListeners(t){if(t){const e=await $t(this,t);if(!e)return this;e.stop(),$(this).subs.delete(e.tag)}else{const{subs:e}=$(this);for(const{tag:n,stop:r}of e.values())r(),e.delete(n)}return this}async addListener(t,e){return await this.on(t,e)}async removeListener(t,e){return await this.off(t,e)}static buildClass(t){class e extends Gt{constructor(r,i=null){super(r,t,i)}}return e}static from(t,e,n){return n==null&&(n=null),new this(t,e,n)}};let re=Gt;function Cr(){return re}class Fr extends Cr(){}exports.AbiCoder=Vt;exports.BaseContract=re;exports.Block=Pr;exports.Contract=Fr;exports.EventPayload=nn;exports.FeeData=xr;exports.Interface=ee;exports.Log=Wt;exports.TransactionReceipt=Pn;exports.TransactionResponse=Mt;exports.accessListify=fn;exports.copyOverrides=Re;exports.copyRequest=xn;exports.fromTwos=tn;exports.getBigInt=at;exports.getNumber=Q;exports.id=Ft;exports.mask=Dt;exports.resolveArgs=Un;exports.toBeArray=Ne;exports.toBeHex=Ae;exports.toBigInt=Pe;exports.toQuantity=Dn;exports.toTwos=en;exports.toUtf8Bytes=ve;exports.toUtf8String=sn;
|