@wormhole-foundation/wormhole-connect 1.0.0-beta.1-development → 1.0.0-beta.3-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-YN27M9dL.js} +1 -1
- package/dist/assets/{evm-B97OP4_W.js → evm-wKiUiV3-.js} +4 -4
- package/dist/assets/{index-B4nwQysh.js → index-8fbGA94c.js} +1 -1
- package/dist/assets/{index-B3CIvGYj.js → index-B9_Snb-C.js} +2 -2
- package/dist/assets/{index-CUWn-lgC.js → index-BBy_QGBB.js} +1 -1
- package/dist/assets/{index.es-DMMEjdkD.js → index.es-BY7lrdO_.js} +2 -2
- package/dist/main.js +61 -67
- package/dist/src/config/index.d.ts.map +1 -1
- package/dist/src/config/types.d.ts +0 -8
- 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/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/index.d.ts +2 -0
- package/dist/src/utils/index.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/index.d.ts.map +1 -1
- package/lib/{algorand-D-BdPUAb.mjs → algorand-BZLSulqp.mjs} +3 -3
- package/lib/{algorand-BgrZh6rH.js → algorand-DIrI8hux.js} +1 -1
- package/lib/{aptos-CATrqTpB.js → aptos-B61S9Mku.js} +1 -1
- package/lib/{aptos-CmpYdVuv.mjs → aptos-BXyptrTk.mjs} +3 -3
- package/lib/{aptos-CeHwTLqC.mjs → aptos-ClFQX748.mjs} +1 -1
- package/lib/{aptos-CA8QZDqZ.js → aptos-poOCeL-e.js} +2 -2
- package/lib/{ccip-BMQmQT67.mjs → ccip-BcLqF-ov.mjs} +1 -1
- package/lib/{ccip-B-v_m1LK.js → ccip-CROSeCCn.js} +1 -1
- package/lib/{cosmos-Bh-ZHBp5.mjs → cosmos-B7IowZE9.mjs} +6 -6
- package/lib/{cosmos-ksRGnYO-.js → cosmos-D-fRtzTz.js} +1 -1
- package/lib/{cosmwasm-o9pLVX_k.js → cosmwasm-BU28GqyN.js} +2 -2
- package/lib/{cosmwasm-C-wFDXoO.mjs → cosmwasm-i8-2LBd4.mjs} +7 -7
- package/lib/{events-BWa5Dt3J.mjs → events-BIfEV615.mjs} +1 -1
- package/lib/{events-DPgA7TqX.js → events-CG085uVS.js} +1 -1
- package/lib/{evm-SljAss8Z.mjs → evm-BG4p6wWc.mjs} +7 -7
- package/lib/{evm-Bo__7sSE.js → evm-DSo1klm4.js} +4 -4
- package/lib/{evm-BD__DIo1.mjs → evm-DqVh4NBz.mjs} +5 -5
- package/lib/{evm-DDtxPajQ.js → evm-z72BQwjo.js} +1 -1
- package/lib/{index-CRvWgES1.js → index--kQS0wX-.js} +1 -1
- package/lib/{index-CFxkimTS.mjs → index--orPBbEs.mjs} +3 -3
- package/lib/{index-BNk2jOXm.js → index-2u6Q9y32.js} +1 -1
- package/lib/{index-xkiQhLtp.mjs → index-3CEBQmCn.mjs} +2 -2
- package/lib/{index-B-MBhpe0.js → index-9Ifk_2V6.js} +1 -1
- package/lib/{index-BslyDK6y.mjs → index-B-bMfv9J.mjs} +3 -3
- package/lib/{index-DPrVdTMi.mjs → index-B3uNul6-.mjs} +3 -3
- package/lib/{index-7CTgJQOQ.mjs → index-B51snNHX.mjs} +1 -1
- package/lib/{index-LRaD5GwM.mjs → index-BDhzG0Bz.mjs} +6887 -6755
- package/lib/{index-C9d-aAW8.mjs → index-BM3TrHYu.mjs} +7 -7
- package/lib/{index-Ddkg7QVK.mjs → index-BUcxdUpo.mjs} +2 -2
- package/lib/{index-Cm3OT3uK.js → index-BhfoV5RZ.js} +1 -1
- package/lib/{index-CvuTcJSI.mjs → index-Bn9MsO0e.mjs} +2 -2
- package/lib/{index-Cpxx41dy.js → index-BrFyHtHO.js} +1 -1
- package/lib/{index-DrMU1dLJ.js → index-ByG9EJHX.js} +79 -84
- package/lib/{index-BD0yz6tu.js → index-C1XMdJFH.js} +1 -1
- package/lib/{index-PaF1hgt3.mjs → index-C1fq1xT0.mjs} +2 -2
- package/lib/{index-ByFmI7fl.mjs → index-C1t8_dYP.mjs} +1 -1
- package/lib/{index-DnW_8WuE.mjs → index-C262JAz4.mjs} +4 -4
- package/lib/{index-BrNN7bqh.mjs → index-C2ZrCXVv.mjs} +2 -2
- package/lib/{index-BA87Paw9.mjs → index-C3Ztf7te.mjs} +4 -4
- package/lib/{index-BYj4cYE2.mjs → index-C8UyzBg3.mjs} +4 -4
- package/lib/{index-CVizGyR3.mjs → index-C8tIBuyM.mjs} +1 -1
- package/lib/{index-Bvy2urku.js → index-CGmv-GLf.js} +1 -1
- package/lib/{index-BQQ1YCDk.js → index-CJJaUncM.js} +1 -1
- package/lib/{index-C9ExQapt.js → index-CLiemfL3.js} +1 -1
- package/lib/{index-D2X6frcJ.js → index-CQ_e_FtW.js} +1 -1
- package/lib/{index-CGWI5MkA.js → index-CYfEuKEC.js} +1 -1
- package/lib/{index-DFUaa0TE.js → index-CdnXAZl6.js} +1 -1
- package/lib/{index-Bm-ooA-8.js → index-Cf-xLfst.js} +1 -1
- package/lib/{index-BJlBMw-S.mjs → index-Cfu2mlWW.mjs} +2 -2
- package/lib/{index-w4I6zC7D.js → index-CkrE6mmF.js} +1 -1
- package/lib/{index-ma17SOHh.js → index-Coqx-ZYc.js} +1 -1
- package/lib/{index-ZhtSUjN2.js → index-CytdQ1id.js} +1 -1
- package/lib/{index-CI4Wimyz.js → index-D1GFc9u_.js} +1 -1
- package/lib/{index-CihYnnL-.js → index-DEfagu36.js} +1 -1
- package/lib/{index-BU0JH9mJ.mjs → index-DGI2tbSC.mjs} +1 -1
- package/lib/{index-wz3LbIKe.mjs → index-DTLOaiZ5.mjs} +2 -2
- package/lib/{index-B5qZWsrJ.mjs → index-DTj0BYI6.mjs} +1 -1
- package/lib/{index-B-J7cTiK.mjs → index-DTtBAHqC.mjs} +2 -2
- package/lib/{index-3mar0UQr.mjs → index-DjSK9SdK.mjs} +2 -2
- package/lib/{index-CdREPuOV.js → index-DkmEXbbA.js} +1 -1
- package/lib/{index-D2Tw2fd0.js → index-GyFHGs5Z.js} +1 -1
- package/lib/{index-pZcxlLhg.mjs → index-Xxsx46yX.mjs} +1 -1
- package/lib/{index-W02R6fpy.js → index-eY_q88kc.js} +1 -1
- package/lib/{index-CjlxucQW.mjs → index-l3VuXtv4.mjs} +2 -2
- package/lib/{index-CQz5TuuG.js → index-x3yNXPc-.js} +1 -1
- package/lib/{index-C7jTj2To.js → index-xrevpHY6.js} +1 -1
- package/lib/{index.es-tANmFq-b.js → index.es-CTYy3A6V.js} +2 -2
- package/lib/{index.es-CKfzoruR.mjs → index.es-zlUSra_a.mjs} +5 -5
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{libsodium-wrappers-2v8zIqd0.mjs → libsodium-wrappers-BL6m46dv.mjs} +1 -1
- package/lib/{libsodium-wrappers-BUvbW9gF.js → libsodium-wrappers-_Sv3nUjE.js} +1 -1
- package/lib/{pako.esm-BMyUH3EC.mjs → pako.esm-Bf33_673.mjs} +3 -3
- package/lib/{pako.esm-BYIheyHK.js → pako.esm-CEjOh_1P.js} +1 -1
- package/lib/{pbkdf2-UD0Tc_gW.js → pbkdf2-BJ3CFykt.js} +1 -1
- package/lib/{pbkdf2-Cs0L5Yy1.mjs → pbkdf2-C3vdgkb4.mjs} +1 -1
- package/lib/{sei-xJVzoq-b.mjs → sei-BXWrZef6.mjs} +4 -4
- package/lib/{sei-SvEHSilI.js → sei-LGYYUG8M.js} +1 -1
- package/lib/{signer-DXjyd0up.js → signer-BQ4T60Nz.js} +1 -1
- package/lib/{signer-BxofHac_.mjs → signer-DaJj3hCp.mjs} +1 -1
- package/lib/solana-6EZacoKb.js +1 -0
- package/lib/{solana-ySRMXxyQ.js → solana-AQlZomQ6.js} +1 -1
- package/lib/solana-CbB3tRah.mjs +16 -0
- package/lib/{solana-DcACAvjT.mjs → solana-Cl4jwD2F.mjs} +4 -4
- package/lib/{solanaEmbed.esm-Df1M0bDZ.js → solanaEmbed.esm-B_5axZif.js} +1 -1
- package/lib/{solanaEmbed.esm-DBTvwrFj.mjs → solanaEmbed.esm-DEMxZG02.mjs} +4 -4
- package/lib/src/config/index.d.ts.map +1 -1
- package/lib/src/config/types.d.ts +0 -8
- 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/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/index.d.ts +2 -0
- package/lib/src/utils/index.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/index.d.ts.map +1 -1
- package/lib/{sui-Cyoug3Go.mjs → sui-BpKCqOiX.mjs} +4 -4
- package/lib/{sui-8gf1B7bO.mjs → sui-DfdFzATl.mjs} +1 -1
- package/lib/{sui-Cke2TbcJ.js → sui-IAt2YxVB.js} +2 -2
- package/lib/{sui-BnN9t4QC.js → sui-tX-807Bw.js} +1 -1
- package/lib/{unsignedTransaction-BxebONkK.mjs → unsignedTransaction-B1rzGa0o.mjs} +2 -2
- package/lib/{unsignedTransaction-eEgPAqvi.js → unsignedTransaction-BzNQ2WFS.js} +1 -1
- package/lib/{utils-BvaOEETp.js → utils-DZZcQv7V.js} +1 -1
- package/lib/{utils-CpUQ2GWl.mjs → utils-Xa6ErDQY.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,7 +1,7 @@
|
|
|
1
1
|
var Pt = Object.defineProperty;
|
|
2
2
|
var _t = (e, t, r) => t in e ? Pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var f = (e, t, r) => _t(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { aX as c, bw as A, bA as z, bz as U, Z as l, cf as le, bB as G, by as S, bx as V, cg as Ge, ch as Ze, ci as Wt, cj as It, ck as Ut, cl as Nt, cm as O, cn as E, a8 as y, co as b, cp as Ft, cq as ye, c9 as dt, cr as xt, cs as lt, ct as zt, cu as Ot, cv as Q, cw as Lt, cx as Z, cy as H, cz as Dt, cA as qt, cB as Kt, cC as Vt, cD as Se, cE as Gt, cF as v, cG as Zt, e as oe, S as k, c7 as Ce, c8 as Ht, p as $, ce as Be, cH as Yt, cI as Qt, b6 as se, a$ as L, a5 as Xt, cJ as ft, bR as mt, g as gt } from "./index-
|
|
4
|
+
import { aX as c, bw as A, bA as z, bz as U, Z as l, cf as le, bB as G, by as S, bx as V, cg as Ge, ch as Ze, ci as Wt, cj as It, ck as Ut, cl as Nt, cm as O, cn as E, a8 as y, co as b, cp as Ft, cq as ye, c9 as dt, cr as xt, cs as lt, ct as zt, cu as Ot, cv as Q, cw as Lt, cx as Z, cy as H, cz as Dt, cA as qt, cB as Kt, cC as Vt, cD as Se, cE as Gt, cF as v, cG as Zt, e as oe, S as k, c7 as Ce, c8 as Ht, p as $, ce as Be, cH as Yt, cI as Qt, b6 as se, a$ as L, a5 as Xt, cJ as ft, bR as mt, g as gt } from "./index-BDhzG0Bz.mjs";
|
|
5
5
|
const M = new c("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
|
|
6
6
|
new c("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
|
7
7
|
const Ae = new c("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"), D = new c("So11111111111111111111111111111111111111112");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const N=require("./index-DrMU1dLJ.js"),ze=require("./index-CihYnnL-.js"),Qn=require("./events-DPgA7TqX.js");function Wr(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function Hr(e,r){r||(r=e.reduce((s,d)=>s+d.length,0));const n=Wr(r);let a=0;for(const s of e)n.set(s,a),a+=s.length;return n}const vr={...ze.identityBase,...ze.base2,...ze.base8,...ze.base10,...ze.base16,...ze.base32,...ze.base36,...ze.base58,...ze.base64,...ze.base256emoji};function $r(e,r,n,a){return{name:e,prefix:r,encoder:{name:e,prefix:r,encode:n},decoder:{decode:a}}}const xr=$r("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Yt=$r("ascii","a",e=>{let r="a";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return r},e=>{e=e.substring(1);const r=Wr(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}),Gr={utf8:xr,"utf-8":xr,hex:vr.base16,latin1:Yt,ascii:Yt,binary:Yt,...vr};function Ft(e,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):n.decoder.decode(`${n.prefix}${e}`)}function Jt(e,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}var Er=function(e,r,n){if(n||arguments.length===2)for(var a=0,s=r.length,d;a<s;a++)(d||!(a in r))&&(d||(d=Array.prototype.slice.call(r,0,a)),d[a]=r[a]);return e.concat(d||Array.prototype.slice.call(r))},ei=function(){function e(r,n,a){this.name=r,this.version=n,this.os=a,this.type="browser"}return e}(),ti=function(){function e(r){this.version=r,this.type="node",this.name="node",this.os=N.dist.process.platform}return e}(),ri=function(){function e(r,n,a,s){this.name=r,this.version=n,this.os=a,this.bot=s,this.type="bot-device"}return e}(),ni=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),ii=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),si=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,oi=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Sr=3,ai=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",si]],Ir=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function fi(e){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ii:typeof navigator<"u"?ui(navigator.userAgent):di()}function ci(e){return e!==""&&ai.reduce(function(r,n){var a=n[0],s=n[1];if(r)return r;var d=s.exec(e);return!!d&&[a,d]},!1)}function ui(e){var r=ci(e);if(!r)return null;var n=r[0],a=r[1];if(n==="searchbot")return new ni;var s=a[1]&&a[1].split(".").join("_").split("_").slice(0,3);s?s.length<Sr&&(s=Er(Er([],s,!0),hi(Sr-s.length),!0)):s=[];var d=s.join("."),E=li(e),v=oi.exec(e);return v&&v[1]?new ri(n,d,E,v[1]):new ei(n,d,E)}function li(e){for(var r=0,n=Ir.length;r<n;r++){var a=Ir[r],s=a[0],d=a[1],E=d.exec(e);if(E)return s}return null}function di(){var e=typeof N.dist.process<"u"&&N.dist.process.version;return e?new ti(N.dist.process.version.slice(1)):null}function hi(e){for(var r=[],n=0;n<e;n++)r.push("0");return r}const bi={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},gi=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,yi=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,pi=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function _i(e,r){if(e==="__proto__"||e==="constructor"&&r&&typeof r=="object"&&"prototype"in r){mi(e);return}return r}function mi(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function zt(e,r={}){if(typeof e!="string")return e;const n=e.trim();if(e[0]==='"'&&e.endsWith('"')&&!e.includes("\\"))return n.slice(1,-1);if(n.length<=9){const a=n.toLowerCase();if(a==="true")return!0;if(a==="false")return!1;if(a==="undefined")return;if(a==="null")return null;if(a==="nan")return Number.NaN;if(a==="infinity")return Number.POSITIVE_INFINITY;if(a==="-infinity")return Number.NEGATIVE_INFINITY}if(!pi.test(e)){if(r.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(gi.test(e)||yi.test(e)){if(r.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,_i)}return JSON.parse(e)}catch(a){if(r.strict)throw a;return e}}function wi(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function Te(e,...r){try{return wi(e(...r))}catch(n){return Promise.reject(n)}}function vi(e){const r=typeof e;return e===null||r!=="object"&&r!=="function"}function xi(e){const r=Object.getPrototypeOf(e);return!r||r.isPrototypeOf(Object)}function Ut(e){if(vi(e))return String(e);if(xi(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return Ut(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function kr(){if(typeof N.dist.Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const tr="base64:";function Ei(e){if(typeof e=="string")return e;kr();const r=N.dist.Buffer.from(e).toString("base64");return tr+r}function Si(e){return typeof e!="string"||!e.startsWith(tr)?e:(kr(),N.dist.Buffer.from(e.slice(tr.length),"base64"))}function Ue(e){return e?e.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function Ii(...e){return Ue(e.join(":"))}function Dt(e){return e=Ue(e),e?e+":":""}const Oi="memory",Ti=()=>{const e=new Map;return{name:Oi,options:{},hasItem(r){return e.has(r)},getItem(r){return e.get(r)??null},getItemRaw(r){return e.get(r)??null},setItem(r,n){e.set(r,n)},setItemRaw(r,n){e.set(r,n)},removeItem(r){e.delete(r)},getKeys(){return Array.from(e.keys())},clear(){e.clear()},dispose(){e.clear()}}};function Ai(e={}){const r={mounts:{"":e.driver||Ti()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=o=>{for(const l of r.mountpoints)if(o.startsWith(l))return{base:l,relativeKey:o.slice(l.length),driver:r.mounts[l]};return{base:"",relativeKey:o,driver:r.mounts[""]}},a=(o,l)=>r.mountpoints.filter(y=>y.startsWith(o)||l&&o.startsWith(y)).map(y=>({relativeBase:o.length>y.length?o.slice(y.length):void 0,mountpoint:y,driver:r.mounts[y]})),s=(o,l)=>{if(r.watching){l=Ue(l);for(const y of r.watchListeners)y(o,l)}},d=async()=>{if(!r.watching){r.watching=!0;for(const o in r.mounts)r.unwatch[o]=await Or(r.mounts[o],s,o)}},E=async()=>{if(r.watching){for(const o in r.unwatch)await r.unwatch[o]();r.unwatch={},r.watching=!1}},v=(o,l,y)=>{const S=new Map,x=w=>{let j=S.get(w.base);return j||(j={driver:w.driver,base:w.base,items:[]},S.set(w.base,j)),j};for(const w of o){const j=typeof w=="string",J=Ue(j?w:w.key),q=j?void 0:w.value,B=j||!w.options?l:{...l,...w.options},Ae=n(J);x(Ae).items.push({key:J,value:q,relativeKey:Ae.relativeKey,options:B})}return Promise.all([...S.values()].map(w=>y(w))).then(w=>w.flat())},g={hasItem(o,l={}){o=Ue(o);const{relativeKey:y,driver:S}=n(o);return Te(S.hasItem,y,l)},getItem(o,l={}){o=Ue(o);const{relativeKey:y,driver:S}=n(o);return Te(S.getItem,y,l).then(x=>zt(x))},getItems(o,l){return v(o,l,y=>y.driver.getItems?Te(y.driver.getItems,y.items.map(S=>({key:S.relativeKey,options:S.options})),l).then(S=>S.map(x=>({key:Ii(y.base,x.key),value:zt(x.value)}))):Promise.all(y.items.map(S=>Te(y.driver.getItem,S.relativeKey,S.options).then(x=>({key:S.key,value:zt(x)})))))},getItemRaw(o,l={}){o=Ue(o);const{relativeKey:y,driver:S}=n(o);return S.getItemRaw?Te(S.getItemRaw,y,l):Te(S.getItem,y,l).then(x=>Si(x))},async setItem(o,l,y={}){if(l===void 0)return g.removeItem(o);o=Ue(o);const{relativeKey:S,driver:x}=n(o);x.setItem&&(await Te(x.setItem,S,Ut(l),y),x.watch||s("update",o))},async setItems(o,l){await v(o,l,async y=>{if(y.driver.setItems)return Te(y.driver.setItems,y.items.map(S=>({key:S.relativeKey,value:Ut(S.value),options:S.options})),l);y.driver.setItem&&await Promise.all(y.items.map(S=>Te(y.driver.setItem,S.relativeKey,Ut(S.value),S.options)))})},async setItemRaw(o,l,y={}){if(l===void 0)return g.removeItem(o,y);o=Ue(o);const{relativeKey:S,driver:x}=n(o);if(x.setItemRaw)await Te(x.setItemRaw,S,l,y);else if(x.setItem)await Te(x.setItem,S,Ei(l),y);else return;x.watch||s("update",o)},async removeItem(o,l={}){typeof l=="boolean"&&(l={removeMeta:l}),o=Ue(o);const{relativeKey:y,driver:S}=n(o);S.removeItem&&(await Te(S.removeItem,y,l),(l.removeMeta||l.removeMata)&&await Te(S.removeItem,y+"$",l),S.watch||s("remove",o))},async getMeta(o,l={}){typeof l=="boolean"&&(l={nativeOnly:l}),o=Ue(o);const{relativeKey:y,driver:S}=n(o),x=Object.create(null);if(S.getMeta&&Object.assign(x,await Te(S.getMeta,y,l)),!l.nativeOnly){const w=await Te(S.getItem,y+"$",l).then(j=>zt(j));w&&typeof w=="object"&&(typeof w.atime=="string"&&(w.atime=new Date(w.atime)),typeof w.mtime=="string"&&(w.mtime=new Date(w.mtime)),Object.assign(x,w))}return x},setMeta(o,l,y={}){return this.setItem(o+"$",l,y)},removeMeta(o,l={}){return this.removeItem(o+"$",l)},async getKeys(o,l={}){o=Dt(o);const y=a(o,!0);let S=[];const x=[];for(const w of y){const J=(await Te(w.driver.getKeys,w.relativeBase,l)).map(q=>w.mountpoint+Ue(q)).filter(q=>!S.some(B=>q.startsWith(B)));x.push(...J),S=[w.mountpoint,...S.filter(q=>!q.startsWith(w.mountpoint))]}return o?x.filter(w=>w.startsWith(o)&&!w.endsWith("$")):x.filter(w=>!w.endsWith("$"))},async clear(o,l={}){o=Dt(o),await Promise.all(a(o,!1).map(async y=>{if(y.driver.clear)return Te(y.driver.clear,y.relativeBase,l);if(y.driver.removeItem){const S=await y.driver.getKeys(y.relativeBase||"",l);return Promise.all(S.map(x=>y.driver.removeItem(x,l)))}}))},async dispose(){await Promise.all(Object.values(r.mounts).map(o=>Tr(o)))},async watch(o){return await d(),r.watchListeners.push(o),async()=>{r.watchListeners=r.watchListeners.filter(l=>l!==o),r.watchListeners.length===0&&await E()}},async unwatch(){r.watchListeners=[],await E()},mount(o,l){if(o=Dt(o),o&&r.mounts[o])throw new Error(`already mounted at ${o}`);return o&&(r.mountpoints.push(o),r.mountpoints.sort((y,S)=>S.length-y.length)),r.mounts[o]=l,r.watching&&Promise.resolve(Or(l,s,o)).then(y=>{r.unwatch[o]=y}).catch(console.error),g},async unmount(o,l=!0){o=Dt(o),!(!o||!r.mounts[o])&&(r.watching&&o in r.unwatch&&(r.unwatch[o](),delete r.unwatch[o]),l&&await Tr(r.mounts[o]),r.mountpoints=r.mountpoints.filter(y=>y!==o),delete r.mounts[o])},getMount(o=""){o=Ue(o)+":";const l=n(o);return{driver:l.driver,base:l.base}},getMounts(o="",l={}){return o=Ue(o),a(o,l.parents).map(S=>({driver:S.driver,base:S.mountpoint}))}};return g}function Or(e,r,n){return e.watch?e.watch((a,s)=>r(a,n+s)):()=>{}}async function Tr(e){typeof e.dispose=="function"&&await Te(e.dispose)}function bt(e){return new Promise((r,n)=>{e.oncomplete=e.onsuccess=()=>r(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Fr(e,r){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(r);const a=bt(n);return(s,d)=>a.then(E=>d(E.transaction(r,s).objectStore(r)))}let Zt;function At(){return Zt||(Zt=Fr("keyval-store","keyval")),Zt}function Ar(e,r=At()){return r("readonly",n=>bt(n.get(e)))}function Li(e,r,n=At()){return n("readwrite",a=>(a.put(r,e),bt(a.transaction)))}function Ri(e,r=At()){return r("readwrite",n=>(n.delete(e),bt(n.transaction)))}function Pi(e=At()){return e("readwrite",r=>(r.clear(),bt(r.transaction)))}function Ci(e,r){return e.openCursor().onsuccess=function(){this.result&&(r(this.result),this.result.continue())},bt(e.transaction)}function Mi(e=At()){return e("readonly",r=>{if(r.getAllKeys)return bt(r.getAllKeys());const n=[];return Ci(r,a=>n.push(a.key)).then(()=>n)})}const ji=e=>JSON.stringify(e,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),Ni=e=>{const r=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,n=e.replace(r,'$1"$2n"$3');return JSON.parse(n,(a,s)=>typeof s=="string"&&s.match(/^\d+n$/)?BigInt(s.substring(0,s.length-1)):s)};function Vt(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return Ni(e)}catch{return e}}function ht(e){return typeof e=="string"?e:ji(e)||""}const Bi="idb-keyval";var zi=(e={})=>{const r=e.base&&e.base.length>0?`${e.base}:`:"",n=s=>r+s;let a;return e.dbName&&e.storeName&&(a=Fr(e.dbName,e.storeName)),{name:Bi,options:e,async hasItem(s){return!(typeof await Ar(n(s),a)>"u")},async getItem(s){return await Ar(n(s),a)??null},setItem(s,d){return Li(n(s),d,a)},removeItem(s){return Ri(n(s),a)},getKeys(){return Mi(a)},clear(){return Pi(a)}}};const Di="WALLET_CONNECT_V2_INDEXED_DB",Ki="keyvaluestorage";let Ui=class{constructor(){this.indexedDb=Ai({driver:zi({dbName:Di,storeName:Ki})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(r=>[r.key,r.value])}async getItem(r){const n=await this.indexedDb.getItem(r);if(n!==null)return n}async setItem(r,n){await this.indexedDb.setItem(r,ht(n))}async removeItem(r){await this.indexedDb.removeItem(r)}};var Qt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof N.dist.global<"u"?N.dist.global:typeof self<"u"?self:{},Wt={exports:{}};(function(){let e;function r(){}e=r,e.prototype.getItem=function(n){return this.hasOwnProperty(n)?String(this[n]):null},e.prototype.setItem=function(n,a){this[n]=String(a)},e.prototype.removeItem=function(n){delete this[n]},e.prototype.clear=function(){const n=this;Object.keys(n).forEach(function(a){n[a]=void 0,delete n[a]})},e.prototype.key=function(n){return n=n||0,Object.keys(this)[n]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Qt<"u"&&Qt.localStorage?Wt.exports=Qt.localStorage:typeof window<"u"&&window.localStorage?Wt.exports=window.localStorage:Wt.exports=new r})();function Wi(e){var r;return[e[0],Vt((r=e[1])!=null?r:"")]}class Hi{constructor(){this.localStorage=Wt.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Wi)}async getItem(r){const n=this.localStorage.getItem(r);if(n!==null)return Vt(n)}async setItem(r,n){this.localStorage.setItem(r,ht(n))}async removeItem(r){this.localStorage.removeItem(r)}}const $i="wc_storage_version",Lr=1,Gi=async(e,r,n)=>{const a=$i,s=await r.getItem(a);if(s&&s>=Lr){n(r);return}const d=await e.getKeys();if(!d.length){n(r);return}const E=[];for(;d.length;){const v=d.shift();if(!v)continue;const g=v.toLowerCase();if(g.includes("wc@")||g.includes("walletconnect")||g.includes("wc_")||g.includes("wallet_connect")){const o=await e.getItem(v);await r.setItem(v,o),E.push(v)}}await r.setItem(a,Lr),n(r),ki(e,E)},ki=async(e,r)=>{r.length&&r.forEach(async n=>{await e.removeItem(n)})};let Fi=class{constructor(){this.initialized=!1,this.setInitialized=n=>{this.storage=n,this.initialized=!0};const r=new Hi;this.storage=r;try{const n=new Ui;Gi(r,n,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(r){return await this.initialize(),this.storage.getItem(r)}async setItem(r,n){return await this.initialize(),this.storage.setItem(r,n)}async removeItem(r){return await this.initialize(),this.storage.removeItem(r)}async initialize(){this.initialized||await new Promise(r=>{const n=setInterval(()=>{this.initialized&&(clearInterval(n),r())},20)})}};class Ji{}function Vi(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var Xi=qi;function qi(e,r,n){var a=n&&n.stringify||Vi,s=1;if(typeof e=="object"&&e!==null){var d=r.length+s;if(d===1)return e;var E=new Array(d);E[0]=a(e);for(var v=1;v<d;v++)E[v]=a(r[v]);return E.join(" ")}if(typeof e!="string")return e;var g=r.length;if(g===0)return e;for(var o="",l=1-s,y=-1,S=e&&e.length||0,x=0;x<S;){if(e.charCodeAt(x)===37&&x+1<S){switch(y=y>-1?y:0,e.charCodeAt(x+1)){case 100:case 102:if(l>=g||r[l]==null)break;y<x&&(o+=e.slice(y,x)),o+=Number(r[l]),y=x+2,x++;break;case 105:if(l>=g||r[l]==null)break;y<x&&(o+=e.slice(y,x)),o+=Math.floor(Number(r[l])),y=x+2,x++;break;case 79:case 111:case 106:if(l>=g||r[l]===void 0)break;y<x&&(o+=e.slice(y,x));var w=typeof r[l];if(w==="string"){o+="'"+r[l]+"'",y=x+2,x++;break}if(w==="function"){o+=r[l].name||"<anonymous>",y=x+2,x++;break}o+=a(r[l]),y=x+2,x++;break;case 115:if(l>=g)break;y<x&&(o+=e.slice(y,x)),o+=String(r[l]),y=x+2,x++;break;case 37:y<x&&(o+=e.slice(y,x)),o+="%",y=x+2,x++,l--;break}++l}++x}return y===-1?e:(y<S&&(o+=e.slice(y)),o)}const Rr=Xi;var mt=Qe;const It=os().console||{},Yi={mapHttpRequest:Kt,mapHttpResponse:Kt,wrapRequestSerializer:er,wrapResponseSerializer:er,wrapErrorSerializer:er,req:Kt,res:Kt,err:rs};function Zi(e,r){return Array.isArray(e)?e.filter(function(a){return a!=="!stdSerializers.err"}):e===!0?Object.keys(r):!1}function Qe(e){e=e||{},e.browser=e.browser||{};const r=e.browser.transmit;if(r&&typeof r.send!="function")throw Error("pino: transmit option must have a send function");const n=e.browser.write||It;e.browser.write&&(e.browser.asObject=!0);const a=e.serializers||{},s=Zi(e.browser.serialize,a);let d=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(d=!1);const E=["error","fatal","warn","info","debug","trace"];typeof n=="function"&&(n.error=n.fatal=n.warn=n.info=n.debug=n.trace=n),e.enabled===!1&&(e.level="silent");const v=e.level||"info",g=Object.create(n);g.log||(g.log=Ot),Object.defineProperty(g,"levelVal",{get:l}),Object.defineProperty(g,"level",{get:y,set:S});const o={transmit:r,serialize:s,asObject:e.browser.asObject,levels:E,timestamp:ns(e)};g.levels=Qe.levels,g.level=v,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prependOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=Ot,g.serializers=a,g._serialize=s,g._stdErrSerialize=d,g.child=x,r&&(g._logEvent=rr());function l(){return this.level==="silent"?1/0:this.levels.values[this.level]}function y(){return this._level}function S(w){if(w!=="silent"&&!this.levels.values[w])throw Error("unknown level "+w);this._level=w,pt(o,g,"error","log"),pt(o,g,"fatal","error"),pt(o,g,"warn","error"),pt(o,g,"info","log"),pt(o,g,"debug","log"),pt(o,g,"trace","log")}function x(w,j){if(!w)throw new Error("missing bindings for child Pino");j=j||{},s&&w.serializers&&(j.serializers=w.serializers);const J=j.serializers;if(s&&J){var q=Object.assign({},a,J),B=e.browser.serialize===!0?Object.keys(q):s;delete w.serializers,Xt([w],B,q,this._stdErrSerialize)}function Ae(ge){this._childLevel=(ge._childLevel|0)+1,this.error=_t(ge,w,"error"),this.fatal=_t(ge,w,"fatal"),this.warn=_t(ge,w,"warn"),this.info=_t(ge,w,"info"),this.debug=_t(ge,w,"debug"),this.trace=_t(ge,w,"trace"),q&&(this.serializers=q,this._serialize=B),r&&(this._logEvent=rr([].concat(ge._logEvent.bindings,w)))}return Ae.prototype=this,new Ae(this)}return g}Qe.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};Qe.stdSerializers=Yi;Qe.stdTimeFunctions=Object.assign({},{nullTime:Jr,epochTime:Vr,unixTime:is,isoTime:ss});function pt(e,r,n,a){const s=Object.getPrototypeOf(r);r[n]=r.levelVal>r.levels.values[n]?Ot:s[n]?s[n]:It[n]||It[a]||Ot,Qi(e,r,n)}function Qi(e,r,n){!e.transmit&&r[n]===Ot||(r[n]=function(a){return function(){const d=e.timestamp(),E=new Array(arguments.length),v=Object.getPrototypeOf&&Object.getPrototypeOf(this)===It?It:this;for(var g=0;g<E.length;g++)E[g]=arguments[g];if(e.serialize&&!e.asObject&&Xt(E,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?a.call(v,es(this,n,E,d)):a.apply(v,E),e.transmit){const o=e.transmit.level||r.level,l=Qe.levels.values[o],y=Qe.levels.values[n];if(y<l)return;ts(this,{ts:d,methodLevel:n,methodValue:y,transmitLevel:o,transmitValue:Qe.levels.values[e.transmit.level||r.level],send:e.transmit.send,val:r.levelVal},E)}}}(r[n]))}function es(e,r,n,a){e._serialize&&Xt(n,e._serialize,e.serializers,e._stdErrSerialize);const s=n.slice();let d=s[0];const E={};a&&(E.time=a),E.level=Qe.levels.values[r];let v=(e._childLevel|0)+1;if(v<1&&(v=1),d!==null&&typeof d=="object"){for(;v--&&typeof s[0]=="object";)Object.assign(E,s.shift());d=s.length?Rr(s.shift(),s):void 0}else typeof d=="string"&&(d=Rr(s.shift(),s));return d!==void 0&&(E.msg=d),E}function Xt(e,r,n,a){for(const s in e)if(a&&e[s]instanceof Error)e[s]=Qe.stdSerializers.err(e[s]);else if(typeof e[s]=="object"&&!Array.isArray(e[s]))for(const d in e[s])r&&r.indexOf(d)>-1&&d in n&&(e[s][d]=n[d](e[s][d]))}function _t(e,r,n){return function(){const a=new Array(1+arguments.length);a[0]=r;for(var s=1;s<a.length;s++)a[s]=arguments[s-1];return e[n].apply(this,a)}}function ts(e,r,n){const a=r.send,s=r.ts,d=r.methodLevel,E=r.methodValue,v=r.val,g=e._logEvent.bindings;Xt(n,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=s,e._logEvent.messages=n.filter(function(o){return g.indexOf(o)===-1}),e._logEvent.level.label=d,e._logEvent.level.value=E,a(d,e._logEvent,v),e._logEvent=rr(g)}function rr(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function rs(e){const r={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)r[n]===void 0&&(r[n]=e[n]);return r}function ns(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Jr:Vr}function Kt(){return{}}function er(e){return e}function Ot(){}function Jr(){return!1}function Vr(){return Date.now()}function is(){return Math.round(Date.now()/1e3)}function ss(){return new Date(Date.now()).toISOString()}function os(){function e(r){return typeof r<"u"&&r}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}const or=N.getDefaultExportFromCjs(mt),as={level:"info"},Lt="custom_context",ar=1e3*1024;class fs{constructor(r){this.nodeValue=r,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class Pr{constructor(r){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=r,this.sizeInBytes=0}append(r){const n=new fs(r);if(n.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${r} with size ${n.size}`);for(;this.size+n.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.lengthInNodes++,this.sizeInBytes+=n.size}shift(){if(!this.head)return;const r=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=r.size}toArray(){const r=[];let n=this.head;for(;n!==null;)r.push(n.value),n=n.next;return r}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let r=this.head;return{next:()=>{if(!r)return{done:!0,value:null};const n=r.value;return r=r.next,{done:!1,value:n}}}}}class Xr{constructor(r,n=ar){this.level=r??"error",this.levelValue=mt.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=n,this.logs=new Pr(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(r,n){n===mt.levels.values.error?console.error(r):n===mt.levels.values.warn?console.warn(r):n===mt.levels.values.debug?console.debug(r):n===mt.levels.values.trace?console.trace(r):console.log(r)}appendToLogs(r){this.logs.append(ht({timestamp:new Date().toISOString(),log:r}));const n=typeof r=="string"?JSON.parse(r).level:r.level;n>=this.levelValue&&this.forwardToConsole(r,n)}getLogs(){return this.logs}clearLogs(){this.logs=new Pr(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(r){const n=this.getLogArray();return n.push(ht({extraMetadata:r})),new Blob(n,{type:"application/json"})}}class cs{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}downloadLogsBlobInBrowser(r){const n=URL.createObjectURL(this.logsToBlob(r)),a=document.createElement("a");a.href=n,a.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n)}}class us{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}}var ls=Object.defineProperty,ds=Object.defineProperties,hs=Object.getOwnPropertyDescriptors,Cr=Object.getOwnPropertySymbols,bs=Object.prototype.hasOwnProperty,gs=Object.prototype.propertyIsEnumerable,Mr=(e,r,n)=>r in e?ls(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,Ht=(e,r)=>{for(var n in r||(r={}))bs.call(r,n)&&Mr(e,n,r[n]);if(Cr)for(var n of Cr(r))gs.call(r,n)&&Mr(e,n,r[n]);return e},$t=(e,r)=>ds(e,hs(r));function ys(e){return $t(Ht({},e),{level:(e==null?void 0:e.level)||as.level})}function ps(e,r=Lt){return e[r]||""}function _s(e,r,n=Lt){return e[n]=r,e}function qr(e,r=Lt){let n="";return typeof e.bindings>"u"?n=ps(e,r):n=e.bindings().context||"",n}function ms(e,r,n=Lt){const a=qr(e,n);return a.trim()?`${a}/${r}`:r}function ws(e,r,n=Lt){const a=ms(e,r,n),s=e.child({context:a});return _s(s,a,n)}function vs(e){var r,n;const a=new cs((r=e.opts)==null?void 0:r.level,e.maxSizeInBytes);return{logger:or($t(Ht({},e.opts),{level:"trace",browser:$t(Ht({},(n=e.opts)==null?void 0:n.browser),{write:s=>a.write(s)})})),chunkLoggerController:a}}function xs(e){var r;const n=new us((r=e.opts)==null?void 0:r.level,e.maxSizeInBytes);return{logger:or($t(Ht({},e.opts),{level:"trace"}),n),chunkLoggerController:n}}function Es(e){return typeof e.loggerOverride<"u"&&typeof e.loggerOverride!="string"?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?vs(e):xs(e)}var fr={},Yr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=ze.binary,n=ze.wipe;e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var a=function(){function v(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return v.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},v.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},v.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},v.prototype.update=function(g,o){if(o===void 0&&(o=g.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var l=0;if(this._bytesHashed+=o,this._bufferLength>0){for(;this._bufferLength<e.BLOCK_SIZE&&o>0;)this._buffer[this._bufferLength++]=g[l++],o--;this._bufferLength===this.blockSize&&(d(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(o>=this.blockSize&&(l=d(this._tempHi,this._tempLo,this._stateHi,this._stateLo,g,l,o),o%=this.blockSize);o>0;)this._buffer[this._bufferLength++]=g[l++],o--;return this},v.prototype.finish=function(g){if(!this._finished){var o=this._bytesHashed,l=this._bufferLength,y=o/536870912|0,S=o<<3,x=o%128<112?128:256;this._buffer[l]=128;for(var w=l+1;w<x-8;w++)this._buffer[w]=0;r.writeUint32BE(y,this._buffer,x-8),r.writeUint32BE(S,this._buffer,x-4),d(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,x),this._finished=!0}for(var w=0;w<this.digestLength/8;w++)r.writeUint32BE(this._stateHi[w],g,w*8),r.writeUint32BE(this._stateLo[w],g,w*8+4);return this},v.prototype.digest=function(){var g=new Uint8Array(this.digestLength);return this.finish(g),g},v.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},v.prototype.restoreState=function(g){return this._stateHi.set(g.stateHi),this._stateLo.set(g.stateLo),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},v.prototype.cleanSavedState=function(g){n.wipe(g.stateHi),n.wipe(g.stateLo),g.buffer&&n.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},v}();e.SHA512=a;var s=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function d(v,g,o,l,y,S,x){for(var w=o[0],j=o[1],J=o[2],q=o[3],B=o[4],Ae=o[5],ge=o[6],Me=o[7],$=l[0],M=l[1],je=l[2],et=l[3],ye=l[4],Fe=l[5],We=l[6],Xe=l[7],m,_,Y,le,L,I,O,A;x>=128;){for(var Le=0;Le<16;Le++){var ne=8*Le+S;v[Le]=r.readUint32BE(y,ne),g[Le]=r.readUint32BE(y,ne+4)}for(var Le=0;Le<80;Le++){var wt=w,z=j,gt=J,b=q,h=B,u=Ae,t=ge,f=Me,R=$,P=M,K=je,U=et,D=ye,W=Fe,Re=We,de=Xe;if(m=Me,_=Xe,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=(B>>>14|ye<<18)^(B>>>18|ye<<14)^(ye>>>9|B<<23),_=(ye>>>14|B<<18)^(ye>>>18|B<<14)^(B>>>9|ye<<23),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=B&Ae^~B&ge,_=ye&Fe^~ye&We,L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=s[Le*2],_=s[Le*2+1],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=v[Le%16],_=g[Le%16],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,Y=O&65535|A<<16,le=L&65535|I<<16,m=Y,_=le,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=(w>>>28|$<<4)^($>>>2|w<<30)^($>>>7|w<<25),_=($>>>28|w<<4)^(w>>>2|$<<30)^(w>>>7|$<<25),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=w&j^w&J^j&J,_=$&M^$&je^M&je,L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,f=O&65535|A<<16,de=L&65535|I<<16,m=b,_=U,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=Y,_=le,L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,b=O&65535|A<<16,U=L&65535|I<<16,j=wt,J=z,q=gt,B=b,Ae=h,ge=u,Me=t,w=f,M=R,je=P,et=K,ye=U,Fe=D,We=W,Xe=Re,$=de,Le%16===15)for(var ne=0;ne<16;ne++)m=v[ne],_=g[ne],L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=v[(ne+9)%16],_=g[(ne+9)%16],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,Y=v[(ne+1)%16],le=g[(ne+1)%16],m=(Y>>>1|le<<31)^(Y>>>8|le<<24)^Y>>>7,_=(le>>>1|Y<<31)^(le>>>8|Y<<24)^(le>>>7|Y<<25),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,Y=v[(ne+14)%16],le=g[(ne+14)%16],m=(Y>>>19|le<<13)^(le>>>29|Y<<3)^Y>>>6,_=(le>>>19|Y<<13)^(Y>>>29|le<<3)^(le>>>6|Y<<26),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,v[ne]=O&65535|A<<16,g[ne]=L&65535|I<<16}m=w,_=$,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[0],_=l[0],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[0]=w=O&65535|A<<16,l[0]=$=L&65535|I<<16,m=j,_=M,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[1],_=l[1],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[1]=j=O&65535|A<<16,l[1]=M=L&65535|I<<16,m=J,_=je,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[2],_=l[2],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[2]=J=O&65535|A<<16,l[2]=je=L&65535|I<<16,m=q,_=et,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[3],_=l[3],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[3]=q=O&65535|A<<16,l[3]=et=L&65535|I<<16,m=B,_=ye,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[4],_=l[4],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[4]=B=O&65535|A<<16,l[4]=ye=L&65535|I<<16,m=Ae,_=Fe,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[5],_=l[5],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[5]=Ae=O&65535|A<<16,l[5]=Fe=L&65535|I<<16,m=ge,_=We,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[6],_=l[6],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[6]=ge=O&65535|A<<16,l[6]=We=L&65535|I<<16,m=Me,_=Xe,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[7],_=l[7],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[7]=Me=O&65535|A<<16,l[7]=Xe=L&65535|I<<16,S+=128,x-=128}return S}function E(v){var g=new a;g.update(v);var o=g.digest();return g.clean(),o}e.hash=E})(Yr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.convertSecretKeyToX25519=e.convertPublicKeyToX25519=e.verify=e.sign=e.extractPublicKeyFromSecretKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.SEED_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=e.SIGNATURE_LENGTH=void 0;const r=ze.random,n=Yr,a=ze.wipe;e.SIGNATURE_LENGTH=64,e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=64,e.SEED_LENGTH=32;function s(b){const h=new Float64Array(16);if(b)for(let u=0;u<b.length;u++)h[u]=b[u];return h}const d=new Uint8Array(32);d[0]=9;const E=s(),v=s([1]),g=s([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),o=s([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),l=s([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),y=s([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),S=s([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function x(b,h){for(let u=0;u<16;u++)b[u]=h[u]|0}function w(b){let h=1;for(let u=0;u<16;u++){let t=b[u]+h+65535;h=Math.floor(t/65536),b[u]=t-h*65536}b[0]+=h-1+37*(h-1)}function j(b,h,u){const t=~(u-1);for(let f=0;f<16;f++){const R=t&(b[f]^h[f]);b[f]^=R,h[f]^=R}}function J(b,h){const u=s(),t=s();for(let f=0;f<16;f++)t[f]=h[f];w(t),w(t),w(t);for(let f=0;f<2;f++){u[0]=t[0]-65517;for(let P=1;P<15;P++)u[P]=t[P]-65535-(u[P-1]>>16&1),u[P-1]&=65535;u[15]=t[15]-32767-(u[14]>>16&1);const R=u[15]>>16&1;u[14]&=65535,j(t,u,1-R)}for(let f=0;f<16;f++)b[2*f]=t[f]&255,b[2*f+1]=t[f]>>8}function q(b,h){let u=0;for(let t=0;t<32;t++)u|=b[t]^h[t];return(1&u-1>>>8)-1}function B(b,h){const u=new Uint8Array(32),t=new Uint8Array(32);return J(u,b),J(t,h),q(u,t)}function Ae(b){const h=new Uint8Array(32);return J(h,b),h[0]&1}function ge(b,h){for(let u=0;u<16;u++)b[u]=h[2*u]+(h[2*u+1]<<8);b[15]&=32767}function Me(b,h,u){for(let t=0;t<16;t++)b[t]=h[t]+u[t]}function $(b,h,u){for(let t=0;t<16;t++)b[t]=h[t]-u[t]}function M(b,h,u){let t,f,R=0,P=0,K=0,U=0,D=0,W=0,Re=0,de=0,Pe=0,pe=0,he=0,ie=0,re=0,Z=0,V=0,H=0,se=0,_e=0,G=0,Ne=0,De=0,He=0,$e=0,Ke=0,qe=0,Ze=0,st=0,Ge=0,ct=0,vt=0,Rt=0,oe=u[0],Q=u[1],ae=u[2],fe=u[3],ce=u[4],ee=u[5],me=u[6],we=u[7],ve=u[8],xe=u[9],Ee=u[10],be=u[11],ue=u[12],F=u[13],Se=u[14],Ie=u[15];t=h[0],R+=t*oe,P+=t*Q,K+=t*ae,U+=t*fe,D+=t*ce,W+=t*ee,Re+=t*me,de+=t*we,Pe+=t*ve,pe+=t*xe,he+=t*Ee,ie+=t*be,re+=t*ue,Z+=t*F,V+=t*Se,H+=t*Ie,t=h[1],P+=t*oe,K+=t*Q,U+=t*ae,D+=t*fe,W+=t*ce,Re+=t*ee,de+=t*me,Pe+=t*we,pe+=t*ve,he+=t*xe,ie+=t*Ee,re+=t*be,Z+=t*ue,V+=t*F,H+=t*Se,se+=t*Ie,t=h[2],K+=t*oe,U+=t*Q,D+=t*ae,W+=t*fe,Re+=t*ce,de+=t*ee,Pe+=t*me,pe+=t*we,he+=t*ve,ie+=t*xe,re+=t*Ee,Z+=t*be,V+=t*ue,H+=t*F,se+=t*Se,_e+=t*Ie,t=h[3],U+=t*oe,D+=t*Q,W+=t*ae,Re+=t*fe,de+=t*ce,Pe+=t*ee,pe+=t*me,he+=t*we,ie+=t*ve,re+=t*xe,Z+=t*Ee,V+=t*be,H+=t*ue,se+=t*F,_e+=t*Se,G+=t*Ie,t=h[4],D+=t*oe,W+=t*Q,Re+=t*ae,de+=t*fe,Pe+=t*ce,pe+=t*ee,he+=t*me,ie+=t*we,re+=t*ve,Z+=t*xe,V+=t*Ee,H+=t*be,se+=t*ue,_e+=t*F,G+=t*Se,Ne+=t*Ie,t=h[5],W+=t*oe,Re+=t*Q,de+=t*ae,Pe+=t*fe,pe+=t*ce,he+=t*ee,ie+=t*me,re+=t*we,Z+=t*ve,V+=t*xe,H+=t*Ee,se+=t*be,_e+=t*ue,G+=t*F,Ne+=t*Se,De+=t*Ie,t=h[6],Re+=t*oe,de+=t*Q,Pe+=t*ae,pe+=t*fe,he+=t*ce,ie+=t*ee,re+=t*me,Z+=t*we,V+=t*ve,H+=t*xe,se+=t*Ee,_e+=t*be,G+=t*ue,Ne+=t*F,De+=t*Se,He+=t*Ie,t=h[7],de+=t*oe,Pe+=t*Q,pe+=t*ae,he+=t*fe,ie+=t*ce,re+=t*ee,Z+=t*me,V+=t*we,H+=t*ve,se+=t*xe,_e+=t*Ee,G+=t*be,Ne+=t*ue,De+=t*F,He+=t*Se,$e+=t*Ie,t=h[8],Pe+=t*oe,pe+=t*Q,he+=t*ae,ie+=t*fe,re+=t*ce,Z+=t*ee,V+=t*me,H+=t*we,se+=t*ve,_e+=t*xe,G+=t*Ee,Ne+=t*be,De+=t*ue,He+=t*F,$e+=t*Se,Ke+=t*Ie,t=h[9],pe+=t*oe,he+=t*Q,ie+=t*ae,re+=t*fe,Z+=t*ce,V+=t*ee,H+=t*me,se+=t*we,_e+=t*ve,G+=t*xe,Ne+=t*Ee,De+=t*be,He+=t*ue,$e+=t*F,Ke+=t*Se,qe+=t*Ie,t=h[10],he+=t*oe,ie+=t*Q,re+=t*ae,Z+=t*fe,V+=t*ce,H+=t*ee,se+=t*me,_e+=t*we,G+=t*ve,Ne+=t*xe,De+=t*Ee,He+=t*be,$e+=t*ue,Ke+=t*F,qe+=t*Se,Ze+=t*Ie,t=h[11],ie+=t*oe,re+=t*Q,Z+=t*ae,V+=t*fe,H+=t*ce,se+=t*ee,_e+=t*me,G+=t*we,Ne+=t*ve,De+=t*xe,He+=t*Ee,$e+=t*be,Ke+=t*ue,qe+=t*F,Ze+=t*Se,st+=t*Ie,t=h[12],re+=t*oe,Z+=t*Q,V+=t*ae,H+=t*fe,se+=t*ce,_e+=t*ee,G+=t*me,Ne+=t*we,De+=t*ve,He+=t*xe,$e+=t*Ee,Ke+=t*be,qe+=t*ue,Ze+=t*F,st+=t*Se,Ge+=t*Ie,t=h[13],Z+=t*oe,V+=t*Q,H+=t*ae,se+=t*fe,_e+=t*ce,G+=t*ee,Ne+=t*me,De+=t*we,He+=t*ve,$e+=t*xe,Ke+=t*Ee,qe+=t*be,Ze+=t*ue,st+=t*F,Ge+=t*Se,ct+=t*Ie,t=h[14],V+=t*oe,H+=t*Q,se+=t*ae,_e+=t*fe,G+=t*ce,Ne+=t*ee,De+=t*me,He+=t*we,$e+=t*ve,Ke+=t*xe,qe+=t*Ee,Ze+=t*be,st+=t*ue,Ge+=t*F,ct+=t*Se,vt+=t*Ie,t=h[15],H+=t*oe,se+=t*Q,_e+=t*ae,G+=t*fe,Ne+=t*ce,De+=t*ee,He+=t*me,$e+=t*we,Ke+=t*ve,qe+=t*xe,Ze+=t*Ee,st+=t*be,Ge+=t*ue,ct+=t*F,vt+=t*Se,Rt+=t*Ie,R+=38*se,P+=38*_e,K+=38*G,U+=38*Ne,D+=38*De,W+=38*He,Re+=38*$e,de+=38*Ke,Pe+=38*qe,pe+=38*Ze,he+=38*st,ie+=38*Ge,re+=38*ct,Z+=38*vt,V+=38*Rt,f=1,t=R+f+65535,f=Math.floor(t/65536),R=t-f*65536,t=P+f+65535,f=Math.floor(t/65536),P=t-f*65536,t=K+f+65535,f=Math.floor(t/65536),K=t-f*65536,t=U+f+65535,f=Math.floor(t/65536),U=t-f*65536,t=D+f+65535,f=Math.floor(t/65536),D=t-f*65536,t=W+f+65535,f=Math.floor(t/65536),W=t-f*65536,t=Re+f+65535,f=Math.floor(t/65536),Re=t-f*65536,t=de+f+65535,f=Math.floor(t/65536),de=t-f*65536,t=Pe+f+65535,f=Math.floor(t/65536),Pe=t-f*65536,t=pe+f+65535,f=Math.floor(t/65536),pe=t-f*65536,t=he+f+65535,f=Math.floor(t/65536),he=t-f*65536,t=ie+f+65535,f=Math.floor(t/65536),ie=t-f*65536,t=re+f+65535,f=Math.floor(t/65536),re=t-f*65536,t=Z+f+65535,f=Math.floor(t/65536),Z=t-f*65536,t=V+f+65535,f=Math.floor(t/65536),V=t-f*65536,t=H+f+65535,f=Math.floor(t/65536),H=t-f*65536,R+=f-1+37*(f-1),f=1,t=R+f+65535,f=Math.floor(t/65536),R=t-f*65536,t=P+f+65535,f=Math.floor(t/65536),P=t-f*65536,t=K+f+65535,f=Math.floor(t/65536),K=t-f*65536,t=U+f+65535,f=Math.floor(t/65536),U=t-f*65536,t=D+f+65535,f=Math.floor(t/65536),D=t-f*65536,t=W+f+65535,f=Math.floor(t/65536),W=t-f*65536,t=Re+f+65535,f=Math.floor(t/65536),Re=t-f*65536,t=de+f+65535,f=Math.floor(t/65536),de=t-f*65536,t=Pe+f+65535,f=Math.floor(t/65536),Pe=t-f*65536,t=pe+f+65535,f=Math.floor(t/65536),pe=t-f*65536,t=he+f+65535,f=Math.floor(t/65536),he=t-f*65536,t=ie+f+65535,f=Math.floor(t/65536),ie=t-f*65536,t=re+f+65535,f=Math.floor(t/65536),re=t-f*65536,t=Z+f+65535,f=Math.floor(t/65536),Z=t-f*65536,t=V+f+65535,f=Math.floor(t/65536),V=t-f*65536,t=H+f+65535,f=Math.floor(t/65536),H=t-f*65536,R+=f-1+37*(f-1),b[0]=R,b[1]=P,b[2]=K,b[3]=U,b[4]=D,b[5]=W,b[6]=Re,b[7]=de,b[8]=Pe,b[9]=pe,b[10]=he,b[11]=ie,b[12]=re,b[13]=Z,b[14]=V,b[15]=H}function je(b,h){M(b,h,h)}function et(b,h){const u=s();let t;for(t=0;t<16;t++)u[t]=h[t];for(t=253;t>=0;t--)je(u,u),t!==2&&t!==4&&M(u,u,h);for(t=0;t<16;t++)b[t]=u[t]}function ye(b,h){const u=s();let t;for(t=0;t<16;t++)u[t]=h[t];for(t=250;t>=0;t--)je(u,u),t!==1&&M(u,u,h);for(t=0;t<16;t++)b[t]=u[t]}function Fe(b,h){const u=s(),t=s(),f=s(),R=s(),P=s(),K=s(),U=s(),D=s(),W=s();$(u,b[1],b[0]),$(W,h[1],h[0]),M(u,u,W),Me(t,b[0],b[1]),Me(W,h[0],h[1]),M(t,t,W),M(f,b[3],h[3]),M(f,f,o),M(R,b[2],h[2]),Me(R,R,R),$(P,t,u),$(K,R,f),Me(U,R,f),Me(D,t,u),M(b[0],P,K),M(b[1],D,U),M(b[2],U,K),M(b[3],P,D)}function We(b,h,u){for(let t=0;t<4;t++)j(b[t],h[t],u)}function Xe(b,h){const u=s(),t=s(),f=s();et(f,h[2]),M(u,h[0],f),M(t,h[1],f),J(b,t),b[31]^=Ae(u)<<7}function m(b,h,u){x(b[0],E),x(b[1],v),x(b[2],v),x(b[3],E);for(let t=255;t>=0;--t){const f=u[t/8|0]>>(t&7)&1;We(b,h,f),Fe(h,b),Fe(b,b),We(b,h,f)}}function _(b,h){const u=[s(),s(),s(),s()];x(u[0],l),x(u[1],y),x(u[2],v),M(u[3],l,y),m(b,u,h)}function Y(b){if(b.length!==e.SEED_LENGTH)throw new Error(`ed25519: seed must be ${e.SEED_LENGTH} bytes`);const h=(0,n.hash)(b);h[0]&=248,h[31]&=127,h[31]|=64;const u=new Uint8Array(32),t=[s(),s(),s(),s()];_(t,h),Xe(u,t);const f=new Uint8Array(64);return f.set(b),f.set(u,32),{publicKey:u,secretKey:f}}e.generateKeyPairFromSeed=Y;function le(b){const h=(0,r.randomBytes)(32,b),u=Y(h);return(0,a.wipe)(h),u}e.generateKeyPair=le;function L(b){if(b.length!==e.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${e.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(b.subarray(32))}e.extractPublicKeyFromSecretKey=L;const I=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function O(b,h){let u,t,f,R;for(t=63;t>=32;--t){for(u=0,f=t-32,R=t-12;f<R;++f)h[f]+=u-16*h[t]*I[f-(t-32)],u=Math.floor((h[f]+128)/256),h[f]-=u*256;h[f]+=u,h[t]=0}for(u=0,f=0;f<32;f++)h[f]+=u-(h[31]>>4)*I[f],u=h[f]>>8,h[f]&=255;for(f=0;f<32;f++)h[f]-=u*I[f];for(t=0;t<32;t++)h[t+1]+=h[t]>>8,b[t]=h[t]&255}function A(b){const h=new Float64Array(64);for(let u=0;u<64;u++)h[u]=b[u];for(let u=0;u<64;u++)b[u]=0;O(b,h)}function Le(b,h){const u=new Float64Array(64),t=[s(),s(),s(),s()],f=(0,n.hash)(b.subarray(0,32));f[0]&=248,f[31]&=127,f[31]|=64;const R=new Uint8Array(64);R.set(f.subarray(32),32);const P=new n.SHA512;P.update(R.subarray(32)),P.update(h);const K=P.digest();P.clean(),A(K),_(t,K),Xe(R,t),P.reset(),P.update(R.subarray(0,32)),P.update(b.subarray(32)),P.update(h);const U=P.digest();A(U);for(let D=0;D<32;D++)u[D]=K[D];for(let D=0;D<32;D++)for(let W=0;W<32;W++)u[D+W]+=U[D]*f[W];return O(R.subarray(32),u),R}e.sign=Le;function ne(b,h){const u=s(),t=s(),f=s(),R=s(),P=s(),K=s(),U=s();return x(b[2],v),ge(b[1],h),je(f,b[1]),M(R,f,g),$(f,f,b[2]),Me(R,b[2],R),je(P,R),je(K,P),M(U,K,P),M(u,U,f),M(u,u,R),ye(u,u),M(u,u,f),M(u,u,R),M(u,u,R),M(b[0],u,R),je(t,b[0]),M(t,t,R),B(t,f)&&M(b[0],b[0],S),je(t,b[0]),M(t,t,R),B(t,f)?-1:(Ae(b[0])===h[31]>>7&&$(b[0],E,b[0]),M(b[3],b[0],b[1]),0)}function wt(b,h,u){const t=new Uint8Array(32),f=[s(),s(),s(),s()],R=[s(),s(),s(),s()];if(u.length!==e.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${e.SIGNATURE_LENGTH} bytes`);if(ne(R,b))return!1;const P=new n.SHA512;P.update(u.subarray(0,32)),P.update(b),P.update(h);const K=P.digest();return A(K),m(f,R,K),_(R,u.subarray(32)),Fe(f,R),Xe(t,f),!q(u,t)}e.verify=wt;function z(b){let h=[s(),s(),s(),s()];if(ne(h,b))throw new Error("Ed25519: invalid public key");let u=s(),t=s(),f=h[1];Me(u,v,f),$(t,v,f),et(t,t),M(u,u,t);let R=new Uint8Array(32);return J(R,u),R}e.convertPublicKeyToX25519=z;function gt(b){const h=(0,n.hash)(b.subarray(0,32));h[0]&=248,h[31]&=127,h[31]|=64;const u=new Uint8Array(h.subarray(0,32));return(0,a.wipe)(h),u}e.convertSecretKeyToX25519=gt})(fr);const Ss="EdDSA",Is="JWT",Zr=".",Qr="base64url",Os="utf8",Ts="utf8",As=":",Ls="did",Rs="key",jr="base58btc",Ps="z",Cs="K36",Ms=32;function Gt(e){return Jt(Ft(ht(e),Os),Qr)}function en(e){const r=Ft(Cs,jr),n=Ps+Jt(Hr([r,e]),jr);return[Ls,Rs,n].join(As)}function js(e){return Jt(e,Qr)}function Ns(e){return Ft([Gt(e.header),Gt(e.payload)].join(Zr),Ts)}function Bs(e){return[Gt(e.header),Gt(e.payload),js(e.signature)].join(Zr)}function zs(e=ze.random.randomBytes(Ms)){return fr.generateKeyPairFromSeed(e)}async function Ds(e,r,n,a,s=ze.cjs.fromMiliseconds(Date.now())){const d={alg:Ss,typ:Is},E=en(a.publicKey),v=s+n,g={iss:E,sub:e,aud:r,iat:s,exp:v},o=Ns({header:d,payload:g}),l=fr.sign(a.secretKey,o);return Bs({header:d,payload:g,signature:l})}const Ks="PARSE_ERROR",Us="INVALID_REQUEST",Ws="METHOD_NOT_FOUND",Hs="INVALID_PARAMS",tn="INTERNAL_ERROR",cr="SERVER_ERROR",$s=[-32700,-32600,-32601,-32602,-32603],St={[Ks]:{code:-32700,message:"Parse error"},[Us]:{code:-32600,message:"Invalid Request"},[Ws]:{code:-32601,message:"Method not found"},[Hs]:{code:-32602,message:"Invalid params"},[tn]:{code:-32603,message:"Internal error"},[cr]:{code:-32e3,message:"Server error"}},rn=cr;function Gs(e){return $s.includes(e)}function Nr(e){return Object.keys(St).includes(e)?St[e]:St[rn]}function ks(e){const r=Object.values(St).find(n=>n.code===e);return r||St[rn]}function nn(e,r,n){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${r}`):e}var sn={};/*! *****************************************************************************
|
|
1
|
+
"use strict";const N=require("./index-ByG9EJHX.js"),ze=require("./index-DEfagu36.js"),Qn=require("./events-CG085uVS.js");function Wr(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function Hr(e,r){r||(r=e.reduce((s,d)=>s+d.length,0));const n=Wr(r);let a=0;for(const s of e)n.set(s,a),a+=s.length;return n}const vr={...ze.identityBase,...ze.base2,...ze.base8,...ze.base10,...ze.base16,...ze.base32,...ze.base36,...ze.base58,...ze.base64,...ze.base256emoji};function $r(e,r,n,a){return{name:e,prefix:r,encoder:{name:e,prefix:r,encode:n},decoder:{decode:a}}}const xr=$r("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Yt=$r("ascii","a",e=>{let r="a";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return r},e=>{e=e.substring(1);const r=Wr(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}),Gr={utf8:xr,"utf-8":xr,hex:vr.base16,latin1:Yt,ascii:Yt,binary:Yt,...vr};function Ft(e,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):n.decoder.decode(`${n.prefix}${e}`)}function Jt(e,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}var Er=function(e,r,n){if(n||arguments.length===2)for(var a=0,s=r.length,d;a<s;a++)(d||!(a in r))&&(d||(d=Array.prototype.slice.call(r,0,a)),d[a]=r[a]);return e.concat(d||Array.prototype.slice.call(r))},ei=function(){function e(r,n,a){this.name=r,this.version=n,this.os=a,this.type="browser"}return e}(),ti=function(){function e(r){this.version=r,this.type="node",this.name="node",this.os=N.dist.process.platform}return e}(),ri=function(){function e(r,n,a,s){this.name=r,this.version=n,this.os=a,this.bot=s,this.type="bot-device"}return e}(),ni=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),ii=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),si=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,oi=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Sr=3,ai=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",si]],Ir=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function fi(e){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ii:typeof navigator<"u"?ui(navigator.userAgent):di()}function ci(e){return e!==""&&ai.reduce(function(r,n){var a=n[0],s=n[1];if(r)return r;var d=s.exec(e);return!!d&&[a,d]},!1)}function ui(e){var r=ci(e);if(!r)return null;var n=r[0],a=r[1];if(n==="searchbot")return new ni;var s=a[1]&&a[1].split(".").join("_").split("_").slice(0,3);s?s.length<Sr&&(s=Er(Er([],s,!0),hi(Sr-s.length),!0)):s=[];var d=s.join("."),E=li(e),v=oi.exec(e);return v&&v[1]?new ri(n,d,E,v[1]):new ei(n,d,E)}function li(e){for(var r=0,n=Ir.length;r<n;r++){var a=Ir[r],s=a[0],d=a[1],E=d.exec(e);if(E)return s}return null}function di(){var e=typeof N.dist.process<"u"&&N.dist.process.version;return e?new ti(N.dist.process.version.slice(1)):null}function hi(e){for(var r=[],n=0;n<e;n++)r.push("0");return r}const bi={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},gi=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,yi=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,pi=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function _i(e,r){if(e==="__proto__"||e==="constructor"&&r&&typeof r=="object"&&"prototype"in r){mi(e);return}return r}function mi(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function zt(e,r={}){if(typeof e!="string")return e;const n=e.trim();if(e[0]==='"'&&e.endsWith('"')&&!e.includes("\\"))return n.slice(1,-1);if(n.length<=9){const a=n.toLowerCase();if(a==="true")return!0;if(a==="false")return!1;if(a==="undefined")return;if(a==="null")return null;if(a==="nan")return Number.NaN;if(a==="infinity")return Number.POSITIVE_INFINITY;if(a==="-infinity")return Number.NEGATIVE_INFINITY}if(!pi.test(e)){if(r.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(gi.test(e)||yi.test(e)){if(r.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,_i)}return JSON.parse(e)}catch(a){if(r.strict)throw a;return e}}function wi(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function Te(e,...r){try{return wi(e(...r))}catch(n){return Promise.reject(n)}}function vi(e){const r=typeof e;return e===null||r!=="object"&&r!=="function"}function xi(e){const r=Object.getPrototypeOf(e);return!r||r.isPrototypeOf(Object)}function Ut(e){if(vi(e))return String(e);if(xi(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return Ut(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function kr(){if(typeof N.dist.Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const tr="base64:";function Ei(e){if(typeof e=="string")return e;kr();const r=N.dist.Buffer.from(e).toString("base64");return tr+r}function Si(e){return typeof e!="string"||!e.startsWith(tr)?e:(kr(),N.dist.Buffer.from(e.slice(tr.length),"base64"))}function Ue(e){return e?e.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function Ii(...e){return Ue(e.join(":"))}function Dt(e){return e=Ue(e),e?e+":":""}const Oi="memory",Ti=()=>{const e=new Map;return{name:Oi,options:{},hasItem(r){return e.has(r)},getItem(r){return e.get(r)??null},getItemRaw(r){return e.get(r)??null},setItem(r,n){e.set(r,n)},setItemRaw(r,n){e.set(r,n)},removeItem(r){e.delete(r)},getKeys(){return Array.from(e.keys())},clear(){e.clear()},dispose(){e.clear()}}};function Ai(e={}){const r={mounts:{"":e.driver||Ti()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=o=>{for(const l of r.mountpoints)if(o.startsWith(l))return{base:l,relativeKey:o.slice(l.length),driver:r.mounts[l]};return{base:"",relativeKey:o,driver:r.mounts[""]}},a=(o,l)=>r.mountpoints.filter(y=>y.startsWith(o)||l&&o.startsWith(y)).map(y=>({relativeBase:o.length>y.length?o.slice(y.length):void 0,mountpoint:y,driver:r.mounts[y]})),s=(o,l)=>{if(r.watching){l=Ue(l);for(const y of r.watchListeners)y(o,l)}},d=async()=>{if(!r.watching){r.watching=!0;for(const o in r.mounts)r.unwatch[o]=await Or(r.mounts[o],s,o)}},E=async()=>{if(r.watching){for(const o in r.unwatch)await r.unwatch[o]();r.unwatch={},r.watching=!1}},v=(o,l,y)=>{const S=new Map,x=w=>{let j=S.get(w.base);return j||(j={driver:w.driver,base:w.base,items:[]},S.set(w.base,j)),j};for(const w of o){const j=typeof w=="string",J=Ue(j?w:w.key),q=j?void 0:w.value,B=j||!w.options?l:{...l,...w.options},Ae=n(J);x(Ae).items.push({key:J,value:q,relativeKey:Ae.relativeKey,options:B})}return Promise.all([...S.values()].map(w=>y(w))).then(w=>w.flat())},g={hasItem(o,l={}){o=Ue(o);const{relativeKey:y,driver:S}=n(o);return Te(S.hasItem,y,l)},getItem(o,l={}){o=Ue(o);const{relativeKey:y,driver:S}=n(o);return Te(S.getItem,y,l).then(x=>zt(x))},getItems(o,l){return v(o,l,y=>y.driver.getItems?Te(y.driver.getItems,y.items.map(S=>({key:S.relativeKey,options:S.options})),l).then(S=>S.map(x=>({key:Ii(y.base,x.key),value:zt(x.value)}))):Promise.all(y.items.map(S=>Te(y.driver.getItem,S.relativeKey,S.options).then(x=>({key:S.key,value:zt(x)})))))},getItemRaw(o,l={}){o=Ue(o);const{relativeKey:y,driver:S}=n(o);return S.getItemRaw?Te(S.getItemRaw,y,l):Te(S.getItem,y,l).then(x=>Si(x))},async setItem(o,l,y={}){if(l===void 0)return g.removeItem(o);o=Ue(o);const{relativeKey:S,driver:x}=n(o);x.setItem&&(await Te(x.setItem,S,Ut(l),y),x.watch||s("update",o))},async setItems(o,l){await v(o,l,async y=>{if(y.driver.setItems)return Te(y.driver.setItems,y.items.map(S=>({key:S.relativeKey,value:Ut(S.value),options:S.options})),l);y.driver.setItem&&await Promise.all(y.items.map(S=>Te(y.driver.setItem,S.relativeKey,Ut(S.value),S.options)))})},async setItemRaw(o,l,y={}){if(l===void 0)return g.removeItem(o,y);o=Ue(o);const{relativeKey:S,driver:x}=n(o);if(x.setItemRaw)await Te(x.setItemRaw,S,l,y);else if(x.setItem)await Te(x.setItem,S,Ei(l),y);else return;x.watch||s("update",o)},async removeItem(o,l={}){typeof l=="boolean"&&(l={removeMeta:l}),o=Ue(o);const{relativeKey:y,driver:S}=n(o);S.removeItem&&(await Te(S.removeItem,y,l),(l.removeMeta||l.removeMata)&&await Te(S.removeItem,y+"$",l),S.watch||s("remove",o))},async getMeta(o,l={}){typeof l=="boolean"&&(l={nativeOnly:l}),o=Ue(o);const{relativeKey:y,driver:S}=n(o),x=Object.create(null);if(S.getMeta&&Object.assign(x,await Te(S.getMeta,y,l)),!l.nativeOnly){const w=await Te(S.getItem,y+"$",l).then(j=>zt(j));w&&typeof w=="object"&&(typeof w.atime=="string"&&(w.atime=new Date(w.atime)),typeof w.mtime=="string"&&(w.mtime=new Date(w.mtime)),Object.assign(x,w))}return x},setMeta(o,l,y={}){return this.setItem(o+"$",l,y)},removeMeta(o,l={}){return this.removeItem(o+"$",l)},async getKeys(o,l={}){o=Dt(o);const y=a(o,!0);let S=[];const x=[];for(const w of y){const J=(await Te(w.driver.getKeys,w.relativeBase,l)).map(q=>w.mountpoint+Ue(q)).filter(q=>!S.some(B=>q.startsWith(B)));x.push(...J),S=[w.mountpoint,...S.filter(q=>!q.startsWith(w.mountpoint))]}return o?x.filter(w=>w.startsWith(o)&&!w.endsWith("$")):x.filter(w=>!w.endsWith("$"))},async clear(o,l={}){o=Dt(o),await Promise.all(a(o,!1).map(async y=>{if(y.driver.clear)return Te(y.driver.clear,y.relativeBase,l);if(y.driver.removeItem){const S=await y.driver.getKeys(y.relativeBase||"",l);return Promise.all(S.map(x=>y.driver.removeItem(x,l)))}}))},async dispose(){await Promise.all(Object.values(r.mounts).map(o=>Tr(o)))},async watch(o){return await d(),r.watchListeners.push(o),async()=>{r.watchListeners=r.watchListeners.filter(l=>l!==o),r.watchListeners.length===0&&await E()}},async unwatch(){r.watchListeners=[],await E()},mount(o,l){if(o=Dt(o),o&&r.mounts[o])throw new Error(`already mounted at ${o}`);return o&&(r.mountpoints.push(o),r.mountpoints.sort((y,S)=>S.length-y.length)),r.mounts[o]=l,r.watching&&Promise.resolve(Or(l,s,o)).then(y=>{r.unwatch[o]=y}).catch(console.error),g},async unmount(o,l=!0){o=Dt(o),!(!o||!r.mounts[o])&&(r.watching&&o in r.unwatch&&(r.unwatch[o](),delete r.unwatch[o]),l&&await Tr(r.mounts[o]),r.mountpoints=r.mountpoints.filter(y=>y!==o),delete r.mounts[o])},getMount(o=""){o=Ue(o)+":";const l=n(o);return{driver:l.driver,base:l.base}},getMounts(o="",l={}){return o=Ue(o),a(o,l.parents).map(S=>({driver:S.driver,base:S.mountpoint}))}};return g}function Or(e,r,n){return e.watch?e.watch((a,s)=>r(a,n+s)):()=>{}}async function Tr(e){typeof e.dispose=="function"&&await Te(e.dispose)}function bt(e){return new Promise((r,n)=>{e.oncomplete=e.onsuccess=()=>r(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Fr(e,r){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(r);const a=bt(n);return(s,d)=>a.then(E=>d(E.transaction(r,s).objectStore(r)))}let Zt;function At(){return Zt||(Zt=Fr("keyval-store","keyval")),Zt}function Ar(e,r=At()){return r("readonly",n=>bt(n.get(e)))}function Li(e,r,n=At()){return n("readwrite",a=>(a.put(r,e),bt(a.transaction)))}function Ri(e,r=At()){return r("readwrite",n=>(n.delete(e),bt(n.transaction)))}function Pi(e=At()){return e("readwrite",r=>(r.clear(),bt(r.transaction)))}function Ci(e,r){return e.openCursor().onsuccess=function(){this.result&&(r(this.result),this.result.continue())},bt(e.transaction)}function Mi(e=At()){return e("readonly",r=>{if(r.getAllKeys)return bt(r.getAllKeys());const n=[];return Ci(r,a=>n.push(a.key)).then(()=>n)})}const ji=e=>JSON.stringify(e,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),Ni=e=>{const r=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,n=e.replace(r,'$1"$2n"$3');return JSON.parse(n,(a,s)=>typeof s=="string"&&s.match(/^\d+n$/)?BigInt(s.substring(0,s.length-1)):s)};function Vt(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return Ni(e)}catch{return e}}function ht(e){return typeof e=="string"?e:ji(e)||""}const Bi="idb-keyval";var zi=(e={})=>{const r=e.base&&e.base.length>0?`${e.base}:`:"",n=s=>r+s;let a;return e.dbName&&e.storeName&&(a=Fr(e.dbName,e.storeName)),{name:Bi,options:e,async hasItem(s){return!(typeof await Ar(n(s),a)>"u")},async getItem(s){return await Ar(n(s),a)??null},setItem(s,d){return Li(n(s),d,a)},removeItem(s){return Ri(n(s),a)},getKeys(){return Mi(a)},clear(){return Pi(a)}}};const Di="WALLET_CONNECT_V2_INDEXED_DB",Ki="keyvaluestorage";let Ui=class{constructor(){this.indexedDb=Ai({driver:zi({dbName:Di,storeName:Ki})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(r=>[r.key,r.value])}async getItem(r){const n=await this.indexedDb.getItem(r);if(n!==null)return n}async setItem(r,n){await this.indexedDb.setItem(r,ht(n))}async removeItem(r){await this.indexedDb.removeItem(r)}};var Qt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof N.dist.global<"u"?N.dist.global:typeof self<"u"?self:{},Wt={exports:{}};(function(){let e;function r(){}e=r,e.prototype.getItem=function(n){return this.hasOwnProperty(n)?String(this[n]):null},e.prototype.setItem=function(n,a){this[n]=String(a)},e.prototype.removeItem=function(n){delete this[n]},e.prototype.clear=function(){const n=this;Object.keys(n).forEach(function(a){n[a]=void 0,delete n[a]})},e.prototype.key=function(n){return n=n||0,Object.keys(this)[n]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Qt<"u"&&Qt.localStorage?Wt.exports=Qt.localStorage:typeof window<"u"&&window.localStorage?Wt.exports=window.localStorage:Wt.exports=new r})();function Wi(e){var r;return[e[0],Vt((r=e[1])!=null?r:"")]}class Hi{constructor(){this.localStorage=Wt.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Wi)}async getItem(r){const n=this.localStorage.getItem(r);if(n!==null)return Vt(n)}async setItem(r,n){this.localStorage.setItem(r,ht(n))}async removeItem(r){this.localStorage.removeItem(r)}}const $i="wc_storage_version",Lr=1,Gi=async(e,r,n)=>{const a=$i,s=await r.getItem(a);if(s&&s>=Lr){n(r);return}const d=await e.getKeys();if(!d.length){n(r);return}const E=[];for(;d.length;){const v=d.shift();if(!v)continue;const g=v.toLowerCase();if(g.includes("wc@")||g.includes("walletconnect")||g.includes("wc_")||g.includes("wallet_connect")){const o=await e.getItem(v);await r.setItem(v,o),E.push(v)}}await r.setItem(a,Lr),n(r),ki(e,E)},ki=async(e,r)=>{r.length&&r.forEach(async n=>{await e.removeItem(n)})};let Fi=class{constructor(){this.initialized=!1,this.setInitialized=n=>{this.storage=n,this.initialized=!0};const r=new Hi;this.storage=r;try{const n=new Ui;Gi(r,n,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(r){return await this.initialize(),this.storage.getItem(r)}async setItem(r,n){return await this.initialize(),this.storage.setItem(r,n)}async removeItem(r){return await this.initialize(),this.storage.removeItem(r)}async initialize(){this.initialized||await new Promise(r=>{const n=setInterval(()=>{this.initialized&&(clearInterval(n),r())},20)})}};class Ji{}function Vi(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var Xi=qi;function qi(e,r,n){var a=n&&n.stringify||Vi,s=1;if(typeof e=="object"&&e!==null){var d=r.length+s;if(d===1)return e;var E=new Array(d);E[0]=a(e);for(var v=1;v<d;v++)E[v]=a(r[v]);return E.join(" ")}if(typeof e!="string")return e;var g=r.length;if(g===0)return e;for(var o="",l=1-s,y=-1,S=e&&e.length||0,x=0;x<S;){if(e.charCodeAt(x)===37&&x+1<S){switch(y=y>-1?y:0,e.charCodeAt(x+1)){case 100:case 102:if(l>=g||r[l]==null)break;y<x&&(o+=e.slice(y,x)),o+=Number(r[l]),y=x+2,x++;break;case 105:if(l>=g||r[l]==null)break;y<x&&(o+=e.slice(y,x)),o+=Math.floor(Number(r[l])),y=x+2,x++;break;case 79:case 111:case 106:if(l>=g||r[l]===void 0)break;y<x&&(o+=e.slice(y,x));var w=typeof r[l];if(w==="string"){o+="'"+r[l]+"'",y=x+2,x++;break}if(w==="function"){o+=r[l].name||"<anonymous>",y=x+2,x++;break}o+=a(r[l]),y=x+2,x++;break;case 115:if(l>=g)break;y<x&&(o+=e.slice(y,x)),o+=String(r[l]),y=x+2,x++;break;case 37:y<x&&(o+=e.slice(y,x)),o+="%",y=x+2,x++,l--;break}++l}++x}return y===-1?e:(y<S&&(o+=e.slice(y)),o)}const Rr=Xi;var mt=Qe;const It=os().console||{},Yi={mapHttpRequest:Kt,mapHttpResponse:Kt,wrapRequestSerializer:er,wrapResponseSerializer:er,wrapErrorSerializer:er,req:Kt,res:Kt,err:rs};function Zi(e,r){return Array.isArray(e)?e.filter(function(a){return a!=="!stdSerializers.err"}):e===!0?Object.keys(r):!1}function Qe(e){e=e||{},e.browser=e.browser||{};const r=e.browser.transmit;if(r&&typeof r.send!="function")throw Error("pino: transmit option must have a send function");const n=e.browser.write||It;e.browser.write&&(e.browser.asObject=!0);const a=e.serializers||{},s=Zi(e.browser.serialize,a);let d=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(d=!1);const E=["error","fatal","warn","info","debug","trace"];typeof n=="function"&&(n.error=n.fatal=n.warn=n.info=n.debug=n.trace=n),e.enabled===!1&&(e.level="silent");const v=e.level||"info",g=Object.create(n);g.log||(g.log=Ot),Object.defineProperty(g,"levelVal",{get:l}),Object.defineProperty(g,"level",{get:y,set:S});const o={transmit:r,serialize:s,asObject:e.browser.asObject,levels:E,timestamp:ns(e)};g.levels=Qe.levels,g.level=v,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prependOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=Ot,g.serializers=a,g._serialize=s,g._stdErrSerialize=d,g.child=x,r&&(g._logEvent=rr());function l(){return this.level==="silent"?1/0:this.levels.values[this.level]}function y(){return this._level}function S(w){if(w!=="silent"&&!this.levels.values[w])throw Error("unknown level "+w);this._level=w,pt(o,g,"error","log"),pt(o,g,"fatal","error"),pt(o,g,"warn","error"),pt(o,g,"info","log"),pt(o,g,"debug","log"),pt(o,g,"trace","log")}function x(w,j){if(!w)throw new Error("missing bindings for child Pino");j=j||{},s&&w.serializers&&(j.serializers=w.serializers);const J=j.serializers;if(s&&J){var q=Object.assign({},a,J),B=e.browser.serialize===!0?Object.keys(q):s;delete w.serializers,Xt([w],B,q,this._stdErrSerialize)}function Ae(ge){this._childLevel=(ge._childLevel|0)+1,this.error=_t(ge,w,"error"),this.fatal=_t(ge,w,"fatal"),this.warn=_t(ge,w,"warn"),this.info=_t(ge,w,"info"),this.debug=_t(ge,w,"debug"),this.trace=_t(ge,w,"trace"),q&&(this.serializers=q,this._serialize=B),r&&(this._logEvent=rr([].concat(ge._logEvent.bindings,w)))}return Ae.prototype=this,new Ae(this)}return g}Qe.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};Qe.stdSerializers=Yi;Qe.stdTimeFunctions=Object.assign({},{nullTime:Jr,epochTime:Vr,unixTime:is,isoTime:ss});function pt(e,r,n,a){const s=Object.getPrototypeOf(r);r[n]=r.levelVal>r.levels.values[n]?Ot:s[n]?s[n]:It[n]||It[a]||Ot,Qi(e,r,n)}function Qi(e,r,n){!e.transmit&&r[n]===Ot||(r[n]=function(a){return function(){const d=e.timestamp(),E=new Array(arguments.length),v=Object.getPrototypeOf&&Object.getPrototypeOf(this)===It?It:this;for(var g=0;g<E.length;g++)E[g]=arguments[g];if(e.serialize&&!e.asObject&&Xt(E,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?a.call(v,es(this,n,E,d)):a.apply(v,E),e.transmit){const o=e.transmit.level||r.level,l=Qe.levels.values[o],y=Qe.levels.values[n];if(y<l)return;ts(this,{ts:d,methodLevel:n,methodValue:y,transmitLevel:o,transmitValue:Qe.levels.values[e.transmit.level||r.level],send:e.transmit.send,val:r.levelVal},E)}}}(r[n]))}function es(e,r,n,a){e._serialize&&Xt(n,e._serialize,e.serializers,e._stdErrSerialize);const s=n.slice();let d=s[0];const E={};a&&(E.time=a),E.level=Qe.levels.values[r];let v=(e._childLevel|0)+1;if(v<1&&(v=1),d!==null&&typeof d=="object"){for(;v--&&typeof s[0]=="object";)Object.assign(E,s.shift());d=s.length?Rr(s.shift(),s):void 0}else typeof d=="string"&&(d=Rr(s.shift(),s));return d!==void 0&&(E.msg=d),E}function Xt(e,r,n,a){for(const s in e)if(a&&e[s]instanceof Error)e[s]=Qe.stdSerializers.err(e[s]);else if(typeof e[s]=="object"&&!Array.isArray(e[s]))for(const d in e[s])r&&r.indexOf(d)>-1&&d in n&&(e[s][d]=n[d](e[s][d]))}function _t(e,r,n){return function(){const a=new Array(1+arguments.length);a[0]=r;for(var s=1;s<a.length;s++)a[s]=arguments[s-1];return e[n].apply(this,a)}}function ts(e,r,n){const a=r.send,s=r.ts,d=r.methodLevel,E=r.methodValue,v=r.val,g=e._logEvent.bindings;Xt(n,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=s,e._logEvent.messages=n.filter(function(o){return g.indexOf(o)===-1}),e._logEvent.level.label=d,e._logEvent.level.value=E,a(d,e._logEvent,v),e._logEvent=rr(g)}function rr(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function rs(e){const r={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)r[n]===void 0&&(r[n]=e[n]);return r}function ns(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Jr:Vr}function Kt(){return{}}function er(e){return e}function Ot(){}function Jr(){return!1}function Vr(){return Date.now()}function is(){return Math.round(Date.now()/1e3)}function ss(){return new Date(Date.now()).toISOString()}function os(){function e(r){return typeof r<"u"&&r}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}const or=N.getDefaultExportFromCjs(mt),as={level:"info"},Lt="custom_context",ar=1e3*1024;class fs{constructor(r){this.nodeValue=r,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class Pr{constructor(r){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=r,this.sizeInBytes=0}append(r){const n=new fs(r);if(n.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${r} with size ${n.size}`);for(;this.size+n.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.lengthInNodes++,this.sizeInBytes+=n.size}shift(){if(!this.head)return;const r=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=r.size}toArray(){const r=[];let n=this.head;for(;n!==null;)r.push(n.value),n=n.next;return r}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let r=this.head;return{next:()=>{if(!r)return{done:!0,value:null};const n=r.value;return r=r.next,{done:!1,value:n}}}}}class Xr{constructor(r,n=ar){this.level=r??"error",this.levelValue=mt.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=n,this.logs=new Pr(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(r,n){n===mt.levels.values.error?console.error(r):n===mt.levels.values.warn?console.warn(r):n===mt.levels.values.debug?console.debug(r):n===mt.levels.values.trace?console.trace(r):console.log(r)}appendToLogs(r){this.logs.append(ht({timestamp:new Date().toISOString(),log:r}));const n=typeof r=="string"?JSON.parse(r).level:r.level;n>=this.levelValue&&this.forwardToConsole(r,n)}getLogs(){return this.logs}clearLogs(){this.logs=new Pr(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(r){const n=this.getLogArray();return n.push(ht({extraMetadata:r})),new Blob(n,{type:"application/json"})}}class cs{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}downloadLogsBlobInBrowser(r){const n=URL.createObjectURL(this.logsToBlob(r)),a=document.createElement("a");a.href=n,a.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n)}}class us{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}}var ls=Object.defineProperty,ds=Object.defineProperties,hs=Object.getOwnPropertyDescriptors,Cr=Object.getOwnPropertySymbols,bs=Object.prototype.hasOwnProperty,gs=Object.prototype.propertyIsEnumerable,Mr=(e,r,n)=>r in e?ls(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,Ht=(e,r)=>{for(var n in r||(r={}))bs.call(r,n)&&Mr(e,n,r[n]);if(Cr)for(var n of Cr(r))gs.call(r,n)&&Mr(e,n,r[n]);return e},$t=(e,r)=>ds(e,hs(r));function ys(e){return $t(Ht({},e),{level:(e==null?void 0:e.level)||as.level})}function ps(e,r=Lt){return e[r]||""}function _s(e,r,n=Lt){return e[n]=r,e}function qr(e,r=Lt){let n="";return typeof e.bindings>"u"?n=ps(e,r):n=e.bindings().context||"",n}function ms(e,r,n=Lt){const a=qr(e,n);return a.trim()?`${a}/${r}`:r}function ws(e,r,n=Lt){const a=ms(e,r,n),s=e.child({context:a});return _s(s,a,n)}function vs(e){var r,n;const a=new cs((r=e.opts)==null?void 0:r.level,e.maxSizeInBytes);return{logger:or($t(Ht({},e.opts),{level:"trace",browser:$t(Ht({},(n=e.opts)==null?void 0:n.browser),{write:s=>a.write(s)})})),chunkLoggerController:a}}function xs(e){var r;const n=new us((r=e.opts)==null?void 0:r.level,e.maxSizeInBytes);return{logger:or($t(Ht({},e.opts),{level:"trace"}),n),chunkLoggerController:n}}function Es(e){return typeof e.loggerOverride<"u"&&typeof e.loggerOverride!="string"?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?vs(e):xs(e)}var fr={},Yr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=ze.binary,n=ze.wipe;e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var a=function(){function v(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return v.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},v.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},v.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},v.prototype.update=function(g,o){if(o===void 0&&(o=g.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var l=0;if(this._bytesHashed+=o,this._bufferLength>0){for(;this._bufferLength<e.BLOCK_SIZE&&o>0;)this._buffer[this._bufferLength++]=g[l++],o--;this._bufferLength===this.blockSize&&(d(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(o>=this.blockSize&&(l=d(this._tempHi,this._tempLo,this._stateHi,this._stateLo,g,l,o),o%=this.blockSize);o>0;)this._buffer[this._bufferLength++]=g[l++],o--;return this},v.prototype.finish=function(g){if(!this._finished){var o=this._bytesHashed,l=this._bufferLength,y=o/536870912|0,S=o<<3,x=o%128<112?128:256;this._buffer[l]=128;for(var w=l+1;w<x-8;w++)this._buffer[w]=0;r.writeUint32BE(y,this._buffer,x-8),r.writeUint32BE(S,this._buffer,x-4),d(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,x),this._finished=!0}for(var w=0;w<this.digestLength/8;w++)r.writeUint32BE(this._stateHi[w],g,w*8),r.writeUint32BE(this._stateLo[w],g,w*8+4);return this},v.prototype.digest=function(){var g=new Uint8Array(this.digestLength);return this.finish(g),g},v.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},v.prototype.restoreState=function(g){return this._stateHi.set(g.stateHi),this._stateLo.set(g.stateLo),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},v.prototype.cleanSavedState=function(g){n.wipe(g.stateHi),n.wipe(g.stateLo),g.buffer&&n.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},v}();e.SHA512=a;var s=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function d(v,g,o,l,y,S,x){for(var w=o[0],j=o[1],J=o[2],q=o[3],B=o[4],Ae=o[5],ge=o[6],Me=o[7],$=l[0],M=l[1],je=l[2],et=l[3],ye=l[4],Fe=l[5],We=l[6],Xe=l[7],m,_,Y,le,L,I,O,A;x>=128;){for(var Le=0;Le<16;Le++){var ne=8*Le+S;v[Le]=r.readUint32BE(y,ne),g[Le]=r.readUint32BE(y,ne+4)}for(var Le=0;Le<80;Le++){var wt=w,z=j,gt=J,b=q,h=B,u=Ae,t=ge,f=Me,R=$,P=M,K=je,U=et,D=ye,W=Fe,Re=We,de=Xe;if(m=Me,_=Xe,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=(B>>>14|ye<<18)^(B>>>18|ye<<14)^(ye>>>9|B<<23),_=(ye>>>14|B<<18)^(ye>>>18|B<<14)^(B>>>9|ye<<23),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=B&Ae^~B&ge,_=ye&Fe^~ye&We,L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=s[Le*2],_=s[Le*2+1],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=v[Le%16],_=g[Le%16],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,Y=O&65535|A<<16,le=L&65535|I<<16,m=Y,_=le,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=(w>>>28|$<<4)^($>>>2|w<<30)^($>>>7|w<<25),_=($>>>28|w<<4)^(w>>>2|$<<30)^(w>>>7|$<<25),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,m=w&j^w&J^j&J,_=$&M^$&je^M&je,L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,f=O&65535|A<<16,de=L&65535|I<<16,m=b,_=U,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=Y,_=le,L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,b=O&65535|A<<16,U=L&65535|I<<16,j=wt,J=z,q=gt,B=b,Ae=h,ge=u,Me=t,w=f,M=R,je=P,et=K,ye=U,Fe=D,We=W,Xe=Re,$=de,Le%16===15)for(var ne=0;ne<16;ne++)m=v[ne],_=g[ne],L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=v[(ne+9)%16],_=g[(ne+9)%16],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,Y=v[(ne+1)%16],le=g[(ne+1)%16],m=(Y>>>1|le<<31)^(Y>>>8|le<<24)^Y>>>7,_=(le>>>1|Y<<31)^(le>>>8|Y<<24)^(le>>>7|Y<<25),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,Y=v[(ne+14)%16],le=g[(ne+14)%16],m=(Y>>>19|le<<13)^(le>>>29|Y<<3)^Y>>>6,_=(le>>>19|Y<<13)^(Y>>>29|le<<3)^(le>>>6|Y<<26),L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,v[ne]=O&65535|A<<16,g[ne]=L&65535|I<<16}m=w,_=$,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[0],_=l[0],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[0]=w=O&65535|A<<16,l[0]=$=L&65535|I<<16,m=j,_=M,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[1],_=l[1],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[1]=j=O&65535|A<<16,l[1]=M=L&65535|I<<16,m=J,_=je,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[2],_=l[2],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[2]=J=O&65535|A<<16,l[2]=je=L&65535|I<<16,m=q,_=et,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[3],_=l[3],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[3]=q=O&65535|A<<16,l[3]=et=L&65535|I<<16,m=B,_=ye,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[4],_=l[4],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[4]=B=O&65535|A<<16,l[4]=ye=L&65535|I<<16,m=Ae,_=Fe,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[5],_=l[5],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[5]=Ae=O&65535|A<<16,l[5]=Fe=L&65535|I<<16,m=ge,_=We,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[6],_=l[6],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[6]=ge=O&65535|A<<16,l[6]=We=L&65535|I<<16,m=Me,_=Xe,L=_&65535,I=_>>>16,O=m&65535,A=m>>>16,m=o[7],_=l[7],L+=_&65535,I+=_>>>16,O+=m&65535,A+=m>>>16,I+=L>>>16,O+=I>>>16,A+=O>>>16,o[7]=Me=O&65535|A<<16,l[7]=Xe=L&65535|I<<16,S+=128,x-=128}return S}function E(v){var g=new a;g.update(v);var o=g.digest();return g.clean(),o}e.hash=E})(Yr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.convertSecretKeyToX25519=e.convertPublicKeyToX25519=e.verify=e.sign=e.extractPublicKeyFromSecretKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.SEED_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=e.SIGNATURE_LENGTH=void 0;const r=ze.random,n=Yr,a=ze.wipe;e.SIGNATURE_LENGTH=64,e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=64,e.SEED_LENGTH=32;function s(b){const h=new Float64Array(16);if(b)for(let u=0;u<b.length;u++)h[u]=b[u];return h}const d=new Uint8Array(32);d[0]=9;const E=s(),v=s([1]),g=s([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),o=s([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),l=s([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),y=s([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),S=s([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function x(b,h){for(let u=0;u<16;u++)b[u]=h[u]|0}function w(b){let h=1;for(let u=0;u<16;u++){let t=b[u]+h+65535;h=Math.floor(t/65536),b[u]=t-h*65536}b[0]+=h-1+37*(h-1)}function j(b,h,u){const t=~(u-1);for(let f=0;f<16;f++){const R=t&(b[f]^h[f]);b[f]^=R,h[f]^=R}}function J(b,h){const u=s(),t=s();for(let f=0;f<16;f++)t[f]=h[f];w(t),w(t),w(t);for(let f=0;f<2;f++){u[0]=t[0]-65517;for(let P=1;P<15;P++)u[P]=t[P]-65535-(u[P-1]>>16&1),u[P-1]&=65535;u[15]=t[15]-32767-(u[14]>>16&1);const R=u[15]>>16&1;u[14]&=65535,j(t,u,1-R)}for(let f=0;f<16;f++)b[2*f]=t[f]&255,b[2*f+1]=t[f]>>8}function q(b,h){let u=0;for(let t=0;t<32;t++)u|=b[t]^h[t];return(1&u-1>>>8)-1}function B(b,h){const u=new Uint8Array(32),t=new Uint8Array(32);return J(u,b),J(t,h),q(u,t)}function Ae(b){const h=new Uint8Array(32);return J(h,b),h[0]&1}function ge(b,h){for(let u=0;u<16;u++)b[u]=h[2*u]+(h[2*u+1]<<8);b[15]&=32767}function Me(b,h,u){for(let t=0;t<16;t++)b[t]=h[t]+u[t]}function $(b,h,u){for(let t=0;t<16;t++)b[t]=h[t]-u[t]}function M(b,h,u){let t,f,R=0,P=0,K=0,U=0,D=0,W=0,Re=0,de=0,Pe=0,pe=0,he=0,ie=0,re=0,Z=0,V=0,H=0,se=0,_e=0,G=0,Ne=0,De=0,He=0,$e=0,Ke=0,qe=0,Ze=0,st=0,Ge=0,ct=0,vt=0,Rt=0,oe=u[0],Q=u[1],ae=u[2],fe=u[3],ce=u[4],ee=u[5],me=u[6],we=u[7],ve=u[8],xe=u[9],Ee=u[10],be=u[11],ue=u[12],F=u[13],Se=u[14],Ie=u[15];t=h[0],R+=t*oe,P+=t*Q,K+=t*ae,U+=t*fe,D+=t*ce,W+=t*ee,Re+=t*me,de+=t*we,Pe+=t*ve,pe+=t*xe,he+=t*Ee,ie+=t*be,re+=t*ue,Z+=t*F,V+=t*Se,H+=t*Ie,t=h[1],P+=t*oe,K+=t*Q,U+=t*ae,D+=t*fe,W+=t*ce,Re+=t*ee,de+=t*me,Pe+=t*we,pe+=t*ve,he+=t*xe,ie+=t*Ee,re+=t*be,Z+=t*ue,V+=t*F,H+=t*Se,se+=t*Ie,t=h[2],K+=t*oe,U+=t*Q,D+=t*ae,W+=t*fe,Re+=t*ce,de+=t*ee,Pe+=t*me,pe+=t*we,he+=t*ve,ie+=t*xe,re+=t*Ee,Z+=t*be,V+=t*ue,H+=t*F,se+=t*Se,_e+=t*Ie,t=h[3],U+=t*oe,D+=t*Q,W+=t*ae,Re+=t*fe,de+=t*ce,Pe+=t*ee,pe+=t*me,he+=t*we,ie+=t*ve,re+=t*xe,Z+=t*Ee,V+=t*be,H+=t*ue,se+=t*F,_e+=t*Se,G+=t*Ie,t=h[4],D+=t*oe,W+=t*Q,Re+=t*ae,de+=t*fe,Pe+=t*ce,pe+=t*ee,he+=t*me,ie+=t*we,re+=t*ve,Z+=t*xe,V+=t*Ee,H+=t*be,se+=t*ue,_e+=t*F,G+=t*Se,Ne+=t*Ie,t=h[5],W+=t*oe,Re+=t*Q,de+=t*ae,Pe+=t*fe,pe+=t*ce,he+=t*ee,ie+=t*me,re+=t*we,Z+=t*ve,V+=t*xe,H+=t*Ee,se+=t*be,_e+=t*ue,G+=t*F,Ne+=t*Se,De+=t*Ie,t=h[6],Re+=t*oe,de+=t*Q,Pe+=t*ae,pe+=t*fe,he+=t*ce,ie+=t*ee,re+=t*me,Z+=t*we,V+=t*ve,H+=t*xe,se+=t*Ee,_e+=t*be,G+=t*ue,Ne+=t*F,De+=t*Se,He+=t*Ie,t=h[7],de+=t*oe,Pe+=t*Q,pe+=t*ae,he+=t*fe,ie+=t*ce,re+=t*ee,Z+=t*me,V+=t*we,H+=t*ve,se+=t*xe,_e+=t*Ee,G+=t*be,Ne+=t*ue,De+=t*F,He+=t*Se,$e+=t*Ie,t=h[8],Pe+=t*oe,pe+=t*Q,he+=t*ae,ie+=t*fe,re+=t*ce,Z+=t*ee,V+=t*me,H+=t*we,se+=t*ve,_e+=t*xe,G+=t*Ee,Ne+=t*be,De+=t*ue,He+=t*F,$e+=t*Se,Ke+=t*Ie,t=h[9],pe+=t*oe,he+=t*Q,ie+=t*ae,re+=t*fe,Z+=t*ce,V+=t*ee,H+=t*me,se+=t*we,_e+=t*ve,G+=t*xe,Ne+=t*Ee,De+=t*be,He+=t*ue,$e+=t*F,Ke+=t*Se,qe+=t*Ie,t=h[10],he+=t*oe,ie+=t*Q,re+=t*ae,Z+=t*fe,V+=t*ce,H+=t*ee,se+=t*me,_e+=t*we,G+=t*ve,Ne+=t*xe,De+=t*Ee,He+=t*be,$e+=t*ue,Ke+=t*F,qe+=t*Se,Ze+=t*Ie,t=h[11],ie+=t*oe,re+=t*Q,Z+=t*ae,V+=t*fe,H+=t*ce,se+=t*ee,_e+=t*me,G+=t*we,Ne+=t*ve,De+=t*xe,He+=t*Ee,$e+=t*be,Ke+=t*ue,qe+=t*F,Ze+=t*Se,st+=t*Ie,t=h[12],re+=t*oe,Z+=t*Q,V+=t*ae,H+=t*fe,se+=t*ce,_e+=t*ee,G+=t*me,Ne+=t*we,De+=t*ve,He+=t*xe,$e+=t*Ee,Ke+=t*be,qe+=t*ue,Ze+=t*F,st+=t*Se,Ge+=t*Ie,t=h[13],Z+=t*oe,V+=t*Q,H+=t*ae,se+=t*fe,_e+=t*ce,G+=t*ee,Ne+=t*me,De+=t*we,He+=t*ve,$e+=t*xe,Ke+=t*Ee,qe+=t*be,Ze+=t*ue,st+=t*F,Ge+=t*Se,ct+=t*Ie,t=h[14],V+=t*oe,H+=t*Q,se+=t*ae,_e+=t*fe,G+=t*ce,Ne+=t*ee,De+=t*me,He+=t*we,$e+=t*ve,Ke+=t*xe,qe+=t*Ee,Ze+=t*be,st+=t*ue,Ge+=t*F,ct+=t*Se,vt+=t*Ie,t=h[15],H+=t*oe,se+=t*Q,_e+=t*ae,G+=t*fe,Ne+=t*ce,De+=t*ee,He+=t*me,$e+=t*we,Ke+=t*ve,qe+=t*xe,Ze+=t*Ee,st+=t*be,Ge+=t*ue,ct+=t*F,vt+=t*Se,Rt+=t*Ie,R+=38*se,P+=38*_e,K+=38*G,U+=38*Ne,D+=38*De,W+=38*He,Re+=38*$e,de+=38*Ke,Pe+=38*qe,pe+=38*Ze,he+=38*st,ie+=38*Ge,re+=38*ct,Z+=38*vt,V+=38*Rt,f=1,t=R+f+65535,f=Math.floor(t/65536),R=t-f*65536,t=P+f+65535,f=Math.floor(t/65536),P=t-f*65536,t=K+f+65535,f=Math.floor(t/65536),K=t-f*65536,t=U+f+65535,f=Math.floor(t/65536),U=t-f*65536,t=D+f+65535,f=Math.floor(t/65536),D=t-f*65536,t=W+f+65535,f=Math.floor(t/65536),W=t-f*65536,t=Re+f+65535,f=Math.floor(t/65536),Re=t-f*65536,t=de+f+65535,f=Math.floor(t/65536),de=t-f*65536,t=Pe+f+65535,f=Math.floor(t/65536),Pe=t-f*65536,t=pe+f+65535,f=Math.floor(t/65536),pe=t-f*65536,t=he+f+65535,f=Math.floor(t/65536),he=t-f*65536,t=ie+f+65535,f=Math.floor(t/65536),ie=t-f*65536,t=re+f+65535,f=Math.floor(t/65536),re=t-f*65536,t=Z+f+65535,f=Math.floor(t/65536),Z=t-f*65536,t=V+f+65535,f=Math.floor(t/65536),V=t-f*65536,t=H+f+65535,f=Math.floor(t/65536),H=t-f*65536,R+=f-1+37*(f-1),f=1,t=R+f+65535,f=Math.floor(t/65536),R=t-f*65536,t=P+f+65535,f=Math.floor(t/65536),P=t-f*65536,t=K+f+65535,f=Math.floor(t/65536),K=t-f*65536,t=U+f+65535,f=Math.floor(t/65536),U=t-f*65536,t=D+f+65535,f=Math.floor(t/65536),D=t-f*65536,t=W+f+65535,f=Math.floor(t/65536),W=t-f*65536,t=Re+f+65535,f=Math.floor(t/65536),Re=t-f*65536,t=de+f+65535,f=Math.floor(t/65536),de=t-f*65536,t=Pe+f+65535,f=Math.floor(t/65536),Pe=t-f*65536,t=pe+f+65535,f=Math.floor(t/65536),pe=t-f*65536,t=he+f+65535,f=Math.floor(t/65536),he=t-f*65536,t=ie+f+65535,f=Math.floor(t/65536),ie=t-f*65536,t=re+f+65535,f=Math.floor(t/65536),re=t-f*65536,t=Z+f+65535,f=Math.floor(t/65536),Z=t-f*65536,t=V+f+65535,f=Math.floor(t/65536),V=t-f*65536,t=H+f+65535,f=Math.floor(t/65536),H=t-f*65536,R+=f-1+37*(f-1),b[0]=R,b[1]=P,b[2]=K,b[3]=U,b[4]=D,b[5]=W,b[6]=Re,b[7]=de,b[8]=Pe,b[9]=pe,b[10]=he,b[11]=ie,b[12]=re,b[13]=Z,b[14]=V,b[15]=H}function je(b,h){M(b,h,h)}function et(b,h){const u=s();let t;for(t=0;t<16;t++)u[t]=h[t];for(t=253;t>=0;t--)je(u,u),t!==2&&t!==4&&M(u,u,h);for(t=0;t<16;t++)b[t]=u[t]}function ye(b,h){const u=s();let t;for(t=0;t<16;t++)u[t]=h[t];for(t=250;t>=0;t--)je(u,u),t!==1&&M(u,u,h);for(t=0;t<16;t++)b[t]=u[t]}function Fe(b,h){const u=s(),t=s(),f=s(),R=s(),P=s(),K=s(),U=s(),D=s(),W=s();$(u,b[1],b[0]),$(W,h[1],h[0]),M(u,u,W),Me(t,b[0],b[1]),Me(W,h[0],h[1]),M(t,t,W),M(f,b[3],h[3]),M(f,f,o),M(R,b[2],h[2]),Me(R,R,R),$(P,t,u),$(K,R,f),Me(U,R,f),Me(D,t,u),M(b[0],P,K),M(b[1],D,U),M(b[2],U,K),M(b[3],P,D)}function We(b,h,u){for(let t=0;t<4;t++)j(b[t],h[t],u)}function Xe(b,h){const u=s(),t=s(),f=s();et(f,h[2]),M(u,h[0],f),M(t,h[1],f),J(b,t),b[31]^=Ae(u)<<7}function m(b,h,u){x(b[0],E),x(b[1],v),x(b[2],v),x(b[3],E);for(let t=255;t>=0;--t){const f=u[t/8|0]>>(t&7)&1;We(b,h,f),Fe(h,b),Fe(b,b),We(b,h,f)}}function _(b,h){const u=[s(),s(),s(),s()];x(u[0],l),x(u[1],y),x(u[2],v),M(u[3],l,y),m(b,u,h)}function Y(b){if(b.length!==e.SEED_LENGTH)throw new Error(`ed25519: seed must be ${e.SEED_LENGTH} bytes`);const h=(0,n.hash)(b);h[0]&=248,h[31]&=127,h[31]|=64;const u=new Uint8Array(32),t=[s(),s(),s(),s()];_(t,h),Xe(u,t);const f=new Uint8Array(64);return f.set(b),f.set(u,32),{publicKey:u,secretKey:f}}e.generateKeyPairFromSeed=Y;function le(b){const h=(0,r.randomBytes)(32,b),u=Y(h);return(0,a.wipe)(h),u}e.generateKeyPair=le;function L(b){if(b.length!==e.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${e.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(b.subarray(32))}e.extractPublicKeyFromSecretKey=L;const I=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function O(b,h){let u,t,f,R;for(t=63;t>=32;--t){for(u=0,f=t-32,R=t-12;f<R;++f)h[f]+=u-16*h[t]*I[f-(t-32)],u=Math.floor((h[f]+128)/256),h[f]-=u*256;h[f]+=u,h[t]=0}for(u=0,f=0;f<32;f++)h[f]+=u-(h[31]>>4)*I[f],u=h[f]>>8,h[f]&=255;for(f=0;f<32;f++)h[f]-=u*I[f];for(t=0;t<32;t++)h[t+1]+=h[t]>>8,b[t]=h[t]&255}function A(b){const h=new Float64Array(64);for(let u=0;u<64;u++)h[u]=b[u];for(let u=0;u<64;u++)b[u]=0;O(b,h)}function Le(b,h){const u=new Float64Array(64),t=[s(),s(),s(),s()],f=(0,n.hash)(b.subarray(0,32));f[0]&=248,f[31]&=127,f[31]|=64;const R=new Uint8Array(64);R.set(f.subarray(32),32);const P=new n.SHA512;P.update(R.subarray(32)),P.update(h);const K=P.digest();P.clean(),A(K),_(t,K),Xe(R,t),P.reset(),P.update(R.subarray(0,32)),P.update(b.subarray(32)),P.update(h);const U=P.digest();A(U);for(let D=0;D<32;D++)u[D]=K[D];for(let D=0;D<32;D++)for(let W=0;W<32;W++)u[D+W]+=U[D]*f[W];return O(R.subarray(32),u),R}e.sign=Le;function ne(b,h){const u=s(),t=s(),f=s(),R=s(),P=s(),K=s(),U=s();return x(b[2],v),ge(b[1],h),je(f,b[1]),M(R,f,g),$(f,f,b[2]),Me(R,b[2],R),je(P,R),je(K,P),M(U,K,P),M(u,U,f),M(u,u,R),ye(u,u),M(u,u,f),M(u,u,R),M(u,u,R),M(b[0],u,R),je(t,b[0]),M(t,t,R),B(t,f)&&M(b[0],b[0],S),je(t,b[0]),M(t,t,R),B(t,f)?-1:(Ae(b[0])===h[31]>>7&&$(b[0],E,b[0]),M(b[3],b[0],b[1]),0)}function wt(b,h,u){const t=new Uint8Array(32),f=[s(),s(),s(),s()],R=[s(),s(),s(),s()];if(u.length!==e.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${e.SIGNATURE_LENGTH} bytes`);if(ne(R,b))return!1;const P=new n.SHA512;P.update(u.subarray(0,32)),P.update(b),P.update(h);const K=P.digest();return A(K),m(f,R,K),_(R,u.subarray(32)),Fe(f,R),Xe(t,f),!q(u,t)}e.verify=wt;function z(b){let h=[s(),s(),s(),s()];if(ne(h,b))throw new Error("Ed25519: invalid public key");let u=s(),t=s(),f=h[1];Me(u,v,f),$(t,v,f),et(t,t),M(u,u,t);let R=new Uint8Array(32);return J(R,u),R}e.convertPublicKeyToX25519=z;function gt(b){const h=(0,n.hash)(b.subarray(0,32));h[0]&=248,h[31]&=127,h[31]|=64;const u=new Uint8Array(h.subarray(0,32));return(0,a.wipe)(h),u}e.convertSecretKeyToX25519=gt})(fr);const Ss="EdDSA",Is="JWT",Zr=".",Qr="base64url",Os="utf8",Ts="utf8",As=":",Ls="did",Rs="key",jr="base58btc",Ps="z",Cs="K36",Ms=32;function Gt(e){return Jt(Ft(ht(e),Os),Qr)}function en(e){const r=Ft(Cs,jr),n=Ps+Jt(Hr([r,e]),jr);return[Ls,Rs,n].join(As)}function js(e){return Jt(e,Qr)}function Ns(e){return Ft([Gt(e.header),Gt(e.payload)].join(Zr),Ts)}function Bs(e){return[Gt(e.header),Gt(e.payload),js(e.signature)].join(Zr)}function zs(e=ze.random.randomBytes(Ms)){return fr.generateKeyPairFromSeed(e)}async function Ds(e,r,n,a,s=ze.cjs.fromMiliseconds(Date.now())){const d={alg:Ss,typ:Is},E=en(a.publicKey),v=s+n,g={iss:E,sub:e,aud:r,iat:s,exp:v},o=Ns({header:d,payload:g}),l=fr.sign(a.secretKey,o);return Bs({header:d,payload:g,signature:l})}const Ks="PARSE_ERROR",Us="INVALID_REQUEST",Ws="METHOD_NOT_FOUND",Hs="INVALID_PARAMS",tn="INTERNAL_ERROR",cr="SERVER_ERROR",$s=[-32700,-32600,-32601,-32602,-32603],St={[Ks]:{code:-32700,message:"Parse error"},[Us]:{code:-32600,message:"Invalid Request"},[Ws]:{code:-32601,message:"Method not found"},[Hs]:{code:-32602,message:"Invalid params"},[tn]:{code:-32603,message:"Internal error"},[cr]:{code:-32e3,message:"Server error"}},rn=cr;function Gs(e){return $s.includes(e)}function Nr(e){return Object.keys(St).includes(e)?St[e]:St[rn]}function ks(e){const r=Object.values(St).find(n=>n.code===e);return r||St[rn]}function nn(e,r,n){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${r}`):e}var sn={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var v = Object.defineProperty;
|
|
2
2
|
var S = (i, e, t) => e in i ? v(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var a = (i, e, t) => S(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { cM as f, cN as I, a5 as x, r as p, cO as b, a8 as w, c7 as U, c8 as E, c9 as m, u as o, cP as k, s as c, p as h, cQ as F, ce as _, Z as $, cb as C, m as T, bM as l, cR as R, bR as N } from "./index-
|
|
5
|
-
import { A as O } from "./aptos-
|
|
4
|
+
import { cM as f, cN as I, a5 as x, r as p, cO as b, a8 as w, c7 as U, c8 as E, c9 as m, u as o, cP as k, s as c, p as h, cQ as F, ce as _, Z as $, cb as C, m as T, bM as l, cR as R, bR as N } from "./index-BDhzG0Bz.mjs";
|
|
5
|
+
import { A as O } from "./aptos-BXyptrTk.mjs";
|
|
6
6
|
class Q {
|
|
7
7
|
constructor(e, t, s, r, n = !1) {
|
|
8
8
|
a(this, "transaction");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var P=Object.defineProperty;var U=(k,o,t)=>o in k?P(k,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):k[o]=t;var g=(k,o,t)=>U(k,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-Bvy2urku.js"),e=require("./index-DrMU1dLJ.js"),v=require("./algorand-BgrZh6rH.js"),j=e.ABIMethod.fromSignature("portal_transfer(byte[])byte[]"),p=class p{constructor(o,t,r,s){g(this,"network");g(this,"chain");g(this,"connection");g(this,"contracts");g(this,"chainId");g(this,"coreBridge");g(this,"coreAppId");g(this,"coreAppAddress");g(this,"tokenBridgeAppId");g(this,"tokenBridgeAddress");if(this.network=o,this.chain=t,this.connection=r,this.contracts=s,this.chainId=e.toChainId(t),!s.coreBridge)throw new Error(`Core contract address for chain ${t} not found`);const i=BigInt(s.coreBridge);if(this.coreAppId=i,this.coreAppAddress=e.getApplicationAddress(i),this.coreBridge=new d.AlgorandWormholeCore(o,t,r,s),!s.tokenBridge)throw new Error(`TokenBridge contract address for chain ${t} not found`);const a=BigInt(s.tokenBridge);this.tokenBridgeAppId=a,this.tokenBridgeAddress=e.getApplicationAddress(a)}static async fromRpc(o,t){const[r,s]=await v.AlgorandPlatform.chainFromRpc(o),i=t[s];if(i.network!==r)throw new Error(`Network mismatch: ${i.network} != ${r}`);return new p(r,s,o,i.contracts)}async isWrappedAsset(o){const t=new e.AlgorandAddress(o).toInt();if(t===0)return!1;const r=await this.connection.getAssetByID(t).do(),i=e.Asset.from_obj_for_encoding(r).params.creator,a=await this.connection.accountInformation(i).exclude("all").do(),n=e.Account.from_obj_for_encoding(a);return(n==null?void 0:n.authAddr)===this.tokenBridgeAddress}async getOriginalAsset(o){const t=new e.AlgorandAddress(o).toInt(),r=await this.connection.getAssetByID(t).do(),s=e.Asset.from_obj_for_encoding(r),i=await d.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,s.params.creator);if(i.length<94)throw new Error("Invalid local state data");const a=i.slice(92,94),n=e.toChain(e.bignum.decode(a)),A=new e.UniversalAddress(i.slice(60,92));return{chain:n,address:A}}async getTokenUniversalAddress(o){return new e.AlgorandAddress(o).toUniversalAddress()}async getTokenNativeAddress(o,t){return new e.AlgorandAddress(t).toNative()}async getWrappedAsset(o){if(e.isNative(o.address))throw new Error("native asset cannot be a wrapped asset");const t=d.StorageLogicSig.forWrappedAsset(this.tokenBridgeAppId,o),r=await d.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,t.address());if(r.length<8)throw new Error("Invalid wrapped asset data");return e.toNative(this.chain,e.bignum.decode(r.slice(0,8)).toString())}async hasWrappedAsset(o){try{return await this.getWrappedAsset(o),!0}catch{}return!1}async getWrappedNative(){return e.toNative(this.chain,"0")}async isTransferCompleted(o){const t=d.StorageLogicSig.forMessageId(this.tokenBridgeAppId,{sequence:o.sequence,chain:o.emitterChain,emitter:o.emitterAddress});try{return await d.StorageLogicSig.checkBitsSet(this.connection,this.tokenBridgeAppId,t.address(),o.sequence)}catch{}return!1}async*createAttestation(o,t){if(!t)throw new Error("Payer required to create attestation");const r=new e.AlgorandAddress(t).toString(),s=new e.AlgorandAddress(o).toInt(),i=[],a=await this.connection.getTransactionParams().do(),n=d.StorageLogicSig.forEmitter(this.coreAppId,new e.AlgorandAddress(this.tokenBridgeAddress).toUint8Array()),{accounts:[A],txs:I}=await d.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,r,this.coreAppId,n,a);i.push(...I);let h="",c;if(s!==0){const u=await this.connection.getAssetByID(s).do(),b=e.Asset.from_obj_for_encoding(u),S=await this.connection.accountInformation(b.params.creator).do();if(c=e.Account.from_obj_for_encoding(S),c.authAddr===this.tokenBridgeAddress.toString())throw new Error("Cannot re-attest wormhole assets")}const B=d.StorageLogicSig.forNativeAsset(this.tokenBridgeAppId,BigInt(s)),w=await d.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,r,this.tokenBridgeAppId,B);h=w.accounts[0],i.push(...w.txs);const m=e.makeApplicationCallTxnFromObject({from:r,appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:e.OnApplicationComplete.NoOpOC,appArgs:[p.noop],suggestedParams:a});i.push({tx:m});const f=await this.coreBridge.getMessageFee();if(f>BigInt(0)){const u=e.makePaymentTxnWithSuggestedParamsFromObject({from:r,suggestedParams:a,to:this.tokenBridgeAddress,amount:f});i.push({tx:u})}let y=[A,h,this.coreAppAddress];c&&y.push(c.address);let l=e.makeApplicationCallTxnFromObject({appArgs:[p.attestToken,e.bignum.toBytes(s,8)],accounts:y,appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),foreignApps:[e.safeBigIntToNumber(this.coreAppId)],foreignAssets:[s],from:r,onComplete:e.OnApplicationComplete.NoOpOC,suggestedParams:a});f>BigInt(0)?l.fee*=3:l.fee*=2,i.push({tx:l});for(const u of i)yield this.createUnsignedTx(u,"TokenBridge.createAttestation",!0)}async*submitAttestation(o,t,r){if(!t)throw new Error("Sender required to submit attestation");r||(r=await this.connection.getTransactionParams().do());const s=t.toString(),a=d.StorageLogicSig.forWrappedAsset(this.tokenBridgeAppId,o.payload.token).address(),n=[],A=[],I=await d.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,a);I.length>8&&A.push(new e.AlgorandAddress(I.slice(0,8)).toInt()),n.push({tx:e.makePaymentTxnWithSuggestedParamsFromObject({from:s,to:a,amount:1e5,suggestedParams:r})});let h=new Uint8Array(1);h[0]=1,n.push({tx:e.makeApplicationCallTxnFromObject({appArgs:[p.noop,h],appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),from:s,onComplete:e.OnApplicationComplete.NoOpOC,suggestedParams:r})}),h=new Uint8Array(1),h[0]=2,n.push({tx:e.makeApplicationCallTxnFromObject({appArgs:[p.noop,h],appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),from:s,onComplete:e.OnApplicationComplete.NoOpOC,suggestedParams:r})}),n.push({tx:e.makeApplicationCallTxnFromObject({accounts:[],appArgs:[p.receiveAttest,e.serialize(o)],appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),foreignAssets:A,from:s,onComplete:e.OnApplicationComplete.NoOpOC,suggestedParams:r})}),n[n.length-1].tx.fee=n[n.length-1].tx.fee*2;for(const c of n)yield this.createUnsignedTx(c,"TokenBridge.submitAttestation",!0)}async*transfer(o,t,r,s,i){const a=o.toString(),n=e.isNative(r)?0:new e.AlgorandAddress(r).toInt(),A=s,I=e.toChainId(t.chain),h=t.address.toUniversalAddress().toUint8Array(),c=await this.connection.getTransactionParams().do(),B=BigInt(0),w=d.StorageLogicSig.fromData({appId:this.coreAppId,appAddress:e.decodeAddress(this.coreAppAddress).publicKey,idx:BigInt(0),address:e.decodeAddress(this.tokenBridgeAddress).publicKey}),m=[],{accounts:[f],txs:y}=await d.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,a,this.coreAppId,w,c);m.push(...y);let l="",u,b=!1;if(n!==0){const x=await this.connection.getAssetByID(n).do();l=e.Asset.from_obj_for_encoding(x).params.creator;const C=await this.connection.accountInformation(l).do();u=e.Account.from_obj_for_encoding(C),b=u.authAddr===this.tokenBridgeAddress.toString()}const S=await this.coreBridge.getMessageFee();if(S>0&&m.push({tx:e.makePaymentTxnWithSuggestedParamsFromObject({from:a,to:this.tokenBridgeAddress,amount:S,suggestedParams:c})}),!b){const x=d.StorageLogicSig.forNativeAsset(this.tokenBridgeAppId,BigInt(n)),{accounts:[T],txs:C}=await d.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,a,this.tokenBridgeAppId,x,c);l=T,C.push(...C)}if(n!==0&&!await p.isOptedInToAsset(this.connection,l,n)){const x=e.makePaymentTxnWithSuggestedParamsFromObject({from:a,to:l,amount:1e5,suggestedParams:c});let T=e.makeApplicationCallTxnFromObject({from:a,appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:e.OnApplicationComplete.NoOpOC,appArgs:[p.optIn,e.bigIntToBytes(n,8)],foreignAssets:[n],accounts:[l],suggestedParams:c});T.fee*=2,m.unshift({tx:x},{tx:T})}const L=e.makeApplicationCallTxnFromObject({from:a,appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:e.OnApplicationComplete.NoOpOC,appArgs:[p.noop],suggestedParams:c});m.push({tx:L});let N=[];if(n===0){const x=e.makePaymentTxnWithSuggestedParamsFromObject({from:a,to:l,amount:A,suggestedParams:c});m.push({tx:x}),N=[f,l,l]}else{const x=e.makeAssetTransferTxnWithSuggestedParamsFromObject({from:a,to:l,amount:A,assetIndex:n,suggestedParams:c});m.push({tx:x}),N=u!=null&&u.address?[f,l,u.address]:[f,l]}const W=[p.sendTransfer,e.bignum.toBytes(n,8),e.bignum.toBytes(A,8),h,e.bignum.toBytes(I,8),e.bignum.toBytes(B,8)];i&&W.push(i);const F=e.makeApplicationCallTxnFromObject({from:a,appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:e.OnApplicationComplete.NoOpOC,appArgs:W,foreignApps:[e.safeBigIntToNumber(this.coreAppId)],foreignAssets:[n],accounts:N,suggestedParams:c});F.fee*=2,m.push({tx:F});for(const x of m)yield this.createUnsignedTx(x,"TokenBridge.transfer",!0)}async*redeem(o,t,r=!0,s){s||(s=await this.connection.getTransactionParams().do());const i=new e.AlgorandAddress(o).toString(),{accounts:a,txs:n}=await d.AlgorandWormholeCore.submitVAAHeader(this.connection,this.coreAppId,this.tokenBridgeAppId,t,i);let A,I="",h=[],c=0;if(t.payload.token.chain!==this.chain){A=d.StorageLogicSig.forWrappedAsset(this.tokenBridgeAppId,t.payload.token),I=A.address();const f=await d.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,I);c=new e.AlgorandAddress(f.slice(0,8)).toInt()}else{const f=new e.AlgorandAddress(t.payload.token.address).toBigInt();A=d.StorageLogicSig.forNativeAsset(this.tokenBridgeAppId,f),I=A.address(),c=e.safeBigIntToNumber(f)}a.push(I);let B=0,w="";if(t.payloadName==="TransferWithPayload"?(B=new e.AlgorandAddress(t.payload.to.address).toInt(),w=e.getApplicationAddress(B)):w=new e.AlgorandAddress(t.payload.to.address.toUint8Array()).toString(),a.push(w),c!==0&&(h.push(c),!await p.isOptedInToAsset(this.connection,w,c))){if(i!=w)throw new Error("Cannot ASA optin for somebody else (asset "+c.toString()+")");n.unshift({tx:e.makeAssetTransferTxnWithSuggestedParamsFromObject({amount:0,assetIndex:c,from:i,suggestedParams:s,to:i})})}const m={accounts:a,appArgs:[p.completeTransfer,e.serialize(t)],appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),foreignAssets:h,from:i,onComplete:e.OnApplicationComplete.NoOpOC,suggestedParams:s};n.push({tx:e.makeApplicationCallTxnFromObject(m)}),n[n.length-1].tx.fee=n[n.length-1].tx.fee*(t.payloadName==="Transfer"&&t.payload.fee!==void 0&&t.payload.fee===0n?2:3),t.payloadName==="TransferWithPayload"&&(n[n.length-1].tx.appForeignApps=[B],n.push({tx:e.makeApplicationCallTxnFromObject({appArgs:[j.getSelector(),j.args[0].type.encode(e.serialize(t))],appIndex:B,foreignAssets:h,from:i,onComplete:e.OnApplicationComplete.NoOpOC,suggestedParams:s})}));for(const f of n)yield this.createUnsignedTx(f,"TokenBridge.redeem",!0)}static async isOptedInToAsset(o,t,r){var s;try{const i=await o.accountAssetInformation(t,r).do();return(((s=e.AccountAssetResponse.from_obj_for_encoding(i).assetHolding)==null?void 0:s.amount)??0)>0}catch{}return!1}createUnsignedTx(o,t,r=!0){return new d.AlgorandUnsignedTransaction(o,this.network,this.chain,t,r)}};g(p,"sendTransfer",e.bytes.encode("sendTransfer")),g(p,"attestToken",e.bytes.encode("attestToken")),g(p,"noop",e.bytes.encode("nop")),g(p,"optIn",e.bytes.encode("optin")),g(p,"completeTransfer",e.bytes.encode("completeTransfer")),g(p,"receiveAttest",e.bytes.encode("receiveAttest"));let O=p;e.registerProtocol(e._platform$4,"TokenBridge",O);exports.AlgorandTokenBridge=O;exports.TransferMethodSelector=j;
|
|
1
|
+
"use strict";var P=Object.defineProperty;var U=(k,o,t)=>o in k?P(k,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):k[o]=t;var g=(k,o,t)=>U(k,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-CGmv-GLf.js"),e=require("./index-ByG9EJHX.js"),v=require("./algorand-DIrI8hux.js"),j=e.ABIMethod.fromSignature("portal_transfer(byte[])byte[]"),p=class p{constructor(o,t,r,s){g(this,"network");g(this,"chain");g(this,"connection");g(this,"contracts");g(this,"chainId");g(this,"coreBridge");g(this,"coreAppId");g(this,"coreAppAddress");g(this,"tokenBridgeAppId");g(this,"tokenBridgeAddress");if(this.network=o,this.chain=t,this.connection=r,this.contracts=s,this.chainId=e.toChainId(t),!s.coreBridge)throw new Error(`Core contract address for chain ${t} not found`);const i=BigInt(s.coreBridge);if(this.coreAppId=i,this.coreAppAddress=e.getApplicationAddress(i),this.coreBridge=new d.AlgorandWormholeCore(o,t,r,s),!s.tokenBridge)throw new Error(`TokenBridge contract address for chain ${t} not found`);const a=BigInt(s.tokenBridge);this.tokenBridgeAppId=a,this.tokenBridgeAddress=e.getApplicationAddress(a)}static async fromRpc(o,t){const[r,s]=await v.AlgorandPlatform.chainFromRpc(o),i=t[s];if(i.network!==r)throw new Error(`Network mismatch: ${i.network} != ${r}`);return new p(r,s,o,i.contracts)}async isWrappedAsset(o){const t=new e.AlgorandAddress(o).toInt();if(t===0)return!1;const r=await this.connection.getAssetByID(t).do(),i=e.Asset.from_obj_for_encoding(r).params.creator,a=await this.connection.accountInformation(i).exclude("all").do(),n=e.Account.from_obj_for_encoding(a);return(n==null?void 0:n.authAddr)===this.tokenBridgeAddress}async getOriginalAsset(o){const t=new e.AlgorandAddress(o).toInt(),r=await this.connection.getAssetByID(t).do(),s=e.Asset.from_obj_for_encoding(r),i=await d.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,s.params.creator);if(i.length<94)throw new Error("Invalid local state data");const a=i.slice(92,94),n=e.toChain(e.bignum.decode(a)),A=new e.UniversalAddress(i.slice(60,92));return{chain:n,address:A}}async getTokenUniversalAddress(o){return new e.AlgorandAddress(o).toUniversalAddress()}async getTokenNativeAddress(o,t){return new e.AlgorandAddress(t).toNative()}async getWrappedAsset(o){if(e.isNative(o.address))throw new Error("native asset cannot be a wrapped asset");const t=d.StorageLogicSig.forWrappedAsset(this.tokenBridgeAppId,o),r=await d.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,t.address());if(r.length<8)throw new Error("Invalid wrapped asset data");return e.toNative(this.chain,e.bignum.decode(r.slice(0,8)).toString())}async hasWrappedAsset(o){try{return await this.getWrappedAsset(o),!0}catch{}return!1}async getWrappedNative(){return e.toNative(this.chain,"0")}async isTransferCompleted(o){const t=d.StorageLogicSig.forMessageId(this.tokenBridgeAppId,{sequence:o.sequence,chain:o.emitterChain,emitter:o.emitterAddress});try{return await d.StorageLogicSig.checkBitsSet(this.connection,this.tokenBridgeAppId,t.address(),o.sequence)}catch{}return!1}async*createAttestation(o,t){if(!t)throw new Error("Payer required to create attestation");const r=new e.AlgorandAddress(t).toString(),s=new e.AlgorandAddress(o).toInt(),i=[],a=await this.connection.getTransactionParams().do(),n=d.StorageLogicSig.forEmitter(this.coreAppId,new e.AlgorandAddress(this.tokenBridgeAddress).toUint8Array()),{accounts:[A],txs:I}=await d.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,r,this.coreAppId,n,a);i.push(...I);let h="",c;if(s!==0){const u=await this.connection.getAssetByID(s).do(),b=e.Asset.from_obj_for_encoding(u),S=await this.connection.accountInformation(b.params.creator).do();if(c=e.Account.from_obj_for_encoding(S),c.authAddr===this.tokenBridgeAddress.toString())throw new Error("Cannot re-attest wormhole assets")}const B=d.StorageLogicSig.forNativeAsset(this.tokenBridgeAppId,BigInt(s)),w=await d.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,r,this.tokenBridgeAppId,B);h=w.accounts[0],i.push(...w.txs);const m=e.makeApplicationCallTxnFromObject({from:r,appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:e.OnApplicationComplete.NoOpOC,appArgs:[p.noop],suggestedParams:a});i.push({tx:m});const f=await this.coreBridge.getMessageFee();if(f>BigInt(0)){const u=e.makePaymentTxnWithSuggestedParamsFromObject({from:r,suggestedParams:a,to:this.tokenBridgeAddress,amount:f});i.push({tx:u})}let y=[A,h,this.coreAppAddress];c&&y.push(c.address);let l=e.makeApplicationCallTxnFromObject({appArgs:[p.attestToken,e.bignum.toBytes(s,8)],accounts:y,appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),foreignApps:[e.safeBigIntToNumber(this.coreAppId)],foreignAssets:[s],from:r,onComplete:e.OnApplicationComplete.NoOpOC,suggestedParams:a});f>BigInt(0)?l.fee*=3:l.fee*=2,i.push({tx:l});for(const u of i)yield this.createUnsignedTx(u,"TokenBridge.createAttestation",!0)}async*submitAttestation(o,t,r){if(!t)throw new Error("Sender required to submit attestation");r||(r=await this.connection.getTransactionParams().do());const s=t.toString(),a=d.StorageLogicSig.forWrappedAsset(this.tokenBridgeAppId,o.payload.token).address(),n=[],A=[],I=await d.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,a);I.length>8&&A.push(new e.AlgorandAddress(I.slice(0,8)).toInt()),n.push({tx:e.makePaymentTxnWithSuggestedParamsFromObject({from:s,to:a,amount:1e5,suggestedParams:r})});let h=new Uint8Array(1);h[0]=1,n.push({tx:e.makeApplicationCallTxnFromObject({appArgs:[p.noop,h],appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),from:s,onComplete:e.OnApplicationComplete.NoOpOC,suggestedParams:r})}),h=new Uint8Array(1),h[0]=2,n.push({tx:e.makeApplicationCallTxnFromObject({appArgs:[p.noop,h],appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),from:s,onComplete:e.OnApplicationComplete.NoOpOC,suggestedParams:r})}),n.push({tx:e.makeApplicationCallTxnFromObject({accounts:[],appArgs:[p.receiveAttest,e.serialize(o)],appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),foreignAssets:A,from:s,onComplete:e.OnApplicationComplete.NoOpOC,suggestedParams:r})}),n[n.length-1].tx.fee=n[n.length-1].tx.fee*2;for(const c of n)yield this.createUnsignedTx(c,"TokenBridge.submitAttestation",!0)}async*transfer(o,t,r,s,i){const a=o.toString(),n=e.isNative(r)?0:new e.AlgorandAddress(r).toInt(),A=s,I=e.toChainId(t.chain),h=t.address.toUniversalAddress().toUint8Array(),c=await this.connection.getTransactionParams().do(),B=BigInt(0),w=d.StorageLogicSig.fromData({appId:this.coreAppId,appAddress:e.decodeAddress(this.coreAppAddress).publicKey,idx:BigInt(0),address:e.decodeAddress(this.tokenBridgeAddress).publicKey}),m=[],{accounts:[f],txs:y}=await d.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,a,this.coreAppId,w,c);m.push(...y);let l="",u,b=!1;if(n!==0){const x=await this.connection.getAssetByID(n).do();l=e.Asset.from_obj_for_encoding(x).params.creator;const C=await this.connection.accountInformation(l).do();u=e.Account.from_obj_for_encoding(C),b=u.authAddr===this.tokenBridgeAddress.toString()}const S=await this.coreBridge.getMessageFee();if(S>0&&m.push({tx:e.makePaymentTxnWithSuggestedParamsFromObject({from:a,to:this.tokenBridgeAddress,amount:S,suggestedParams:c})}),!b){const x=d.StorageLogicSig.forNativeAsset(this.tokenBridgeAppId,BigInt(n)),{accounts:[T],txs:C}=await d.AlgorandWormholeCore.maybeCreateStorageTx(this.connection,a,this.tokenBridgeAppId,x,c);l=T,C.push(...C)}if(n!==0&&!await p.isOptedInToAsset(this.connection,l,n)){const x=e.makePaymentTxnWithSuggestedParamsFromObject({from:a,to:l,amount:1e5,suggestedParams:c});let T=e.makeApplicationCallTxnFromObject({from:a,appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:e.OnApplicationComplete.NoOpOC,appArgs:[p.optIn,e.bigIntToBytes(n,8)],foreignAssets:[n],accounts:[l],suggestedParams:c});T.fee*=2,m.unshift({tx:x},{tx:T})}const L=e.makeApplicationCallTxnFromObject({from:a,appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:e.OnApplicationComplete.NoOpOC,appArgs:[p.noop],suggestedParams:c});m.push({tx:L});let N=[];if(n===0){const x=e.makePaymentTxnWithSuggestedParamsFromObject({from:a,to:l,amount:A,suggestedParams:c});m.push({tx:x}),N=[f,l,l]}else{const x=e.makeAssetTransferTxnWithSuggestedParamsFromObject({from:a,to:l,amount:A,assetIndex:n,suggestedParams:c});m.push({tx:x}),N=u!=null&&u.address?[f,l,u.address]:[f,l]}const W=[p.sendTransfer,e.bignum.toBytes(n,8),e.bignum.toBytes(A,8),h,e.bignum.toBytes(I,8),e.bignum.toBytes(B,8)];i&&W.push(i);const F=e.makeApplicationCallTxnFromObject({from:a,appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),onComplete:e.OnApplicationComplete.NoOpOC,appArgs:W,foreignApps:[e.safeBigIntToNumber(this.coreAppId)],foreignAssets:[n],accounts:N,suggestedParams:c});F.fee*=2,m.push({tx:F});for(const x of m)yield this.createUnsignedTx(x,"TokenBridge.transfer",!0)}async*redeem(o,t,r=!0,s){s||(s=await this.connection.getTransactionParams().do());const i=new e.AlgorandAddress(o).toString(),{accounts:a,txs:n}=await d.AlgorandWormholeCore.submitVAAHeader(this.connection,this.coreAppId,this.tokenBridgeAppId,t,i);let A,I="",h=[],c=0;if(t.payload.token.chain!==this.chain){A=d.StorageLogicSig.forWrappedAsset(this.tokenBridgeAppId,t.payload.token),I=A.address();const f=await d.StorageLogicSig.decodeLocalState(this.connection,this.tokenBridgeAppId,I);c=new e.AlgorandAddress(f.slice(0,8)).toInt()}else{const f=new e.AlgorandAddress(t.payload.token.address).toBigInt();A=d.StorageLogicSig.forNativeAsset(this.tokenBridgeAppId,f),I=A.address(),c=e.safeBigIntToNumber(f)}a.push(I);let B=0,w="";if(t.payloadName==="TransferWithPayload"?(B=new e.AlgorandAddress(t.payload.to.address).toInt(),w=e.getApplicationAddress(B)):w=new e.AlgorandAddress(t.payload.to.address.toUint8Array()).toString(),a.push(w),c!==0&&(h.push(c),!await p.isOptedInToAsset(this.connection,w,c))){if(i!=w)throw new Error("Cannot ASA optin for somebody else (asset "+c.toString()+")");n.unshift({tx:e.makeAssetTransferTxnWithSuggestedParamsFromObject({amount:0,assetIndex:c,from:i,suggestedParams:s,to:i})})}const m={accounts:a,appArgs:[p.completeTransfer,e.serialize(t)],appIndex:e.safeBigIntToNumber(this.tokenBridgeAppId),foreignAssets:h,from:i,onComplete:e.OnApplicationComplete.NoOpOC,suggestedParams:s};n.push({tx:e.makeApplicationCallTxnFromObject(m)}),n[n.length-1].tx.fee=n[n.length-1].tx.fee*(t.payloadName==="Transfer"&&t.payload.fee!==void 0&&t.payload.fee===0n?2:3),t.payloadName==="TransferWithPayload"&&(n[n.length-1].tx.appForeignApps=[B],n.push({tx:e.makeApplicationCallTxnFromObject({appArgs:[j.getSelector(),j.args[0].type.encode(e.serialize(t))],appIndex:B,foreignAssets:h,from:i,onComplete:e.OnApplicationComplete.NoOpOC,suggestedParams:s})}));for(const f of n)yield this.createUnsignedTx(f,"TokenBridge.redeem",!0)}static async isOptedInToAsset(o,t,r){var s;try{const i=await o.accountAssetInformation(t,r).do();return(((s=e.AccountAssetResponse.from_obj_for_encoding(i).assetHolding)==null?void 0:s.amount)??0)>0}catch{}return!1}createUnsignedTx(o,t,r=!0){return new d.AlgorandUnsignedTransaction(o,this.network,this.chain,t,r)}};g(p,"sendTransfer",e.bytes.encode("sendTransfer")),g(p,"attestToken",e.bytes.encode("attestToken")),g(p,"noop",e.bytes.encode("nop")),g(p,"optIn",e.bytes.encode("optin")),g(p,"completeTransfer",e.bytes.encode("completeTransfer")),g(p,"receiveAttest",e.bytes.encode("receiveAttest"));let O=p;e.registerProtocol(e._platform$4,"TokenBridge",O);exports.AlgorandTokenBridge=O;exports.TransferMethodSelector=j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var m=Object.defineProperty;var w=(i,e,t)=>e in i?m(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var s=(i,e,t)=>w(i,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-
|
|
1
|
+
"use strict";var m=Object.defineProperty;var w=(i,e,t)=>e in i?m(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var s=(i,e,t)=>w(i,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-ByG9EJHX.js"),g=require("./aptos-poOCeL-e.js");class d{constructor(e,t,r,o){s(this,"network");s(this,"chain");s(this,"connection");s(this,"contracts");s(this,"chainId");s(this,"coreBridge");this.network=e,this.chain=t,this.connection=r,this.contracts=o,this.chainId=c.toChainId(t);const n=o.coreBridge;if(!n)throw new Error(`CoreBridge contract Address for chain ${t} not found`);this.coreBridge=n}getGuardianSet(e){throw new Error("Method not implemented.")}getGuardianSetIndex(){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,t){const[r,o]=await g.AptosPlatform.chainFromRpc(e),n=t[o];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} !== ${r}`);return new d(r,o,e,n.contracts)}async*publishMessage(e,t){throw new Error("Method not implemented.")}async*verifyMessage(e,t){throw new Error("Not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(r=>({chain:r.emitterChain,emitter:r.emitterAddress,sequence:r.sequence}))}async parseMessages(e){const t=await this.connection.getTransactionByHash(e);if(t.type!=="user_transaction")throw new Error(`${e} is not a user_transaction`);const o=t.events.filter(n=>n.type.endsWith("WormholeMessage"));if(!o||o.length===0)throw new Error(`WormholeMessage not found for ${e}`);return o.map(n=>{const a=n.data,h=new c.UniversalAddress(BigInt(a.sender).toString(16).padStart(64,"0"));return c.createVAA("Uint8Array",{guardianSet:0,emitterChain:this.chain,emitterAddress:h,sequence:BigInt(a.sequence),timestamp:Number(a.timestamp),consistencyLevel:a.consistency_level,nonce:Number(a.nonce),signatures:[],payload:c.hex.decode(a.payload)})})}}c.registerProtocol("Aptos","WormholeCore",d);exports.AptosWormholeCore=d;
|