@wormhole-foundation/wormhole-connect 1.0.0-beta.1-development → 1.0.0-beta.4-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/{ccip-DqoMCvgC.js → ccip-Dn5z57Cx.js} +1 -1
- package/dist/assets/{evm-B97OP4_W.js → evm-Ci-t-8ei.js} +4 -4
- package/dist/assets/{index-B4nwQysh.js → index-Da59NFoY.js} +1 -1
- package/dist/assets/{index-B3CIvGYj.js → index-DlyJ6Tua.js} +2 -2
- package/dist/assets/{index-CUWn-lgC.js → index-yInQCZK6.js} +1 -1
- package/dist/assets/{index.es-DMMEjdkD.js → index.es-DUffrgf3.js} +2 -2
- package/dist/main.js +115 -68
- package/dist/src/components/v2/Button.d.ts +1 -1
- package/dist/src/components/v2/Button.d.ts.map +1 -1
- package/dist/src/config/index.d.ts.map +1 -1
- package/dist/src/config/types.d.ts +17 -11
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/config/ui.d.ts +1 -0
- package/dist/src/config/ui.d.ts.map +1 -1
- package/dist/src/hooks/useAmountValidation.d.ts +1 -0
- package/dist/src/hooks/useAmountValidation.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistory.d.ts +1 -1
- package/dist/src/hooks/useTransactionHistory.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
- package/dist/src/icons/PoweredBy.d.ts.map +1 -1
- package/dist/src/icons/Tokens/KLAY.d.ts.map +1 -1
- package/dist/src/icons/TxReadyForClaim.d.ts +5 -0
- package/dist/src/icons/TxReadyForClaim.d.ts.map +1 -0
- package/dist/src/routes/sdkv2/route.d.ts.map +1 -1
- package/dist/src/store/index.d.ts +0 -2
- package/dist/src/store/index.d.ts.map +1 -1
- package/dist/src/store/transferInput.d.ts +1 -3
- package/dist/src/store/transferInput.d.ts.map +1 -1
- package/dist/src/telemetry/index.d.ts +6 -1
- package/dist/src/telemetry/index.d.ts.map +1 -1
- package/dist/src/utils/errors.d.ts.map +1 -1
- package/dist/src/utils/inProgressTxCache.d.ts +5 -0
- package/dist/src/utils/inProgressTxCache.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/polling.d.ts +5 -0
- package/dist/src/utils/polling.d.ts.map +1 -0
- package/dist/src/utils/sdkv2.d.ts +3 -2
- package/dist/src/utils/sdkv2.d.ts.map +1 -1
- package/dist/src/utils/style.d.ts +1 -0
- package/dist/src/utils/style.d.ts.map +1 -1
- package/dist/src/utils/wallet/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AssetPicker/ChainList.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AssetPicker/SearchableList/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/ReviewTransaction/SendError.d.ts +8 -0
- package/dist/src/views/v2/Bridge/ReviewTransaction/SendError.d.ts.map +1 -0
- package/dist/src/views/v2/Bridge/ReviewTransaction/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/Routes/index.d.ts +1 -1
- package/dist/src/views/v2/Bridge/Routes/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/index.d.ts.map +1 -1
- package/dist/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/dist/src/views/v2/Redeem/index.d.ts.map +1 -1
- package/dist/src/views/v2/TxHistory/Widget/Item.d.ts +8 -0
- package/dist/src/views/v2/TxHistory/Widget/Item.d.ts.map +1 -0
- package/dist/src/views/v2/TxHistory/Widget/index.d.ts +4 -0
- package/dist/src/views/v2/TxHistory/Widget/index.d.ts.map +1 -0
- package/dist/src/views/v2/TxHistory/index.d.ts.map +1 -1
- package/lib/{algorand-D-BdPUAb.mjs → algorand-B9ai7AKk.mjs} +3 -3
- package/lib/{algorand-BgrZh6rH.js → algorand-BZfir-Gt.js} +1 -1
- package/lib/{aptos-CmpYdVuv.mjs → aptos-BiWZASIH.mjs} +3 -3
- package/lib/{aptos-CATrqTpB.js → aptos-CX7jOv1y.js} +1 -1
- package/lib/{aptos-CA8QZDqZ.js → aptos-D_w5IEUK.js} +2 -2
- package/lib/{aptos-CeHwTLqC.mjs → aptos-ZpPdNMHJ.mjs} +1 -1
- package/lib/{ccip-B-v_m1LK.js → ccip-CLMQ2RsP.js} +1 -1
- package/lib/{ccip-BMQmQT67.mjs → ccip-lVzudYcQ.mjs} +1 -1
- package/lib/{cosmos-ksRGnYO-.js → cosmos-6rjmrhY_.js} +1 -1
- package/lib/{cosmos-Bh-ZHBp5.mjs → cosmos-B3YMB-qs.mjs} +6 -6
- package/lib/{cosmwasm-o9pLVX_k.js → cosmwasm-DMVssDjU.js} +2 -2
- package/lib/{cosmwasm-C-wFDXoO.mjs → cosmwasm-SnVdtN68.mjs} +7 -7
- package/lib/{events-BWa5Dt3J.mjs → events-pgsgrP1S.mjs} +1 -1
- package/lib/{events-DPgA7TqX.js → events-t6i_QSEn.js} +1 -1
- package/lib/{evm-SljAss8Z.mjs → evm-Bd3DzKCY.mjs} +7 -7
- package/lib/{evm-Bo__7sSE.js → evm-D7GRIPdg.js} +4 -4
- package/lib/{evm-DDtxPajQ.js → evm-DFJuxSg1.js} +1 -1
- package/lib/{evm-BD__DIo1.mjs → evm-DiQodX72.mjs} +5 -5
- package/lib/{index-Cpxx41dy.js → index-048e7Uvl.js} +1 -1
- package/lib/{index-CvuTcJSI.mjs → index-0QJFchou.mjs} +2 -2
- package/lib/{index-3mar0UQr.mjs → index-0YCaekiF.mjs} +2 -2
- package/lib/{index-D2Tw2fd0.js → index-2LZtNZ5P.js} +1 -1
- package/lib/{index-BD0yz6tu.js → index-B2aC_g_3.js} +1 -1
- package/lib/{index-Bm-ooA-8.js → index-B5TmFc4M.js} +1 -1
- package/lib/{index-CjlxucQW.mjs → index-B64jLBfI.mjs} +2 -2
- package/lib/{index-w4I6zC7D.js → index-BAqClXT6.js} +1 -1
- package/lib/{index-CFxkimTS.mjs → index-BT7_dDgl.mjs} +3 -3
- package/lib/{index-B5qZWsrJ.mjs → index-BYv5Tbwe.mjs} +1 -1
- package/lib/{index-DrMU1dLJ.js → index-BZ7LatAr.js} +131 -83
- package/lib/{index-Cm3OT3uK.js → index-B_FxM4qi.js} +1 -1
- package/lib/{index-DPrVdTMi.mjs → index-BcbPoWss.mjs} +3 -3
- package/lib/{index-DnW_8WuE.mjs → index-Bd6ExIDW.mjs} +4 -4
- package/lib/{index-BrNN7bqh.mjs → index-BhrO8yNx.mjs} +2 -2
- package/lib/{index-CRvWgES1.js → index-BjpzXqrL.js} +1 -1
- package/lib/{index-BNk2jOXm.js → index-BkyCouQJ.js} +1 -1
- package/lib/{index-BU0JH9mJ.mjs → index-C4NKqUWK.mjs} +1 -1
- package/lib/{index-xkiQhLtp.mjs → index-C9xfXphF.mjs} +2 -2
- package/lib/{index-DFUaa0TE.js → index-CE4mRmPN.js} +1 -1
- package/lib/{index-BQQ1YCDk.js → index-CFVJznfe.js} +1 -1
- package/lib/{index-ma17SOHh.js → index-C_JBf5AE.js} +1 -1
- package/lib/{index-B-MBhpe0.js → index-CcKxlhe-.js} +1 -1
- package/lib/{index-BA87Paw9.mjs → index-CdFX-OBR.mjs} +4 -4
- package/lib/{index-Ddkg7QVK.mjs → index-CkyGUP8I.mjs} +2 -2
- package/lib/{index-W02R6fpy.js → index-Cl110Yt1.js} +1 -1
- package/lib/{index-BYj4cYE2.mjs → index-CpM8O4af.mjs} +4 -4
- package/lib/{index-ZhtSUjN2.js → index-CvRFH7pa.js} +1 -1
- package/lib/{index-CdREPuOV.js → index-D4-zCm-j.js} +1 -1
- package/lib/{index-BslyDK6y.mjs → index-DG5KwGj7.mjs} +3 -3
- package/lib/{index-BJlBMw-S.mjs → index-DJgWkkqj.mjs} +2 -2
- package/lib/{index-C7jTj2To.js → index-DLXjX60f.js} +1 -1
- package/lib/{index-7CTgJQOQ.mjs → index-DPq8nS1b.mjs} +1 -1
- package/lib/{index-B-J7cTiK.mjs → index-DUn9bDrk.mjs} +2 -2
- package/lib/{index-CVizGyR3.mjs → index-DVnPDtFx.mjs} +1 -1
- package/lib/{index-CihYnnL-.js → index-DWmEAYa2.js} +1 -1
- package/lib/{index-wz3LbIKe.mjs → index-DZbeM9gY.mjs} +2 -2
- package/lib/{index-C9ExQapt.js → index-Dk2OkATw.js} +1 -1
- package/lib/{index-CQz5TuuG.js → index-DllSkb9h.js} +1 -1
- package/lib/{index-D2X6frcJ.js → index-EPcXyhD3.js} +1 -1
- package/lib/{index-LRaD5GwM.mjs → index-EhUlCH18.mjs} +7724 -7078
- package/lib/{index-CGWI5MkA.js → index-QqzqKjF9.js} +1 -1
- package/lib/{index-CI4Wimyz.js → index-VI9qDjx0.js} +1 -1
- package/lib/{index-ByFmI7fl.mjs → index-bpVbPzFG.mjs} +1 -1
- package/lib/{index-C9d-aAW8.mjs → index-fD6yeQDw.mjs} +7 -7
- package/lib/{index-PaF1hgt3.mjs → index-fPs98C_X.mjs} +2 -2
- package/lib/{index-pZcxlLhg.mjs → index-hiGmsL0b.mjs} +1 -1
- package/lib/{index-Bvy2urku.js → index-mAuqp4GD.js} +1 -1
- package/lib/{index.es-CKfzoruR.mjs → index.es-B4wQLKJO.mjs} +5 -5
- package/lib/{index.es-tANmFq-b.js → index.es-WCp4WrVw.js} +2 -2
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{libsodium-wrappers-BUvbW9gF.js → libsodium-wrappers-BdZeVEOK.js} +1 -1
- package/lib/{libsodium-wrappers-2v8zIqd0.mjs → libsodium-wrappers-DnY3rBzj.mjs} +1 -1
- package/lib/{pako.esm-BYIheyHK.js → pako.esm-CpOVp0Fg.js} +1 -1
- package/lib/{pako.esm-BMyUH3EC.mjs → pako.esm-doGHPq3v.mjs} +3 -3
- package/lib/{pbkdf2-Cs0L5Yy1.mjs → pbkdf2-CR1mMO6P.mjs} +1 -1
- package/lib/{pbkdf2-UD0Tc_gW.js → pbkdf2-DRrUaAek.js} +1 -1
- package/lib/{sei-SvEHSilI.js → sei-BHskcl2R.js} +1 -1
- package/lib/{sei-xJVzoq-b.mjs → sei-ReMraEM4.mjs} +4 -4
- package/lib/{signer-BxofHac_.mjs → signer-BwkEV8NR.mjs} +1 -1
- package/lib/{signer-DXjyd0up.js → signer-C5udfQih.js} +1 -1
- package/lib/{solana-ySRMXxyQ.js → solana-BWRzXH9-.js} +1 -1
- package/lib/solana-ci1dqiv5.mjs +16 -0
- package/lib/solana-gFEm46ZS.js +1 -0
- package/lib/{solana-DcACAvjT.mjs → solana-kr2Et-_M.mjs} +4 -4
- package/lib/{solanaEmbed.esm-Df1M0bDZ.js → solanaEmbed.esm-8hegnauD.js} +1 -1
- package/lib/{solanaEmbed.esm-DBTvwrFj.mjs → solanaEmbed.esm-HLygiesN.mjs} +4 -4
- package/lib/src/components/v2/Button.d.ts +1 -1
- package/lib/src/components/v2/Button.d.ts.map +1 -1
- package/lib/src/config/index.d.ts.map +1 -1
- package/lib/src/config/types.d.ts +17 -11
- package/lib/src/config/types.d.ts.map +1 -1
- package/lib/src/config/ui.d.ts +1 -0
- package/lib/src/config/ui.d.ts.map +1 -1
- package/lib/src/hooks/useAmountValidation.d.ts +1 -0
- package/lib/src/hooks/useAmountValidation.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistory.d.ts +1 -1
- package/lib/src/hooks/useTransactionHistory.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
- package/lib/src/icons/PoweredBy.d.ts.map +1 -1
- package/lib/src/icons/Tokens/KLAY.d.ts.map +1 -1
- package/lib/src/icons/TxReadyForClaim.d.ts +5 -0
- package/lib/src/icons/TxReadyForClaim.d.ts.map +1 -0
- package/lib/src/routes/sdkv2/route.d.ts.map +1 -1
- package/lib/src/store/index.d.ts +0 -2
- package/lib/src/store/index.d.ts.map +1 -1
- package/lib/src/store/transferInput.d.ts +1 -3
- package/lib/src/store/transferInput.d.ts.map +1 -1
- package/lib/src/telemetry/index.d.ts +6 -1
- package/lib/src/telemetry/index.d.ts.map +1 -1
- package/lib/src/utils/errors.d.ts.map +1 -1
- package/lib/src/utils/inProgressTxCache.d.ts +5 -0
- package/lib/src/utils/inProgressTxCache.d.ts.map +1 -0
- package/lib/src/utils/index.d.ts +2 -0
- package/lib/src/utils/index.d.ts.map +1 -1
- package/lib/src/utils/polling.d.ts +5 -0
- package/lib/src/utils/polling.d.ts.map +1 -0
- package/lib/src/utils/sdkv2.d.ts +3 -2
- package/lib/src/utils/sdkv2.d.ts.map +1 -1
- package/lib/src/utils/style.d.ts +1 -0
- package/lib/src/utils/style.d.ts.map +1 -1
- package/lib/src/utils/wallet/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AssetPicker/ChainList.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AssetPicker/SearchableList/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/ReviewTransaction/SendError.d.ts +8 -0
- package/lib/src/views/v2/Bridge/ReviewTransaction/SendError.d.ts.map +1 -0
- package/lib/src/views/v2/Bridge/ReviewTransaction/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/Routes/index.d.ts +1 -1
- package/lib/src/views/v2/Bridge/Routes/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/index.d.ts.map +1 -1
- package/lib/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/lib/src/views/v2/Redeem/index.d.ts.map +1 -1
- package/lib/src/views/v2/TxHistory/Widget/Item.d.ts +8 -0
- package/lib/src/views/v2/TxHistory/Widget/Item.d.ts.map +1 -0
- package/lib/src/views/v2/TxHistory/Widget/index.d.ts +4 -0
- package/lib/src/views/v2/TxHistory/Widget/index.d.ts.map +1 -0
- package/lib/src/views/v2/TxHistory/index.d.ts.map +1 -1
- package/lib/{sui-8gf1B7bO.mjs → sui-B6XCpe1d.mjs} +1 -1
- package/lib/{sui-Cke2TbcJ.js → sui-BWRqoTdl.js} +2 -2
- package/lib/{sui-BnN9t4QC.js → sui-BocrppL0.js} +1 -1
- package/lib/{sui-Cyoug3Go.mjs → sui-BuZPAcI0.mjs} +4 -4
- package/lib/{unsignedTransaction-eEgPAqvi.js → unsignedTransaction-DSuqsGgb.js} +1 -1
- package/lib/{unsignedTransaction-BxebONkK.mjs → unsignedTransaction-oXk8lD5s.mjs} +2 -2
- package/lib/{utils-BvaOEETp.js → utils-SML27G4C.js} +1 -1
- package/lib/{utils-CpUQ2GWl.mjs → utils-fI-uXUZk.mjs} +2 -2
- package/package.json +3 -3
- package/dist/src/components/ChainsModal.d.ts +0 -19
- package/dist/src/components/ChainsModal.d.ts.map +0 -1
- package/dist/src/components/ConnectWallet.d.ts +0 -11
- package/dist/src/components/ConnectWallet.d.ts.map +0 -1
- package/dist/src/components/Input.d.ts +0 -8
- package/dist/src/components/Input.d.ts.map +0 -1
- package/dist/src/components/InputContainer.d.ts +0 -11
- package/dist/src/components/InputContainer.d.ts.map +0 -1
- package/dist/src/components/Menu.d.ts +0 -3
- package/dist/src/components/Menu.d.ts.map +0 -1
- package/dist/src/components/Options.d.ts +0 -16
- package/dist/src/components/Options.d.ts.map +0 -1
- package/dist/src/components/Price.d.ts +0 -8
- package/dist/src/components/Price.d.ts.map +0 -1
- package/dist/src/components/RenderRows.d.ts +0 -9
- package/dist/src/components/RenderRows.d.ts.map +0 -1
- package/dist/src/components/Scroll.d.ts +0 -9
- package/dist/src/components/Scroll.d.ts.map +0 -1
- package/dist/src/components/Stepper/Stepper.d.ts +0 -14
- package/dist/src/components/Stepper/Stepper.d.ts.map +0 -1
- package/dist/src/components/Stepper/StepperContent.d.ts +0 -11
- package/dist/src/components/Stepper/StepperContent.d.ts.map +0 -1
- package/dist/src/components/Stepper/StepperLabel.d.ts +0 -11
- package/dist/src/components/Stepper/StepperLabel.d.ts.map +0 -1
- package/dist/src/components/Tabs.d.ts +0 -10
- package/dist/src/components/Tabs.d.ts.map +0 -1
- package/dist/src/components/TokensModal.d.ts +0 -13
- package/dist/src/components/TokensModal.d.ts.map +0 -1
- package/dist/src/components/Tooltip.d.ts +0 -9
- package/dist/src/components/Tooltip.d.ts.map +0 -1
- package/dist/src/hooks/useComputeReceiverNativeBalance.d.ts +0 -10
- package/dist/src/hooks/useComputeReceiverNativeBalance.d.ts.map +0 -1
- package/dist/src/routes/porticoBridge/utils.d.ts +0 -3
- package/dist/src/routes/porticoBridge/utils.d.ts.map +0 -1
- package/dist/src/routes/relay/index.d.ts +0 -2
- package/dist/src/routes/relay/index.d.ts.map +0 -1
- package/dist/src/routes/relay/types.d.ts +0 -14
- package/dist/src/routes/relay/types.d.ts.map +0 -1
- package/dist/src/store/porticoBridge.d.ts +0 -26
- package/dist/src/store/porticoBridge.d.ts.map +0 -1
- package/dist/src/views/Bridge/Bridge.d.ts +0 -4
- package/dist/src/views/Bridge/Bridge.d.ts.map +0 -1
- package/dist/src/views/Bridge/ChainTile.d.ts +0 -11
- package/dist/src/views/Bridge/ChainTile.d.ts.map +0 -1
- package/dist/src/views/Bridge/Collapse.d.ts +0 -22
- package/dist/src/views/Bridge/Collapse.d.ts.map +0 -1
- package/dist/src/views/Bridge/Inputs/AmountInput.d.ts +0 -12
- package/dist/src/views/Bridge/Inputs/AmountInput.d.ts.map +0 -1
- package/dist/src/views/Bridge/Inputs/From.d.ts +0 -4
- package/dist/src/views/Bridge/Inputs/From.d.ts.map +0 -1
- package/dist/src/views/Bridge/Inputs/Input.d.ts +0 -13
- package/dist/src/views/Bridge/Inputs/Input.d.ts.map +0 -1
- package/dist/src/views/Bridge/Inputs/Inputs.d.ts +0 -23
- package/dist/src/views/Bridge/Inputs/Inputs.d.ts.map +0 -1
- package/dist/src/views/Bridge/Inputs/Select.d.ts +0 -19
- package/dist/src/views/Bridge/Inputs/Select.d.ts.map +0 -1
- package/dist/src/views/Bridge/Inputs/To.d.ts +0 -4
- package/dist/src/views/Bridge/Inputs/To.d.ts.map +0 -1
- package/dist/src/views/Bridge/Inputs/TokenWarnings.d.ts +0 -8
- package/dist/src/views/Bridge/Inputs/TokenWarnings.d.ts.map +0 -1
- package/dist/src/views/Bridge/NativeGasSlider.d.ts +0 -6
- package/dist/src/views/Bridge/NativeGasSlider.d.ts.map +0 -1
- package/dist/src/views/Bridge/Preview.d.ts +0 -6
- package/dist/src/views/Bridge/Preview.d.ts.map +0 -1
- package/dist/src/views/Bridge/RouteOptions.d.ts +0 -9
- package/dist/src/views/Bridge/RouteOptions.d.ts.map +0 -1
- package/dist/src/views/Bridge/Send.d.ts +0 -6
- package/dist/src/views/Bridge/Send.d.ts.map +0 -1
- package/dist/src/views/Bridge/SwapChains.d.ts +0 -4
- package/dist/src/views/Bridge/SwapChains.d.ts.map +0 -1
- package/dist/src/views/Bridge/ValidationError.d.ts +0 -10
- package/dist/src/views/Bridge/ValidationError.d.ts.map +0 -1
- package/dist/src/views/Redeem/AddToWallet.d.ts +0 -4
- package/dist/src/views/Redeem/AddToWallet.d.ts.map +0 -1
- package/dist/src/views/Redeem/BridgeComplete.d.ts +0 -4
- package/dist/src/views/Redeem/BridgeComplete.d.ts.map +0 -1
- package/dist/src/views/Redeem/Confirmations.d.ts +0 -9
- package/dist/src/views/Redeem/Confirmations.d.ts.map +0 -1
- package/dist/src/views/Redeem/DestinationQueued.d.ts +0 -4
- package/dist/src/views/Redeem/DestinationQueued.d.ts.map +0 -1
- package/dist/src/views/Redeem/ExplorerLink.d.ts +0 -20
- package/dist/src/views/Redeem/ExplorerLink.d.ts.map +0 -1
- package/dist/src/views/Redeem/Header.d.ts +0 -14
- package/dist/src/views/Redeem/Header.d.ts.map +0 -1
- package/dist/src/views/Redeem/Redeem.d.ts +0 -18
- package/dist/src/views/Redeem/Redeem.d.ts.map +0 -1
- package/dist/src/views/Redeem/RelayerDeliveryFailed.d.ts +0 -4
- package/dist/src/views/Redeem/RelayerDeliveryFailed.d.ts.map +0 -1
- package/dist/src/views/Redeem/SendFrom.d.ts +0 -4
- package/dist/src/views/Redeem/SendFrom.d.ts.map +0 -1
- package/dist/src/views/Redeem/SendTo.d.ts +0 -4
- package/dist/src/views/Redeem/SendTo.d.ts.map +0 -1
- package/dist/src/views/Redeem/Stepper.d.ts +0 -3
- package/dist/src/views/Redeem/Stepper.d.ts.map +0 -1
- package/dist/src/views/Redeem/SwitchToManualClaim.d.ts +0 -9
- package/dist/src/views/Redeem/SwitchToManualClaim.d.ts.map +0 -1
- package/dist/src/views/Redeem/Tag.d.ts +0 -4
- package/dist/src/views/Redeem/Tag.d.ts.map +0 -1
- package/dist/src/views/WalletModal.d.ts +0 -11
- package/dist/src/views/WalletModal.d.ts.map +0 -1
- package/lib/solana-B82b4Mp_.js +0 -1
- package/lib/solana-BureHx9-.mjs +0 -16
- package/lib/src/components/ChainsModal.d.ts +0 -19
- package/lib/src/components/ChainsModal.d.ts.map +0 -1
- package/lib/src/components/ConnectWallet.d.ts +0 -11
- package/lib/src/components/ConnectWallet.d.ts.map +0 -1
- package/lib/src/components/Input.d.ts +0 -8
- package/lib/src/components/Input.d.ts.map +0 -1
- package/lib/src/components/InputContainer.d.ts +0 -11
- package/lib/src/components/InputContainer.d.ts.map +0 -1
- package/lib/src/components/Menu.d.ts +0 -3
- package/lib/src/components/Menu.d.ts.map +0 -1
- package/lib/src/components/Options.d.ts +0 -16
- package/lib/src/components/Options.d.ts.map +0 -1
- package/lib/src/components/Price.d.ts +0 -8
- package/lib/src/components/Price.d.ts.map +0 -1
- package/lib/src/components/RenderRows.d.ts +0 -9
- package/lib/src/components/RenderRows.d.ts.map +0 -1
- package/lib/src/components/Scroll.d.ts +0 -9
- package/lib/src/components/Scroll.d.ts.map +0 -1
- package/lib/src/components/Stepper/Stepper.d.ts +0 -14
- package/lib/src/components/Stepper/Stepper.d.ts.map +0 -1
- package/lib/src/components/Stepper/StepperContent.d.ts +0 -11
- package/lib/src/components/Stepper/StepperContent.d.ts.map +0 -1
- package/lib/src/components/Stepper/StepperLabel.d.ts +0 -11
- package/lib/src/components/Stepper/StepperLabel.d.ts.map +0 -1
- package/lib/src/components/Tabs.d.ts +0 -10
- package/lib/src/components/Tabs.d.ts.map +0 -1
- package/lib/src/components/TokensModal.d.ts +0 -13
- package/lib/src/components/TokensModal.d.ts.map +0 -1
- package/lib/src/components/Tooltip.d.ts +0 -9
- package/lib/src/components/Tooltip.d.ts.map +0 -1
- package/lib/src/hooks/useComputeReceiverNativeBalance.d.ts +0 -10
- package/lib/src/hooks/useComputeReceiverNativeBalance.d.ts.map +0 -1
- package/lib/src/routes/porticoBridge/utils.d.ts +0 -3
- package/lib/src/routes/porticoBridge/utils.d.ts.map +0 -1
- package/lib/src/routes/relay/index.d.ts +0 -2
- package/lib/src/routes/relay/index.d.ts.map +0 -1
- package/lib/src/routes/relay/types.d.ts +0 -14
- package/lib/src/routes/relay/types.d.ts.map +0 -1
- package/lib/src/store/porticoBridge.d.ts +0 -26
- package/lib/src/store/porticoBridge.d.ts.map +0 -1
- package/lib/src/views/Bridge/Bridge.d.ts +0 -4
- package/lib/src/views/Bridge/Bridge.d.ts.map +0 -1
- package/lib/src/views/Bridge/ChainTile.d.ts +0 -11
- package/lib/src/views/Bridge/ChainTile.d.ts.map +0 -1
- package/lib/src/views/Bridge/Collapse.d.ts +0 -22
- package/lib/src/views/Bridge/Collapse.d.ts.map +0 -1
- package/lib/src/views/Bridge/Inputs/AmountInput.d.ts +0 -12
- package/lib/src/views/Bridge/Inputs/AmountInput.d.ts.map +0 -1
- package/lib/src/views/Bridge/Inputs/From.d.ts +0 -4
- package/lib/src/views/Bridge/Inputs/From.d.ts.map +0 -1
- package/lib/src/views/Bridge/Inputs/Input.d.ts +0 -13
- package/lib/src/views/Bridge/Inputs/Input.d.ts.map +0 -1
- package/lib/src/views/Bridge/Inputs/Inputs.d.ts +0 -23
- package/lib/src/views/Bridge/Inputs/Inputs.d.ts.map +0 -1
- package/lib/src/views/Bridge/Inputs/Select.d.ts +0 -19
- package/lib/src/views/Bridge/Inputs/Select.d.ts.map +0 -1
- package/lib/src/views/Bridge/Inputs/To.d.ts +0 -4
- package/lib/src/views/Bridge/Inputs/To.d.ts.map +0 -1
- package/lib/src/views/Bridge/Inputs/TokenWarnings.d.ts +0 -8
- package/lib/src/views/Bridge/Inputs/TokenWarnings.d.ts.map +0 -1
- package/lib/src/views/Bridge/NativeGasSlider.d.ts +0 -6
- package/lib/src/views/Bridge/NativeGasSlider.d.ts.map +0 -1
- package/lib/src/views/Bridge/Preview.d.ts +0 -6
- package/lib/src/views/Bridge/Preview.d.ts.map +0 -1
- package/lib/src/views/Bridge/RouteOptions.d.ts +0 -9
- package/lib/src/views/Bridge/RouteOptions.d.ts.map +0 -1
- package/lib/src/views/Bridge/Send.d.ts +0 -6
- package/lib/src/views/Bridge/Send.d.ts.map +0 -1
- package/lib/src/views/Bridge/SwapChains.d.ts +0 -4
- package/lib/src/views/Bridge/SwapChains.d.ts.map +0 -1
- package/lib/src/views/Bridge/ValidationError.d.ts +0 -10
- package/lib/src/views/Bridge/ValidationError.d.ts.map +0 -1
- package/lib/src/views/Redeem/AddToWallet.d.ts +0 -4
- package/lib/src/views/Redeem/AddToWallet.d.ts.map +0 -1
- package/lib/src/views/Redeem/BridgeComplete.d.ts +0 -4
- package/lib/src/views/Redeem/BridgeComplete.d.ts.map +0 -1
- package/lib/src/views/Redeem/Confirmations.d.ts +0 -9
- package/lib/src/views/Redeem/Confirmations.d.ts.map +0 -1
- package/lib/src/views/Redeem/DestinationQueued.d.ts +0 -4
- package/lib/src/views/Redeem/DestinationQueued.d.ts.map +0 -1
- package/lib/src/views/Redeem/ExplorerLink.d.ts +0 -20
- package/lib/src/views/Redeem/ExplorerLink.d.ts.map +0 -1
- package/lib/src/views/Redeem/Header.d.ts +0 -14
- package/lib/src/views/Redeem/Header.d.ts.map +0 -1
- package/lib/src/views/Redeem/Redeem.d.ts +0 -18
- package/lib/src/views/Redeem/Redeem.d.ts.map +0 -1
- package/lib/src/views/Redeem/RelayerDeliveryFailed.d.ts +0 -4
- package/lib/src/views/Redeem/RelayerDeliveryFailed.d.ts.map +0 -1
- package/lib/src/views/Redeem/SendFrom.d.ts +0 -4
- package/lib/src/views/Redeem/SendFrom.d.ts.map +0 -1
- package/lib/src/views/Redeem/SendTo.d.ts +0 -4
- package/lib/src/views/Redeem/SendTo.d.ts.map +0 -1
- package/lib/src/views/Redeem/Stepper.d.ts +0 -3
- package/lib/src/views/Redeem/Stepper.d.ts.map +0 -1
- package/lib/src/views/Redeem/SwitchToManualClaim.d.ts +0 -9
- package/lib/src/views/Redeem/SwitchToManualClaim.d.ts.map +0 -1
- package/lib/src/views/Redeem/Tag.d.ts +0 -4
- package/lib/src/views/Redeem/Tag.d.ts.map +0 -1
- package/lib/src/views/WalletModal.d.ts +0 -11
- package/lib/src/views/WalletModal.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ge=require("./events-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ge=require("./events-t6i_QSEn.js"),ie=require("./index-BZ7LatAr.js"),D=require("./index-DWmEAYa2.js"),N=require("./index-Cl110Yt1.js");var qv={};(function(a){const t=D.strictUriEncode,r=D.decodeUriComponent,s=D.splitOnFirst,o=D.filterObj,u=f=>f==null,l=Symbol("encodeFragmentIdentifier");function y(f){switch(f.arrayFormat){case"index":return m=>(w,_)=>{const P=w.length;return _===void 0||f.skipNull&&_===null||f.skipEmptyString&&_===""?w:_===null?[...w,[R(m,f),"[",P,"]"].join("")]:[...w,[R(m,f),"[",R(P,f),"]=",R(_,f)].join("")]};case"bracket":return m=>(w,_)=>_===void 0||f.skipNull&&_===null||f.skipEmptyString&&_===""?w:_===null?[...w,[R(m,f),"[]"].join("")]:[...w,[R(m,f),"[]=",R(_,f)].join("")];case"colon-list-separator":return m=>(w,_)=>_===void 0||f.skipNull&&_===null||f.skipEmptyString&&_===""?w:_===null?[...w,[R(m,f),":list="].join("")]:[...w,[R(m,f),":list=",R(_,f)].join("")];case"comma":case"separator":case"bracket-separator":{const m=f.arrayFormat==="bracket-separator"?"[]=":"=";return w=>(_,P)=>P===void 0||f.skipNull&&P===null||f.skipEmptyString&&P===""?_:(P=P===null?"":P,_.length===0?[[R(w,f),m,R(P,f)].join("")]:[[_,R(P,f)].join(f.arrayFormatSeparator)])}default:return m=>(w,_)=>_===void 0||f.skipNull&&_===null||f.skipEmptyString&&_===""?w:_===null?[...w,R(m,f)]:[...w,[R(m,f),"=",R(_,f)].join("")]}}function I(f){let m;switch(f.arrayFormat){case"index":return(w,_,P)=>{if(m=/\[(\d*)\]$/.exec(w),w=w.replace(/\[\d*\]$/,""),!m){P[w]=_;return}P[w]===void 0&&(P[w]={}),P[w][m[1]]=_};case"bracket":return(w,_,P)=>{if(m=/(\[\])$/.exec(w),w=w.replace(/\[\]$/,""),!m){P[w]=_;return}if(P[w]===void 0){P[w]=[_];return}P[w]=[].concat(P[w],_)};case"colon-list-separator":return(w,_,P)=>{if(m=/(:list)$/.exec(w),w=w.replace(/:list$/,""),!m){P[w]=_;return}if(P[w]===void 0){P[w]=[_];return}P[w]=[].concat(P[w],_)};case"comma":case"separator":return(w,_,P)=>{const U=typeof _=="string"&&_.includes(f.arrayFormatSeparator),F=typeof _=="string"&&!U&&x(_,f).includes(f.arrayFormatSeparator);_=F?x(_,f):_;const X=U||F?_.split(f.arrayFormatSeparator).map(Cr=>x(Cr,f)):_===null?_:x(_,f);P[w]=X};case"bracket-separator":return(w,_,P)=>{const U=/(\[\])$/.test(w);if(w=w.replace(/\[\]$/,""),!U){P[w]=_&&x(_,f);return}const F=_===null?[]:_.split(f.arrayFormatSeparator).map(X=>x(X,f));if(P[w]===void 0){P[w]=F;return}P[w]=[].concat(P[w],F)};default:return(w,_,P)=>{if(P[w]===void 0){P[w]=_;return}P[w]=[].concat(P[w],_)}}}function S(f){if(typeof f!="string"||f.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function R(f,m){return m.encode?m.strict?t(f):encodeURIComponent(f):f}function x(f,m){return m.decode?r(f):f}function j(f){return Array.isArray(f)?f.sort():typeof f=="object"?j(Object.keys(f)).sort((m,w)=>Number(m)-Number(w)).map(m=>f[m]):f}function B(f){const m=f.indexOf("#");return m!==-1&&(f=f.slice(0,m)),f}function k(f){let m="";const w=f.indexOf("#");return w!==-1&&(m=f.slice(w)),m}function re(f){f=B(f);const m=f.indexOf("?");return m===-1?"":f.slice(m+1)}function ne(f,m){return m.parseNumbers&&!Number.isNaN(Number(f))&&typeof f=="string"&&f.trim()!==""?f=Number(f):m.parseBooleans&&f!==null&&(f.toLowerCase()==="true"||f.toLowerCase()==="false")&&(f=f.toLowerCase()==="true"),f}function oe(f,m){m=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},m),S(m.arrayFormatSeparator);const w=I(m),_=Object.create(null);if(typeof f!="string"||(f=f.trim().replace(/^[?#&]/,""),!f))return _;for(const P of f.split("&")){if(P==="")continue;let[U,F]=s(m.decode?P.replace(/\+/g," "):P,"=");F=F===void 0?null:["comma","separator","bracket-separator"].includes(m.arrayFormat)?F:x(F,m),w(x(U,m),F,_)}for(const P of Object.keys(_)){const U=_[P];if(typeof U=="object"&&U!==null)for(const F of Object.keys(U))U[F]=ne(U[F],m);else _[P]=ne(U,m)}return m.sort===!1?_:(m.sort===!0?Object.keys(_).sort():Object.keys(_).sort(m.sort)).reduce((P,U)=>{const F=_[U];return F&&typeof F=="object"&&!Array.isArray(F)?P[U]=j(F):P[U]=F,P},Object.create(null))}a.extract=re,a.parse=oe,a.stringify=(f,m)=>{if(!f)return"";m=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},m),S(m.arrayFormatSeparator);const w=F=>m.skipNull&&u(f[F])||m.skipEmptyString&&f[F]==="",_=y(m),P={};for(const F of Object.keys(f))w(F)||(P[F]=f[F]);const U=Object.keys(P);return m.sort!==!1&&U.sort(m.sort),U.map(F=>{const X=f[F];return X===void 0?"":X===null?R(F,m):Array.isArray(X)?X.length===0&&m.arrayFormat==="bracket-separator"?R(F,m)+"[]":X.reduce(_(F),[]).join("&"):R(F,m)+"="+R(X,m)}).filter(F=>F.length>0).join("&")},a.parseUrl=(f,m)=>{m=Object.assign({decode:!0},m);const[w,_]=s(f,"#");return Object.assign({url:w.split("?")[0]||"",query:oe(re(f),m)},m&&m.parseFragmentIdentifier&&_?{fragmentIdentifier:x(_,m)}:{})},a.stringifyUrl=(f,m)=>{m=Object.assign({encode:!0,strict:!0,[l]:!0},m);const w=B(f.url).split("?")[0]||"",_=a.extract(f.url),P=a.parse(_,{sort:!1}),U=Object.assign(P,f.query);let F=a.stringify(U,m);F&&(F=`?${F}`);let X=k(f.url);return f.fragmentIdentifier&&(X=`#${m[l]?R(f.fragmentIdentifier,m):f.fragmentIdentifier}`),`${w}${F}${X}`},a.pick=(f,m,w)=>{w=Object.assign({parseFragmentIdentifier:!0,[l]:!1},w);const{url:_,query:P,fragmentIdentifier:U}=a.parseUrl(f,w);return a.stringifyUrl({url:_,query:o(P,m),fragmentIdentifier:U},w)},a.exclude=(f,m,w)=>{const _=Array.isArray(m)?P=>!m.includes(P):(P,U)=>!m(P,U);return a.pick(f,_,w)}})(qv);function Uv(a,t=[]){const r=[];return Object.keys(a).forEach(s=>{if(t.length&&!t.includes(s))return;const o=a[s];r.push(...o.accounts)}),r}const Mv={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}};function Lv(a,t){const{message:r,code:s}=Mv[a];return{message:r,code:s}}function so(a,t){return!!Array.isArray(a)}var Or={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -43,4 +43,4 @@ __p += '`),te&&(T+=`' +
|
|
|
43
43
|
function print() { __p += __j.call(arguments, '') }
|
|
44
44
|
`:`;
|
|
45
45
|
`)+T+`return __p
|
|
46
|
-
}`;var Q=tu(function(){return se(d,z+"return "+T).apply(r,g)});if(Q.source=T,Fn(Q))throw Q;return Q}function Vm(e){return ae(e).toLowerCase()}function Km(e){return ae(e).toUpperCase()}function Bm(e,i,n){if(e=ae(e),e&&(n||i===r))return ha(e);if(!e||!(i=He(i)))return e;var c=ot(e),h=ot(i),d=la(c,h),g=pa(c,h)+1;return Mt(c,d,g).join("")}function Jm(e,i,n){if(e=ae(e),e&&(n||i===r))return e.slice(0,fa(e)+1);if(!e||!(i=He(i)))return e;var c=ot(e),h=pa(c,ot(i))+1;return Mt(c,0,h).join("")}function Gm(e,i,n){if(e=ae(e),e&&(n||i===r))return e.replace(Ts,"");if(!e||!(i=He(i)))return e;var c=ot(e),h=la(c,ot(i));return Mt(c,h).join("")}function Wm(e,i){var n=Cr,c=kh;if(fe(i)){var h="separator"in i?i.separator:h;n="length"in i?W(i.length):n,c="omission"in i?He(i.omission):c}e=ae(e);var d=e.length;if(hr(e)){var g=ot(e);d=g.length}if(n>=d)return e;var v=n-lr(c);if(v<1)return c;var E=g?Mt(g,0,v).join(""):e.slice(0,v);if(h===r)return E+c;if(g&&(v+=E.length-v),jn(h)){if(e.slice(v).search(h)){var C,$=E;for(h.global||(h=Qs(h.source,ae(xo.exec(h))+"g")),h.lastIndex=0;C=h.exec($);)var T=C.index;E=E.slice(0,T===r?v:T)}}else if(e.indexOf(He(h),v)!=v){var M=E.lastIndexOf(h);M>-1&&(E=E.slice(0,M))}return E+c}function Qm(e){return e=ae(e),e&&ol.test(e)?e.replace(Ao,Pp):e}var Ym=vr(function(e,i,n){return e+(n?" ":"")+i.toUpperCase()}),Un=rc("toUpperCase");function eu(e,i,n){return e=ae(e),i=n?r:i,i===r?wp(e)?Rp(e):hp(e):e.match(i)||[]}var tu=Y(function(e,i){try{return ze(e,r,i)}catch(n){return Fn(n)?n:new J(n)}}),Zm=Et(function(e,i){return Qe(i,function(n){n=gt(n),_t(e,n,xn(e[n],e))}),e});function Xm(e){var i=e==null?0:e.length,n=H();return e=i?pe(e,function(c){if(typeof c[1]!="function")throw new Ye(l);return[n(c[0]),c[1]]}):[],Y(function(c){for(var h=-1;++h<i;){var d=e[h];if(ze(d[0],this,c))return ze(d[1],this,c)}})}function ev(e){return Pd(Xe(e,x))}function Mn(e){return function(){return e}}function tv(e,i){return e==null||e!==e?i:e}var rv=sc(),iv=sc(!0);function qe(e){return e}function Ln(e){return Fa(typeof e=="function"?e:Xe(e,x))}function sv(e){return Da(Xe(e,x))}function nv(e,i){return qa(e,Xe(i,x))}var ov=Y(function(e,i){return function(n){return Br(n,e,i)}}),av=Y(function(e,i){return function(n){return Br(e,n,i)}});function zn(e,i,n){var c=Ee(i),h=ki(i,c);n==null&&!(fe(i)&&(h.length||!c.length))&&(n=i,i=e,e=this,h=ki(i,Ee(i)));var d=!(fe(n)&&"chain"in n)||!!n.chain,g=Pt(e);return Qe(h,function(v){var E=i[v];e[v]=E,g&&(e.prototype[v]=function(){var C=this.__chain__;if(d||C){var $=e(this.__wrapped__),T=$.__actions__=Fe(this.__actions__);return T.push({func:E,args:arguments,thisArg:e}),$.__chain__=C,$}return E.apply(e,Tt([this.value()],arguments))})}),e}function cv(){return Pe._===this&&(Pe._=Tp),this}function kn(){}function uv(e){return e=W(e),Y(function(i){return Ua(i,e)})}var hv=wn(pe),lv=wn(na),pv=wn(Hs);function ru(e){return On(e)?Vs(gt(e)):zd(e)}function dv(e){return function(i){return e==null?r:Yt(e,i)}}var fv=oc(),gv=oc(!0);function Hn(){return[]}function Vn(){return!1}function yv(){return{}}function mv(){return""}function vv(){return!0}function wv(e,i){if(e=W(e),e<1||e>$t)return[];var n=pt,c=Re(e,pt);i=H(i),e-=pt;for(var h=Js(c,i);++n<e;)i(n);return h}function _v(e){return G(e)?pe(e,gt):Ve(e)?[e]:Fe(Ec(ae(e)))}function bv(e){var i=++$p;return ae(e)+i}var Ev=Gi(function(e,i){return e+i},0),Iv=_n("ceil"),Pv=Gi(function(e,i){return e/i},1),Sv=_n("floor");function Ov(e){return e&&e.length?zi(e,qe,nn):r}function Rv(e,i){return e&&e.length?zi(e,H(i,2),nn):r}function Nv(e){return ca(e,qe)}function Av(e,i){return ca(e,H(i,2))}function Cv(e){return e&&e.length?zi(e,qe,un):r}function $v(e,i){return e&&e.length?zi(e,H(i,2),un):r}var xv=Gi(function(e,i){return e*i},1),Tv=_n("round"),Fv=Gi(function(e,i){return e-i},0);function jv(e){return e&&e.length?Bs(e,qe):0}function Dv(e,i){return e&&e.length?Bs(e,H(i,2)):0}return p.after=sy,p.ary=Tc,p.assign=Ky,p.assignIn=Jc,p.assignInWith=as,p.assignWith=By,p.at=Jy,p.before=Fc,p.bind=xn,p.bindAll=Zm,p.bindKey=jc,p.castArray=yy,p.chain=Cc,p.chunk=Sf,p.compact=Of,p.concat=Rf,p.cond=Xm,p.conforms=ev,p.constant=Mn,p.countBy=jg,p.create=Gy,p.curry=Dc,p.curryRight=qc,p.debounce=Uc,p.defaults=Wy,p.defaultsDeep=Qy,p.defer=ny,p.delay=oy,p.difference=Nf,p.differenceBy=Af,p.differenceWith=Cf,p.drop=$f,p.dropRight=xf,p.dropRightWhile=Tf,p.dropWhile=Ff,p.fill=jf,p.filter=qg,p.flatMap=Lg,p.flatMapDeep=zg,p.flatMapDepth=kg,p.flatten=Oc,p.flattenDeep=Df,p.flattenDepth=qf,p.flip=ay,p.flow=rv,p.flowRight=iv,p.fromPairs=Uf,p.functions=im,p.functionsIn=sm,p.groupBy=Hg,p.initial=Lf,p.intersection=zf,p.intersectionBy=kf,p.intersectionWith=Hf,p.invert=om,p.invertBy=am,p.invokeMap=Kg,p.iteratee=Ln,p.keyBy=Bg,p.keys=Ee,p.keysIn=De,p.map=ts,p.mapKeys=um,p.mapValues=hm,p.matches=sv,p.matchesProperty=nv,p.memoize=is,p.merge=lm,p.mergeWith=Gc,p.method=ov,p.methodOf=av,p.mixin=zn,p.negate=ss,p.nthArg=uv,p.omit=pm,p.omitBy=dm,p.once=cy,p.orderBy=Jg,p.over=hv,p.overArgs=uy,p.overEvery=lv,p.overSome=pv,p.partial=Tn,p.partialRight=Mc,p.partition=Gg,p.pick=fm,p.pickBy=Wc,p.property=ru,p.propertyOf=dv,p.pull=Jf,p.pullAll=Nc,p.pullAllBy=Gf,p.pullAllWith=Wf,p.pullAt=Qf,p.range=fv,p.rangeRight=gv,p.rearg=hy,p.reject=Yg,p.remove=Yf,p.rest=ly,p.reverse=Cn,p.sampleSize=Xg,p.set=ym,p.setWith=mm,p.shuffle=ey,p.slice=Zf,p.sortBy=iy,p.sortedUniq=ng,p.sortedUniqBy=og,p.split=Lm,p.spread=py,p.tail=ag,p.take=cg,p.takeRight=ug,p.takeRightWhile=hg,p.takeWhile=lg,p.tap=Og,p.throttle=dy,p.thru=es,p.toArray=Vc,p.toPairs=Qc,p.toPairsIn=Yc,p.toPath=_v,p.toPlainObject=Bc,p.transform=vm,p.unary=fy,p.union=pg,p.unionBy=dg,p.unionWith=fg,p.uniq=gg,p.uniqBy=yg,p.uniqWith=mg,p.unset=wm,p.unzip=$n,p.unzipWith=Ac,p.update=_m,p.updateWith=bm,p.values=br,p.valuesIn=Em,p.without=vg,p.words=eu,p.wrap=gy,p.xor=wg,p.xorBy=_g,p.xorWith=bg,p.zip=Eg,p.zipObject=Ig,p.zipObjectDeep=Pg,p.zipWith=Sg,p.entries=Qc,p.entriesIn=Yc,p.extend=Jc,p.extendWith=as,zn(p,p),p.add=Ev,p.attempt=tu,p.camelCase=Om,p.capitalize=Zc,p.ceil=Iv,p.clamp=Im,p.clone=my,p.cloneDeep=wy,p.cloneDeepWith=_y,p.cloneWith=vy,p.conformsTo=by,p.deburr=Xc,p.defaultTo=tv,p.divide=Pv,p.endsWith=Rm,p.eq=ct,p.escape=Nm,p.escapeRegExp=Am,p.every=Dg,p.find=Ug,p.findIndex=Pc,p.findKey=Yy,p.findLast=Mg,p.findLastIndex=Sc,p.findLastKey=Zy,p.floor=Sv,p.forEach=$c,p.forEachRight=xc,p.forIn=Xy,p.forInRight=em,p.forOwn=tm,p.forOwnRight=rm,p.get=Dn,p.gt=Ey,p.gte=Iy,p.has=nm,p.hasIn=qn,p.head=Rc,p.identity=qe,p.includes=Vg,p.indexOf=Mf,p.inRange=Pm,p.invoke=cm,p.isArguments=er,p.isArray=G,p.isArrayBuffer=Py,p.isArrayLike=je,p.isArrayLikeObject=ye,p.isBoolean=Sy,p.isBuffer=Lt,p.isDate=Oy,p.isElement=Ry,p.isEmpty=Ny,p.isEqual=Ay,p.isEqualWith=Cy,p.isError=Fn,p.isFinite=$y,p.isFunction=Pt,p.isInteger=Lc,p.isLength=ns,p.isMap=zc,p.isMatch=xy,p.isMatchWith=Ty,p.isNaN=Fy,p.isNative=jy,p.isNil=qy,p.isNull=Dy,p.isNumber=kc,p.isObject=fe,p.isObjectLike=ge,p.isPlainObject=Zr,p.isRegExp=jn,p.isSafeInteger=Uy,p.isSet=Hc,p.isString=os,p.isSymbol=Ve,p.isTypedArray=_r,p.isUndefined=My,p.isWeakMap=Ly,p.isWeakSet=zy,p.join=Vf,p.kebabCase=Cm,p.last=tt,p.lastIndexOf=Kf,p.lowerCase=$m,p.lowerFirst=xm,p.lt=ky,p.lte=Hy,p.max=Ov,p.maxBy=Rv,p.mean=Nv,p.meanBy=Av,p.min=Cv,p.minBy=$v,p.stubArray=Hn,p.stubFalse=Vn,p.stubObject=yv,p.stubString=mv,p.stubTrue=vv,p.multiply=xv,p.nth=Bf,p.noConflict=cv,p.noop=kn,p.now=rs,p.pad=Tm,p.padEnd=Fm,p.padStart=jm,p.parseInt=Dm,p.random=Sm,p.reduce=Wg,p.reduceRight=Qg,p.repeat=qm,p.replace=Um,p.result=gm,p.round=Tv,p.runInContext=b,p.sample=Zg,p.size=ty,p.snakeCase=Mm,p.some=ry,p.sortedIndex=Xf,p.sortedIndexBy=eg,p.sortedIndexOf=tg,p.sortedLastIndex=rg,p.sortedLastIndexBy=ig,p.sortedLastIndexOf=sg,p.startCase=zm,p.startsWith=km,p.subtract=Fv,p.sum=jv,p.sumBy=Dv,p.template=Hm,p.times=wv,p.toFinite=St,p.toInteger=W,p.toLength=Kc,p.toLower=Vm,p.toNumber=rt,p.toSafeInteger=Vy,p.toString=ae,p.toUpper=Km,p.trim=Bm,p.trimEnd=Jm,p.trimStart=Gm,p.truncate=Wm,p.unescape=Qm,p.uniqueId=bv,p.upperCase=Ym,p.upperFirst=Un,p.each=$c,p.eachRight=xc,p.first=Rc,zn(p,function(){var e={};return dt(p,function(i,n){ce.call(p.prototype,n)||(e[n]=i)}),e}(),{chain:!1}),p.VERSION=s,Qe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){p[e].placeholder=p}),Qe(["drop","take"],function(e,i){ee.prototype[e]=function(n){n=n===r?1:be(W(n),0);var c=this.__filtered__&&!i?new ee(this):this.clone();return c.__filtered__?c.__takeCount__=Re(n,c.__takeCount__):c.__views__.push({size:Re(n,pt),type:e+(c.__dir__<0?"Right":"")}),c},ee.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),Qe(["filter","map","takeWhile"],function(e,i){var n=i+1,c=n==Oo||n==Bh;ee.prototype[e]=function(h){var d=this.clone();return d.__iteratees__.push({iteratee:H(h,3),type:n}),d.__filtered__=d.__filtered__||c,d}}),Qe(["head","last"],function(e,i){var n="take"+(i?"Right":"");ee.prototype[e]=function(){return this[n](1).value()[0]}}),Qe(["initial","tail"],function(e,i){var n="drop"+(i?"":"Right");ee.prototype[e]=function(){return this.__filtered__?new ee(this):this[n](1)}}),ee.prototype.compact=function(){return this.filter(qe)},ee.prototype.find=function(e){return this.filter(e).head()},ee.prototype.findLast=function(e){return this.reverse().find(e)},ee.prototype.invokeMap=Y(function(e,i){return typeof e=="function"?new ee(this):this.map(function(n){return Br(n,e,i)})}),ee.prototype.reject=function(e){return this.filter(ss(H(e)))},ee.prototype.slice=function(e,i){e=W(e);var n=this;return n.__filtered__&&(e>0||i<0)?new ee(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),i!==r&&(i=W(i),n=i<0?n.dropRight(-i):n.take(i-e)),n)},ee.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ee.prototype.toArray=function(){return this.take(pt)},dt(ee.prototype,function(e,i){var n=/^(?:filter|find|map|reject)|While$/.test(i),c=/^(?:head|last)$/.test(i),h=p[c?"take"+(i=="last"?"Right":""):i],d=c||/^find/.test(i);h&&(p.prototype[i]=function(){var g=this.__wrapped__,v=c?[1]:arguments,E=g instanceof ee,C=v[0],$=E||G(g),T=function(Z){var te=h.apply(p,Tt([Z],v));return c&&M?te[0]:te};$&&n&&typeof C=="function"&&C.length!=1&&(E=$=!1);var M=this.__chain__,z=!!this.__actions__.length,V=d&&!M,Q=E&&!z;if(!d&&$){g=Q?g:new ee(this);var K=e.apply(g,v);return K.__actions__.push({func:es,args:[T],thisArg:r}),new Ze(K,M)}return V&&Q?e.apply(this,v):(K=this.thru(T),V?c?K.value()[0]:K.value():K)})}),Qe(["pop","push","shift","sort","splice","unshift"],function(e){var i=Oi[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",c=/^(?:pop|shift)$/.test(e);p.prototype[e]=function(){var h=arguments;if(c&&!this.__chain__){var d=this.value();return i.apply(G(d)?d:[],h)}return this[n](function(g){return i.apply(G(g)?g:[],h)})}}),dt(ee.prototype,function(e,i){var n=p[i];if(n){var c=n.name+"";ce.call(gr,c)||(gr[c]=[]),gr[c].push({name:i,func:n})}}),gr[Ji(r,oe).name]=[{name:"wrapper",func:r}],ee.prototype.clone=Wp,ee.prototype.reverse=Qp,ee.prototype.value=Yp,p.prototype.at=Rg,p.prototype.chain=Ng,p.prototype.commit=Ag,p.prototype.next=Cg,p.prototype.plant=xg,p.prototype.reverse=Tg,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Fg,p.prototype.first=p.prototype.head,Mr&&(p.prototype[Mr]=$g),p},pr=Np();Bt?((Bt.exports=pr)._=pr,Ms._=pr):Pe._=pr}).call(ni)})(yo,yo.exports);var Bb=Object.defineProperty,Jb=Object.defineProperties,Gb=Object.getOwnPropertyDescriptors,Zu=Object.getOwnPropertySymbols,Wb=Object.prototype.hasOwnProperty,Qb=Object.prototype.propertyIsEnumerable,Xu=(a,t,r)=>t in a?Bb(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,hs=(a,t)=>{for(var r in t||(t={}))Wb.call(t,r)&&Xu(a,r,t[r]);if(Zu)for(var r of Zu(t))Qb.call(t,r)&&Xu(a,r,t[r]);return a},Yb=(a,t)=>Jb(a,Gb(t));function Ht(a,t,r){var s;const o=Sw(a);return((s=t.rpcMap)==null?void 0:s[o.reference])||`${Kb}?chainId=${o.namespace}:${o.reference}&projectId=${r}`}function nr(a){return a.includes(":")?a.split(":")[1]:a}function Uh(a){return a.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function Zb(a,t){const r=Object.keys(t.namespaces).filter(o=>o.includes(a));if(!r.length)return[];const s=[];return r.forEach(o=>{const u=t.namespaces[o].accounts;s.push(...u)}),s}function Xb(a={},t={}){const r=eh(a),s=eh(t);return yo.exports.merge(r,s)}function eh(a){var t,r,s,o;const u={};if(!Sr(a))return u;for(const[l,y]of Object.entries(a)){const I=_o(l)?[l]:y.chains,S=y.methods||[],R=y.events||[],x=y.rpcMap||{},j=oi(l);u[j]=Yb(hs(hs({},u[j]),y),{chains:Jn(I,(t=u[j])==null?void 0:t.chains),methods:Jn(S,(r=u[j])==null?void 0:r.methods),events:Jn(R,(s=u[j])==null?void 0:s.events),rpcMap:hs(hs({},x),(o=u[j])==null?void 0:o.rpcMap)})}return u}function eE(a){return a.includes(":")?a.split(":")[2]:a}function tE(a){const t={};for(const[r,s]of Object.entries(a)){const o=s.methods||[],u=s.events||[],l=s.accounts||[],y=_o(r)?[r]:s.chains?s.chains:Uh(s.accounts);t[r]={chains:y,methods:o,events:u,accounts:l}}return t}function eo(a){return typeof a=="number"?a:a.includes("0x")?parseInt(a,16):a.includes(":")?Number(a.split(":")[1]):Number(a)}const Mh={},de=a=>Mh[a],to=(a,t)=>{Mh[a]=t};class rE{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const o=nr(r);t[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Ht(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}}class iE{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(parseInt(t),r),this.chainId=parseInt(t),this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,r){const s=r||Ht(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const o=parseInt(nr(r));t[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}async handleSwitchChain(t){var r,s;let o=t.request.params?(r=t.request.params[0])==null?void 0:r.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;const u=parseInt(o,16);if(this.isChainApproved(u))this.setDefaultChain(`${u}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:o}]},chainId:(s=this.namespace.chains)==null?void 0:s[0]}),this.setDefaultChain(`${u}`);else throw new Error(`Failed to switch to chain 'eip155:${u}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}}class sE{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const o=nr(r);t[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Ht(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}}class nE{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const o=nr(r);t[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Ht(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}}class oE{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{const s=this.getCardanoRPCUrl(r),o=nr(r);t[o]=this.createHttpProvider(o,s)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}getCardanoRPCUrl(t){const r=this.namespace.rpcMap;if(r)return r[t]}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||this.getCardanoRPCUrl(t);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}}class aE{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const o=nr(r);t[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Ht(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}}class cE{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const o=nr(r);t[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Ht(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}}class uE{constructor(t){this.name="near",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){if(this.chainId=t,!this.httpProviders[t]){const s=r||Ht(`${this.name}:${t}`,this.namespace);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,s)}this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;t[r]=this.createHttpProvider(r,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Ht(t,this.namespace);return typeof s>"u"?void 0:new At(new Vt(s,de("disableProviderPing")))}}var hE=Object.defineProperty,lE=Object.defineProperties,pE=Object.getOwnPropertyDescriptors,th=Object.getOwnPropertySymbols,dE=Object.prototype.hasOwnProperty,fE=Object.prototype.propertyIsEnumerable,rh=(a,t,r)=>t in a?hE(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,ls=(a,t)=>{for(var r in t||(t={}))dE.call(t,r)&&rh(a,r,t[r]);if(th)for(var r of th(t))fE.call(t,r)&&rh(a,r,t[r]);return a},ro=(a,t)=>lE(a,pE(t));class So{constructor(t){this.events=new Ge.Dt,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:N.ot(N.k({level:(t==null?void 0:t.logger)||Qu})),this.disableProviderPing=(t==null?void 0:t.disableProviderPing)||!1}static async init(t){const r=new So(t);return await r.initialize(),r}async request(t,r){const[s,o]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:ls({},t),chainId:`${s}:${o}`,topic:this.session.topic})}sendAsync(t,r,s){const o=new Date().getTime();this.request(t,s).then(u=>r(null,N.formatJsonRpcResult(o,u))).catch(u=>r(u,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:ve("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}removeListener(t,r){this.events.removeListener(t,r)}off(t,r){this.events.off(t,r)}get isWalletConnect(){return!0}async pair(t){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:s,approval:o}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});s&&(this.uri=s,this.events.emit("display_uri",s)),await o().then(u=>{this.session=u,this.namespaces||(this.namespaces=tE(u.namespaces),this.persist("namespaces",this.namespaces))}).catch(u=>{if(u.message!==Dh)throw u;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,r){try{if(!this.session)return;const[s,o]=this.validateChain(t);this.getProvider(s).setDefaultChain(o,r)}catch(s){if(!/Please call connect/.test(s.message))throw s}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(ir(r)){for(const s of r)t.deletePairings?this.client.core.expirer.set(s.topic,0):await this.client.core.relayer.subscriber.unsubscribe(s.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Fb.init({logger:this.providerOpts.logger||Qu,relayUrl:this.providerOpts.relayUrl||kb,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const t=[...new Set(Object.keys(this.session.namespaces).map(r=>oi(r)))];to("client",this.client),to("events",this.events),to("disableProviderPing",this.disableProviderPing),t.forEach(r=>{if(!this.session)return;const s=Zb(r,this.session),o=Uh(s),u=Xb(this.namespaces,this.optionalNamespaces),l=ro(ls({},u[r]),{accounts:s,chains:o});switch(r){case"eip155":this.rpcProviders[r]=new iE({namespace:l});break;case"solana":this.rpcProviders[r]=new sE({namespace:l});break;case"cosmos":this.rpcProviders[r]=new nE({namespace:l});break;case"polkadot":this.rpcProviders[r]=new rE({namespace:l});break;case"cip34":this.rpcProviders[r]=new oE({namespace:l});break;case"elrond":this.rpcProviders[r]=new aE({namespace:l});break;case"multiversx":this.rpcProviders[r]=new cE({namespace:l});break;case"near":this.rpcProviders[r]=new uE({namespace:l});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{this.events.emit("session_ping",t)}),this.client.on("session_event",t=>{const{params:r}=t,{event:s}=r;if(s.name==="accountsChanged"){const o=s.data;o&&ir(o)&&this.events.emit("accountsChanged",o.map(eE))}else if(s.name==="chainChanged"){const o=r.chainId,u=r.event.data,l=oi(o),y=eo(o)!==eo(u)?`${l}:${eo(u)}`:o;this.onChainChanged(y)}else this.events.emit(s.name,s.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:r})=>{var s;const{namespaces:o}=r,u=(s=this.client)==null?void 0:s.session.get(t);this.session=ro(ls({},u),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:r})}),this.client.on("session_delete",async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",ro(ls({},ve("USER_DISCONNECTED")),{data:t.topic}))}),this.on(Ct.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(t,!0)})}getProvider(t){if(!this.rpcProviders[t])throw new Error(`Provider not found: ${t}`);return this.rpcProviders[t]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var r;this.getProvider(t).updateNamespace((r=this.session)==null?void 0:r.namespaces[t])})}setNamespaces(t){const{namespaces:r,optionalNamespaces:s,sessionProperties:o}=t;r&&Object.keys(r).length&&(this.namespaces=r),s&&Object.keys(s).length&&(this.optionalNamespaces=s),this.sessionProperties=o,this.persist("namespaces",r),this.persist("optionalNamespaces",s)}validateChain(t){const[r,s]=(t==null?void 0:t.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,s];if(r&&!Object.keys(this.namespaces||{}).map(l=>oi(l)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&s)return[r,s];const o=oi(Object.keys(this.namespaces)[0]),u=this.rpcProviders[o].getDefaultChain();return[o,u]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t,r=!1){var s;if(!this.namespaces)return;const[o,u]=this.validateChain(t);r||this.getProvider(o).setDefaultChain(u),((s=this.namespaces[o])!=null?s:this.namespaces[`${o}:${u}`]).defaultChain=u,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",u)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(t,r){this.client.core.storage.setItem(`${Yu}/${t}`,r)}async getFromStore(t){return await this.client.core.storage.getItem(`${Yu}/${t}`)}}const gE=So,yE="wc",mE="ethereum_provider",vE=`${yE}@2:${mE}:`,wE="https://rpc.walletconnect.com/v1/",ys=["eth_sendTransaction","personal_sign"],Lh=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],ms=["chainChanged","accountsChanged"],zh=["chainChanged","accountsChanged","message","disconnect","connect"];var _E=Object.defineProperty,bE=Object.defineProperties,EE=Object.getOwnPropertyDescriptors,ih=Object.getOwnPropertySymbols,IE=Object.prototype.hasOwnProperty,PE=Object.prototype.propertyIsEnumerable,sh=(a,t,r)=>t in a?_E(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,ci=(a,t)=>{for(var r in t||(t={}))IE.call(t,r)&&sh(a,r,t[r]);if(ih)for(var r of ih(t))PE.call(t,r)&&sh(a,r,t[r]);return a},nh=(a,t)=>bE(a,EE(t));function vs(a){return Number(a[0].split(":")[1])}function io(a){return`0x${a.toString(16)}`}function SE(a){const{chains:t,optionalChains:r,methods:s,optionalMethods:o,events:u,optionalEvents:l,rpcMap:y}=a;if(!so(t))throw new Error("Invalid chains");const I={chains:t,methods:s||ys,events:u||ms,rpcMap:ci({},t.length?{[vs(t)]:y[vs(t)]}:{})},S=u==null?void 0:u.filter(B=>!ms.includes(B)),R=s==null?void 0:s.filter(B=>!ys.includes(B));if(!r&&!l&&!o&&!(S!=null&&S.length)&&!(R!=null&&R.length))return{required:t.length?I:void 0};const x=(S==null?void 0:S.length)&&(R==null?void 0:R.length)||!r,j={chains:[...new Set(x?I.chains.concat(r||[]):r)],methods:[...new Set(I.methods.concat(o!=null&&o.length?o:Lh))],events:[...new Set(I.events.concat(l!=null&&l.length?l:zh))],rpcMap:y};return{required:t.length?I:void 0,optional:r.length?j:void 0}}class Es{constructor(){this.events=new Ge.eventsExports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=vE,this.on=(t,r)=>(this.events.on(t,r),this),this.once=(t,r)=>(this.events.once(t,r),this),this.removeListener=(t,r)=>(this.events.removeListener(t,r),this),this.off=(t,r)=>(this.events.off(t,r),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){const r=new Es;return await r.initialize(t),r}async request(t){return await this.signer.request(t,this.formatChainId(this.chainId))}sendAsync(t,r){this.signer.sendAsync(t,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);const{required:r,optional:s}=SE(this.rpc);try{const o=await new Promise(async(l,y)=>{var I;this.rpc.showQrModal&&((I=this.modal)==null||I.subscribeModal(S=>{!S.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),y(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(nh(ci({namespaces:ci({},r&&{[this.namespace]:r})},s&&{optionalNamespaces:{[this.namespace]:s}}),{pairingTopic:t==null?void 0:t.pairingTopic})).then(S=>{l(S)}).catch(S=>{y(new Error(S.message))})});if(!o)return;const u=Uv(o.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:u),this.setAccounts(u),this.events.emit("connect",{chainId:io(this.chainId)})}catch(o){throw this.signer.logger.error(o),o}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",t=>{const{params:r}=t,{event:s}=r;s.name==="accountsChanged"?(this.accounts=this.parseAccounts(s.data),this.events.emit("accountsChanged",this.accounts)):s.name==="chainChanged"?this.setChainId(this.formatChainId(s.data)):this.events.emit(s.name,s.data),this.events.emit("session_event",t)}),this.signer.on("chainChanged",t=>{const r=parseInt(t);this.chainId=r,this.events.emit("chainChanged",io(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",nh(ci({},Lv("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",t=>{var r,s;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(s=this.modal)==null||s.openModal({uri:t})),this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return typeof t=="string"?t.startsWith(`${this.namespace}:`):!1}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){const r=t.filter(s=>this.isCompatibleChainId(s)).map(s=>this.parseChainId(s));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",io(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const r=this.parseChainId(t);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(t){const[r,s,o]=t.split(":");return{chainId:`${r}:${s}`,address:o}}setAccounts(t){this.accounts=t.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var r,s;const o=(r=t==null?void 0:t.chains)!=null?r:[],u=(s=t==null?void 0:t.optionalChains)!=null?s:[],l=o.concat(u);if(!l.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const y=o.length?(t==null?void 0:t.methods)||ys:[],I=o.length?(t==null?void 0:t.events)||ms:[],S=(t==null?void 0:t.optionalMethods)||[],R=(t==null?void 0:t.optionalEvents)||[],x=(t==null?void 0:t.rpcMap)||this.buildRpcMap(l,t.projectId),j=(t==null?void 0:t.qrModalOptions)||void 0;return{chains:o==null?void 0:o.map(B=>this.formatChainId(B)),optionalChains:u.map(B=>this.formatChainId(B)),methods:y,events:I,optionalMethods:S,optionalEvents:R,rpcMap:x,showQrModal:!!(t!=null&&t.showQrModal),qrModalOptions:j,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,r){const s={};return t.forEach(o=>{s[o]=this.getRpcUrl(o,r)}),s}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?vs(this.rpc.chains):vs(this.rpc.optionalChains),this.signer=await gE.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:s}=await Promise.resolve().then(()=>require("./index-D2X6frcJ.js")).then(o=>o.index);r=s}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(ci({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(s){throw this.signer.logger.error(s),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:r,optionalChains:s,rpcMap:o}=t;r&&so(r)&&(this.rpc.chains=r.map(u=>this.formatChainId(u)),r.forEach(u=>{this.rpc.rpcMap[u]=(o==null?void 0:o[u])||this.getRpcUrl(u)})),s&&so(s)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=s==null?void 0:s.map(u=>this.formatChainId(u)),s.forEach(u=>{this.rpc.rpcMap[u]=(o==null?void 0:o[u])||this.getRpcUrl(u)}))}getRpcUrl(t,r){var s;return((s=this.rpc.rpcMap)==null?void 0:s[t])||`${wE}?chainId=eip155:${t}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return typeof t=="string"||t instanceof String?[this.parseAccount(t)]:t.map(r=>this.parseAccount(r))}}const OE=Es;exports.EthereumProvider=OE;exports.OPTIONAL_EVENTS=zh;exports.OPTIONAL_METHODS=Lh;exports.REQUIRED_EVENTS=ms;exports.REQUIRED_METHODS=ys;exports.default=Es;
|
|
46
|
+
}`;var Q=tu(function(){return se(d,z+"return "+T).apply(r,g)});if(Q.source=T,Fn(Q))throw Q;return Q}function Vm(e){return ae(e).toLowerCase()}function Km(e){return ae(e).toUpperCase()}function Bm(e,i,n){if(e=ae(e),e&&(n||i===r))return ha(e);if(!e||!(i=He(i)))return e;var c=ot(e),h=ot(i),d=la(c,h),g=pa(c,h)+1;return Mt(c,d,g).join("")}function Jm(e,i,n){if(e=ae(e),e&&(n||i===r))return e.slice(0,fa(e)+1);if(!e||!(i=He(i)))return e;var c=ot(e),h=pa(c,ot(i))+1;return Mt(c,0,h).join("")}function Gm(e,i,n){if(e=ae(e),e&&(n||i===r))return e.replace(Ts,"");if(!e||!(i=He(i)))return e;var c=ot(e),h=la(c,ot(i));return Mt(c,h).join("")}function Wm(e,i){var n=Cr,c=kh;if(fe(i)){var h="separator"in i?i.separator:h;n="length"in i?W(i.length):n,c="omission"in i?He(i.omission):c}e=ae(e);var d=e.length;if(hr(e)){var g=ot(e);d=g.length}if(n>=d)return e;var v=n-lr(c);if(v<1)return c;var E=g?Mt(g,0,v).join(""):e.slice(0,v);if(h===r)return E+c;if(g&&(v+=E.length-v),jn(h)){if(e.slice(v).search(h)){var C,$=E;for(h.global||(h=Qs(h.source,ae(xo.exec(h))+"g")),h.lastIndex=0;C=h.exec($);)var T=C.index;E=E.slice(0,T===r?v:T)}}else if(e.indexOf(He(h),v)!=v){var M=E.lastIndexOf(h);M>-1&&(E=E.slice(0,M))}return E+c}function Qm(e){return e=ae(e),e&&ol.test(e)?e.replace(Ao,Pp):e}var Ym=vr(function(e,i,n){return e+(n?" ":"")+i.toUpperCase()}),Un=rc("toUpperCase");function eu(e,i,n){return e=ae(e),i=n?r:i,i===r?wp(e)?Rp(e):hp(e):e.match(i)||[]}var tu=Y(function(e,i){try{return ze(e,r,i)}catch(n){return Fn(n)?n:new J(n)}}),Zm=Et(function(e,i){return Qe(i,function(n){n=gt(n),_t(e,n,xn(e[n],e))}),e});function Xm(e){var i=e==null?0:e.length,n=H();return e=i?pe(e,function(c){if(typeof c[1]!="function")throw new Ye(l);return[n(c[0]),c[1]]}):[],Y(function(c){for(var h=-1;++h<i;){var d=e[h];if(ze(d[0],this,c))return ze(d[1],this,c)}})}function ev(e){return Pd(Xe(e,x))}function Mn(e){return function(){return e}}function tv(e,i){return e==null||e!==e?i:e}var rv=sc(),iv=sc(!0);function qe(e){return e}function Ln(e){return Fa(typeof e=="function"?e:Xe(e,x))}function sv(e){return Da(Xe(e,x))}function nv(e,i){return qa(e,Xe(i,x))}var ov=Y(function(e,i){return function(n){return Br(n,e,i)}}),av=Y(function(e,i){return function(n){return Br(e,n,i)}});function zn(e,i,n){var c=Ee(i),h=ki(i,c);n==null&&!(fe(i)&&(h.length||!c.length))&&(n=i,i=e,e=this,h=ki(i,Ee(i)));var d=!(fe(n)&&"chain"in n)||!!n.chain,g=Pt(e);return Qe(h,function(v){var E=i[v];e[v]=E,g&&(e.prototype[v]=function(){var C=this.__chain__;if(d||C){var $=e(this.__wrapped__),T=$.__actions__=Fe(this.__actions__);return T.push({func:E,args:arguments,thisArg:e}),$.__chain__=C,$}return E.apply(e,Tt([this.value()],arguments))})}),e}function cv(){return Pe._===this&&(Pe._=Tp),this}function kn(){}function uv(e){return e=W(e),Y(function(i){return Ua(i,e)})}var hv=wn(pe),lv=wn(na),pv=wn(Hs);function ru(e){return On(e)?Vs(gt(e)):zd(e)}function dv(e){return function(i){return e==null?r:Yt(e,i)}}var fv=oc(),gv=oc(!0);function Hn(){return[]}function Vn(){return!1}function yv(){return{}}function mv(){return""}function vv(){return!0}function wv(e,i){if(e=W(e),e<1||e>$t)return[];var n=pt,c=Re(e,pt);i=H(i),e-=pt;for(var h=Js(c,i);++n<e;)i(n);return h}function _v(e){return G(e)?pe(e,gt):Ve(e)?[e]:Fe(Ec(ae(e)))}function bv(e){var i=++$p;return ae(e)+i}var Ev=Gi(function(e,i){return e+i},0),Iv=_n("ceil"),Pv=Gi(function(e,i){return e/i},1),Sv=_n("floor");function Ov(e){return e&&e.length?zi(e,qe,nn):r}function Rv(e,i){return e&&e.length?zi(e,H(i,2),nn):r}function Nv(e){return ca(e,qe)}function Av(e,i){return ca(e,H(i,2))}function Cv(e){return e&&e.length?zi(e,qe,un):r}function $v(e,i){return e&&e.length?zi(e,H(i,2),un):r}var xv=Gi(function(e,i){return e*i},1),Tv=_n("round"),Fv=Gi(function(e,i){return e-i},0);function jv(e){return e&&e.length?Bs(e,qe):0}function Dv(e,i){return e&&e.length?Bs(e,H(i,2)):0}return p.after=sy,p.ary=Tc,p.assign=Ky,p.assignIn=Jc,p.assignInWith=as,p.assignWith=By,p.at=Jy,p.before=Fc,p.bind=xn,p.bindAll=Zm,p.bindKey=jc,p.castArray=yy,p.chain=Cc,p.chunk=Sf,p.compact=Of,p.concat=Rf,p.cond=Xm,p.conforms=ev,p.constant=Mn,p.countBy=jg,p.create=Gy,p.curry=Dc,p.curryRight=qc,p.debounce=Uc,p.defaults=Wy,p.defaultsDeep=Qy,p.defer=ny,p.delay=oy,p.difference=Nf,p.differenceBy=Af,p.differenceWith=Cf,p.drop=$f,p.dropRight=xf,p.dropRightWhile=Tf,p.dropWhile=Ff,p.fill=jf,p.filter=qg,p.flatMap=Lg,p.flatMapDeep=zg,p.flatMapDepth=kg,p.flatten=Oc,p.flattenDeep=Df,p.flattenDepth=qf,p.flip=ay,p.flow=rv,p.flowRight=iv,p.fromPairs=Uf,p.functions=im,p.functionsIn=sm,p.groupBy=Hg,p.initial=Lf,p.intersection=zf,p.intersectionBy=kf,p.intersectionWith=Hf,p.invert=om,p.invertBy=am,p.invokeMap=Kg,p.iteratee=Ln,p.keyBy=Bg,p.keys=Ee,p.keysIn=De,p.map=ts,p.mapKeys=um,p.mapValues=hm,p.matches=sv,p.matchesProperty=nv,p.memoize=is,p.merge=lm,p.mergeWith=Gc,p.method=ov,p.methodOf=av,p.mixin=zn,p.negate=ss,p.nthArg=uv,p.omit=pm,p.omitBy=dm,p.once=cy,p.orderBy=Jg,p.over=hv,p.overArgs=uy,p.overEvery=lv,p.overSome=pv,p.partial=Tn,p.partialRight=Mc,p.partition=Gg,p.pick=fm,p.pickBy=Wc,p.property=ru,p.propertyOf=dv,p.pull=Jf,p.pullAll=Nc,p.pullAllBy=Gf,p.pullAllWith=Wf,p.pullAt=Qf,p.range=fv,p.rangeRight=gv,p.rearg=hy,p.reject=Yg,p.remove=Yf,p.rest=ly,p.reverse=Cn,p.sampleSize=Xg,p.set=ym,p.setWith=mm,p.shuffle=ey,p.slice=Zf,p.sortBy=iy,p.sortedUniq=ng,p.sortedUniqBy=og,p.split=Lm,p.spread=py,p.tail=ag,p.take=cg,p.takeRight=ug,p.takeRightWhile=hg,p.takeWhile=lg,p.tap=Og,p.throttle=dy,p.thru=es,p.toArray=Vc,p.toPairs=Qc,p.toPairsIn=Yc,p.toPath=_v,p.toPlainObject=Bc,p.transform=vm,p.unary=fy,p.union=pg,p.unionBy=dg,p.unionWith=fg,p.uniq=gg,p.uniqBy=yg,p.uniqWith=mg,p.unset=wm,p.unzip=$n,p.unzipWith=Ac,p.update=_m,p.updateWith=bm,p.values=br,p.valuesIn=Em,p.without=vg,p.words=eu,p.wrap=gy,p.xor=wg,p.xorBy=_g,p.xorWith=bg,p.zip=Eg,p.zipObject=Ig,p.zipObjectDeep=Pg,p.zipWith=Sg,p.entries=Qc,p.entriesIn=Yc,p.extend=Jc,p.extendWith=as,zn(p,p),p.add=Ev,p.attempt=tu,p.camelCase=Om,p.capitalize=Zc,p.ceil=Iv,p.clamp=Im,p.clone=my,p.cloneDeep=wy,p.cloneDeepWith=_y,p.cloneWith=vy,p.conformsTo=by,p.deburr=Xc,p.defaultTo=tv,p.divide=Pv,p.endsWith=Rm,p.eq=ct,p.escape=Nm,p.escapeRegExp=Am,p.every=Dg,p.find=Ug,p.findIndex=Pc,p.findKey=Yy,p.findLast=Mg,p.findLastIndex=Sc,p.findLastKey=Zy,p.floor=Sv,p.forEach=$c,p.forEachRight=xc,p.forIn=Xy,p.forInRight=em,p.forOwn=tm,p.forOwnRight=rm,p.get=Dn,p.gt=Ey,p.gte=Iy,p.has=nm,p.hasIn=qn,p.head=Rc,p.identity=qe,p.includes=Vg,p.indexOf=Mf,p.inRange=Pm,p.invoke=cm,p.isArguments=er,p.isArray=G,p.isArrayBuffer=Py,p.isArrayLike=je,p.isArrayLikeObject=ye,p.isBoolean=Sy,p.isBuffer=Lt,p.isDate=Oy,p.isElement=Ry,p.isEmpty=Ny,p.isEqual=Ay,p.isEqualWith=Cy,p.isError=Fn,p.isFinite=$y,p.isFunction=Pt,p.isInteger=Lc,p.isLength=ns,p.isMap=zc,p.isMatch=xy,p.isMatchWith=Ty,p.isNaN=Fy,p.isNative=jy,p.isNil=qy,p.isNull=Dy,p.isNumber=kc,p.isObject=fe,p.isObjectLike=ge,p.isPlainObject=Zr,p.isRegExp=jn,p.isSafeInteger=Uy,p.isSet=Hc,p.isString=os,p.isSymbol=Ve,p.isTypedArray=_r,p.isUndefined=My,p.isWeakMap=Ly,p.isWeakSet=zy,p.join=Vf,p.kebabCase=Cm,p.last=tt,p.lastIndexOf=Kf,p.lowerCase=$m,p.lowerFirst=xm,p.lt=ky,p.lte=Hy,p.max=Ov,p.maxBy=Rv,p.mean=Nv,p.meanBy=Av,p.min=Cv,p.minBy=$v,p.stubArray=Hn,p.stubFalse=Vn,p.stubObject=yv,p.stubString=mv,p.stubTrue=vv,p.multiply=xv,p.nth=Bf,p.noConflict=cv,p.noop=kn,p.now=rs,p.pad=Tm,p.padEnd=Fm,p.padStart=jm,p.parseInt=Dm,p.random=Sm,p.reduce=Wg,p.reduceRight=Qg,p.repeat=qm,p.replace=Um,p.result=gm,p.round=Tv,p.runInContext=b,p.sample=Zg,p.size=ty,p.snakeCase=Mm,p.some=ry,p.sortedIndex=Xf,p.sortedIndexBy=eg,p.sortedIndexOf=tg,p.sortedLastIndex=rg,p.sortedLastIndexBy=ig,p.sortedLastIndexOf=sg,p.startCase=zm,p.startsWith=km,p.subtract=Fv,p.sum=jv,p.sumBy=Dv,p.template=Hm,p.times=wv,p.toFinite=St,p.toInteger=W,p.toLength=Kc,p.toLower=Vm,p.toNumber=rt,p.toSafeInteger=Vy,p.toString=ae,p.toUpper=Km,p.trim=Bm,p.trimEnd=Jm,p.trimStart=Gm,p.truncate=Wm,p.unescape=Qm,p.uniqueId=bv,p.upperCase=Ym,p.upperFirst=Un,p.each=$c,p.eachRight=xc,p.first=Rc,zn(p,function(){var e={};return dt(p,function(i,n){ce.call(p.prototype,n)||(e[n]=i)}),e}(),{chain:!1}),p.VERSION=s,Qe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){p[e].placeholder=p}),Qe(["drop","take"],function(e,i){ee.prototype[e]=function(n){n=n===r?1:be(W(n),0);var c=this.__filtered__&&!i?new ee(this):this.clone();return c.__filtered__?c.__takeCount__=Re(n,c.__takeCount__):c.__views__.push({size:Re(n,pt),type:e+(c.__dir__<0?"Right":"")}),c},ee.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),Qe(["filter","map","takeWhile"],function(e,i){var n=i+1,c=n==Oo||n==Bh;ee.prototype[e]=function(h){var d=this.clone();return d.__iteratees__.push({iteratee:H(h,3),type:n}),d.__filtered__=d.__filtered__||c,d}}),Qe(["head","last"],function(e,i){var n="take"+(i?"Right":"");ee.prototype[e]=function(){return this[n](1).value()[0]}}),Qe(["initial","tail"],function(e,i){var n="drop"+(i?"":"Right");ee.prototype[e]=function(){return this.__filtered__?new ee(this):this[n](1)}}),ee.prototype.compact=function(){return this.filter(qe)},ee.prototype.find=function(e){return this.filter(e).head()},ee.prototype.findLast=function(e){return this.reverse().find(e)},ee.prototype.invokeMap=Y(function(e,i){return typeof e=="function"?new ee(this):this.map(function(n){return Br(n,e,i)})}),ee.prototype.reject=function(e){return this.filter(ss(H(e)))},ee.prototype.slice=function(e,i){e=W(e);var n=this;return n.__filtered__&&(e>0||i<0)?new ee(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),i!==r&&(i=W(i),n=i<0?n.dropRight(-i):n.take(i-e)),n)},ee.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ee.prototype.toArray=function(){return this.take(pt)},dt(ee.prototype,function(e,i){var n=/^(?:filter|find|map|reject)|While$/.test(i),c=/^(?:head|last)$/.test(i),h=p[c?"take"+(i=="last"?"Right":""):i],d=c||/^find/.test(i);h&&(p.prototype[i]=function(){var g=this.__wrapped__,v=c?[1]:arguments,E=g instanceof ee,C=v[0],$=E||G(g),T=function(Z){var te=h.apply(p,Tt([Z],v));return c&&M?te[0]:te};$&&n&&typeof C=="function"&&C.length!=1&&(E=$=!1);var M=this.__chain__,z=!!this.__actions__.length,V=d&&!M,Q=E&&!z;if(!d&&$){g=Q?g:new ee(this);var K=e.apply(g,v);return K.__actions__.push({func:es,args:[T],thisArg:r}),new Ze(K,M)}return V&&Q?e.apply(this,v):(K=this.thru(T),V?c?K.value()[0]:K.value():K)})}),Qe(["pop","push","shift","sort","splice","unshift"],function(e){var i=Oi[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",c=/^(?:pop|shift)$/.test(e);p.prototype[e]=function(){var h=arguments;if(c&&!this.__chain__){var d=this.value();return i.apply(G(d)?d:[],h)}return this[n](function(g){return i.apply(G(g)?g:[],h)})}}),dt(ee.prototype,function(e,i){var n=p[i];if(n){var c=n.name+"";ce.call(gr,c)||(gr[c]=[]),gr[c].push({name:i,func:n})}}),gr[Ji(r,oe).name]=[{name:"wrapper",func:r}],ee.prototype.clone=Wp,ee.prototype.reverse=Qp,ee.prototype.value=Yp,p.prototype.at=Rg,p.prototype.chain=Ng,p.prototype.commit=Ag,p.prototype.next=Cg,p.prototype.plant=xg,p.prototype.reverse=Tg,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Fg,p.prototype.first=p.prototype.head,Mr&&(p.prototype[Mr]=$g),p},pr=Np();Bt?((Bt.exports=pr)._=pr,Ms._=pr):Pe._=pr}).call(ni)})(yo,yo.exports);var Bb=Object.defineProperty,Jb=Object.defineProperties,Gb=Object.getOwnPropertyDescriptors,Zu=Object.getOwnPropertySymbols,Wb=Object.prototype.hasOwnProperty,Qb=Object.prototype.propertyIsEnumerable,Xu=(a,t,r)=>t in a?Bb(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,hs=(a,t)=>{for(var r in t||(t={}))Wb.call(t,r)&&Xu(a,r,t[r]);if(Zu)for(var r of Zu(t))Qb.call(t,r)&&Xu(a,r,t[r]);return a},Yb=(a,t)=>Jb(a,Gb(t));function Ht(a,t,r){var s;const o=Sw(a);return((s=t.rpcMap)==null?void 0:s[o.reference])||`${Kb}?chainId=${o.namespace}:${o.reference}&projectId=${r}`}function nr(a){return a.includes(":")?a.split(":")[1]:a}function Uh(a){return a.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function Zb(a,t){const r=Object.keys(t.namespaces).filter(o=>o.includes(a));if(!r.length)return[];const s=[];return r.forEach(o=>{const u=t.namespaces[o].accounts;s.push(...u)}),s}function Xb(a={},t={}){const r=eh(a),s=eh(t);return yo.exports.merge(r,s)}function eh(a){var t,r,s,o;const u={};if(!Sr(a))return u;for(const[l,y]of Object.entries(a)){const I=_o(l)?[l]:y.chains,S=y.methods||[],R=y.events||[],x=y.rpcMap||{},j=oi(l);u[j]=Yb(hs(hs({},u[j]),y),{chains:Jn(I,(t=u[j])==null?void 0:t.chains),methods:Jn(S,(r=u[j])==null?void 0:r.methods),events:Jn(R,(s=u[j])==null?void 0:s.events),rpcMap:hs(hs({},x),(o=u[j])==null?void 0:o.rpcMap)})}return u}function eE(a){return a.includes(":")?a.split(":")[2]:a}function tE(a){const t={};for(const[r,s]of Object.entries(a)){const o=s.methods||[],u=s.events||[],l=s.accounts||[],y=_o(r)?[r]:s.chains?s.chains:Uh(s.accounts);t[r]={chains:y,methods:o,events:u,accounts:l}}return t}function eo(a){return typeof a=="number"?a:a.includes("0x")?parseInt(a,16):a.includes(":")?Number(a.split(":")[1]):Number(a)}const Mh={},de=a=>Mh[a],to=(a,t)=>{Mh[a]=t};class rE{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const o=nr(r);t[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Ht(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}}class iE{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(parseInt(t),r),this.chainId=parseInt(t),this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,r){const s=r||Ht(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const o=parseInt(nr(r));t[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}async handleSwitchChain(t){var r,s;let o=t.request.params?(r=t.request.params[0])==null?void 0:r.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;const u=parseInt(o,16);if(this.isChainApproved(u))this.setDefaultChain(`${u}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:o}]},chainId:(s=this.namespace.chains)==null?void 0:s[0]}),this.setDefaultChain(`${u}`);else throw new Error(`Failed to switch to chain 'eip155:${u}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}}class sE{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const o=nr(r);t[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Ht(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}}class nE{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const o=nr(r);t[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Ht(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}}class oE{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{const s=this.getCardanoRPCUrl(r),o=nr(r);t[o]=this.createHttpProvider(o,s)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}getCardanoRPCUrl(t){const r=this.namespace.rpcMap;if(r)return r[t]}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||this.getCardanoRPCUrl(t);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}}class aE{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const o=nr(r);t[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Ht(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}}class cE{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;const o=nr(r);t[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Ht(t,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);return new At(new Vt(s,de("disableProviderPing")))}}class uE{constructor(t){this.name="near",this.namespace=t.namespace,this.events=de("events"),this.client=de("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){if(this.chainId=t,!this.httpProviders[t]){const s=r||Ht(`${this.name}:${t}`,this.namespace);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,s)}this.events.emit(Ct.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var s;t[r]=this.createHttpProvider(r,(s=this.namespace.rpcMap)==null?void 0:s[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const s=this.createHttpProvider(t,r);s&&(this.httpProviders[t]=s)}createHttpProvider(t,r){const s=r||Ht(t,this.namespace);return typeof s>"u"?void 0:new At(new Vt(s,de("disableProviderPing")))}}var hE=Object.defineProperty,lE=Object.defineProperties,pE=Object.getOwnPropertyDescriptors,th=Object.getOwnPropertySymbols,dE=Object.prototype.hasOwnProperty,fE=Object.prototype.propertyIsEnumerable,rh=(a,t,r)=>t in a?hE(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,ls=(a,t)=>{for(var r in t||(t={}))dE.call(t,r)&&rh(a,r,t[r]);if(th)for(var r of th(t))fE.call(t,r)&&rh(a,r,t[r]);return a},ro=(a,t)=>lE(a,pE(t));class So{constructor(t){this.events=new Ge.Dt,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:N.ot(N.k({level:(t==null?void 0:t.logger)||Qu})),this.disableProviderPing=(t==null?void 0:t.disableProviderPing)||!1}static async init(t){const r=new So(t);return await r.initialize(),r}async request(t,r){const[s,o]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:ls({},t),chainId:`${s}:${o}`,topic:this.session.topic})}sendAsync(t,r,s){const o=new Date().getTime();this.request(t,s).then(u=>r(null,N.formatJsonRpcResult(o,u))).catch(u=>r(u,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:ve("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}removeListener(t,r){this.events.removeListener(t,r)}off(t,r){this.events.off(t,r)}get isWalletConnect(){return!0}async pair(t){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:s,approval:o}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});s&&(this.uri=s,this.events.emit("display_uri",s)),await o().then(u=>{this.session=u,this.namespaces||(this.namespaces=tE(u.namespaces),this.persist("namespaces",this.namespaces))}).catch(u=>{if(u.message!==Dh)throw u;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,r){try{if(!this.session)return;const[s,o]=this.validateChain(t);this.getProvider(s).setDefaultChain(o,r)}catch(s){if(!/Please call connect/.test(s.message))throw s}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(ir(r)){for(const s of r)t.deletePairings?this.client.core.expirer.set(s.topic,0):await this.client.core.relayer.subscriber.unsubscribe(s.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Fb.init({logger:this.providerOpts.logger||Qu,relayUrl:this.providerOpts.relayUrl||kb,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const t=[...new Set(Object.keys(this.session.namespaces).map(r=>oi(r)))];to("client",this.client),to("events",this.events),to("disableProviderPing",this.disableProviderPing),t.forEach(r=>{if(!this.session)return;const s=Zb(r,this.session),o=Uh(s),u=Xb(this.namespaces,this.optionalNamespaces),l=ro(ls({},u[r]),{accounts:s,chains:o});switch(r){case"eip155":this.rpcProviders[r]=new iE({namespace:l});break;case"solana":this.rpcProviders[r]=new sE({namespace:l});break;case"cosmos":this.rpcProviders[r]=new nE({namespace:l});break;case"polkadot":this.rpcProviders[r]=new rE({namespace:l});break;case"cip34":this.rpcProviders[r]=new oE({namespace:l});break;case"elrond":this.rpcProviders[r]=new aE({namespace:l});break;case"multiversx":this.rpcProviders[r]=new cE({namespace:l});break;case"near":this.rpcProviders[r]=new uE({namespace:l});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{this.events.emit("session_ping",t)}),this.client.on("session_event",t=>{const{params:r}=t,{event:s}=r;if(s.name==="accountsChanged"){const o=s.data;o&&ir(o)&&this.events.emit("accountsChanged",o.map(eE))}else if(s.name==="chainChanged"){const o=r.chainId,u=r.event.data,l=oi(o),y=eo(o)!==eo(u)?`${l}:${eo(u)}`:o;this.onChainChanged(y)}else this.events.emit(s.name,s.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:r})=>{var s;const{namespaces:o}=r,u=(s=this.client)==null?void 0:s.session.get(t);this.session=ro(ls({},u),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:r})}),this.client.on("session_delete",async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",ro(ls({},ve("USER_DISCONNECTED")),{data:t.topic}))}),this.on(Ct.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(t,!0)})}getProvider(t){if(!this.rpcProviders[t])throw new Error(`Provider not found: ${t}`);return this.rpcProviders[t]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var r;this.getProvider(t).updateNamespace((r=this.session)==null?void 0:r.namespaces[t])})}setNamespaces(t){const{namespaces:r,optionalNamespaces:s,sessionProperties:o}=t;r&&Object.keys(r).length&&(this.namespaces=r),s&&Object.keys(s).length&&(this.optionalNamespaces=s),this.sessionProperties=o,this.persist("namespaces",r),this.persist("optionalNamespaces",s)}validateChain(t){const[r,s]=(t==null?void 0:t.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,s];if(r&&!Object.keys(this.namespaces||{}).map(l=>oi(l)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&s)return[r,s];const o=oi(Object.keys(this.namespaces)[0]),u=this.rpcProviders[o].getDefaultChain();return[o,u]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t,r=!1){var s;if(!this.namespaces)return;const[o,u]=this.validateChain(t);r||this.getProvider(o).setDefaultChain(u),((s=this.namespaces[o])!=null?s:this.namespaces[`${o}:${u}`]).defaultChain=u,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",u)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(t,r){this.client.core.storage.setItem(`${Yu}/${t}`,r)}async getFromStore(t){return await this.client.core.storage.getItem(`${Yu}/${t}`)}}const gE=So,yE="wc",mE="ethereum_provider",vE=`${yE}@2:${mE}:`,wE="https://rpc.walletconnect.com/v1/",ys=["eth_sendTransaction","personal_sign"],Lh=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],ms=["chainChanged","accountsChanged"],zh=["chainChanged","accountsChanged","message","disconnect","connect"];var _E=Object.defineProperty,bE=Object.defineProperties,EE=Object.getOwnPropertyDescriptors,ih=Object.getOwnPropertySymbols,IE=Object.prototype.hasOwnProperty,PE=Object.prototype.propertyIsEnumerable,sh=(a,t,r)=>t in a?_E(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,ci=(a,t)=>{for(var r in t||(t={}))IE.call(t,r)&&sh(a,r,t[r]);if(ih)for(var r of ih(t))PE.call(t,r)&&sh(a,r,t[r]);return a},nh=(a,t)=>bE(a,EE(t));function vs(a){return Number(a[0].split(":")[1])}function io(a){return`0x${a.toString(16)}`}function SE(a){const{chains:t,optionalChains:r,methods:s,optionalMethods:o,events:u,optionalEvents:l,rpcMap:y}=a;if(!so(t))throw new Error("Invalid chains");const I={chains:t,methods:s||ys,events:u||ms,rpcMap:ci({},t.length?{[vs(t)]:y[vs(t)]}:{})},S=u==null?void 0:u.filter(B=>!ms.includes(B)),R=s==null?void 0:s.filter(B=>!ys.includes(B));if(!r&&!l&&!o&&!(S!=null&&S.length)&&!(R!=null&&R.length))return{required:t.length?I:void 0};const x=(S==null?void 0:S.length)&&(R==null?void 0:R.length)||!r,j={chains:[...new Set(x?I.chains.concat(r||[]):r)],methods:[...new Set(I.methods.concat(o!=null&&o.length?o:Lh))],events:[...new Set(I.events.concat(l!=null&&l.length?l:zh))],rpcMap:y};return{required:t.length?I:void 0,optional:r.length?j:void 0}}class Es{constructor(){this.events=new Ge.eventsExports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=vE,this.on=(t,r)=>(this.events.on(t,r),this),this.once=(t,r)=>(this.events.once(t,r),this),this.removeListener=(t,r)=>(this.events.removeListener(t,r),this),this.off=(t,r)=>(this.events.off(t,r),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){const r=new Es;return await r.initialize(t),r}async request(t){return await this.signer.request(t,this.formatChainId(this.chainId))}sendAsync(t,r){this.signer.sendAsync(t,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);const{required:r,optional:s}=SE(this.rpc);try{const o=await new Promise(async(l,y)=>{var I;this.rpc.showQrModal&&((I=this.modal)==null||I.subscribeModal(S=>{!S.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),y(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(nh(ci({namespaces:ci({},r&&{[this.namespace]:r})},s&&{optionalNamespaces:{[this.namespace]:s}}),{pairingTopic:t==null?void 0:t.pairingTopic})).then(S=>{l(S)}).catch(S=>{y(new Error(S.message))})});if(!o)return;const u=Uv(o.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:u),this.setAccounts(u),this.events.emit("connect",{chainId:io(this.chainId)})}catch(o){throw this.signer.logger.error(o),o}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",t=>{const{params:r}=t,{event:s}=r;s.name==="accountsChanged"?(this.accounts=this.parseAccounts(s.data),this.events.emit("accountsChanged",this.accounts)):s.name==="chainChanged"?this.setChainId(this.formatChainId(s.data)):this.events.emit(s.name,s.data),this.events.emit("session_event",t)}),this.signer.on("chainChanged",t=>{const r=parseInt(t);this.chainId=r,this.events.emit("chainChanged",io(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",nh(ci({},Lv("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",t=>{var r,s;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(s=this.modal)==null||s.openModal({uri:t})),this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return typeof t=="string"?t.startsWith(`${this.namespace}:`):!1}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){const r=t.filter(s=>this.isCompatibleChainId(s)).map(s=>this.parseChainId(s));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",io(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const r=this.parseChainId(t);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(t){const[r,s,o]=t.split(":");return{chainId:`${r}:${s}`,address:o}}setAccounts(t){this.accounts=t.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var r,s;const o=(r=t==null?void 0:t.chains)!=null?r:[],u=(s=t==null?void 0:t.optionalChains)!=null?s:[],l=o.concat(u);if(!l.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const y=o.length?(t==null?void 0:t.methods)||ys:[],I=o.length?(t==null?void 0:t.events)||ms:[],S=(t==null?void 0:t.optionalMethods)||[],R=(t==null?void 0:t.optionalEvents)||[],x=(t==null?void 0:t.rpcMap)||this.buildRpcMap(l,t.projectId),j=(t==null?void 0:t.qrModalOptions)||void 0;return{chains:o==null?void 0:o.map(B=>this.formatChainId(B)),optionalChains:u.map(B=>this.formatChainId(B)),methods:y,events:I,optionalMethods:S,optionalEvents:R,rpcMap:x,showQrModal:!!(t!=null&&t.showQrModal),qrModalOptions:j,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,r){const s={};return t.forEach(o=>{s[o]=this.getRpcUrl(o,r)}),s}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?vs(this.rpc.chains):vs(this.rpc.optionalChains),this.signer=await gE.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:s}=await Promise.resolve().then(()=>require("./index-EPcXyhD3.js")).then(o=>o.index);r=s}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(ci({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(s){throw this.signer.logger.error(s),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:r,optionalChains:s,rpcMap:o}=t;r&&so(r)&&(this.rpc.chains=r.map(u=>this.formatChainId(u)),r.forEach(u=>{this.rpc.rpcMap[u]=(o==null?void 0:o[u])||this.getRpcUrl(u)})),s&&so(s)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=s==null?void 0:s.map(u=>this.formatChainId(u)),s.forEach(u=>{this.rpc.rpcMap[u]=(o==null?void 0:o[u])||this.getRpcUrl(u)}))}getRpcUrl(t,r){var s;return((s=this.rpc.rpcMap)==null?void 0:s[t])||`${wE}?chainId=eip155:${t}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return typeof t=="string"||t instanceof String?[this.parseAccount(t)]:t.map(r=>this.parseAccount(r))}}const OE=Es;exports.EthereumProvider=OE;exports.OPTIONAL_EVENTS=zh;exports.OPTIONAL_METHODS=Lh;exports.REQUIRED_EVENTS=ms;exports.REQUIRED_METHODS=ys;exports.default=Es;
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index-BZ7LatAr.js");exports.AutomaticCCTPRoute=t.AutomaticCCTPRoute;exports.AutomaticTokenBridgeRoute=t.AutomaticTokenBridgeRoute;exports.CCTPRoute=t.CCTPRoute;exports.DEFAULT_ROUTES=t.DEFAULT_ROUTES;exports.MAINNET=t.MAINNET;exports.MayanRoute=t.MayanRoute;exports.MayanRouteMCTP=t.MayanRouteMCTP;exports.MayanRouteSWIFT=t.MayanRouteSWIFT;exports.MayanRouteWH=t.MayanRouteWH;exports.TESTNET=t.TESTNET;exports.TokenBridgeRoute=t.TokenBridgeRoute;exports.dark=t.dark;exports.default=t.WormholeConnect;exports.light=t.light;exports.nttAutomaticRoute=t.nttAutomaticRoute;exports.nttManualRoute=t.nttManualRoute;exports.nttRoutes=t.nttRoutes;
|
package/lib/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dV as d, dT as o, dW as s, dP as e, dL as u, dX as R, dZ as T, d_ as n, dY as M, dM as i, dU as r, dN as A, dK as C, dO as E, dR as m, dS as y, dQ as N } from "./index-
|
|
1
|
+
import { dV as d, dT as o, dW as s, dP as e, dL as u, dX as R, dZ as T, d_ as n, dY as M, dM as i, dU as r, dN as A, dK as C, dO as E, dR as m, dS as y, dQ as N } from "./index-EhUlCH18.mjs";
|
|
2
2
|
export {
|
|
3
3
|
d as AutomaticCCTPRoute,
|
|
4
4
|
o as AutomaticTokenBridgeRoute,
|