@wormhole-foundation/wormhole-connect 1.1.7 → 1.1.8-beta.2-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 +2 -6
- package/dist/assets/{ccip-CKlxC_Y7.js → ccip-B5VfDKOr.js} +1 -1
- package/dist/assets/{evm-0FhX9q-N.js → evm-CkbZddI4.js} +11 -11
- package/dist/assets/{index-D3tkaG2a.js → index-BVl4T3LK.js} +1 -1
- package/dist/assets/{index-Cpn9HW_L.js → index-CPZCe6ys.js} +1 -1
- package/dist/assets/index-C_hywdem.js +2 -0
- package/dist/assets/{index.es-C7aRxBms.js → index.es-D_CMbICm.js} +2 -2
- package/dist/assets/{solana-fPZvnal8.js → solana-BWnjaIFb.js} +1 -1
- package/dist/main.js +69 -69
- package/dist/src/config/devnet/chains.d.ts.map +1 -1
- package/dist/src/config/devnet/tokens.d.ts.map +1 -1
- package/dist/src/config/mainnet/chains.d.ts.map +1 -1
- package/dist/src/config/mainnet/rpcs.d.ts.map +1 -1
- package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
- package/dist/src/config/testnet/chains.d.ts.map +1 -1
- package/dist/src/config/testnet/rpcs.d.ts.map +1 -1
- package/dist/src/config/testnet/tokens.d.ts.map +1 -1
- package/dist/src/config/types.d.ts +6 -4
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/icons/ChainIcons.d.ts +9 -0
- package/dist/src/icons/ChainIcons.d.ts.map +1 -0
- package/dist/src/icons/Chains/APT.d.ts +4 -0
- package/dist/src/icons/Chains/APT.d.ts.map +1 -0
- package/dist/src/icons/Chains/ARBITRUM.d.ts +4 -0
- package/dist/src/icons/Chains/ARBITRUM.d.ts.map +1 -0
- package/dist/src/icons/Chains/AVAX.d.ts +4 -0
- package/dist/src/icons/Chains/AVAX.d.ts.map +1 -0
- package/dist/src/icons/Chains/BASE.d.ts +4 -0
- package/dist/src/icons/Chains/BASE.d.ts.map +1 -0
- package/dist/src/icons/Chains/BLAST.d.ts +4 -0
- package/dist/src/icons/Chains/BLAST.d.ts.map +1 -0
- package/dist/src/icons/Chains/BSC.d.ts +4 -0
- package/dist/src/icons/Chains/BSC.d.ts.map +1 -0
- package/dist/src/icons/Chains/CELO.d.ts +4 -0
- package/dist/src/icons/Chains/CELO.d.ts.map +1 -0
- package/dist/src/icons/Chains/ETH.d.ts +4 -0
- package/dist/src/icons/Chains/ETH.d.ts.map +1 -0
- package/dist/src/icons/Chains/FTM.d.ts +4 -0
- package/dist/src/icons/Chains/FTM.d.ts.map +1 -0
- package/dist/src/icons/Chains/GLMR.d.ts +4 -0
- package/dist/src/icons/Chains/GLMR.d.ts.map +1 -0
- package/dist/src/icons/Chains/KAIA.d.ts +4 -0
- package/dist/src/icons/Chains/KAIA.d.ts.map +1 -0
- package/dist/src/icons/Chains/MANTLE.d.ts +4 -0
- package/dist/src/icons/Chains/MANTLE.d.ts.map +1 -0
- package/dist/src/icons/Chains/OPTIMISM.d.ts +4 -0
- package/dist/src/icons/Chains/OPTIMISM.d.ts.map +1 -0
- package/dist/src/icons/Chains/OSMO.d.ts +4 -0
- package/dist/src/icons/Chains/OSMO.d.ts.map +1 -0
- package/dist/src/icons/{Tokens/MATIC.d.ts → Chains/POLY.d.ts} +1 -1
- package/dist/src/icons/Chains/POLY.d.ts.map +1 -0
- package/dist/src/icons/Chains/SCROLL.d.ts +4 -0
- package/dist/src/icons/Chains/SCROLL.d.ts.map +1 -0
- package/dist/src/icons/Chains/SOL.d.ts +4 -0
- package/dist/src/icons/Chains/SOL.d.ts.map +1 -0
- package/dist/src/icons/Chains/SUI.d.ts +4 -0
- package/dist/src/icons/Chains/SUI.d.ts.map +1 -0
- package/dist/src/icons/Chains/WORLD.d.ts +4 -0
- package/dist/src/icons/Chains/WORLD.d.ts.map +1 -0
- package/dist/src/icons/Chains/XLAYER.d.ts +4 -0
- package/dist/src/icons/Chains/XLAYER.d.ts.map +1 -0
- package/dist/src/icons/{Tokens/noIcon.d.ts → Chains/empty.d.ts} +1 -1
- package/dist/src/icons/Chains/empty.d.ts.map +1 -0
- package/dist/src/icons/Error.d.ts +5 -0
- package/dist/src/icons/Error.d.ts.map +1 -0
- package/dist/src/icons/TokenIcons.d.ts +4 -4
- package/dist/src/icons/TokenIcons.d.ts.map +1 -1
- package/dist/src/icons/Tokens/POLY.d.ts +4 -0
- package/dist/src/icons/Tokens/POLY.d.ts.map +1 -0
- package/{lib/src/icons/Tokens/noIcon.d.ts → dist/src/icons/Tokens/empty.d.ts} +1 -1
- package/dist/src/icons/Tokens/empty.d.ts.map +1 -0
- package/dist/src/icons/Warning.d.ts +5 -0
- package/dist/src/icons/Warning.d.ts.map +1 -0
- package/dist/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
- package/dist/src/sdklegacy/config/TESTNET.d.ts.map +1 -1
- package/dist/src/telemetry/types.d.ts +2 -2
- package/dist/src/telemetry/types.d.ts.map +1 -1
- package/dist/src/utils/errors.d.ts +1 -0
- package/dist/src/utils/errors.d.ts.map +1 -1
- package/dist/src/utils/wallet/solana.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/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/SwapInputs/index.d.ts.map +1 -1
- package/dist/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/dist/src/views/v2/TxHistory/Item/index.d.ts.map +1 -1
- package/lib/{algorand-BMmsWTAu.mjs → algorand-DgpF_mXd.mjs} +3 -3
- package/lib/{algorand-Da0_8cf2.js → algorand-tXcNTbqw.js} +1 -1
- package/lib/{aptos-DzlneWdc.js → aptos-CR0OcDBV.js} +1 -1
- package/lib/{aptos-CqNp8m3d.mjs → aptos-CTr4u3up.mjs} +3 -3
- package/lib/{aptos-Bq5m4DWd.js → aptos-Cbmld6H3.js} +2 -2
- package/lib/{aptos-BRy2Sx9v.mjs → aptos-M_shWERr.mjs} +1 -1
- package/lib/{ccip-D8QgtWRV.mjs → ccip-C0KpO3UY.mjs} +1 -1
- package/lib/{ccip-D_lKZ8dG.js → ccip-DaRd1xyq.js} +1 -1
- package/lib/{cosmwasm-Cf0t1lE-.mjs → cosmwasm-BrumI-4g.mjs} +6 -6
- package/lib/{cosmwasm-fRr7e3MB.js → cosmwasm-u__X419O.js} +2 -2
- package/lib/{events-yfdmmNCR.js → events-B3M_mwnv.js} +1 -1
- package/lib/{events-CVSLp-ok.mjs → events-CpI6THlG.mjs} +1 -1
- package/lib/{evm-CQKp6_Wx.js → evm-B8QV0WMy.js} +1 -1
- package/lib/{evm-Dg1mIkXe.js → evm-Blf-_XHQ.js} +10 -10
- package/lib/{evm-Zg5jdrlO.mjs → evm-CcAiiNiN.mjs} +191 -148
- package/lib/{evm-DSZZezK1.mjs → evm-DTv3ll5g.mjs} +5 -5
- package/lib/{index-Ck7U51Xm.mjs → index-5Nsx5Sww.mjs} +4 -4
- package/lib/{index-D13ZQRlT.mjs → index-5iQ5GTSu.mjs} +2 -2
- package/lib/{index-D3O-ZJcv.mjs → index-B0-xPGuQ.mjs} +1 -1
- package/lib/{index-C731B7jq.js → index-B9I8wNfR.js} +1 -1
- package/lib/{index-BOq0uXpD.js → index-BLT1iLJO.js} +1 -1
- package/lib/{index-BmuYzhHL.js → index-BPyIEVyq.js} +1 -1
- package/lib/{index-DszEbASZ.mjs → index-BRV3iD_7.mjs} +4 -4
- package/lib/{index-CSSKS-vz.mjs → index-BVEhvlmw.mjs} +2 -2
- package/lib/{index-C5QlkKHr.mjs → index-BVvayeum.mjs} +2 -2
- package/lib/{index-By_UgVLx.js → index-BWadlVxP.js} +1 -1
- package/lib/{index-BxQtifWt.mjs → index-BeR2pFP_.mjs} +2 -2
- package/lib/{index-Cz3osr_g.mjs → index-Br2oG_eT.mjs} +2 -2
- package/lib/{index-2wZ-FIVm.mjs → index-C24awnH1.mjs} +1 -1
- package/lib/{index-DD_1zlsI.mjs → index-CH4v9fdl.mjs} +2 -2
- package/lib/{index-BsmwMTgP.mjs → index-CPe7WKSz.mjs} +2 -2
- package/lib/{index-D71NyvyY.js → index-CU3bs1UO.js} +1 -1
- package/lib/{index-BLgSQ86p.js → index-CX4xrmvB.js} +1 -1
- package/lib/{index-Dy6GB5mP.js → index-CaA38viB.js} +1 -1
- package/lib/{index-D3mpEea2.js → index-CrvMtWJk.js} +1 -1
- package/lib/{index-CYUFRVbi.mjs → index-CuqXZa2Q.mjs} +1 -1
- package/lib/{index-efbET7Py.js → index-CwrUNk7R.js} +1 -1
- package/lib/{index-DVWYpaeI.mjs → index-DGUuTzq5.mjs} +4 -4
- package/lib/{index-CGKozrvg.js → index-DIeGmRzd.js} +1 -1
- package/lib/{index-CHGx8I1j.mjs → index-DSQmXjdq.mjs} +3 -3
- package/lib/{index-J6N9_FYr.js → index-DXxIHcif.js} +1 -1
- package/lib/{index-B4AhyVTX.mjs → index-DZohPEoL.mjs} +1 -1
- package/lib/{index-CZnVbF6M.js → index-D_WLQWCk.js} +1 -1
- package/lib/{index-VzpUKEWS.mjs → index-DaqgMXh5.mjs} +2 -2
- package/lib/{index-Cl_cUur6.js → index-DcH-LW3u.js} +1 -1
- package/lib/{index-CWtPENwp.mjs → index-DhvaqGhk.mjs} +3 -3
- package/lib/{index-DXEJXrZB.mjs → index-Dj9uX8Yq.mjs} +2 -2
- package/lib/{index-Bd3r5qyl.js → index-Dsp18Ki0.js} +1 -1
- package/lib/{index-DcB3fjme.mjs → index-EFO4LCUD.mjs} +2 -2
- package/lib/{index-BO3vOQxk.js → index-Hj_44yP6.js} +71 -71
- package/lib/{index-BHG51Brl.js → index-MAW-S7qJ.js} +1 -1
- package/lib/{index-qfthnBCS.js → index-NVVfqKqy.js} +1 -1
- package/lib/{index-D-Krstx1.js → index-QVDg02xQ.js} +1 -1
- package/lib/index-YmHc4VtK.js +1 -0
- package/lib/{index-DvsgVXYg.mjs → index-aB_fp0rM.mjs} +7490 -5805
- package/lib/{index-CNP16QTD.js → index-iMGGdz1P.js} +1 -1
- package/lib/{index-LGjuZKKu.mjs → index-lNjLQ3Ln.mjs} +2 -2
- package/lib/{index-DBjTeGna.mjs → index-nvF_Vnsk.mjs} +3 -3
- package/lib/{index-DixplJql.js → index-sqvrX5as.js} +1 -1
- package/lib/{index-C5S2j8Fu.js → index-w19NhRI8.js} +1 -1
- package/lib/{index.es-BVCple4p.mjs → index.es-4k95rbkL.mjs} +5 -5
- package/lib/{index.es-CjMJzYF1.js → index.es-8dGbttwj.js} +2 -2
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{keccak-De7nuwQ4.mjs → keccak-BVl93H2h.mjs} +1 -1
- package/lib/{keccak-B1TxS-dx.js → keccak-DxPHQOs9.js} +1 -1
- package/lib/{pbkdf2-th68Msr4.js → pbkdf2-C4tGHSl-.js} +1 -1
- package/lib/{pbkdf2-BMvMJkBs.mjs → pbkdf2-CrsCYTQU.mjs} +1 -1
- package/lib/{signer-BJMVxfdc.js → signer-BcAkKtkv.js} +1 -1
- package/lib/{signer-MVt0UYt2.mjs → signer-Du2DF25K.mjs} +1 -1
- package/lib/{solana-CSHof9wh.js → solana-B2noqxW_.js} +1 -1
- package/lib/solana-CFMBUeJY.js +1 -0
- package/lib/{solana-CzYn3Qoy.mjs → solana-DS0mdgC1.mjs} +6 -5
- package/lib/{solana-Dl0-sj3P.mjs → solana-lSSqSdUq.mjs} +5 -5
- package/lib/{solanaEmbed.esm-CiqJ8OMN.mjs → solanaEmbed.esm-B9HRNUtr.mjs} +3 -3
- package/lib/{solanaEmbed.esm-D4-CQ1dc.js → solanaEmbed.esm-Cr2BGkxp.js} +1 -1
- package/lib/src/config/devnet/chains.d.ts.map +1 -1
- package/lib/src/config/devnet/tokens.d.ts.map +1 -1
- package/lib/src/config/mainnet/chains.d.ts.map +1 -1
- package/lib/src/config/mainnet/rpcs.d.ts.map +1 -1
- package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
- package/lib/src/config/testnet/chains.d.ts.map +1 -1
- package/lib/src/config/testnet/rpcs.d.ts.map +1 -1
- package/lib/src/config/testnet/tokens.d.ts.map +1 -1
- package/lib/src/config/types.d.ts +6 -4
- package/lib/src/config/types.d.ts.map +1 -1
- package/lib/src/icons/ChainIcons.d.ts +9 -0
- package/lib/src/icons/ChainIcons.d.ts.map +1 -0
- package/lib/src/icons/Chains/APT.d.ts +4 -0
- package/lib/src/icons/Chains/APT.d.ts.map +1 -0
- package/lib/src/icons/Chains/ARBITRUM.d.ts +4 -0
- package/lib/src/icons/Chains/ARBITRUM.d.ts.map +1 -0
- package/lib/src/icons/Chains/AVAX.d.ts +4 -0
- package/lib/src/icons/Chains/AVAX.d.ts.map +1 -0
- package/lib/src/icons/Chains/BASE.d.ts +4 -0
- package/lib/src/icons/Chains/BASE.d.ts.map +1 -0
- package/lib/src/icons/Chains/BLAST.d.ts +4 -0
- package/lib/src/icons/Chains/BLAST.d.ts.map +1 -0
- package/lib/src/icons/Chains/BSC.d.ts +4 -0
- package/lib/src/icons/Chains/BSC.d.ts.map +1 -0
- package/lib/src/icons/Chains/CELO.d.ts +4 -0
- package/lib/src/icons/Chains/CELO.d.ts.map +1 -0
- package/lib/src/icons/Chains/ETH.d.ts +4 -0
- package/lib/src/icons/Chains/ETH.d.ts.map +1 -0
- package/lib/src/icons/Chains/FTM.d.ts +4 -0
- package/lib/src/icons/Chains/FTM.d.ts.map +1 -0
- package/lib/src/icons/Chains/GLMR.d.ts +4 -0
- package/lib/src/icons/Chains/GLMR.d.ts.map +1 -0
- package/lib/src/icons/Chains/KAIA.d.ts +4 -0
- package/lib/src/icons/Chains/KAIA.d.ts.map +1 -0
- package/lib/src/icons/Chains/MANTLE.d.ts +4 -0
- package/lib/src/icons/Chains/MANTLE.d.ts.map +1 -0
- package/lib/src/icons/Chains/OPTIMISM.d.ts +4 -0
- package/lib/src/icons/Chains/OPTIMISM.d.ts.map +1 -0
- package/lib/src/icons/Chains/OSMO.d.ts +4 -0
- package/lib/src/icons/Chains/OSMO.d.ts.map +1 -0
- package/lib/src/icons/{Tokens/MATIC.d.ts → Chains/POLY.d.ts} +1 -1
- package/lib/src/icons/Chains/POLY.d.ts.map +1 -0
- package/lib/src/icons/Chains/SCROLL.d.ts +4 -0
- package/lib/src/icons/Chains/SCROLL.d.ts.map +1 -0
- package/lib/src/icons/Chains/SOL.d.ts +4 -0
- package/lib/src/icons/Chains/SOL.d.ts.map +1 -0
- package/lib/src/icons/Chains/SUI.d.ts +4 -0
- package/lib/src/icons/Chains/SUI.d.ts.map +1 -0
- package/lib/src/icons/Chains/WORLD.d.ts +4 -0
- package/lib/src/icons/Chains/WORLD.d.ts.map +1 -0
- package/lib/src/icons/Chains/XLAYER.d.ts +4 -0
- package/lib/src/icons/Chains/XLAYER.d.ts.map +1 -0
- package/lib/src/icons/Chains/empty.d.ts +4 -0
- package/lib/src/icons/Chains/empty.d.ts.map +1 -0
- package/lib/src/icons/Error.d.ts +5 -0
- package/lib/src/icons/Error.d.ts.map +1 -0
- package/lib/src/icons/TokenIcons.d.ts +4 -4
- package/lib/src/icons/TokenIcons.d.ts.map +1 -1
- package/lib/src/icons/Tokens/POLY.d.ts +4 -0
- package/lib/src/icons/Tokens/POLY.d.ts.map +1 -0
- package/lib/src/icons/Tokens/empty.d.ts +4 -0
- package/lib/src/icons/Tokens/empty.d.ts.map +1 -0
- package/lib/src/icons/Warning.d.ts +5 -0
- package/lib/src/icons/Warning.d.ts.map +1 -0
- package/lib/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
- package/lib/src/sdklegacy/config/TESTNET.d.ts.map +1 -1
- package/lib/src/telemetry/types.d.ts +2 -2
- package/lib/src/telemetry/types.d.ts.map +1 -1
- package/lib/src/utils/errors.d.ts +1 -0
- package/lib/src/utils/errors.d.ts.map +1 -1
- package/lib/src/utils/wallet/solana.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/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/SwapInputs/index.d.ts.map +1 -1
- package/lib/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/lib/src/views/v2/TxHistory/Item/index.d.ts.map +1 -1
- package/lib/{sui-CtcHvkr4.js → sui-C7SxJ54B.js} +1 -1
- package/lib/{sui-CRd5nfFp.mjs → sui-CnGk4aWJ.mjs} +1 -1
- package/lib/{sui-DGx4sp7U.mjs → sui-CsizbSts.mjs} +4 -4
- package/lib/{sui-Dr2X3iSP.js → sui-Q9BM2cCK.js} +2 -2
- package/lib/{unsignedTransaction--hPZeMNL.mjs → unsignedTransaction-Cd7qXgBL.mjs} +2 -2
- package/lib/{unsignedTransaction-B3FN8Hrt.js → unsignedTransaction-DDxT_548.js} +1 -1
- package/package.json +19 -19
- package/dist/assets/index-DzYZz-_M.js +0 -2
- package/dist/src/icons/Tokens/MATIC.d.ts.map +0 -1
- package/dist/src/icons/Tokens/noIcon.d.ts.map +0 -1
- package/lib/index-B0DfJMRv.js +0 -1
- package/lib/solana-tlqX9QNX.js +0 -1
- package/lib/src/icons/Tokens/MATIC.d.ts.map +0 -1
- package/lib/src/icons/Tokens/noIcon.d.ts.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var Dc=Object.defineProperty;var xc=(e,t,n)=>t in e?Dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ct=(e,t,n)=>xc(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-BO3vOQxk.js"),p=require("./cosmwasm-fRr7e3MB.js"),Uc=require("./index-DixplJql.js"),oi=require("./unsignedTransaction-B3FN8Hrt.js");function qc(e){return e.id!==void 0&&e.pending!==void 0&&e.data!==void 0}var Hi={},Fn={},te={},Nr={},Hc=l.commonjsGlobal&&l.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.Decimal=void 0;const qe=Hc(l.bnExports),si=100;class Q{static fromUserInput(t,n){Q.verifyFractionalDigits(n);const r=t.match(/[^0-9.]/);if(r)throw new Error(`Invalid character at position ${r.index+1}`);let o,s;if(t==="")o="0",s="";else if(t.search(/\./)===-1)o=t,s="";else{const c=t.split(".");switch(c.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!c[1])throw new Error("Fractional part missing");o=c[0],s=c[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(s.length>n)throw new Error("Got more fractional digits than supported");const i=`${o}${s.padEnd(n,"0")}`;return new Q(i,n)}static fromAtomics(t,n){return Q.verifyFractionalDigits(n),new Q(t,n)}static zero(t){return Q.verifyFractionalDigits(t),new Q("0",t)}static one(t){return Q.verifyFractionalDigits(t),new Q("1"+"0".repeat(t),t)}static verifyFractionalDigits(t){if(!Number.isInteger(t))throw new Error("Fractional digits is not an integer");if(t<0)throw new Error("Fractional digits must not be negative");if(t>si)throw new Error(`Fractional digits must not exceed ${si}`)}static compare(t,n){if(t.fractionalDigits!==n.fractionalDigits)throw new Error("Fractional digits do not match");return t.data.atomics.cmp(new qe.default(n.atomics))}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}constructor(t,n){if(!t.match(/^[0-9]+$/))throw new Error("Invalid string format. Only non-negative integers in decimal representation supported.");this.data={atomics:new qe.default(t),fractionalDigits:n}}clone(){return new Q(this.atomics,this.fractionalDigits)}floor(){const t=new qe.default(10).pow(new qe.default(this.data.fractionalDigits)),n=this.data.atomics.div(t);return this.data.atomics.mod(t).isZero()?this.clone():Q.fromAtomics(n.mul(t).toString(),this.fractionalDigits)}ceil(){const t=new qe.default(10).pow(new qe.default(this.data.fractionalDigits)),n=this.data.atomics.div(t);return this.data.atomics.mod(t).isZero()?this.clone():Q.fromAtomics(n.addn(1).mul(t).toString(),this.fractionalDigits)}toString(){const t=new qe.default(10).pow(new qe.default(this.data.fractionalDigits)),n=this.data.atomics.div(t),r=this.data.atomics.mod(t);if(r.isZero())return n.toString();{const s=r.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${n.toString()}.${s}`}}toFloatApproximation(){const t=Number(this.toString());if(Number.isNaN(t))throw new Error("Conversion to number failed");return t}plus(t){if(this.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");const n=this.data.atomics.add(new qe.default(t.atomics));return new Q(n.toString(),this.fractionalDigits)}minus(t){if(this.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");const n=this.data.atomics.sub(new qe.default(t.atomics));if(n.ltn(0))throw new Error("Difference must not be negative");return new Q(n.toString(),this.fractionalDigits)}multiply(t){const n=this.data.atomics.mul(new qe.default(t.toString()));return new Q(n.toString(),this.fractionalDigits)}equals(t){return Q.compare(this,t)===0}isLessThan(t){return Q.compare(this,t)<0}isLessThanOrEqual(t){return Q.compare(this,t)<=0}isGreaterThan(t){return Q.compare(this,t)>0}isGreaterThanOrEqual(t){return Q.compare(this,t)>=0}}Nr.Decimal=Q;var Je={},Vc=l.commonjsGlobal&&l.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Je,"__esModule",{value:!0});Je.Uint64=Je.Uint53=Je.Int53=Je.Uint32=void 0;const _r=Vc(l.bnExports),Gc=new _r.default("18446744073709551615",10,"be");class $n{static fromBigEndianBytes(t){return $n.fromBytes(t)}static fromBytes(t,n="be"){if(t.length!==4)throw new Error("Invalid input length. Expected 4 bytes.");for(let o=0;o<t.length;++o)if(!Number.isInteger(t[o])||t[o]>255||t[o]<0)throw new Error("Invalid value in byte. Found: "+t[o]);const r=n==="be"?t:Array.from(t).reverse();return new $n(r[0]*2**24+r[1]*2**16+r[2]*2**8+r[3])}static fromString(t){if(!t.match(/^[0-9]+$/))throw new Error("Invalid string format");return new $n(Number.parseInt(t,10))}constructor(t){if(Number.isNaN(t))throw new Error("Input is not a number");if(!Number.isInteger(t))throw new Error("Input is not an integer");if(t<0||t>4294967295)throw new Error("Input not in uint32 range: "+t.toString());this.data=t}toBytesBigEndian(){return new Uint8Array([Math.floor(this.data/2**24)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**0)&255])}toBytesLittleEndian(){return new Uint8Array([Math.floor(this.data/2**0)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**24)&255])}toNumber(){return this.data}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}Je.Uint32=$n;class xn{static fromString(t){if(!t.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new xn(Number.parseInt(t,10))}constructor(t){if(Number.isNaN(t))throw new Error("Input is not a number");if(!Number.isInteger(t))throw new Error("Input is not an integer");if(t<Number.MIN_SAFE_INTEGER||t>Number.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+t.toString());this.data=t}toNumber(){return this.data}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}Je.Int53=xn;class Ts{static fromString(t){const n=xn.fromString(t);return new Ts(n.toNumber())}constructor(t){const n=new xn(t);if(n.toNumber()<0)throw new Error("Input is negative");this.data=n}toNumber(){return this.data.toNumber()}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}Je.Uint53=Ts;class xt{static fromBytesBigEndian(t){return xt.fromBytes(t)}static fromBytes(t,n="be"){if(t.length!==8)throw new Error("Invalid input length. Expected 8 bytes.");for(let o=0;o<t.length;++o)if(!Number.isInteger(t[o])||t[o]>255||t[o]<0)throw new Error("Invalid value in byte. Found: "+t[o]);const r=n==="be"?Array.from(t):Array.from(t).reverse();return new xt(new _r.default(r))}static fromString(t){if(!t.match(/^[0-9]+$/))throw new Error("Invalid string format");return new xt(new _r.default(t,10,"be"))}static fromNumber(t){if(Number.isNaN(t))throw new Error("Input is not a number");if(!Number.isInteger(t))throw new Error("Input is not an integer");let n;try{n=new _r.default(t)}catch{throw new Error("Input is not a safe integer")}return new xt(n)}constructor(t){if(t.isNeg())throw new Error("Input is negative");if(t.gt(Gc))throw new Error("Input exceeds uint64 range");this.data=t}toBytesBigEndian(){return Uint8Array.from(this.data.toArray("be",8))}toBytesLittleEndian(){return Uint8Array.from(this.data.toArray("le",8))}toString(){return this.data.toString(10)}toBigInt(){return BigInt(this.toString())}toNumber(){return this.data.toNumber()}}Je.Uint64=xt;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Uint64=e.Uint53=e.Uint32=e.Int53=e.Decimal=void 0;var t=Nr;Object.defineProperty(e,"Decimal",{enumerable:!0,get:function(){return t.Decimal}});var n=Je;Object.defineProperty(e,"Int53",{enumerable:!0,get:function(){return n.Int53}}),Object.defineProperty(e,"Uint32",{enumerable:!0,get:function(){return n.Uint32}}),Object.defineProperty(e,"Uint53",{enumerable:!0,get:function(){return n.Uint53}}),Object.defineProperty(e,"Uint64",{enumerable:!0,get:function(){return n.Uint64}})})(te);var vt={},Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.decodeTxRaw=void 0;const Wo=p.tx;function Fc(e){const t=Wo.TxRaw.decode(e);return{authInfo:Wo.AuthInfo.decode(t.authInfoBytes),body:Wo.TxBody.decode(t.bodyBytes),signatures:t.signatures}}Dr.decodeTxRaw=Fc;var Vt={},st={},Ae={},_e={},Le={},D={},Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.fromAscii=Gt.toAscii=void 0;function Wc(e){const t=n=>n.split("").map(r=>{const o=r.charCodeAt(0);if(o<32||o>126)throw new Error("Cannot encode character that is out of printable ASCII range: "+o);return o});return Uint8Array.from(t(e))}Gt.toAscii=Wc;function Jc(e){return(n=>n.map(r=>{if(r<32||r>126)throw new Error("Cannot decode character that is out of printable ASCII range: "+r);return String.fromCharCode(r)}))(Array.from(e)).join("")}Gt.fromAscii=Jc;var Ft={},Lc=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),zc=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Kc=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Lc(t,e,n);return zc(t,e),t};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.fromBase64=Ft.toBase64=void 0;const Vi=Kc(l.base64Js);function Qc(e){return Vi.fromByteArray(e)}Ft.toBase64=Qc;function Zc(e){if(!e.match(/^[a-zA-Z0-9+/]*={0,2}$/))throw new Error("Invalid base64 string format");return Vi.toByteArray(e)}Ft.fromBase64=Zc;var lt={},Xc=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Yc=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),eu=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Xc(t,e,n);return Yc(t,e),t};Object.defineProperty(lt,"__esModule",{value:!0});lt.normalizeBech32=lt.fromBech32=lt.toBech32=void 0;const Ar=eu(p.bech32);function Gi(e,t,n){return Ar.encode(e,Ar.toWords(t),n)}lt.toBech32=Gi;function Fi(e,t=1/0){const n=Ar.decode(e,t);return{prefix:n.prefix,data:new Uint8Array(Ar.fromWords(n.words))}}lt.fromBech32=Fi;function tu(e){const{prefix:t,data:n}=Fi(e);return Gi(t,n)}lt.normalizeBech32=tu;var Wt={};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.fromHex=Wt.toHex=void 0;function nu(e){let t="";for(const n of e)t+=("0"+n.toString(16)).slice(-2);return t}Wt.toHex=nu;function ru(e){if(e.length%2!==0)throw new Error("hex string length must be a multiple of 2");const t=new Uint8Array(e.length/2);for(let n=0;n<t.length;n++){const r=2*n,o=e.slice(r,r+2);if(!o.match(/[0-9a-f]{2}/i))throw new Error("hex string contains invalid characters");t[n]=parseInt(o,16)}return t}Wt.fromHex=ru;var Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.toRfc3339=Jt.fromRfc3339=void 0;const ou=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/;function It(e,t=2){return e.toString().padStart(t,"0")}function su(e){const t=ou.exec(e);if(!t)throw new Error("Date string is not in RFC3339 format");const n=+t[1],r=+t[2],o=+t[3],s=+t[4],i=+t[5],c=+t[6],a=t[7]?Math.floor(+t[7]*1e3):0;let u,d,y;t[8]==="Z"?(u=1,d=0,y=0):(u=t[8].substring(0,1)==="-"?-1:1,d=+t[8].substring(1,3),y=+t[8].substring(4,6));const M=u*(d*60+y)*60,_=new Date;return _.setUTCFullYear(n,r-1,o),_.setUTCHours(s,i,c,a),new Date(_.getTime()-M*1e3)}Jt.fromRfc3339=su;function iu(e){const t=e.getUTCFullYear(),n=It(e.getUTCMonth()+1),r=It(e.getUTCDate()),o=It(e.getUTCHours()),s=It(e.getUTCMinutes()),i=It(e.getUTCSeconds()),c=It(e.getUTCMilliseconds(),3);return`${t}-${n}-${r}T${o}:${s}:${i}.${c}Z`}Jt.toRfc3339=iu;var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.fromUtf8=Lt.toUtf8=void 0;function au(e){return new TextEncoder().encode(e)}Lt.toUtf8=au;function cu(e,t=!1){const n=!t;return new TextDecoder("utf-8",{fatal:n}).decode(e)}Lt.fromUtf8=cu;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toUtf8=e.fromUtf8=e.toRfc3339=e.fromRfc3339=e.toHex=e.fromHex=e.toBech32=e.normalizeBech32=e.fromBech32=e.toBase64=e.fromBase64=e.toAscii=e.fromAscii=void 0;var t=Gt;Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return t.fromAscii}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return t.toAscii}});var n=Ft;Object.defineProperty(e,"fromBase64",{enumerable:!0,get:function(){return n.fromBase64}}),Object.defineProperty(e,"toBase64",{enumerable:!0,get:function(){return n.toBase64}});var r=lt;Object.defineProperty(e,"fromBech32",{enumerable:!0,get:function(){return r.fromBech32}}),Object.defineProperty(e,"normalizeBech32",{enumerable:!0,get:function(){return r.normalizeBech32}}),Object.defineProperty(e,"toBech32",{enumerable:!0,get:function(){return r.toBech32}});var o=Wt;Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return o.fromHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return o.toHex}});var s=Jt;Object.defineProperty(e,"fromRfc3339",{enumerable:!0,get:function(){return s.fromRfc3339}}),Object.defineProperty(e,"toRfc3339",{enumerable:!0,get:function(){return s.toRfc3339}});var i=Lt;Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(e,"toUtf8",{enumerable:!0,get:function(){return i.toUtf8}})})(D);var pe={},X={},zt={};Object.defineProperty(zt,"__esModule",{value:!0});zt.arrayContentStartsWith=zt.arrayContentEquals=void 0;function uu(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}zt.arrayContentEquals=uu;function lu(e,t){if(e.length<t.length)return!1;for(let n=0;n<t.length;++n)if(e[n]!==t[n])return!1;return!0}zt.arrayContentStartsWith=lu;var dt={};Object.defineProperty(dt,"__esModule",{value:!0});dt.assertDefinedAndNotNull=dt.assertDefined=dt.assert=void 0;function du(e,t){if(!e)throw new Error(t||"condition is not truthy")}dt.assert=du;function mu(e,t){if(e===void 0)throw new Error(t??"value is undefined")}dt.assertDefined=mu;function fu(e,t){if(e==null)throw new Error(t??"value is undefined or null")}dt.assertDefinedAndNotNull=fu;var xr={};Object.defineProperty(xr,"__esModule",{value:!0});xr.sleep=void 0;async function hu(e){return new Promise(t=>setTimeout(t,e))}xr.sleep=hu;var mt={};Object.defineProperty(mt,"__esModule",{value:!0});mt.isDefined=mt.isUint8Array=mt.isNonNullObject=void 0;function Wi(e){return typeof e=="object"&&e!==null}mt.isNonNullObject=Wi;function pu(e){return!(!Wi(e)||Object.prototype.toString.call(e)!=="[object Uint8Array]"||typeof l.dist.Buffer<"u"&&typeof l.dist.Buffer.isBuffer<"u"&&l.dist.Buffer.isBuffer(e))}mt.isUint8Array=pu;function gu(e){return e!==void 0}mt.isDefined=gu;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isUint8Array=e.isNonNullObject=e.isDefined=e.sleep=e.assertDefinedAndNotNull=e.assertDefined=e.assert=e.arrayContentStartsWith=e.arrayContentEquals=void 0;var t=zt;Object.defineProperty(e,"arrayContentEquals",{enumerable:!0,get:function(){return t.arrayContentEquals}}),Object.defineProperty(e,"arrayContentStartsWith",{enumerable:!0,get:function(){return t.arrayContentStartsWith}});var n=dt;Object.defineProperty(e,"assert",{enumerable:!0,get:function(){return n.assert}}),Object.defineProperty(e,"assertDefined",{enumerable:!0,get:function(){return n.assertDefined}}),Object.defineProperty(e,"assertDefinedAndNotNull",{enumerable:!0,get:function(){return n.assertDefinedAndNotNull}});var r=xr;Object.defineProperty(e,"sleep",{enumerable:!0,get:function(){return r.sleep}});var o=mt;Object.defineProperty(e,"isDefined",{enumerable:!0,get:function(){return o.isDefined}}),Object.defineProperty(e,"isNonNullObject",{enumerable:!0,get:function(){return o.isNonNullObject}}),Object.defineProperty(e,"isUint8Array",{enumerable:!0,get:function(){return o.isUint8Array}})})(X);var yu=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),bu=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),vu=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&yu(t,e,n);return bu(t,e),t};Object.defineProperty(pe,"__esModule",{value:!0});pe.pbkdf2Sha512=pe.pbkdf2Sha512Noble=pe.pbkdf2Sha512NodeCrypto=pe.pbkdf2Sha512Subtle=pe.getSubtle=pe.getNodeCrypto=void 0;const Et=X,wu=p.require$$1,ku=p.require$$1$1;async function Ji(){try{const e=await Promise.resolve().then(()=>vu(l.requireCryptoBrowserify()));return typeof e=="object"&&Object.keys(e).length<=1?void 0:e}catch{return}}pe.getNodeCrypto=Ji;async function Li(){var t,n,r;let e=(t=globalThis==null?void 0:globalThis.crypto)==null?void 0:t.subtle;return e||(e=(r=(n=globalThis==null?void 0:globalThis.crypto)==null?void 0:n.webcrypto)==null?void 0:r.subtle),e}pe.getSubtle=Li;async function zi(e,t,n,r,o){return(0,Et.assert)(e,"Argument subtle is falsy"),(0,Et.assert)(typeof e=="object","Argument subtle is not of type object"),(0,Et.assert)(typeof e.importKey=="function","subtle.importKey is not a function"),(0,Et.assert)(typeof e.deriveBits=="function","subtle.deriveBits is not a function"),e.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then(s=>e.deriveBits({name:"PBKDF2",salt:n,iterations:r,hash:{name:"SHA-512"}},s,o*8).then(i=>new Uint8Array(i)))}pe.pbkdf2Sha512Subtle=zi;async function Ki(e,t,n,r,o){return(0,Et.assert)(e,"Argument nodeCrypto is falsy"),(0,Et.assert)(typeof e=="object","Argument nodeCrypto is not of type object"),(0,Et.assert)(typeof e.pbkdf2=="function","nodeCrypto.pbkdf2 is not a function"),new Promise((s,i)=>{e.pbkdf2(t,n,r,o,"sha512",(c,a)=>{c?i(c):s(Uint8Array.from(a))})})}pe.pbkdf2Sha512NodeCrypto=Ki;async function Qi(e,t,n,r){return(0,wu.pbkdf2Async)(ku.sha512,e,t,{c:n,dkLen:r})}pe.pbkdf2Sha512Noble=Qi;async function _u(e,t,n,r){const o=await Li();if(o)return zi(o,e,t,n,r);{const s=await Ji();return s?Ki(s,e,t,n,r):Qi(e,t,n,r)}}pe.pbkdf2Sha512=_u;var xe={},bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.toRealUint8Array=void 0;function Su(e){return e instanceof Uint8Array?e:Uint8Array.from(e)}bn.toRealUint8Array=Su;Object.defineProperty(xe,"__esModule",{value:!0});xe.sha512=xe.Sha512=xe.sha256=xe.Sha256=void 0;const Pu=p.require$$0,Au=p.require$$1$1,Zi=bn;class Xi{constructor(t){this.blockSize=512/8,this.impl=Pu.sha256.create(),t&&this.update(t)}update(t){return this.impl.update((0,Zi.toRealUint8Array)(t)),this}digest(){return this.impl.digest()}}xe.Sha256=Xi;function Tu(e){return new Xi(e).digest()}xe.sha256=Tu;class Yi{constructor(t){this.blockSize=1024/8,this.impl=Au.sha512.create(),t&&this.update(t)}update(t){return this.impl.update((0,Zi.toRealUint8Array)(t)),this}digest(){return this.impl.digest()}}xe.Sha512=Yi;function Eu(e){return new Yi(e).digest()}xe.sha512=Eu;Object.defineProperty(Le,"__esModule",{value:!0});Le.Bip39=Le.EnglishMnemonic=Le.mnemonicToEntropy=Le.entropyToMnemonic=void 0;const ii=D,Cu=pe,ju=xe,Es=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];function ea(e){return Array.from(e).map(t=>t.toString(2).padStart(8,"0")).join("")}function ta(e){const n=e.length*8/32,r=(0,ju.sha256)(e);return ea(r).slice(0,n)}function na(e){return parseInt(e,2)}const Mu=[16,20,24,28,32],Ou=[12,15,18,21,24];function ra(e){if(Mu.indexOf(e.length)===-1)throw new Error("invalid input length");const t=ea(e),n=ta(e);return(t+n).match(/(.{11})/g).map(i=>{const c=na(i);return Es[c]}).join(" ")}Le.entropyToMnemonic=ra;const Bu="Invalid number of words",Ru="Found word that is not in the wordlist",Iu="Invalid entropy",$u="Invalid mnemonic checksum";function ss(e){return e.normalize("NFKD")}function Cs(e){const t=ss(e).split(" ");if(!Ou.includes(t.length))throw new Error(Bu);const n=t.map(u=>{const d=Es.indexOf(u);if(d===-1)throw new Error(Ru);return d.toString(2).padStart(11,"0")}).join(""),r=Math.floor(n.length/33)*32,o=n.slice(0,r),s=n.slice(r),i=o.match(/(.{1,8})/g).map(na);if(i.length<16||i.length>32||i.length%4!==0)throw new Error(Iu);const c=Uint8Array.from(i);if(ta(c)!==s)throw new Error($u);return c}Le.mnemonicToEntropy=Cs;class Ct{constructor(t){if(!Ct.mnemonicMatcher.test(t))throw new Error("Invalid mnemonic format");const n=t.split(" "),r=[12,15,18,21,24];if(r.indexOf(n.length)===-1)throw new Error(`Invalid word count in mnemonic (allowed: ${r} got: ${n.length})`);for(const o of n)if(Ct.wordlist.indexOf(o)===-1)throw new Error("Mnemonic contains invalid word");Cs(t),this.data=t}toString(){return this.data}}Le.EnglishMnemonic=Ct;Ct.wordlist=Es;Ct.mnemonicMatcher=/^[a-z]+( [a-z]+)*$/;class Nu{static encode(t){return new Ct(ra(t))}static decode(t){return Cs(t.toString())}static async mnemonicToSeed(t,n){const r=(0,ii.toUtf8)(ss(t.toString())),o="mnemonic"+(n?ss(n):""),s=(0,ii.toUtf8)(o);return(0,Cu.pbkdf2Sha512)(r,s,2048,64)}}Le.Bip39=Nu;var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.Hmac=void 0;class Du{constructor(t,n){const r=new t().blockSize;this.hash=s=>new t().update(s).digest();let o=n;if(o.length>r&&(o=this.hash(o)),o.length<r){const s=new Uint8Array(r-o.length);o=new Uint8Array([...o,...s])}this.oKeyPad=o.map(s=>s^92),this.iKeyPad=o.map(s=>s^54),this.messageHasher=new t,this.blockSize=r,this.update(this.iKeyPad)}update(t){return this.messageHasher.update(t),this}digest(){const t=this.messageHasher.digest();return this.hash(new Uint8Array([...this.oKeyPad,...t]))}}Wn.Hmac=Du;var Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.keccak256=Kt.Keccak256=void 0;const xu=p.require$$0$1,Uu=bn;class oa{constructor(t){this.blockSize=512/8,this.impl=xu.keccak_256.create(),t&&this.update(t)}update(t){return this.impl.update((0,Uu.toRealUint8Array)(t)),this}digest(){return this.impl.digest()}}Kt.Keccak256=oa;function qu(e){return new oa(e).digest()}Kt.keccak256=qu;var ge={},Hu=l.commonjsGlobal&&l.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ge,"__esModule",{value:!0});ge.Xchacha20poly1305Ietf=ge.xchacha20NonceLength=ge.Ed25519=ge.Ed25519Keypair=ge.Argon2id=ge.isArgon2idOptions=void 0;const Vu=X,Pe=Hu(p.libsodiumWrappers);function Gu(e){return!(!(0,Vu.isNonNullObject)(e)||typeof e.outputLength!="number"||typeof e.opsLimit!="number"||typeof e.memLimitKib!="number")}ge.isArgon2idOptions=Gu;class Fu{static async execute(t,n,r){return await Pe.default.ready,Pe.default.crypto_pwhash(r.outputLength,t,n,r.opsLimit,r.memLimitKib*1024,Pe.default.crypto_pwhash_ALG_ARGON2ID13)}}ge.Argon2id=Fu;class Ur{static fromLibsodiumPrivkey(t){if(t.length!==64)throw new Error(`Unexpected key length ${t.length}. Must be 64.`);return new Ur(t.slice(0,32),t.slice(32,64))}constructor(t,n){this.privkey=t,this.pubkey=n}toLibsodiumPrivkey(){return new Uint8Array([...this.privkey,...this.pubkey])}}ge.Ed25519Keypair=Ur;class Wu{static async makeKeypair(t){await Pe.default.ready;const n=Pe.default.crypto_sign_seed_keypair(t);return Ur.fromLibsodiumPrivkey(n.privateKey)}static async createSignature(t,n){return await Pe.default.ready,Pe.default.crypto_sign_detached(t,n.toLibsodiumPrivkey())}static async verifySignature(t,n,r){return await Pe.default.ready,Pe.default.crypto_sign_verify_detached(t,n,r)}}ge.Ed25519=Wu;ge.xchacha20NonceLength=24;class Ju{static async encrypt(t,n,r){return await Pe.default.ready,Pe.default.crypto_aead_xchacha20poly1305_ietf_encrypt(t,null,null,r,n)}static async decrypt(t,n,r){return await Pe.default.ready,Pe.default.crypto_aead_xchacha20poly1305_ietf_decrypt(null,t,null,r,n)}}ge.Xchacha20poly1305Ietf=Ju;var qr={};Object.defineProperty(qr,"__esModule",{value:!0});qr.Random=void 0;class Lu{static getBytes(t){try{const n=typeof window=="object"?window:self,r=typeof n.crypto<"u"?n.crypto:n.msCrypto,o=new Uint8Array(t);return r.getRandomValues(o),o}catch{try{const n=l.requireCryptoBrowserify();return new Uint8Array([...n.randomBytes(t)])}catch{throw new Error("No secure random number generator found")}}}}qr.Random=Lu;var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.ripemd160=Qt.Ripemd160=void 0;const zu=p.require$$0$2,Ku=bn;class sa{constructor(t){this.blockSize=512/8,this.impl=zu.ripemd160.create(),t&&this.update(t)}update(t){return this.impl.update((0,Ku.toRealUint8Array)(t)),this}digest(){return this.impl.digest()}}Qt.Ripemd160=sa;function Qu(e){return new sa(e).digest()}Qt.ripemd160=Qu;var Hr={},jt={};Object.defineProperty(jt,"__esModule",{value:!0});jt.ExtendedSecp256k1Signature=jt.Secp256k1Signature=void 0;function Ut(e){let t=0;for(const n of e)if(n===0)t++;else break;return e.slice(t)}const or=2;class Un{static fromFixedLength(t){if(t.length!==64)throw new Error(`Got invalid data length: ${t.length}. Expected 2x 32 bytes for the pair (r, s)`);return new Un(Ut(t.slice(0,32)),Ut(t.slice(32,64)))}static fromDer(t){let n=0;if(t[n++]!==48)throw new Error("Prefix 0x30 expected");const r=t[n++];if(t.length-n!==r)throw new Error("Data length mismatch detected");if(t[n++]!==or)throw new Error("INTEGER tag expected");const s=t[n++];if(s>=128)throw new Error("Decoding length values above 127 not supported");const i=t.slice(n,n+s);if(n+=s,t[n++]!==or)throw new Error("INTEGER tag expected");const a=t[n++];if(a>=128)throw new Error("Decoding length values above 127 not supported");const u=t.slice(n,n+a);return n+=a,new Un(Ut(i),Ut(u))}constructor(t,n){if(t.length>32||t.length===0||t[0]===0)throw new Error("Unsigned integer r must be encoded as unpadded big endian.");if(n.length>32||n.length===0||n[0]===0)throw new Error("Unsigned integer s must be encoded as unpadded big endian.");this.data={r:t,s:n}}r(t){if(t===void 0)return this.data.r;{const n=t-this.data.r.length;if(n<0)throw new Error("Length too small to hold parameter r");const r=new Uint8Array(n);return new Uint8Array([...r,...this.data.r])}}s(t){if(t===void 0)return this.data.s;{const n=t-this.data.s.length;if(n<0)throw new Error("Length too small to hold parameter s");const r=new Uint8Array(n);return new Uint8Array([...r,...this.data.s])}}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32)])}toDer(){const t=this.data.r[0]>=128?new Uint8Array([0,...this.data.r]):this.data.r,n=this.data.s[0]>=128?new Uint8Array([0,...this.data.s]):this.data.s,r=t.length,o=n.length,s=new Uint8Array([or,r,...t,or,o,...n]);return new Uint8Array([48,s.length,...s])}}jt.Secp256k1Signature=Un;class js extends Un{static fromFixedLength(t){if(t.length!==65)throw new Error(`Got invalid data length ${t.length}. Expected 32 + 32 + 1`);return new js(Ut(t.slice(0,32)),Ut(t.slice(32,64)),t[64])}constructor(t,n,r){if(super(t,n),!Number.isInteger(r))throw new Error("The recovery parameter must be an integer.");if(r<0||r>4)throw new Error("The recovery parameter must be one of 0, 1, 2, 3.");this.recovery=r}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32),this.recovery])}}jt.ExtendedSecp256k1Signature=js;var ia=l.commonjsGlobal&&l.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.Secp256k1=void 0;const sr=D,aa=ia(l.bnExports),Zu=ia(l.requireElliptic()),Xu=jt,wt=new Zu.default.ec("secp256k1"),Yu=new aa.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex");class el{static async makeKeypair(t){if(t.length!==32)throw new Error("input data is not a valid secp256k1 private key");const n=wt.keyFromPrivate(t);if(n.validate().result!==!0)throw new Error("input data is not a valid secp256k1 private key");if(new aa.default(t).gte(Yu))throw new Error("input data is not a valid secp256k1 private key");return{privkey:(0,sr.fromHex)(n.getPrivate("hex")),pubkey:Uint8Array.from(n.getPublic("array"))}}static async createSignature(t,n){if(t.length===0)throw new Error("Message hash must not be empty");if(t.length>32)throw new Error("Message hash length must not exceed 32 bytes");const r=wt.keyFromPrivate(n),{r:o,s,recoveryParam:i}=r.sign(t,{canonical:!0});if(typeof i!="number")throw new Error("Recovery param missing");return new Xu.ExtendedSecp256k1Signature(Uint8Array.from(o.toArray()),Uint8Array.from(s.toArray()),i)}static async verifySignature(t,n,r){if(n.length===0)throw new Error("Message hash must not be empty");if(n.length>32)throw new Error("Message hash length must not exceed 32 bytes");const o=wt.keyFromPublic(r);try{return o.verify(n,t.toDer())}catch{return!1}}static recoverPubkey(t,n){const r={r:(0,sr.toHex)(t.r()),s:(0,sr.toHex)(t.s())},o=wt.recoverPubKey(n,r,t.recovery),s=wt.keyFromPublic(o);return(0,sr.fromHex)(s.getPublic(!1,"hex"))}static compressPubkey(t){switch(t.length){case 33:return t;case 65:return Uint8Array.from(wt.keyFromPublic(t).getPublic(!0,"array"));default:throw new Error("Invalid pubkey length")}}static uncompressPubkey(t){switch(t.length){case 33:return Uint8Array.from(wt.keyFromPublic(t).getPublic(!1,"array"));case 65:return t;default:throw new Error("Invalid pubkey length")}}static trimRecoveryByte(t){switch(t.length){case 64:return t;case 65:return t.slice(0,64);default:throw new Error("Invalid signature length")}}}Hr.Secp256k1=el;var ca={};(function(e){var t=l.commonjsGlobal&&l.commonjsGlobal.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.stringToPath=e.pathToString=e.Slip10=e.Slip10RawIndex=e.slip10CurveFromString=e.Slip10Curve=void 0;const n=D,r=te,o=t(l.bnExports),s=t(l.requireElliptic()),i=Wn,c=xe;var a;(function(b){b.Secp256k1="Bitcoin seed",b.Ed25519="ed25519 seed"})(a=e.Slip10Curve||(e.Slip10Curve={}));function u(b){switch(b){case a.Ed25519:return a.Ed25519;case a.Secp256k1:return a.Secp256k1;default:throw new Error(`Unknown curve string: '${b}'`)}}e.slip10CurveFromString=u;class d extends r.Uint32{static hardened(g){return new d(g+2**31)}static normal(g){return new d(g)}isHardened(){return this.data>=2**31}}e.Slip10RawIndex=d;const y=new s.default.ec("secp256k1");class M{static derivePath(g,w,q){let x=this.master(g,w);for(const ue of q)x=this.child(g,x.privkey,x.chainCode,ue);return x}static master(g,w){const q=new i.Hmac(c.Sha512,(0,n.toAscii)(g)).update(w).digest(),x=q.slice(0,32),ue=q.slice(32,64);return g!==a.Ed25519&&(this.isZero(x)||this.isGteN(g,x))?this.master(g,q):{chainCode:ue,privkey:x}}static child(g,w,q,x){let ue;if(x.isHardened()){const v=new Uint8Array([0,...w,...x.toBytesBigEndian()]);ue=new i.Hmac(c.Sha512,q).update(v).digest()}else{if(g===a.Ed25519)throw new Error("Normal keys are not allowed with ed25519");{const v=new Uint8Array([...M.serializedPoint(g,new o.default(w)),...x.toBytesBigEndian()]);ue=new i.Hmac(c.Sha512,q).update(v).digest()}}return this.childImpl(g,w,q,x,ue)}static serializedPoint(g,w){switch(g){case a.Secp256k1:return(0,n.fromHex)(y.g.mul(w).encodeCompressed("hex"));default:throw new Error("curve not supported")}}static childImpl(g,w,q,x,ue){const v=ue.slice(0,32),S=ue.slice(32,64),k=S;if(g===a.Ed25519)return{chainCode:k,privkey:v};const U=this.n(g),H=new o.default(v).add(new o.default(w)).mod(U),V=Uint8Array.from(H.toArray("be",32));if(this.isGteN(g,v)||this.isZero(V)){const F=new i.Hmac(c.Sha512,q).update(new Uint8Array([1,...S,...x.toBytesBigEndian()])).digest();return this.childImpl(g,w,q,x,F)}return{chainCode:k,privkey:V}}static isZero(g){return g.every(w=>w===0)}static isGteN(g,w){return new o.default(w).gte(this.n(g))}static n(g){switch(g){case a.Secp256k1:return new o.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",16);default:throw new Error("curve not supported")}}}e.Slip10=M;function _(b){return b.reduce((g,w)=>{const q=w.isHardened()?`${w.toNumber()-2147483648}'`:w.toString();return g+"/"+q},"m")}e.pathToString=_;function G(b){if(!b.startsWith("m"))throw new Error("Path string must start with 'm'");let g=b.slice(1);const w=new Array;for(;g;){const q=g.match(/^\/([0-9]+)('?)/);if(!q)throw new Error("Syntax error while reading path component");const[x,ue,v]=q,S=r.Uint53.fromString(ue).toNumber();if(S>=2**31)throw new Error("Component value too high. Must not exceed 2**31-1.");v?w.push(d.hardened(S)):w.push(d.normal(S)),g=g.slice(x.length)}return w}e.stringToPath=G})(ca);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.stringToPath=e.Slip10RawIndex=e.slip10CurveFromString=e.Slip10Curve=e.Slip10=e.pathToString=e.sha512=e.Sha512=e.sha256=e.Sha256=e.Secp256k1Signature=e.ExtendedSecp256k1Signature=e.Secp256k1=e.ripemd160=e.Ripemd160=e.Random=e.Xchacha20poly1305Ietf=e.xchacha20NonceLength=e.isArgon2idOptions=e.Ed25519Keypair=e.Ed25519=e.Argon2id=e.keccak256=e.Keccak256=e.Hmac=e.EnglishMnemonic=e.Bip39=void 0;var t=Le;Object.defineProperty(e,"Bip39",{enumerable:!0,get:function(){return t.Bip39}}),Object.defineProperty(e,"EnglishMnemonic",{enumerable:!0,get:function(){return t.EnglishMnemonic}});var n=Wn;Object.defineProperty(e,"Hmac",{enumerable:!0,get:function(){return n.Hmac}});var r=Kt;Object.defineProperty(e,"Keccak256",{enumerable:!0,get:function(){return r.Keccak256}}),Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return r.keccak256}});var o=ge;Object.defineProperty(e,"Argon2id",{enumerable:!0,get:function(){return o.Argon2id}}),Object.defineProperty(e,"Ed25519",{enumerable:!0,get:function(){return o.Ed25519}}),Object.defineProperty(e,"Ed25519Keypair",{enumerable:!0,get:function(){return o.Ed25519Keypair}}),Object.defineProperty(e,"isArgon2idOptions",{enumerable:!0,get:function(){return o.isArgon2idOptions}}),Object.defineProperty(e,"xchacha20NonceLength",{enumerable:!0,get:function(){return o.xchacha20NonceLength}}),Object.defineProperty(e,"Xchacha20poly1305Ietf",{enumerable:!0,get:function(){return o.Xchacha20poly1305Ietf}});var s=qr;Object.defineProperty(e,"Random",{enumerable:!0,get:function(){return s.Random}});var i=Qt;Object.defineProperty(e,"Ripemd160",{enumerable:!0,get:function(){return i.Ripemd160}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return i.ripemd160}});var c=Hr;Object.defineProperty(e,"Secp256k1",{enumerable:!0,get:function(){return c.Secp256k1}});var a=jt;Object.defineProperty(e,"ExtendedSecp256k1Signature",{enumerable:!0,get:function(){return a.ExtendedSecp256k1Signature}}),Object.defineProperty(e,"Secp256k1Signature",{enumerable:!0,get:function(){return a.Secp256k1Signature}});var u=xe;Object.defineProperty(e,"Sha256",{enumerable:!0,get:function(){return u.Sha256}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return u.sha256}}),Object.defineProperty(e,"Sha512",{enumerable:!0,get:function(){return u.Sha512}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return u.sha512}});var d=ca;Object.defineProperty(e,"pathToString",{enumerable:!0,get:function(){return d.pathToString}}),Object.defineProperty(e,"Slip10",{enumerable:!0,get:function(){return d.Slip10}}),Object.defineProperty(e,"Slip10Curve",{enumerable:!0,get:function(){return d.Slip10Curve}}),Object.defineProperty(e,"slip10CurveFromString",{enumerable:!0,get:function(){return d.slip10CurveFromString}}),Object.defineProperty(e,"Slip10RawIndex",{enumerable:!0,get:function(){return d.Slip10RawIndex}}),Object.defineProperty(e,"stringToPath",{enumerable:!0,get:function(){return d.stringToPath}})})(_e);var ie={},Jn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isMultisigThresholdPubkey=e.isSinglePubkey=e.pubkeyType=e.isSecp256k1Pubkey=e.isEd25519Pubkey=void 0;function t(s){return s.type==="tendermint/PubKeyEd25519"}e.isEd25519Pubkey=t;function n(s){return s.type==="tendermint/PubKeySecp256k1"}e.isSecp256k1Pubkey=n,e.pubkeyType={secp256k1:"tendermint/PubKeySecp256k1",ed25519:"tendermint/PubKeyEd25519",sr25519:"tendermint/PubKeySr25519",multisigThreshold:"tendermint/PubKeyMultisigThreshold"};function r(s){return[e.pubkeyType.ed25519,e.pubkeyType.secp256k1,e.pubkeyType.sr25519].includes(s.type)}e.isSinglePubkey=r;function o(s){return s.type==="tendermint/PubKeyMultisigThreshold"}e.isMultisigThresholdPubkey=o})(Jn);Object.defineProperty(ie,"__esModule",{value:!0});ie.encodeBech32Pubkey=ie.encodeAminoPubkey=ie.decodeBech32Pubkey=ie.decodeAminoPubkey=ie.encodeEd25519Pubkey=ie.encodeSecp256k1Pubkey=void 0;const be=D,tl=te,Rn=X,nt=Jn;function nl(e){if(e.length!==33||e[0]!==2&&e[0]!==3)throw new Error("Public key must be compressed secp256k1, i.e. 33 bytes starting with 0x02 or 0x03");return{type:nt.pubkeyType.secp256k1,value:(0,be.toBase64)(e)}}ie.encodeSecp256k1Pubkey=nl;function rl(e){if(e.length!==32)throw new Error("Ed25519 public key must be 32 bytes long");return{type:nt.pubkeyType.ed25519,value:(0,be.toBase64)(e)}}ie.encodeEd25519Pubkey=rl;const is=(0,be.fromHex)("eb5ae98721"),as=(0,be.fromHex)("1624de6420"),ai=(0,be.fromHex)("0dfb100520"),Tr=(0,be.fromHex)("22c1f7e2");function Ms(e){if((0,Rn.arrayContentStartsWith)(e,is)){const t=e.slice(is.length);if(t.length!==33)throw new Error("Invalid rest data length. Expected 33 bytes (compressed secp256k1 pubkey).");return{type:nt.pubkeyType.secp256k1,value:(0,be.toBase64)(t)}}else if((0,Rn.arrayContentStartsWith)(e,as)){const t=e.slice(as.length);if(t.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Ed25519 pubkey).");return{type:nt.pubkeyType.ed25519,value:(0,be.toBase64)(t)}}else if((0,Rn.arrayContentStartsWith)(e,ai)){const t=e.slice(ai.length);if(t.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Sr25519 pubkey).");return{type:nt.pubkeyType.sr25519,value:(0,be.toBase64)(t)}}else{if((0,Rn.arrayContentStartsWith)(e,Tr))return sl(e);throw new Error("Unsupported public key type. Amino data starts with: "+(0,be.toHex)(e.slice(0,5)))}}ie.decodeAminoPubkey=Ms;function ol(e){const{data:t}=(0,be.fromBech32)(e);return Ms(t)}ie.decodeBech32Pubkey=ol;function ci(e){if(e.length<1)throw new Error("Can't decode varint. EOF");if(e[0]>127)throw new Error("Decoding numbers > 127 is not supported here. Please tell those lazy CosmJS maintainers to port the binary.Varint implementation from the Go standard library and write some tests.");return[e[0],1]}function sl(e){const t=Array.from(e),n=t.splice(0,Tr.length);if(!(0,Rn.arrayContentStartsWith)(n,Tr))throw new Error("Invalid multisig prefix.");if(t.shift()!=8)throw new Error("Invalid multisig data. Expecting 0x08 prefix before threshold.");const[r,o]=ci(t);t.splice(0,o);const s=[];for(;t.length>0;){if(t.shift()!=18)throw new Error("Invalid multisig data. Expecting 0x12 prefix before participant pubkey length.");const[i,c]=ci(t);if(t.splice(0,c),t.length<i)throw new Error("Invalid multisig data length.");const a=t.splice(0,i),u=Ms(Uint8Array.from(a));s.push(u)}return{type:nt.pubkeyType.multisigThreshold,value:{threshold:r.toString(),pubkeys:s}}}function ui(e){const t=tl.Uint53.fromString(e.toString()).toNumber();if(t>127)throw new Error("Encoding numbers > 127 is not supported here. Please tell those lazy CosmJS maintainers to port the binary.PutUvarint implementation from the Go standard library and write some tests.");return[t]}function Os(e){if((0,nt.isMultisigThresholdPubkey)(e)){const t=Array.from(Tr);t.push(8),t.push(...ui(e.value.threshold));for(const n of e.value.pubkeys.map(r=>Os(r)))t.push(18),t.push(...ui(n.length)),t.push(...n);return new Uint8Array(t)}else{if((0,nt.isEd25519Pubkey)(e))return new Uint8Array([...as,...(0,be.fromBase64)(e.value)]);if((0,nt.isSecp256k1Pubkey)(e))return new Uint8Array([...is,...(0,be.fromBase64)(e.value)]);throw new Error("Unsupported pubkey type")}}ie.encodeAminoPubkey=Os;function il(e,t){return(0,be.toBech32)(t,Os(e))}ie.encodeBech32Pubkey=il;Object.defineProperty(Ae,"__esModule",{value:!0});Ae.pubkeyToAddress=Ae.pubkeyToRawAddress=Ae.rawSecp256k1PubkeyToRawAddress=Ae.rawEd25519PubkeyToRawAddress=void 0;const Er=_e,cs=D,al=ie,Jo=Jn;function ua(e){if(e.length!==32)throw new Error(`Invalid Ed25519 pubkey length: ${e.length}`);return(0,Er.sha256)(e).slice(0,20)}Ae.rawEd25519PubkeyToRawAddress=ua;function la(e){if(e.length!==33)throw new Error(`Invalid Secp256k1 pubkey length (compressed): ${e.length}`);return(0,Er.ripemd160)((0,Er.sha256)(e))}Ae.rawSecp256k1PubkeyToRawAddress=la;function da(e){if((0,Jo.isSecp256k1Pubkey)(e)){const t=(0,cs.fromBase64)(e.value);return la(t)}else if((0,Jo.isEd25519Pubkey)(e)){const t=(0,cs.fromBase64)(e.value);return ua(t)}else if((0,Jo.isMultisigThresholdPubkey)(e)){const t=(0,al.encodeAminoPubkey)(e);return(0,Er.sha256)(t).slice(0,20)}else throw new Error("Unsupported public key type")}Ae.pubkeyToRawAddress=da;function cl(e,t){return(0,cs.toBech32)(t,da(e))}Ae.pubkeyToAddress=cl;var ze={};Object.defineProperty(ze,"__esModule",{value:!0});ze.addCoins=ze.parseCoins=ze.coins=ze.coin=void 0;const us=te;function ma(e,t){let n;if(typeof e=="number")try{n=new us.Uint53(e).toString()}catch{throw new Error("Given amount is not a safe integer. Consider using a string instead to overcome the limitations of JS numbers.")}else{if(!e.match(/^[0-9]+$/))throw new Error("Invalid unsigned integer string format");n=e.replace(/^0*/,"")||"0"}return{amount:n,denom:t}}ze.coin=ma;function ul(e,t){return[ma(e,t)]}ze.coins=ul;function ll(e){return e.replace(/\s/g,"").split(",").filter(Boolean).map(t=>{const n=t.match(/^([0-9]+)([a-zA-Z][a-zA-Z0-9/]{2,127})$/);if(!n)throw new Error("Got an invalid coin string");return{amount:n[1].replace(/^0+/,"")||"0",denom:n[2]}})}ze.parseCoins=ll;function dl(e,t){if(e.denom!==t.denom)throw new Error("Trying to add two coins with different denoms");return{amount:us.Decimal.fromAtomics(e.amount,0).plus(us.Decimal.fromAtomics(t.amount,0)).atomics,denom:e.denom}}ze.addCoins=dl;var Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.createMultisigThresholdPubkey=Zt.compareArrays=void 0;const li=D,ml=te,di=Ae;function fa(e,t){const n=(0,li.toHex)(e),r=(0,li.toHex)(t);return n===r?0:n<r?-1:1}Zt.compareArrays=fa;function fl(e,t,n=!1){const r=new ml.Uint53(t);if(r.toNumber()>e.length)throw new Error(`Threshold k = ${r.toNumber()} exceeds number of keys n = ${e.length}`);const o=n?e:Array.from(e).sort((s,i)=>{const c=(0,di.pubkeyToRawAddress)(s),a=(0,di.pubkeyToRawAddress)(i);return fa(c,a)});return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:r.toString(),pubkeys:o}}}Zt.createMultisigThresholdPubkey=fl;var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.omitDefault=void 0;function hl(e){switch(typeof e){case"string":return e===""?void 0:e;case"number":return e===0?void 0:e;case"bigint":return e===BigInt(0)?void 0:e;case"boolean":return e||void 0;default:throw new Error(`Got unsupported type '${typeof e}'`)}}Vr.omitDefault=hl;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.makeCosmoshubPath=void 0;const kn=_e;function pl(e){return[kn.Slip10RawIndex.hardened(44),kn.Slip10RawIndex.hardened(118),kn.Slip10RawIndex.hardened(0),kn.Slip10RawIndex.normal(0),kn.Slip10RawIndex.normal(e)]}Ln.makeCosmoshubPath=pl;var Xt={},bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.decodeSignature=bt.encodeSecp256k1Signature=void 0;const ls=D,gl=ie,yl=Jn;function bl(e,t){if(t.length!==64)throw new Error("Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s.");return{pub_key:(0,gl.encodeSecp256k1Pubkey)(e),signature:(0,ls.toBase64)(t)}}bt.encodeSecp256k1Signature=bl;function vl(e){switch(e.pub_key.type){case yl.pubkeyType.secp256k1:return{pubkey:(0,ls.fromBase64)(e.pub_key.value),signature:(0,ls.fromBase64)(e.signature)};default:throw new Error("Unsupported pubkey type")}}bt.decodeSignature=vl;var Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.serializeSignDoc=Ue.escapeCharacters=Ue.makeSignDoc=Ue.sortedJsonStringify=void 0;const wl=D,mi=te;function ds(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(ds);const t=Object.keys(e).sort(),n={};return t.forEach(r=>{n[r]=ds(e[r])}),n}function ha(e){return JSON.stringify(ds(e))}Ue.sortedJsonStringify=ha;function kl(e,t,n,r,o,s,i){return{chain_id:n,account_number:mi.Uint53.fromString(o.toString()).toString(),sequence:mi.Uint53.fromString(s.toString()).toString(),fee:t,msgs:e,memo:r||"",...i&&{timeout_height:i.toString()}}}Ue.makeSignDoc=kl;function pa(e){const t=/&/g,n=/</g,r=/>/g;return e.replace(t,"\\u0026").replace(n,"\\u003c").replace(r,"\\u003e")}Ue.escapeCharacters=pa;function _l(e){const t=pa(ha(e));return(0,wl.toUtf8)(t)}Ue.serializeSignDoc=_l;var Bs={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const t=_e,n=D;e.cosmjsSalt=(0,n.toAscii)("The CosmJS salt.");async function r(i,c){switch(c.algorithm){case"argon2id":{const a=c.params;if(!(0,t.isArgon2idOptions)(a))throw new Error("Invalid format of argon2id params");return t.Argon2id.execute(i,e.cosmjsSalt,a)}default:throw new Error("Unsupported KDF algorithm")}}e.executeKdf=r,e.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"};async function o(i,c,a){switch(a.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const u=t.Random.getBytes(t.xchacha20NonceLength);return new Uint8Array([...u,...await t.Xchacha20poly1305Ietf.encrypt(i,c,u)])}default:throw new Error(`Unsupported encryption algorithm: '${a.algorithm}'`)}}e.encrypt=o;async function s(i,c,a){switch(a.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const u=i.slice(0,t.xchacha20NonceLength);return t.Xchacha20poly1305Ietf.decrypt(i.slice(t.xchacha20NonceLength),c,u)}default:throw new Error(`Unsupported encryption algorithm: '${a.algorithm}'`)}}e.decrypt=s})(Bs);Object.defineProperty(Xt,"__esModule",{value:!0});Xt.Secp256k1HdWallet=Xt.extractKdfConfiguration=void 0;const Ee=_e,_n=D,qt=X,Sl=Ae,Pl=Ln,Al=bt,Tl=Ue,Sn=Bs,Sr="secp256k1wallet-v1",El={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function Cl(e){return!(!(0,qt.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function jl(e){return e.kdf}function Ml(e){const t=JSON.parse(e);if(!(0,qt.isNonNullObject)(t))throw new Error("Root document is not an object.");switch(t.type){case Sr:return jl(t);default:throw new Error("Unsupported serialization type")}}Xt.extractKdfConfiguration=Ml;const fi={bip39Password:"",hdPaths:[(0,Pl.makeCosmoshubPath)(0)],prefix:"cosmos"};class Pt{static async fromMnemonic(t,n={}){const r=new Ee.EnglishMnemonic(t),o=await Ee.Bip39.mnemonicToSeed(r,n.bip39Password);return new Pt(r,{...n,seed:o})}static async generate(t=12,n={}){const r=4*Math.floor(11*t/33),o=Ee.Random.getBytes(r),s=Ee.Bip39.encode(o);return Pt.fromMnemonic(s.toString(),n)}static async deserialize(t,n){const r=JSON.parse(t);if(!(0,qt.isNonNullObject)(r))throw new Error("Root document is not an object.");switch(r.type){case Sr:return Pt.deserializeTypeV1(t,n);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(t,n){const r=JSON.parse(t);if(!(0,qt.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=r;switch(o.type){case Sr:{const s=await(0,Sn.decrypt)((0,_n.fromBase64)(o.data),n,o.encryption),i=JSON.parse((0,_n.fromUtf8)(s)),{mnemonic:c,accounts:a}=i;if((0,qt.assert)(typeof c=="string"),!Array.isArray(a))throw new Error("Property 'accounts' is not an array");if(!a.every(y=>Cl(y)))throw new Error("Account is not in the correct format.");const u=a[0].prefix;if(!a.every(({prefix:y})=>y===u))throw new Error("Accounts do not all have the same prefix");const d=a.map(({hdPath:y})=>(0,Ee.stringToPath)(y));return Pt.fromMnemonic(c,{hdPaths:d,prefix:u})}default:throw new Error("Unsupported serialization type")}}static async deserializeTypeV1(t,n){const r=JSON.parse(t);if(!(0,qt.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=await(0,Sn.executeKdf)(n,r.kdf);return Pt.deserializeWithEncryptionKey(t,o)}constructor(t,n){const r=n.hdPaths??fi.hdPaths,o=n.prefix??fi.prefix;this.secret=t,this.seed=n.seed,this.accounts=r.map(s=>({hdPath:s,prefix:o}))}get mnemonic(){return this.secret.toString()}async getAccounts(){return(await this.getAccountsWithPrivkeys()).map(({algo:n,pubkey:r,address:o})=>({algo:n,pubkey:r,address:o}))}async signAmino(t,n){const o=(await this.getAccountsWithPrivkeys()).find(({address:d})=>d===t);if(o===void 0)throw new Error(`Address ${t} not found in wallet`);const{privkey:s,pubkey:i}=o,c=(0,Ee.sha256)((0,Tl.serializeSignDoc)(n)),a=await Ee.Secp256k1.createSignature(c,s),u=new Uint8Array([...a.r(32),...a.s(32)]);return{signed:n,signature:(0,Al.encodeSecp256k1Signature)(i,u)}}async serialize(t){const n=El,r=await(0,Sn.executeKdf)(t,n);return this.serializeWithEncryptionKey(r,n)}async serializeWithEncryptionKey(t,n){const r={mnemonic:this.mnemonic,accounts:this.accounts.map(({hdPath:a,prefix:u})=>({hdPath:(0,Ee.pathToString)(a),prefix:u}))},o=(0,_n.toUtf8)(JSON.stringify(r)),s={algorithm:Sn.supportedAlgorithms.xchacha20poly1305Ietf},i=await(0,Sn.encrypt)(o,t,s),c={type:Sr,kdf:n,encryption:s,data:(0,_n.toBase64)(i)};return JSON.stringify(c)}async getKeyPair(t){const{privkey:n}=Ee.Slip10.derivePath(Ee.Slip10Curve.Secp256k1,this.seed,t),{pubkey:r}=await Ee.Secp256k1.makeKeypair(n);return{privkey:n,pubkey:Ee.Secp256k1.compressPubkey(r)}}async getAccountsWithPrivkeys(){return Promise.all(this.accounts.map(async({hdPath:t,prefix:n})=>{const{privkey:r,pubkey:o}=await this.getKeyPair(t),s=(0,_n.toBech32)(n,(0,Sl.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:r,pubkey:o,address:s}}))}}Xt.Secp256k1HdWallet=Pt;var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.Secp256k1Wallet=void 0;const ir=_e,Ol=D,Bl=Ae,Rl=bt,Il=Ue;class Rs{static async fromKey(t,n="cosmos"){const r=(await ir.Secp256k1.makeKeypair(t)).pubkey;return new Rs(t,ir.Secp256k1.compressPubkey(r),n)}constructor(t,n,r){this.privkey=t,this.pubkey=n,this.prefix=r}get address(){return(0,Ol.toBech32)(this.prefix,(0,Bl.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signAmino(t,n){if(t!==this.address)throw new Error(`Address ${t} not found in wallet`);const r=new ir.Sha256((0,Il.serializeSignDoc)(n)).digest(),o=await ir.Secp256k1.createSignature(r,this.privkey),s=new Uint8Array([...o.r(32),...o.s(32)]);return{signed:n,signature:(0,Rl.encodeSecp256k1Signature)(this.pubkey,s)}}}Gr.Secp256k1Wallet=Rs;var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.makeStdTx=Yt.isStdTx=void 0;function $l(e){const{memo:t,msg:n,fee:r,signatures:o}=e;return typeof t=="string"&&Array.isArray(n)&&typeof r=="object"&&Array.isArray(o)}Yt.isStdTx=$l;function Nl(e,t){return{msg:e.msgs,fee:e.fee,memo:e.memo,signatures:Array.isArray(t)?t:[t]}}Yt.makeStdTx=Nl;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.executeKdf=e.makeStdTx=e.isStdTx=e.serializeSignDoc=e.makeSignDoc=e.encodeSecp256k1Signature=e.decodeSignature=e.Secp256k1Wallet=e.Secp256k1HdWallet=e.extractKdfConfiguration=e.pubkeyType=e.isSinglePubkey=e.isSecp256k1Pubkey=e.isMultisigThresholdPubkey=e.isEd25519Pubkey=e.makeCosmoshubPath=e.omitDefault=e.createMultisigThresholdPubkey=e.encodeSecp256k1Pubkey=e.encodeEd25519Pubkey=e.encodeBech32Pubkey=e.encodeAminoPubkey=e.decodeBech32Pubkey=e.decodeAminoPubkey=e.parseCoins=e.coins=e.coin=e.addCoins=e.rawSecp256k1PubkeyToRawAddress=e.rawEd25519PubkeyToRawAddress=e.pubkeyToRawAddress=e.pubkeyToAddress=void 0;var t=Ae;Object.defineProperty(e,"pubkeyToAddress",{enumerable:!0,get:function(){return t.pubkeyToAddress}}),Object.defineProperty(e,"pubkeyToRawAddress",{enumerable:!0,get:function(){return t.pubkeyToRawAddress}}),Object.defineProperty(e,"rawEd25519PubkeyToRawAddress",{enumerable:!0,get:function(){return t.rawEd25519PubkeyToRawAddress}}),Object.defineProperty(e,"rawSecp256k1PubkeyToRawAddress",{enumerable:!0,get:function(){return t.rawSecp256k1PubkeyToRawAddress}});var n=ze;Object.defineProperty(e,"addCoins",{enumerable:!0,get:function(){return n.addCoins}}),Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return n.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return n.coins}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return n.parseCoins}});var r=ie;Object.defineProperty(e,"decodeAminoPubkey",{enumerable:!0,get:function(){return r.decodeAminoPubkey}}),Object.defineProperty(e,"decodeBech32Pubkey",{enumerable:!0,get:function(){return r.decodeBech32Pubkey}}),Object.defineProperty(e,"encodeAminoPubkey",{enumerable:!0,get:function(){return r.encodeAminoPubkey}}),Object.defineProperty(e,"encodeBech32Pubkey",{enumerable:!0,get:function(){return r.encodeBech32Pubkey}}),Object.defineProperty(e,"encodeEd25519Pubkey",{enumerable:!0,get:function(){return r.encodeEd25519Pubkey}}),Object.defineProperty(e,"encodeSecp256k1Pubkey",{enumerable:!0,get:function(){return r.encodeSecp256k1Pubkey}});var o=Zt;Object.defineProperty(e,"createMultisigThresholdPubkey",{enumerable:!0,get:function(){return o.createMultisigThresholdPubkey}});var s=Vr;Object.defineProperty(e,"omitDefault",{enumerable:!0,get:function(){return s.omitDefault}});var i=Ln;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return i.makeCosmoshubPath}});var c=Jn;Object.defineProperty(e,"isEd25519Pubkey",{enumerable:!0,get:function(){return c.isEd25519Pubkey}}),Object.defineProperty(e,"isMultisigThresholdPubkey",{enumerable:!0,get:function(){return c.isMultisigThresholdPubkey}}),Object.defineProperty(e,"isSecp256k1Pubkey",{enumerable:!0,get:function(){return c.isSecp256k1Pubkey}}),Object.defineProperty(e,"isSinglePubkey",{enumerable:!0,get:function(){return c.isSinglePubkey}}),Object.defineProperty(e,"pubkeyType",{enumerable:!0,get:function(){return c.pubkeyType}});var a=Xt;Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return a.extractKdfConfiguration}}),Object.defineProperty(e,"Secp256k1HdWallet",{enumerable:!0,get:function(){return a.Secp256k1HdWallet}});var u=Gr;Object.defineProperty(e,"Secp256k1Wallet",{enumerable:!0,get:function(){return u.Secp256k1Wallet}});var d=bt;Object.defineProperty(e,"decodeSignature",{enumerable:!0,get:function(){return d.decodeSignature}}),Object.defineProperty(e,"encodeSecp256k1Signature",{enumerable:!0,get:function(){return d.encodeSecp256k1Signature}});var y=Ue;Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return y.makeSignDoc}}),Object.defineProperty(e,"serializeSignDoc",{enumerable:!0,get:function(){return y.serializeSignDoc}});var M=Yt;Object.defineProperty(e,"isStdTx",{enumerable:!0,get:function(){return M.isStdTx}}),Object.defineProperty(e,"makeStdTx",{enumerable:!0,get:function(){return M.makeStdTx}});var _=Bs;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return _.executeKdf}})})(st);var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.makeSignBytes=Ye.makeSignDoc=Ye.makeAuthInfoBytes=void 0;const hi=X,Dl=p.signing,Cr=p.tx;function xl(e,t){return e.map(({pubkey:n,sequence:r})=>({publicKey:n,modeInfo:{single:{mode:t}},sequence:BigInt(r)}))}function Ul(e,t,n,r,o,s=Dl.SignMode.SIGN_MODE_DIRECT){(0,hi.assert)(r===void 0||typeof r=="string","feeGranter must be undefined or string"),(0,hi.assert)(o===void 0||typeof o=="string","feePayer must be undefined or string");const i=Cr.AuthInfo.fromPartial({signerInfos:xl(e,s),fee:{amount:[...t],gasLimit:BigInt(n),granter:r,payer:o}});return Cr.AuthInfo.encode(i).finish()}Ye.makeAuthInfoBytes=Ul;function ql(e,t,n,r){return{bodyBytes:e,authInfoBytes:t,chainId:n,accountNumber:BigInt(r)}}Ye.makeSignDoc=ql;function Hl({accountNumber:e,authInfoBytes:t,bodyBytes:n,chainId:r}){const o=Cr.SignDoc.fromPartial({accountNumber:e,authInfoBytes:t,bodyBytes:n,chainId:r});return Cr.SignDoc.encode(o).finish()}Ye.makeSignBytes=Hl;var Is={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const t=_e,n=D;e.cosmjsSalt=(0,n.toAscii)("The CosmJS salt.");async function r(i,c){switch(c.algorithm){case"argon2id":{const a=c.params;if(!(0,t.isArgon2idOptions)(a))throw new Error("Invalid format of argon2id params");return t.Argon2id.execute(i,e.cosmjsSalt,a)}default:throw new Error("Unsupported KDF algorithm")}}e.executeKdf=r,e.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"};async function o(i,c,a){switch(a.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const u=t.Random.getBytes(t.xchacha20NonceLength);return new Uint8Array([...u,...await t.Xchacha20poly1305Ietf.encrypt(i,c,u)])}default:throw new Error(`Unsupported encryption algorithm: '${a.algorithm}'`)}}e.encrypt=o;async function s(i,c,a){switch(a.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const u=i.slice(0,t.xchacha20NonceLength);return t.Xchacha20poly1305Ietf.decrypt(i.slice(t.xchacha20NonceLength),c,u)}default:throw new Error(`Unsupported encryption algorithm: '${a.algorithm}'`)}}e.decrypt=s})(Is);Object.defineProperty(Vt,"__esModule",{value:!0});Vt.DirectSecp256k1HdWallet=Vt.extractKdfConfiguration=void 0;const ms=st,Ce=_e,Pn=D,Ht=X,Vl=Ye,An=Is,Pr="directsecp256k1hdwallet-v1",Gl={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function Fl(e){return!(!(0,Ht.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function Wl(e){return e.kdf}function Jl(e){const t=JSON.parse(e);if(!(0,Ht.isNonNullObject)(t))throw new Error("Root document is not an object.");switch(t.type){case Pr:return Wl(t);default:throw new Error("Unsupported serialization type")}}Vt.extractKdfConfiguration=Jl;const pi={bip39Password:"",hdPaths:[(0,ms.makeCosmoshubPath)(0)],prefix:"cosmos"};class At{static async fromMnemonic(t,n={}){const r=new Ce.EnglishMnemonic(t),o=await Ce.Bip39.mnemonicToSeed(r,n.bip39Password);return new At(r,{...n,seed:o})}static async generate(t=12,n={}){const r=4*Math.floor(11*t/33),o=Ce.Random.getBytes(r),s=Ce.Bip39.encode(o);return At.fromMnemonic(s.toString(),n)}static async deserialize(t,n){const r=JSON.parse(t);if(!(0,Ht.isNonNullObject)(r))throw new Error("Root document is not an object.");switch(r.type){case Pr:return At.deserializeTypeV1(t,n);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(t,n){const r=JSON.parse(t);if(!(0,Ht.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=r;switch(o.type){case Pr:{const s=await(0,An.decrypt)((0,Pn.fromBase64)(o.data),n,o.encryption),i=JSON.parse((0,Pn.fromUtf8)(s)),{mnemonic:c,accounts:a}=i;if((0,Ht.assert)(typeof c=="string"),!Array.isArray(a))throw new Error("Property 'accounts' is not an array");if(!a.every(y=>Fl(y)))throw new Error("Account is not in the correct format.");const u=a[0].prefix;if(!a.every(({prefix:y})=>y===u))throw new Error("Accounts do not all have the same prefix");const d=a.map(({hdPath:y})=>(0,Ce.stringToPath)(y));return At.fromMnemonic(c,{hdPaths:d,prefix:u})}default:throw new Error("Unsupported serialization type")}}static async deserializeTypeV1(t,n){const r=JSON.parse(t);if(!(0,Ht.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=await(0,An.executeKdf)(n,r.kdf);return At.deserializeWithEncryptionKey(t,o)}constructor(t,n){const r=n.prefix??pi.prefix,o=n.hdPaths??pi.hdPaths;this.secret=t,this.seed=n.seed,this.accounts=o.map(s=>({hdPath:s,prefix:r}))}get mnemonic(){return this.secret.toString()}async getAccounts(){return(await this.getAccountsWithPrivkeys()).map(({algo:n,pubkey:r,address:o})=>({algo:n,pubkey:r,address:o}))}async signDirect(t,n){const o=(await this.getAccountsWithPrivkeys()).find(({address:M})=>M===t);if(o===void 0)throw new Error(`Address ${t} not found in wallet`);const{privkey:s,pubkey:i}=o,c=(0,Vl.makeSignBytes)(n),a=(0,Ce.sha256)(c),u=await Ce.Secp256k1.createSignature(a,s),d=new Uint8Array([...u.r(32),...u.s(32)]),y=(0,ms.encodeSecp256k1Signature)(i,d);return{signed:n,signature:y}}async serialize(t){const n=Gl,r=await(0,An.executeKdf)(t,n);return this.serializeWithEncryptionKey(r,n)}async serializeWithEncryptionKey(t,n){const r={mnemonic:this.mnemonic,accounts:this.accounts.map(({hdPath:a,prefix:u})=>({hdPath:(0,Ce.pathToString)(a),prefix:u}))},o=(0,Pn.toUtf8)(JSON.stringify(r)),s={algorithm:An.supportedAlgorithms.xchacha20poly1305Ietf},i=await(0,An.encrypt)(o,t,s),c={type:Pr,kdf:n,encryption:s,data:(0,Pn.toBase64)(i)};return JSON.stringify(c)}async getKeyPair(t){const{privkey:n}=Ce.Slip10.derivePath(Ce.Slip10Curve.Secp256k1,this.seed,t),{pubkey:r}=await Ce.Secp256k1.makeKeypair(n);return{privkey:n,pubkey:Ce.Secp256k1.compressPubkey(r)}}async getAccountsWithPrivkeys(){return Promise.all(this.accounts.map(async({hdPath:t,prefix:n})=>{const{privkey:r,pubkey:o}=await this.getKeyPair(t),s=(0,Pn.toBech32)(n,(0,ms.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:r,pubkey:o,address:s}}))}}Vt.DirectSecp256k1HdWallet=At;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.DirectSecp256k1Wallet=void 0;const gi=st,ar=_e,Ll=D,zl=Ye;class $s{static async fromKey(t,n="cosmos"){const r=(await ar.Secp256k1.makeKeypair(t)).pubkey;return new $s(t,ar.Secp256k1.compressPubkey(r),n)}constructor(t,n,r){this.privkey=t,this.pubkey=n,this.prefix=r}get address(){return(0,Ll.toBech32)(this.prefix,(0,gi.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signDirect(t,n){const r=(0,zl.makeSignBytes)(n);if(t!==this.address)throw new Error(`Address ${t} not found in wallet`);const o=(0,ar.sha256)(r),s=await ar.Secp256k1.createSignature(o,this.privkey),i=new Uint8Array([...s.r(32),...s.s(32)]),c=(0,gi.encodeSecp256k1Signature)(this.pubkey,i);return{signed:n,signature:c}}}Fr.DirectSecp256k1Wallet=$s;var Wr={};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.makeCosmoshubPath=void 0;const Tn=_e;function Kl(e){return[Tn.Slip10RawIndex.hardened(44),Tn.Slip10RawIndex.hardened(118),Tn.Slip10RawIndex.hardened(0),Tn.Slip10RawIndex.normal(0),Tn.Slip10RawIndex.normal(e)]}Wr.makeCosmoshubPath=Kl;var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.decodeOptionalPubkey=Ke.decodePubkey=Ke.anyToSinglePubkey=Ke.encodePubkey=void 0;const Nn=st,yi=D,Ql=te,fs=p.keys,hs=p.keys$1,ps=p.keys$2,Lo=p.any;function ga(e){if((0,Nn.isSecp256k1Pubkey)(e)){const t=ps.PubKey.fromPartial({key:(0,yi.fromBase64)(e.value)});return Lo.Any.fromPartial({typeUrl:"/cosmos.crypto.secp256k1.PubKey",value:Uint8Array.from(ps.PubKey.encode(t).finish())})}else if((0,Nn.isEd25519Pubkey)(e)){const t=fs.PubKey.fromPartial({key:(0,yi.fromBase64)(e.value)});return Lo.Any.fromPartial({typeUrl:"/cosmos.crypto.ed25519.PubKey",value:Uint8Array.from(fs.PubKey.encode(t).finish())})}else if((0,Nn.isMultisigThresholdPubkey)(e)){const t=hs.LegacyAminoPubKey.fromPartial({threshold:Ql.Uint53.fromString(e.value.threshold).toNumber(),publicKeys:e.value.pubkeys.map(ga)});return Lo.Any.fromPartial({typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",value:Uint8Array.from(hs.LegacyAminoPubKey.encode(t).finish())})}else throw new Error(`Pubkey type ${e.type} not recognized`)}Ke.encodePubkey=ga;function gs(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":{const{key:t}=ps.PubKey.decode(e.value);return(0,Nn.encodeSecp256k1Pubkey)(t)}case"/cosmos.crypto.ed25519.PubKey":{const{key:t}=fs.PubKey.decode(e.value);return(0,Nn.encodeEd25519Pubkey)(t)}default:throw new Error(`Pubkey type_url ${e.typeUrl} not recognized as single public key type`)}}Ke.anyToSinglePubkey=gs;function ya(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":case"/cosmos.crypto.ed25519.PubKey":return gs(e);case"/cosmos.crypto.multisig.LegacyAminoPubKey":{const{threshold:t,publicKeys:n}=hs.LegacyAminoPubKey.decode(e.value);return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:t.toString(),pubkeys:n.map(gs)}}}default:throw new Error(`Pubkey type URL '${e.typeUrl}' not recognized`)}}Ke.decodePubkey=ya;function Zl(e){if(!e)return null;if(e.typeUrl){if(e.value.length)return ya(e);throw new Error(`Pubkey is an Any with type URL '${e.typeUrl}' but an empty value`)}else{if(e.value.length)throw new Error("Pubkey is an Any with an empty type URL but a value set");return null}}Ke.decodeOptionalPubkey=Zl;var je={};Object.defineProperty(je,"__esModule",{value:!0});je.Registry=je.isTxBodyEncodeObject=je.isPbjsGeneratedType=je.isTsProtoGeneratedType=je.isTelescopeGeneratedType=void 0;const Xl=p.tx$1,Yl=p.coin,zo=p.tx,ed=p.any;function ba(e){const t=e;return typeof t.fromPartial=="function"&&typeof t.typeUrl=="string"}je.isTelescopeGeneratedType=ba;function Ns(e){return typeof e.fromPartial=="function"}je.isTsProtoGeneratedType=Ns;function td(e){return!Ns(e)}je.isPbjsGeneratedType=td;const bi={cosmosCoin:"/cosmos.base.v1beta1.Coin",cosmosMsgSend:"/cosmos.bank.v1beta1.MsgSend",cosmosTxBody:"/cosmos.tx.v1beta1.TxBody",googleAny:"/google.protobuf.Any"};function va(e){return e.typeUrl==="/cosmos.tx.v1beta1.TxBody"}je.isTxBodyEncodeObject=va;class nd{constructor(t){const{cosmosCoin:n,cosmosMsgSend:r}=bi;this.types=t?new Map([...t]):new Map([[n,Yl.Coin],[r,Xl.MsgSend]])}register(t,n){this.types.set(t,n)}lookupType(t){return this.types.get(t)}lookupTypeWithError(t){const n=this.lookupType(t);if(!n)throw new Error(`Unregistered type url: ${t}`);return n}encode(t){const{value:n,typeUrl:r}=t;if(va(t))return this.encodeTxBody(n);const o=this.lookupTypeWithError(r),s=ba(o)||Ns(o)?o.fromPartial(n):o.create(n);return o.encode(s).finish()}encodeAsAny(t){const n=this.encode(t);return ed.Any.fromPartial({typeUrl:t.typeUrl,value:n})}encodeTxBody(t){var o;const n=t.messages.map(s=>this.encodeAsAny(s)),r=zo.TxBody.fromPartial({...t,timeoutHeight:BigInt(((o=t.timeoutHeight)==null?void 0:o.toString())??"0"),messages:n});return zo.TxBody.encode(r).finish()}decode({typeUrl:t,value:n}){if(t===bi.cosmosTxBody)return this.decodeTxBody(n);const o=this.lookupTypeWithError(t).decode(n);return Object.entries(o).forEach(([s,i])=>{typeof l.dist.Buffer<"u"&&typeof l.dist.Buffer.isBuffer<"u"&&l.dist.Buffer.isBuffer(i)&&(o[s]=Uint8Array.from(i))}),o}decodeTxBody(t){const n=zo.TxBody.decode(t);return{...n,messages:n.messages.map(({typeUrl:r,value:o})=>{if(!r)throw new Error("Missing type_url in Any");if(!o)throw new Error("Missing value in Any");return this.decode({typeUrl:r,value:o})})}}}je.Registry=nd;var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isOfflineDirectSigner=void 0;function rd(e){return e.signDirect!==void 0}Jr.isOfflineDirectSigner=rd;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseCoins=e.coins=e.coin=e.executeKdf=e.makeSignDoc=e.makeSignBytes=e.makeAuthInfoBytes=e.isOfflineDirectSigner=e.Registry=e.isTxBodyEncodeObject=e.isTsProtoGeneratedType=e.isPbjsGeneratedType=e.encodePubkey=e.decodePubkey=e.decodeOptionalPubkey=e.anyToSinglePubkey=e.makeCosmoshubPath=e.DirectSecp256k1Wallet=e.extractKdfConfiguration=e.DirectSecp256k1HdWallet=e.decodeTxRaw=void 0;var t=Dr;Object.defineProperty(e,"decodeTxRaw",{enumerable:!0,get:function(){return t.decodeTxRaw}});var n=Vt;Object.defineProperty(e,"DirectSecp256k1HdWallet",{enumerable:!0,get:function(){return n.DirectSecp256k1HdWallet}}),Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return n.extractKdfConfiguration}});var r=Fr;Object.defineProperty(e,"DirectSecp256k1Wallet",{enumerable:!0,get:function(){return r.DirectSecp256k1Wallet}});var o=Wr;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return o.makeCosmoshubPath}});var s=Ke;Object.defineProperty(e,"anyToSinglePubkey",{enumerable:!0,get:function(){return s.anyToSinglePubkey}}),Object.defineProperty(e,"decodeOptionalPubkey",{enumerable:!0,get:function(){return s.decodeOptionalPubkey}}),Object.defineProperty(e,"decodePubkey",{enumerable:!0,get:function(){return s.decodePubkey}}),Object.defineProperty(e,"encodePubkey",{enumerable:!0,get:function(){return s.encodePubkey}});var i=je;Object.defineProperty(e,"isPbjsGeneratedType",{enumerable:!0,get:function(){return i.isPbjsGeneratedType}}),Object.defineProperty(e,"isTsProtoGeneratedType",{enumerable:!0,get:function(){return i.isTsProtoGeneratedType}}),Object.defineProperty(e,"isTxBodyEncodeObject",{enumerable:!0,get:function(){return i.isTxBodyEncodeObject}}),Object.defineProperty(e,"Registry",{enumerable:!0,get:function(){return i.Registry}});var c=Jr;Object.defineProperty(e,"isOfflineDirectSigner",{enumerable:!0,get:function(){return c.isOfflineDirectSigner}});var a=Ye;Object.defineProperty(e,"makeAuthInfoBytes",{enumerable:!0,get:function(){return a.makeAuthInfoBytes}}),Object.defineProperty(e,"makeSignBytes",{enumerable:!0,get:function(){return a.makeSignBytes}}),Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return a.makeSignDoc}});var u=Is;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return u.executeKdf}});var d=st;Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return d.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return d.coins}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return d.parseCoins}})})(vt);Object.defineProperty(Fn,"__esModule",{value:!0});Fn.accountFromAny=void 0;const od=te,sd=vt,En=X,vi=p.auth,cr=p.vesting;function wi(e){return od.Uint64.fromString(e.toString())}function $t(e){const{address:t,pubKey:n,accountNumber:r,sequence:o}=e,s=(0,sd.decodeOptionalPubkey)(n);return{address:t,pubkey:s,accountNumber:wi(r).toNumber(),sequence:wi(o).toNumber()}}function id(e){var r,o,s,i,c,a,u;const{typeUrl:t,value:n}=e;switch(t){case"/cosmos.auth.v1beta1.BaseAccount":return $t(vi.BaseAccount.decode(n));case"/cosmos.auth.v1beta1.ModuleAccount":{const d=vi.ModuleAccount.decode(n).baseAccount;return(0,En.assert)(d),$t(d)}case"/cosmos.vesting.v1beta1.BaseVestingAccount":{const d=(r=cr.BaseVestingAccount.decode(n))==null?void 0:r.baseAccount;return(0,En.assert)(d),$t(d)}case"/cosmos.vesting.v1beta1.ContinuousVestingAccount":{const d=(s=(o=cr.ContinuousVestingAccount.decode(n))==null?void 0:o.baseVestingAccount)==null?void 0:s.baseAccount;return(0,En.assert)(d),$t(d)}case"/cosmos.vesting.v1beta1.DelayedVestingAccount":{const d=(c=(i=cr.DelayedVestingAccount.decode(n))==null?void 0:i.baseVestingAccount)==null?void 0:c.baseAccount;return(0,En.assert)(d),$t(d)}case"/cosmos.vesting.v1beta1.PeriodicVestingAccount":{const d=(u=(a=cr.PeriodicVestingAccount.decode(n))==null?void 0:a.baseVestingAccount)==null?void 0:u.baseAccount;return(0,En.assert)(d),$t(d)}default:throw new Error(`Unsupported type: '${t}'`)}}Fn.accountFromAny=id;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.AminoTypes=void 0;class ad{constructor(t){this.register=t}toAmino({typeUrl:t,value:n}){const r=this.register[t];if(!r)throw new Error(`Type URL '${t}' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.`);return{type:r.aminoType,value:r.toAmino(n)}}fromAmino({type:t,value:n}){const r=Object.entries(this.register).filter(([o,{aminoType:s}])=>s===t);switch(r.length){case 0:throw new Error(`Amino type identifier '${t}' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.`);case 1:{const[o,s]=r[0];return{typeUrl:o,value:s.fromAmino(n)}}default:throw new Error(`Multiple types are registered with Amino type identifier '${t}': '`+r.map(([o,s])=>o).sort().join("', '")+"'. Thus fromAmino cannot be performed.")}}}zn.AminoTypes=ad;var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.fromTendermintEvent=void 0;const ki=D;function cd(e){return{type:e.type,attributes:e.attributes.map(t=>({key:typeof t.key=="string"?t.key:(0,ki.fromUtf8)(t.key,!0),value:typeof t.value=="string"?t.value:(0,ki.fromUtf8)(t.value,!0)}))}}Kn.fromTendermintEvent=cd;var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.calculateFee=Mt.GasPrice=void 0;const wa=te,ud=vt;function ld(e){if(e.length<3||e.length>128)throw new Error("Denom must be between 3 and 128 characters")}class Lr{constructor(t,n){this.amount=t,this.denom=n}static fromString(t){const n=t.match(/^([0-9.]+)([a-zA-Z][a-zA-Z0-9/:._-]*)$/);if(!n)throw new Error("Invalid gas price string");const[r,o,s]=n;ld(s);const c=wa.Decimal.fromUserInput(o,18);return new Lr(c,s)}toString(){return this.amount.toString()+this.denom}}Mt.GasPrice=Lr;function dd(e,t){const n=typeof t=="string"?Lr.fromString(t):t,{denom:r,amount:o}=n,s=o.multiply(new wa.Uint53(e)).ceil().toString();return{amount:(0,ud.coins)(s,r),gas:e.toString()}}Mt.calculateFee=dd;var ye={};Object.defineProperty(ye,"__esModule",{value:!0});ye.findAttribute=ye.parseRawLog=ye.parseLogs=ye.parseLog=ye.parseEvent=ye.parseAttribute=void 0;const Ds=X;function ka(e){if(!(0,Ds.isNonNullObject)(e))throw new Error("Attribute must be a non-null object");const{key:t,value:n}=e;if(typeof t!="string"||!t)throw new Error("Attribute's key must be a non-empty string");if(typeof n!="string"&&typeof n<"u")throw new Error("Attribute's value must be a string or unset");return{key:t,value:n||""}}ye.parseAttribute=ka;function _a(e){if(!(0,Ds.isNonNullObject)(e))throw new Error("Event must be a non-null object");const{type:t,attributes:n}=e;if(typeof t!="string"||t==="")throw new Error("Event type must be a non-empty string");if(!Array.isArray(n))throw new Error("Event's attributes must be an array");return{type:t,attributes:n.map(ka)}}ye.parseEvent=_a;function Sa(e){if(!(0,Ds.isNonNullObject)(e))throw new Error("Log must be a non-null object");const{msg_index:t,log:n,events:r}=e;if(typeof t!="number")throw new Error("Log's msg_index must be a number");if(typeof n!="string")throw new Error("Log's log must be a string");if(!Array.isArray(r))throw new Error("Log's events must be an array");return{msg_index:t,log:n,events:r.map(_a)}}ye.parseLog=Sa;function Pa(e){if(!Array.isArray(e))throw new Error("Logs must be an array");return e.map(Sa)}ye.parseLogs=Pa;function md(e){if(!e)return[];const t=JSON.parse(e).map(({events:n},r)=>({msg_index:r,events:n,log:""}));return Pa(t)}ye.parseRawLog=md;function fd(e,t,n){var s;const r=e.find(()=>!0),o=(s=r==null?void 0:r.events.find(i=>i.type===t))==null?void 0:s.attributes.find(i=>i.key===n);if(!o)throw new Error(`Could not find attribute '${n}' in first event of type '${t}' in first log.`);return o}ye.findAttribute=fd;var qn={},zr={},ce={},Kr={},Qn={},Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.concat=void 0;const hd=p.xstream;function pd(...e){const t=new Array,n=new Array,r=new Set;let o=0;function s(){for(;t.length>0;)t.shift().unsubscribe();n.length=0,r.clear(),o=0}const i={start:c=>{e.forEach(d=>n.push([]));function a(d){for(;;){const y=n[d].shift();if(y===void 0)return;c.next(y)}}function u(){return o>=e.length}if(u()){c.complete();return}e.forEach((d,y)=>{t.push(d.subscribe({next:M=>{y===o?c.next(M):n[y].push(M)},complete:()=>{for(r.add(y);r.has(o);)a(o),o++;u()?c.complete():a(o)},error:M=>{c.error(M),s()}}))})},stop:()=>{s()}};return hd.Stream.create(i)}Qr.concat=pd;var Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.DefaultValueProducer=void 0;class gd{get value(){return this.internalValue}constructor(t,n){this.callbacks=n,this.internalValue=t}update(t){this.internalValue=t,this.listener&&this.listener.next(t)}error(t){this.listener&&this.listener.error(t)}start(t){this.listener=t,t.next(this.internalValue),this.callbacks&&this.callbacks.onStarted()}stop(){this.callbacks&&this.callbacks.onStop(),this.listener=void 0}}Zr.DefaultValueProducer=gd;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.dropDuplicates=void 0;function yd(e){return n=>{const r=new Set;return n.filter(s=>!r.has(e(s))).debug(s=>r.add(e(s)))}}Xr.dropDuplicates=yd;var ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.firstEvent=ft.toListPromise=ft.fromListPromise=void 0;const bd=p.xstream;function vd(e){const t={start:n=>{e.then(r=>{for(const o of r)n.next(o);n.complete()}).catch(r=>n.error(r))},stop:()=>{}};return bd.Stream.create(t)}ft.fromListPromise=vd;async function Aa(e,t){return new Promise((n,r)=>{if(t===0){n([]);return}const o=new Array;e.take(t).subscribe({next:s=>{o.push(s),o.length===t&&n(o)},complete:()=>{r(`Stream completed before all events could be collected. Collected ${o.length}, expected ${t}`)},error:s=>r(s)})})}ft.toListPromise=Aa;async function wd(e){return(await Aa(e,1))[0]}ft.firstEvent=wd;var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.lastValue=Qe.asArray=Qe.countStream=Qe.Reducer=void 0;class Yr{constructor(t,n,r){this.stream=t,this.reducer=n,this.state=r,this.completed=new Promise((o,s)=>{const i=this.stream.subscribe({next:c=>{this.state=this.reducer(this.state,c)},complete:()=>{o(),i.unsubscribe()},error:c=>{s(c),i.unsubscribe()}})})}value(){return this.state}async finished(){return this.completed}}Qe.Reducer=Yr;function kd(e,t){return e+1}function _d(e){return new Yr(e,kd,0)}Qe.countStream=_d;function Sd(e,t){return[...e,t]}function Pd(e){return new Yr(e,Sd,[])}Qe.asArray=Pd;function Ad(e,t){return t}function Td(e){return new Yr(e,Ad,void 0)}Qe.lastValue=Td;var eo={};Object.defineProperty(eo,"__esModule",{value:!0});eo.ValueAndUpdates=void 0;const Ed=p.xstream;class Cd{get value(){return this.producer.value}constructor(t){this.producer=t,this.updates=Ed.MemoryStream.createWithMemory(this.producer)}async waitFor(t){const n=typeof t=="function"?t:r=>r===t;return new Promise((r,o)=>{const s=this.updates.subscribe({next:i=>{n(i)&&(r(i),setTimeout(()=>s.unsubscribe(),0))},complete:()=>{s.unsubscribe(),o("Update stream completed without expected value")},error:i=>{o(i)}})})}}eo.ValueAndUpdates=Cd;(function(e){var t=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(a,u,d,y){y===void 0&&(y=d);var M=Object.getOwnPropertyDescriptor(u,d);(!M||("get"in M?!u.__esModule:M.writable||M.configurable))&&(M={enumerable:!0,get:function(){return u[d]}}),Object.defineProperty(a,y,M)}:function(a,u,d,y){y===void 0&&(y=d),a[y]=u[d]}),n=l.commonjsGlobal&&l.commonjsGlobal.__exportStar||function(a,u){for(var d in a)d!=="default"&&!Object.prototype.hasOwnProperty.call(u,d)&&t(u,a,d)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueAndUpdates=e.toListPromise=e.fromListPromise=e.firstEvent=e.dropDuplicates=e.DefaultValueProducer=e.concat=void 0;var r=Qr;Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return r.concat}});var o=Zr;Object.defineProperty(e,"DefaultValueProducer",{enumerable:!0,get:function(){return o.DefaultValueProducer}});var s=Xr;Object.defineProperty(e,"dropDuplicates",{enumerable:!0,get:function(){return s.dropDuplicates}});var i=ft;Object.defineProperty(e,"firstEvent",{enumerable:!0,get:function(){return i.firstEvent}}),Object.defineProperty(e,"fromListPromise",{enumerable:!0,get:function(){return i.fromListPromise}}),Object.defineProperty(e,"toListPromise",{enumerable:!0,get:function(){return i.toListPromise}}),n(Qe,e);var c=eo;Object.defineProperty(e,"ValueAndUpdates",{enumerable:!0,get:function(){return c.ValueAndUpdates}})})(Qn);Object.defineProperty(Kr,"__esModule",{value:!0});Kr.QueryClient=void 0;const St=p.build,Tt=D,jd=Qn,he=X;function ur(e,t,n){if(e.type!==t)throw new Error(`Op expected to be ${t}, got "${e.type}`);if(!(0,he.arrayContentEquals)(n,e.key))throw new Error(`Proven key different than queried key.
|
|
1
|
+
"use strict";var Dc=Object.defineProperty;var xc=(e,t,n)=>t in e?Dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ct=(e,t,n)=>xc(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-Hj_44yP6.js"),p=require("./cosmwasm-u__X419O.js"),Uc=require("./index-sqvrX5as.js"),oi=require("./unsignedTransaction-DDxT_548.js");function qc(e){return e.id!==void 0&&e.pending!==void 0&&e.data!==void 0}var Hi={},Fn={},te={},Nr={},Hc=l.commonjsGlobal&&l.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.Decimal=void 0;const qe=Hc(l.bnExports),si=100;class Q{static fromUserInput(t,n){Q.verifyFractionalDigits(n);const r=t.match(/[^0-9.]/);if(r)throw new Error(`Invalid character at position ${r.index+1}`);let o,s;if(t==="")o="0",s="";else if(t.search(/\./)===-1)o=t,s="";else{const c=t.split(".");switch(c.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!c[1])throw new Error("Fractional part missing");o=c[0],s=c[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(s.length>n)throw new Error("Got more fractional digits than supported");const i=`${o}${s.padEnd(n,"0")}`;return new Q(i,n)}static fromAtomics(t,n){return Q.verifyFractionalDigits(n),new Q(t,n)}static zero(t){return Q.verifyFractionalDigits(t),new Q("0",t)}static one(t){return Q.verifyFractionalDigits(t),new Q("1"+"0".repeat(t),t)}static verifyFractionalDigits(t){if(!Number.isInteger(t))throw new Error("Fractional digits is not an integer");if(t<0)throw new Error("Fractional digits must not be negative");if(t>si)throw new Error(`Fractional digits must not exceed ${si}`)}static compare(t,n){if(t.fractionalDigits!==n.fractionalDigits)throw new Error("Fractional digits do not match");return t.data.atomics.cmp(new qe.default(n.atomics))}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}constructor(t,n){if(!t.match(/^[0-9]+$/))throw new Error("Invalid string format. Only non-negative integers in decimal representation supported.");this.data={atomics:new qe.default(t),fractionalDigits:n}}clone(){return new Q(this.atomics,this.fractionalDigits)}floor(){const t=new qe.default(10).pow(new qe.default(this.data.fractionalDigits)),n=this.data.atomics.div(t);return this.data.atomics.mod(t).isZero()?this.clone():Q.fromAtomics(n.mul(t).toString(),this.fractionalDigits)}ceil(){const t=new qe.default(10).pow(new qe.default(this.data.fractionalDigits)),n=this.data.atomics.div(t);return this.data.atomics.mod(t).isZero()?this.clone():Q.fromAtomics(n.addn(1).mul(t).toString(),this.fractionalDigits)}toString(){const t=new qe.default(10).pow(new qe.default(this.data.fractionalDigits)),n=this.data.atomics.div(t),r=this.data.atomics.mod(t);if(r.isZero())return n.toString();{const s=r.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${n.toString()}.${s}`}}toFloatApproximation(){const t=Number(this.toString());if(Number.isNaN(t))throw new Error("Conversion to number failed");return t}plus(t){if(this.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");const n=this.data.atomics.add(new qe.default(t.atomics));return new Q(n.toString(),this.fractionalDigits)}minus(t){if(this.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");const n=this.data.atomics.sub(new qe.default(t.atomics));if(n.ltn(0))throw new Error("Difference must not be negative");return new Q(n.toString(),this.fractionalDigits)}multiply(t){const n=this.data.atomics.mul(new qe.default(t.toString()));return new Q(n.toString(),this.fractionalDigits)}equals(t){return Q.compare(this,t)===0}isLessThan(t){return Q.compare(this,t)<0}isLessThanOrEqual(t){return Q.compare(this,t)<=0}isGreaterThan(t){return Q.compare(this,t)>0}isGreaterThanOrEqual(t){return Q.compare(this,t)>=0}}Nr.Decimal=Q;var Je={},Vc=l.commonjsGlobal&&l.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Je,"__esModule",{value:!0});Je.Uint64=Je.Uint53=Je.Int53=Je.Uint32=void 0;const _r=Vc(l.bnExports),Gc=new _r.default("18446744073709551615",10,"be");class $n{static fromBigEndianBytes(t){return $n.fromBytes(t)}static fromBytes(t,n="be"){if(t.length!==4)throw new Error("Invalid input length. Expected 4 bytes.");for(let o=0;o<t.length;++o)if(!Number.isInteger(t[o])||t[o]>255||t[o]<0)throw new Error("Invalid value in byte. Found: "+t[o]);const r=n==="be"?t:Array.from(t).reverse();return new $n(r[0]*2**24+r[1]*2**16+r[2]*2**8+r[3])}static fromString(t){if(!t.match(/^[0-9]+$/))throw new Error("Invalid string format");return new $n(Number.parseInt(t,10))}constructor(t){if(Number.isNaN(t))throw new Error("Input is not a number");if(!Number.isInteger(t))throw new Error("Input is not an integer");if(t<0||t>4294967295)throw new Error("Input not in uint32 range: "+t.toString());this.data=t}toBytesBigEndian(){return new Uint8Array([Math.floor(this.data/2**24)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**0)&255])}toBytesLittleEndian(){return new Uint8Array([Math.floor(this.data/2**0)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**24)&255])}toNumber(){return this.data}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}Je.Uint32=$n;class xn{static fromString(t){if(!t.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new xn(Number.parseInt(t,10))}constructor(t){if(Number.isNaN(t))throw new Error("Input is not a number");if(!Number.isInteger(t))throw new Error("Input is not an integer");if(t<Number.MIN_SAFE_INTEGER||t>Number.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+t.toString());this.data=t}toNumber(){return this.data}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}Je.Int53=xn;class Ts{static fromString(t){const n=xn.fromString(t);return new Ts(n.toNumber())}constructor(t){const n=new xn(t);if(n.toNumber()<0)throw new Error("Input is negative");this.data=n}toNumber(){return this.data.toNumber()}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}Je.Uint53=Ts;class xt{static fromBytesBigEndian(t){return xt.fromBytes(t)}static fromBytes(t,n="be"){if(t.length!==8)throw new Error("Invalid input length. Expected 8 bytes.");for(let o=0;o<t.length;++o)if(!Number.isInteger(t[o])||t[o]>255||t[o]<0)throw new Error("Invalid value in byte. Found: "+t[o]);const r=n==="be"?Array.from(t):Array.from(t).reverse();return new xt(new _r.default(r))}static fromString(t){if(!t.match(/^[0-9]+$/))throw new Error("Invalid string format");return new xt(new _r.default(t,10,"be"))}static fromNumber(t){if(Number.isNaN(t))throw new Error("Input is not a number");if(!Number.isInteger(t))throw new Error("Input is not an integer");let n;try{n=new _r.default(t)}catch{throw new Error("Input is not a safe integer")}return new xt(n)}constructor(t){if(t.isNeg())throw new Error("Input is negative");if(t.gt(Gc))throw new Error("Input exceeds uint64 range");this.data=t}toBytesBigEndian(){return Uint8Array.from(this.data.toArray("be",8))}toBytesLittleEndian(){return Uint8Array.from(this.data.toArray("le",8))}toString(){return this.data.toString(10)}toBigInt(){return BigInt(this.toString())}toNumber(){return this.data.toNumber()}}Je.Uint64=xt;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Uint64=e.Uint53=e.Uint32=e.Int53=e.Decimal=void 0;var t=Nr;Object.defineProperty(e,"Decimal",{enumerable:!0,get:function(){return t.Decimal}});var n=Je;Object.defineProperty(e,"Int53",{enumerable:!0,get:function(){return n.Int53}}),Object.defineProperty(e,"Uint32",{enumerable:!0,get:function(){return n.Uint32}}),Object.defineProperty(e,"Uint53",{enumerable:!0,get:function(){return n.Uint53}}),Object.defineProperty(e,"Uint64",{enumerable:!0,get:function(){return n.Uint64}})})(te);var vt={},Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.decodeTxRaw=void 0;const Wo=p.tx;function Fc(e){const t=Wo.TxRaw.decode(e);return{authInfo:Wo.AuthInfo.decode(t.authInfoBytes),body:Wo.TxBody.decode(t.bodyBytes),signatures:t.signatures}}Dr.decodeTxRaw=Fc;var Vt={},st={},Ae={},_e={},Le={},D={},Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.fromAscii=Gt.toAscii=void 0;function Wc(e){const t=n=>n.split("").map(r=>{const o=r.charCodeAt(0);if(o<32||o>126)throw new Error("Cannot encode character that is out of printable ASCII range: "+o);return o});return Uint8Array.from(t(e))}Gt.toAscii=Wc;function Jc(e){return(n=>n.map(r=>{if(r<32||r>126)throw new Error("Cannot decode character that is out of printable ASCII range: "+r);return String.fromCharCode(r)}))(Array.from(e)).join("")}Gt.fromAscii=Jc;var Ft={},Lc=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),zc=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Kc=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Lc(t,e,n);return zc(t,e),t};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.fromBase64=Ft.toBase64=void 0;const Vi=Kc(l.base64Js);function Qc(e){return Vi.fromByteArray(e)}Ft.toBase64=Qc;function Zc(e){if(!e.match(/^[a-zA-Z0-9+/]*={0,2}$/))throw new Error("Invalid base64 string format");return Vi.toByteArray(e)}Ft.fromBase64=Zc;var lt={},Xc=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Yc=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),eu=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Xc(t,e,n);return Yc(t,e),t};Object.defineProperty(lt,"__esModule",{value:!0});lt.normalizeBech32=lt.fromBech32=lt.toBech32=void 0;const Ar=eu(p.bech32);function Gi(e,t,n){return Ar.encode(e,Ar.toWords(t),n)}lt.toBech32=Gi;function Fi(e,t=1/0){const n=Ar.decode(e,t);return{prefix:n.prefix,data:new Uint8Array(Ar.fromWords(n.words))}}lt.fromBech32=Fi;function tu(e){const{prefix:t,data:n}=Fi(e);return Gi(t,n)}lt.normalizeBech32=tu;var Wt={};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.fromHex=Wt.toHex=void 0;function nu(e){let t="";for(const n of e)t+=("0"+n.toString(16)).slice(-2);return t}Wt.toHex=nu;function ru(e){if(e.length%2!==0)throw new Error("hex string length must be a multiple of 2");const t=new Uint8Array(e.length/2);for(let n=0;n<t.length;n++){const r=2*n,o=e.slice(r,r+2);if(!o.match(/[0-9a-f]{2}/i))throw new Error("hex string contains invalid characters");t[n]=parseInt(o,16)}return t}Wt.fromHex=ru;var Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.toRfc3339=Jt.fromRfc3339=void 0;const ou=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/;function It(e,t=2){return e.toString().padStart(t,"0")}function su(e){const t=ou.exec(e);if(!t)throw new Error("Date string is not in RFC3339 format");const n=+t[1],r=+t[2],o=+t[3],s=+t[4],i=+t[5],c=+t[6],a=t[7]?Math.floor(+t[7]*1e3):0;let u,d,y;t[8]==="Z"?(u=1,d=0,y=0):(u=t[8].substring(0,1)==="-"?-1:1,d=+t[8].substring(1,3),y=+t[8].substring(4,6));const M=u*(d*60+y)*60,_=new Date;return _.setUTCFullYear(n,r-1,o),_.setUTCHours(s,i,c,a),new Date(_.getTime()-M*1e3)}Jt.fromRfc3339=su;function iu(e){const t=e.getUTCFullYear(),n=It(e.getUTCMonth()+1),r=It(e.getUTCDate()),o=It(e.getUTCHours()),s=It(e.getUTCMinutes()),i=It(e.getUTCSeconds()),c=It(e.getUTCMilliseconds(),3);return`${t}-${n}-${r}T${o}:${s}:${i}.${c}Z`}Jt.toRfc3339=iu;var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.fromUtf8=Lt.toUtf8=void 0;function au(e){return new TextEncoder().encode(e)}Lt.toUtf8=au;function cu(e,t=!1){const n=!t;return new TextDecoder("utf-8",{fatal:n}).decode(e)}Lt.fromUtf8=cu;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toUtf8=e.fromUtf8=e.toRfc3339=e.fromRfc3339=e.toHex=e.fromHex=e.toBech32=e.normalizeBech32=e.fromBech32=e.toBase64=e.fromBase64=e.toAscii=e.fromAscii=void 0;var t=Gt;Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return t.fromAscii}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return t.toAscii}});var n=Ft;Object.defineProperty(e,"fromBase64",{enumerable:!0,get:function(){return n.fromBase64}}),Object.defineProperty(e,"toBase64",{enumerable:!0,get:function(){return n.toBase64}});var r=lt;Object.defineProperty(e,"fromBech32",{enumerable:!0,get:function(){return r.fromBech32}}),Object.defineProperty(e,"normalizeBech32",{enumerable:!0,get:function(){return r.normalizeBech32}}),Object.defineProperty(e,"toBech32",{enumerable:!0,get:function(){return r.toBech32}});var o=Wt;Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return o.fromHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return o.toHex}});var s=Jt;Object.defineProperty(e,"fromRfc3339",{enumerable:!0,get:function(){return s.fromRfc3339}}),Object.defineProperty(e,"toRfc3339",{enumerable:!0,get:function(){return s.toRfc3339}});var i=Lt;Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(e,"toUtf8",{enumerable:!0,get:function(){return i.toUtf8}})})(D);var pe={},X={},zt={};Object.defineProperty(zt,"__esModule",{value:!0});zt.arrayContentStartsWith=zt.arrayContentEquals=void 0;function uu(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}zt.arrayContentEquals=uu;function lu(e,t){if(e.length<t.length)return!1;for(let n=0;n<t.length;++n)if(e[n]!==t[n])return!1;return!0}zt.arrayContentStartsWith=lu;var dt={};Object.defineProperty(dt,"__esModule",{value:!0});dt.assertDefinedAndNotNull=dt.assertDefined=dt.assert=void 0;function du(e,t){if(!e)throw new Error(t||"condition is not truthy")}dt.assert=du;function mu(e,t){if(e===void 0)throw new Error(t??"value is undefined")}dt.assertDefined=mu;function fu(e,t){if(e==null)throw new Error(t??"value is undefined or null")}dt.assertDefinedAndNotNull=fu;var xr={};Object.defineProperty(xr,"__esModule",{value:!0});xr.sleep=void 0;async function hu(e){return new Promise(t=>setTimeout(t,e))}xr.sleep=hu;var mt={};Object.defineProperty(mt,"__esModule",{value:!0});mt.isDefined=mt.isUint8Array=mt.isNonNullObject=void 0;function Wi(e){return typeof e=="object"&&e!==null}mt.isNonNullObject=Wi;function pu(e){return!(!Wi(e)||Object.prototype.toString.call(e)!=="[object Uint8Array]"||typeof l.dist.Buffer<"u"&&typeof l.dist.Buffer.isBuffer<"u"&&l.dist.Buffer.isBuffer(e))}mt.isUint8Array=pu;function gu(e){return e!==void 0}mt.isDefined=gu;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isUint8Array=e.isNonNullObject=e.isDefined=e.sleep=e.assertDefinedAndNotNull=e.assertDefined=e.assert=e.arrayContentStartsWith=e.arrayContentEquals=void 0;var t=zt;Object.defineProperty(e,"arrayContentEquals",{enumerable:!0,get:function(){return t.arrayContentEquals}}),Object.defineProperty(e,"arrayContentStartsWith",{enumerable:!0,get:function(){return t.arrayContentStartsWith}});var n=dt;Object.defineProperty(e,"assert",{enumerable:!0,get:function(){return n.assert}}),Object.defineProperty(e,"assertDefined",{enumerable:!0,get:function(){return n.assertDefined}}),Object.defineProperty(e,"assertDefinedAndNotNull",{enumerable:!0,get:function(){return n.assertDefinedAndNotNull}});var r=xr;Object.defineProperty(e,"sleep",{enumerable:!0,get:function(){return r.sleep}});var o=mt;Object.defineProperty(e,"isDefined",{enumerable:!0,get:function(){return o.isDefined}}),Object.defineProperty(e,"isNonNullObject",{enumerable:!0,get:function(){return o.isNonNullObject}}),Object.defineProperty(e,"isUint8Array",{enumerable:!0,get:function(){return o.isUint8Array}})})(X);var yu=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),bu=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),vu=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&yu(t,e,n);return bu(t,e),t};Object.defineProperty(pe,"__esModule",{value:!0});pe.pbkdf2Sha512=pe.pbkdf2Sha512Noble=pe.pbkdf2Sha512NodeCrypto=pe.pbkdf2Sha512Subtle=pe.getSubtle=pe.getNodeCrypto=void 0;const Et=X,wu=p.require$$1,ku=p.require$$1$1;async function Ji(){try{const e=await Promise.resolve().then(()=>vu(l.requireCryptoBrowserify()));return typeof e=="object"&&Object.keys(e).length<=1?void 0:e}catch{return}}pe.getNodeCrypto=Ji;async function Li(){var t,n,r;let e=(t=globalThis==null?void 0:globalThis.crypto)==null?void 0:t.subtle;return e||(e=(r=(n=globalThis==null?void 0:globalThis.crypto)==null?void 0:n.webcrypto)==null?void 0:r.subtle),e}pe.getSubtle=Li;async function zi(e,t,n,r,o){return(0,Et.assert)(e,"Argument subtle is falsy"),(0,Et.assert)(typeof e=="object","Argument subtle is not of type object"),(0,Et.assert)(typeof e.importKey=="function","subtle.importKey is not a function"),(0,Et.assert)(typeof e.deriveBits=="function","subtle.deriveBits is not a function"),e.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then(s=>e.deriveBits({name:"PBKDF2",salt:n,iterations:r,hash:{name:"SHA-512"}},s,o*8).then(i=>new Uint8Array(i)))}pe.pbkdf2Sha512Subtle=zi;async function Ki(e,t,n,r,o){return(0,Et.assert)(e,"Argument nodeCrypto is falsy"),(0,Et.assert)(typeof e=="object","Argument nodeCrypto is not of type object"),(0,Et.assert)(typeof e.pbkdf2=="function","nodeCrypto.pbkdf2 is not a function"),new Promise((s,i)=>{e.pbkdf2(t,n,r,o,"sha512",(c,a)=>{c?i(c):s(Uint8Array.from(a))})})}pe.pbkdf2Sha512NodeCrypto=Ki;async function Qi(e,t,n,r){return(0,wu.pbkdf2Async)(ku.sha512,e,t,{c:n,dkLen:r})}pe.pbkdf2Sha512Noble=Qi;async function _u(e,t,n,r){const o=await Li();if(o)return zi(o,e,t,n,r);{const s=await Ji();return s?Ki(s,e,t,n,r):Qi(e,t,n,r)}}pe.pbkdf2Sha512=_u;var xe={},bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.toRealUint8Array=void 0;function Su(e){return e instanceof Uint8Array?e:Uint8Array.from(e)}bn.toRealUint8Array=Su;Object.defineProperty(xe,"__esModule",{value:!0});xe.sha512=xe.Sha512=xe.sha256=xe.Sha256=void 0;const Pu=p.require$$0,Au=p.require$$1$1,Zi=bn;class Xi{constructor(t){this.blockSize=512/8,this.impl=Pu.sha256.create(),t&&this.update(t)}update(t){return this.impl.update((0,Zi.toRealUint8Array)(t)),this}digest(){return this.impl.digest()}}xe.Sha256=Xi;function Tu(e){return new Xi(e).digest()}xe.sha256=Tu;class Yi{constructor(t){this.blockSize=1024/8,this.impl=Au.sha512.create(),t&&this.update(t)}update(t){return this.impl.update((0,Zi.toRealUint8Array)(t)),this}digest(){return this.impl.digest()}}xe.Sha512=Yi;function Eu(e){return new Yi(e).digest()}xe.sha512=Eu;Object.defineProperty(Le,"__esModule",{value:!0});Le.Bip39=Le.EnglishMnemonic=Le.mnemonicToEntropy=Le.entropyToMnemonic=void 0;const ii=D,Cu=pe,ju=xe,Es=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];function ea(e){return Array.from(e).map(t=>t.toString(2).padStart(8,"0")).join("")}function ta(e){const n=e.length*8/32,r=(0,ju.sha256)(e);return ea(r).slice(0,n)}function na(e){return parseInt(e,2)}const Mu=[16,20,24,28,32],Ou=[12,15,18,21,24];function ra(e){if(Mu.indexOf(e.length)===-1)throw new Error("invalid input length");const t=ea(e),n=ta(e);return(t+n).match(/(.{11})/g).map(i=>{const c=na(i);return Es[c]}).join(" ")}Le.entropyToMnemonic=ra;const Bu="Invalid number of words",Ru="Found word that is not in the wordlist",Iu="Invalid entropy",$u="Invalid mnemonic checksum";function ss(e){return e.normalize("NFKD")}function Cs(e){const t=ss(e).split(" ");if(!Ou.includes(t.length))throw new Error(Bu);const n=t.map(u=>{const d=Es.indexOf(u);if(d===-1)throw new Error(Ru);return d.toString(2).padStart(11,"0")}).join(""),r=Math.floor(n.length/33)*32,o=n.slice(0,r),s=n.slice(r),i=o.match(/(.{1,8})/g).map(na);if(i.length<16||i.length>32||i.length%4!==0)throw new Error(Iu);const c=Uint8Array.from(i);if(ta(c)!==s)throw new Error($u);return c}Le.mnemonicToEntropy=Cs;class Ct{constructor(t){if(!Ct.mnemonicMatcher.test(t))throw new Error("Invalid mnemonic format");const n=t.split(" "),r=[12,15,18,21,24];if(r.indexOf(n.length)===-1)throw new Error(`Invalid word count in mnemonic (allowed: ${r} got: ${n.length})`);for(const o of n)if(Ct.wordlist.indexOf(o)===-1)throw new Error("Mnemonic contains invalid word");Cs(t),this.data=t}toString(){return this.data}}Le.EnglishMnemonic=Ct;Ct.wordlist=Es;Ct.mnemonicMatcher=/^[a-z]+( [a-z]+)*$/;class Nu{static encode(t){return new Ct(ra(t))}static decode(t){return Cs(t.toString())}static async mnemonicToSeed(t,n){const r=(0,ii.toUtf8)(ss(t.toString())),o="mnemonic"+(n?ss(n):""),s=(0,ii.toUtf8)(o);return(0,Cu.pbkdf2Sha512)(r,s,2048,64)}}Le.Bip39=Nu;var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.Hmac=void 0;class Du{constructor(t,n){const r=new t().blockSize;this.hash=s=>new t().update(s).digest();let o=n;if(o.length>r&&(o=this.hash(o)),o.length<r){const s=new Uint8Array(r-o.length);o=new Uint8Array([...o,...s])}this.oKeyPad=o.map(s=>s^92),this.iKeyPad=o.map(s=>s^54),this.messageHasher=new t,this.blockSize=r,this.update(this.iKeyPad)}update(t){return this.messageHasher.update(t),this}digest(){const t=this.messageHasher.digest();return this.hash(new Uint8Array([...this.oKeyPad,...t]))}}Wn.Hmac=Du;var Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.keccak256=Kt.Keccak256=void 0;const xu=p.require$$0$1,Uu=bn;class oa{constructor(t){this.blockSize=512/8,this.impl=xu.keccak_256.create(),t&&this.update(t)}update(t){return this.impl.update((0,Uu.toRealUint8Array)(t)),this}digest(){return this.impl.digest()}}Kt.Keccak256=oa;function qu(e){return new oa(e).digest()}Kt.keccak256=qu;var ge={},Hu=l.commonjsGlobal&&l.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ge,"__esModule",{value:!0});ge.Xchacha20poly1305Ietf=ge.xchacha20NonceLength=ge.Ed25519=ge.Ed25519Keypair=ge.Argon2id=ge.isArgon2idOptions=void 0;const Vu=X,Pe=Hu(p.libsodiumWrappers);function Gu(e){return!(!(0,Vu.isNonNullObject)(e)||typeof e.outputLength!="number"||typeof e.opsLimit!="number"||typeof e.memLimitKib!="number")}ge.isArgon2idOptions=Gu;class Fu{static async execute(t,n,r){return await Pe.default.ready,Pe.default.crypto_pwhash(r.outputLength,t,n,r.opsLimit,r.memLimitKib*1024,Pe.default.crypto_pwhash_ALG_ARGON2ID13)}}ge.Argon2id=Fu;class Ur{static fromLibsodiumPrivkey(t){if(t.length!==64)throw new Error(`Unexpected key length ${t.length}. Must be 64.`);return new Ur(t.slice(0,32),t.slice(32,64))}constructor(t,n){this.privkey=t,this.pubkey=n}toLibsodiumPrivkey(){return new Uint8Array([...this.privkey,...this.pubkey])}}ge.Ed25519Keypair=Ur;class Wu{static async makeKeypair(t){await Pe.default.ready;const n=Pe.default.crypto_sign_seed_keypair(t);return Ur.fromLibsodiumPrivkey(n.privateKey)}static async createSignature(t,n){return await Pe.default.ready,Pe.default.crypto_sign_detached(t,n.toLibsodiumPrivkey())}static async verifySignature(t,n,r){return await Pe.default.ready,Pe.default.crypto_sign_verify_detached(t,n,r)}}ge.Ed25519=Wu;ge.xchacha20NonceLength=24;class Ju{static async encrypt(t,n,r){return await Pe.default.ready,Pe.default.crypto_aead_xchacha20poly1305_ietf_encrypt(t,null,null,r,n)}static async decrypt(t,n,r){return await Pe.default.ready,Pe.default.crypto_aead_xchacha20poly1305_ietf_decrypt(null,t,null,r,n)}}ge.Xchacha20poly1305Ietf=Ju;var qr={};Object.defineProperty(qr,"__esModule",{value:!0});qr.Random=void 0;class Lu{static getBytes(t){try{const n=typeof window=="object"?window:self,r=typeof n.crypto<"u"?n.crypto:n.msCrypto,o=new Uint8Array(t);return r.getRandomValues(o),o}catch{try{const n=l.requireCryptoBrowserify();return new Uint8Array([...n.randomBytes(t)])}catch{throw new Error("No secure random number generator found")}}}}qr.Random=Lu;var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.ripemd160=Qt.Ripemd160=void 0;const zu=p.require$$0$2,Ku=bn;class sa{constructor(t){this.blockSize=512/8,this.impl=zu.ripemd160.create(),t&&this.update(t)}update(t){return this.impl.update((0,Ku.toRealUint8Array)(t)),this}digest(){return this.impl.digest()}}Qt.Ripemd160=sa;function Qu(e){return new sa(e).digest()}Qt.ripemd160=Qu;var Hr={},jt={};Object.defineProperty(jt,"__esModule",{value:!0});jt.ExtendedSecp256k1Signature=jt.Secp256k1Signature=void 0;function Ut(e){let t=0;for(const n of e)if(n===0)t++;else break;return e.slice(t)}const or=2;class Un{static fromFixedLength(t){if(t.length!==64)throw new Error(`Got invalid data length: ${t.length}. Expected 2x 32 bytes for the pair (r, s)`);return new Un(Ut(t.slice(0,32)),Ut(t.slice(32,64)))}static fromDer(t){let n=0;if(t[n++]!==48)throw new Error("Prefix 0x30 expected");const r=t[n++];if(t.length-n!==r)throw new Error("Data length mismatch detected");if(t[n++]!==or)throw new Error("INTEGER tag expected");const s=t[n++];if(s>=128)throw new Error("Decoding length values above 127 not supported");const i=t.slice(n,n+s);if(n+=s,t[n++]!==or)throw new Error("INTEGER tag expected");const a=t[n++];if(a>=128)throw new Error("Decoding length values above 127 not supported");const u=t.slice(n,n+a);return n+=a,new Un(Ut(i),Ut(u))}constructor(t,n){if(t.length>32||t.length===0||t[0]===0)throw new Error("Unsigned integer r must be encoded as unpadded big endian.");if(n.length>32||n.length===0||n[0]===0)throw new Error("Unsigned integer s must be encoded as unpadded big endian.");this.data={r:t,s:n}}r(t){if(t===void 0)return this.data.r;{const n=t-this.data.r.length;if(n<0)throw new Error("Length too small to hold parameter r");const r=new Uint8Array(n);return new Uint8Array([...r,...this.data.r])}}s(t){if(t===void 0)return this.data.s;{const n=t-this.data.s.length;if(n<0)throw new Error("Length too small to hold parameter s");const r=new Uint8Array(n);return new Uint8Array([...r,...this.data.s])}}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32)])}toDer(){const t=this.data.r[0]>=128?new Uint8Array([0,...this.data.r]):this.data.r,n=this.data.s[0]>=128?new Uint8Array([0,...this.data.s]):this.data.s,r=t.length,o=n.length,s=new Uint8Array([or,r,...t,or,o,...n]);return new Uint8Array([48,s.length,...s])}}jt.Secp256k1Signature=Un;class js extends Un{static fromFixedLength(t){if(t.length!==65)throw new Error(`Got invalid data length ${t.length}. Expected 32 + 32 + 1`);return new js(Ut(t.slice(0,32)),Ut(t.slice(32,64)),t[64])}constructor(t,n,r){if(super(t,n),!Number.isInteger(r))throw new Error("The recovery parameter must be an integer.");if(r<0||r>4)throw new Error("The recovery parameter must be one of 0, 1, 2, 3.");this.recovery=r}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32),this.recovery])}}jt.ExtendedSecp256k1Signature=js;var ia=l.commonjsGlobal&&l.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.Secp256k1=void 0;const sr=D,aa=ia(l.bnExports),Zu=ia(l.requireElliptic()),Xu=jt,wt=new Zu.default.ec("secp256k1"),Yu=new aa.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex");class el{static async makeKeypair(t){if(t.length!==32)throw new Error("input data is not a valid secp256k1 private key");const n=wt.keyFromPrivate(t);if(n.validate().result!==!0)throw new Error("input data is not a valid secp256k1 private key");if(new aa.default(t).gte(Yu))throw new Error("input data is not a valid secp256k1 private key");return{privkey:(0,sr.fromHex)(n.getPrivate("hex")),pubkey:Uint8Array.from(n.getPublic("array"))}}static async createSignature(t,n){if(t.length===0)throw new Error("Message hash must not be empty");if(t.length>32)throw new Error("Message hash length must not exceed 32 bytes");const r=wt.keyFromPrivate(n),{r:o,s,recoveryParam:i}=r.sign(t,{canonical:!0});if(typeof i!="number")throw new Error("Recovery param missing");return new Xu.ExtendedSecp256k1Signature(Uint8Array.from(o.toArray()),Uint8Array.from(s.toArray()),i)}static async verifySignature(t,n,r){if(n.length===0)throw new Error("Message hash must not be empty");if(n.length>32)throw new Error("Message hash length must not exceed 32 bytes");const o=wt.keyFromPublic(r);try{return o.verify(n,t.toDer())}catch{return!1}}static recoverPubkey(t,n){const r={r:(0,sr.toHex)(t.r()),s:(0,sr.toHex)(t.s())},o=wt.recoverPubKey(n,r,t.recovery),s=wt.keyFromPublic(o);return(0,sr.fromHex)(s.getPublic(!1,"hex"))}static compressPubkey(t){switch(t.length){case 33:return t;case 65:return Uint8Array.from(wt.keyFromPublic(t).getPublic(!0,"array"));default:throw new Error("Invalid pubkey length")}}static uncompressPubkey(t){switch(t.length){case 33:return Uint8Array.from(wt.keyFromPublic(t).getPublic(!1,"array"));case 65:return t;default:throw new Error("Invalid pubkey length")}}static trimRecoveryByte(t){switch(t.length){case 64:return t;case 65:return t.slice(0,64);default:throw new Error("Invalid signature length")}}}Hr.Secp256k1=el;var ca={};(function(e){var t=l.commonjsGlobal&&l.commonjsGlobal.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.stringToPath=e.pathToString=e.Slip10=e.Slip10RawIndex=e.slip10CurveFromString=e.Slip10Curve=void 0;const n=D,r=te,o=t(l.bnExports),s=t(l.requireElliptic()),i=Wn,c=xe;var a;(function(b){b.Secp256k1="Bitcoin seed",b.Ed25519="ed25519 seed"})(a=e.Slip10Curve||(e.Slip10Curve={}));function u(b){switch(b){case a.Ed25519:return a.Ed25519;case a.Secp256k1:return a.Secp256k1;default:throw new Error(`Unknown curve string: '${b}'`)}}e.slip10CurveFromString=u;class d extends r.Uint32{static hardened(g){return new d(g+2**31)}static normal(g){return new d(g)}isHardened(){return this.data>=2**31}}e.Slip10RawIndex=d;const y=new s.default.ec("secp256k1");class M{static derivePath(g,w,q){let x=this.master(g,w);for(const ue of q)x=this.child(g,x.privkey,x.chainCode,ue);return x}static master(g,w){const q=new i.Hmac(c.Sha512,(0,n.toAscii)(g)).update(w).digest(),x=q.slice(0,32),ue=q.slice(32,64);return g!==a.Ed25519&&(this.isZero(x)||this.isGteN(g,x))?this.master(g,q):{chainCode:ue,privkey:x}}static child(g,w,q,x){let ue;if(x.isHardened()){const v=new Uint8Array([0,...w,...x.toBytesBigEndian()]);ue=new i.Hmac(c.Sha512,q).update(v).digest()}else{if(g===a.Ed25519)throw new Error("Normal keys are not allowed with ed25519");{const v=new Uint8Array([...M.serializedPoint(g,new o.default(w)),...x.toBytesBigEndian()]);ue=new i.Hmac(c.Sha512,q).update(v).digest()}}return this.childImpl(g,w,q,x,ue)}static serializedPoint(g,w){switch(g){case a.Secp256k1:return(0,n.fromHex)(y.g.mul(w).encodeCompressed("hex"));default:throw new Error("curve not supported")}}static childImpl(g,w,q,x,ue){const v=ue.slice(0,32),S=ue.slice(32,64),k=S;if(g===a.Ed25519)return{chainCode:k,privkey:v};const U=this.n(g),H=new o.default(v).add(new o.default(w)).mod(U),V=Uint8Array.from(H.toArray("be",32));if(this.isGteN(g,v)||this.isZero(V)){const F=new i.Hmac(c.Sha512,q).update(new Uint8Array([1,...S,...x.toBytesBigEndian()])).digest();return this.childImpl(g,w,q,x,F)}return{chainCode:k,privkey:V}}static isZero(g){return g.every(w=>w===0)}static isGteN(g,w){return new o.default(w).gte(this.n(g))}static n(g){switch(g){case a.Secp256k1:return new o.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",16);default:throw new Error("curve not supported")}}}e.Slip10=M;function _(b){return b.reduce((g,w)=>{const q=w.isHardened()?`${w.toNumber()-2147483648}'`:w.toString();return g+"/"+q},"m")}e.pathToString=_;function G(b){if(!b.startsWith("m"))throw new Error("Path string must start with 'm'");let g=b.slice(1);const w=new Array;for(;g;){const q=g.match(/^\/([0-9]+)('?)/);if(!q)throw new Error("Syntax error while reading path component");const[x,ue,v]=q,S=r.Uint53.fromString(ue).toNumber();if(S>=2**31)throw new Error("Component value too high. Must not exceed 2**31-1.");v?w.push(d.hardened(S)):w.push(d.normal(S)),g=g.slice(x.length)}return w}e.stringToPath=G})(ca);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.stringToPath=e.Slip10RawIndex=e.slip10CurveFromString=e.Slip10Curve=e.Slip10=e.pathToString=e.sha512=e.Sha512=e.sha256=e.Sha256=e.Secp256k1Signature=e.ExtendedSecp256k1Signature=e.Secp256k1=e.ripemd160=e.Ripemd160=e.Random=e.Xchacha20poly1305Ietf=e.xchacha20NonceLength=e.isArgon2idOptions=e.Ed25519Keypair=e.Ed25519=e.Argon2id=e.keccak256=e.Keccak256=e.Hmac=e.EnglishMnemonic=e.Bip39=void 0;var t=Le;Object.defineProperty(e,"Bip39",{enumerable:!0,get:function(){return t.Bip39}}),Object.defineProperty(e,"EnglishMnemonic",{enumerable:!0,get:function(){return t.EnglishMnemonic}});var n=Wn;Object.defineProperty(e,"Hmac",{enumerable:!0,get:function(){return n.Hmac}});var r=Kt;Object.defineProperty(e,"Keccak256",{enumerable:!0,get:function(){return r.Keccak256}}),Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return r.keccak256}});var o=ge;Object.defineProperty(e,"Argon2id",{enumerable:!0,get:function(){return o.Argon2id}}),Object.defineProperty(e,"Ed25519",{enumerable:!0,get:function(){return o.Ed25519}}),Object.defineProperty(e,"Ed25519Keypair",{enumerable:!0,get:function(){return o.Ed25519Keypair}}),Object.defineProperty(e,"isArgon2idOptions",{enumerable:!0,get:function(){return o.isArgon2idOptions}}),Object.defineProperty(e,"xchacha20NonceLength",{enumerable:!0,get:function(){return o.xchacha20NonceLength}}),Object.defineProperty(e,"Xchacha20poly1305Ietf",{enumerable:!0,get:function(){return o.Xchacha20poly1305Ietf}});var s=qr;Object.defineProperty(e,"Random",{enumerable:!0,get:function(){return s.Random}});var i=Qt;Object.defineProperty(e,"Ripemd160",{enumerable:!0,get:function(){return i.Ripemd160}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return i.ripemd160}});var c=Hr;Object.defineProperty(e,"Secp256k1",{enumerable:!0,get:function(){return c.Secp256k1}});var a=jt;Object.defineProperty(e,"ExtendedSecp256k1Signature",{enumerable:!0,get:function(){return a.ExtendedSecp256k1Signature}}),Object.defineProperty(e,"Secp256k1Signature",{enumerable:!0,get:function(){return a.Secp256k1Signature}});var u=xe;Object.defineProperty(e,"Sha256",{enumerable:!0,get:function(){return u.Sha256}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return u.sha256}}),Object.defineProperty(e,"Sha512",{enumerable:!0,get:function(){return u.Sha512}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return u.sha512}});var d=ca;Object.defineProperty(e,"pathToString",{enumerable:!0,get:function(){return d.pathToString}}),Object.defineProperty(e,"Slip10",{enumerable:!0,get:function(){return d.Slip10}}),Object.defineProperty(e,"Slip10Curve",{enumerable:!0,get:function(){return d.Slip10Curve}}),Object.defineProperty(e,"slip10CurveFromString",{enumerable:!0,get:function(){return d.slip10CurveFromString}}),Object.defineProperty(e,"Slip10RawIndex",{enumerable:!0,get:function(){return d.Slip10RawIndex}}),Object.defineProperty(e,"stringToPath",{enumerable:!0,get:function(){return d.stringToPath}})})(_e);var ie={},Jn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isMultisigThresholdPubkey=e.isSinglePubkey=e.pubkeyType=e.isSecp256k1Pubkey=e.isEd25519Pubkey=void 0;function t(s){return s.type==="tendermint/PubKeyEd25519"}e.isEd25519Pubkey=t;function n(s){return s.type==="tendermint/PubKeySecp256k1"}e.isSecp256k1Pubkey=n,e.pubkeyType={secp256k1:"tendermint/PubKeySecp256k1",ed25519:"tendermint/PubKeyEd25519",sr25519:"tendermint/PubKeySr25519",multisigThreshold:"tendermint/PubKeyMultisigThreshold"};function r(s){return[e.pubkeyType.ed25519,e.pubkeyType.secp256k1,e.pubkeyType.sr25519].includes(s.type)}e.isSinglePubkey=r;function o(s){return s.type==="tendermint/PubKeyMultisigThreshold"}e.isMultisigThresholdPubkey=o})(Jn);Object.defineProperty(ie,"__esModule",{value:!0});ie.encodeBech32Pubkey=ie.encodeAminoPubkey=ie.decodeBech32Pubkey=ie.decodeAminoPubkey=ie.encodeEd25519Pubkey=ie.encodeSecp256k1Pubkey=void 0;const be=D,tl=te,Rn=X,nt=Jn;function nl(e){if(e.length!==33||e[0]!==2&&e[0]!==3)throw new Error("Public key must be compressed secp256k1, i.e. 33 bytes starting with 0x02 or 0x03");return{type:nt.pubkeyType.secp256k1,value:(0,be.toBase64)(e)}}ie.encodeSecp256k1Pubkey=nl;function rl(e){if(e.length!==32)throw new Error("Ed25519 public key must be 32 bytes long");return{type:nt.pubkeyType.ed25519,value:(0,be.toBase64)(e)}}ie.encodeEd25519Pubkey=rl;const is=(0,be.fromHex)("eb5ae98721"),as=(0,be.fromHex)("1624de6420"),ai=(0,be.fromHex)("0dfb100520"),Tr=(0,be.fromHex)("22c1f7e2");function Ms(e){if((0,Rn.arrayContentStartsWith)(e,is)){const t=e.slice(is.length);if(t.length!==33)throw new Error("Invalid rest data length. Expected 33 bytes (compressed secp256k1 pubkey).");return{type:nt.pubkeyType.secp256k1,value:(0,be.toBase64)(t)}}else if((0,Rn.arrayContentStartsWith)(e,as)){const t=e.slice(as.length);if(t.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Ed25519 pubkey).");return{type:nt.pubkeyType.ed25519,value:(0,be.toBase64)(t)}}else if((0,Rn.arrayContentStartsWith)(e,ai)){const t=e.slice(ai.length);if(t.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Sr25519 pubkey).");return{type:nt.pubkeyType.sr25519,value:(0,be.toBase64)(t)}}else{if((0,Rn.arrayContentStartsWith)(e,Tr))return sl(e);throw new Error("Unsupported public key type. Amino data starts with: "+(0,be.toHex)(e.slice(0,5)))}}ie.decodeAminoPubkey=Ms;function ol(e){const{data:t}=(0,be.fromBech32)(e);return Ms(t)}ie.decodeBech32Pubkey=ol;function ci(e){if(e.length<1)throw new Error("Can't decode varint. EOF");if(e[0]>127)throw new Error("Decoding numbers > 127 is not supported here. Please tell those lazy CosmJS maintainers to port the binary.Varint implementation from the Go standard library and write some tests.");return[e[0],1]}function sl(e){const t=Array.from(e),n=t.splice(0,Tr.length);if(!(0,Rn.arrayContentStartsWith)(n,Tr))throw new Error("Invalid multisig prefix.");if(t.shift()!=8)throw new Error("Invalid multisig data. Expecting 0x08 prefix before threshold.");const[r,o]=ci(t);t.splice(0,o);const s=[];for(;t.length>0;){if(t.shift()!=18)throw new Error("Invalid multisig data. Expecting 0x12 prefix before participant pubkey length.");const[i,c]=ci(t);if(t.splice(0,c),t.length<i)throw new Error("Invalid multisig data length.");const a=t.splice(0,i),u=Ms(Uint8Array.from(a));s.push(u)}return{type:nt.pubkeyType.multisigThreshold,value:{threshold:r.toString(),pubkeys:s}}}function ui(e){const t=tl.Uint53.fromString(e.toString()).toNumber();if(t>127)throw new Error("Encoding numbers > 127 is not supported here. Please tell those lazy CosmJS maintainers to port the binary.PutUvarint implementation from the Go standard library and write some tests.");return[t]}function Os(e){if((0,nt.isMultisigThresholdPubkey)(e)){const t=Array.from(Tr);t.push(8),t.push(...ui(e.value.threshold));for(const n of e.value.pubkeys.map(r=>Os(r)))t.push(18),t.push(...ui(n.length)),t.push(...n);return new Uint8Array(t)}else{if((0,nt.isEd25519Pubkey)(e))return new Uint8Array([...as,...(0,be.fromBase64)(e.value)]);if((0,nt.isSecp256k1Pubkey)(e))return new Uint8Array([...is,...(0,be.fromBase64)(e.value)]);throw new Error("Unsupported pubkey type")}}ie.encodeAminoPubkey=Os;function il(e,t){return(0,be.toBech32)(t,Os(e))}ie.encodeBech32Pubkey=il;Object.defineProperty(Ae,"__esModule",{value:!0});Ae.pubkeyToAddress=Ae.pubkeyToRawAddress=Ae.rawSecp256k1PubkeyToRawAddress=Ae.rawEd25519PubkeyToRawAddress=void 0;const Er=_e,cs=D,al=ie,Jo=Jn;function ua(e){if(e.length!==32)throw new Error(`Invalid Ed25519 pubkey length: ${e.length}`);return(0,Er.sha256)(e).slice(0,20)}Ae.rawEd25519PubkeyToRawAddress=ua;function la(e){if(e.length!==33)throw new Error(`Invalid Secp256k1 pubkey length (compressed): ${e.length}`);return(0,Er.ripemd160)((0,Er.sha256)(e))}Ae.rawSecp256k1PubkeyToRawAddress=la;function da(e){if((0,Jo.isSecp256k1Pubkey)(e)){const t=(0,cs.fromBase64)(e.value);return la(t)}else if((0,Jo.isEd25519Pubkey)(e)){const t=(0,cs.fromBase64)(e.value);return ua(t)}else if((0,Jo.isMultisigThresholdPubkey)(e)){const t=(0,al.encodeAminoPubkey)(e);return(0,Er.sha256)(t).slice(0,20)}else throw new Error("Unsupported public key type")}Ae.pubkeyToRawAddress=da;function cl(e,t){return(0,cs.toBech32)(t,da(e))}Ae.pubkeyToAddress=cl;var ze={};Object.defineProperty(ze,"__esModule",{value:!0});ze.addCoins=ze.parseCoins=ze.coins=ze.coin=void 0;const us=te;function ma(e,t){let n;if(typeof e=="number")try{n=new us.Uint53(e).toString()}catch{throw new Error("Given amount is not a safe integer. Consider using a string instead to overcome the limitations of JS numbers.")}else{if(!e.match(/^[0-9]+$/))throw new Error("Invalid unsigned integer string format");n=e.replace(/^0*/,"")||"0"}return{amount:n,denom:t}}ze.coin=ma;function ul(e,t){return[ma(e,t)]}ze.coins=ul;function ll(e){return e.replace(/\s/g,"").split(",").filter(Boolean).map(t=>{const n=t.match(/^([0-9]+)([a-zA-Z][a-zA-Z0-9/]{2,127})$/);if(!n)throw new Error("Got an invalid coin string");return{amount:n[1].replace(/^0+/,"")||"0",denom:n[2]}})}ze.parseCoins=ll;function dl(e,t){if(e.denom!==t.denom)throw new Error("Trying to add two coins with different denoms");return{amount:us.Decimal.fromAtomics(e.amount,0).plus(us.Decimal.fromAtomics(t.amount,0)).atomics,denom:e.denom}}ze.addCoins=dl;var Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.createMultisigThresholdPubkey=Zt.compareArrays=void 0;const li=D,ml=te,di=Ae;function fa(e,t){const n=(0,li.toHex)(e),r=(0,li.toHex)(t);return n===r?0:n<r?-1:1}Zt.compareArrays=fa;function fl(e,t,n=!1){const r=new ml.Uint53(t);if(r.toNumber()>e.length)throw new Error(`Threshold k = ${r.toNumber()} exceeds number of keys n = ${e.length}`);const o=n?e:Array.from(e).sort((s,i)=>{const c=(0,di.pubkeyToRawAddress)(s),a=(0,di.pubkeyToRawAddress)(i);return fa(c,a)});return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:r.toString(),pubkeys:o}}}Zt.createMultisigThresholdPubkey=fl;var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.omitDefault=void 0;function hl(e){switch(typeof e){case"string":return e===""?void 0:e;case"number":return e===0?void 0:e;case"bigint":return e===BigInt(0)?void 0:e;case"boolean":return e||void 0;default:throw new Error(`Got unsupported type '${typeof e}'`)}}Vr.omitDefault=hl;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.makeCosmoshubPath=void 0;const kn=_e;function pl(e){return[kn.Slip10RawIndex.hardened(44),kn.Slip10RawIndex.hardened(118),kn.Slip10RawIndex.hardened(0),kn.Slip10RawIndex.normal(0),kn.Slip10RawIndex.normal(e)]}Ln.makeCosmoshubPath=pl;var Xt={},bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.decodeSignature=bt.encodeSecp256k1Signature=void 0;const ls=D,gl=ie,yl=Jn;function bl(e,t){if(t.length!==64)throw new Error("Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s.");return{pub_key:(0,gl.encodeSecp256k1Pubkey)(e),signature:(0,ls.toBase64)(t)}}bt.encodeSecp256k1Signature=bl;function vl(e){switch(e.pub_key.type){case yl.pubkeyType.secp256k1:return{pubkey:(0,ls.fromBase64)(e.pub_key.value),signature:(0,ls.fromBase64)(e.signature)};default:throw new Error("Unsupported pubkey type")}}bt.decodeSignature=vl;var Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.serializeSignDoc=Ue.escapeCharacters=Ue.makeSignDoc=Ue.sortedJsonStringify=void 0;const wl=D,mi=te;function ds(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(ds);const t=Object.keys(e).sort(),n={};return t.forEach(r=>{n[r]=ds(e[r])}),n}function ha(e){return JSON.stringify(ds(e))}Ue.sortedJsonStringify=ha;function kl(e,t,n,r,o,s,i){return{chain_id:n,account_number:mi.Uint53.fromString(o.toString()).toString(),sequence:mi.Uint53.fromString(s.toString()).toString(),fee:t,msgs:e,memo:r||"",...i&&{timeout_height:i.toString()}}}Ue.makeSignDoc=kl;function pa(e){const t=/&/g,n=/</g,r=/>/g;return e.replace(t,"\\u0026").replace(n,"\\u003c").replace(r,"\\u003e")}Ue.escapeCharacters=pa;function _l(e){const t=pa(ha(e));return(0,wl.toUtf8)(t)}Ue.serializeSignDoc=_l;var Bs={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const t=_e,n=D;e.cosmjsSalt=(0,n.toAscii)("The CosmJS salt.");async function r(i,c){switch(c.algorithm){case"argon2id":{const a=c.params;if(!(0,t.isArgon2idOptions)(a))throw new Error("Invalid format of argon2id params");return t.Argon2id.execute(i,e.cosmjsSalt,a)}default:throw new Error("Unsupported KDF algorithm")}}e.executeKdf=r,e.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"};async function o(i,c,a){switch(a.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const u=t.Random.getBytes(t.xchacha20NonceLength);return new Uint8Array([...u,...await t.Xchacha20poly1305Ietf.encrypt(i,c,u)])}default:throw new Error(`Unsupported encryption algorithm: '${a.algorithm}'`)}}e.encrypt=o;async function s(i,c,a){switch(a.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const u=i.slice(0,t.xchacha20NonceLength);return t.Xchacha20poly1305Ietf.decrypt(i.slice(t.xchacha20NonceLength),c,u)}default:throw new Error(`Unsupported encryption algorithm: '${a.algorithm}'`)}}e.decrypt=s})(Bs);Object.defineProperty(Xt,"__esModule",{value:!0});Xt.Secp256k1HdWallet=Xt.extractKdfConfiguration=void 0;const Ee=_e,_n=D,qt=X,Sl=Ae,Pl=Ln,Al=bt,Tl=Ue,Sn=Bs,Sr="secp256k1wallet-v1",El={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function Cl(e){return!(!(0,qt.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function jl(e){return e.kdf}function Ml(e){const t=JSON.parse(e);if(!(0,qt.isNonNullObject)(t))throw new Error("Root document is not an object.");switch(t.type){case Sr:return jl(t);default:throw new Error("Unsupported serialization type")}}Xt.extractKdfConfiguration=Ml;const fi={bip39Password:"",hdPaths:[(0,Pl.makeCosmoshubPath)(0)],prefix:"cosmos"};class Pt{static async fromMnemonic(t,n={}){const r=new Ee.EnglishMnemonic(t),o=await Ee.Bip39.mnemonicToSeed(r,n.bip39Password);return new Pt(r,{...n,seed:o})}static async generate(t=12,n={}){const r=4*Math.floor(11*t/33),o=Ee.Random.getBytes(r),s=Ee.Bip39.encode(o);return Pt.fromMnemonic(s.toString(),n)}static async deserialize(t,n){const r=JSON.parse(t);if(!(0,qt.isNonNullObject)(r))throw new Error("Root document is not an object.");switch(r.type){case Sr:return Pt.deserializeTypeV1(t,n);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(t,n){const r=JSON.parse(t);if(!(0,qt.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=r;switch(o.type){case Sr:{const s=await(0,Sn.decrypt)((0,_n.fromBase64)(o.data),n,o.encryption),i=JSON.parse((0,_n.fromUtf8)(s)),{mnemonic:c,accounts:a}=i;if((0,qt.assert)(typeof c=="string"),!Array.isArray(a))throw new Error("Property 'accounts' is not an array");if(!a.every(y=>Cl(y)))throw new Error("Account is not in the correct format.");const u=a[0].prefix;if(!a.every(({prefix:y})=>y===u))throw new Error("Accounts do not all have the same prefix");const d=a.map(({hdPath:y})=>(0,Ee.stringToPath)(y));return Pt.fromMnemonic(c,{hdPaths:d,prefix:u})}default:throw new Error("Unsupported serialization type")}}static async deserializeTypeV1(t,n){const r=JSON.parse(t);if(!(0,qt.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=await(0,Sn.executeKdf)(n,r.kdf);return Pt.deserializeWithEncryptionKey(t,o)}constructor(t,n){const r=n.hdPaths??fi.hdPaths,o=n.prefix??fi.prefix;this.secret=t,this.seed=n.seed,this.accounts=r.map(s=>({hdPath:s,prefix:o}))}get mnemonic(){return this.secret.toString()}async getAccounts(){return(await this.getAccountsWithPrivkeys()).map(({algo:n,pubkey:r,address:o})=>({algo:n,pubkey:r,address:o}))}async signAmino(t,n){const o=(await this.getAccountsWithPrivkeys()).find(({address:d})=>d===t);if(o===void 0)throw new Error(`Address ${t} not found in wallet`);const{privkey:s,pubkey:i}=o,c=(0,Ee.sha256)((0,Tl.serializeSignDoc)(n)),a=await Ee.Secp256k1.createSignature(c,s),u=new Uint8Array([...a.r(32),...a.s(32)]);return{signed:n,signature:(0,Al.encodeSecp256k1Signature)(i,u)}}async serialize(t){const n=El,r=await(0,Sn.executeKdf)(t,n);return this.serializeWithEncryptionKey(r,n)}async serializeWithEncryptionKey(t,n){const r={mnemonic:this.mnemonic,accounts:this.accounts.map(({hdPath:a,prefix:u})=>({hdPath:(0,Ee.pathToString)(a),prefix:u}))},o=(0,_n.toUtf8)(JSON.stringify(r)),s={algorithm:Sn.supportedAlgorithms.xchacha20poly1305Ietf},i=await(0,Sn.encrypt)(o,t,s),c={type:Sr,kdf:n,encryption:s,data:(0,_n.toBase64)(i)};return JSON.stringify(c)}async getKeyPair(t){const{privkey:n}=Ee.Slip10.derivePath(Ee.Slip10Curve.Secp256k1,this.seed,t),{pubkey:r}=await Ee.Secp256k1.makeKeypair(n);return{privkey:n,pubkey:Ee.Secp256k1.compressPubkey(r)}}async getAccountsWithPrivkeys(){return Promise.all(this.accounts.map(async({hdPath:t,prefix:n})=>{const{privkey:r,pubkey:o}=await this.getKeyPair(t),s=(0,_n.toBech32)(n,(0,Sl.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:r,pubkey:o,address:s}}))}}Xt.Secp256k1HdWallet=Pt;var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.Secp256k1Wallet=void 0;const ir=_e,Ol=D,Bl=Ae,Rl=bt,Il=Ue;class Rs{static async fromKey(t,n="cosmos"){const r=(await ir.Secp256k1.makeKeypair(t)).pubkey;return new Rs(t,ir.Secp256k1.compressPubkey(r),n)}constructor(t,n,r){this.privkey=t,this.pubkey=n,this.prefix=r}get address(){return(0,Ol.toBech32)(this.prefix,(0,Bl.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signAmino(t,n){if(t!==this.address)throw new Error(`Address ${t} not found in wallet`);const r=new ir.Sha256((0,Il.serializeSignDoc)(n)).digest(),o=await ir.Secp256k1.createSignature(r,this.privkey),s=new Uint8Array([...o.r(32),...o.s(32)]);return{signed:n,signature:(0,Rl.encodeSecp256k1Signature)(this.pubkey,s)}}}Gr.Secp256k1Wallet=Rs;var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.makeStdTx=Yt.isStdTx=void 0;function $l(e){const{memo:t,msg:n,fee:r,signatures:o}=e;return typeof t=="string"&&Array.isArray(n)&&typeof r=="object"&&Array.isArray(o)}Yt.isStdTx=$l;function Nl(e,t){return{msg:e.msgs,fee:e.fee,memo:e.memo,signatures:Array.isArray(t)?t:[t]}}Yt.makeStdTx=Nl;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.executeKdf=e.makeStdTx=e.isStdTx=e.serializeSignDoc=e.makeSignDoc=e.encodeSecp256k1Signature=e.decodeSignature=e.Secp256k1Wallet=e.Secp256k1HdWallet=e.extractKdfConfiguration=e.pubkeyType=e.isSinglePubkey=e.isSecp256k1Pubkey=e.isMultisigThresholdPubkey=e.isEd25519Pubkey=e.makeCosmoshubPath=e.omitDefault=e.createMultisigThresholdPubkey=e.encodeSecp256k1Pubkey=e.encodeEd25519Pubkey=e.encodeBech32Pubkey=e.encodeAminoPubkey=e.decodeBech32Pubkey=e.decodeAminoPubkey=e.parseCoins=e.coins=e.coin=e.addCoins=e.rawSecp256k1PubkeyToRawAddress=e.rawEd25519PubkeyToRawAddress=e.pubkeyToRawAddress=e.pubkeyToAddress=void 0;var t=Ae;Object.defineProperty(e,"pubkeyToAddress",{enumerable:!0,get:function(){return t.pubkeyToAddress}}),Object.defineProperty(e,"pubkeyToRawAddress",{enumerable:!0,get:function(){return t.pubkeyToRawAddress}}),Object.defineProperty(e,"rawEd25519PubkeyToRawAddress",{enumerable:!0,get:function(){return t.rawEd25519PubkeyToRawAddress}}),Object.defineProperty(e,"rawSecp256k1PubkeyToRawAddress",{enumerable:!0,get:function(){return t.rawSecp256k1PubkeyToRawAddress}});var n=ze;Object.defineProperty(e,"addCoins",{enumerable:!0,get:function(){return n.addCoins}}),Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return n.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return n.coins}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return n.parseCoins}});var r=ie;Object.defineProperty(e,"decodeAminoPubkey",{enumerable:!0,get:function(){return r.decodeAminoPubkey}}),Object.defineProperty(e,"decodeBech32Pubkey",{enumerable:!0,get:function(){return r.decodeBech32Pubkey}}),Object.defineProperty(e,"encodeAminoPubkey",{enumerable:!0,get:function(){return r.encodeAminoPubkey}}),Object.defineProperty(e,"encodeBech32Pubkey",{enumerable:!0,get:function(){return r.encodeBech32Pubkey}}),Object.defineProperty(e,"encodeEd25519Pubkey",{enumerable:!0,get:function(){return r.encodeEd25519Pubkey}}),Object.defineProperty(e,"encodeSecp256k1Pubkey",{enumerable:!0,get:function(){return r.encodeSecp256k1Pubkey}});var o=Zt;Object.defineProperty(e,"createMultisigThresholdPubkey",{enumerable:!0,get:function(){return o.createMultisigThresholdPubkey}});var s=Vr;Object.defineProperty(e,"omitDefault",{enumerable:!0,get:function(){return s.omitDefault}});var i=Ln;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return i.makeCosmoshubPath}});var c=Jn;Object.defineProperty(e,"isEd25519Pubkey",{enumerable:!0,get:function(){return c.isEd25519Pubkey}}),Object.defineProperty(e,"isMultisigThresholdPubkey",{enumerable:!0,get:function(){return c.isMultisigThresholdPubkey}}),Object.defineProperty(e,"isSecp256k1Pubkey",{enumerable:!0,get:function(){return c.isSecp256k1Pubkey}}),Object.defineProperty(e,"isSinglePubkey",{enumerable:!0,get:function(){return c.isSinglePubkey}}),Object.defineProperty(e,"pubkeyType",{enumerable:!0,get:function(){return c.pubkeyType}});var a=Xt;Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return a.extractKdfConfiguration}}),Object.defineProperty(e,"Secp256k1HdWallet",{enumerable:!0,get:function(){return a.Secp256k1HdWallet}});var u=Gr;Object.defineProperty(e,"Secp256k1Wallet",{enumerable:!0,get:function(){return u.Secp256k1Wallet}});var d=bt;Object.defineProperty(e,"decodeSignature",{enumerable:!0,get:function(){return d.decodeSignature}}),Object.defineProperty(e,"encodeSecp256k1Signature",{enumerable:!0,get:function(){return d.encodeSecp256k1Signature}});var y=Ue;Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return y.makeSignDoc}}),Object.defineProperty(e,"serializeSignDoc",{enumerable:!0,get:function(){return y.serializeSignDoc}});var M=Yt;Object.defineProperty(e,"isStdTx",{enumerable:!0,get:function(){return M.isStdTx}}),Object.defineProperty(e,"makeStdTx",{enumerable:!0,get:function(){return M.makeStdTx}});var _=Bs;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return _.executeKdf}})})(st);var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.makeSignBytes=Ye.makeSignDoc=Ye.makeAuthInfoBytes=void 0;const hi=X,Dl=p.signing,Cr=p.tx;function xl(e,t){return e.map(({pubkey:n,sequence:r})=>({publicKey:n,modeInfo:{single:{mode:t}},sequence:BigInt(r)}))}function Ul(e,t,n,r,o,s=Dl.SignMode.SIGN_MODE_DIRECT){(0,hi.assert)(r===void 0||typeof r=="string","feeGranter must be undefined or string"),(0,hi.assert)(o===void 0||typeof o=="string","feePayer must be undefined or string");const i=Cr.AuthInfo.fromPartial({signerInfos:xl(e,s),fee:{amount:[...t],gasLimit:BigInt(n),granter:r,payer:o}});return Cr.AuthInfo.encode(i).finish()}Ye.makeAuthInfoBytes=Ul;function ql(e,t,n,r){return{bodyBytes:e,authInfoBytes:t,chainId:n,accountNumber:BigInt(r)}}Ye.makeSignDoc=ql;function Hl({accountNumber:e,authInfoBytes:t,bodyBytes:n,chainId:r}){const o=Cr.SignDoc.fromPartial({accountNumber:e,authInfoBytes:t,bodyBytes:n,chainId:r});return Cr.SignDoc.encode(o).finish()}Ye.makeSignBytes=Hl;var Is={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const t=_e,n=D;e.cosmjsSalt=(0,n.toAscii)("The CosmJS salt.");async function r(i,c){switch(c.algorithm){case"argon2id":{const a=c.params;if(!(0,t.isArgon2idOptions)(a))throw new Error("Invalid format of argon2id params");return t.Argon2id.execute(i,e.cosmjsSalt,a)}default:throw new Error("Unsupported KDF algorithm")}}e.executeKdf=r,e.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"};async function o(i,c,a){switch(a.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const u=t.Random.getBytes(t.xchacha20NonceLength);return new Uint8Array([...u,...await t.Xchacha20poly1305Ietf.encrypt(i,c,u)])}default:throw new Error(`Unsupported encryption algorithm: '${a.algorithm}'`)}}e.encrypt=o;async function s(i,c,a){switch(a.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const u=i.slice(0,t.xchacha20NonceLength);return t.Xchacha20poly1305Ietf.decrypt(i.slice(t.xchacha20NonceLength),c,u)}default:throw new Error(`Unsupported encryption algorithm: '${a.algorithm}'`)}}e.decrypt=s})(Is);Object.defineProperty(Vt,"__esModule",{value:!0});Vt.DirectSecp256k1HdWallet=Vt.extractKdfConfiguration=void 0;const ms=st,Ce=_e,Pn=D,Ht=X,Vl=Ye,An=Is,Pr="directsecp256k1hdwallet-v1",Gl={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function Fl(e){return!(!(0,Ht.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function Wl(e){return e.kdf}function Jl(e){const t=JSON.parse(e);if(!(0,Ht.isNonNullObject)(t))throw new Error("Root document is not an object.");switch(t.type){case Pr:return Wl(t);default:throw new Error("Unsupported serialization type")}}Vt.extractKdfConfiguration=Jl;const pi={bip39Password:"",hdPaths:[(0,ms.makeCosmoshubPath)(0)],prefix:"cosmos"};class At{static async fromMnemonic(t,n={}){const r=new Ce.EnglishMnemonic(t),o=await Ce.Bip39.mnemonicToSeed(r,n.bip39Password);return new At(r,{...n,seed:o})}static async generate(t=12,n={}){const r=4*Math.floor(11*t/33),o=Ce.Random.getBytes(r),s=Ce.Bip39.encode(o);return At.fromMnemonic(s.toString(),n)}static async deserialize(t,n){const r=JSON.parse(t);if(!(0,Ht.isNonNullObject)(r))throw new Error("Root document is not an object.");switch(r.type){case Pr:return At.deserializeTypeV1(t,n);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(t,n){const r=JSON.parse(t);if(!(0,Ht.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=r;switch(o.type){case Pr:{const s=await(0,An.decrypt)((0,Pn.fromBase64)(o.data),n,o.encryption),i=JSON.parse((0,Pn.fromUtf8)(s)),{mnemonic:c,accounts:a}=i;if((0,Ht.assert)(typeof c=="string"),!Array.isArray(a))throw new Error("Property 'accounts' is not an array");if(!a.every(y=>Fl(y)))throw new Error("Account is not in the correct format.");const u=a[0].prefix;if(!a.every(({prefix:y})=>y===u))throw new Error("Accounts do not all have the same prefix");const d=a.map(({hdPath:y})=>(0,Ce.stringToPath)(y));return At.fromMnemonic(c,{hdPaths:d,prefix:u})}default:throw new Error("Unsupported serialization type")}}static async deserializeTypeV1(t,n){const r=JSON.parse(t);if(!(0,Ht.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=await(0,An.executeKdf)(n,r.kdf);return At.deserializeWithEncryptionKey(t,o)}constructor(t,n){const r=n.prefix??pi.prefix,o=n.hdPaths??pi.hdPaths;this.secret=t,this.seed=n.seed,this.accounts=o.map(s=>({hdPath:s,prefix:r}))}get mnemonic(){return this.secret.toString()}async getAccounts(){return(await this.getAccountsWithPrivkeys()).map(({algo:n,pubkey:r,address:o})=>({algo:n,pubkey:r,address:o}))}async signDirect(t,n){const o=(await this.getAccountsWithPrivkeys()).find(({address:M})=>M===t);if(o===void 0)throw new Error(`Address ${t} not found in wallet`);const{privkey:s,pubkey:i}=o,c=(0,Vl.makeSignBytes)(n),a=(0,Ce.sha256)(c),u=await Ce.Secp256k1.createSignature(a,s),d=new Uint8Array([...u.r(32),...u.s(32)]),y=(0,ms.encodeSecp256k1Signature)(i,d);return{signed:n,signature:y}}async serialize(t){const n=Gl,r=await(0,An.executeKdf)(t,n);return this.serializeWithEncryptionKey(r,n)}async serializeWithEncryptionKey(t,n){const r={mnemonic:this.mnemonic,accounts:this.accounts.map(({hdPath:a,prefix:u})=>({hdPath:(0,Ce.pathToString)(a),prefix:u}))},o=(0,Pn.toUtf8)(JSON.stringify(r)),s={algorithm:An.supportedAlgorithms.xchacha20poly1305Ietf},i=await(0,An.encrypt)(o,t,s),c={type:Pr,kdf:n,encryption:s,data:(0,Pn.toBase64)(i)};return JSON.stringify(c)}async getKeyPair(t){const{privkey:n}=Ce.Slip10.derivePath(Ce.Slip10Curve.Secp256k1,this.seed,t),{pubkey:r}=await Ce.Secp256k1.makeKeypair(n);return{privkey:n,pubkey:Ce.Secp256k1.compressPubkey(r)}}async getAccountsWithPrivkeys(){return Promise.all(this.accounts.map(async({hdPath:t,prefix:n})=>{const{privkey:r,pubkey:o}=await this.getKeyPair(t),s=(0,Pn.toBech32)(n,(0,ms.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:r,pubkey:o,address:s}}))}}Vt.DirectSecp256k1HdWallet=At;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.DirectSecp256k1Wallet=void 0;const gi=st,ar=_e,Ll=D,zl=Ye;class $s{static async fromKey(t,n="cosmos"){const r=(await ar.Secp256k1.makeKeypair(t)).pubkey;return new $s(t,ar.Secp256k1.compressPubkey(r),n)}constructor(t,n,r){this.privkey=t,this.pubkey=n,this.prefix=r}get address(){return(0,Ll.toBech32)(this.prefix,(0,gi.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signDirect(t,n){const r=(0,zl.makeSignBytes)(n);if(t!==this.address)throw new Error(`Address ${t} not found in wallet`);const o=(0,ar.sha256)(r),s=await ar.Secp256k1.createSignature(o,this.privkey),i=new Uint8Array([...s.r(32),...s.s(32)]),c=(0,gi.encodeSecp256k1Signature)(this.pubkey,i);return{signed:n,signature:c}}}Fr.DirectSecp256k1Wallet=$s;var Wr={};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.makeCosmoshubPath=void 0;const Tn=_e;function Kl(e){return[Tn.Slip10RawIndex.hardened(44),Tn.Slip10RawIndex.hardened(118),Tn.Slip10RawIndex.hardened(0),Tn.Slip10RawIndex.normal(0),Tn.Slip10RawIndex.normal(e)]}Wr.makeCosmoshubPath=Kl;var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.decodeOptionalPubkey=Ke.decodePubkey=Ke.anyToSinglePubkey=Ke.encodePubkey=void 0;const Nn=st,yi=D,Ql=te,fs=p.keys,hs=p.keys$1,ps=p.keys$2,Lo=p.any;function ga(e){if((0,Nn.isSecp256k1Pubkey)(e)){const t=ps.PubKey.fromPartial({key:(0,yi.fromBase64)(e.value)});return Lo.Any.fromPartial({typeUrl:"/cosmos.crypto.secp256k1.PubKey",value:Uint8Array.from(ps.PubKey.encode(t).finish())})}else if((0,Nn.isEd25519Pubkey)(e)){const t=fs.PubKey.fromPartial({key:(0,yi.fromBase64)(e.value)});return Lo.Any.fromPartial({typeUrl:"/cosmos.crypto.ed25519.PubKey",value:Uint8Array.from(fs.PubKey.encode(t).finish())})}else if((0,Nn.isMultisigThresholdPubkey)(e)){const t=hs.LegacyAminoPubKey.fromPartial({threshold:Ql.Uint53.fromString(e.value.threshold).toNumber(),publicKeys:e.value.pubkeys.map(ga)});return Lo.Any.fromPartial({typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",value:Uint8Array.from(hs.LegacyAminoPubKey.encode(t).finish())})}else throw new Error(`Pubkey type ${e.type} not recognized`)}Ke.encodePubkey=ga;function gs(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":{const{key:t}=ps.PubKey.decode(e.value);return(0,Nn.encodeSecp256k1Pubkey)(t)}case"/cosmos.crypto.ed25519.PubKey":{const{key:t}=fs.PubKey.decode(e.value);return(0,Nn.encodeEd25519Pubkey)(t)}default:throw new Error(`Pubkey type_url ${e.typeUrl} not recognized as single public key type`)}}Ke.anyToSinglePubkey=gs;function ya(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":case"/cosmos.crypto.ed25519.PubKey":return gs(e);case"/cosmos.crypto.multisig.LegacyAminoPubKey":{const{threshold:t,publicKeys:n}=hs.LegacyAminoPubKey.decode(e.value);return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:t.toString(),pubkeys:n.map(gs)}}}default:throw new Error(`Pubkey type URL '${e.typeUrl}' not recognized`)}}Ke.decodePubkey=ya;function Zl(e){if(!e)return null;if(e.typeUrl){if(e.value.length)return ya(e);throw new Error(`Pubkey is an Any with type URL '${e.typeUrl}' but an empty value`)}else{if(e.value.length)throw new Error("Pubkey is an Any with an empty type URL but a value set");return null}}Ke.decodeOptionalPubkey=Zl;var je={};Object.defineProperty(je,"__esModule",{value:!0});je.Registry=je.isTxBodyEncodeObject=je.isPbjsGeneratedType=je.isTsProtoGeneratedType=je.isTelescopeGeneratedType=void 0;const Xl=p.tx$1,Yl=p.coin,zo=p.tx,ed=p.any;function ba(e){const t=e;return typeof t.fromPartial=="function"&&typeof t.typeUrl=="string"}je.isTelescopeGeneratedType=ba;function Ns(e){return typeof e.fromPartial=="function"}je.isTsProtoGeneratedType=Ns;function td(e){return!Ns(e)}je.isPbjsGeneratedType=td;const bi={cosmosCoin:"/cosmos.base.v1beta1.Coin",cosmosMsgSend:"/cosmos.bank.v1beta1.MsgSend",cosmosTxBody:"/cosmos.tx.v1beta1.TxBody",googleAny:"/google.protobuf.Any"};function va(e){return e.typeUrl==="/cosmos.tx.v1beta1.TxBody"}je.isTxBodyEncodeObject=va;class nd{constructor(t){const{cosmosCoin:n,cosmosMsgSend:r}=bi;this.types=t?new Map([...t]):new Map([[n,Yl.Coin],[r,Xl.MsgSend]])}register(t,n){this.types.set(t,n)}lookupType(t){return this.types.get(t)}lookupTypeWithError(t){const n=this.lookupType(t);if(!n)throw new Error(`Unregistered type url: ${t}`);return n}encode(t){const{value:n,typeUrl:r}=t;if(va(t))return this.encodeTxBody(n);const o=this.lookupTypeWithError(r),s=ba(o)||Ns(o)?o.fromPartial(n):o.create(n);return o.encode(s).finish()}encodeAsAny(t){const n=this.encode(t);return ed.Any.fromPartial({typeUrl:t.typeUrl,value:n})}encodeTxBody(t){var o;const n=t.messages.map(s=>this.encodeAsAny(s)),r=zo.TxBody.fromPartial({...t,timeoutHeight:BigInt(((o=t.timeoutHeight)==null?void 0:o.toString())??"0"),messages:n});return zo.TxBody.encode(r).finish()}decode({typeUrl:t,value:n}){if(t===bi.cosmosTxBody)return this.decodeTxBody(n);const o=this.lookupTypeWithError(t).decode(n);return Object.entries(o).forEach(([s,i])=>{typeof l.dist.Buffer<"u"&&typeof l.dist.Buffer.isBuffer<"u"&&l.dist.Buffer.isBuffer(i)&&(o[s]=Uint8Array.from(i))}),o}decodeTxBody(t){const n=zo.TxBody.decode(t);return{...n,messages:n.messages.map(({typeUrl:r,value:o})=>{if(!r)throw new Error("Missing type_url in Any");if(!o)throw new Error("Missing value in Any");return this.decode({typeUrl:r,value:o})})}}}je.Registry=nd;var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isOfflineDirectSigner=void 0;function rd(e){return e.signDirect!==void 0}Jr.isOfflineDirectSigner=rd;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseCoins=e.coins=e.coin=e.executeKdf=e.makeSignDoc=e.makeSignBytes=e.makeAuthInfoBytes=e.isOfflineDirectSigner=e.Registry=e.isTxBodyEncodeObject=e.isTsProtoGeneratedType=e.isPbjsGeneratedType=e.encodePubkey=e.decodePubkey=e.decodeOptionalPubkey=e.anyToSinglePubkey=e.makeCosmoshubPath=e.DirectSecp256k1Wallet=e.extractKdfConfiguration=e.DirectSecp256k1HdWallet=e.decodeTxRaw=void 0;var t=Dr;Object.defineProperty(e,"decodeTxRaw",{enumerable:!0,get:function(){return t.decodeTxRaw}});var n=Vt;Object.defineProperty(e,"DirectSecp256k1HdWallet",{enumerable:!0,get:function(){return n.DirectSecp256k1HdWallet}}),Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return n.extractKdfConfiguration}});var r=Fr;Object.defineProperty(e,"DirectSecp256k1Wallet",{enumerable:!0,get:function(){return r.DirectSecp256k1Wallet}});var o=Wr;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return o.makeCosmoshubPath}});var s=Ke;Object.defineProperty(e,"anyToSinglePubkey",{enumerable:!0,get:function(){return s.anyToSinglePubkey}}),Object.defineProperty(e,"decodeOptionalPubkey",{enumerable:!0,get:function(){return s.decodeOptionalPubkey}}),Object.defineProperty(e,"decodePubkey",{enumerable:!0,get:function(){return s.decodePubkey}}),Object.defineProperty(e,"encodePubkey",{enumerable:!0,get:function(){return s.encodePubkey}});var i=je;Object.defineProperty(e,"isPbjsGeneratedType",{enumerable:!0,get:function(){return i.isPbjsGeneratedType}}),Object.defineProperty(e,"isTsProtoGeneratedType",{enumerable:!0,get:function(){return i.isTsProtoGeneratedType}}),Object.defineProperty(e,"isTxBodyEncodeObject",{enumerable:!0,get:function(){return i.isTxBodyEncodeObject}}),Object.defineProperty(e,"Registry",{enumerable:!0,get:function(){return i.Registry}});var c=Jr;Object.defineProperty(e,"isOfflineDirectSigner",{enumerable:!0,get:function(){return c.isOfflineDirectSigner}});var a=Ye;Object.defineProperty(e,"makeAuthInfoBytes",{enumerable:!0,get:function(){return a.makeAuthInfoBytes}}),Object.defineProperty(e,"makeSignBytes",{enumerable:!0,get:function(){return a.makeSignBytes}}),Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return a.makeSignDoc}});var u=Is;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return u.executeKdf}});var d=st;Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return d.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return d.coins}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return d.parseCoins}})})(vt);Object.defineProperty(Fn,"__esModule",{value:!0});Fn.accountFromAny=void 0;const od=te,sd=vt,En=X,vi=p.auth,cr=p.vesting;function wi(e){return od.Uint64.fromString(e.toString())}function $t(e){const{address:t,pubKey:n,accountNumber:r,sequence:o}=e,s=(0,sd.decodeOptionalPubkey)(n);return{address:t,pubkey:s,accountNumber:wi(r).toNumber(),sequence:wi(o).toNumber()}}function id(e){var r,o,s,i,c,a,u;const{typeUrl:t,value:n}=e;switch(t){case"/cosmos.auth.v1beta1.BaseAccount":return $t(vi.BaseAccount.decode(n));case"/cosmos.auth.v1beta1.ModuleAccount":{const d=vi.ModuleAccount.decode(n).baseAccount;return(0,En.assert)(d),$t(d)}case"/cosmos.vesting.v1beta1.BaseVestingAccount":{const d=(r=cr.BaseVestingAccount.decode(n))==null?void 0:r.baseAccount;return(0,En.assert)(d),$t(d)}case"/cosmos.vesting.v1beta1.ContinuousVestingAccount":{const d=(s=(o=cr.ContinuousVestingAccount.decode(n))==null?void 0:o.baseVestingAccount)==null?void 0:s.baseAccount;return(0,En.assert)(d),$t(d)}case"/cosmos.vesting.v1beta1.DelayedVestingAccount":{const d=(c=(i=cr.DelayedVestingAccount.decode(n))==null?void 0:i.baseVestingAccount)==null?void 0:c.baseAccount;return(0,En.assert)(d),$t(d)}case"/cosmos.vesting.v1beta1.PeriodicVestingAccount":{const d=(u=(a=cr.PeriodicVestingAccount.decode(n))==null?void 0:a.baseVestingAccount)==null?void 0:u.baseAccount;return(0,En.assert)(d),$t(d)}default:throw new Error(`Unsupported type: '${t}'`)}}Fn.accountFromAny=id;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.AminoTypes=void 0;class ad{constructor(t){this.register=t}toAmino({typeUrl:t,value:n}){const r=this.register[t];if(!r)throw new Error(`Type URL '${t}' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.`);return{type:r.aminoType,value:r.toAmino(n)}}fromAmino({type:t,value:n}){const r=Object.entries(this.register).filter(([o,{aminoType:s}])=>s===t);switch(r.length){case 0:throw new Error(`Amino type identifier '${t}' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.`);case 1:{const[o,s]=r[0];return{typeUrl:o,value:s.fromAmino(n)}}default:throw new Error(`Multiple types are registered with Amino type identifier '${t}': '`+r.map(([o,s])=>o).sort().join("', '")+"'. Thus fromAmino cannot be performed.")}}}zn.AminoTypes=ad;var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.fromTendermintEvent=void 0;const ki=D;function cd(e){return{type:e.type,attributes:e.attributes.map(t=>({key:typeof t.key=="string"?t.key:(0,ki.fromUtf8)(t.key,!0),value:typeof t.value=="string"?t.value:(0,ki.fromUtf8)(t.value,!0)}))}}Kn.fromTendermintEvent=cd;var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.calculateFee=Mt.GasPrice=void 0;const wa=te,ud=vt;function ld(e){if(e.length<3||e.length>128)throw new Error("Denom must be between 3 and 128 characters")}class Lr{constructor(t,n){this.amount=t,this.denom=n}static fromString(t){const n=t.match(/^([0-9.]+)([a-zA-Z][a-zA-Z0-9/:._-]*)$/);if(!n)throw new Error("Invalid gas price string");const[r,o,s]=n;ld(s);const c=wa.Decimal.fromUserInput(o,18);return new Lr(c,s)}toString(){return this.amount.toString()+this.denom}}Mt.GasPrice=Lr;function dd(e,t){const n=typeof t=="string"?Lr.fromString(t):t,{denom:r,amount:o}=n,s=o.multiply(new wa.Uint53(e)).ceil().toString();return{amount:(0,ud.coins)(s,r),gas:e.toString()}}Mt.calculateFee=dd;var ye={};Object.defineProperty(ye,"__esModule",{value:!0});ye.findAttribute=ye.parseRawLog=ye.parseLogs=ye.parseLog=ye.parseEvent=ye.parseAttribute=void 0;const Ds=X;function ka(e){if(!(0,Ds.isNonNullObject)(e))throw new Error("Attribute must be a non-null object");const{key:t,value:n}=e;if(typeof t!="string"||!t)throw new Error("Attribute's key must be a non-empty string");if(typeof n!="string"&&typeof n<"u")throw new Error("Attribute's value must be a string or unset");return{key:t,value:n||""}}ye.parseAttribute=ka;function _a(e){if(!(0,Ds.isNonNullObject)(e))throw new Error("Event must be a non-null object");const{type:t,attributes:n}=e;if(typeof t!="string"||t==="")throw new Error("Event type must be a non-empty string");if(!Array.isArray(n))throw new Error("Event's attributes must be an array");return{type:t,attributes:n.map(ka)}}ye.parseEvent=_a;function Sa(e){if(!(0,Ds.isNonNullObject)(e))throw new Error("Log must be a non-null object");const{msg_index:t,log:n,events:r}=e;if(typeof t!="number")throw new Error("Log's msg_index must be a number");if(typeof n!="string")throw new Error("Log's log must be a string");if(!Array.isArray(r))throw new Error("Log's events must be an array");return{msg_index:t,log:n,events:r.map(_a)}}ye.parseLog=Sa;function Pa(e){if(!Array.isArray(e))throw new Error("Logs must be an array");return e.map(Sa)}ye.parseLogs=Pa;function md(e){if(!e)return[];const t=JSON.parse(e).map(({events:n},r)=>({msg_index:r,events:n,log:""}));return Pa(t)}ye.parseRawLog=md;function fd(e,t,n){var s;const r=e.find(()=>!0),o=(s=r==null?void 0:r.events.find(i=>i.type===t))==null?void 0:s.attributes.find(i=>i.key===n);if(!o)throw new Error(`Could not find attribute '${n}' in first event of type '${t}' in first log.`);return o}ye.findAttribute=fd;var qn={},zr={},ce={},Kr={},Qn={},Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.concat=void 0;const hd=p.xstream;function pd(...e){const t=new Array,n=new Array,r=new Set;let o=0;function s(){for(;t.length>0;)t.shift().unsubscribe();n.length=0,r.clear(),o=0}const i={start:c=>{e.forEach(d=>n.push([]));function a(d){for(;;){const y=n[d].shift();if(y===void 0)return;c.next(y)}}function u(){return o>=e.length}if(u()){c.complete();return}e.forEach((d,y)=>{t.push(d.subscribe({next:M=>{y===o?c.next(M):n[y].push(M)},complete:()=>{for(r.add(y);r.has(o);)a(o),o++;u()?c.complete():a(o)},error:M=>{c.error(M),s()}}))})},stop:()=>{s()}};return hd.Stream.create(i)}Qr.concat=pd;var Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.DefaultValueProducer=void 0;class gd{get value(){return this.internalValue}constructor(t,n){this.callbacks=n,this.internalValue=t}update(t){this.internalValue=t,this.listener&&this.listener.next(t)}error(t){this.listener&&this.listener.error(t)}start(t){this.listener=t,t.next(this.internalValue),this.callbacks&&this.callbacks.onStarted()}stop(){this.callbacks&&this.callbacks.onStop(),this.listener=void 0}}Zr.DefaultValueProducer=gd;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.dropDuplicates=void 0;function yd(e){return n=>{const r=new Set;return n.filter(s=>!r.has(e(s))).debug(s=>r.add(e(s)))}}Xr.dropDuplicates=yd;var ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.firstEvent=ft.toListPromise=ft.fromListPromise=void 0;const bd=p.xstream;function vd(e){const t={start:n=>{e.then(r=>{for(const o of r)n.next(o);n.complete()}).catch(r=>n.error(r))},stop:()=>{}};return bd.Stream.create(t)}ft.fromListPromise=vd;async function Aa(e,t){return new Promise((n,r)=>{if(t===0){n([]);return}const o=new Array;e.take(t).subscribe({next:s=>{o.push(s),o.length===t&&n(o)},complete:()=>{r(`Stream completed before all events could be collected. Collected ${o.length}, expected ${t}`)},error:s=>r(s)})})}ft.toListPromise=Aa;async function wd(e){return(await Aa(e,1))[0]}ft.firstEvent=wd;var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.lastValue=Qe.asArray=Qe.countStream=Qe.Reducer=void 0;class Yr{constructor(t,n,r){this.stream=t,this.reducer=n,this.state=r,this.completed=new Promise((o,s)=>{const i=this.stream.subscribe({next:c=>{this.state=this.reducer(this.state,c)},complete:()=>{o(),i.unsubscribe()},error:c=>{s(c),i.unsubscribe()}})})}value(){return this.state}async finished(){return this.completed}}Qe.Reducer=Yr;function kd(e,t){return e+1}function _d(e){return new Yr(e,kd,0)}Qe.countStream=_d;function Sd(e,t){return[...e,t]}function Pd(e){return new Yr(e,Sd,[])}Qe.asArray=Pd;function Ad(e,t){return t}function Td(e){return new Yr(e,Ad,void 0)}Qe.lastValue=Td;var eo={};Object.defineProperty(eo,"__esModule",{value:!0});eo.ValueAndUpdates=void 0;const Ed=p.xstream;class Cd{get value(){return this.producer.value}constructor(t){this.producer=t,this.updates=Ed.MemoryStream.createWithMemory(this.producer)}async waitFor(t){const n=typeof t=="function"?t:r=>r===t;return new Promise((r,o)=>{const s=this.updates.subscribe({next:i=>{n(i)&&(r(i),setTimeout(()=>s.unsubscribe(),0))},complete:()=>{s.unsubscribe(),o("Update stream completed without expected value")},error:i=>{o(i)}})})}}eo.ValueAndUpdates=Cd;(function(e){var t=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(a,u,d,y){y===void 0&&(y=d);var M=Object.getOwnPropertyDescriptor(u,d);(!M||("get"in M?!u.__esModule:M.writable||M.configurable))&&(M={enumerable:!0,get:function(){return u[d]}}),Object.defineProperty(a,y,M)}:function(a,u,d,y){y===void 0&&(y=d),a[y]=u[d]}),n=l.commonjsGlobal&&l.commonjsGlobal.__exportStar||function(a,u){for(var d in a)d!=="default"&&!Object.prototype.hasOwnProperty.call(u,d)&&t(u,a,d)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueAndUpdates=e.toListPromise=e.fromListPromise=e.firstEvent=e.dropDuplicates=e.DefaultValueProducer=e.concat=void 0;var r=Qr;Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return r.concat}});var o=Zr;Object.defineProperty(e,"DefaultValueProducer",{enumerable:!0,get:function(){return o.DefaultValueProducer}});var s=Xr;Object.defineProperty(e,"dropDuplicates",{enumerable:!0,get:function(){return s.dropDuplicates}});var i=ft;Object.defineProperty(e,"firstEvent",{enumerable:!0,get:function(){return i.firstEvent}}),Object.defineProperty(e,"fromListPromise",{enumerable:!0,get:function(){return i.fromListPromise}}),Object.defineProperty(e,"toListPromise",{enumerable:!0,get:function(){return i.toListPromise}}),n(Qe,e);var c=eo;Object.defineProperty(e,"ValueAndUpdates",{enumerable:!0,get:function(){return c.ValueAndUpdates}})})(Qn);Object.defineProperty(Kr,"__esModule",{value:!0});Kr.QueryClient=void 0;const St=p.build,Tt=D,jd=Qn,he=X;function ur(e,t,n){if(e.type!==t)throw new Error(`Op expected to be ${t}, got "${e.type}`);if(!(0,he.arrayContentEquals)(n,e.key))throw new Error(`Proven key different than queried key.
|
|
2
2
|
Query: ${(0,Tt.toHex)(n)}
|
|
3
3
|
Proven: ${(0,Tt.toHex)(e.key)}`);return St.ics23.CommitmentProof.decode(e.data)}class xs{static withExtensions(t,...n){const r=new xs(t),o=n.map(s=>s(r));for(const s of o){(0,he.assert)((0,he.isNonNullObject)(s),"Extension must be a non-null object");for(const[i,c]of Object.entries(s)){(0,he.assert)((0,he.isNonNullObject)(c),`Module must be a non-null object. Found type ${typeof c} for module "${i}".`);const a=r[i]||{};r[i]={...a,...c}}}return r}constructor(t){this.cometClient=t}async queryStoreVerified(t,n,r){const{height:o,proof:s,key:i,value:c}=await this.queryRawProof(t,n,r),a=ur(s.ops[0],"ics23:iavl",n),u=ur(s.ops[1],"ics23:simple",(0,Tt.toAscii)(t));(0,he.assert)(u.exist),(0,he.assert)(u.exist.value),!c||c.length===0?((0,he.assert)(a.nonexist),(0,St.verifyNonExistence)(a.nonexist,St.iavlSpec,u.exist.value,n)):((0,he.assert)(a.exist),(0,he.assert)(a.exist.value),(0,St.verifyExistence)(a.exist,St.iavlSpec,u.exist.value,n,c));const d=await this.getNextHeader(o);return(0,St.verifyExistence)(u.exist,St.tendermintSpec,d.appHash,(0,Tt.toAscii)(t),u.exist.value),{key:i,value:c,height:o}}async queryRawProof(t,n,r){const{key:o,value:s,height:i,proof:c,code:a,log:u}=await this.cometClient.abciQuery({path:`/store/${t}/key`,data:n,prove:!0,height:r});if(a)throw new Error(`Query failed with (${a}): ${u}`);if(!(0,he.arrayContentEquals)(n,o))throw new Error(`Response key ${(0,Tt.toHex)(o)} doesn't match query key ${(0,Tt.toHex)(n)}`);if(!i)throw new Error("No query height returned");if(!c||c.ops.length!==2)throw new Error(`Expected 2 proof ops, got ${(c==null?void 0:c.ops.length)??0}. Are you using stargate?`);return ur(c.ops[0],"ics23:iavl",o),ur(c.ops[1],"ics23:simple",(0,Tt.toAscii)(t)),{key:o,value:s,height:i,proof:{ops:[...c.ops]}}}async queryAbci(t,n,r){const o=await this.cometClient.abciQuery({path:t,data:n,prove:!1,height:r});if(o.code)throw new Error(`Query failed with (${o.code}): ${o.log}`);if(!o.height)throw new Error("No query height returned");return{value:o.value,height:o.height}}async getNextHeader(t){if((0,he.assertDefined)(t),t===0)throw new Error("Query returned height 0, cannot prove it");const n=t+1;let r,o;try{o=this.cometClient.subscribeNewBlockHeader()}catch{}if(o){const s=await(0,jd.firstEvent)(o);s.height===n&&(r=s)}for(;!r;){const s=(await this.cometClient.blockchain(t,n)).blockMetas.map(i=>i.header).find(i=>i.height===n);s?r=s:await(0,he.sleep)(1e3)}return(0,he.assert)(r.height===n,"Got wrong header. This is a bug in the logic above."),r}}Kr.QueryClient=xs;var Me={};Object.defineProperty(Me,"__esModule",{value:!0});Me.decodeCosmosSdkDecFromProto=Me.longify=Me.createProtobufRpcClient=Me.createPagination=Me.toAccAddress=void 0;const Ta=D,Ea=te,_i=p.pagination;function Md(e){return(0,Ta.fromBech32)(e).data}Me.toAccAddress=Md;function Od(e){return e?_i.PageRequest.fromPartial({key:e}):_i.PageRequest.fromPartial({})}Me.createPagination=Od;function Bd(e){return{request:async(t,n,r)=>{const o=`/${t}/${n}`;return(await e.queryAbci(o,r,void 0)).value}}}Me.createProtobufRpcClient=Bd;function Rd(e){const t=Ea.Uint64.fromString(e.toString());return BigInt(t.toString())}Me.longify=Rd;function Id(e){const t=typeof e=="string"?e:(0,Ta.fromAscii)(e);return Ea.Decimal.fromAtomics(t,18)}Me.decodeCosmosSdkDecFromProto=Id;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.longify=e.decodeCosmosSdkDecFromProto=e.createProtobufRpcClient=e.createPagination=e.QueryClient=void 0;var t=Kr;Object.defineProperty(e,"QueryClient",{enumerable:!0,get:function(){return t.QueryClient}});var n=Me;Object.defineProperty(e,"createPagination",{enumerable:!0,get:function(){return n.createPagination}}),Object.defineProperty(e,"createProtobufRpcClient",{enumerable:!0,get:function(){return n.createProtobufRpcClient}}),Object.defineProperty(e,"decodeCosmosSdkDecFromProto",{enumerable:!0,get:function(){return n.decodeCosmosSdkDecFromProto}}),Object.defineProperty(e,"longify",{enumerable:!0,get:function(){return n.longify}})})(ce);Object.defineProperty(zr,"__esModule",{value:!0});zr.setupAuthExtension=void 0;const $d=p.query,Nd=ce;function Dd(e){const t=(0,Nd.createProtobufRpcClient)(e),n=new $d.QueryClientImpl(t);return{auth:{account:async r=>{const{account:o}=await n.Account({address:r});return o??null}}}}zr.setupAuthExtension=Dd;var to={};Object.defineProperty(to,"__esModule",{value:!0});to.createAuthzAminoConverters=void 0;function xd(){return{}}to.createAuthzAminoConverters=xd;var no={};Object.defineProperty(no,"__esModule",{value:!0});no.authzTypes=void 0;const Ko=p.tx$2;no.authzTypes=[["/cosmos.authz.v1beta1.MsgExec",Ko.MsgExec],["/cosmos.authz.v1beta1.MsgGrant",Ko.MsgGrant],["/cosmos.authz.v1beta1.MsgRevoke",Ko.MsgRevoke]];var ro={};Object.defineProperty(ro,"__esModule",{value:!0});ro.setupAuthzExtension=void 0;const Ud=p.query$1,lr=ce;function qd(e){const t=(0,lr.createProtobufRpcClient)(e),n=new Ud.QueryClientImpl(t);return{authz:{grants:async(r,o,s,i)=>await n.Grants({granter:r,grantee:o,msgTypeUrl:s,pagination:(0,lr.createPagination)(i)}),granteeGrants:async(r,o)=>await n.GranteeGrants({grantee:r,pagination:(0,lr.createPagination)(o)}),granterGrants:async(r,o)=>await n.GranterGrants({granter:r,pagination:(0,lr.createPagination)(o)})}}}ro.setupAuthzExtension=qd;var ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.createBankAminoConverters=ht.isAminoMsgMultiSend=ht.isAminoMsgSend=void 0;function Hd(e){return e.type==="cosmos-sdk/MsgSend"}ht.isAminoMsgSend=Hd;function Vd(e){return e.type==="cosmos-sdk/MsgMultiSend"}ht.isAminoMsgMultiSend=Vd;function Gd(){return{"/cosmos.bank.v1beta1.MsgSend":{aminoType:"cosmos-sdk/MsgSend",toAmino:({fromAddress:e,toAddress:t,amount:n})=>({from_address:e,to_address:t,amount:[...n]}),fromAmino:({from_address:e,to_address:t,amount:n})=>({fromAddress:e,toAddress:t,amount:[...n]})},"/cosmos.bank.v1beta1.MsgMultiSend":{aminoType:"cosmos-sdk/MsgMultiSend",toAmino:({inputs:e,outputs:t})=>({inputs:e.map(n=>({address:n.address,coins:[...n.coins]})),outputs:t.map(n=>({address:n.address,coins:[...n.coins]}))}),fromAmino:({inputs:e,outputs:t})=>({inputs:e.map(n=>({address:n.address,coins:[...n.coins]})),outputs:t.map(n=>({address:n.address,coins:[...n.coins]}))})}}}ht.createBankAminoConverters=Gd;var en={};Object.defineProperty(en,"__esModule",{value:!0});en.isMsgSendEncodeObject=en.bankTypes=void 0;const Si=p.tx$1;en.bankTypes=[["/cosmos.bank.v1beta1.MsgMultiSend",Si.MsgMultiSend],["/cosmos.bank.v1beta1.MsgSend",Si.MsgSend]];function Fd(e){return e.typeUrl==="/cosmos.bank.v1beta1.MsgSend"}en.isMsgSendEncodeObject=Fd;var oo={};Object.defineProperty(oo,"__esModule",{value:!0});oo.setupBankExtension=void 0;const Qo=X,Zo=p.query$2,Pi=ce;function Wd(e){const t=(0,Pi.createProtobufRpcClient)(e),n=new Zo.QueryClientImpl(t);return{bank:{balance:async(r,o)=>{const{balance:s}=await n.Balance({address:r,denom:o});return(0,Qo.assert)(s),s},allBalances:async r=>{const{balances:o}=await n.AllBalances(Zo.QueryAllBalancesRequest.fromPartial({address:r}));return o},totalSupply:async r=>await n.TotalSupply({pagination:(0,Pi.createPagination)(r)}),supplyOf:async r=>{const{amount:o}=await n.SupplyOf({denom:r});return(0,Qo.assert)(o),o},denomMetadata:async r=>{const{metadata:o}=await n.DenomMetadata({denom:r});return(0,Qo.assert)(o),o},denomsMetadata:async()=>{const{metadatas:r}=await n.DenomsMetadata(Zo.QueryDenomsMetadataRequest.fromPartial({pagination:void 0}));return r}}}}oo.setupBankExtension=Wd;var tn={};Object.defineProperty(tn,"__esModule",{value:!0});tn.createCrysisAminoConverters=tn.isAminoMsgVerifyInvariant=void 0;function Jd(e){return e.type==="cosmos-sdk/MsgVerifyInvariant"}tn.isAminoMsgVerifyInvariant=Jd;function Ld(){throw new Error("Not implemented")}tn.createCrysisAminoConverters=Ld;var Oe={};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.createDistributionAminoConverters=Oe.isAminoMsgFundCommunityPool=Oe.isAminoMsgWithdrawValidatorCommission=Oe.isAminoMsgWithdrawDelegatorReward=Oe.isAminoMsgSetWithdrawAddress=void 0;function zd(e){return e.type==="cosmos-sdk/MsgModifyWithdrawAddress"}Oe.isAminoMsgSetWithdrawAddress=zd;function Kd(e){return e.type==="cosmos-sdk/MsgWithdrawDelegationReward"}Oe.isAminoMsgWithdrawDelegatorReward=Kd;function Qd(e){return e.type==="cosmos-sdk/MsgWithdrawValidatorCommission"}Oe.isAminoMsgWithdrawValidatorCommission=Qd;function Zd(e){return e.type==="cosmos-sdk/MsgFundCommunityPool"}Oe.isAminoMsgFundCommunityPool=Zd;function Xd(){return{"/cosmos.distribution.v1beta1.MsgFundCommunityPool":{aminoType:"cosmos-sdk/MsgFundCommunityPool",toAmino:({amount:e,depositor:t})=>({amount:[...e],depositor:t}),fromAmino:({amount:e,depositor:t})=>({amount:[...e],depositor:t})},"/cosmos.distribution.v1beta1.MsgSetWithdrawAddress":{aminoType:"cosmos-sdk/MsgModifyWithdrawAddress",toAmino:({delegatorAddress:e,withdrawAddress:t})=>({delegator_address:e,withdraw_address:t}),fromAmino:({delegator_address:e,withdraw_address:t})=>({delegatorAddress:e,withdrawAddress:t})},"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward":{aminoType:"cosmos-sdk/MsgWithdrawDelegationReward",toAmino:({delegatorAddress:e,validatorAddress:t})=>({delegator_address:e,validator_address:t}),fromAmino:({delegator_address:e,validator_address:t})=>({delegatorAddress:e,validatorAddress:t})},"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission":{aminoType:"cosmos-sdk/MsgWithdrawValidatorCommission",toAmino:({validatorAddress:e})=>({validator_address:e}),fromAmino:({validator_address:e})=>({validatorAddress:e})}}}Oe.createDistributionAminoConverters=Xd;var nn={};Object.defineProperty(nn,"__esModule",{value:!0});nn.isMsgWithdrawDelegatorRewardEncodeObject=nn.distributionTypes=void 0;const dr=p.tx$3;nn.distributionTypes=[["/cosmos.distribution.v1beta1.MsgFundCommunityPool",dr.MsgFundCommunityPool],["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",dr.MsgSetWithdrawAddress],["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",dr.MsgWithdrawDelegatorReward],["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",dr.MsgWithdrawValidatorCommission]];function Yd(e){return e.typeUrl==="/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"}nn.isMsgWithdrawDelegatorRewardEncodeObject=Yd;var so={};Object.defineProperty(so,"__esModule",{value:!0});so.setupDistributionExtension=void 0;const em=p.query$3,Ai=ce;function tm(e){const t=(0,Ai.createProtobufRpcClient)(e),n=new em.QueryClientImpl(t);return{distribution:{communityPool:async()=>await n.CommunityPool({}),delegationRewards:async(r,o)=>await n.DelegationRewards({delegatorAddress:r,validatorAddress:o}),delegationTotalRewards:async r=>await n.DelegationTotalRewards({delegatorAddress:r}),delegatorValidators:async r=>await n.DelegatorValidators({delegatorAddress:r}),delegatorWithdrawAddress:async r=>await n.DelegatorWithdrawAddress({delegatorAddress:r}),params:async()=>await n.Params({}),validatorCommission:async r=>await n.ValidatorCommission({validatorAddress:r}),validatorOutstandingRewards:async r=>await n.ValidatorOutstandingRewards({validatorAddress:r}),validatorSlashes:async(r,o,s,i)=>await n.ValidatorSlashes({validatorAddress:r,startingHeight:BigInt(o),endingHeight:BigInt(s),pagination:(0,Ai.createPagination)(i)})}}}so.setupDistributionExtension=tm;var rn={};Object.defineProperty(rn,"__esModule",{value:!0});rn.createEvidenceAminoConverters=rn.isAminoMsgSubmitEvidence=void 0;function nm(e){return e.type==="cosmos-sdk/MsgSubmitEvidence"}rn.isAminoMsgSubmitEvidence=nm;function rm(){throw new Error("Not implemented")}rn.createEvidenceAminoConverters=rm;var io={};Object.defineProperty(io,"__esModule",{value:!0});io.createFeegrantAminoConverters=void 0;function om(){return{}}io.createFeegrantAminoConverters=om;var ao={};Object.defineProperty(ao,"__esModule",{value:!0});ao.feegrantTypes=void 0;const Ti=p.tx$4;ao.feegrantTypes=[["/cosmos.feegrant.v1beta1.MsgGrantAllowance",Ti.MsgGrantAllowance],["/cosmos.feegrant.v1beta1.MsgRevokeAllowance",Ti.MsgRevokeAllowance]];var co={};Object.defineProperty(co,"__esModule",{value:!0});co.setupFeegrantExtension=void 0;const sm=p.query$4,Ei=ce;function im(e){const t=(0,Ei.createProtobufRpcClient)(e),n=new sm.QueryClientImpl(t);return{feegrant:{allowance:async(r,o)=>await n.Allowance({granter:r,grantee:o}),allowances:async(r,o)=>await n.Allowances({grantee:r,pagination:(0,Ei.createPagination)(o)})}}}co.setupFeegrantExtension=im;var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.createGovAminoConverters=Be.isAminoMsgDeposit=Be.isAminoMsgVoteWeighted=Be.isAminoMsgVote=Be.isAminoMsgSubmitProposal=void 0;const am=te,Cn=X,jn=p.gov,cm=p.any,um=ce;function lm(e){return e.type==="cosmos-sdk/MsgSubmitProposal"}Be.isAminoMsgSubmitProposal=lm;function dm(e){return e.type==="cosmos-sdk/MsgVote"}Be.isAminoMsgVote=dm;function mm(e){return e.type==="cosmos-sdk/MsgVoteWeighted"}Be.isAminoMsgVoteWeighted=mm;function fm(e){return e.type==="cosmos-sdk/MsgDeposit"}Be.isAminoMsgDeposit=fm;function hm(){return{"/cosmos.gov.v1beta1.MsgDeposit":{aminoType:"cosmos-sdk/MsgDeposit",toAmino:({amount:e,depositor:t,proposalId:n})=>({amount:e,depositor:t,proposal_id:n.toString()}),fromAmino:({amount:e,depositor:t,proposal_id:n})=>({amount:Array.from(e),depositor:t,proposalId:BigInt(n)})},"/cosmos.gov.v1beta1.MsgVote":{aminoType:"cosmos-sdk/MsgVote",toAmino:({option:e,proposalId:t,voter:n})=>({option:e,proposal_id:t.toString(),voter:n}),fromAmino:({option:e,proposal_id:t,voter:n})=>({option:(0,jn.voteOptionFromJSON)(e),proposalId:BigInt(t),voter:n})},"/cosmos.gov.v1beta1.MsgVoteWeighted":{aminoType:"cosmos-sdk/MsgVoteWeighted",toAmino:({options:e,proposalId:t,voter:n})=>({options:e.map(r=>({option:r.option,weight:(0,um.decodeCosmosSdkDecFromProto)(r.weight).toString().padEnd(20,"0")})),proposal_id:t.toString(),voter:n}),fromAmino:({options:e,proposal_id:t,voter:n})=>({proposalId:BigInt(t),voter:n,options:e.map(r=>({option:(0,jn.voteOptionFromJSON)(r.option),weight:am.Decimal.fromUserInput(r.weight,18).atomics}))})},"/cosmos.gov.v1beta1.MsgSubmitProposal":{aminoType:"cosmos-sdk/MsgSubmitProposal",toAmino:({initialDeposit:e,proposer:t,content:n})=>{(0,Cn.assertDefinedAndNotNull)(n);let r;switch(n.typeUrl){case"/cosmos.gov.v1beta1.TextProposal":{const o=jn.TextProposal.decode(n.value);r={type:"cosmos-sdk/TextProposal",value:{description:o.description,title:o.title}};break}default:throw new Error(`Unsupported proposal type: '${n.typeUrl}'`)}return{initial_deposit:e,proposer:t,content:r}},fromAmino:({initial_deposit:e,proposer:t,content:n})=>{let r;switch(n.type){case"cosmos-sdk/TextProposal":{const{value:o}=n;(0,Cn.assert)((0,Cn.isNonNullObject)(o));const{title:s,description:i}=o;(0,Cn.assert)(typeof s=="string"),(0,Cn.assert)(typeof i=="string"),r=cm.Any.fromPartial({typeUrl:"/cosmos.gov.v1beta1.TextProposal",value:jn.TextProposal.encode(jn.TextProposal.fromPartial({title:s,description:i})).finish()});break}default:throw new Error(`Unsupported proposal type: '${n.type}'`)}return{initialDeposit:Array.from(e),proposer:t,content:r}}}}}Be.createGovAminoConverters=hm;var Re={};Object.defineProperty(Re,"__esModule",{value:!0});Re.isMsgVoteWeightedEncodeObject=Re.isMsgVoteEncodeObject=Re.isMsgSubmitProposalEncodeObject=Re.isMsgDepositEncodeObject=Re.govTypes=void 0;const Mn=p.tx$5,mr=p.tx$6;Re.govTypes=[["/cosmos.gov.v1.MsgDeposit",Mn.MsgDeposit],["/cosmos.gov.v1.MsgSubmitProposal",Mn.MsgSubmitProposal],["/cosmos.gov.v1.MsgUpdateParams",Mn.MsgUpdateParams],["/cosmos.gov.v1.MsgVote",Mn.MsgVote],["/cosmos.gov.v1.MsgVoteWeighted",Mn.MsgVoteWeighted],["/cosmos.gov.v1beta1.MsgDeposit",mr.MsgDeposit],["/cosmos.gov.v1beta1.MsgSubmitProposal",mr.MsgSubmitProposal],["/cosmos.gov.v1beta1.MsgVote",mr.MsgVote],["/cosmos.gov.v1beta1.MsgVoteWeighted",mr.MsgVoteWeighted]];function pm(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgDeposit"}Re.isMsgDepositEncodeObject=pm;function gm(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgSubmitProposal"}Re.isMsgSubmitProposalEncodeObject=gm;function ym(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgVote"}Re.isMsgVoteEncodeObject=ym;function bm(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgVoteWeighted"}Re.isMsgVoteWeightedEncodeObject=bm;var uo={};Object.defineProperty(uo,"__esModule",{value:!0});uo.setupGovExtension=void 0;const vm=p.query$5,Fe=ce;function wm(e){const t=(0,Fe.createProtobufRpcClient)(e),n=new vm.QueryClientImpl(t);return{gov:{params:async r=>await n.Params({paramsType:r}),proposals:async(r,o,s,i)=>await n.Proposals({proposalStatus:r,depositor:o,voter:s,pagination:(0,Fe.createPagination)(i)}),proposal:async r=>await n.Proposal({proposalId:(0,Fe.longify)(r)}),deposits:async(r,o)=>await n.Deposits({proposalId:(0,Fe.longify)(r),pagination:(0,Fe.createPagination)(o)}),deposit:async(r,o)=>await n.Deposit({proposalId:(0,Fe.longify)(r),depositor:o}),tally:async r=>await n.TallyResult({proposalId:(0,Fe.longify)(r)}),votes:async(r,o)=>await n.Votes({proposalId:(0,Fe.longify)(r),pagination:(0,Fe.createPagination)(o)}),vote:async(r,o)=>await n.Vote({proposalId:(0,Fe.longify)(r),voter:o})}}}uo.setupGovExtension=wm;var lo={};Object.defineProperty(lo,"__esModule",{value:!0});lo.createGroupAminoConverters=void 0;function km(){return{}}lo.createGroupAminoConverters=km;var mo={};Object.defineProperty(mo,"__esModule",{value:!0});mo.groupTypes=void 0;const le=p.tx$7;mo.groupTypes=[["/cosmos.group.v1.MsgCreateGroup",le.MsgCreateGroup],["/cosmos.group.v1.MsgCreateGroupPolicy",le.MsgCreateGroupPolicy],["/cosmos.group.v1.MsgCreateGroupWithPolicy",le.MsgCreateGroupWithPolicy],["/cosmos.group.v1.MsgExec",le.MsgExec],["/cosmos.group.v1.MsgLeaveGroup",le.MsgLeaveGroup],["/cosmos.group.v1.MsgSubmitProposal",le.MsgSubmitProposal],["/cosmos.group.v1.MsgUpdateGroupAdmin",le.MsgUpdateGroupAdmin],["/cosmos.group.v1.MsgUpdateGroupMembers",le.MsgUpdateGroupMembers],["/cosmos.group.v1.MsgUpdateGroupMetadata",le.MsgUpdateGroupMetadata],["/cosmos.group.v1.MsgUpdateGroupPolicyAdmin",le.MsgUpdateGroupPolicyAdmin],["/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy",le.MsgUpdateGroupPolicyDecisionPolicy],["/cosmos.group.v1.MsgUpdateGroupPolicyMetadata",le.MsgUpdateGroupPolicyMetadata],["/cosmos.group.v1.MsgVote",le.MsgVote],["/cosmos.group.v1.MsgWithdrawProposal",le.MsgWithdrawProposal]];var on={};Object.defineProperty(on,"__esModule",{value:!0});on.createIbcAminoConverters=on.isAminoMsgTransfer=void 0;const fr=st,_m=p.tx$8;function Sm(e){return e.type==="cosmos-sdk/MsgTransfer"}on.isAminoMsgTransfer=Sm;function Pm(){return{"/ibc.applications.transfer.v1.MsgTransfer":{aminoType:"cosmos-sdk/MsgTransfer",toAmino:({sourcePort:e,sourceChannel:t,token:n,sender:r,receiver:o,timeoutHeight:s,timeoutTimestamp:i,memo:c})=>{var a,u,d;return{source_port:e,source_channel:t,token:n,sender:r,receiver:o,timeout_height:s?{revision_height:(a=(0,fr.omitDefault)(s.revisionHeight))==null?void 0:a.toString(),revision_number:(u=(0,fr.omitDefault)(s.revisionNumber))==null?void 0:u.toString()}:{},timeout_timestamp:(d=(0,fr.omitDefault)(i))==null?void 0:d.toString(),memo:(0,fr.omitDefault)(c)}},fromAmino:({source_port:e,source_channel:t,token:n,sender:r,receiver:o,timeout_height:s,timeout_timestamp:i,memo:c})=>_m.MsgTransfer.fromPartial({sourcePort:e,sourceChannel:t,token:n,sender:r,receiver:o,timeoutHeight:s?{revisionHeight:BigInt(s.revision_height||"0"),revisionNumber:BigInt(s.revision_number||"0")}:void 0,timeoutTimestamp:BigInt(i||"0"),memo:c??""})}}}on.createIbcAminoConverters=Pm;var sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.isMsgTransferEncodeObject=sn.ibcTypes=void 0;const Am=p.tx$8,We=p.tx$9,hr=p.tx$10,pr=p.tx$11;sn.ibcTypes=[["/ibc.applications.transfer.v1.MsgTransfer",Am.MsgTransfer],["/ibc.core.channel.v1.MsgAcknowledgement",We.MsgAcknowledgement],["/ibc.core.channel.v1.MsgChannelCloseConfirm",We.MsgChannelCloseConfirm],["/ibc.core.channel.v1.MsgChannelCloseInit",We.MsgChannelCloseInit],["/ibc.core.channel.v1.MsgChannelOpenAck",We.MsgChannelOpenAck],["/ibc.core.channel.v1.MsgChannelOpenConfirm",We.MsgChannelOpenConfirm],["/ibc.core.channel.v1.MsgChannelOpenInit",We.MsgChannelOpenInit],["/ibc.core.channel.v1.MsgChannelOpenTry",We.MsgChannelOpenTry],["/ibc.core.channel.v1.MsgRecvPacket",We.MsgRecvPacket],["/ibc.core.channel.v1.MsgTimeout",We.MsgTimeout],["/ibc.core.channel.v1.MsgTimeoutOnClose",We.MsgTimeoutOnClose],["/ibc.core.client.v1.MsgCreateClient",hr.MsgCreateClient],["/ibc.core.client.v1.MsgSubmitMisbehaviour",hr.MsgSubmitMisbehaviour],["/ibc.core.client.v1.MsgUpdateClient",hr.MsgUpdateClient],["/ibc.core.client.v1.MsgUpgradeClient",hr.MsgUpgradeClient],["/ibc.core.connection.v1.MsgConnectionOpenAck",pr.MsgConnectionOpenAck],["/ibc.core.connection.v1.MsgConnectionOpenConfirm",pr.MsgConnectionOpenConfirm],["/ibc.core.connection.v1.MsgConnectionOpenInit",pr.MsgConnectionOpenInit],["/ibc.core.connection.v1.MsgConnectionOpenTry",pr.MsgConnectionOpenTry]];function Tm(e){return e.typeUrl==="/ibc.applications.transfer.v1.MsgTransfer"}sn.isMsgTransferEncodeObject=Tm;var fo={};Object.defineProperty(fo,"__esModule",{value:!0});fo.setupIbcExtension=void 0;const gr=D,Em=te,Ci=p.query$6,Cm=p.channel,kt=p.query$7,On=p.query$8,Xo=p.query$9,Ca=p.tendermint,K=ce;function Yo(e){if((e==null?void 0:e.typeUrl)!=="/ibc.lightclients.tendermint.v1.ClientState")throw new Error(`Unexpected client state type: ${e==null?void 0:e.typeUrl}`);return Ca.ClientState.decode(e.value)}function jm(e){if((e==null?void 0:e.typeUrl)!=="/ibc.lightclients.tendermint.v1.ConsensusState")throw new Error(`Unexpected client state type: ${e==null?void 0:e.typeUrl}`);return Ca.ConsensusState.decode(e.value)}function Mm(e){const t=(0,K.createProtobufRpcClient)(e),n=new kt.QueryClientImpl(t),r=new On.QueryClientImpl(t),o=new Xo.QueryClientImpl(t),s=new Ci.QueryClientImpl(t);return{ibc:{channel:{channel:async(i,c)=>n.Channel({portId:i,channelId:c}),channels:async i=>n.Channels({pagination:(0,K.createPagination)(i)}),allChannels:async()=>{var u;const i=[];let c,a;do c=await n.Channels({pagination:(0,K.createPagination)(a)}),i.push(...c.channels),a=(u=c.pagination)==null?void 0:u.nextKey;while(a&&a.length);return kt.QueryChannelsResponse.fromPartial({channels:i,height:c.height})},connectionChannels:async(i,c)=>n.ConnectionChannels({connection:i,pagination:(0,K.createPagination)(c)}),allConnectionChannels:async i=>{var d;const c=[];let a,u;do a=await n.ConnectionChannels({connection:i,pagination:(0,K.createPagination)(u)}),c.push(...a.channels),u=(d=a.pagination)==null?void 0:d.nextKey;while(u&&u.length);return kt.QueryConnectionChannelsResponse.fromPartial({channels:c,height:a.height})},clientState:async(i,c)=>n.ChannelClientState({portId:i,channelId:c}),consensusState:async(i,c,a,u)=>n.ChannelConsensusState({portId:i,channelId:c,revisionNumber:BigInt(a),revisionHeight:BigInt(u)}),packetCommitment:async(i,c,a)=>n.PacketCommitment({portId:i,channelId:c,sequence:(0,K.longify)(a)}),packetCommitments:async(i,c,a)=>n.PacketCommitments({channelId:c,portId:i,pagination:(0,K.createPagination)(a)}),allPacketCommitments:async(i,c)=>{var y;const a=[];let u,d;do u=await n.PacketCommitments({channelId:c,portId:i,pagination:(0,K.createPagination)(d)}),a.push(...u.commitments),d=(y=u.pagination)==null?void 0:y.nextKey;while(d&&d.length);return kt.QueryPacketCommitmentsResponse.fromPartial({commitments:a,height:u.height})},packetReceipt:async(i,c,a)=>n.PacketReceipt({portId:i,channelId:c,sequence:(0,K.longify)(a)}),packetAcknowledgement:async(i,c,a)=>n.PacketAcknowledgement({portId:i,channelId:c,sequence:(0,K.longify)(a)}),packetAcknowledgements:async(i,c,a)=>{const u=kt.QueryPacketAcknowledgementsRequest.fromPartial({portId:i,channelId:c,pagination:(0,K.createPagination)(a)});return n.PacketAcknowledgements(u)},allPacketAcknowledgements:async(i,c)=>{var y;const a=[];let u,d;do{const M=kt.QueryPacketAcknowledgementsRequest.fromPartial({channelId:c,portId:i,pagination:(0,K.createPagination)(d)});u=await n.PacketAcknowledgements(M),a.push(...u.acknowledgements),d=(y=u.pagination)==null?void 0:y.nextKey}while(d&&d.length);return kt.QueryPacketAcknowledgementsResponse.fromPartial({acknowledgements:a,height:u.height})},unreceivedPackets:async(i,c,a)=>n.UnreceivedPackets({portId:i,channelId:c,packetCommitmentSequences:a.map(u=>BigInt(u))}),unreceivedAcks:async(i,c,a)=>n.UnreceivedAcks({portId:i,channelId:c,packetAckSequences:a.map(u=>BigInt(u))}),nextSequenceReceive:async(i,c)=>n.NextSequenceReceive({portId:i,channelId:c})},client:{state:async i=>r.ClientState({clientId:i}),states:async i=>r.ClientStates({pagination:(0,K.createPagination)(i)}),allStates:async()=>{var u;const i=[];let c,a;do c=await r.ClientStates({pagination:(0,K.createPagination)(a)}),i.push(...c.clientStates),a=(u=c.pagination)==null?void 0:u.nextKey;while(a&&a.length);return On.QueryClientStatesResponse.fromPartial({clientStates:i})},consensusState:async(i,c)=>r.ConsensusState(On.QueryConsensusStateRequest.fromPartial({clientId:i,revisionHeight:c!==void 0?BigInt(c):void 0,latestHeight:c===void 0})),consensusStates:async(i,c)=>r.ConsensusStates({clientId:i,pagination:(0,K.createPagination)(c)}),allConsensusStates:async i=>{var d;const c=[];let a,u;do a=await r.ConsensusStates({clientId:i,pagination:(0,K.createPagination)(u)}),c.push(...a.consensusStates),u=(d=a.pagination)==null?void 0:d.nextKey;while(u&&u.length);return On.QueryConsensusStatesResponse.fromPartial({consensusStates:c})},params:async()=>r.ClientParams({}),stateTm:async i=>{const c=await r.ClientState({clientId:i});return Yo(c.clientState)},statesTm:async i=>{const{clientStates:c}=await r.ClientStates({pagination:(0,K.createPagination)(i)});return c.map(({clientState:a})=>Yo(a))},allStatesTm:async()=>{var u;const i=[];let c,a;do c=await r.ClientStates({pagination:(0,K.createPagination)(a)}),i.push(...c.clientStates),a=(u=c.pagination)==null?void 0:u.nextKey;while(a&&a.length);return i.map(({clientState:d})=>Yo(d))},consensusStateTm:async(i,c)=>{const a=await r.ConsensusState(On.QueryConsensusStateRequest.fromPartial({clientId:i,revisionHeight:c==null?void 0:c.revisionHeight,revisionNumber:c==null?void 0:c.revisionNumber,latestHeight:c===void 0}));return jm(a.consensusState)}},connection:{connection:async i=>o.Connection({connectionId:i}),connections:async i=>o.Connections({pagination:(0,K.createPagination)(i)}),allConnections:async()=>{var u;const i=[];let c,a;do c=await o.Connections({pagination:(0,K.createPagination)(a)}),i.push(...c.connections),a=(u=c.pagination)==null?void 0:u.nextKey;while(a&&a.length);return Xo.QueryConnectionsResponse.fromPartial({connections:i,height:c.height})},clientConnections:async i=>o.ClientConnections({clientId:i}),clientState:async i=>o.ConnectionClientState({connectionId:i}),consensusState:async(i,c)=>o.ConnectionConsensusState(Xo.QueryConnectionConsensusStateRequest.fromPartial({connectionId:i,revisionHeight:BigInt(c)}))},transfer:{denomTrace:async i=>s.DenomTrace({hash:i}),denomTraces:async i=>s.DenomTraces({pagination:(0,K.createPagination)(i)}),allDenomTraces:async()=>{var u;const i=[];let c,a;do c=await s.DenomTraces({pagination:(0,K.createPagination)(a)}),i.push(...c.denomTraces),a=(u=c.pagination)==null?void 0:u.nextKey;while(a&&a.length);return Ci.QueryDenomTracesResponse.fromPartial({denomTraces:i})},params:async()=>s.Params({})},verified:{channel:{channel:async(i,c)=>{const a=(0,gr.toAscii)(`channelEnds/ports/${i}/channels/${c}`),{value:u}=await e.queryStoreVerified("ibc",a);return u.length?Cm.Channel.decode(u):null},packetCommitment:async(i,c,a)=>{const u=(0,gr.toAscii)(`commitments/ports/${i}/channels/${c}/packets/${a}`),{value:d}=await e.queryStoreVerified("ibc",u);return d},packetAcknowledgement:async(i,c,a)=>{const u=(0,gr.toAscii)(`acks/ports/${i}/channels/${c}/acknowledgements/${a}`),{value:d}=await e.queryStoreVerified("ibc",u);return d},nextSequenceReceive:async(i,c)=>{const a=(0,gr.toAscii)(`seqAcks/ports/${i}/channels/${c}/nextSequenceAck`),{value:u}=await e.queryStoreVerified("ibc",a);return u.length?Em.Uint64.fromBytes(u).toNumber():null}}}}}}fo.setupIbcExtension=Mm;var ho={};Object.defineProperty(ho,"__esModule",{value:!0});ho.setupMintExtension=void 0;const Om=X,Bm=p.query$10,_t=ce;function Rm(e){const t=(0,_t.createProtobufRpcClient)(e),n=new Bm.QueryClientImpl(t);return{mint:{params:async()=>{const{params:r}=await n.Params({});return(0,Om.assert)(r),{blocksPerYear:r.blocksPerYear,goalBonded:(0,_t.decodeCosmosSdkDecFromProto)(r.goalBonded),inflationMin:(0,_t.decodeCosmosSdkDecFromProto)(r.inflationMin),inflationMax:(0,_t.decodeCosmosSdkDecFromProto)(r.inflationMax),inflationRateChange:(0,_t.decodeCosmosSdkDecFromProto)(r.inflationRateChange),mintDenom:r.mintDenom}},inflation:async()=>{const{inflation:r}=await n.Inflation({});return(0,_t.decodeCosmosSdkDecFromProto)(r)},annualProvisions:async()=>{const{annualProvisions:r}=await n.AnnualProvisions({});return(0,_t.decodeCosmosSdkDecFromProto)(r)}}}}ho.setupMintExtension=Rm;var an={};Object.defineProperty(an,"__esModule",{value:!0});an.createSlashingAminoConverters=an.isAminoMsgUnjail=void 0;function Im(e){return e.type==="cosmos-sdk/MsgUnjail"}an.isAminoMsgUnjail=Im;function $m(){throw new Error("Not implemented")}an.createSlashingAminoConverters=$m;var po={};Object.defineProperty(po,"__esModule",{value:!0});po.setupSlashingExtension=void 0;const Nm=p.query$11,ji=ce;function Dm(e){const t=(0,ji.createProtobufRpcClient)(e),n=new Nm.QueryClientImpl(t);return{slashing:{signingInfo:async r=>await n.SigningInfo({consAddress:r}),signingInfos:async r=>await n.SigningInfos({pagination:(0,ji.createPagination)(r)}),params:async()=>await n.Params({})}}}po.setupSlashingExtension=Dm;var Y={};Object.defineProperty(Y,"__esModule",{value:!0});Y.createStakingAminoConverters=Y.isAminoMsgCancelUnbondingDelegation=Y.isAminoMsgUndelegate=Y.isAminoMsgBeginRedelegate=Y.isAminoMsgDelegate=Y.isAminoMsgEditValidator=Y.isAminoMsgCreateValidator=Y.protoDecimalToJson=void 0;const ja=te,Mi=vt,tt=X;function In(e){const t=ja.Decimal.fromAtomics(e,18),[n,r]=t.toString().split(".");return`${n}.${(r??"").padEnd(18,"0")}`}Y.protoDecimalToJson=In;function yr(e){return ja.Decimal.fromUserInput(e,18).atomics}function xm(e){return e.type==="cosmos-sdk/MsgCreateValidator"}Y.isAminoMsgCreateValidator=xm;function Um(e){return e.type==="cosmos-sdk/MsgEditValidator"}Y.isAminoMsgEditValidator=Um;function qm(e){return e.type==="cosmos-sdk/MsgDelegate"}Y.isAminoMsgDelegate=qm;function Hm(e){return e.type==="cosmos-sdk/MsgBeginRedelegate"}Y.isAminoMsgBeginRedelegate=Hm;function Vm(e){return e.type==="cosmos-sdk/MsgUndelegate"}Y.isAminoMsgUndelegate=Vm;function Gm(e){return e.type==="cosmos-sdk/MsgCancelUnbondingDelegation"}Y.isAminoMsgCancelUnbondingDelegation=Gm;function Fm(){return{"/cosmos.staking.v1beta1.MsgBeginRedelegate":{aminoType:"cosmos-sdk/MsgBeginRedelegate",toAmino:({delegatorAddress:e,validatorSrcAddress:t,validatorDstAddress:n,amount:r})=>((0,tt.assertDefinedAndNotNull)(r,"missing amount"),{delegator_address:e,validator_src_address:t,validator_dst_address:n,amount:r}),fromAmino:({delegator_address:e,validator_src_address:t,validator_dst_address:n,amount:r})=>({delegatorAddress:e,validatorSrcAddress:t,validatorDstAddress:n,amount:r})},"/cosmos.staking.v1beta1.MsgCreateValidator":{aminoType:"cosmos-sdk/MsgCreateValidator",toAmino:({description:e,commission:t,minSelfDelegation:n,delegatorAddress:r,validatorAddress:o,pubkey:s,value:i})=>((0,tt.assertDefinedAndNotNull)(e,"missing description"),(0,tt.assertDefinedAndNotNull)(t,"missing commission"),(0,tt.assertDefinedAndNotNull)(s,"missing pubkey"),(0,tt.assertDefinedAndNotNull)(i,"missing value"),{description:{moniker:e.moniker,identity:e.identity,website:e.website,security_contact:e.securityContact,details:e.details},commission:{rate:In(t.rate),max_rate:In(t.maxRate),max_change_rate:In(t.maxChangeRate)},min_self_delegation:n,delegator_address:r,validator_address:o,pubkey:(0,Mi.decodePubkey)(s),value:i}),fromAmino:({description:e,commission:t,min_self_delegation:n,delegator_address:r,validator_address:o,pubkey:s,value:i})=>({description:{moniker:e.moniker,identity:e.identity,website:e.website,securityContact:e.security_contact,details:e.details},commission:{rate:yr(t.rate),maxRate:yr(t.max_rate),maxChangeRate:yr(t.max_change_rate)},minSelfDelegation:n,delegatorAddress:r,validatorAddress:o,pubkey:(0,Mi.encodePubkey)(s),value:i})},"/cosmos.staking.v1beta1.MsgDelegate":{aminoType:"cosmos-sdk/MsgDelegate",toAmino:({delegatorAddress:e,validatorAddress:t,amount:n})=>((0,tt.assertDefinedAndNotNull)(n,"missing amount"),{delegator_address:e,validator_address:t,amount:n}),fromAmino:({delegator_address:e,validator_address:t,amount:n})=>({delegatorAddress:e,validatorAddress:t,amount:n})},"/cosmos.staking.v1beta1.MsgEditValidator":{aminoType:"cosmos-sdk/MsgEditValidator",toAmino:({description:e,commissionRate:t,minSelfDelegation:n,validatorAddress:r})=>((0,tt.assertDefinedAndNotNull)(e,"missing description"),{description:{moniker:e.moniker,identity:e.identity,website:e.website,security_contact:e.securityContact,details:e.details},commission_rate:t?In(t):void 0,min_self_delegation:n||void 0,validator_address:r}),fromAmino:({description:e,commission_rate:t,min_self_delegation:n,validator_address:r})=>({description:{moniker:e.moniker,identity:e.identity,website:e.website,securityContact:e.security_contact,details:e.details},commissionRate:t?yr(t):"",minSelfDelegation:n??"",validatorAddress:r})},"/cosmos.staking.v1beta1.MsgUndelegate":{aminoType:"cosmos-sdk/MsgUndelegate",toAmino:({delegatorAddress:e,validatorAddress:t,amount:n})=>((0,tt.assertDefinedAndNotNull)(n,"missing amount"),{delegator_address:e,validator_address:t,amount:n}),fromAmino:({delegator_address:e,validator_address:t,amount:n})=>({delegatorAddress:e,validatorAddress:t,amount:n})},"/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation":{aminoType:"cosmos-sdk/MsgCancelUnbondingDelegation",toAmino:({delegatorAddress:e,validatorAddress:t,amount:n,creationHeight:r})=>((0,tt.assertDefinedAndNotNull)(n,"missing amount"),{delegator_address:e,validator_address:t,amount:n,creation_height:r.toString()}),fromAmino:({delegator_address:e,validator_address:t,amount:n,creation_height:r})=>({delegatorAddress:e,validatorAddress:t,amount:n,creationHeight:BigInt(r)})}}}Y.createStakingAminoConverters=Fm;var se={};Object.defineProperty(se,"__esModule",{value:!0});se.isMsgCancelUnbondingDelegationEncodeObject=se.isMsgUndelegateEncodeObject=se.isMsgEditValidatorEncodeObject=se.isMsgDelegateEncodeObject=se.isMsgCreateValidatorEncodeObject=se.isMsgBeginRedelegateEncodeObject=se.stakingTypes=void 0;const Nt=p.tx$12;se.stakingTypes=[["/cosmos.staking.v1beta1.MsgBeginRedelegate",Nt.MsgBeginRedelegate],["/cosmos.staking.v1beta1.MsgCreateValidator",Nt.MsgCreateValidator],["/cosmos.staking.v1beta1.MsgDelegate",Nt.MsgDelegate],["/cosmos.staking.v1beta1.MsgEditValidator",Nt.MsgEditValidator],["/cosmos.staking.v1beta1.MsgUndelegate",Nt.MsgUndelegate],["/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation",Nt.MsgCancelUnbondingDelegation]];function Wm(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgBeginRedelegate"}se.isMsgBeginRedelegateEncodeObject=Wm;function Jm(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgCreateValidator"}se.isMsgCreateValidatorEncodeObject=Jm;function Lm(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgDelegate"}se.isMsgDelegateEncodeObject=Lm;function zm(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgEditValidator"}se.isMsgEditValidatorEncodeObject=zm;function Km(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgUndelegate"}se.isMsgUndelegateEncodeObject=Km;function Qm(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation"}se.isMsgCancelUnbondingDelegationEncodeObject=Qm;var go={};Object.defineProperty(go,"__esModule",{value:!0});go.setupStakingExtension=void 0;const Zm=p.query$12,ut=ce;function Xm(e){const t=(0,ut.createProtobufRpcClient)(e),n=new Zm.QueryClientImpl(t);return{staking:{delegation:async(r,o)=>await n.Delegation({delegatorAddr:r,validatorAddr:o}),delegatorDelegations:async(r,o)=>await n.DelegatorDelegations({delegatorAddr:r,pagination:(0,ut.createPagination)(o)}),delegatorUnbondingDelegations:async(r,o)=>await n.DelegatorUnbondingDelegations({delegatorAddr:r,pagination:(0,ut.createPagination)(o)}),delegatorValidator:async(r,o)=>await n.DelegatorValidator({delegatorAddr:r,validatorAddr:o}),delegatorValidators:async(r,o)=>await n.DelegatorValidators({delegatorAddr:r,pagination:(0,ut.createPagination)(o)}),historicalInfo:async r=>await n.HistoricalInfo({height:BigInt(r)}),params:async()=>await n.Params({}),pool:async()=>await n.Pool({}),redelegations:async(r,o,s,i)=>await n.Redelegations({delegatorAddr:r,srcValidatorAddr:o,dstValidatorAddr:s,pagination:(0,ut.createPagination)(i)}),unbondingDelegation:async(r,o)=>await n.UnbondingDelegation({delegatorAddr:r,validatorAddr:o}),validator:async r=>await n.Validator({validatorAddr:r}),validatorDelegations:async(r,o)=>await n.ValidatorDelegations({validatorAddr:r,pagination:(0,ut.createPagination)(o)}),validators:async(r,o)=>await n.Validators({status:r,pagination:(0,ut.createPagination)(o)}),validatorUnbondingDelegations:async(r,o)=>await n.ValidatorUnbondingDelegations({validatorAddr:r,pagination:(0,ut.createPagination)(o)})}}}go.setupStakingExtension=Xm;var yo={};Object.defineProperty(yo,"__esModule",{value:!0});yo.setupTxExtension=void 0;const Ym=vt,ef=p.signing,Oi=p.service,Bn=p.tx,tf=ce;function nf(e){const t=(0,tf.createProtobufRpcClient)(e),n=new Oi.ServiceClientImpl(t);return{tx:{getTx:async r=>{const o={hash:r};return await n.GetTx(o)},simulate:async(r,o,s,i)=>{const c=Bn.Tx.fromPartial({authInfo:Bn.AuthInfo.fromPartial({fee:Bn.Fee.fromPartial({}),signerInfos:[{publicKey:(0,Ym.encodePubkey)(s),sequence:BigInt(i),modeInfo:{single:{mode:ef.SignMode.SIGN_MODE_UNSPECIFIED}}}]}),body:Bn.TxBody.fromPartial({messages:Array.from(r),memo:o}),signatures:[new Uint8Array]}),a=Oi.SimulateRequest.fromPartial({txBytes:Bn.Tx.encode(c).finish()});return await n.Simulate(a)}}}}yo.setupTxExtension=nf;var cn={};Object.defineProperty(cn,"__esModule",{value:!0});cn.createVestingAminoConverters=cn.isAminoMsgCreateVestingAccount=void 0;function rf(e){return e.type==="cosmos-sdk/MsgCreateVestingAccount"}cn.isAminoMsgCreateVestingAccount=rf;function of(){return{"/cosmos.vesting.v1beta1.MsgCreateVestingAccount":{aminoType:"cosmos-sdk/MsgCreateVestingAccount",toAmino:({fromAddress:e,toAddress:t,amount:n,endTime:r,delayed:o})=>({from_address:e,to_address:t,amount:[...n],end_time:r.toString(),delayed:o}),fromAmino:({from_address:e,to_address:t,amount:n,end_time:r,delayed:o})=>({fromAddress:e,toAddress:t,amount:[...n],endTime:BigInt(r),delayed:o})}}}cn.createVestingAminoConverters=of;var bo={};Object.defineProperty(bo,"__esModule",{value:!0});bo.vestingTypes=void 0;const sf=p.tx$13;bo.vestingTypes=[["/cosmos.vesting.v1beta1.MsgCreateVestingAccount",sf.MsgCreateVestingAccount]];(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isAminoMsgCreateValidator=e.isAminoMsgBeginRedelegate=e.createStakingAminoConverters=e.setupSlashingExtension=e.isAminoMsgUnjail=e.createSlashingAminoConverters=e.setupMintExtension=e.setupIbcExtension=e.isMsgTransferEncodeObject=e.ibcTypes=e.isAminoMsgTransfer=e.createIbcAminoConverters=e.groupTypes=e.createGroupAminoConverters=e.setupGovExtension=e.isMsgVoteWeightedEncodeObject=e.isMsgVoteEncodeObject=e.isMsgSubmitProposalEncodeObject=e.isMsgDepositEncodeObject=e.govTypes=e.isAminoMsgVoteWeighted=e.isAminoMsgVote=e.isAminoMsgSubmitProposal=e.isAminoMsgDeposit=e.createGovAminoConverters=e.setupFeegrantExtension=e.feegrantTypes=e.createFeegrantAminoConverters=e.isAminoMsgSubmitEvidence=e.createEvidenceAminoConverters=e.setupDistributionExtension=e.isMsgWithdrawDelegatorRewardEncodeObject=e.distributionTypes=e.isAminoMsgWithdrawValidatorCommission=e.isAminoMsgWithdrawDelegatorReward=e.isAminoMsgSetWithdrawAddress=e.isAminoMsgFundCommunityPool=e.createDistributionAminoConverters=e.isAminoMsgVerifyInvariant=e.createCrysisAminoConverters=e.setupBankExtension=e.isMsgSendEncodeObject=e.bankTypes=e.isAminoMsgSend=e.isAminoMsgMultiSend=e.createBankAminoConverters=e.setupAuthzExtension=e.authzTypes=e.createAuthzAminoConverters=e.setupAuthExtension=void 0,e.vestingTypes=e.isAminoMsgCreateVestingAccount=e.createVestingAminoConverters=e.setupTxExtension=e.setupStakingExtension=e.stakingTypes=e.isMsgUndelegateEncodeObject=e.isMsgEditValidatorEncodeObject=e.isMsgDelegateEncodeObject=e.isMsgCreateValidatorEncodeObject=e.isMsgCancelUnbondingDelegationEncodeObject=e.isMsgBeginRedelegateEncodeObject=e.isAminoMsgUndelegate=e.isAminoMsgEditValidator=e.isAminoMsgDelegate=void 0;var t=zr;Object.defineProperty(e,"setupAuthExtension",{enumerable:!0,get:function(){return t.setupAuthExtension}});var n=to;Object.defineProperty(e,"createAuthzAminoConverters",{enumerable:!0,get:function(){return n.createAuthzAminoConverters}});var r=no;Object.defineProperty(e,"authzTypes",{enumerable:!0,get:function(){return r.authzTypes}});var o=ro;Object.defineProperty(e,"setupAuthzExtension",{enumerable:!0,get:function(){return o.setupAuthzExtension}});var s=ht;Object.defineProperty(e,"createBankAminoConverters",{enumerable:!0,get:function(){return s.createBankAminoConverters}}),Object.defineProperty(e,"isAminoMsgMultiSend",{enumerable:!0,get:function(){return s.isAminoMsgMultiSend}}),Object.defineProperty(e,"isAminoMsgSend",{enumerable:!0,get:function(){return s.isAminoMsgSend}});var i=en;Object.defineProperty(e,"bankTypes",{enumerable:!0,get:function(){return i.bankTypes}}),Object.defineProperty(e,"isMsgSendEncodeObject",{enumerable:!0,get:function(){return i.isMsgSendEncodeObject}});var c=oo;Object.defineProperty(e,"setupBankExtension",{enumerable:!0,get:function(){return c.setupBankExtension}});var a=tn;Object.defineProperty(e,"createCrysisAminoConverters",{enumerable:!0,get:function(){return a.createCrysisAminoConverters}}),Object.defineProperty(e,"isAminoMsgVerifyInvariant",{enumerable:!0,get:function(){return a.isAminoMsgVerifyInvariant}});var u=Oe;Object.defineProperty(e,"createDistributionAminoConverters",{enumerable:!0,get:function(){return u.createDistributionAminoConverters}}),Object.defineProperty(e,"isAminoMsgFundCommunityPool",{enumerable:!0,get:function(){return u.isAminoMsgFundCommunityPool}}),Object.defineProperty(e,"isAminoMsgSetWithdrawAddress",{enumerable:!0,get:function(){return u.isAminoMsgSetWithdrawAddress}}),Object.defineProperty(e,"isAminoMsgWithdrawDelegatorReward",{enumerable:!0,get:function(){return u.isAminoMsgWithdrawDelegatorReward}}),Object.defineProperty(e,"isAminoMsgWithdrawValidatorCommission",{enumerable:!0,get:function(){return u.isAminoMsgWithdrawValidatorCommission}});var d=nn;Object.defineProperty(e,"distributionTypes",{enumerable:!0,get:function(){return d.distributionTypes}}),Object.defineProperty(e,"isMsgWithdrawDelegatorRewardEncodeObject",{enumerable:!0,get:function(){return d.isMsgWithdrawDelegatorRewardEncodeObject}});var y=so;Object.defineProperty(e,"setupDistributionExtension",{enumerable:!0,get:function(){return y.setupDistributionExtension}});var M=rn;Object.defineProperty(e,"createEvidenceAminoConverters",{enumerable:!0,get:function(){return M.createEvidenceAminoConverters}}),Object.defineProperty(e,"isAminoMsgSubmitEvidence",{enumerable:!0,get:function(){return M.isAminoMsgSubmitEvidence}});var _=io;Object.defineProperty(e,"createFeegrantAminoConverters",{enumerable:!0,get:function(){return _.createFeegrantAminoConverters}});var G=ao;Object.defineProperty(e,"feegrantTypes",{enumerable:!0,get:function(){return G.feegrantTypes}});var b=co;Object.defineProperty(e,"setupFeegrantExtension",{enumerable:!0,get:function(){return b.setupFeegrantExtension}});var g=Be;Object.defineProperty(e,"createGovAminoConverters",{enumerable:!0,get:function(){return g.createGovAminoConverters}}),Object.defineProperty(e,"isAminoMsgDeposit",{enumerable:!0,get:function(){return g.isAminoMsgDeposit}}),Object.defineProperty(e,"isAminoMsgSubmitProposal",{enumerable:!0,get:function(){return g.isAminoMsgSubmitProposal}}),Object.defineProperty(e,"isAminoMsgVote",{enumerable:!0,get:function(){return g.isAminoMsgVote}}),Object.defineProperty(e,"isAminoMsgVoteWeighted",{enumerable:!0,get:function(){return g.isAminoMsgVoteWeighted}});var w=Re;Object.defineProperty(e,"govTypes",{enumerable:!0,get:function(){return w.govTypes}}),Object.defineProperty(e,"isMsgDepositEncodeObject",{enumerable:!0,get:function(){return w.isMsgDepositEncodeObject}}),Object.defineProperty(e,"isMsgSubmitProposalEncodeObject",{enumerable:!0,get:function(){return w.isMsgSubmitProposalEncodeObject}}),Object.defineProperty(e,"isMsgVoteEncodeObject",{enumerable:!0,get:function(){return w.isMsgVoteEncodeObject}}),Object.defineProperty(e,"isMsgVoteWeightedEncodeObject",{enumerable:!0,get:function(){return w.isMsgVoteWeightedEncodeObject}});var q=uo;Object.defineProperty(e,"setupGovExtension",{enumerable:!0,get:function(){return q.setupGovExtension}});var x=lo;Object.defineProperty(e,"createGroupAminoConverters",{enumerable:!0,get:function(){return x.createGroupAminoConverters}});var ue=mo;Object.defineProperty(e,"groupTypes",{enumerable:!0,get:function(){return ue.groupTypes}});var v=on;Object.defineProperty(e,"createIbcAminoConverters",{enumerable:!0,get:function(){return v.createIbcAminoConverters}}),Object.defineProperty(e,"isAminoMsgTransfer",{enumerable:!0,get:function(){return v.isAminoMsgTransfer}});var S=sn;Object.defineProperty(e,"ibcTypes",{enumerable:!0,get:function(){return S.ibcTypes}}),Object.defineProperty(e,"isMsgTransferEncodeObject",{enumerable:!0,get:function(){return S.isMsgTransferEncodeObject}});var k=fo;Object.defineProperty(e,"setupIbcExtension",{enumerable:!0,get:function(){return k.setupIbcExtension}});var U=ho;Object.defineProperty(e,"setupMintExtension",{enumerable:!0,get:function(){return U.setupMintExtension}});var H=an;Object.defineProperty(e,"createSlashingAminoConverters",{enumerable:!0,get:function(){return H.createSlashingAminoConverters}}),Object.defineProperty(e,"isAminoMsgUnjail",{enumerable:!0,get:function(){return H.isAminoMsgUnjail}});var V=po;Object.defineProperty(e,"setupSlashingExtension",{enumerable:!0,get:function(){return V.setupSlashingExtension}});var F=Y;Object.defineProperty(e,"createStakingAminoConverters",{enumerable:!0,get:function(){return F.createStakingAminoConverters}}),Object.defineProperty(e,"isAminoMsgBeginRedelegate",{enumerable:!0,get:function(){return F.isAminoMsgBeginRedelegate}}),Object.defineProperty(e,"isAminoMsgCreateValidator",{enumerable:!0,get:function(){return F.isAminoMsgCreateValidator}}),Object.defineProperty(e,"isAminoMsgDelegate",{enumerable:!0,get:function(){return F.isAminoMsgDelegate}}),Object.defineProperty(e,"isAminoMsgEditValidator",{enumerable:!0,get:function(){return F.isAminoMsgEditValidator}}),Object.defineProperty(e,"isAminoMsgUndelegate",{enumerable:!0,get:function(){return F.isAminoMsgUndelegate}});var z=se;Object.defineProperty(e,"isMsgBeginRedelegateEncodeObject",{enumerable:!0,get:function(){return z.isMsgBeginRedelegateEncodeObject}}),Object.defineProperty(e,"isMsgCancelUnbondingDelegationEncodeObject",{enumerable:!0,get:function(){return z.isMsgCancelUnbondingDelegationEncodeObject}}),Object.defineProperty(e,"isMsgCreateValidatorEncodeObject",{enumerable:!0,get:function(){return z.isMsgCreateValidatorEncodeObject}}),Object.defineProperty(e,"isMsgDelegateEncodeObject",{enumerable:!0,get:function(){return z.isMsgDelegateEncodeObject}}),Object.defineProperty(e,"isMsgEditValidatorEncodeObject",{enumerable:!0,get:function(){return z.isMsgEditValidatorEncodeObject}}),Object.defineProperty(e,"isMsgUndelegateEncodeObject",{enumerable:!0,get:function(){return z.isMsgUndelegateEncodeObject}}),Object.defineProperty(e,"stakingTypes",{enumerable:!0,get:function(){return z.stakingTypes}});var Z=go;Object.defineProperty(e,"setupStakingExtension",{enumerable:!0,get:function(){return Z.setupStakingExtension}});var Se=yo;Object.defineProperty(e,"setupTxExtension",{enumerable:!0,get:function(){return Se.setupTxExtension}});var at=cn;Object.defineProperty(e,"createVestingAminoConverters",{enumerable:!0,get:function(){return at.createVestingAminoConverters}}),Object.defineProperty(e,"isAminoMsgCreateVestingAccount",{enumerable:!0,get:function(){return at.isAminoMsgCreateVestingAccount}});var vn=bo;Object.defineProperty(e,"vestingTypes",{enumerable:!0,get:function(){return vn.vestingTypes}})})(qn);var pt={};Object.defineProperty(pt,"__esModule",{value:!0});pt.makeMultisignedTxBytes=pt.makeMultisignedTx=pt.makeCompactBitArray=void 0;const af=st,cf=D,uf=vt,ys=p.multisig,lf=p.signing,Bi=p.tx,Ma=p.tx;function Oa(e){const t=Math.ceil(e.length/8),n=e.length-Math.floor(e.length/8)*8,r=new Uint8Array(t);return e.forEach((o,s)=>{const i=Math.floor(s/8),c=s%8;o&&(r[i]|=1<<7-c)}),ys.CompactBitArray.fromPartial({elems:r,extraBitsStored:n})}pt.makeCompactBitArray=Oa;function Ba(e,t,n,r,o){const s=Array.from(o.keys()),i=(0,cf.fromBech32)(s[0]).prefix,c=Array(e.value.pubkeys.length).fill(!1),a=new Array;for(let _=0;_<e.value.pubkeys.length;_++){const G=(0,af.pubkeyToAddress)(e.value.pubkeys[_],i),b=o.get(G);b&&(c[_]=!0,a.push(b))}const u={publicKey:(0,uf.encodePubkey)(e),modeInfo:{multi:{bitarray:Oa(c),modeInfos:a.map(_=>({single:{mode:lf.SignMode.SIGN_MODE_LEGACY_AMINO_JSON}}))}},sequence:BigInt(t)},d=Bi.AuthInfo.fromPartial({signerInfos:[u],fee:{amount:[...n.amount],gasLimit:BigInt(n.gas)}}),y=Bi.AuthInfo.encode(d).finish();return Ma.TxRaw.fromPartial({bodyBytes:r,authInfoBytes:y,signatures:[ys.MultiSignature.encode(ys.MultiSignature.fromPartial({signatures:a})).finish()]})}pt.makeMultisignedTx=Ba;function df(e,t,n,r,o){const s=Ba(e,t,n,r,o);return Uint8Array.from(Ma.TxRaw.encode(s).finish())}pt.makeMultisignedTxBytes=df;var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.isSearchTxQueryArray=void 0;function mf(e){return Array.isArray(e)}Zn.isSearchTxQueryArray=mf;var Ra={},Us={},Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.pubkeyToAddress=Ze.pubkeyToRawAddress=Ze.rawSecp256k1PubkeyToRawAddress=Ze.rawEd25519PubkeyToRawAddress=void 0;const bs=_e,ff=D;function Ia(e){if(e.length!==32)throw new Error(`Invalid Ed25519 pubkey length: ${e.length}`);return(0,bs.sha256)(e).slice(0,20)}Ze.rawEd25519PubkeyToRawAddress=Ia;function $a(e){if(e.length!==33)throw new Error(`Invalid Secp256k1 pubkey length (compressed): ${e.length}`);return(0,bs.ripemd160)((0,bs.sha256)(e))}Ze.rawSecp256k1PubkeyToRawAddress=$a;function Na(e,t){switch(e){case"ed25519":return Ia(t);case"secp256k1":return $a(t);default:throw new Error(`Pubkey type ${e} not supported`)}}Ze.pubkeyToRawAddress=Na;function hf(e,t){return(0,ff.toHex)(Na(e,t)).toUpperCase()}Ze.pubkeyToAddress=hf;var ae={};Object.defineProperty(ae,"__esModule",{value:!0});ae.DateTime=ae.toSeconds=ae.fromSeconds=ae.toRfc3339WithNanoseconds=ae.fromRfc3339WithNanoseconds=void 0;const pf=D,gf=te;function Da(e){const t=(0,pf.fromRfc3339)(e),n=e.match(/\.(\d+)Z$/),r=n?n[1].slice(3):"";return t.nanoseconds=parseInt(r.padEnd(6,"0"),10),t}ae.fromRfc3339WithNanoseconds=Da;function xa(e){var r;const t=e.toISOString(),n=((r=e.nanoseconds)==null?void 0:r.toString())??"";return`${t.slice(0,-1)}${n.padStart(6,"0")}Z`}ae.toRfc3339WithNanoseconds=xa;function yf(e,t=0){const n=new gf.Uint32(t).toNumber();if(n>999999999)throw new Error("Nano seconds must not exceed 999999999");const r=new Date(e*1e3+Math.floor(n/1e6));return r.nanoseconds=n%1e6,r}ae.fromSeconds=yf;function bf(e){return{seconds:Math.floor(e.getTime()/1e3),nanos:e.getTime()%1e3*1e6+(e.nanoseconds??0)}}ae.toSeconds=bf;class vf{static decode(t){return Da(t)}static encode(t){return xa(t)}}ae.DateTime=vf;var jr={},vo={},it={};Object.defineProperty(it,"__esModule",{value:!0});it.createJsonRpcRequest=void 0;const Ri="123456789";function wf(){return Ri[Math.floor(Math.random()*Ri.length)]}function kf(){return parseInt(Array.from({length:12}).map(()=>wf()).join(""),10)}function _f(e,t){const n=t?{...t}:{};return{jsonrpc:"2.0",id:kf(),method:e,params:n}}it.createJsonRpcRequest=_f;var Xn={},wo={},ko={},_o={};Object.defineProperty(_o,"__esModule",{value:!0});_o.makeJsonRpcId=void 0;let Sf=1e4;function Pf(){return Sf+=1}_o.makeJsonRpcId=Pf;var So={},rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.jsonRpcCode=rt.isJsonRpcSuccessResponse=rt.isJsonRpcErrorResponse=void 0;function Ua(e){return typeof e.error=="object"}rt.isJsonRpcErrorResponse=Ua;function Af(e){return!Ua(e)}rt.isJsonRpcSuccessResponse=Af;rt.jsonRpcCode={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:{default:-32e3}};Object.defineProperty(So,"__esModule",{value:!0});So.JsonRpcClient=void 0;const Tf=Qn,Ef=rt;class Cf{constructor(t){this.connection=t}async run(t){const n=this.connection.responseStream.filter(s=>s.id===t.id),r=(0,Tf.firstEvent)(n);this.connection.sendRequest(t);const o=await r;if((0,Ef.isJsonRpcErrorResponse)(o)){const s=o.error;throw new Error(`JSON RPC error: code=${s.code}; message='${s.message}'`)}return o}}So.JsonRpcClient=Cf;var Ie={},gt={};Object.defineProperty(gt,"__esModule",{value:!0});gt.isJsonCompatibleDictionary=gt.isJsonCompatibleArray=gt.isJsonCompatibleValue=void 0;function qs(e){return!!(typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null||qa(e)||Ha(e))}gt.isJsonCompatibleValue=qs;function qa(e){if(!Array.isArray(e))return!1;for(const t of e)if(!qs(t))return!1;return!0}gt.isJsonCompatibleArray=qa;function Ha(e){return typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]"?!1:Object.values(e).every(qs)}gt.isJsonCompatibleDictionary=Ha;Object.defineProperty(Ie,"__esModule",{value:!0});Ie.parseJsonRpcResponse=Ie.parseJsonRpcSuccessResponse=Ie.parseJsonRpcErrorResponse=Ie.parseJsonRpcRequest=Ie.parseJsonRpcId=void 0;const yt=gt;function Va(e){if(!(0,yt.isJsonCompatibleDictionary)(e))throw new Error("Data must be JSON compatible dictionary");const t=e.id;return typeof t!="number"&&typeof t!="string"?null:t}Ie.parseJsonRpcId=Va;function jf(e){if(!(0,yt.isJsonCompatibleDictionary)(e))throw new Error("Data must be JSON compatible dictionary");if(e.jsonrpc!=="2.0")throw new Error(`Got unexpected jsonrpc version: ${e.jsonrpc}`);const t=Va(e);if(t===null)throw new Error("Invalid id field");const n=e.method;if(typeof n!="string")throw new Error("Invalid method field");if(!(0,yt.isJsonCompatibleArray)(e.params)&&!(0,yt.isJsonCompatibleDictionary)(e.params))throw new Error("Invalid params field");return{jsonrpc:"2.0",id:t,method:n,params:e.params}}Ie.parseJsonRpcRequest=jf;function Mf(e){if(typeof e.code!="number")throw new Error("Error property 'code' is not a number");if(typeof e.message!="string")throw new Error("Error property 'message' is not a string");let t;if(e.data===void 0)t=void 0;else if((0,yt.isJsonCompatibleValue)(e.data))t=e.data;else throw new Error("Error property 'data' is defined but not a JSON compatible value.");return{code:e.code,message:e.message,...t!==void 0?{data:t}:{}}}function Ga(e){if(!(0,yt.isJsonCompatibleDictionary)(e))throw new Error("Data must be JSON compatible dictionary");if(e.jsonrpc!=="2.0")throw new Error(`Got unexpected jsonrpc version: ${JSON.stringify(e)}`);const t=e.id;if(typeof t!="number"&&typeof t!="string"&&t!==null)throw new Error("Invalid id field");if(typeof e.error>"u"||!(0,yt.isJsonCompatibleDictionary)(e.error))throw new Error("Invalid error field");return{jsonrpc:"2.0",id:t,error:Mf(e.error)}}Ie.parseJsonRpcErrorResponse=Ga;function Fa(e){if(!(0,yt.isJsonCompatibleDictionary)(e))throw new Error("Data must be JSON compatible dictionary");if(e.jsonrpc!=="2.0")throw new Error(`Got unexpected jsonrpc version: ${JSON.stringify(e)}`);const t=e.id;if(typeof t!="number"&&typeof t!="string")throw new Error("Invalid id field");if(typeof e.result>"u")throw new Error("Invalid result field");const n=e.result;return{jsonrpc:"2.0",id:t,result:n}}Ie.parseJsonRpcSuccessResponse=Fa;function Of(e){let t;try{t=Ga(e)}catch{t=Fa(e)}return t}Ie.parseJsonRpcResponse=Of;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.jsonRpcCode=e.isJsonRpcSuccessResponse=e.isJsonRpcErrorResponse=e.parseJsonRpcSuccessResponse=e.parseJsonRpcResponse=e.parseJsonRpcRequest=e.parseJsonRpcId=e.parseJsonRpcErrorResponse=e.JsonRpcClient=e.makeJsonRpcId=void 0;var t=_o;Object.defineProperty(e,"makeJsonRpcId",{enumerable:!0,get:function(){return t.makeJsonRpcId}});var n=So;Object.defineProperty(e,"JsonRpcClient",{enumerable:!0,get:function(){return n.JsonRpcClient}});var r=Ie;Object.defineProperty(e,"parseJsonRpcErrorResponse",{enumerable:!0,get:function(){return r.parseJsonRpcErrorResponse}}),Object.defineProperty(e,"parseJsonRpcId",{enumerable:!0,get:function(){return r.parseJsonRpcId}}),Object.defineProperty(e,"parseJsonRpcRequest",{enumerable:!0,get:function(){return r.parseJsonRpcRequest}}),Object.defineProperty(e,"parseJsonRpcResponse",{enumerable:!0,get:function(){return r.parseJsonRpcResponse}}),Object.defineProperty(e,"parseJsonRpcSuccessResponse",{enumerable:!0,get:function(){return r.parseJsonRpcSuccessResponse}});var o=rt;Object.defineProperty(e,"isJsonRpcErrorResponse",{enumerable:!0,get:function(){return o.isJsonRpcErrorResponse}}),Object.defineProperty(e,"isJsonRpcSuccessResponse",{enumerable:!0,get:function(){return o.isJsonRpcSuccessResponse}}),Object.defineProperty(e,"jsonRpcCode",{enumerable:!0,get:function(){return o.jsonRpcCode}})})(ko);var Yn={},Bf=l.commonjsGlobal&&l.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.http=void 0;const Rf=Bf(p.require$$0$3);function If(e){if(e.status>=400)throw new Error(`Bad status on response: ${e.status}`);return e}function $f(e){return e.toString().includes("emitExperimentalWarning")}async function Nf(e,t,n,r){if(typeof fetch=="function"&&!$f(fetch)){const o={method:e,body:r?JSON.stringify(r):void 0,headers:{"Content-Type":"application/json",...n}};return fetch(t,o).then(If).then(s=>s.json())}else return Rf.default.request({url:t,method:e,data:r,headers:n}).then(o=>o.data)}Yn.http=Nf;var ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.hasProtocol=ot.instanceOfRpcStreamingClient=void 0;function Df(e){return typeof e.listen=="function"}ot.instanceOfRpcStreamingClient=Df;function xf(e){return e.search("://")!==-1}ot.hasProtocol=xf;Object.defineProperty(wo,"__esModule",{value:!0});wo.HttpBatchClient=void 0;const Ii=ko,Uf=Yn,qf=ot,$i={dispatchInterval:20,batchSizeLimit:20};class Hf{constructor(t,n={}){if(this.queue=[],this.options={batchSizeLimit:n.batchSizeLimit??$i.batchSizeLimit,dispatchInterval:n.dispatchInterval??$i.dispatchInterval},typeof t=="string"){if(!(0,qf.hasProtocol)(t))throw new Error("Endpoint URL is missing a protocol. Expected 'https://' or 'http://'.");this.url=t}else this.url=t.url,this.headers=t.headers;this.timer=setInterval(()=>this.tick(),n.dispatchInterval),this.validate()}disconnect(){this.timer&&clearInterval(this.timer),this.timer=void 0}async execute(t){return new Promise((n,r)=>{this.queue.push({request:t,resolve:n,reject:r}),this.queue.length>=this.options.batchSizeLimit&&this.tick()})}validate(){if(!this.options.batchSizeLimit||!Number.isSafeInteger(this.options.batchSizeLimit)||this.options.batchSizeLimit<1)throw new Error("batchSizeLimit must be a safe integer >= 1")}tick(){const t=this.queue.splice(0,this.options.batchSizeLimit);if(!t.length)return;const n=t.map(o=>o.request),r=n.map(o=>o.id);(0,Uf.http)("POST",this.url,this.headers,n).then(o=>{(Array.isArray(o)?o:[o]).forEach(i=>{const c=t.find(y=>y.request.id===i.id);if(!c)return;const{reject:a,resolve:u}=c,d=(0,Ii.parseJsonRpcResponse)(i);(0,Ii.isJsonRpcErrorResponse)(d)?a(new Error(JSON.stringify(d.error))):u(d)})},o=>{for(const s of r){const i=t.find(c=>c.request.id===s);if(!i)return;i.reject(o)}})}}wo.HttpBatchClient=Hf;var Po={};Object.defineProperty(Po,"__esModule",{value:!0});Po.HttpClient=void 0;const Ni=ko,Vf=Yn,Gf=ot;class Ff{constructor(t){if(typeof t=="string"){if(!(0,Gf.hasProtocol)(t))throw new Error("Endpoint URL is missing a protocol. Expected 'https://' or 'http://'.");this.url=t}else this.url=t.url,this.headers=t.headers}disconnect(){}async execute(t){const n=(0,Ni.parseJsonRpcResponse)(await(0,Vf.http)("POST",this.url,this.headers,t));if((0,Ni.isJsonRpcErrorResponse)(n))throw new Error(JSON.stringify(n.error));return n}}Po.HttpClient=Ff;var Ao={},Wa={},Hs={},er={},tr={},Wf=l.commonjsGlobal&&l.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tr,"__esModule",{value:!0});tr.SocketWrapper=void 0;const Dt=Wf(p.browser);function Jf(){return typeof l.dist.process<"u"&&typeof l.dist.process.versions<"u"&&typeof l.dist.process.versions.node<"u"}class Lf{constructor(t,n,r,o,s,i=1e4){this.closed=!1,this.connected=new Promise((c,a)=>{this.connectedResolver=c,this.connectedRejecter=a}),this.url=t,this.messageHandler=n,this.errorHandler=r,this.openHandler=o,this.closeHandler=s,this.timeout=i}connect(){const t=new Dt.default(this.url);t.onerror=r=>{this.clearTimeout(),this.errorHandler&&this.errorHandler(r)},t.onmessage=r=>{this.messageHandler({type:r.type,data:r.data})},t.onopen=r=>{this.clearTimeout(),this.connectedResolver(),this.openHandler&&this.openHandler()},t.onclose=r=>{this.closed=!0,this.closeHandler&&this.closeHandler(r)};const n=Date.now();this.timeoutId=setTimeout(()=>{t.onmessage=()=>0,t.onerror=()=>0,t.onopen=()=>0,t.onclose=()=>0,t.close(),this.socket=void 0;const r=Math.floor(Date.now()-n);this.connectedRejecter(`Connection attempt timed out after ${r} ms`)},this.timeout),this.socket=t}disconnect(){if(!this.socket)throw new Error("Socket undefined. This must be called after connecting.");switch(this.clearTimeout(),this.socket.readyState){case Dt.default.OPEN:this.socket.close(1e3);break;case Dt.default.CLOSED:break;case Dt.default.CONNECTING:this.socket.onopen=()=>0,this.socket.onclose=()=>0,this.socket.onerror=()=>0,this.socket.onmessage=()=>0,this.socket=void 0,this.closeHandler&&this.closeHandler({wasClean:!1,code:4001});break;case Dt.default.CLOSING:break;default:throw new Error(`Unknown readyState: ${this.socket.readyState}`)}}async send(t){return new Promise((n,r)=>{if(!this.socket)throw new Error("Socket undefined. This must be called after connecting.");if(this.closed)throw new Error("Socket was closed, so no data can be sent anymore.");if(this.socket.readyState!==Dt.default.OPEN)throw new Error("Websocket is not open");Jf()?this.socket.send(t,o=>o?r(o):n()):(this.socket.send(t),n())})}clearTimeout(){if(!this.timeoutId)throw new Error("Timeout ID not set. This should not happen and usually means connect() was not called.");clearTimeout(this.timeoutId)}}tr.SocketWrapper=Lf;Object.defineProperty(er,"__esModule",{value:!0});er.StreamingSocket=void 0;const zf=p.xstream,Kf=tr;class Qf{constructor(t,n=1e4){this.socket=new Kf.SocketWrapper(t,o=>{this.eventProducerListener&&this.eventProducerListener.next(o)},o=>{this.eventProducerListener&&this.eventProducerListener.error(o)},()=>{},o=>{this.eventProducerListener&&(o.wasClean?this.eventProducerListener.complete():this.eventProducerListener.error("Socket was closed unclean"))},n),this.connected=this.socket.connected;const r={start:o=>this.eventProducerListener=o,stop:()=>this.eventProducerListener=void 0};this.events=zf.Stream.create(r)}connect(){this.socket.connect()}disconnect(){this.socket.disconnect()}async send(t){return this.socket.send(t)}}er.StreamingSocket=Qf;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueueingStreamingSocket=e.ConnectionStatus=void 0;const t=Qn,n=p.xstream,r=er;var o;(function(i){i[i.Unconnected=0]="Unconnected",i[i.Connecting=1]="Connecting",i[i.Connected=2]="Connected",i[i.Disconnected=3]="Disconnected"})(o=e.ConnectionStatus||(e.ConnectionStatus={}));class s{constructor(c,a=1e4,u){this.queue=[],this.isProcessingQueue=!1,this.url=c,this.timeout=a,this.reconnectedHandler=u;const d={start:y=>this.eventProducerListener=y,stop:()=>this.eventProducerListener=void 0};this.events=n.Stream.create(d),this.connectionStatusProducer=new t.DefaultValueProducer(o.Unconnected),this.connectionStatus=new t.ValueAndUpdates(this.connectionStatusProducer),this.socket=new r.StreamingSocket(this.url,this.timeout),this.socket.events.subscribe({next:y=>{if(!this.eventProducerListener)throw new Error("No event producer listener set");this.eventProducerListener.next(y)},error:()=>this.connectionStatusProducer.update(o.Disconnected)})}connect(){this.connectionStatusProducer.update(o.Connecting),this.socket.connected.then(async()=>(this.connectionStatusProducer.update(o.Connected),this.processQueue()),()=>this.connectionStatusProducer.update(o.Disconnected)),this.socket.connect()}disconnect(){this.connectionStatusProducer.update(o.Disconnected),this.socket.disconnect()}reconnect(){this.socket=new r.StreamingSocket(this.url,this.timeout),this.socket.events.subscribe({next:c=>{if(!this.eventProducerListener)throw new Error("No event producer listener set");this.eventProducerListener.next(c)},error:()=>this.connectionStatusProducer.update(o.Disconnected)}),this.socket.connected.then(()=>{this.reconnectedHandler&&this.reconnectedHandler()}),this.connect()}getQueueLength(){return this.queue.length}queueRequest(c){this.queue.push(c),this.processQueue()}async processQueue(){if(this.isProcessingQueue||this.connectionStatus.value!==o.Connected)return;this.isProcessingQueue=!0;let c;for(;c=this.queue.shift();)try{await this.socket.send(c),this.isProcessingQueue=!1}catch{this.queue.unshift(c),this.isProcessingQueue=!1;return}}}e.QueueingStreamingSocket=s})(Hs);var To={};Object.defineProperty(To,"__esModule",{value:!0});To.ReconnectingSocket=void 0;const Zf=p.xstream,es=Hs;class Vs{static calculateTimeout(t){return Math.min(2**t*100,5e3)}constructor(t,n=1e4,r){this.unconnected=!0,this.disconnected=!1,this.timeoutIndex=0,this.reconnectTimeout=null;const o={start:s=>this.eventProducerListener=s,stop:()=>this.eventProducerListener=void 0};this.events=Zf.Stream.create(o),this.socket=new es.QueueingStreamingSocket(t,n,r),this.socket.events.subscribe({next:s=>{this.eventProducerListener&&this.eventProducerListener.next(s)},error:s=>{this.eventProducerListener&&this.eventProducerListener.error(s)}}),this.connectionStatus=this.socket.connectionStatus,this.connectionStatus.updates.subscribe({next:s=>{s===es.ConnectionStatus.Connected&&(this.timeoutIndex=0),s===es.ConnectionStatus.Disconnected&&(this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.reconnectTimeout=setTimeout(()=>this.socket.reconnect(),Vs.calculateTimeout(this.timeoutIndex++)))}})}connect(){if(!this.unconnected)throw new Error("Cannot connect: socket has already connected");this.socket.connect(),this.unconnected=!1}disconnect(){if(this.unconnected)throw new Error("Cannot disconnect: socket has not yet connected");this.socket.disconnect(),this.eventProducerListener&&this.eventProducerListener.complete(),this.disconnected=!0}queueRequest(t){if(this.disconnected)throw new Error("Cannot queue request: socket has disconnected");this.socket.queueRequest(t)}}To.ReconnectingSocket=Vs;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamingSocket=e.SocketWrapper=e.ReconnectingSocket=e.QueueingStreamingSocket=e.ConnectionStatus=void 0;var t=Hs;Object.defineProperty(e,"ConnectionStatus",{enumerable:!0,get:function(){return t.ConnectionStatus}}),Object.defineProperty(e,"QueueingStreamingSocket",{enumerable:!0,get:function(){return t.QueueingStreamingSocket}});var n=To;Object.defineProperty(e,"ReconnectingSocket",{enumerable:!0,get:function(){return n.ReconnectingSocket}});var r=tr;Object.defineProperty(e,"SocketWrapper",{enumerable:!0,get:function(){return r.SocketWrapper}});var o=er;Object.defineProperty(e,"StreamingSocket",{enumerable:!0,get:function(){return o.StreamingSocket}})})(Wa);Object.defineProperty(Ao,"__esModule",{value:!0});Ao.WebsocketClient=void 0;const Mr=ko,Di=Wa,Xf=Qn,Yf=p.xstream,eh=ot;function th(e){throw e}function Ja(e){if(e.type!=="message")throw new Error(`Unexcepted message type on websocket: ${e.type}`);return(0,Mr.parseJsonRpcResponse)(JSON.parse(e.data))}class nh{constructor(t,n){this.running=!1,this.subscriptions=[],this.request=t,this.socket=n}start(t){if(this.running)throw Error("Already started. Please stop first before restarting.");this.running=!0,this.connectToClient(t),this.socket.queueRequest(JSON.stringify(this.request))}stop(){this.running=!1;const t={...this.request,method:"unsubscribe"};try{this.socket.queueRequest(JSON.stringify(t))}catch(n){if(!(n instanceof Error&&n.message.match(/socket has disconnected/i)))throw n}}connectToClient(t){const n=this.socket.events.map(Ja),r=n.filter(i=>i.id===this.request.id).subscribe({next:i=>{(0,Mr.isJsonRpcErrorResponse)(i)&&(this.closeSubscriptions(),t.error(JSON.stringify(i.error))),r.unsubscribe()}}),o=n.filter(i=>i.id===this.request.id).subscribe({next:i=>{(0,Mr.isJsonRpcErrorResponse)(i)?(this.closeSubscriptions(),t.error(JSON.stringify(i.error))):t.next(i.result)}}),s=n.subscribe({error:i=>{this.closeSubscriptions(),t.error(i)},complete:()=>{this.closeSubscriptions(),t.complete()}});this.subscriptions.push(r,o,s)}closeSubscriptions(){for(const t of this.subscriptions)t.unsubscribe();this.subscriptions=[]}}class rh{constructor(t,n=th){if(this.subscriptionStreams=new Map,!(0,eh.hasProtocol)(t))throw new Error("Base URL is missing a protocol. Expected 'ws://' or 'wss://'.");const r=t.endsWith("/")?"websocket":"/websocket";this.url=t+r,this.socket=new Di.ReconnectingSocket(this.url);const o=this.socket.events.subscribe({error:s=>{n(s),o.unsubscribe()}});this.jsonRpcResponseStream=this.socket.events.map(Ja),this.socket.connect()}async execute(t){const n=this.responseForRequestId(t.id);this.socket.queueRequest(JSON.stringify(t));const r=await n;if((0,Mr.isJsonRpcErrorResponse)(r))throw new Error(JSON.stringify(r.error));return r}listen(t){if(t.method!=="subscribe")throw new Error('Request method must be "subscribe" to start event listening');const n=t.params.query;if(typeof n!="string")throw new Error("request.params.query must be a string");if(!this.subscriptionStreams.has(n)){const r=new nh(t,this.socket),o=Yf.Stream.create(r);this.subscriptionStreams.set(n,o)}return this.subscriptionStreams.get(n).filter(r=>r.query!==void 0)}async connected(){await this.socket.connectionStatus.waitFor(Di.ConnectionStatus.Connected)}disconnect(){this.socket.disconnect()}async responseForRequestId(t){return(0,Xf.firstEvent)(this.jsonRpcResponseStream.filter(n=>n.id===t))}}Ao.WebsocketClient=rh;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WebsocketClient=e.instanceOfRpcStreamingClient=e.HttpClient=e.HttpBatchClient=void 0;var t=wo;Object.defineProperty(e,"HttpBatchClient",{enumerable:!0,get:function(){return t.HttpBatchClient}});var n=Po;Object.defineProperty(e,"HttpClient",{enumerable:!0,get:function(){return n.HttpClient}});var r=ot;Object.defineProperty(e,"instanceOfRpcStreamingClient",{enumerable:!0,get:function(){return r.instanceOfRpcStreamingClient}});var o=Ao;Object.defineProperty(e,"WebsocketClient",{enumerable:!0,get:function(){return o.WebsocketClient}})})(Xn);var La={},Eo={},Te={},I={};Object.defineProperty(I,"__esModule",{value:!0});I.encodeBlockId=I.encodeVersion=I.encodeBytes=I.encodeTime=I.encodeUvarint=I.encodeString=I.dictionaryToStringMap=I.may=I.assertNotEmpty=I.assertObject=I.assertArray=I.assertNumber=I.assertString=I.assertBoolean=I.assertSet=void 0;const oh=D;function Ot(e){if(e===void 0)throw new Error("Value must not be undefined");if(e===null)throw new Error("Value must not be null");return e}I.assertSet=Ot;function sh(e){if(Ot(e),typeof e!="boolean")throw new Error("Value must be a boolean");return e}I.assertBoolean=sh;function ih(e){if(Ot(e),typeof e!="string")throw new Error("Value must be a string");return e}I.assertString=ih;function ah(e){if(Ot(e),typeof e!="number")throw new Error("Value must be a number");return e}I.assertNumber=ah;function ch(e){if(Ot(e),!Array.isArray(e))throw new Error("Value must be a an array");return e}I.assertArray=ch;function uh(e){if(Ot(e),typeof e!="object")throw new Error("Value must be an object");if(Object.prototype.toString.call(e)!=="[object Object]")throw new Error("Value must be a simple object");return e}I.assertObject=uh;function lh(e){if(Ot(e),typeof e=="number"&&e===0)throw new Error("must provide a non-zero value");if(e.length===0)throw new Error("must provide a non-empty value");return e}I.assertNotEmpty=lh;function dh(e,t){return t==null?void 0:e(t)}I.may=dh;function mh(e){const t=new Map;for(const n of Object.keys(e)){const r=e[n];if(typeof r!="string")throw new Error("Found dictionary value of type other than string");t.set(n,r)}return t}I.dictionaryToStringMap=mh;function fh(e){const t=(0,oh.toUtf8)(e);return Uint8Array.from([t.length,...t])}I.encodeString=fh;function un(e){return e>=128?Uint8Array.from([e&255|128,...un(e>>7)]):Uint8Array.from([e&255])}I.encodeUvarint=un;function hh(e){const t=e.getTime(),n=Math.floor(t/1e3),r=n?[8,...un(n)]:new Uint8Array,o=(e.nanoseconds||0)+t%1e3*1e6,s=o?[16,...un(o)]:new Uint8Array;return Uint8Array.from([...r,...s])}I.encodeTime=hh;function ph(e){if(e.length>=128)throw new Error("Not implemented for byte arrays of length 128 or more");return e.length?Uint8Array.from([e.length,...e]):new Uint8Array}I.encodeBytes=ph;function gh(e){const t=e.block?Uint8Array.from([8,...un(e.block)]):new Uint8Array,n=e.app?Uint8Array.from([16,...un(e.app)]):new Uint8Array;return Uint8Array.from([...t,...n])}I.encodeVersion=gh;function yh(e){return Uint8Array.from([10,e.hash.length,...e.hash,18,e.parts.hash.length+4,8,e.parts.total,18,e.parts.hash.length,...e.parts.hash])}I.encodeBlockId=yh;Object.defineProperty(Te,"__esModule",{value:!0});Te.smallIntToApi=Te.apiToBigInt=Te.apiToSmallInt=void 0;const vs=te,bh=I;function vh(e){return(typeof e=="number"?new vs.Int53(e):vs.Int53.fromString(e)).toNumber()}Te.apiToSmallInt=vh;function wh(e){if((0,bh.assertString)(e),!e.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return BigInt(e)}Te.apiToBigInt=wh;function kh(e){return new vs.Int53(e).toString()}Te.smallIntToApi=kh;var $={};Object.defineProperty($,"__esModule",{value:!0});$.encodeBlockId=$.encodeVersion=$.encodeBytes=$.encodeTime=$.encodeUvarint=$.encodeString=$.dictionaryToStringMap=$.may=$.assertNotEmpty=$.assertObject=$.assertArray=$.assertNumber=$.assertString=$.assertBoolean=$.assertSet=void 0;const _h=D;function Bt(e){if(e===void 0)throw new Error("Value must not be undefined");if(e===null)throw new Error("Value must not be null");return e}$.assertSet=Bt;function Sh(e){if(Bt(e),typeof e!="boolean")throw new Error("Value must be a boolean");return e}$.assertBoolean=Sh;function Ph(e){if(Bt(e),typeof e!="string")throw new Error("Value must be a string");return e}$.assertString=Ph;function Ah(e){if(Bt(e),typeof e!="number")throw new Error("Value must be a number");return e}$.assertNumber=Ah;function Th(e){if(Bt(e),!Array.isArray(e))throw new Error("Value must be a an array");return e}$.assertArray=Th;function Eh(e){if(Bt(e),typeof e!="object")throw new Error("Value must be an object");if(Object.prototype.toString.call(e)!=="[object Object]")throw new Error("Value must be a simple object");return e}$.assertObject=Eh;function Ch(e){if(Bt(e),typeof e=="number"&&e===0)throw new Error("must provide a non-zero value");if(e.length===0)throw new Error("must provide a non-empty value");return e}$.assertNotEmpty=Ch;function jh(e,t){return t==null?void 0:e(t)}$.may=jh;function Mh(e){const t=new Map;for(const n of Object.keys(e)){const r=e[n];if(typeof r!="string")throw new Error("Found dictionary value of type other than string");t.set(n,r)}return t}$.dictionaryToStringMap=Mh;function Oh(e){const t=(0,_h.toUtf8)(e);return Uint8Array.from([t.length,...t])}$.encodeString=Oh;function ln(e){return e>=128?Uint8Array.from([e&255|128,...ln(e>>7)]):Uint8Array.from([e&255])}$.encodeUvarint=ln;function Bh(e){const t=e.getTime(),n=Math.floor(t/1e3),r=n?[8,...ln(n)]:new Uint8Array,o=(e.nanoseconds||0)+t%1e3*1e6,s=o?[16,...ln(o)]:new Uint8Array;return Uint8Array.from([...r,...s])}$.encodeTime=Bh;function Rh(e){if(e.length>=128)throw new Error("Not implemented for byte arrays of length 128 or more");return e.length?Uint8Array.from([e.length,...e]):new Uint8Array}$.encodeBytes=Rh;function Ih(e){const t=e.block?Uint8Array.from([8,...ln(e.block)]):new Uint8Array,n=e.app?Uint8Array.from([16,...ln(e.app)]):new Uint8Array;return Uint8Array.from([...t,...n])}$.encodeVersion=Ih;function $h(e){return Uint8Array.from([10,e.hash.length,...e.hash,18,e.parts.hash.length+4,8,e.parts.total,18,e.parts.hash.length,...e.parts.hash])}$.encodeBlockId=$h;var Co={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buildQuery=e.SubscriptionEventType=e.Method=void 0,function(n){n.AbciInfo="abci_info",n.AbciQuery="abci_query",n.Block="block",n.Blockchain="blockchain",n.BlockResults="block_results",n.BlockSearch="block_search",n.BroadcastTxAsync="broadcast_tx_async",n.BroadcastTxSync="broadcast_tx_sync",n.BroadcastTxCommit="broadcast_tx_commit",n.Commit="commit",n.Genesis="genesis",n.Health="health",n.NumUnconfirmedTxs="num_unconfirmed_txs",n.Status="status",n.Subscribe="subscribe",n.Tx="tx",n.TxSearch="tx_search",n.Validators="validators",n.Unsubscribe="unsubscribe"}(e.Method||(e.Method={})),function(n){n.NewBlock="NewBlock",n.NewBlockHeader="NewBlockHeader",n.Tx="Tx"}(e.SubscriptionEventType||(e.SubscriptionEventType={}));function t(n){const o=(n.tags?n.tags:[]).map(i=>`${i.key}='${i.value}'`),s=n.raw?[n.raw]:[];return[...o,...s].join(" AND ")}e.buildQuery=t})(Co);var Nh=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Dh=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),xh=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Nh(t,e,n);return Dh(t,e),t};Object.defineProperty(Eo,"__esModule",{value:!0});Eo.Params=void 0;const Gs=D,He=Te,ne=it,ve=$,Uh=xh(Co);function ts(e){return{height:(0,ve.may)(He.smallIntToApi,e.height)}}function qh(e){return{minHeight:(0,ve.may)(He.smallIntToApi,e.minHeight),maxHeight:(0,ve.may)(He.smallIntToApi,e.maxHeight)}}function Hh(e){return{query:e.query,page:(0,ve.may)(He.smallIntToApi,e.page),per_page:(0,ve.may)(He.smallIntToApi,e.per_page),order_by:e.order_by}}function Vh(e){return{path:(0,ve.assertNotEmpty)(e.path),data:(0,Gs.toHex)(e.data),height:(0,ve.may)(He.smallIntToApi,e.height),prove:e.prove}}function Gh(e){return{tx:(0,Gs.toBase64)((0,ve.assertNotEmpty)(e.tx))}}function Fh(e){return{hash:(0,Gs.toBase64)((0,ve.assertNotEmpty)(e.hash)),prove:e.prove}}function Wh(e){return{query:e.query,prove:e.prove,page:(0,ve.may)(He.smallIntToApi,e.page),per_page:(0,ve.may)(He.smallIntToApi,e.per_page),order_by:e.order_by}}function Jh(e){return{height:(0,ve.may)(He.smallIntToApi,e.height),page:(0,ve.may)(He.smallIntToApi,e.page),per_page:(0,ve.may)(He.smallIntToApi,e.per_page)}}let Lh=class{static encodeAbciInfo(t){return(0,ne.createJsonRpcRequest)(t.method)}static encodeAbciQuery(t){return(0,ne.createJsonRpcRequest)(t.method,Vh(t.params))}static encodeBlock(t){return(0,ne.createJsonRpcRequest)(t.method,ts(t.params))}static encodeBlockchain(t){return(0,ne.createJsonRpcRequest)(t.method,qh(t.params))}static encodeBlockResults(t){return(0,ne.createJsonRpcRequest)(t.method,ts(t.params))}static encodeBlockSearch(t){return(0,ne.createJsonRpcRequest)(t.method,Hh(t.params))}static encodeBroadcastTx(t){return(0,ne.createJsonRpcRequest)(t.method,Gh(t.params))}static encodeCommit(t){return(0,ne.createJsonRpcRequest)(t.method,ts(t.params))}static encodeGenesis(t){return(0,ne.createJsonRpcRequest)(t.method)}static encodeHealth(t){return(0,ne.createJsonRpcRequest)(t.method)}static encodeNumUnconfirmedTxs(t){return(0,ne.createJsonRpcRequest)(t.method)}static encodeStatus(t){return(0,ne.createJsonRpcRequest)(t.method)}static encodeSubscribe(t){const n={key:"tm.event",value:t.query.type},r=Uh.buildQuery({tags:[n],raw:t.query.raw});return(0,ne.createJsonRpcRequest)("subscribe",{query:r})}static encodeTx(t){return(0,ne.createJsonRpcRequest)(t.method,Fh(t.params))}static encodeTxSearch(t){return(0,ne.createJsonRpcRequest)(t.method,Wh(t.params))}static encodeValidators(t){return(0,ne.createJsonRpcRequest)(t.method,Jh(t.params))}};Eo.Params=Lh;var $e={},nr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BlockIdFlag=void 0,function(t){t[t.Unknown=0]="Unknown",t[t.Absent=1]="Absent",t[t.Commit=2]="Commit",t[t.Nil=3]="Nil",t[t.Unrecognized=-1]="Unrecognized"}(e.BlockIdFlag||(e.BlockIdFlag={}))})(nr);var dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.hashBlock=dn.hashTx=void 0;const Fs=_e,de=$;function zh(e){return(0,Fs.sha256)(e)}dn.hashTx=zh;function Kh(e){if(e<1)throw new Error("Cannot split an empty tree");const t=2**Math.floor(Math.log2(e));return t<e?t:t/2}function Qh(e){const t=new Fs.Sha256(Uint8Array.from([0]));return t.update(e),t.digest()}function Zh(e,t){const n=new Fs.Sha256(Uint8Array.from([1]));return n.update(e),n.update(t),n.digest()}function ws(e){switch(e.length){case 0:throw new Error("Cannot hash empty tree");case 1:return Qh(e[0]);default:{const t=Kh(e.length),n=ws(e.slice(0,t)),r=ws(e.slice(t));return Zh(n,r)}}}function Xh(e){if(!e.lastBlockId)throw new Error("Hashing a block header with no last block ID (i.e. header at height 1) is not supported. If you need this, contributions are welcome. Please add documentation and test vectors for this case.");const t=[(0,de.encodeVersion)(e.version),(0,de.encodeString)(e.chainId),(0,de.encodeUvarint)(e.height),(0,de.encodeTime)(e.time),(0,de.encodeBlockId)(e.lastBlockId),(0,de.encodeBytes)(e.lastCommitHash),(0,de.encodeBytes)(e.dataHash),(0,de.encodeBytes)(e.validatorsHash),(0,de.encodeBytes)(e.nextValidatorsHash),(0,de.encodeBytes)(e.consensusHash),(0,de.encodeBytes)(e.appHash),(0,de.encodeBytes)(e.lastResultsHash),(0,de.encodeBytes)(e.evidenceHash),(0,de.encodeBytes)(e.proposerAddress)];return ws(t)}dn.hashBlock=Xh;Object.defineProperty($e,"__esModule",{value:!0});$e.Responses=$e.decodeValidatorInfo=$e.decodeValidatorGenesis=$e.decodeValidatorUpdate=$e.decodeEvent=void 0;const C=D,za=X,Hn=ae,A=Te,Yh=nr,h=$,ep=dn;function tp(e){return{data:e.data,lastBlockHeight:(0,h.may)(A.apiToSmallInt,e.last_block_height),lastBlockAppHash:(0,h.may)(C.fromBase64,e.last_block_app_hash)}}function np(e){return{ops:e.ops.map(t=>({type:t.type,key:(0,C.fromBase64)(t.key),data:(0,C.fromBase64)(t.data)}))}}function rp(e){return{key:(0,C.fromBase64)((0,h.assertString)(e.key??"")),value:(0,C.fromBase64)((0,h.assertString)(e.value??"")),proof:(0,h.may)(np,e.proofOps),height:(0,h.may)(A.apiToSmallInt,e.height),code:(0,h.may)(A.apiToSmallInt,e.code),codespace:(0,h.assertString)(e.codespace??""),index:(0,h.may)(A.apiToSmallInt,e.index),log:e.log,info:(0,h.assertString)(e.info??"")}}function op(e){return{key:(0,h.assertNotEmpty)(e.key),value:e.value??""}}function sp(e){return(0,h.assertArray)(e).map(op)}function Ka(e){return{type:e.type,attributes:e.attributes?sp(e.attributes):[]}}$e.decodeEvent=Ka;function ks(e){return(0,h.assertArray)(e).map(Ka)}function mn(e){return{code:(0,A.apiToSmallInt)((0,h.assertNumber)(e.code??0)),codespace:e.codespace,log:e.log,data:(0,h.may)(C.fromBase64,e.data),events:e.events?ks(e.events):[],gasWanted:(0,A.apiToBigInt)(e.gas_wanted??"0"),gasUsed:(0,A.apiToBigInt)(e.gas_used??"0")}}function Ws(e){if("Sum"in e){const[[t,n]]=Object.entries(e.Sum.value);return(0,za.assert)(t==="ed25519"||t==="secp256k1",`unknown pubkey type: ${t}`),{algorithm:t,data:(0,C.fromBase64)((0,h.assertNotEmpty)(n))}}else switch(e.type){case"tendermint/PubKeyEd25519":return{algorithm:"ed25519",data:(0,C.fromBase64)((0,h.assertNotEmpty)(e.value))};case"tendermint/PubKeySecp256k1":return{algorithm:"secp256k1",data:(0,C.fromBase64)((0,h.assertNotEmpty)(e.value))};default:throw new Error(`unknown pubkey type: ${e.type}`)}}function ip(e){return{maxBytes:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.max_bytes)),maxGas:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.max_gas))}}function ap(e){return{maxAgeNumBlocks:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.max_age_num_blocks)),maxAgeDuration:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.max_age_duration))}}function Qa(e){return{block:ip((0,h.assertObject)(e.block)),evidence:ap((0,h.assertObject)(e.evidence))}}function Za(e){return{pubkey:Ws((0,h.assertObject)(e.pub_key)),votingPower:(0,A.apiToBigInt)(e.power??"0")}}$e.decodeValidatorUpdate=Za;function cp(e){return{height:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.height)),results:(e.txs_results||[]).map(mn),validatorUpdates:(e.validator_updates||[]).map(Za),consensusUpdates:(0,h.may)(Qa,e.consensus_param_updates),beginBlockEvents:ks(e.begin_block_events||[]),endBlockEvents:ks(e.end_block_events||[])}}function jo(e){return{hash:(0,C.fromHex)((0,h.assertNotEmpty)(e.hash)),parts:{total:(0,h.assertNotEmpty)(e.parts.total),hash:(0,C.fromHex)((0,h.assertNotEmpty)(e.parts.hash))}}}function up(e){return{block:(0,A.apiToSmallInt)(e.block),app:(0,A.apiToSmallInt)(e.app??0)}}function Mo(e){return{version:up(e.version),chainId:(0,h.assertNotEmpty)(e.chain_id),height:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.height)),time:(0,Hn.fromRfc3339WithNanoseconds)((0,h.assertNotEmpty)(e.time)),lastBlockId:e.last_block_id.hash?jo(e.last_block_id):null,lastCommitHash:(0,C.fromHex)((0,h.assertSet)(e.last_commit_hash)),dataHash:(0,C.fromHex)((0,h.assertSet)(e.data_hash)),validatorsHash:(0,C.fromHex)((0,h.assertSet)(e.validators_hash)),nextValidatorsHash:(0,C.fromHex)((0,h.assertSet)(e.next_validators_hash)),consensusHash:(0,C.fromHex)((0,h.assertSet)(e.consensus_hash)),appHash:(0,C.fromHex)((0,h.assertSet)(e.app_hash)),lastResultsHash:(0,C.fromHex)((0,h.assertSet)(e.last_results_hash)),evidenceHash:(0,C.fromHex)((0,h.assertSet)(e.evidence_hash)),proposerAddress:(0,C.fromHex)((0,h.assertNotEmpty)(e.proposer_address))}}function lp(e){return{blockId:jo(e.block_id),blockSize:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.block_size)),header:Mo(e.header),numTxs:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.num_txs))}}function dp(e){return{lastHeight:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.last_height)),blockMetas:(0,h.assertArray)(e.block_metas).map(lp)}}function mp(e){return{...mn(e),hash:(0,C.fromHex)((0,h.assertNotEmpty)(e.hash))}}function fp(e){const t=e.tx_result?mn(e.tx_result):void 0;return{height:(0,A.apiToSmallInt)(e.height),hash:(0,C.fromHex)((0,h.assertNotEmpty)(e.hash)),checkTx:mn((0,h.assertObject)(e.check_tx)),deliverTx:t,txResult:t}}function hp(e){return(0,za.assert)(e in Yh.BlockIdFlag),e}function pp(e){return{blockIdFlag:hp(e.block_id_flag),validatorAddress:e.validator_address?(0,C.fromHex)(e.validator_address):void 0,timestamp:e.timestamp?(0,Hn.fromRfc3339WithNanoseconds)(e.timestamp):void 0,signature:e.signature?(0,C.fromBase64)(e.signature):void 0}}function Xa(e){return{blockId:jo((0,h.assertObject)(e.block_id)),height:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.height)),round:(0,A.apiToSmallInt)(e.round),signatures:(0,h.assertArray)(e.signatures).map(pp)}}function gp(e){return{canonical:(0,h.assertBoolean)(e.canonical),header:Mo(e.signed_header.header),commit:Xa(e.signed_header.commit)}}function Ya(e){return{address:(0,C.fromHex)((0,h.assertNotEmpty)(e.address)),pubkey:Ws((0,h.assertObject)(e.pub_key)),votingPower:(0,A.apiToBigInt)((0,h.assertNotEmpty)(e.power))}}$e.decodeValidatorGenesis=Ya;function yp(e){return{genesisTime:(0,Hn.fromRfc3339WithNanoseconds)((0,h.assertNotEmpty)(e.genesis_time)),chainId:(0,h.assertNotEmpty)(e.chain_id),consensusParams:Qa(e.consensus_params),validators:e.validators?(0,h.assertArray)(e.validators).map(Ya):[],appHash:(0,C.fromHex)((0,h.assertSet)(e.app_hash)),appState:e.app_state}}function Js(e){return{pubkey:Ws((0,h.assertObject)(e.pub_key)),votingPower:(0,A.apiToBigInt)((0,h.assertNotEmpty)(e.voting_power)),address:(0,C.fromHex)((0,h.assertNotEmpty)(e.address)),proposerPriority:e.proposer_priority?(0,A.apiToSmallInt)(e.proposer_priority):void 0}}$e.decodeValidatorInfo=Js;function bp(e){return{id:(0,C.fromHex)((0,h.assertNotEmpty)(e.id)),listenAddr:(0,h.assertNotEmpty)(e.listen_addr),network:(0,h.assertNotEmpty)(e.network),version:(0,h.assertString)(e.version),channels:(0,h.assertString)(e.channels),moniker:(0,h.assertNotEmpty)(e.moniker),other:(0,h.dictionaryToStringMap)(e.other),protocolVersion:{app:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.protocol_version.app)),block:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.protocol_version.block)),p2p:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.protocol_version.p2p))}}}function vp(e){const t=e.earliest_block_height?(0,A.apiToSmallInt)(e.earliest_block_height):void 0,n=e.earliest_block_time?(0,Hn.fromRfc3339WithNanoseconds)(e.earliest_block_time):void 0;return{earliestAppHash:e.earliest_app_hash?(0,C.fromHex)(e.earliest_app_hash):void 0,earliestBlockHash:e.earliest_block_hash?(0,C.fromHex)(e.earliest_block_hash):void 0,earliestBlockHeight:t||void 0,earliestBlockTime:n!=null&&n.getTime()?n:void 0,latestBlockHash:(0,C.fromHex)((0,h.assertNotEmpty)(e.latest_block_hash)),latestAppHash:(0,C.fromHex)((0,h.assertNotEmpty)(e.latest_app_hash)),latestBlockTime:(0,Hn.fromRfc3339WithNanoseconds)((0,h.assertNotEmpty)(e.latest_block_time)),latestBlockHeight:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.latest_block_height)),catchingUp:(0,h.assertBoolean)(e.catching_up)}}function wp(e){return{nodeInfo:bp(e.node_info),syncInfo:vp(e.sync_info),validatorInfo:Js(e.validator_info)}}function kp(e){return{data:(0,C.fromBase64)((0,h.assertNotEmpty)(e.data)),rootHash:(0,C.fromHex)((0,h.assertNotEmpty)(e.root_hash)),proof:{total:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.proof.total)),index:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.proof.index)),leafHash:(0,C.fromBase64)((0,h.assertNotEmpty)(e.proof.leaf_hash)),aunts:(0,h.assertArray)(e.proof.aunts).map(C.fromBase64)}}}function ec(e){return{tx:(0,C.fromBase64)((0,h.assertNotEmpty)(e.tx)),result:mn((0,h.assertObject)(e.tx_result)),height:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.height)),index:(0,A.apiToSmallInt)((0,h.assertNumber)(e.index)),hash:(0,C.fromHex)((0,h.assertNotEmpty)(e.hash)),proof:(0,h.may)(kp,e.proof)}}function _p(e){return{totalCount:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.total_count)),txs:(0,h.assertArray)(e.txs).map(ec)}}function Sp(e){const t=(0,C.fromBase64)((0,h.assertNotEmpty)(e.tx));return{tx:t,hash:(0,ep.hashTx)(t),result:mn(e.result),height:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.height))}}function Pp(e){return{blockHeight:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.block_height)),validators:(0,h.assertArray)(e.validators).map(Js),count:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.count)),total:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.total))}}function tc(e){var t;return{header:Mo((0,h.assertObject)(e.header)),lastCommit:e.last_commit.block_id.hash?Xa((0,h.assertObject)(e.last_commit)):null,txs:e.data.txs?(0,h.assertArray)(e.data.txs).map(C.fromBase64):[],evidence:((t=e.evidence)==null?void 0:t.evidence)??[]}}function nc(e){return{blockId:jo(e.block_id),block:tc(e.block)}}function Ap(e){return{totalCount:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.total_count)),blocks:(0,h.assertArray)(e.blocks).map(nc)}}function Tp(e){return{total:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.total)),totalBytes:(0,A.apiToSmallInt)((0,h.assertNotEmpty)(e.total_bytes))}}let Ep=class rc{static decodeAbciInfo(t){return tp((0,h.assertObject)(t.result.response))}static decodeAbciQuery(t){return rp((0,h.assertObject)(t.result.response))}static decodeBlock(t){return nc(t.result)}static decodeBlockResults(t){return cp(t.result)}static decodeBlockSearch(t){return Ap(t.result)}static decodeBlockchain(t){return dp(t.result)}static decodeBroadcastTxSync(t){return mp(t.result)}static decodeBroadcastTxAsync(t){return rc.decodeBroadcastTxSync(t)}static decodeBroadcastTxCommit(t){return fp(t.result)}static decodeCommit(t){return gp(t.result)}static decodeGenesis(t){return yp((0,h.assertObject)(t.result.genesis))}static decodeHealth(){return null}static decodeNumUnconfirmedTxs(t){return Tp(t.result)}static decodeStatus(t){return wp(t.result)}static decodeNewBlockEvent(t){return tc(t.data.value.block)}static decodeNewBlockHeaderEvent(t){return Mo(t.data.value.header)}static decodeTxEvent(t){return Sp(t.data.value.TxResult)}static decodeTx(t){return ec(t.result)}static decodeTxSearch(t){return _p(t.result)}static decodeValidators(t){return Pp(t.result)}};$e.Responses=Ep;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Responses=e.Params=void 0;var t=Eo;Object.defineProperty(e,"Params",{enumerable:!0,get:function(){return t.Params}});var n=$e;Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return n.Responses}})})(La);var Cp=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),jp=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Mp=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Cp(t,e,n);return jp(t,e),t};Object.defineProperty(vo,"__esModule",{value:!0});vo.Comet38Client=void 0;const Op=it,br=Xn,O=La,W=Mp(Co);class Or{static async connect(t){let n;return typeof t=="object"?n=new br.HttpClient(t):n=t.startsWith("http://")||t.startsWith("https://")?new br.HttpClient(t):new br.WebsocketClient(t),await this.detectVersion(n),Or.create(n)}static async create(t){return new Or(t)}static async detectVersion(t){const n=(0,Op.createJsonRpcRequest)(W.Method.Status),o=(await t.execute(n)).result;if(!o||!o.node_info)throw new Error("Unrecognized format for status response");const s=o.node_info.version;if(typeof s!="string")throw new Error("Unrecognized version format: must be string");return s}constructor(t){this.client=t}disconnect(){this.client.disconnect()}async abciInfo(){const t={method:W.Method.AbciInfo};return this.doCall(t,O.Params.encodeAbciInfo,O.Responses.decodeAbciInfo)}async abciQuery(t){const n={params:t,method:W.Method.AbciQuery};return this.doCall(n,O.Params.encodeAbciQuery,O.Responses.decodeAbciQuery)}async block(t){const n={method:W.Method.Block,params:{height:t}};return this.doCall(n,O.Params.encodeBlock,O.Responses.decodeBlock)}async blockResults(t){const n={method:W.Method.BlockResults,params:{height:t}};return this.doCall(n,O.Params.encodeBlockResults,O.Responses.decodeBlockResults)}async blockSearch(t){const n={params:t,method:W.Method.BlockSearch},r=await this.doCall(n,O.Params.encodeBlockSearch,O.Responses.decodeBlockSearch);return{...r,blocks:[...r.blocks].sort((o,s)=>o.block.header.height-s.block.header.height)}}async blockSearchAll(t){let n=t.page||1;const r=[];let o=!1;for(;!o;){const s=await this.blockSearch({...t,page:n});r.push(...s.blocks),r.length<s.totalCount?n++:o=!0}return r.sort((s,i)=>s.block.header.height-i.block.header.height),{totalCount:r.length,blocks:r}}async blockchain(t,n){const r={method:W.Method.Blockchain,params:{minHeight:t,maxHeight:n}};return this.doCall(r,O.Params.encodeBlockchain,O.Responses.decodeBlockchain)}async broadcastTxSync(t){const n={params:t,method:W.Method.BroadcastTxSync};return this.doCall(n,O.Params.encodeBroadcastTx,O.Responses.decodeBroadcastTxSync)}async broadcastTxAsync(t){const n={params:t,method:W.Method.BroadcastTxAsync};return this.doCall(n,O.Params.encodeBroadcastTx,O.Responses.decodeBroadcastTxAsync)}async broadcastTxCommit(t){const n={params:t,method:W.Method.BroadcastTxCommit};return this.doCall(n,O.Params.encodeBroadcastTx,O.Responses.decodeBroadcastTxCommit)}async commit(t){const n={method:W.Method.Commit,params:{height:t}};return this.doCall(n,O.Params.encodeCommit,O.Responses.decodeCommit)}async genesis(){const t={method:W.Method.Genesis};return this.doCall(t,O.Params.encodeGenesis,O.Responses.decodeGenesis)}async health(){const t={method:W.Method.Health};return this.doCall(t,O.Params.encodeHealth,O.Responses.decodeHealth)}async numUnconfirmedTxs(){const t={method:W.Method.NumUnconfirmedTxs};return this.doCall(t,O.Params.encodeNumUnconfirmedTxs,O.Responses.decodeNumUnconfirmedTxs)}async status(){const t={method:W.Method.Status};return this.doCall(t,O.Params.encodeStatus,O.Responses.decodeStatus)}subscribeNewBlock(){const t={method:W.Method.Subscribe,query:{type:W.SubscriptionEventType.NewBlock}};return this.subscribe(t,O.Responses.decodeNewBlockEvent)}subscribeNewBlockHeader(){const t={method:W.Method.Subscribe,query:{type:W.SubscriptionEventType.NewBlockHeader}};return this.subscribe(t,O.Responses.decodeNewBlockHeaderEvent)}subscribeTx(t){const n={method:W.Method.Subscribe,query:{type:W.SubscriptionEventType.Tx,raw:t}};return this.subscribe(n,O.Responses.decodeTxEvent)}async tx(t){const n={params:t,method:W.Method.Tx};return this.doCall(n,O.Params.encodeTx,O.Responses.decodeTx)}async txSearch(t){const n={params:t,method:W.Method.TxSearch};return this.doCall(n,O.Params.encodeTxSearch,O.Responses.decodeTxSearch)}async txSearchAll(t){let n=t.page||1;const r=[];let o=!1;for(;!o;){const s=await this.txSearch({...t,page:n});r.push(...s.txs),r.length<s.totalCount?n++:o=!0}return{totalCount:r.length,txs:r}}async validators(t){const n={method:W.Method.Validators,params:t};return this.doCall(n,O.Params.encodeValidators,O.Responses.decodeValidators)}async validatorsAll(t){const n=[];let r=1,o=!1,s=t;for(;!o;){const i=await this.validators({per_page:50,height:s,page:r});n.push(...i.validators),s=s||i.blockHeight,n.length<i.total?r++:o=!0}return{blockHeight:s??0,count:n.length,total:n.length,validators:n}}async doCall(t,n,r){const o=n(t),s=await this.client.execute(o);return r(s)}subscribe(t,n){if(!(0,br.instanceOfRpcStreamingClient)(this.client))throw new Error("This RPC client type cannot subscribe to events");const r=O.Params.encodeSubscribe(t);return this.client.listen(r).map(s=>n(s))}}vo.Comet38Client=Or;var oc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VoteType=e.broadcastTxCommitSuccess=e.broadcastTxSyncSuccess=void 0;function t(r){return r.code===0}e.broadcastTxSyncSuccess=t;function n(r){return r.checkTx.code===0&&!!r.deliverTx&&r.deliverTx.code===0}e.broadcastTxCommitSuccess=n,function(r){r[r.PreVote=1]="PreVote",r[r.PreCommit=2]="PreCommit"}(e.VoteType||(e.VoteType={}))})(oc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VoteType=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.SubscriptionEventType=e.Method=e.Comet38Client=void 0;var t=vo;Object.defineProperty(e,"Comet38Client",{enumerable:!0,get:function(){return t.Comet38Client}});var n=Co;Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return n.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return n.SubscriptionEventType}});var r=oc;Object.defineProperty(e,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return r.broadcastTxCommitSuccess}}),Object.defineProperty(e,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return r.broadcastTxSyncSuccess}}),Object.defineProperty(e,"VoteType",{enumerable:!0,get:function(){return r.VoteType}})})(jr);var Dn={},Oo={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buildQuery=e.SubscriptionEventType=e.Method=void 0,function(n){n.AbciInfo="abci_info",n.AbciQuery="abci_query",n.Block="block",n.Blockchain="blockchain",n.BlockResults="block_results",n.BlockSearch="block_search",n.BroadcastTxAsync="broadcast_tx_async",n.BroadcastTxSync="broadcast_tx_sync",n.BroadcastTxCommit="broadcast_tx_commit",n.Commit="commit",n.Genesis="genesis",n.Health="health",n.NumUnconfirmedTxs="num_unconfirmed_txs",n.Status="status",n.Subscribe="subscribe",n.Tx="tx",n.TxSearch="tx_search",n.Validators="validators",n.Unsubscribe="unsubscribe"}(e.Method||(e.Method={})),function(n){n.NewBlock="NewBlock",n.NewBlockHeader="NewBlockHeader",n.Tx="Tx"}(e.SubscriptionEventType||(e.SubscriptionEventType={}));function t(n){const o=(n.tags?n.tags:[]).map(i=>`${i.key}='${i.value}'`),s=n.raw?[n.raw]:[];return[...o,...s].join(" AND ")}e.buildQuery=t})(Oo);var sc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VoteType=e.broadcastTxCommitSuccess=e.broadcastTxSyncSuccess=void 0;function t(r){return r.code===0}e.broadcastTxSyncSuccess=t;function n(r){return r.checkTx.code===0&&!!r.deliverTx&&r.deliverTx.code===0}e.broadcastTxCommitSuccess=n,function(r){r[r.PreVote=1]="PreVote",r[r.PreCommit=2]="PreCommit"}(e.VoteType||(e.VoteType={}))})(sc);var Bo={},ic={},Ro={},Bp=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Rp=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ip=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Bp(t,e,n);return Rp(t,e),t};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.Params=void 0;const Ls=D,Ve=Te,re=it,we=I,$p=Ip(Oo);function ns(e){return{height:(0,we.may)(Ve.smallIntToApi,e.height)}}function Np(e){return{minHeight:(0,we.may)(Ve.smallIntToApi,e.minHeight),maxHeight:(0,we.may)(Ve.smallIntToApi,e.maxHeight)}}function Dp(e){return{query:e.query,page:(0,we.may)(Ve.smallIntToApi,e.page),per_page:(0,we.may)(Ve.smallIntToApi,e.per_page),order_by:e.order_by}}function xp(e){return{path:(0,we.assertNotEmpty)(e.path),data:(0,Ls.toHex)(e.data),height:(0,we.may)(Ve.smallIntToApi,e.height),prove:e.prove}}function Up(e){return{tx:(0,Ls.toBase64)((0,we.assertNotEmpty)(e.tx))}}function qp(e){return{hash:(0,Ls.toBase64)((0,we.assertNotEmpty)(e.hash)),prove:e.prove}}function Hp(e){return{query:e.query,prove:e.prove,page:(0,we.may)(Ve.smallIntToApi,e.page),per_page:(0,we.may)(Ve.smallIntToApi,e.per_page),order_by:e.order_by}}function Vp(e){return{height:(0,we.may)(Ve.smallIntToApi,e.height),page:(0,we.may)(Ve.smallIntToApi,e.page),per_page:(0,we.may)(Ve.smallIntToApi,e.per_page)}}let Gp=class{static encodeAbciInfo(t){return(0,re.createJsonRpcRequest)(t.method)}static encodeAbciQuery(t){return(0,re.createJsonRpcRequest)(t.method,xp(t.params))}static encodeBlock(t){return(0,re.createJsonRpcRequest)(t.method,ns(t.params))}static encodeBlockchain(t){return(0,re.createJsonRpcRequest)(t.method,Np(t.params))}static encodeBlockResults(t){return(0,re.createJsonRpcRequest)(t.method,ns(t.params))}static encodeBlockSearch(t){return(0,re.createJsonRpcRequest)(t.method,Dp(t.params))}static encodeBroadcastTx(t){return(0,re.createJsonRpcRequest)(t.method,Up(t.params))}static encodeCommit(t){return(0,re.createJsonRpcRequest)(t.method,ns(t.params))}static encodeGenesis(t){return(0,re.createJsonRpcRequest)(t.method)}static encodeHealth(t){return(0,re.createJsonRpcRequest)(t.method)}static encodeNumUnconfirmedTxs(t){return(0,re.createJsonRpcRequest)(t.method)}static encodeStatus(t){return(0,re.createJsonRpcRequest)(t.method)}static encodeSubscribe(t){const n={key:"tm.event",value:t.query.type},r=$p.buildQuery({tags:[n],raw:t.query.raw});return(0,re.createJsonRpcRequest)("subscribe",{query:r})}static encodeTx(t){return(0,re.createJsonRpcRequest)(t.method,qp(t.params))}static encodeTxSearch(t){return(0,re.createJsonRpcRequest)(t.method,Hp(t.params))}static encodeValidators(t){return(0,re.createJsonRpcRequest)(t.method,Vp(t.params))}};Ro.Params=Gp;var Ne={},fn={};Object.defineProperty(fn,"__esModule",{value:!0});fn.hashBlock=fn.hashTx=void 0;const zs=_e,me=I;function Fp(e){return(0,zs.sha256)(e)}fn.hashTx=Fp;function Wp(e){if(e<1)throw new Error("Cannot split an empty tree");const t=2**Math.floor(Math.log2(e));return t<e?t:t/2}function Jp(e){const t=new zs.Sha256(Uint8Array.from([0]));return t.update(e),t.digest()}function Lp(e,t){const n=new zs.Sha256(Uint8Array.from([1]));return n.update(e),n.update(t),n.digest()}function _s(e){switch(e.length){case 0:throw new Error("Cannot hash empty tree");case 1:return Jp(e[0]);default:{const t=Wp(e.length),n=_s(e.slice(0,t)),r=_s(e.slice(t));return Lp(n,r)}}}function zp(e){if(!e.lastBlockId)throw new Error("Hashing a block header with no last block ID (i.e. header at height 1) is not supported. If you need this, contributions are welcome. Please add documentation and test vectors for this case.");const t=[(0,me.encodeVersion)(e.version),(0,me.encodeString)(e.chainId),(0,me.encodeUvarint)(e.height),(0,me.encodeTime)(e.time),(0,me.encodeBlockId)(e.lastBlockId),(0,me.encodeBytes)(e.lastCommitHash),(0,me.encodeBytes)(e.dataHash),(0,me.encodeBytes)(e.validatorsHash),(0,me.encodeBytes)(e.nextValidatorsHash),(0,me.encodeBytes)(e.consensusHash),(0,me.encodeBytes)(e.appHash),(0,me.encodeBytes)(e.lastResultsHash),(0,me.encodeBytes)(e.evidenceHash),(0,me.encodeBytes)(e.proposerAddress)];return _s(t)}fn.hashBlock=zp;Object.defineProperty(Ne,"__esModule",{value:!0});Ne.Responses=Ne.decodeValidatorInfo=Ne.decodeValidatorGenesis=Ne.decodeValidatorUpdate=Ne.decodeEvent=void 0;const P=D,ac=X,Vn=ae,T=Te,Kp=nr,m=I,Qp=fn;function Zp(e){return{data:e.data,lastBlockHeight:(0,m.may)(T.apiToSmallInt,e.last_block_height),lastBlockAppHash:(0,m.may)(P.fromBase64,e.last_block_app_hash)}}function Xp(e){return{ops:e.ops.map(t=>({type:t.type,key:(0,P.fromBase64)(t.key),data:(0,P.fromBase64)(t.data)}))}}function Yp(e){return{key:(0,P.fromBase64)((0,m.assertString)(e.key??"")),value:(0,P.fromBase64)((0,m.assertString)(e.value??"")),proof:(0,m.may)(Xp,e.proofOps),height:(0,m.may)(T.apiToSmallInt,e.height),code:(0,m.may)(T.apiToSmallInt,e.code),codespace:(0,m.assertString)(e.codespace??""),index:(0,m.may)(T.apiToSmallInt,e.index),log:e.log,info:(0,m.assertString)(e.info??"")}}function eg(e){return{key:(0,P.fromBase64)((0,m.assertNotEmpty)(e.key)),value:(0,P.fromBase64)((0,m.assertString)(e.value??""))}}function tg(e){return(0,m.assertArray)(e).map(eg)}function cc(e){return{type:e.type,attributes:e.attributes?tg(e.attributes):[]}}Ne.decodeEvent=cc;function Ss(e){return(0,m.assertArray)(e).map(cc)}function hn(e){return{code:(0,T.apiToSmallInt)((0,m.assertNumber)(e.code??0)),codespace:e.codespace,log:e.log,data:(0,m.may)(P.fromBase64,e.data),events:e.events?Ss(e.events):[],gasWanted:(0,T.apiToBigInt)(e.gas_wanted??"0"),gasUsed:(0,T.apiToBigInt)(e.gas_used??"0")}}function Ks(e){if("Sum"in e){const[[t,n]]=Object.entries(e.Sum.value);return(0,ac.assert)(t==="ed25519"||t==="secp256k1",`unknown pubkey type: ${t}`),{algorithm:t,data:(0,P.fromBase64)((0,m.assertNotEmpty)(n))}}else switch(e.type){case"tendermint/PubKeyEd25519":return{algorithm:"ed25519",data:(0,P.fromBase64)((0,m.assertNotEmpty)(e.value))};case"tendermint/PubKeySecp256k1":return{algorithm:"secp256k1",data:(0,P.fromBase64)((0,m.assertNotEmpty)(e.value))};default:throw new Error(`unknown pubkey type: ${e.type}`)}}function ng(e){return{maxBytes:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.max_bytes)),maxGas:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.max_gas))}}function rg(e){return{maxAgeNumBlocks:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.max_age_num_blocks)),maxAgeDuration:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.max_age_duration))}}function uc(e){return{block:ng((0,m.assertObject)(e.block)),evidence:rg((0,m.assertObject)(e.evidence))}}function lc(e){return{pubkey:Ks((0,m.assertObject)(e.pub_key)),votingPower:(0,T.apiToBigInt)(e.power??"0")}}Ne.decodeValidatorUpdate=lc;function og(e){return{height:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.height)),results:(e.txs_results||[]).map(hn),validatorUpdates:(e.validator_updates||[]).map(lc),consensusUpdates:(0,m.may)(uc,e.consensus_param_updates),beginBlockEvents:Ss(e.begin_block_events||[]),endBlockEvents:Ss(e.end_block_events||[])}}function Io(e){return{hash:(0,P.fromHex)((0,m.assertNotEmpty)(e.hash)),parts:{total:(0,m.assertNotEmpty)(e.parts.total),hash:(0,P.fromHex)((0,m.assertNotEmpty)(e.parts.hash))}}}function sg(e){return{block:(0,T.apiToSmallInt)(e.block),app:(0,T.apiToSmallInt)(e.app??0)}}function $o(e){return{version:sg(e.version),chainId:(0,m.assertNotEmpty)(e.chain_id),height:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.height)),time:(0,Vn.fromRfc3339WithNanoseconds)((0,m.assertNotEmpty)(e.time)),lastBlockId:e.last_block_id.hash?Io(e.last_block_id):null,lastCommitHash:(0,P.fromHex)((0,m.assertSet)(e.last_commit_hash)),dataHash:(0,P.fromHex)((0,m.assertSet)(e.data_hash)),validatorsHash:(0,P.fromHex)((0,m.assertSet)(e.validators_hash)),nextValidatorsHash:(0,P.fromHex)((0,m.assertSet)(e.next_validators_hash)),consensusHash:(0,P.fromHex)((0,m.assertSet)(e.consensus_hash)),appHash:(0,P.fromHex)((0,m.assertSet)(e.app_hash)),lastResultsHash:(0,P.fromHex)((0,m.assertSet)(e.last_results_hash)),evidenceHash:(0,P.fromHex)((0,m.assertSet)(e.evidence_hash)),proposerAddress:(0,P.fromHex)((0,m.assertNotEmpty)(e.proposer_address))}}function ig(e){return{blockId:Io(e.block_id),blockSize:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.block_size)),header:$o(e.header),numTxs:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.num_txs))}}function ag(e){return{lastHeight:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.last_height)),blockMetas:(0,m.assertArray)(e.block_metas).map(ig)}}function cg(e){return{...hn(e),hash:(0,P.fromHex)((0,m.assertNotEmpty)(e.hash))}}function ug(e){return{height:(0,T.apiToSmallInt)(e.height),hash:(0,P.fromHex)((0,m.assertNotEmpty)(e.hash)),checkTx:hn((0,m.assertObject)(e.check_tx)),deliverTx:(0,m.may)(hn,e.deliver_tx)}}function lg(e){return(0,ac.assert)(e in Kp.BlockIdFlag),e}function dg(e){return{blockIdFlag:lg(e.block_id_flag),validatorAddress:e.validator_address?(0,P.fromHex)(e.validator_address):void 0,timestamp:e.timestamp?(0,Vn.fromRfc3339WithNanoseconds)(e.timestamp):void 0,signature:e.signature?(0,P.fromBase64)(e.signature):void 0}}function dc(e){return{blockId:Io((0,m.assertObject)(e.block_id)),height:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.height)),round:(0,T.apiToSmallInt)(e.round),signatures:(0,m.assertArray)(e.signatures).map(dg)}}function mg(e){return{canonical:(0,m.assertBoolean)(e.canonical),header:$o(e.signed_header.header),commit:dc(e.signed_header.commit)}}function mc(e){return{address:(0,P.fromHex)((0,m.assertNotEmpty)(e.address)),pubkey:Ks((0,m.assertObject)(e.pub_key)),votingPower:(0,T.apiToBigInt)((0,m.assertNotEmpty)(e.power))}}Ne.decodeValidatorGenesis=mc;function fg(e){return{genesisTime:(0,Vn.fromRfc3339WithNanoseconds)((0,m.assertNotEmpty)(e.genesis_time)),chainId:(0,m.assertNotEmpty)(e.chain_id),consensusParams:uc(e.consensus_params),validators:e.validators?(0,m.assertArray)(e.validators).map(mc):[],appHash:(0,P.fromHex)((0,m.assertSet)(e.app_hash)),appState:e.app_state}}function Qs(e){return{pubkey:Ks((0,m.assertObject)(e.pub_key)),votingPower:(0,T.apiToBigInt)((0,m.assertNotEmpty)(e.voting_power)),address:(0,P.fromHex)((0,m.assertNotEmpty)(e.address)),proposerPriority:e.proposer_priority?(0,T.apiToSmallInt)(e.proposer_priority):void 0}}Ne.decodeValidatorInfo=Qs;function hg(e){return{id:(0,P.fromHex)((0,m.assertNotEmpty)(e.id)),listenAddr:(0,m.assertNotEmpty)(e.listen_addr),network:(0,m.assertNotEmpty)(e.network),version:(0,m.assertString)(e.version),channels:(0,m.assertNotEmpty)(e.channels),moniker:(0,m.assertNotEmpty)(e.moniker),other:(0,m.dictionaryToStringMap)(e.other),protocolVersion:{app:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.protocol_version.app)),block:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.protocol_version.block)),p2p:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.protocol_version.p2p))}}}function pg(e){const t=e.earliest_block_height?(0,T.apiToSmallInt)(e.earliest_block_height):void 0,n=e.earliest_block_time?(0,Vn.fromRfc3339WithNanoseconds)(e.earliest_block_time):void 0;return{earliestAppHash:e.earliest_app_hash?(0,P.fromHex)(e.earliest_app_hash):void 0,earliestBlockHash:e.earliest_block_hash?(0,P.fromHex)(e.earliest_block_hash):void 0,earliestBlockHeight:t||void 0,earliestBlockTime:n!=null&&n.getTime()?n:void 0,latestBlockHash:(0,P.fromHex)((0,m.assertNotEmpty)(e.latest_block_hash)),latestAppHash:(0,P.fromHex)((0,m.assertNotEmpty)(e.latest_app_hash)),latestBlockTime:(0,Vn.fromRfc3339WithNanoseconds)((0,m.assertNotEmpty)(e.latest_block_time)),latestBlockHeight:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.latest_block_height)),catchingUp:(0,m.assertBoolean)(e.catching_up)}}function gg(e){return{nodeInfo:hg(e.node_info),syncInfo:pg(e.sync_info),validatorInfo:Qs(e.validator_info)}}function yg(e){return{data:(0,P.fromBase64)((0,m.assertNotEmpty)(e.data)),rootHash:(0,P.fromHex)((0,m.assertNotEmpty)(e.root_hash)),proof:{total:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.proof.total)),index:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.proof.index)),leafHash:(0,P.fromBase64)((0,m.assertNotEmpty)(e.proof.leaf_hash)),aunts:(0,m.assertArray)(e.proof.aunts).map(P.fromBase64)}}}function fc(e){return{tx:(0,P.fromBase64)((0,m.assertNotEmpty)(e.tx)),result:hn((0,m.assertObject)(e.tx_result)),height:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.height)),index:(0,T.apiToSmallInt)((0,m.assertNumber)(e.index)),hash:(0,P.fromHex)((0,m.assertNotEmpty)(e.hash)),proof:(0,m.may)(yg,e.proof)}}function bg(e){return{totalCount:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.total_count)),txs:(0,m.assertArray)(e.txs).map(fc)}}function vg(e){const t=(0,P.fromBase64)((0,m.assertNotEmpty)(e.tx));return{tx:t,hash:(0,Qp.hashTx)(t),result:hn(e.result),height:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.height))}}function wg(e){return{blockHeight:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.block_height)),validators:(0,m.assertArray)(e.validators).map(Qs),count:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.count)),total:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.total))}}function hc(e){var t;return{header:$o((0,m.assertObject)(e.header)),lastCommit:e.last_commit.block_id.hash?dc((0,m.assertObject)(e.last_commit)):null,txs:e.data.txs?(0,m.assertArray)(e.data.txs).map(P.fromBase64):[],evidence:((t=e.evidence)==null?void 0:t.evidence)??[]}}function pc(e){return{blockId:Io(e.block_id),block:hc(e.block)}}function kg(e){return{totalCount:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.total_count)),blocks:(0,m.assertArray)(e.blocks).map(pc)}}function _g(e){return{total:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.total)),totalBytes:(0,T.apiToSmallInt)((0,m.assertNotEmpty)(e.total_bytes))}}let Sg=class gc{static decodeAbciInfo(t){return Zp((0,m.assertObject)(t.result.response))}static decodeAbciQuery(t){return Yp((0,m.assertObject)(t.result.response))}static decodeBlock(t){return pc(t.result)}static decodeBlockResults(t){return og(t.result)}static decodeBlockSearch(t){return kg(t.result)}static decodeBlockchain(t){return ag(t.result)}static decodeBroadcastTxSync(t){return cg(t.result)}static decodeBroadcastTxAsync(t){return gc.decodeBroadcastTxSync(t)}static decodeBroadcastTxCommit(t){return ug(t.result)}static decodeCommit(t){return mg(t.result)}static decodeGenesis(t){return fg((0,m.assertObject)(t.result.genesis))}static decodeHealth(){return null}static decodeNumUnconfirmedTxs(t){return _g(t.result)}static decodeStatus(t){return gg(t.result)}static decodeNewBlockEvent(t){return hc(t.data.value.block)}static decodeNewBlockHeaderEvent(t){return $o(t.data.value.header)}static decodeTxEvent(t){return vg(t.data.value.TxResult)}static decodeTx(t){return fc(t.result)}static decodeTxSearch(t){return bg(t.result)}static decodeValidators(t){return wg(t.result)}};Ne.Responses=Sg;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Responses=e.Params=void 0;var t=Ro;Object.defineProperty(e,"Params",{enumerable:!0,get:function(){return t.Params}});var n=Ne;Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return n.Responses}})})(ic);var Pg=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Ag=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Tg=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Pg(t,e,n);return Ag(t,e),t};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.Tendermint34Client=void 0;const Eg=it,vr=Xn,B=ic,J=Tg(Oo);class Br{static async connect(t){let n;return typeof t=="object"?n=new vr.HttpClient(t):n=t.startsWith("http://")||t.startsWith("https://")?new vr.HttpClient(t):new vr.WebsocketClient(t),await this.detectVersion(n),Br.create(n)}static async create(t){return new Br(t)}static async detectVersion(t){const n=(0,Eg.createJsonRpcRequest)(J.Method.Status),o=(await t.execute(n)).result;if(!o||!o.node_info)throw new Error("Unrecognized format for status response");const s=o.node_info.version;if(typeof s!="string")throw new Error("Unrecognized version format: must be string");return s}constructor(t){this.client=t}disconnect(){this.client.disconnect()}async abciInfo(){const t={method:J.Method.AbciInfo};return this.doCall(t,B.Params.encodeAbciInfo,B.Responses.decodeAbciInfo)}async abciQuery(t){const n={params:t,method:J.Method.AbciQuery};return this.doCall(n,B.Params.encodeAbciQuery,B.Responses.decodeAbciQuery)}async block(t){const n={method:J.Method.Block,params:{height:t}};return this.doCall(n,B.Params.encodeBlock,B.Responses.decodeBlock)}async blockResults(t){const n={method:J.Method.BlockResults,params:{height:t}};return this.doCall(n,B.Params.encodeBlockResults,B.Responses.decodeBlockResults)}async blockSearch(t){const n={params:t,method:J.Method.BlockSearch},r=await this.doCall(n,B.Params.encodeBlockSearch,B.Responses.decodeBlockSearch);return{...r,blocks:[...r.blocks].sort((o,s)=>o.block.header.height-s.block.header.height)}}async blockSearchAll(t){let n=t.page||1;const r=[];let o=!1;for(;!o;){const s=await this.blockSearch({...t,page:n});r.push(...s.blocks),r.length<s.totalCount?n++:o=!0}return r.sort((s,i)=>s.block.header.height-i.block.header.height),{totalCount:r.length,blocks:r}}async blockchain(t,n){const r={method:J.Method.Blockchain,params:{minHeight:t,maxHeight:n}};return this.doCall(r,B.Params.encodeBlockchain,B.Responses.decodeBlockchain)}async broadcastTxSync(t){const n={params:t,method:J.Method.BroadcastTxSync};return this.doCall(n,B.Params.encodeBroadcastTx,B.Responses.decodeBroadcastTxSync)}async broadcastTxAsync(t){const n={params:t,method:J.Method.BroadcastTxAsync};return this.doCall(n,B.Params.encodeBroadcastTx,B.Responses.decodeBroadcastTxAsync)}async broadcastTxCommit(t){const n={params:t,method:J.Method.BroadcastTxCommit};return this.doCall(n,B.Params.encodeBroadcastTx,B.Responses.decodeBroadcastTxCommit)}async commit(t){const n={method:J.Method.Commit,params:{height:t}};return this.doCall(n,B.Params.encodeCommit,B.Responses.decodeCommit)}async genesis(){const t={method:J.Method.Genesis};return this.doCall(t,B.Params.encodeGenesis,B.Responses.decodeGenesis)}async health(){const t={method:J.Method.Health};return this.doCall(t,B.Params.encodeHealth,B.Responses.decodeHealth)}async numUnconfirmedTxs(){const t={method:J.Method.NumUnconfirmedTxs};return this.doCall(t,B.Params.encodeNumUnconfirmedTxs,B.Responses.decodeNumUnconfirmedTxs)}async status(){const t={method:J.Method.Status};return this.doCall(t,B.Params.encodeStatus,B.Responses.decodeStatus)}subscribeNewBlock(){const t={method:J.Method.Subscribe,query:{type:J.SubscriptionEventType.NewBlock}};return this.subscribe(t,B.Responses.decodeNewBlockEvent)}subscribeNewBlockHeader(){const t={method:J.Method.Subscribe,query:{type:J.SubscriptionEventType.NewBlockHeader}};return this.subscribe(t,B.Responses.decodeNewBlockHeaderEvent)}subscribeTx(t){const n={method:J.Method.Subscribe,query:{type:J.SubscriptionEventType.Tx,raw:t}};return this.subscribe(n,B.Responses.decodeTxEvent)}async tx(t){const n={params:t,method:J.Method.Tx};return this.doCall(n,B.Params.encodeTx,B.Responses.decodeTx)}async txSearch(t){const n={params:t,method:J.Method.TxSearch};return this.doCall(n,B.Params.encodeTxSearch,B.Responses.decodeTxSearch)}async txSearchAll(t){let n=t.page||1;const r=[];let o=!1;for(;!o;){const s=await this.txSearch({...t,page:n});r.push(...s.txs),r.length<s.totalCount?n++:o=!0}return{totalCount:r.length,txs:r}}async validators(t){const n={method:J.Method.Validators,params:t};return this.doCall(n,B.Params.encodeValidators,B.Responses.decodeValidators)}async validatorsAll(t){const n=[];let r=1,o=!1,s=t;for(;!o;){const i=await this.validators({per_page:50,height:s,page:r});n.push(...i.validators),s=s||i.blockHeight,n.length<i.total?r++:o=!0}return{blockHeight:s??0,count:n.length,total:n.length,validators:n}}async doCall(t,n,r){const o=n(t),s=await this.client.execute(o);return r(s)}subscribe(t,n){if(!(0,vr.instanceOfRpcStreamingClient)(this.client))throw new Error("This RPC client type cannot subscribe to events");const r=B.Params.encodeSubscribe(t);return this.client.listen(r).map(s=>n(s))}}Bo.Tendermint34Client=Br;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Tendermint34Client=e.VoteType=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.SubscriptionEventType=e.Method=void 0;var t=Oo;Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return t.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return t.SubscriptionEventType}});var n=sc;Object.defineProperty(e,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return n.broadcastTxCommitSuccess}}),Object.defineProperty(e,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return n.broadcastTxSyncSuccess}}),Object.defineProperty(e,"VoteType",{enumerable:!0,get:function(){return n.VoteType}});var r=Bo;Object.defineProperty(e,"Tendermint34Client",{enumerable:!0,get:function(){return r.Tendermint34Client}})})(Dn);var Rr={},No={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buildQuery=e.SubscriptionEventType=e.Method=void 0,function(n){n.AbciInfo="abci_info",n.AbciQuery="abci_query",n.Block="block",n.Blockchain="blockchain",n.BlockResults="block_results",n.BlockSearch="block_search",n.BroadcastTxAsync="broadcast_tx_async",n.BroadcastTxSync="broadcast_tx_sync",n.BroadcastTxCommit="broadcast_tx_commit",n.Commit="commit",n.Genesis="genesis",n.Health="health",n.NumUnconfirmedTxs="num_unconfirmed_txs",n.Status="status",n.Subscribe="subscribe",n.Tx="tx",n.TxSearch="tx_search",n.Validators="validators",n.Unsubscribe="unsubscribe"}(e.Method||(e.Method={})),function(n){n.NewBlock="NewBlock",n.NewBlockHeader="NewBlockHeader",n.Tx="Tx"}(e.SubscriptionEventType||(e.SubscriptionEventType={}));function t(n){const o=(n.tags?n.tags:[]).map(i=>`${i.key}='${i.value}'`),s=n.raw?[n.raw]:[];return[...o,...s].join(" AND ")}e.buildQuery=t})(No);var yc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VoteType=e.broadcastTxCommitSuccess=e.broadcastTxSyncSuccess=void 0;function t(r){return r.code===0}e.broadcastTxSyncSuccess=t;function n(r){return r.checkTx.code===0&&!!r.deliverTx&&r.deliverTx.code===0}e.broadcastTxCommitSuccess=n,function(r){r[r.PreVote=1]="PreVote",r[r.PreCommit=2]="PreCommit"}(e.VoteType||(e.VoteType={}))})(yc);var Do={},bc={},xo={},N={};Object.defineProperty(N,"__esModule",{value:!0});N.encodeBlockId=N.encodeVersion=N.encodeBytes=N.encodeTime=N.encodeUvarint=N.encodeString=N.dictionaryToStringMap=N.may=N.assertNotEmpty=N.assertObject=N.assertArray=N.assertNumber=N.assertString=N.assertBoolean=N.assertSet=void 0;const Cg=D;function Rt(e){if(e===void 0)throw new Error("Value must not be undefined");if(e===null)throw new Error("Value must not be null");return e}N.assertSet=Rt;function jg(e){if(Rt(e),typeof e!="boolean")throw new Error("Value must be a boolean");return e}N.assertBoolean=jg;function Mg(e){if(Rt(e),typeof e!="string")throw new Error("Value must be a string");return e}N.assertString=Mg;function Og(e){if(Rt(e),typeof e!="number")throw new Error("Value must be a number");return e}N.assertNumber=Og;function Bg(e){if(Rt(e),!Array.isArray(e))throw new Error("Value must be a an array");return e}N.assertArray=Bg;function Rg(e){if(Rt(e),typeof e!="object")throw new Error("Value must be an object");if(Object.prototype.toString.call(e)!=="[object Object]")throw new Error("Value must be a simple object");return e}N.assertObject=Rg;function Ig(e){if(Rt(e),typeof e=="number"&&e===0)throw new Error("must provide a non-zero value");if(e.length===0)throw new Error("must provide a non-empty value");return e}N.assertNotEmpty=Ig;function $g(e,t){return t==null?void 0:e(t)}N.may=$g;function Ng(e){const t=new Map;for(const n of Object.keys(e)){const r=e[n];if(typeof r!="string")throw new Error("Found dictionary value of type other than string");t.set(n,r)}return t}N.dictionaryToStringMap=Ng;function Dg(e){const t=(0,Cg.toUtf8)(e);return Uint8Array.from([t.length,...t])}N.encodeString=Dg;function pn(e){return e>=128?Uint8Array.from([e&255|128,...pn(e>>7)]):Uint8Array.from([e&255])}N.encodeUvarint=pn;function xg(e){const t=e.getTime(),n=Math.floor(t/1e3),r=n?[8,...pn(n)]:new Uint8Array,o=(e.nanoseconds||0)+t%1e3*1e6,s=o?[16,...pn(o)]:new Uint8Array;return Uint8Array.from([...r,...s])}N.encodeTime=xg;function Ug(e){if(e.length>=128)throw new Error("Not implemented for byte arrays of length 128 or more");return e.length?Uint8Array.from([e.length,...e]):new Uint8Array}N.encodeBytes=Ug;function qg(e){const t=e.block?Uint8Array.from([8,...pn(e.block)]):new Uint8Array,n=e.app?Uint8Array.from([16,...pn(e.app)]):new Uint8Array;return Uint8Array.from([...t,...n])}N.encodeVersion=qg;function Hg(e){return Uint8Array.from([10,e.hash.length,...e.hash,18,e.parts.hash.length+4,8,e.parts.total,18,e.parts.hash.length,...e.parts.hash])}N.encodeBlockId=Hg;var Vg=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Gg=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Fg=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Vg(t,e,n);return Gg(t,e),t};Object.defineProperty(xo,"__esModule",{value:!0});xo.Params=void 0;const Zs=D,Ge=Te,oe=it,ke=N,Wg=Fg(No);function rs(e){return{height:(0,ke.may)(Ge.smallIntToApi,e.height)}}function Jg(e){return{minHeight:(0,ke.may)(Ge.smallIntToApi,e.minHeight),maxHeight:(0,ke.may)(Ge.smallIntToApi,e.maxHeight)}}function Lg(e){return{query:e.query,page:(0,ke.may)(Ge.smallIntToApi,e.page),per_page:(0,ke.may)(Ge.smallIntToApi,e.per_page),order_by:e.order_by}}function zg(e){return{path:(0,ke.assertNotEmpty)(e.path),data:(0,Zs.toHex)(e.data),height:(0,ke.may)(Ge.smallIntToApi,e.height),prove:e.prove}}function Kg(e){return{tx:(0,Zs.toBase64)((0,ke.assertNotEmpty)(e.tx))}}function Qg(e){return{hash:(0,Zs.toBase64)((0,ke.assertNotEmpty)(e.hash)),prove:e.prove}}function Zg(e){return{query:e.query,prove:e.prove,page:(0,ke.may)(Ge.smallIntToApi,e.page),per_page:(0,ke.may)(Ge.smallIntToApi,e.per_page),order_by:e.order_by}}function Xg(e){return{height:(0,ke.may)(Ge.smallIntToApi,e.height),page:(0,ke.may)(Ge.smallIntToApi,e.page),per_page:(0,ke.may)(Ge.smallIntToApi,e.per_page)}}class Yg{static encodeAbciInfo(t){return(0,oe.createJsonRpcRequest)(t.method)}static encodeAbciQuery(t){return(0,oe.createJsonRpcRequest)(t.method,zg(t.params))}static encodeBlock(t){return(0,oe.createJsonRpcRequest)(t.method,rs(t.params))}static encodeBlockchain(t){return(0,oe.createJsonRpcRequest)(t.method,Jg(t.params))}static encodeBlockResults(t){return(0,oe.createJsonRpcRequest)(t.method,rs(t.params))}static encodeBlockSearch(t){return(0,oe.createJsonRpcRequest)(t.method,Lg(t.params))}static encodeBroadcastTx(t){return(0,oe.createJsonRpcRequest)(t.method,Kg(t.params))}static encodeCommit(t){return(0,oe.createJsonRpcRequest)(t.method,rs(t.params))}static encodeGenesis(t){return(0,oe.createJsonRpcRequest)(t.method)}static encodeHealth(t){return(0,oe.createJsonRpcRequest)(t.method)}static encodeNumUnconfirmedTxs(t){return(0,oe.createJsonRpcRequest)(t.method)}static encodeStatus(t){return(0,oe.createJsonRpcRequest)(t.method)}static encodeSubscribe(t){const n={key:"tm.event",value:t.query.type},r=Wg.buildQuery({tags:[n],raw:t.query.raw});return(0,oe.createJsonRpcRequest)("subscribe",{query:r})}static encodeTx(t){return(0,oe.createJsonRpcRequest)(t.method,Qg(t.params))}static encodeTxSearch(t){return(0,oe.createJsonRpcRequest)(t.method,Zg(t.params))}static encodeValidators(t){return(0,oe.createJsonRpcRequest)(t.method,Xg(t.params))}}xo.Params=Yg;var De={},gn={};Object.defineProperty(gn,"__esModule",{value:!0});gn.hashBlock=gn.hashTx=void 0;const Xs=_e,fe=N;function ey(e){return(0,Xs.sha256)(e)}gn.hashTx=ey;function ty(e){if(e<1)throw new Error("Cannot split an empty tree");const t=2**Math.floor(Math.log2(e));return t<e?t:t/2}function ny(e){const t=new Xs.Sha256(Uint8Array.from([0]));return t.update(e),t.digest()}function ry(e,t){const n=new Xs.Sha256(Uint8Array.from([1]));return n.update(e),n.update(t),n.digest()}function Ps(e){switch(e.length){case 0:throw new Error("Cannot hash empty tree");case 1:return ny(e[0]);default:{const t=ty(e.length),n=Ps(e.slice(0,t)),r=Ps(e.slice(t));return ry(n,r)}}}function oy(e){if(!e.lastBlockId)throw new Error("Hashing a block header with no last block ID (i.e. header at height 1) is not supported. If you need this, contributions are welcome. Please add documentation and test vectors for this case.");const t=[(0,fe.encodeVersion)(e.version),(0,fe.encodeString)(e.chainId),(0,fe.encodeUvarint)(e.height),(0,fe.encodeTime)(e.time),(0,fe.encodeBlockId)(e.lastBlockId),(0,fe.encodeBytes)(e.lastCommitHash),(0,fe.encodeBytes)(e.dataHash),(0,fe.encodeBytes)(e.validatorsHash),(0,fe.encodeBytes)(e.nextValidatorsHash),(0,fe.encodeBytes)(e.consensusHash),(0,fe.encodeBytes)(e.appHash),(0,fe.encodeBytes)(e.lastResultsHash),(0,fe.encodeBytes)(e.evidenceHash),(0,fe.encodeBytes)(e.proposerAddress)];return Ps(t)}gn.hashBlock=oy;Object.defineProperty(De,"__esModule",{value:!0});De.Responses=De.decodeValidatorInfo=De.decodeValidatorGenesis=De.decodeValidatorUpdate=De.decodeEvent=void 0;const j=D,vc=X,Gn=ae,E=Te,sy=nr,f=N,iy=gn;function ay(e){return{data:e.data,lastBlockHeight:(0,f.may)(E.apiToSmallInt,e.last_block_height),lastBlockAppHash:(0,f.may)(j.fromBase64,e.last_block_app_hash)}}function cy(e){return{ops:e.ops.map(t=>({type:t.type,key:(0,j.fromBase64)(t.key),data:(0,j.fromBase64)(t.data)}))}}function uy(e){return{key:(0,j.fromBase64)((0,f.assertString)(e.key??"")),value:(0,j.fromBase64)((0,f.assertString)(e.value??"")),proof:(0,f.may)(cy,e.proofOps),height:(0,f.may)(E.apiToSmallInt,e.height),code:(0,f.may)(E.apiToSmallInt,e.code),codespace:(0,f.assertString)(e.codespace??""),index:(0,f.may)(E.apiToSmallInt,e.index),log:e.log,info:(0,f.assertString)(e.info??"")}}function ly(e){return{key:(0,f.assertNotEmpty)(e.key),value:e.value??""}}function dy(e){return(0,f.assertArray)(e).map(ly)}function wc(e){return{type:e.type,attributes:e.attributes?dy(e.attributes):[]}}De.decodeEvent=wc;function As(e){return(0,f.assertArray)(e).map(wc)}function yn(e){return{code:(0,E.apiToSmallInt)((0,f.assertNumber)(e.code??0)),codespace:e.codespace,log:e.log,data:(0,f.may)(j.fromBase64,e.data),events:e.events?As(e.events):[],gasWanted:(0,E.apiToBigInt)(e.gas_wanted??"0"),gasUsed:(0,E.apiToBigInt)(e.gas_used??"0")}}function Ys(e){if("Sum"in e){const[[t,n]]=Object.entries(e.Sum.value);return(0,vc.assert)(t==="ed25519"||t==="secp256k1",`unknown pubkey type: ${t}`),{algorithm:t,data:(0,j.fromBase64)((0,f.assertNotEmpty)(n))}}else switch(e.type){case"tendermint/PubKeyEd25519":return{algorithm:"ed25519",data:(0,j.fromBase64)((0,f.assertNotEmpty)(e.value))};case"tendermint/PubKeySecp256k1":return{algorithm:"secp256k1",data:(0,j.fromBase64)((0,f.assertNotEmpty)(e.value))};default:throw new Error(`unknown pubkey type: ${e.type}`)}}function my(e){return{maxBytes:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.max_bytes)),maxGas:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.max_gas))}}function fy(e){return{maxAgeNumBlocks:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.max_age_num_blocks)),maxAgeDuration:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.max_age_duration))}}function kc(e){return{block:my((0,f.assertObject)(e.block)),evidence:fy((0,f.assertObject)(e.evidence))}}function _c(e){return{pubkey:Ys((0,f.assertObject)(e.pub_key)),votingPower:(0,E.apiToBigInt)(e.power??"0")}}De.decodeValidatorUpdate=_c;function hy(e){return{height:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.height)),results:(e.txs_results||[]).map(yn),validatorUpdates:(e.validator_updates||[]).map(_c),consensusUpdates:(0,f.may)(kc,e.consensus_param_updates),beginBlockEvents:As(e.begin_block_events||[]),endBlockEvents:As(e.end_block_events||[])}}function Uo(e){return{hash:(0,j.fromHex)((0,f.assertNotEmpty)(e.hash)),parts:{total:(0,f.assertNotEmpty)(e.parts.total),hash:(0,j.fromHex)((0,f.assertNotEmpty)(e.parts.hash))}}}function py(e){return{block:(0,E.apiToSmallInt)(e.block),app:(0,E.apiToSmallInt)(e.app??0)}}function qo(e){return{version:py(e.version),chainId:(0,f.assertNotEmpty)(e.chain_id),height:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.height)),time:(0,Gn.fromRfc3339WithNanoseconds)((0,f.assertNotEmpty)(e.time)),lastBlockId:e.last_block_id.hash?Uo(e.last_block_id):null,lastCommitHash:(0,j.fromHex)((0,f.assertSet)(e.last_commit_hash)),dataHash:(0,j.fromHex)((0,f.assertSet)(e.data_hash)),validatorsHash:(0,j.fromHex)((0,f.assertSet)(e.validators_hash)),nextValidatorsHash:(0,j.fromHex)((0,f.assertSet)(e.next_validators_hash)),consensusHash:(0,j.fromHex)((0,f.assertSet)(e.consensus_hash)),appHash:(0,j.fromHex)((0,f.assertSet)(e.app_hash)),lastResultsHash:(0,j.fromHex)((0,f.assertSet)(e.last_results_hash)),evidenceHash:(0,j.fromHex)((0,f.assertSet)(e.evidence_hash)),proposerAddress:(0,j.fromHex)((0,f.assertNotEmpty)(e.proposer_address))}}function gy(e){return{blockId:Uo(e.block_id),blockSize:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.block_size)),header:qo(e.header),numTxs:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.num_txs))}}function yy(e){return{lastHeight:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.last_height)),blockMetas:(0,f.assertArray)(e.block_metas).map(gy)}}function by(e){return{...yn(e),hash:(0,j.fromHex)((0,f.assertNotEmpty)(e.hash))}}function vy(e){return{height:(0,E.apiToSmallInt)(e.height),hash:(0,j.fromHex)((0,f.assertNotEmpty)(e.hash)),checkTx:yn((0,f.assertObject)(e.check_tx)),deliverTx:(0,f.may)(yn,e.deliver_tx)}}function wy(e){return(0,vc.assert)(e in sy.BlockIdFlag),e}function ky(e){return{blockIdFlag:wy(e.block_id_flag),validatorAddress:e.validator_address?(0,j.fromHex)(e.validator_address):void 0,timestamp:e.timestamp?(0,Gn.fromRfc3339WithNanoseconds)(e.timestamp):void 0,signature:e.signature?(0,j.fromBase64)(e.signature):void 0}}function Sc(e){return{blockId:Uo((0,f.assertObject)(e.block_id)),height:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.height)),round:(0,E.apiToSmallInt)(e.round),signatures:(0,f.assertArray)(e.signatures).map(ky)}}function _y(e){return{canonical:(0,f.assertBoolean)(e.canonical),header:qo(e.signed_header.header),commit:Sc(e.signed_header.commit)}}function Pc(e){return{address:(0,j.fromHex)((0,f.assertNotEmpty)(e.address)),pubkey:Ys((0,f.assertObject)(e.pub_key)),votingPower:(0,E.apiToBigInt)((0,f.assertNotEmpty)(e.power))}}De.decodeValidatorGenesis=Pc;function Sy(e){return{genesisTime:(0,Gn.fromRfc3339WithNanoseconds)((0,f.assertNotEmpty)(e.genesis_time)),chainId:(0,f.assertNotEmpty)(e.chain_id),consensusParams:kc(e.consensus_params),validators:e.validators?(0,f.assertArray)(e.validators).map(Pc):[],appHash:(0,j.fromHex)((0,f.assertSet)(e.app_hash)),appState:e.app_state}}function ei(e){return{pubkey:Ys((0,f.assertObject)(e.pub_key)),votingPower:(0,E.apiToBigInt)((0,f.assertNotEmpty)(e.voting_power)),address:(0,j.fromHex)((0,f.assertNotEmpty)(e.address)),proposerPriority:e.proposer_priority?(0,E.apiToSmallInt)(e.proposer_priority):void 0}}De.decodeValidatorInfo=ei;function Py(e){return{id:(0,j.fromHex)((0,f.assertNotEmpty)(e.id)),listenAddr:(0,f.assertNotEmpty)(e.listen_addr),network:(0,f.assertNotEmpty)(e.network),version:(0,f.assertString)(e.version),channels:(0,f.assertString)(e.channels),moniker:(0,f.assertNotEmpty)(e.moniker),other:(0,f.dictionaryToStringMap)(e.other),protocolVersion:{app:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.protocol_version.app)),block:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.protocol_version.block)),p2p:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.protocol_version.p2p))}}}function Ay(e){const t=e.earliest_block_height?(0,E.apiToSmallInt)(e.earliest_block_height):void 0,n=e.earliest_block_time?(0,Gn.fromRfc3339WithNanoseconds)(e.earliest_block_time):void 0;return{earliestAppHash:e.earliest_app_hash?(0,j.fromHex)(e.earliest_app_hash):void 0,earliestBlockHash:e.earliest_block_hash?(0,j.fromHex)(e.earliest_block_hash):void 0,earliestBlockHeight:t||void 0,earliestBlockTime:n!=null&&n.getTime()?n:void 0,latestBlockHash:(0,j.fromHex)((0,f.assertNotEmpty)(e.latest_block_hash)),latestAppHash:(0,j.fromHex)((0,f.assertNotEmpty)(e.latest_app_hash)),latestBlockTime:(0,Gn.fromRfc3339WithNanoseconds)((0,f.assertNotEmpty)(e.latest_block_time)),latestBlockHeight:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.latest_block_height)),catchingUp:(0,f.assertBoolean)(e.catching_up)}}function Ty(e){return{nodeInfo:Py(e.node_info),syncInfo:Ay(e.sync_info),validatorInfo:ei(e.validator_info)}}function Ey(e){return{data:(0,j.fromBase64)((0,f.assertNotEmpty)(e.data)),rootHash:(0,j.fromHex)((0,f.assertNotEmpty)(e.root_hash)),proof:{total:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.proof.total)),index:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.proof.index)),leafHash:(0,j.fromBase64)((0,f.assertNotEmpty)(e.proof.leaf_hash)),aunts:(0,f.assertArray)(e.proof.aunts).map(j.fromBase64)}}}function Ac(e){return{tx:(0,j.fromBase64)((0,f.assertNotEmpty)(e.tx)),result:yn((0,f.assertObject)(e.tx_result)),height:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.height)),index:(0,E.apiToSmallInt)((0,f.assertNumber)(e.index)),hash:(0,j.fromHex)((0,f.assertNotEmpty)(e.hash)),proof:(0,f.may)(Ey,e.proof)}}function Cy(e){return{totalCount:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.total_count)),txs:(0,f.assertArray)(e.txs).map(Ac)}}function jy(e){const t=(0,j.fromBase64)((0,f.assertNotEmpty)(e.tx));return{tx:t,hash:(0,iy.hashTx)(t),result:yn(e.result),height:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.height))}}function My(e){return{blockHeight:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.block_height)),validators:(0,f.assertArray)(e.validators).map(ei),count:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.count)),total:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.total))}}function Tc(e){var t;return{header:qo((0,f.assertObject)(e.header)),lastCommit:e.last_commit.block_id.hash?Sc((0,f.assertObject)(e.last_commit)):null,txs:e.data.txs?(0,f.assertArray)(e.data.txs).map(j.fromBase64):[],evidence:((t=e.evidence)==null?void 0:t.evidence)??[]}}function Ec(e){return{blockId:Uo(e.block_id),block:Tc(e.block)}}function Oy(e){return{totalCount:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.total_count)),blocks:(0,f.assertArray)(e.blocks).map(Ec)}}function By(e){return{total:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.total)),totalBytes:(0,E.apiToSmallInt)((0,f.assertNotEmpty)(e.total_bytes))}}class ti{static decodeAbciInfo(t){return ay((0,f.assertObject)(t.result.response))}static decodeAbciQuery(t){return uy((0,f.assertObject)(t.result.response))}static decodeBlock(t){return Ec(t.result)}static decodeBlockResults(t){return hy(t.result)}static decodeBlockSearch(t){return Oy(t.result)}static decodeBlockchain(t){return yy(t.result)}static decodeBroadcastTxSync(t){return by(t.result)}static decodeBroadcastTxAsync(t){return ti.decodeBroadcastTxSync(t)}static decodeBroadcastTxCommit(t){return vy(t.result)}static decodeCommit(t){return _y(t.result)}static decodeGenesis(t){return Sy((0,f.assertObject)(t.result.genesis))}static decodeHealth(){return null}static decodeNumUnconfirmedTxs(t){return By(t.result)}static decodeStatus(t){return Ty(t.result)}static decodeNewBlockEvent(t){return Tc(t.data.value.block)}static decodeNewBlockHeaderEvent(t){return qo(t.data.value.header)}static decodeTxEvent(t){return jy(t.data.value.TxResult)}static decodeTx(t){return Ac(t.result)}static decodeTxSearch(t){return Cy(t.result)}static decodeValidators(t){return My(t.result)}}De.Responses=ti;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Responses=e.Params=void 0;var t=xo;Object.defineProperty(e,"Params",{enumerable:!0,get:function(){return t.Params}});var n=De;Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return n.Responses}})})(bc);var Ry=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Iy=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),$y=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Ry(t,e,n);return Iy(t,e),t};Object.defineProperty(Do,"__esModule",{value:!0});Do.Tendermint37Client=void 0;const Ny=it,wr=Xn,R=bc,L=$y(No);class Ir{static async connect(t){let n;return typeof t=="object"?n=new wr.HttpClient(t):n=t.startsWith("http://")||t.startsWith("https://")?new wr.HttpClient(t):new wr.WebsocketClient(t),await this.detectVersion(n),Ir.create(n)}static async create(t){return new Ir(t)}static async detectVersion(t){const n=(0,Ny.createJsonRpcRequest)(L.Method.Status),o=(await t.execute(n)).result;if(!o||!o.node_info)throw new Error("Unrecognized format for status response");const s=o.node_info.version;if(typeof s!="string")throw new Error("Unrecognized version format: must be string");return s}constructor(t){this.client=t}disconnect(){this.client.disconnect()}async abciInfo(){const t={method:L.Method.AbciInfo};return this.doCall(t,R.Params.encodeAbciInfo,R.Responses.decodeAbciInfo)}async abciQuery(t){const n={params:t,method:L.Method.AbciQuery};return this.doCall(n,R.Params.encodeAbciQuery,R.Responses.decodeAbciQuery)}async block(t){const n={method:L.Method.Block,params:{height:t}};return this.doCall(n,R.Params.encodeBlock,R.Responses.decodeBlock)}async blockResults(t){const n={method:L.Method.BlockResults,params:{height:t}};return this.doCall(n,R.Params.encodeBlockResults,R.Responses.decodeBlockResults)}async blockSearch(t){const n={params:t,method:L.Method.BlockSearch},r=await this.doCall(n,R.Params.encodeBlockSearch,R.Responses.decodeBlockSearch);return{...r,blocks:[...r.blocks].sort((o,s)=>o.block.header.height-s.block.header.height)}}async blockSearchAll(t){let n=t.page||1;const r=[];let o=!1;for(;!o;){const s=await this.blockSearch({...t,page:n});r.push(...s.blocks),r.length<s.totalCount?n++:o=!0}return r.sort((s,i)=>s.block.header.height-i.block.header.height),{totalCount:r.length,blocks:r}}async blockchain(t,n){const r={method:L.Method.Blockchain,params:{minHeight:t,maxHeight:n}};return this.doCall(r,R.Params.encodeBlockchain,R.Responses.decodeBlockchain)}async broadcastTxSync(t){const n={params:t,method:L.Method.BroadcastTxSync};return this.doCall(n,R.Params.encodeBroadcastTx,R.Responses.decodeBroadcastTxSync)}async broadcastTxAsync(t){const n={params:t,method:L.Method.BroadcastTxAsync};return this.doCall(n,R.Params.encodeBroadcastTx,R.Responses.decodeBroadcastTxAsync)}async broadcastTxCommit(t){const n={params:t,method:L.Method.BroadcastTxCommit};return this.doCall(n,R.Params.encodeBroadcastTx,R.Responses.decodeBroadcastTxCommit)}async commit(t){const n={method:L.Method.Commit,params:{height:t}};return this.doCall(n,R.Params.encodeCommit,R.Responses.decodeCommit)}async genesis(){const t={method:L.Method.Genesis};return this.doCall(t,R.Params.encodeGenesis,R.Responses.decodeGenesis)}async health(){const t={method:L.Method.Health};return this.doCall(t,R.Params.encodeHealth,R.Responses.decodeHealth)}async numUnconfirmedTxs(){const t={method:L.Method.NumUnconfirmedTxs};return this.doCall(t,R.Params.encodeNumUnconfirmedTxs,R.Responses.decodeNumUnconfirmedTxs)}async status(){const t={method:L.Method.Status};return this.doCall(t,R.Params.encodeStatus,R.Responses.decodeStatus)}subscribeNewBlock(){const t={method:L.Method.Subscribe,query:{type:L.SubscriptionEventType.NewBlock}};return this.subscribe(t,R.Responses.decodeNewBlockEvent)}subscribeNewBlockHeader(){const t={method:L.Method.Subscribe,query:{type:L.SubscriptionEventType.NewBlockHeader}};return this.subscribe(t,R.Responses.decodeNewBlockHeaderEvent)}subscribeTx(t){const n={method:L.Method.Subscribe,query:{type:L.SubscriptionEventType.Tx,raw:t}};return this.subscribe(n,R.Responses.decodeTxEvent)}async tx(t){const n={params:t,method:L.Method.Tx};return this.doCall(n,R.Params.encodeTx,R.Responses.decodeTx)}async txSearch(t){const n={params:t,method:L.Method.TxSearch};return this.doCall(n,R.Params.encodeTxSearch,R.Responses.decodeTxSearch)}async txSearchAll(t){let n=t.page||1;const r=[];let o=!1;for(;!o;){const s=await this.txSearch({...t,page:n});r.push(...s.txs),r.length<s.totalCount?n++:o=!0}return{totalCount:r.length,txs:r}}async validators(t){const n={method:L.Method.Validators,params:t};return this.doCall(n,R.Params.encodeValidators,R.Responses.decodeValidators)}async validatorsAll(t){const n=[];let r=1,o=!1,s=t;for(;!o;){const i=await this.validators({per_page:50,height:s,page:r});n.push(...i.validators),s=s||i.blockHeight,n.length<i.total?r++:o=!0}return{blockHeight:s??0,count:n.length,total:n.length,validators:n}}async doCall(t,n,r){const o=n(t),s=await this.client.execute(o);return r(s)}subscribe(t,n){if(!(0,wr.instanceOfRpcStreamingClient)(this.client))throw new Error("This RPC client type cannot subscribe to events");const r=R.Params.encodeSubscribe(t);return this.client.listen(r).map(s=>n(s))}}Do.Tendermint37Client=Ir;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Tendermint37Client=e.VoteType=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.SubscriptionEventType=e.Method=void 0;var t=No;Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return t.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return t.SubscriptionEventType}});var n=yc;Object.defineProperty(e,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return n.broadcastTxCommitSuccess}}),Object.defineProperty(e,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return n.broadcastTxSyncSuccess}}),Object.defineProperty(e,"VoteType",{enumerable:!0,get:function(){return n.VoteType}});var r=Do;Object.defineProperty(e,"Tendermint37Client",{enumerable:!0,get:function(){return r.Tendermint37Client}})})(Rr);var Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.connectComet=Xe.isComet38Client=Xe.isTendermint37Client=Xe.isTendermint34Client=void 0;const Cc=jr,jc=Dn,Mc=Rr;function Dy(e){return e instanceof jc.Tendermint34Client}Xe.isTendermint34Client=Dy;function xy(e){return e instanceof Mc.Tendermint37Client}Xe.isTendermint37Client=xy;function Uy(e){return e instanceof Cc.Comet38Client}Xe.isComet38Client=Uy;async function qy(e){let t;const n=await Mc.Tendermint37Client.connect(e),r=(await n.status()).nodeInfo.version;return r.startsWith("0.37.")?t=n:r.startsWith("0.38.")?(n.disconnect(),t=await Cc.Comet38Client.connect(e)):(n.disconnect(),t=await jc.Tendermint34Client.connect(e)),t}Xe.connectComet=qy;(function(e){var t=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(_,G,b,g){g===void 0&&(g=b);var w=Object.getOwnPropertyDescriptor(G,b);(!w||("get"in w?!G.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return G[b]}}),Object.defineProperty(_,g,w)}:function(_,G,b,g){g===void 0&&(g=b),_[g]=G[b]}),n=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(_,G){Object.defineProperty(_,"default",{enumerable:!0,value:G})}:function(_,G){_.default=G}),r=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(_){if(_&&_.__esModule)return _;var G={};if(_!=null)for(var b in _)b!=="default"&&Object.prototype.hasOwnProperty.call(_,b)&&t(G,_,b);return n(G,_),G};Object.defineProperty(e,"__esModule",{value:!0}),e.BlockIdFlag=e.isTendermint37Client=e.isTendermint34Client=e.isComet38Client=e.connectComet=e.Tendermint37Client=e.tendermint37=e.Tendermint34Client=e.tendermint34=e.VoteType=e.SubscriptionEventType=e.Method=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.WebsocketClient=e.HttpClient=e.HttpBatchClient=e.Comet38Client=e.comet38=e.toSeconds=e.toRfc3339WithNanoseconds=e.fromSeconds=e.fromRfc3339WithNanoseconds=e.DateTime=e.rawSecp256k1PubkeyToRawAddress=e.rawEd25519PubkeyToRawAddress=e.pubkeyToRawAddress=e.pubkeyToAddress=void 0;var o=Ze;Object.defineProperty(e,"pubkeyToAddress",{enumerable:!0,get:function(){return o.pubkeyToAddress}}),Object.defineProperty(e,"pubkeyToRawAddress",{enumerable:!0,get:function(){return o.pubkeyToRawAddress}}),Object.defineProperty(e,"rawEd25519PubkeyToRawAddress",{enumerable:!0,get:function(){return o.rawEd25519PubkeyToRawAddress}}),Object.defineProperty(e,"rawSecp256k1PubkeyToRawAddress",{enumerable:!0,get:function(){return o.rawSecp256k1PubkeyToRawAddress}});var s=ae;Object.defineProperty(e,"DateTime",{enumerable:!0,get:function(){return s.DateTime}}),Object.defineProperty(e,"fromRfc3339WithNanoseconds",{enumerable:!0,get:function(){return s.fromRfc3339WithNanoseconds}}),Object.defineProperty(e,"fromSeconds",{enumerable:!0,get:function(){return s.fromSeconds}}),Object.defineProperty(e,"toRfc3339WithNanoseconds",{enumerable:!0,get:function(){return s.toRfc3339WithNanoseconds}}),Object.defineProperty(e,"toSeconds",{enumerable:!0,get:function(){return s.toSeconds}}),e.comet38=r(jr);var i=jr;Object.defineProperty(e,"Comet38Client",{enumerable:!0,get:function(){return i.Comet38Client}});var c=Xn;Object.defineProperty(e,"HttpBatchClient",{enumerable:!0,get:function(){return c.HttpBatchClient}}),Object.defineProperty(e,"HttpClient",{enumerable:!0,get:function(){return c.HttpClient}}),Object.defineProperty(e,"WebsocketClient",{enumerable:!0,get:function(){return c.WebsocketClient}});var a=Dn;Object.defineProperty(e,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return a.broadcastTxCommitSuccess}}),Object.defineProperty(e,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return a.broadcastTxSyncSuccess}}),Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return a.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return a.SubscriptionEventType}}),Object.defineProperty(e,"VoteType",{enumerable:!0,get:function(){return a.VoteType}}),e.tendermint34=r(Dn);var u=Dn;Object.defineProperty(e,"Tendermint34Client",{enumerable:!0,get:function(){return u.Tendermint34Client}}),e.tendermint37=r(Rr);var d=Rr;Object.defineProperty(e,"Tendermint37Client",{enumerable:!0,get:function(){return d.Tendermint37Client}});var y=Xe;Object.defineProperty(e,"connectComet",{enumerable:!0,get:function(){return y.connectComet}}),Object.defineProperty(e,"isComet38Client",{enumerable:!0,get:function(){return y.isComet38Client}}),Object.defineProperty(e,"isTendermint34Client",{enumerable:!0,get:function(){return y.isTendermint34Client}}),Object.defineProperty(e,"isTendermint37Client",{enumerable:!0,get:function(){return y.isTendermint37Client}});var M=nr;Object.defineProperty(e,"BlockIdFlag",{enumerable:!0,get:function(){return M.BlockIdFlag}})})(Us);var ee={};Object.defineProperty(ee,"__esModule",{value:!0});ee.StargateClient=ee.BroadcastTxError=ee.assertIsDeliverTxFailure=ee.assertIsDeliverTxSuccess=ee.isDeliverTxSuccess=ee.isDeliverTxFailure=ee.TimeoutError=void 0;const Hy=st,os=D,xi=te,Ui=Us,qi=X,Vy=p.abci,Gy=Fn,Fy=Kn,kr=qn,Wy=ce,Jy=Zn;class Oc extends Error{constructor(t,n){super(t),this.txId=n}}ee.TimeoutError=Oc;function ni(e){return!!e.code}ee.isDeliverTxFailure=ni;function Bc(e){return!ni(e)}ee.isDeliverTxSuccess=Bc;function Ly(e){if(ni(e))throw new Error(`Error when broadcasting tx ${e.transactionHash} at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`)}ee.assertIsDeliverTxSuccess=Ly;function zy(e){if(Bc(e))throw new Error(`Transaction ${e.transactionHash} did not fail at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`)}ee.assertIsDeliverTxFailure=zy;class Rc extends Error{constructor(t,n,r){super(`Broadcasting transaction failed with code ${t} (codespace: ${n}). Log: ${r}`),this.code=t,this.codespace=n,this.log=r}}ee.BroadcastTxError=Rc;class $r{static async connect(t,n={}){const r=await(0,Ui.connectComet)(t);return $r.create(r,n)}static async create(t,n={}){return new $r(t,n)}constructor(t,n){t&&(this.cometClient=t,this.queryClient=Wy.QueryClient.withExtensions(t,kr.setupAuthExtension,kr.setupBankExtension,kr.setupStakingExtension,kr.setupTxExtension));const{accountParser:r=Gy.accountFromAny}=n;this.accountParser=r}getCometClient(){return this.cometClient}forceGetCometClient(){if(!this.cometClient)throw new Error("Comet client not available. You cannot use online functionality in offline mode.");return this.cometClient}getQueryClient(){return this.queryClient}forceGetQueryClient(){if(!this.queryClient)throw new Error("Query client not available. You cannot use online functionality in offline mode.");return this.queryClient}async getChainId(){if(!this.chainId){const n=(await this.forceGetCometClient().status()).nodeInfo.network;if(!n)throw new Error("Chain ID must not be empty");this.chainId=n}return this.chainId}async getHeight(){return(await this.forceGetCometClient().status()).syncInfo.latestBlockHeight}async getAccount(t){try{const n=await this.forceGetQueryClient().auth.account(t);return n?this.accountParser(n):null}catch(n){if(/rpc error: code = NotFound/i.test(n.toString()))return null;throw n}}async getSequence(t){const n=await this.getAccount(t);if(!n)throw new Error(`Account '${t}' does not exist on chain. Send some tokens there before trying to query sequence.`);return{accountNumber:n.accountNumber,sequence:n.sequence}}async getBlock(t){const n=await this.forceGetCometClient().block(t);return{id:(0,os.toHex)(n.blockId.hash).toUpperCase(),header:{version:{block:new xi.Uint53(n.block.header.version.block).toString(),app:new xi.Uint53(n.block.header.version.app).toString()},height:n.block.header.height,chainId:n.block.header.chainId,time:(0,Ui.toRfc3339WithNanoseconds)(n.block.header.time)},txs:n.block.txs}}async getBalance(t,n){return this.forceGetQueryClient().bank.balance(t,n)}async getAllBalances(t){return this.forceGetQueryClient().bank.allBalances(t)}async getBalanceStaked(t){const n=[];let r;do{const{delegationResponses:s,pagination:i}=await this.forceGetQueryClient().staking.delegatorDelegations(t,r),c=s||[];n.push(...c),r=i==null?void 0:i.nextKey}while(r!==void 0&&r.length!==0);return n.reduce((s,i)=>((0,qi.assert)(i.balance),s!==null?(0,Hy.addCoins)(s,i.balance):i.balance),null)}async getDelegation(t,n){var o;let r;try{r=(o=(await this.forceGetQueryClient().staking.delegation(t,n)).delegationResponse)==null?void 0:o.balance}catch(s){if(!s.toString().includes("key not found"))throw s}return r||null}async getTx(t){return(await this.txsQuery(`tx.hash='${t}'`))[0]??null}async searchTx(t){let n;if(typeof t=="string")n=t;else if((0,Jy.isSearchTxQueryArray)(t))n=t.map(r=>typeof r.value=="string"?`${r.key}='${r.value}'`:`${r.key}=${r.value}`).join(" AND ");else throw new Error("Got unsupported query type. See CosmJS 0.31 CHANGELOG for API breaking changes here.");return this.txsQuery(n)}disconnect(){this.cometClient&&this.cometClient.disconnect()}async broadcastTx(t,n=6e4,r=3e3){let o=!1;const s=setTimeout(()=>{o=!0},n),i=async a=>{if(o)throw new Oc(`Transaction with ID ${a} was submitted but was not yet found on the chain. You might want to check later. There was a wait of ${n/1e3} seconds.`,a);await(0,qi.sleep)(r);const u=await this.getTx(a);return u?{code:u.code,height:u.height,txIndex:u.txIndex,events:u.events,rawLog:u.rawLog,transactionHash:a,msgResponses:u.msgResponses,gasUsed:u.gasUsed,gasWanted:u.gasWanted}:i(a)},c=await this.broadcastTxSync(t);return new Promise((a,u)=>i(c).then(d=>{clearTimeout(s),a(d)},d=>{clearTimeout(s),u(d)}))}async broadcastTxSync(t){const n=await this.forceGetCometClient().broadcastTxSync({tx:t});return n.code?Promise.reject(new Rc(n.code,n.codespace??"",n.log)):(0,os.toHex)(n.hash).toUpperCase()}async txsQuery(t){return(await this.forceGetCometClient().txSearchAll({query:t})).txs.map(r=>{const o=Vy.TxMsgData.decode(r.result.data??new Uint8Array);return{height:r.height,txIndex:r.index,hash:(0,os.toHex)(r.hash).toUpperCase(),code:r.result.code,events:r.result.events.map(Fy.fromTendermintEvent),rawLog:r.result.log||"",tx:r.tx,msgResponses:o.msgResponses,gasUsed:r.result.gasUsed,gasWanted:r.result.gasWanted}})}}ee.StargateClient=$r;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SigningStargateClient=e.createDefaultAminoConverters=e.defaultRegistryTypes=void 0;const t=st,n=D,r=te,o=vt,s=Us,i=X,c=p.coin,a=p.tx$3,u=p.tx$12,d=p.signing,y=p.tx,M=p.tx$8,_=zn,G=Mt,b=qn,g=qn,w=ee;e.defaultRegistryTypes=[["/cosmos.base.v1beta1.Coin",c.Coin],...b.authzTypes,...b.bankTypes,...b.distributionTypes,...b.feegrantTypes,...b.govTypes,...b.groupTypes,...b.stakingTypes,...b.ibcTypes,...b.vestingTypes];function q(){return{...(0,g.createAuthzAminoConverters)(),...(0,g.createBankAminoConverters)(),...(0,g.createDistributionAminoConverters)(),...(0,g.createGovAminoConverters)(),...(0,g.createStakingAminoConverters)(),...(0,g.createIbcAminoConverters)(),...(0,g.createFeegrantAminoConverters)(),...(0,g.createVestingAminoConverters)()}}e.createDefaultAminoConverters=q;class x extends w.StargateClient{static async connectWithSigner(v,S,k={}){const U=await(0,s.connectComet)(v);return x.createWithSigner(U,S,k)}static async createWithSigner(v,S,k={}){return new x(v,S,k)}static async offline(v,S={}){return new x(void 0,v,S)}constructor(v,S,k){super(v,k),this.defaultGasMultiplier=1.4;const{registry:U=new o.Registry(e.defaultRegistryTypes),aminoTypes:H=new _.AminoTypes(q())}=k;this.registry=U,this.aminoTypes=H,this.signer=S,this.broadcastTimeoutMs=k.broadcastTimeoutMs,this.broadcastPollIntervalMs=k.broadcastPollIntervalMs,this.gasPrice=k.gasPrice}async simulate(v,S,k){const U=S.map(Z=>this.registry.encodeAsAny(Z)),H=(await this.signer.getAccounts()).find(Z=>Z.address===v);if(!H)throw new Error("Failed to retrieve account from signer");const V=(0,t.encodeSecp256k1Pubkey)(H.pubkey),{sequence:F}=await this.getSequence(v),{gasInfo:z}=await this.forceGetQueryClient().tx.simulate(U,k,V,F);return(0,i.assertDefined)(z),r.Uint53.fromString(z.gasUsed.toString()).toNumber()}async sendTokens(v,S,k,U,H=""){const V={typeUrl:"/cosmos.bank.v1beta1.MsgSend",value:{fromAddress:v,toAddress:S,amount:[...k]}};return this.signAndBroadcast(v,[V],U,H)}async delegateTokens(v,S,k,U,H=""){const V={typeUrl:"/cosmos.staking.v1beta1.MsgDelegate",value:u.MsgDelegate.fromPartial({delegatorAddress:v,validatorAddress:S,amount:k})};return this.signAndBroadcast(v,[V],U,H)}async undelegateTokens(v,S,k,U,H=""){const V={typeUrl:"/cosmos.staking.v1beta1.MsgUndelegate",value:u.MsgUndelegate.fromPartial({delegatorAddress:v,validatorAddress:S,amount:k})};return this.signAndBroadcast(v,[V],U,H)}async withdrawRewards(v,S,k,U=""){const H={typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",value:a.MsgWithdrawDelegatorReward.fromPartial({delegatorAddress:v,validatorAddress:S})};return this.signAndBroadcast(v,[H],k,U)}async sendIbcTokens(v,S,k,U,H,V,F,z,Z=""){const Se=F?BigInt(F)*BigInt(1e9):void 0,at={typeUrl:"/ibc.applications.transfer.v1.MsgTransfer",value:M.MsgTransfer.fromPartial({sourcePort:U,sourceChannel:H,sender:v,receiver:S,token:k,timeoutHeight:V,timeoutTimestamp:Se})};return this.signAndBroadcast(v,[at],z,Z)}async signAndBroadcast(v,S,k,U="",H){let V;if(k=="auto"||typeof k=="number"){(0,i.assertDefined)(this.gasPrice,"Gas price must be set in the client options when auto gas is used.");const Z=await this.simulate(v,S,U),Se=typeof k=="number"?k:this.defaultGasMultiplier;V=(0,G.calculateFee)(Math.round(Z*Se),this.gasPrice)}else V=k;const F=await this.sign(v,S,V,U,void 0,H),z=y.TxRaw.encode(F).finish();return this.broadcastTx(z,this.broadcastTimeoutMs,this.broadcastPollIntervalMs)}async signAndBroadcastSync(v,S,k,U="",H){let V;if(k=="auto"||typeof k=="number"){(0,i.assertDefined)(this.gasPrice,"Gas price must be set in the client options when auto gas is used.");const Z=await this.simulate(v,S,U),Se=typeof k=="number"?k:this.defaultGasMultiplier;V=(0,G.calculateFee)(Math.round(Z*Se),this.gasPrice)}else V=k;const F=await this.sign(v,S,V,U,void 0,H),z=y.TxRaw.encode(F).finish();return this.broadcastTxSync(z)}async sign(v,S,k,U,H,V){let F;if(H)F=H;else{const{accountNumber:z,sequence:Z}=await this.getSequence(v),Se=await this.getChainId();F={accountNumber:z,sequence:Z,chainId:Se}}return(0,o.isOfflineDirectSigner)(this.signer)?this.signDirect(v,S,k,U,F,V):this.signAmino(v,S,k,U,F,V)}async signAmino(v,S,k,U,{accountNumber:H,sequence:V,chainId:F},z){(0,i.assert)(!(0,o.isOfflineDirectSigner)(this.signer));const Z=(await this.signer.getAccounts()).find(wn=>wn.address===v);if(!Z)throw new Error("Failed to retrieve account from signer");const Se=(0,o.encodePubkey)((0,t.encodeSecp256k1Pubkey)(Z.pubkey)),at=d.SignMode.SIGN_MODE_LEGACY_AMINO_JSON,vn=S.map(wn=>this.aminoTypes.toAmino(wn)),Vo=(0,t.makeSignDoc)(vn,k,F,U,H,V,z),{signature:Go,signed:et}=await this.signer.signAmino(v,Vo),rr={typeUrl:"/cosmos.tx.v1beta1.TxBody",value:{messages:et.msgs.map(wn=>this.aminoTypes.fromAmino(wn)),memo:et.memo,timeoutHeight:z}},Fo=this.registry.encode(rr),Ic=r.Int53.fromString(et.fee.gas).toNumber(),$c=r.Int53.fromString(et.sequence).toNumber(),Nc=(0,o.makeAuthInfoBytes)([{pubkey:Se,sequence:$c}],et.fee.amount,Ic,et.fee.granter,et.fee.payer,at);return y.TxRaw.fromPartial({bodyBytes:Fo,authInfoBytes:Nc,signatures:[(0,n.fromBase64)(Go.signature)]})}async signDirect(v,S,k,U,{accountNumber:H,sequence:V,chainId:F},z){(0,i.assert)((0,o.isOfflineDirectSigner)(this.signer));const Z=(await this.signer.getAccounts()).find(Fo=>Fo.address===v);if(!Z)throw new Error("Failed to retrieve account from signer");const Se=(0,o.encodePubkey)((0,t.encodeSecp256k1Pubkey)(Z.pubkey)),at={typeUrl:"/cosmos.tx.v1beta1.TxBody",value:{messages:S,memo:U,timeoutHeight:z}},vn=this.registry.encode(at),Vo=r.Int53.fromString(k.gas).toNumber(),Go=(0,o.makeAuthInfoBytes)([{pubkey:Se,sequence:V}],k.amount,Vo,k.granter,k.payer),et=(0,o.makeSignDoc)(vn,Go,F,H),{signature:ri,signed:rr}=await this.signer.signDirect(v,et);return y.TxRaw.fromPartial({bodyBytes:rr.bodyBytes,authInfoBytes:rr.authInfoBytes,signatures:[(0,n.fromBase64)(ri.signature)]})}}e.SigningStargateClient=x})(Ra);(function(e){var t=l.commonjsGlobal&&l.commonjsGlobal.__createBinding||(Object.create?function(b,g,w,q){q===void 0&&(q=w);var x=Object.getOwnPropertyDescriptor(g,w);(!x||("get"in x?!g.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return g[w]}}),Object.defineProperty(b,q,x)}:function(b,g,w,q){q===void 0&&(q=w),b[q]=g[w]}),n=l.commonjsGlobal&&l.commonjsGlobal.__setModuleDefault||(Object.create?function(b,g){Object.defineProperty(b,"default",{enumerable:!0,value:g})}:function(b,g){b.default=g}),r=l.commonjsGlobal&&l.commonjsGlobal.__importStar||function(b){if(b&&b.__esModule)return b;var g={};if(b!=null)for(var w in b)w!=="default"&&Object.prototype.hasOwnProperty.call(b,w)&&t(g,b,w);return n(g,b),g};Object.defineProperty(e,"__esModule",{value:!0}),e.isMsgVoteWeightedEncodeObject=e.isMsgVoteEncodeObject=e.isMsgUndelegateEncodeObject=e.isMsgTransferEncodeObject=e.isMsgSubmitProposalEncodeObject=e.isMsgSendEncodeObject=e.isMsgEditValidatorEncodeObject=e.isMsgDepositEncodeObject=e.isMsgDelegateEncodeObject=e.isMsgCreateValidatorEncodeObject=e.isMsgCancelUnbondingDelegationEncodeObject=e.isMsgBeginRedelegateEncodeObject=e.isAminoMsgWithdrawValidatorCommission=e.isAminoMsgWithdrawDelegatorReward=e.isAminoMsgVoteWeighted=e.isAminoMsgVote=e.isAminoMsgVerifyInvariant=e.isAminoMsgUnjail=e.isAminoMsgUndelegate=e.isAminoMsgTransfer=e.isAminoMsgSubmitProposal=e.isAminoMsgSubmitEvidence=e.isAminoMsgSetWithdrawAddress=e.isAminoMsgSend=e.isAminoMsgMultiSend=e.isAminoMsgFundCommunityPool=e.isAminoMsgEditValidator=e.isAminoMsgDeposit=e.isAminoMsgDelegate=e.isAminoMsgCreateVestingAccount=e.isAminoMsgCreateValidator=e.isAminoMsgBeginRedelegate=e.createVestingAminoConverters=e.createStakingAminoConverters=e.createSlashingAminoConverters=e.createIbcAminoConverters=e.createGroupAminoConverters=e.createGovAminoConverters=e.createFeegrantAminoConverters=e.createEvidenceAminoConverters=e.createDistributionAminoConverters=e.createCrysisAminoConverters=e.createBankAminoConverters=e.createAuthzAminoConverters=e.logs=e.GasPrice=e.calculateFee=e.fromTendermintEvent=e.AminoTypes=e.accountFromAny=void 0,e.parseCoins=e.makeCosmoshubPath=e.coins=e.coin=e.TimeoutError=e.StargateClient=e.isDeliverTxSuccess=e.isDeliverTxFailure=e.BroadcastTxError=e.assertIsDeliverTxSuccess=e.assertIsDeliverTxFailure=e.SigningStargateClient=e.defaultRegistryTypes=e.createDefaultAminoConverters=e.isSearchTxQueryArray=e.QueryClient=e.decodeCosmosSdkDecFromProto=e.createProtobufRpcClient=e.createPagination=e.makeMultisignedTxBytes=e.makeMultisignedTx=e.setupTxExtension=e.setupStakingExtension=e.setupSlashingExtension=e.setupMintExtension=e.setupIbcExtension=e.setupGovExtension=e.setupFeegrantExtension=e.setupDistributionExtension=e.setupBankExtension=e.setupAuthzExtension=e.setupAuthExtension=e.isMsgWithdrawDelegatorRewardEncodeObject=void 0;var o=Fn;Object.defineProperty(e,"accountFromAny",{enumerable:!0,get:function(){return o.accountFromAny}});var s=zn;Object.defineProperty(e,"AminoTypes",{enumerable:!0,get:function(){return s.AminoTypes}});var i=Kn;Object.defineProperty(e,"fromTendermintEvent",{enumerable:!0,get:function(){return i.fromTendermintEvent}});var c=Mt;Object.defineProperty(e,"calculateFee",{enumerable:!0,get:function(){return c.calculateFee}}),Object.defineProperty(e,"GasPrice",{enumerable:!0,get:function(){return c.GasPrice}}),e.logs=r(ye);var a=qn;Object.defineProperty(e,"createAuthzAminoConverters",{enumerable:!0,get:function(){return a.createAuthzAminoConverters}}),Object.defineProperty(e,"createBankAminoConverters",{enumerable:!0,get:function(){return a.createBankAminoConverters}}),Object.defineProperty(e,"createCrysisAminoConverters",{enumerable:!0,get:function(){return a.createCrysisAminoConverters}}),Object.defineProperty(e,"createDistributionAminoConverters",{enumerable:!0,get:function(){return a.createDistributionAminoConverters}}),Object.defineProperty(e,"createEvidenceAminoConverters",{enumerable:!0,get:function(){return a.createEvidenceAminoConverters}}),Object.defineProperty(e,"createFeegrantAminoConverters",{enumerable:!0,get:function(){return a.createFeegrantAminoConverters}}),Object.defineProperty(e,"createGovAminoConverters",{enumerable:!0,get:function(){return a.createGovAminoConverters}}),Object.defineProperty(e,"createGroupAminoConverters",{enumerable:!0,get:function(){return a.createGroupAminoConverters}}),Object.defineProperty(e,"createIbcAminoConverters",{enumerable:!0,get:function(){return a.createIbcAminoConverters}}),Object.defineProperty(e,"createSlashingAminoConverters",{enumerable:!0,get:function(){return a.createSlashingAminoConverters}}),Object.defineProperty(e,"createStakingAminoConverters",{enumerable:!0,get:function(){return a.createStakingAminoConverters}}),Object.defineProperty(e,"createVestingAminoConverters",{enumerable:!0,get:function(){return a.createVestingAminoConverters}}),Object.defineProperty(e,"isAminoMsgBeginRedelegate",{enumerable:!0,get:function(){return a.isAminoMsgBeginRedelegate}}),Object.defineProperty(e,"isAminoMsgCreateValidator",{enumerable:!0,get:function(){return a.isAminoMsgCreateValidator}}),Object.defineProperty(e,"isAminoMsgCreateVestingAccount",{enumerable:!0,get:function(){return a.isAminoMsgCreateVestingAccount}}),Object.defineProperty(e,"isAminoMsgDelegate",{enumerable:!0,get:function(){return a.isAminoMsgDelegate}}),Object.defineProperty(e,"isAminoMsgDeposit",{enumerable:!0,get:function(){return a.isAminoMsgDeposit}}),Object.defineProperty(e,"isAminoMsgEditValidator",{enumerable:!0,get:function(){return a.isAminoMsgEditValidator}}),Object.defineProperty(e,"isAminoMsgFundCommunityPool",{enumerable:!0,get:function(){return a.isAminoMsgFundCommunityPool}}),Object.defineProperty(e,"isAminoMsgMultiSend",{enumerable:!0,get:function(){return a.isAminoMsgMultiSend}}),Object.defineProperty(e,"isAminoMsgSend",{enumerable:!0,get:function(){return a.isAminoMsgSend}}),Object.defineProperty(e,"isAminoMsgSetWithdrawAddress",{enumerable:!0,get:function(){return a.isAminoMsgSetWithdrawAddress}}),Object.defineProperty(e,"isAminoMsgSubmitEvidence",{enumerable:!0,get:function(){return a.isAminoMsgSubmitEvidence}}),Object.defineProperty(e,"isAminoMsgSubmitProposal",{enumerable:!0,get:function(){return a.isAminoMsgSubmitProposal}}),Object.defineProperty(e,"isAminoMsgTransfer",{enumerable:!0,get:function(){return a.isAminoMsgTransfer}}),Object.defineProperty(e,"isAminoMsgUndelegate",{enumerable:!0,get:function(){return a.isAminoMsgUndelegate}}),Object.defineProperty(e,"isAminoMsgUnjail",{enumerable:!0,get:function(){return a.isAminoMsgUnjail}}),Object.defineProperty(e,"isAminoMsgVerifyInvariant",{enumerable:!0,get:function(){return a.isAminoMsgVerifyInvariant}}),Object.defineProperty(e,"isAminoMsgVote",{enumerable:!0,get:function(){return a.isAminoMsgVote}}),Object.defineProperty(e,"isAminoMsgVoteWeighted",{enumerable:!0,get:function(){return a.isAminoMsgVoteWeighted}}),Object.defineProperty(e,"isAminoMsgWithdrawDelegatorReward",{enumerable:!0,get:function(){return a.isAminoMsgWithdrawDelegatorReward}}),Object.defineProperty(e,"isAminoMsgWithdrawValidatorCommission",{enumerable:!0,get:function(){return a.isAminoMsgWithdrawValidatorCommission}}),Object.defineProperty(e,"isMsgBeginRedelegateEncodeObject",{enumerable:!0,get:function(){return a.isMsgBeginRedelegateEncodeObject}}),Object.defineProperty(e,"isMsgCancelUnbondingDelegationEncodeObject",{enumerable:!0,get:function(){return a.isMsgCancelUnbondingDelegationEncodeObject}}),Object.defineProperty(e,"isMsgCreateValidatorEncodeObject",{enumerable:!0,get:function(){return a.isMsgCreateValidatorEncodeObject}}),Object.defineProperty(e,"isMsgDelegateEncodeObject",{enumerable:!0,get:function(){return a.isMsgDelegateEncodeObject}}),Object.defineProperty(e,"isMsgDepositEncodeObject",{enumerable:!0,get:function(){return a.isMsgDepositEncodeObject}}),Object.defineProperty(e,"isMsgEditValidatorEncodeObject",{enumerable:!0,get:function(){return a.isMsgEditValidatorEncodeObject}}),Object.defineProperty(e,"isMsgSendEncodeObject",{enumerable:!0,get:function(){return a.isMsgSendEncodeObject}}),Object.defineProperty(e,"isMsgSubmitProposalEncodeObject",{enumerable:!0,get:function(){return a.isMsgSubmitProposalEncodeObject}}),Object.defineProperty(e,"isMsgTransferEncodeObject",{enumerable:!0,get:function(){return a.isMsgTransferEncodeObject}}),Object.defineProperty(e,"isMsgUndelegateEncodeObject",{enumerable:!0,get:function(){return a.isMsgUndelegateEncodeObject}}),Object.defineProperty(e,"isMsgVoteEncodeObject",{enumerable:!0,get:function(){return a.isMsgVoteEncodeObject}}),Object.defineProperty(e,"isMsgVoteWeightedEncodeObject",{enumerable:!0,get:function(){return a.isMsgVoteWeightedEncodeObject}}),Object.defineProperty(e,"isMsgWithdrawDelegatorRewardEncodeObject",{enumerable:!0,get:function(){return a.isMsgWithdrawDelegatorRewardEncodeObject}}),Object.defineProperty(e,"setupAuthExtension",{enumerable:!0,get:function(){return a.setupAuthExtension}}),Object.defineProperty(e,"setupAuthzExtension",{enumerable:!0,get:function(){return a.setupAuthzExtension}}),Object.defineProperty(e,"setupBankExtension",{enumerable:!0,get:function(){return a.setupBankExtension}}),Object.defineProperty(e,"setupDistributionExtension",{enumerable:!0,get:function(){return a.setupDistributionExtension}}),Object.defineProperty(e,"setupFeegrantExtension",{enumerable:!0,get:function(){return a.setupFeegrantExtension}}),Object.defineProperty(e,"setupGovExtension",{enumerable:!0,get:function(){return a.setupGovExtension}}),Object.defineProperty(e,"setupIbcExtension",{enumerable:!0,get:function(){return a.setupIbcExtension}}),Object.defineProperty(e,"setupMintExtension",{enumerable:!0,get:function(){return a.setupMintExtension}}),Object.defineProperty(e,"setupSlashingExtension",{enumerable:!0,get:function(){return a.setupSlashingExtension}}),Object.defineProperty(e,"setupStakingExtension",{enumerable:!0,get:function(){return a.setupStakingExtension}}),Object.defineProperty(e,"setupTxExtension",{enumerable:!0,get:function(){return a.setupTxExtension}});var u=pt;Object.defineProperty(e,"makeMultisignedTx",{enumerable:!0,get:function(){return u.makeMultisignedTx}}),Object.defineProperty(e,"makeMultisignedTxBytes",{enumerable:!0,get:function(){return u.makeMultisignedTxBytes}});var d=ce;Object.defineProperty(e,"createPagination",{enumerable:!0,get:function(){return d.createPagination}}),Object.defineProperty(e,"createProtobufRpcClient",{enumerable:!0,get:function(){return d.createProtobufRpcClient}}),Object.defineProperty(e,"decodeCosmosSdkDecFromProto",{enumerable:!0,get:function(){return d.decodeCosmosSdkDecFromProto}}),Object.defineProperty(e,"QueryClient",{enumerable:!0,get:function(){return d.QueryClient}});var y=Zn;Object.defineProperty(e,"isSearchTxQueryArray",{enumerable:!0,get:function(){return y.isSearchTxQueryArray}});var M=Ra;Object.defineProperty(e,"createDefaultAminoConverters",{enumerable:!0,get:function(){return M.createDefaultAminoConverters}}),Object.defineProperty(e,"defaultRegistryTypes",{enumerable:!0,get:function(){return M.defaultRegistryTypes}}),Object.defineProperty(e,"SigningStargateClient",{enumerable:!0,get:function(){return M.SigningStargateClient}});var _=ee;Object.defineProperty(e,"assertIsDeliverTxFailure",{enumerable:!0,get:function(){return _.assertIsDeliverTxFailure}}),Object.defineProperty(e,"assertIsDeliverTxSuccess",{enumerable:!0,get:function(){return _.assertIsDeliverTxSuccess}}),Object.defineProperty(e,"BroadcastTxError",{enumerable:!0,get:function(){return _.BroadcastTxError}}),Object.defineProperty(e,"isDeliverTxFailure",{enumerable:!0,get:function(){return _.isDeliverTxFailure}}),Object.defineProperty(e,"isDeliverTxSuccess",{enumerable:!0,get:function(){return _.isDeliverTxSuccess}}),Object.defineProperty(e,"StargateClient",{enumerable:!0,get:function(){return _.StargateClient}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return _.TimeoutError}});var G=vt;Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return G.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return G.coins}}),Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return G.makeCosmoshubPath}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return G.parseCoins}})})(Hi);const Ky=e=>e*1e6;class Ho{constructor(t,n,r,o){ct(this,"network");ct(this,"chain");ct(this,"rpc");ct(this,"contracts");ct(this,"gatewayAddress");ct(this,"channelToChain",new Map);ct(this,"chainToChannel",new Map);if(this.network=t,this.chain=n,this.rpc=r,this.contracts=o,!l.networkChainToChannels.has(t,n))throw new Error("Unsupported IBC Chain, no channels available: "+n);this.gatewayAddress=p.Gateway.gatewayAddress(t);const s=l.networkChainToChannels.get(t,n)??{};for(const[i,c]of Object.entries(s))this.channelToChain.set(c,i),this.chainToChannel.set(i,c)}static async fromRpc(t,n){const[r,o]=await p.CosmwasmPlatform.chainFromRpc(t),s=n[o];if(s.network!==r)throw new Error("Network mismatch: "+s.network+" != "+r);return new Ho(r,o,t,s.contracts)}getTransferChannel(t){return this.chainToChannel.get(t)??null}async*transfer(t,n,r,o){const s=new l.CosmwasmAddress(t).toString(),i=Math.round(Math.random()*1e4),a={gateway_ibc_token_bridge_payload:{gateway_transfer:{recipient:l.b64.encode(l.chainToPlatform(n.chain)==="Cosmwasm"?n.address.toString():n.address.toUniversalAddress().toUint8Array()),chain:l.toChainId(n.chain),nonce:i,fee:"0"}}},u=BigInt(Ky(Date.now()+l.IBC_TIMEOUT_MILLIS)),d=JSON.stringify(a),y=l.isNative(r)?p.CosmwasmPlatform.getNativeDenom(this.network,this.chain):p.Gateway.deriveIbcDenom(this.network,this.chain,new l.CosmwasmAddress(r).toString()),M=Hi.coin(o.toString(),y.toString()),_={typeUrl:l.IBC_MSG_TYPE,value:p.tx$8.MsgTransfer.fromPartial({sourcePort:l.IBC_TRANSFER_PORT,sourceChannel:this.chainToChannel.get(p.Gateway.chain),sender:s,receiver:this.gatewayAddress,token:M,timeoutTimestamp:u,memo:d})};yield this.createUnsignedTx({msgs:[_],fee:oi.computeFee(this.network,this.chain),memo:"Wormhole.TransferToGateway"},"IBC.transfer")}async lookupTransferFromTx(t){const n=await this.rpc.getTx(t);if(!n)throw new Error(`No IBC transfer found on ${this.chain} with txid: ${t}`);if(n.code!==0)throw new Error(`Transaction failed: ${n.rawLog}`);const r=await this.fetchTransferInfo(n);if(r.length===0)throw new Error(`No IBC transfers found on ${this.chain} with txid: ${t}`);return r}async lookupMessageFromIbcMsgId(t){const n=await this.lookupTxFromIbcMsgId(t);return n?Uc.CosmwasmWormholeCore.parseWormholeMessageId(p.Gateway.chain,p.Gateway.coreAddress(this.network),n):null}async lookupTxFromIbcMsgId(t){const n=this.chain===t.chain?l.IBC_PACKET_SEND:l.IBC_PACKET_RECEIVE,{srcChannel:r,dstChannel:o,sequence:s,srcPort:i,dstPort:c}=t,a=await this.rpc.searchTx([{key:`${n}.${l.IBC_PACKET_DST}`,value:o},{key:`${n}.${l.IBC_PACKET_SRC}`,value:r},{key:`${n}.${l.IBC_PACKET_SRC_PORT}`,value:i},{key:`${n}.${l.IBC_PACKET_DST_PORT}`,value:c},{key:`${n}.${l.IBC_PACKET_SEQ}`,value:s.toString()}]);if(a.length===0)return null;a.length>1&&console.error(`Expected 1 transaction, got ${a.length} found for IbcMsgid: ${t}`);const[u]=a;return u}async lookupTransferFromIbcMsgId(t){const n=await this.lookupTxFromIbcMsgId(t);if(!n)throw new Error(`No transfers found on ${this.chain} for msg: ${JSON.stringify(t)}`);const r=await this.fetchTransferInfo(n);if(r.length===0)throw new Error(`No transfers found on ${this.chain} for msg: ${JSON.stringify(t)}`);return r}async lookupTransferFromMsg(t){const n=l.b64.encode(JSON.stringify(t)),r=await this.rpc.searchTx([{key:"wasm.transfer_payload",value:n}]);if(r.length===0)throw new Error("Found no transactions for payload: "+JSON.stringify(n));r.length!==1&&console.error("Expected 1 tx, got: ",r.length);const[o]=r,s=await this.fetchTransferInfo(o);if(s.length===0)throw new Error("Found no transactions for payload: "+JSON.stringify(n));return s}async fetchTransferInfo(t){const n=this.parseIbcTransferInfo(t),r=[];for(const o of n){const s=p.CosmwasmPlatform.getQueryClient(this.rpc);try{await s.ibc.channel.packetCommitment(l.IBC_TRANSFER_PORT,o.id.srcChannel,o.id.sequence),o.pending=!0}catch(i){if(!i.message.includes("packet commitment hash not found: key not found"))throw i}r.push(o)}return r}parseIbcTransferInfo(t){const n=t.events.filter(o=>o.type===l.IBC_PACKET_SEND||o.type===l.IBC_PACKET_RECEIVE);if(n.length===0)throw new Error(`No IBC Transfers on ${this.chain} found in: ${t.hash}`);const r=new Set;for(const o of n){const s={pending:!1},i={};for(const c of o.attributes)c.key===l.IBC_PACKET_SRC&&(i.srcChannel=c.value),c.key===l.IBC_PACKET_DST&&(i.dstChannel=c.value),c.key===l.IBC_PACKET_SEQ&&(i.sequence=Number(c.value)),c.key===l.IBC_PACKET_SRC_PORT&&(i.srcPort=c.value),c.key===l.IBC_PACKET_DST_PORT&&(i.dstPort=c.value),c.key===l.IBC_PACKET_DATA&&(s.data=JSON.parse(c.value));if(i.chain=o.type===l.IBC_PACKET_SEND?this.chain:this.channelToChain.get(i.dstChannel),l.isIbcMessageId(i))s.id=i;else throw new Error("Invalid IbcMessageId: "+JSON.stringify(i));if(qc(s))r.add(s);else throw new Error("Invalid IbcTransferInfo: "+JSON.stringify(s))}return Array.from(r)}async fetchTransferChannel(t){if(this.chain!==p.Gateway.chain)throw new Error("Cannot query the transfer channels from a non-gateway chain");const{channel:n}=await this.rpc.queryContractSmart(this.gatewayAddress,{ibc_channel:{chain_id:l.toChainId(t)}});return n}createUnsignedTx(t,n,r=!1){return new oi.CosmwasmUnsignedTransaction(t,this.network,this.chain,n,r)}}l.registerProtocol(l._platform$3,"IbcBridge",Ho);exports.CosmwasmIbcBridge=Ho;
|