@wormhole-foundation/wormhole-connect 1.1.3-beta.2-development → 1.1.3-beta.3-development

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/assets/{ccip-CuVLQT8d.js → ccip-DIYM0gy6.js} +1 -1
  2. package/dist/assets/{evm-Dc3QdSOA.js → evm-Y-JIomWz.js} +4 -4
  3. package/dist/assets/{index-EVjhBEXw.js → index--B3_-qch.js} +2 -2
  4. package/dist/assets/{index-BJGeA_ds.js → index-C1YrzzPV.js} +1 -1
  5. package/dist/assets/{index-BIssGeVa.js → index-sR4FP7OJ.js} +1 -1
  6. package/dist/assets/{index.es-BObgTr8H.js → index.es-CRUh0v3x.js} +2 -2
  7. package/dist/main.js +4 -4
  8. package/lib/{algorand-CLoiUadv.mjs → algorand-D_QRI-bg.mjs} +3 -3
  9. package/lib/{algorand-BAFj4ZGa.js → algorand-wRfrbOd6.js} +1 -1
  10. package/lib/{aptos-C45UOjMk.mjs → aptos-39dGPUrb.mjs} +3 -3
  11. package/lib/{aptos-CHkHb9Wn.js → aptos-BYA8pulJ.js} +1 -1
  12. package/lib/{aptos-B0EUzhLn.mjs → aptos-D8si2udZ.mjs} +1 -1
  13. package/lib/{aptos-DLBpR9Uw.js → aptos-j2PEnEen.js} +2 -2
  14. package/lib/{ccip-D6nl66Of.mjs → ccip-CAsSiarY.mjs} +1 -1
  15. package/lib/{ccip-DwcFzOh0.js → ccip-D2DyQ2dl.js} +1 -1
  16. package/lib/{cosmos-BEyKk7pN.js → cosmos--SblITfP.js} +11 -11
  17. package/lib/{cosmos-Bc34YeqV.mjs → cosmos-5QBTeSdf.mjs} +5 -5
  18. package/lib/{cosmwasm-BBIEjp_6.mjs → cosmwasm-BvDytCXd.mjs} +3545 -3545
  19. package/lib/{cosmwasm-DPmjLuio.js → cosmwasm-qpOclFcW.js} +3 -3
  20. package/lib/{events-D9h1HjEa.mjs → events-Cq1VEeNf.mjs} +1 -1
  21. package/lib/{events-B2ZyXE4l.js → events-DSOd4gvB.js} +1 -1
  22. package/lib/{evm--fmrvZiP.js → evm-C-UXATlx.js} +4 -4
  23. package/lib/{evm-sG77B7Ln.mjs → evm-CEwMJ8_A.mjs} +6 -6
  24. package/lib/{evm-D6zAQuRU.js → evm-DG7I4Frq.js} +1 -1
  25. package/lib/{evm-DsRkB-Yc.mjs → evm-DMvzqxcS.mjs} +7 -7
  26. package/lib/{index-DinZIMWa.mjs → index-74c6g32z.mjs} +225 -225
  27. package/lib/{index-DWJ5r15M.mjs → index-7zA9RXv7.mjs} +19853 -19856
  28. package/lib/{index-Cpjj11xV.mjs → index-B8T2NaoX.mjs} +45 -45
  29. package/lib/{index-DPtc-UxP.mjs → index-B8ULFzIF.mjs} +6 -6
  30. package/lib/{index-B7Optu6I.js → index-B9Hz7aqe.js} +1 -1
  31. package/lib/{index-jydTi-hN.mjs → index-BHWO1nl8.mjs} +2 -2
  32. package/lib/{index-ByOoS9NO.js → index-BLp_eTrc.js} +1 -1
  33. package/lib/{index-CvdPwRnL.js → index-BQtbCwXd.js} +1 -1
  34. package/lib/{index-CEovIwuS.js → index-BU_DiszY.js} +92 -92
  35. package/lib/{index-XMIcJZyr.js → index-BbxY_HAX.js} +16 -16
  36. package/lib/{index-CY9fp7fB.mjs → index-Beu3v0JF.mjs} +15 -15
  37. package/lib/{index-D4u8CUKC.mjs → index-BhXfWaSE.mjs} +3 -3
  38. package/lib/{index-B9gBvn5a.mjs → index-BjeY05EL.mjs} +801 -802
  39. package/lib/{index-BT10pzLw.mjs → index-BoUKkFOJ.mjs} +1 -1
  40. package/lib/{index-CVaT6qZW.js → index-C6PC2n3L.js} +1 -1
  41. package/lib/{index-BYnoX4S7.mjs → index-CAqvcaXu.mjs} +15 -15
  42. package/lib/{index-DGq7mQyb.mjs → index-CDHEzcRs.mjs} +10 -10
  43. package/lib/{index-U1A3Ir4_.js → index-CFV9DDDi.js} +1 -1
  44. package/lib/{index-CQY-qyc8.mjs → index-CHNFj7US.mjs} +2 -2
  45. package/lib/{index-DrDopLyp.mjs → index-CIbRMQ53.mjs} +2 -2
  46. package/lib/{index-BFWViYNu.mjs → index-COFRyIUZ.mjs} +7 -7
  47. package/lib/{index-BJ9DGQK7.js → index-CREWpYSc.js} +1 -1
  48. package/lib/{index-CL7evJIB.js → index-CV_U2daN.js} +1 -1
  49. package/lib/{index-CNe0Pean.js → index-CxgmuQ6m.js} +1 -1
  50. package/lib/{index-DugvE6YD.mjs → index-D-p3qNTZ.mjs} +30 -30
  51. package/lib/{index-Cb5M1Ban.mjs → index-D9X9k3PB.mjs} +1 -1
  52. package/lib/{index-IC9ubiMJ.mjs → index-DJghGbqc.mjs} +3 -3
  53. package/lib/{index-Bx7B-3Uk.js → index-DP78DD_7.js} +1 -1
  54. package/lib/{index-OldEBluq.js → index-D_iRGURG.js} +1 -1
  55. package/lib/{index-PcZU5a1K.js → index-DcOE-jqI.js} +1 -1
  56. package/lib/{index-BO1rJrRP.mjs → index-DefP3AL4.mjs} +9 -9
  57. package/lib/{index-C96ibHXm.js → index-DgKzux63.js} +1 -1
  58. package/lib/{index-D_3BlFSH.js → index-DhjRrhjF.js} +1 -1
  59. package/lib/{index-CyPbCf5y.js → index-DhvcbRay.js} +1 -1
  60. package/lib/{index-C010ECjb.js → index-DjAPVIrd.js} +1 -1
  61. package/lib/{index-CaQpF1dj.js → index-Dpwwqt_Y.js} +1 -1
  62. package/lib/{index-Bl8-vKcf.js → index-DqRdsXVl.js} +1 -1
  63. package/lib/{index-jgZQQCfy.mjs → index-DuVadmtW.mjs} +18 -18
  64. package/lib/{index--8OR2IWG.mjs → index-SSdHQ2f1.mjs} +2 -2
  65. package/lib/{index-B_vsKDJm.js → index-X48SyxVx.js} +1 -1
  66. package/lib/{index-DdhKN5Tn.mjs → index-evqr6zVJ.mjs} +2 -2
  67. package/lib/{index-BxxpLnjr.mjs → index-hY0mf_OS.mjs} +26 -26
  68. package/lib/{index-mE3wnazE.js → index-oE-cAvjh.js} +1 -1
  69. package/lib/{index-Ci0O-yiU.js → index-oRg2LZn2.js} +1 -1
  70. package/lib/{index-D0RnzOoN.js → index-pIxA5tC9.js} +1 -1
  71. package/lib/{index-CnElB0dt.mjs → index-vZrnrwrk.mjs} +2 -2
  72. package/lib/{index.es-DbGYkQrs.js → index.es-CwS3KgtR.js} +2 -2
  73. package/lib/{index.es-DV6jIgX3.mjs → index.es-De3BB9Gs.mjs} +5 -5
  74. package/lib/index.js +1 -1
  75. package/lib/index.mjs +1 -1
  76. package/lib/{keccak-BvCC2Kx2.js → keccak-B1lZAzij.js} +1 -1
  77. package/lib/{keccak-C0uJwxei.mjs → keccak-BIkgLtG3.mjs} +1 -1
  78. package/lib/{libsodium-wrappers-BS68glUg.mjs → libsodium-wrappers-BVHsOzCM.mjs} +1 -1
  79. package/lib/{libsodium-wrappers-yq_uVk2-.js → libsodium-wrappers-G-nqImEg.js} +1 -1
  80. package/lib/{pako.esm-DZDXjYQj.js → pako.esm-Bp8XA5UR.js} +1 -1
  81. package/lib/{pako.esm-CWQc3qGc.mjs → pako.esm-CuMQ9lDX.mjs} +2 -2
  82. package/lib/{pbkdf2-DbRuCUvp.js → pbkdf2-DvmY7GlQ.js} +1 -1
  83. package/lib/{pbkdf2-B3V9L7S5.mjs → pbkdf2-QaxjQpDb.mjs} +1 -1
  84. package/lib/{sei-D3Eq9BDV.js → sei-B9drTJKa.js} +1 -1
  85. package/lib/{sei-Bty4vIw4.mjs → sei-DgoF7Bn_.mjs} +3 -3
  86. package/lib/{signer-Dw6nmaHE.js → signer-BEIw02y1.js} +1 -1
  87. package/lib/{signer-zHoIaQqc.mjs → signer-DNX7OGg4.mjs} +1 -1
  88. package/lib/solana-BRb7NfyR.js +1 -0
  89. package/lib/{solana-C-e817Or.mjs → solana-CoAz_ENY.mjs} +4 -4
  90. package/lib/solana-D2xBFYbL.mjs +16 -0
  91. package/lib/{solana-9m57XHRZ.js → solana-iqc7Fvik.js} +1 -1
  92. package/lib/{solanaEmbed.esm-ByzcN6RA.mjs → solanaEmbed.esm-D-2IZyVE.mjs} +3 -3
  93. package/lib/{solanaEmbed.esm-DBOgwSJE.js → solanaEmbed.esm-DjEXAVdT.js} +1 -1
  94. package/lib/{sui-B3dbw4a7.js → sui-CLKF35u2.js} +2 -2
  95. package/lib/{sui-CKgX0Mjn.mjs → sui-C_RZoPbB.mjs} +4 -4
  96. package/lib/{sui-rey0HjGu.mjs → sui-CrvrUATE.mjs} +1 -1
  97. package/lib/{sui-lQcSerf0.js → sui-qNwHoAbu.js} +1 -1
  98. package/lib/{unsignedTransaction-DcJyFS5R.js → unsignedTransaction-CJyRAIyq.js} +1 -1
  99. package/lib/{unsignedTransaction-sTI31PuJ.mjs → unsignedTransaction-XgGjCBSt.mjs} +2 -2
  100. package/package.json +1 -1
  101. package/lib/solana-CV7qftfl.mjs +0 -16
  102. package/lib/solana-GdBZhG_3.js +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";var Yh=Object.defineProperty;var Zh=(e,n,t)=>n in e?Yh(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Se=(e,n,t)=>Zh(e,typeof n!="symbol"?n+"":n,t);const L=require("./index-CEovIwuS.js"),Re=require("./pako.esm-DZDXjYQj.js"),_=require("./index-XMIcJZyr.js"),Pr=require("./index-KWDNKPJe.js"),{Axios:Xh,AxiosError:jh,CanceledError:eg,isCancel:ng,CancelToken:tg,VERSION:rg,all:ig,Cancel:og,isAxiosError:ag,spread:sg,toFormData:dg,AxiosHeaders:ug,HttpStatusCode:cg,formToJSON:lg,getAdapter:fg,mergeConfig:pg}=L.axios,mg=Object.freeze(Object.defineProperty({__proto__:null,Axios:Xh,AxiosError:jh,AxiosHeaders:ug,Cancel:og,CancelToken:tg,CanceledError:eg,HttpStatusCode:cg,VERSION:rg,all:ig,default:L.axios,formToJSON:lg,getAdapter:fg,isAxiosError:ag,isCancel:ng,mergeConfig:pg,spread:sg,toFormData:dg},Symbol.toStringTag,{value:"Module"}));var bt={},yo={},Ne={},Ja={},hg=L.commonjsGlobal&&L.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ja,"__esModule",{value:!0});Ja.Decimal=void 0;const qn=hg(L.bnExports),Sl=100;class Oe{static fromUserInput(n,t){Oe.verifyFractionalDigits(t);const i=n.match(/[^0-9.]/);if(i)throw new Error(`Invalid character at position ${i.index+1}`);let o,g;if(n==="")o="0",g="";else if(n.search(/\./)===-1)o=n,g="";else{const w=n.split(".");switch(w.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!w[1])throw new Error("Fractional part missing");o=w[0],g=w[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(g.length>t)throw new Error("Got more fractional digits than supported");const C=`${o}${g.padEnd(t,"0")}`;return new Oe(C,t)}static fromAtomics(n,t){return Oe.verifyFractionalDigits(t),new Oe(n,t)}static zero(n){return Oe.verifyFractionalDigits(n),new Oe("0",n)}static one(n){return Oe.verifyFractionalDigits(n),new Oe("1"+"0".repeat(n),n)}static verifyFractionalDigits(n){if(!Number.isInteger(n))throw new Error("Fractional digits is not an integer");if(n<0)throw new Error("Fractional digits must not be negative");if(n>Sl)throw new Error(`Fractional digits must not exceed ${Sl}`)}static compare(n,t){if(n.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");return n.data.atomics.cmp(new qn.default(t.atomics))}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}constructor(n,t){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format. Only non-negative integers in decimal representation supported.");this.data={atomics:new qn.default(n),fractionalDigits:t}}clone(){return new Oe(this.atomics,this.fractionalDigits)}floor(){const n=new qn.default(10).pow(new qn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n);return this.data.atomics.mod(n).isZero()?this.clone():Oe.fromAtomics(t.mul(n).toString(),this.fractionalDigits)}ceil(){const n=new qn.default(10).pow(new qn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n);return this.data.atomics.mod(n).isZero()?this.clone():Oe.fromAtomics(t.addn(1).mul(n).toString(),this.fractionalDigits)}toString(){const n=new qn.default(10).pow(new qn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n),i=this.data.atomics.mod(n);if(i.isZero())return t.toString();{const g=i.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${t.toString()}.${g}`}}toFloatApproximation(){const n=Number(this.toString());if(Number.isNaN(n))throw new Error("Conversion to number failed");return n}plus(n){if(this.fractionalDigits!==n.fractionalDigits)throw new Error("Fractional digits do not match");const t=this.data.atomics.add(new qn.default(n.atomics));return new Oe(t.toString(),this.fractionalDigits)}minus(n){if(this.fractionalDigits!==n.fractionalDigits)throw new Error("Fractional digits do not match");const t=this.data.atomics.sub(new qn.default(n.atomics));if(t.ltn(0))throw new Error("Difference must not be negative");return new Oe(t.toString(),this.fractionalDigits)}multiply(n){const t=this.data.atomics.mul(new qn.default(n.toString()));return new Oe(t.toString(),this.fractionalDigits)}equals(n){return Oe.compare(this,n)===0}isLessThan(n){return Oe.compare(this,n)<0}isLessThanOrEqual(n){return Oe.compare(this,n)<=0}isGreaterThan(n){return Oe.compare(this,n)>0}isGreaterThanOrEqual(n){return Oe.compare(this,n)>=0}}Ja.Decimal=Oe;var et={},gg=L.commonjsGlobal&&L.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(et,"__esModule",{value:!0});et.Uint64=et.Uint53=et.Int53=et.Uint32=void 0;const ca=gg(L.bnExports),yg=new ca.default("18446744073709551615",10,"be");class ji{static fromBigEndianBytes(n){return ji.fromBytes(n)}static fromBytes(n,t="be"){if(n.length!==4)throw new Error("Invalid input length. Expected 4 bytes.");for(let o=0;o<n.length;++o)if(!Number.isInteger(n[o])||n[o]>255||n[o]<0)throw new Error("Invalid value in byte. Found: "+n[o]);const i=t==="be"?n:Array.from(n).reverse();return new ji(i[0]*2**24+i[1]*2**16+i[2]*2**8+i[3])}static fromString(n){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format");return new ji(Number.parseInt(n,10))}constructor(n){if(Number.isNaN(n))throw new Error("Input is not a number");if(!Number.isInteger(n))throw new Error("Input is not an integer");if(n<0||n>4294967295)throw new Error("Input not in uint32 range: "+n.toString());this.data=n}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()}}et.Uint32=ji;class so{static fromString(n){if(!n.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new so(Number.parseInt(n,10))}constructor(n){if(Number.isNaN(n))throw new Error("Input is not a number");if(!Number.isInteger(n))throw new Error("Input is not an integer");if(n<Number.MIN_SAFE_INTEGER||n>Number.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+n.toString());this.data=n}toNumber(){return this.data}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}et.Int53=so;class Yu{static fromString(n){const t=so.fromString(n);return new Yu(t.toNumber())}constructor(n){const t=new so(n);if(t.toNumber()<0)throw new Error("Input is negative");this.data=t}toNumber(){return this.data.toNumber()}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}et.Uint53=Yu;class Mr{static fromBytesBigEndian(n){return Mr.fromBytes(n)}static fromBytes(n,t="be"){if(n.length!==8)throw new Error("Invalid input length. Expected 8 bytes.");for(let o=0;o<n.length;++o)if(!Number.isInteger(n[o])||n[o]>255||n[o]<0)throw new Error("Invalid value in byte. Found: "+n[o]);const i=t==="be"?Array.from(n):Array.from(n).reverse();return new Mr(new ca.default(i))}static fromString(n){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format");return new Mr(new ca.default(n,10,"be"))}static fromNumber(n){if(Number.isNaN(n))throw new Error("Input is not a number");if(!Number.isInteger(n))throw new Error("Input is not an integer");let t;try{t=new ca.default(n)}catch{throw new Error("Input is not a safe integer")}return new Mr(t)}constructor(n){if(n.isNeg())throw new Error("Input is negative");if(n.gt(yg))throw new Error("Input exceeds uint64 range");this.data=n}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()}}et.Uint64=Mr;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Uint64=e.Uint53=e.Uint32=e.Int53=e.Decimal=void 0;var n=Ja;Object.defineProperty(e,"Decimal",{enumerable:!0,get:function(){return n.Decimal}});var t=et;Object.defineProperty(e,"Int53",{enumerable:!0,get:function(){return t.Int53}}),Object.defineProperty(e,"Uint32",{enumerable:!0,get:function(){return t.Uint32}}),Object.defineProperty(e,"Uint53",{enumerable:!0,get:function(){return t.Uint53}}),Object.defineProperty(e,"Uint64",{enumerable:!0,get:function(){return t.Uint64}})})(Ne);var ut={},Ha={};Object.defineProperty(Ha,"__esModule",{value:!0});Ha.decodeTxRaw=void 0;const Rd=_.tx;function Sg(e){const n=Rd.TxRaw.decode(e);return{authInfo:Rd.AuthInfo.decode(n.authInfoBytes),body:Rd.TxBody.decode(n.bodyBytes),signatures:n.signatures}}Ha.decodeTxRaw=Sg;var jr={},zn={},hn={},$e={},nt={},ue={},ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.fromAscii=ei.toAscii=void 0;function kg(e){const n=t=>t.split("").map(i=>{const o=i.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(n(e))}ei.toAscii=kg;function Pg(e){return(t=>t.map(i=>{if(i<32||i>126)throw new Error("Cannot decode character that is out of printable ASCII range: "+i);return String.fromCharCode(i)}))(Array.from(e)).join("")}ei.fromAscii=Pg;var ni={},vg=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,o)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),Cg=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Rg=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&vg(n,e,t);return Cg(n,e),n};Object.defineProperty(ni,"__esModule",{value:!0});ni.fromBase64=ni.toBase64=void 0;const Ap=Rg(L.base64Js);function Bg(e){return Ap.fromByteArray(e)}ni.toBase64=Bg;function bg(e){if(!e.match(/^[a-zA-Z0-9+/]*={0,2}$/))throw new Error("Invalid base64 string format");return Ap.toByteArray(e)}ni.fromBase64=bg;var Et={},Eg=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,o)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),Ig=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Og=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&Eg(n,e,t);return Ig(n,e),n};Object.defineProperty(Et,"__esModule",{value:!0});Et.normalizeBech32=Et.fromBech32=Et.toBech32=void 0;const ga=Og(Re.bech32);function Tp(e,n,t){return ga.encode(e,ga.toWords(n),t)}Et.toBech32=Tp;function Np(e,n=1/0){const t=ga.decode(e,n);return{prefix:t.prefix,data:new Uint8Array(ga.fromWords(t.words))}}Et.fromBech32=Np;function Ag(e){const{prefix:n,data:t}=Np(e);return Tp(n,t)}Et.normalizeBech32=Ag;var ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.fromHex=ti.toHex=void 0;function Tg(e){let n="";for(const t of e)n+=("0"+t.toString(16)).slice(-2);return n}ti.toHex=Tg;function Ng(e){if(e.length%2!==0)throw new Error("hex string length must be a multiple of 2");const n=new Uint8Array(e.length/2);for(let t=0;t<n.length;t++){const i=2*t,o=e.slice(i,i+2);if(!o.match(/[0-9a-f]{2}/i))throw new Error("hex string contains invalid characters");n[t]=parseInt(o,16)}return n}ti.fromHex=Ng;var ri={};Object.defineProperty(ri,"__esModule",{value:!0});ri.toRfc3339=ri.fromRfc3339=void 0;const wg=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/;function vr(e,n=2){return e.toString().padStart(n,"0")}function _g(e){const n=wg.exec(e);if(!n)throw new Error("Date string is not in RFC3339 format");const t=+n[1],i=+n[2],o=+n[3],g=+n[4],C=+n[5],w=+n[6],E=n[7]?Math.floor(+n[7]*1e3):0;let D,J,b;n[8]==="Z"?(D=1,J=0,b=0):(D=n[8].substring(0,1)==="-"?-1:1,J=+n[8].substring(1,3),b=+n[8].substring(4,6));const p=D*(J*60+b)*60,S=new Date;return S.setUTCFullYear(t,i-1,o),S.setUTCHours(g,C,w,E),new Date(S.getTime()-p*1e3)}ri.fromRfc3339=_g;function Mg(e){const n=e.getUTCFullYear(),t=vr(e.getUTCMonth()+1),i=vr(e.getUTCDate()),o=vr(e.getUTCHours()),g=vr(e.getUTCMinutes()),C=vr(e.getUTCSeconds()),w=vr(e.getUTCMilliseconds(),3);return`${n}-${t}-${i}T${o}:${g}:${C}.${w}Z`}ri.toRfc3339=Mg;var ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.fromUtf8=ii.toUtf8=void 0;function Ug(e){return new TextEncoder().encode(e)}ii.toUtf8=Ug;function Dg(e,n=!1){const t=!n;return new TextDecoder("utf-8",{fatal:t}).decode(e)}ii.fromUtf8=Dg;(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 n=ei;Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return n.fromAscii}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return n.toAscii}});var t=ni;Object.defineProperty(e,"fromBase64",{enumerable:!0,get:function(){return t.fromBase64}}),Object.defineProperty(e,"toBase64",{enumerable:!0,get:function(){return t.toBase64}});var i=Et;Object.defineProperty(e,"fromBech32",{enumerable:!0,get:function(){return i.fromBech32}}),Object.defineProperty(e,"normalizeBech32",{enumerable:!0,get:function(){return i.normalizeBech32}}),Object.defineProperty(e,"toBech32",{enumerable:!0,get:function(){return i.toBech32}});var o=ti;Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return o.fromHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return o.toHex}});var g=ri;Object.defineProperty(e,"fromRfc3339",{enumerable:!0,get:function(){return g.fromRfc3339}}),Object.defineProperty(e,"toRfc3339",{enumerable:!0,get:function(){return g.toRfc3339}});var C=ii;Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return C.fromUtf8}}),Object.defineProperty(e,"toUtf8",{enumerable:!0,get:function(){return C.toUtf8}})})(ue);var nn={},Ie={},oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.arrayContentStartsWith=oi.arrayContentEquals=void 0;function Jg(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;++t)if(e[t]!==n[t])return!1;return!0}oi.arrayContentEquals=Jg;function Hg(e,n){if(e.length<n.length)return!1;for(let t=0;t<n.length;++t)if(e[t]!==n[t])return!1;return!0}oi.arrayContentStartsWith=Hg;var It={};Object.defineProperty(It,"__esModule",{value:!0});It.assertDefinedAndNotNull=It.assertDefined=It.assert=void 0;function qg(e,n){if(!e)throw new Error(n||"condition is not truthy")}It.assert=qg;function Vg(e,n){if(e===void 0)throw new Error(n??"value is undefined")}It.assertDefined=Vg;function Wg(e,n){if(e==null)throw new Error(n??"value is undefined or null")}It.assertDefinedAndNotNull=Wg;var qa={};Object.defineProperty(qa,"__esModule",{value:!0});qa.sleep=void 0;async function Qg(e){return new Promise(n=>setTimeout(n,e))}qa.sleep=Qg;var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.isDefined=Ot.isUint8Array=Ot.isNonNullObject=void 0;function wp(e){return typeof e=="object"&&e!==null}Ot.isNonNullObject=wp;function Fg(e){return!(!wp(e)||Object.prototype.toString.call(e)!=="[object Uint8Array]"||typeof L.dist.Buffer<"u"&&typeof L.dist.Buffer.isBuffer<"u"&&L.dist.Buffer.isBuffer(e))}Ot.isUint8Array=Fg;function Gg(e){return e!==void 0}Ot.isDefined=Gg;(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 n=oi;Object.defineProperty(e,"arrayContentEquals",{enumerable:!0,get:function(){return n.arrayContentEquals}}),Object.defineProperty(e,"arrayContentStartsWith",{enumerable:!0,get:function(){return n.arrayContentStartsWith}});var t=It;Object.defineProperty(e,"assert",{enumerable:!0,get:function(){return t.assert}}),Object.defineProperty(e,"assertDefined",{enumerable:!0,get:function(){return t.assertDefined}}),Object.defineProperty(e,"assertDefinedAndNotNull",{enumerable:!0,get:function(){return t.assertDefinedAndNotNull}});var i=qa;Object.defineProperty(e,"sleep",{enumerable:!0,get:function(){return i.sleep}});var o=Ot;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}})})(Ie);var Lg=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,o)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),$g=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Kg=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&Lg(n,e,t);return $g(n,e),n};Object.defineProperty(nn,"__esModule",{value:!0});nn.pbkdf2Sha512=nn.pbkdf2Sha512Noble=nn.pbkdf2Sha512NodeCrypto=nn.pbkdf2Sha512Subtle=nn.getSubtle=nn.getNodeCrypto=void 0;const or=Ie,xg=Re.require$$1,zg=Re.require$$1$1;async function _p(){try{const e=await Promise.resolve().then(()=>Kg(L.requireCryptoBrowserify()));return typeof e=="object"&&Object.keys(e).length<=1?void 0:e}catch{return}}nn.getNodeCrypto=_p;async function Mp(){var n,t,i;let e=(n=globalThis==null?void 0:globalThis.crypto)==null?void 0:n.subtle;return e||(e=(i=(t=globalThis==null?void 0:globalThis.crypto)==null?void 0:t.webcrypto)==null?void 0:i.subtle),e}nn.getSubtle=Mp;async function Up(e,n,t,i,o){return(0,or.assert)(e,"Argument subtle is falsy"),(0,or.assert)(typeof e=="object","Argument subtle is not of type object"),(0,or.assert)(typeof e.importKey=="function","subtle.importKey is not a function"),(0,or.assert)(typeof e.deriveBits=="function","subtle.deriveBits is not a function"),e.importKey("raw",n,{name:"PBKDF2"},!1,["deriveBits"]).then(g=>e.deriveBits({name:"PBKDF2",salt:t,iterations:i,hash:{name:"SHA-512"}},g,o*8).then(C=>new Uint8Array(C)))}nn.pbkdf2Sha512Subtle=Up;async function Dp(e,n,t,i,o){return(0,or.assert)(e,"Argument nodeCrypto is falsy"),(0,or.assert)(typeof e=="object","Argument nodeCrypto is not of type object"),(0,or.assert)(typeof e.pbkdf2=="function","nodeCrypto.pbkdf2 is not a function"),new Promise((g,C)=>{e.pbkdf2(n,t,i,o,"sha512",(w,E)=>{w?C(w):g(Uint8Array.from(E))})})}nn.pbkdf2Sha512NodeCrypto=Dp;async function Jp(e,n,t,i){return(0,xg.pbkdf2Async)(zg.sha512,e,n,{c:t,dkLen:i})}nn.pbkdf2Sha512Noble=Jp;async function Yg(e,n,t,i){const o=await Mp();if(o)return Up(o,e,n,t,i);{const g=await _p();return g?Dp(g,e,n,t,i):Jp(e,n,t,i)}}nn.pbkdf2Sha512=Yg;var wn={},Mi={};Object.defineProperty(Mi,"__esModule",{value:!0});Mi.toRealUint8Array=void 0;function Zg(e){return e instanceof Uint8Array?e:Uint8Array.from(e)}Mi.toRealUint8Array=Zg;Object.defineProperty(wn,"__esModule",{value:!0});wn.sha512=wn.Sha512=wn.sha256=wn.Sha256=void 0;const Xg=Re.require$$0,jg=Re.require$$1$1,Hp=Mi;class qp{constructor(n){this.blockSize=512/8,this.impl=Xg.sha256.create(),n&&this.update(n)}update(n){return this.impl.update((0,Hp.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}wn.Sha256=qp;function ey(e){return new qp(e).digest()}wn.sha256=ey;class Vp{constructor(n){this.blockSize=1024/8,this.impl=jg.sha512.create(),n&&this.update(n)}update(n){return this.impl.update((0,Hp.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}wn.Sha512=Vp;function ny(e){return new Vp(e).digest()}wn.sha512=ny;Object.defineProperty(nt,"__esModule",{value:!0});nt.Bip39=nt.EnglishMnemonic=nt.mnemonicToEntropy=nt.entropyToMnemonic=void 0;const kl=ue,ty=nn,ry=wn,Zu=["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 Wp(e){return Array.from(e).map(n=>n.toString(2).padStart(8,"0")).join("")}function Qp(e){const t=e.length*8/32,i=(0,ry.sha256)(e);return Wp(i).slice(0,t)}function Fp(e){return parseInt(e,2)}const iy=[16,20,24,28,32],oy=[12,15,18,21,24];function Gp(e){if(iy.indexOf(e.length)===-1)throw new Error("invalid input length");const n=Wp(e),t=Qp(e);return(n+t).match(/(.{11})/g).map(C=>{const w=Fp(C);return Zu[w]}).join(" ")}nt.entropyToMnemonic=Gp;const ay="Invalid number of words",sy="Found word that is not in the wordlist",dy="Invalid entropy",uy="Invalid mnemonic checksum";function Cu(e){return e.normalize("NFKD")}function Xu(e){const n=Cu(e).split(" ");if(!oy.includes(n.length))throw new Error(ay);const t=n.map(D=>{const J=Zu.indexOf(D);if(J===-1)throw new Error(sy);return J.toString(2).padStart(11,"0")}).join(""),i=Math.floor(t.length/33)*32,o=t.slice(0,i),g=t.slice(i),C=o.match(/(.{1,8})/g).map(Fp);if(C.length<16||C.length>32||C.length%4!==0)throw new Error(dy);const w=Uint8Array.from(C);if(Qp(w)!==g)throw new Error(uy);return w}nt.mnemonicToEntropy=Xu;class sr{constructor(n){if(!sr.mnemonicMatcher.test(n))throw new Error("Invalid mnemonic format");const t=n.split(" "),i=[12,15,18,21,24];if(i.indexOf(t.length)===-1)throw new Error(`Invalid word count in mnemonic (allowed: ${i} got: ${t.length})`);for(const o of t)if(sr.wordlist.indexOf(o)===-1)throw new Error("Mnemonic contains invalid word");Xu(n),this.data=n}toString(){return this.data}}nt.EnglishMnemonic=sr;sr.wordlist=Zu;sr.mnemonicMatcher=/^[a-z]+( [a-z]+)*$/;class cy{static encode(n){return new sr(Gp(n))}static decode(n){return Xu(n.toString())}static async mnemonicToSeed(n,t){const i=(0,kl.toUtf8)(Cu(n.toString())),o="mnemonic"+(t?Cu(t):""),g=(0,kl.toUtf8)(o);return(0,ty.pbkdf2Sha512)(i,g,2048,64)}}nt.Bip39=cy;var So={};Object.defineProperty(So,"__esModule",{value:!0});So.Hmac=void 0;class ly{constructor(n,t){const i=new n().blockSize;this.hash=g=>new n().update(g).digest();let o=t;if(o.length>i&&(o=this.hash(o)),o.length<i){const g=new Uint8Array(i-o.length);o=new Uint8Array([...o,...g])}this.oKeyPad=o.map(g=>g^92),this.iKeyPad=o.map(g=>g^54),this.messageHasher=new n,this.blockSize=i,this.update(this.iKeyPad)}update(n){return this.messageHasher.update(n),this}digest(){const n=this.messageHasher.digest();return this.hash(new Uint8Array([...this.oKeyPad,...n]))}}So.Hmac=ly;var ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.keccak256=ai.Keccak256=void 0;const fy=Re.require$$0$1,py=Mi;class Lp{constructor(n){this.blockSize=512/8,this.impl=fy.keccak_256.create(),n&&this.update(n)}update(n){return this.impl.update((0,py.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}ai.Keccak256=Lp;function my(e){return new Lp(e).digest()}ai.keccak256=my;var tn={},hy=L.commonjsGlobal&&L.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tn,"__esModule",{value:!0});tn.Xchacha20poly1305Ietf=tn.xchacha20NonceLength=tn.Ed25519=tn.Ed25519Keypair=tn.Argon2id=tn.isArgon2idOptions=void 0;const gy=Ie,ln=hy(_.libsodiumWrappers);function yy(e){return!(!(0,gy.isNonNullObject)(e)||typeof e.outputLength!="number"||typeof e.opsLimit!="number"||typeof e.memLimitKib!="number")}tn.isArgon2idOptions=yy;class Sy{static async execute(n,t,i){return await ln.default.ready,ln.default.crypto_pwhash(i.outputLength,n,t,i.opsLimit,i.memLimitKib*1024,ln.default.crypto_pwhash_ALG_ARGON2ID13)}}tn.Argon2id=Sy;class Va{static fromLibsodiumPrivkey(n){if(n.length!==64)throw new Error(`Unexpected key length ${n.length}. Must be 64.`);return new Va(n.slice(0,32),n.slice(32,64))}constructor(n,t){this.privkey=n,this.pubkey=t}toLibsodiumPrivkey(){return new Uint8Array([...this.privkey,...this.pubkey])}}tn.Ed25519Keypair=Va;class ky{static async makeKeypair(n){await ln.default.ready;const t=ln.default.crypto_sign_seed_keypair(n);return Va.fromLibsodiumPrivkey(t.privateKey)}static async createSignature(n,t){return await ln.default.ready,ln.default.crypto_sign_detached(n,t.toLibsodiumPrivkey())}static async verifySignature(n,t,i){return await ln.default.ready,ln.default.crypto_sign_verify_detached(n,t,i)}}tn.Ed25519=ky;tn.xchacha20NonceLength=24;class Py{static async encrypt(n,t,i){return await ln.default.ready,ln.default.crypto_aead_xchacha20poly1305_ietf_encrypt(n,null,null,i,t)}static async decrypt(n,t,i){return await ln.default.ready,ln.default.crypto_aead_xchacha20poly1305_ietf_decrypt(null,n,null,i,t)}}tn.Xchacha20poly1305Ietf=Py;var Wa={};Object.defineProperty(Wa,"__esModule",{value:!0});Wa.Random=void 0;class vy{static getBytes(n){try{const t=typeof window=="object"?window:self,i=typeof t.crypto<"u"?t.crypto:t.msCrypto,o=new Uint8Array(n);return i.getRandomValues(o),o}catch{try{const t=L.requireCryptoBrowserify();return new Uint8Array([...t.randomBytes(n)])}catch{throw new Error("No secure random number generator found")}}}}Wa.Random=vy;var si={};Object.defineProperty(si,"__esModule",{value:!0});si.ripemd160=si.Ripemd160=void 0;const Cy=Re.require$$0$2,Ry=Mi;class $p{constructor(n){this.blockSize=512/8,this.impl=Cy.ripemd160.create(),n&&this.update(n)}update(n){return this.impl.update((0,Ry.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}si.Ripemd160=$p;function By(e){return new $p(e).digest()}si.ripemd160=By;var Qa={},dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.ExtendedSecp256k1Signature=dr.Secp256k1Signature=void 0;function Ur(e){let n=0;for(const t of e)if(t===0)n++;else break;return e.slice(n)}const Wo=2;class uo{static fromFixedLength(n){if(n.length!==64)throw new Error(`Got invalid data length: ${n.length}. Expected 2x 32 bytes for the pair (r, s)`);return new uo(Ur(n.slice(0,32)),Ur(n.slice(32,64)))}static fromDer(n){let t=0;if(n[t++]!==48)throw new Error("Prefix 0x30 expected");const i=n[t++];if(n.length-t!==i)throw new Error("Data length mismatch detected");if(n[t++]!==Wo)throw new Error("INTEGER tag expected");const g=n[t++];if(g>=128)throw new Error("Decoding length values above 127 not supported");const C=n.slice(t,t+g);if(t+=g,n[t++]!==Wo)throw new Error("INTEGER tag expected");const E=n[t++];if(E>=128)throw new Error("Decoding length values above 127 not supported");const D=n.slice(t,t+E);return t+=E,new uo(Ur(C),Ur(D))}constructor(n,t){if(n.length>32||n.length===0||n[0]===0)throw new Error("Unsigned integer r must be encoded as unpadded big endian.");if(t.length>32||t.length===0||t[0]===0)throw new Error("Unsigned integer s must be encoded as unpadded big endian.");this.data={r:n,s:t}}r(n){if(n===void 0)return this.data.r;{const t=n-this.data.r.length;if(t<0)throw new Error("Length too small to hold parameter r");const i=new Uint8Array(t);return new Uint8Array([...i,...this.data.r])}}s(n){if(n===void 0)return this.data.s;{const t=n-this.data.s.length;if(t<0)throw new Error("Length too small to hold parameter s");const i=new Uint8Array(t);return new Uint8Array([...i,...this.data.s])}}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32)])}toDer(){const n=this.data.r[0]>=128?new Uint8Array([0,...this.data.r]):this.data.r,t=this.data.s[0]>=128?new Uint8Array([0,...this.data.s]):this.data.s,i=n.length,o=t.length,g=new Uint8Array([Wo,i,...n,Wo,o,...t]);return new Uint8Array([48,g.length,...g])}}dr.Secp256k1Signature=uo;class ju extends uo{static fromFixedLength(n){if(n.length!==65)throw new Error(`Got invalid data length ${n.length}. Expected 32 + 32 + 1`);return new ju(Ur(n.slice(0,32)),Ur(n.slice(32,64)),n[64])}constructor(n,t,i){if(super(n,t),!Number.isInteger(i))throw new Error("The recovery parameter must be an integer.");if(i<0||i>4)throw new Error("The recovery parameter must be one of 0, 1, 2, 3.");this.recovery=i}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32),this.recovery])}}dr.ExtendedSecp256k1Signature=ju;var Kp=L.commonjsGlobal&&L.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qa,"__esModule",{value:!0});Qa.Secp256k1=void 0;const Qo=ue,xp=Kp(L.bnExports),by=Kp(L.requireElliptic()),Ey=dr,Vt=new by.default.ec("secp256k1"),Iy=new xp.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex");class Oy{static async makeKeypair(n){if(n.length!==32)throw new Error("input data is not a valid secp256k1 private key");const t=Vt.keyFromPrivate(n);if(t.validate().result!==!0)throw new Error("input data is not a valid secp256k1 private key");if(new xp.default(n).gte(Iy))throw new Error("input data is not a valid secp256k1 private key");return{privkey:(0,Qo.fromHex)(t.getPrivate("hex")),pubkey:Uint8Array.from(t.getPublic("array"))}}static async createSignature(n,t){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 i=Vt.keyFromPrivate(t),{r:o,s:g,recoveryParam:C}=i.sign(n,{canonical:!0});if(typeof C!="number")throw new Error("Recovery param missing");return new Ey.ExtendedSecp256k1Signature(Uint8Array.from(o.toArray()),Uint8Array.from(g.toArray()),C)}static async verifySignature(n,t,i){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 o=Vt.keyFromPublic(i);try{return o.verify(t,n.toDer())}catch{return!1}}static recoverPubkey(n,t){const i={r:(0,Qo.toHex)(n.r()),s:(0,Qo.toHex)(n.s())},o=Vt.recoverPubKey(t,i,n.recovery),g=Vt.keyFromPublic(o);return(0,Qo.fromHex)(g.getPublic(!1,"hex"))}static compressPubkey(n){switch(n.length){case 33:return n;case 65:return Uint8Array.from(Vt.keyFromPublic(n).getPublic(!0,"array"));default:throw new Error("Invalid pubkey length")}}static uncompressPubkey(n){switch(n.length){case 33:return Uint8Array.from(Vt.keyFromPublic(n).getPublic(!1,"array"));case 65:return n;default:throw new Error("Invalid pubkey length")}}static trimRecoveryByte(n){switch(n.length){case 64:return n;case 65:return n.slice(0,64);default:throw new Error("Invalid signature length")}}}Qa.Secp256k1=Oy;var zp={};(function(e){var n=L.commonjsGlobal&&L.commonjsGlobal.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.stringToPath=e.pathToString=e.Slip10=e.Slip10RawIndex=e.slip10CurveFromString=e.Slip10Curve=void 0;const t=ue,i=Ne,o=n(L.bnExports),g=n(L.requireElliptic()),C=So,w=wn;var E;(function(u){u.Secp256k1="Bitcoin seed",u.Ed25519="ed25519 seed"})(E=e.Slip10Curve||(e.Slip10Curve={}));function D(u){switch(u){case E.Ed25519:return E.Ed25519;case E.Secp256k1:return E.Secp256k1;default:throw new Error(`Unknown curve string: '${u}'`)}}e.slip10CurveFromString=D;class J extends i.Uint32{static hardened(c){return new J(c+2**31)}static normal(c){return new J(c)}isHardened(){return this.data>=2**31}}e.Slip10RawIndex=J;const b=new g.default.ec("secp256k1");class p{static derivePath(c,y,B){let N=this.master(c,y);for(const U of B)N=this.child(c,N.privkey,N.chainCode,U);return N}static master(c,y){const B=new C.Hmac(w.Sha512,(0,t.toAscii)(c)).update(y).digest(),N=B.slice(0,32),U=B.slice(32,64);return c!==E.Ed25519&&(this.isZero(N)||this.isGteN(c,N))?this.master(c,B):{chainCode:U,privkey:N}}static child(c,y,B,N){let U;if(N.isHardened()){const W=new Uint8Array([0,...y,...N.toBytesBigEndian()]);U=new C.Hmac(w.Sha512,B).update(W).digest()}else{if(c===E.Ed25519)throw new Error("Normal keys are not allowed with ed25519");{const W=new Uint8Array([...p.serializedPoint(c,new o.default(y)),...N.toBytesBigEndian()]);U=new C.Hmac(w.Sha512,B).update(W).digest()}}return this.childImpl(c,y,B,N,U)}static serializedPoint(c,y){switch(c){case E.Secp256k1:return(0,t.fromHex)(b.g.mul(y).encodeCompressed("hex"));default:throw new Error("curve not supported")}}static childImpl(c,y,B,N,U){const W=U.slice(0,32),r=U.slice(32,64),s=r;if(c===E.Ed25519)return{chainCode:s,privkey:W};const O=this.n(c),q=new o.default(W).add(new o.default(y)).mod(O),d=Uint8Array.from(q.toArray("be",32));if(this.isGteN(c,W)||this.isZero(d)){const l=new C.Hmac(w.Sha512,B).update(new Uint8Array([1,...r,...N.toBytesBigEndian()])).digest();return this.childImpl(c,y,B,N,l)}return{chainCode:s,privkey:d}}static isZero(c){return c.every(y=>y===0)}static isGteN(c,y){return new o.default(y).gte(this.n(c))}static n(c){switch(c){case E.Secp256k1:return new o.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",16);default:throw new Error("curve not supported")}}}e.Slip10=p;function S(u){return u.reduce((c,y)=>{const B=y.isHardened()?`${y.toNumber()-2147483648}'`:y.toString();return c+"/"+B},"m")}e.pathToString=S;function R(u){if(!u.startsWith("m"))throw new Error("Path string must start with 'm'");let c=u.slice(1);const y=new Array;for(;c;){const B=c.match(/^\/([0-9]+)('?)/);if(!B)throw new Error("Syntax error while reading path component");const[N,U,W]=B,r=i.Uint53.fromString(U).toNumber();if(r>=2**31)throw new Error("Component value too high. Must not exceed 2**31-1.");W?y.push(J.hardened(r)):y.push(J.normal(r)),c=c.slice(N.length)}return y}e.stringToPath=R})(zp);(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 n=nt;Object.defineProperty(e,"Bip39",{enumerable:!0,get:function(){return n.Bip39}}),Object.defineProperty(e,"EnglishMnemonic",{enumerable:!0,get:function(){return n.EnglishMnemonic}});var t=So;Object.defineProperty(e,"Hmac",{enumerable:!0,get:function(){return t.Hmac}});var i=ai;Object.defineProperty(e,"Keccak256",{enumerable:!0,get:function(){return i.Keccak256}}),Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return i.keccak256}});var o=tn;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 g=Wa;Object.defineProperty(e,"Random",{enumerable:!0,get:function(){return g.Random}});var C=si;Object.defineProperty(e,"Ripemd160",{enumerable:!0,get:function(){return C.Ripemd160}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return C.ripemd160}});var w=Qa;Object.defineProperty(e,"Secp256k1",{enumerable:!0,get:function(){return w.Secp256k1}});var E=dr;Object.defineProperty(e,"ExtendedSecp256k1Signature",{enumerable:!0,get:function(){return E.ExtendedSecp256k1Signature}}),Object.defineProperty(e,"Secp256k1Signature",{enumerable:!0,get:function(){return E.Secp256k1Signature}});var D=wn;Object.defineProperty(e,"Sha256",{enumerable:!0,get:function(){return D.Sha256}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return D.sha256}}),Object.defineProperty(e,"Sha512",{enumerable:!0,get:function(){return D.Sha512}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return D.sha512}});var J=zp;Object.defineProperty(e,"pathToString",{enumerable:!0,get:function(){return J.pathToString}}),Object.defineProperty(e,"Slip10",{enumerable:!0,get:function(){return J.Slip10}}),Object.defineProperty(e,"Slip10Curve",{enumerable:!0,get:function(){return J.Slip10Curve}}),Object.defineProperty(e,"slip10CurveFromString",{enumerable:!0,get:function(){return J.slip10CurveFromString}}),Object.defineProperty(e,"Slip10RawIndex",{enumerable:!0,get:function(){return J.Slip10RawIndex}}),Object.defineProperty(e,"stringToPath",{enumerable:!0,get:function(){return J.stringToPath}})})($e);var Le={},ko={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isMultisigThresholdPubkey=e.isSinglePubkey=e.pubkeyType=e.isSecp256k1Pubkey=e.isEd25519Pubkey=void 0;function n(g){return g.type==="tendermint/PubKeyEd25519"}e.isEd25519Pubkey=n;function t(g){return g.type==="tendermint/PubKeySecp256k1"}e.isSecp256k1Pubkey=t,e.pubkeyType={secp256k1:"tendermint/PubKeySecp256k1",ed25519:"tendermint/PubKeyEd25519",sr25519:"tendermint/PubKeySr25519",multisigThreshold:"tendermint/PubKeyMultisigThreshold"};function i(g){return[e.pubkeyType.ed25519,e.pubkeyType.secp256k1,e.pubkeyType.sr25519].includes(g.type)}e.isSinglePubkey=i;function o(g){return g.type==="tendermint/PubKeyMultisigThreshold"}e.isMultisigThresholdPubkey=o})(ko);Object.defineProperty(Le,"__esModule",{value:!0});Le.encodeBech32Pubkey=Le.encodeAminoPubkey=Le.decodeBech32Pubkey=Le.decodeAminoPubkey=Le.encodeEd25519Pubkey=Le.encodeSecp256k1Pubkey=void 0;const on=ue,Ay=Ne,Yi=Ie,mt=ko;function Ty(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:mt.pubkeyType.secp256k1,value:(0,on.toBase64)(e)}}Le.encodeSecp256k1Pubkey=Ty;function Ny(e){if(e.length!==32)throw new Error("Ed25519 public key must be 32 bytes long");return{type:mt.pubkeyType.ed25519,value:(0,on.toBase64)(e)}}Le.encodeEd25519Pubkey=Ny;const Ru=(0,on.fromHex)("eb5ae98721"),Bu=(0,on.fromHex)("1624de6420"),Pl=(0,on.fromHex)("0dfb100520"),ya=(0,on.fromHex)("22c1f7e2");function ec(e){if((0,Yi.arrayContentStartsWith)(e,Ru)){const n=e.slice(Ru.length);if(n.length!==33)throw new Error("Invalid rest data length. Expected 33 bytes (compressed secp256k1 pubkey).");return{type:mt.pubkeyType.secp256k1,value:(0,on.toBase64)(n)}}else if((0,Yi.arrayContentStartsWith)(e,Bu)){const n=e.slice(Bu.length);if(n.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Ed25519 pubkey).");return{type:mt.pubkeyType.ed25519,value:(0,on.toBase64)(n)}}else if((0,Yi.arrayContentStartsWith)(e,Pl)){const n=e.slice(Pl.length);if(n.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Sr25519 pubkey).");return{type:mt.pubkeyType.sr25519,value:(0,on.toBase64)(n)}}else{if((0,Yi.arrayContentStartsWith)(e,ya))return _y(e);throw new Error("Unsupported public key type. Amino data starts with: "+(0,on.toHex)(e.slice(0,5)))}}Le.decodeAminoPubkey=ec;function wy(e){const{data:n}=(0,on.fromBech32)(e);return ec(n)}Le.decodeBech32Pubkey=wy;function vl(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 _y(e){const n=Array.from(e),t=n.splice(0,ya.length);if(!(0,Yi.arrayContentStartsWith)(t,ya))throw new Error("Invalid multisig prefix.");if(n.shift()!=8)throw new Error("Invalid multisig data. Expecting 0x08 prefix before threshold.");const[i,o]=vl(n);n.splice(0,o);const g=[];for(;n.length>0;){if(n.shift()!=18)throw new Error("Invalid multisig data. Expecting 0x12 prefix before participant pubkey length.");const[C,w]=vl(n);if(n.splice(0,w),n.length<C)throw new Error("Invalid multisig data length.");const E=n.splice(0,C),D=ec(Uint8Array.from(E));g.push(D)}return{type:mt.pubkeyType.multisigThreshold,value:{threshold:i.toString(),pubkeys:g}}}function Cl(e){const n=Ay.Uint53.fromString(e.toString()).toNumber();if(n>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[n]}function nc(e){if((0,mt.isMultisigThresholdPubkey)(e)){const n=Array.from(ya);n.push(8),n.push(...Cl(e.value.threshold));for(const t of e.value.pubkeys.map(i=>nc(i)))n.push(18),n.push(...Cl(t.length)),n.push(...t);return new Uint8Array(n)}else{if((0,mt.isEd25519Pubkey)(e))return new Uint8Array([...Bu,...(0,on.fromBase64)(e.value)]);if((0,mt.isSecp256k1Pubkey)(e))return new Uint8Array([...Ru,...(0,on.fromBase64)(e.value)]);throw new Error("Unsupported pubkey type")}}Le.encodeAminoPubkey=nc;function My(e,n){return(0,on.toBech32)(n,nc(e))}Le.encodeBech32Pubkey=My;Object.defineProperty(hn,"__esModule",{value:!0});hn.pubkeyToAddress=hn.pubkeyToRawAddress=hn.rawSecp256k1PubkeyToRawAddress=hn.rawEd25519PubkeyToRawAddress=void 0;const Sa=$e,bu=ue,Uy=Le,Bd=ko;function Yp(e){if(e.length!==32)throw new Error(`Invalid Ed25519 pubkey length: ${e.length}`);return(0,Sa.sha256)(e).slice(0,20)}hn.rawEd25519PubkeyToRawAddress=Yp;function Zp(e){if(e.length!==33)throw new Error(`Invalid Secp256k1 pubkey length (compressed): ${e.length}`);return(0,Sa.ripemd160)((0,Sa.sha256)(e))}hn.rawSecp256k1PubkeyToRawAddress=Zp;function Xp(e){if((0,Bd.isSecp256k1Pubkey)(e)){const n=(0,bu.fromBase64)(e.value);return Zp(n)}else if((0,Bd.isEd25519Pubkey)(e)){const n=(0,bu.fromBase64)(e.value);return Yp(n)}else if((0,Bd.isMultisigThresholdPubkey)(e)){const n=(0,Uy.encodeAminoPubkey)(e);return(0,Sa.sha256)(n).slice(0,20)}else throw new Error("Unsupported public key type")}hn.pubkeyToRawAddress=Xp;function Dy(e,n){return(0,bu.toBech32)(n,Xp(e))}hn.pubkeyToAddress=Dy;var tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.addCoins=tt.parseCoins=tt.coins=tt.coin=void 0;const Eu=Ne;function jp(e,n){let t;if(typeof e=="number")try{t=new Eu.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");t=e.replace(/^0*/,"")||"0"}return{amount:t,denom:n}}tt.coin=jp;function Jy(e,n){return[jp(e,n)]}tt.coins=Jy;function Hy(e){return e.replace(/\s/g,"").split(",").filter(Boolean).map(n=>{const t=n.match(/^([0-9]+)([a-zA-Z][a-zA-Z0-9/]{2,127})$/);if(!t)throw new Error("Got an invalid coin string");return{amount:t[1].replace(/^0+/,"")||"0",denom:t[2]}})}tt.parseCoins=Hy;function qy(e,n){if(e.denom!==n.denom)throw new Error("Trying to add two coins with different denoms");return{amount:Eu.Decimal.fromAtomics(e.amount,0).plus(Eu.Decimal.fromAtomics(n.amount,0)).atomics,denom:e.denom}}tt.addCoins=qy;var di={};Object.defineProperty(di,"__esModule",{value:!0});di.createMultisigThresholdPubkey=di.compareArrays=void 0;const Rl=ue,Vy=Ne,Bl=hn;function em(e,n){const t=(0,Rl.toHex)(e),i=(0,Rl.toHex)(n);return t===i?0:t<i?-1:1}di.compareArrays=em;function Wy(e,n,t=!1){const i=new Vy.Uint53(n);if(i.toNumber()>e.length)throw new Error(`Threshold k = ${i.toNumber()} exceeds number of keys n = ${e.length}`);const o=t?e:Array.from(e).sort((g,C)=>{const w=(0,Bl.pubkeyToRawAddress)(g),E=(0,Bl.pubkeyToRawAddress)(C);return em(w,E)});return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:i.toString(),pubkeys:o}}}di.createMultisigThresholdPubkey=Wy;var Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});Fa.omitDefault=void 0;function Qy(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}'`)}}Fa.omitDefault=Qy;var Po={};Object.defineProperty(Po,"__esModule",{value:!0});Po.makeCosmoshubPath=void 0;const Ui=$e;function Fy(e){return[Ui.Slip10RawIndex.hardened(44),Ui.Slip10RawIndex.hardened(118),Ui.Slip10RawIndex.hardened(0),Ui.Slip10RawIndex.normal(0),Ui.Slip10RawIndex.normal(e)]}Po.makeCosmoshubPath=Fy;var ui={},qt={};Object.defineProperty(qt,"__esModule",{value:!0});qt.decodeSignature=qt.encodeSecp256k1Signature=void 0;const Iu=ue,Gy=Le,Ly=ko;function $y(e,n){if(n.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,Gy.encodeSecp256k1Pubkey)(e),signature:(0,Iu.toBase64)(n)}}qt.encodeSecp256k1Signature=$y;function Ky(e){switch(e.pub_key.type){case Ly.pubkeyType.secp256k1:return{pubkey:(0,Iu.fromBase64)(e.pub_key.value),signature:(0,Iu.fromBase64)(e.signature)};default:throw new Error("Unsupported pubkey type")}}qt.decodeSignature=Ky;var _n={};Object.defineProperty(_n,"__esModule",{value:!0});_n.serializeSignDoc=_n.escapeCharacters=_n.makeSignDoc=_n.sortedJsonStringify=void 0;const xy=ue,bl=Ne;function Ou(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(Ou);const n=Object.keys(e).sort(),t={};return n.forEach(i=>{t[i]=Ou(e[i])}),t}function nm(e){return JSON.stringify(Ou(e))}_n.sortedJsonStringify=nm;function zy(e,n,t,i,o,g,C){return{chain_id:t,account_number:bl.Uint53.fromString(o.toString()).toString(),sequence:bl.Uint53.fromString(g.toString()).toString(),fee:n,msgs:e,memo:i||"",...C&&{timeout_height:C.toString()}}}_n.makeSignDoc=zy;function tm(e){const n=/&/g,t=/</g,i=/>/g;return e.replace(n,"\\u0026").replace(t,"\\u003c").replace(i,"\\u003e")}_n.escapeCharacters=tm;function Yy(e){const n=tm(nm(e));return(0,xy.toUtf8)(n)}_n.serializeSignDoc=Yy;var tc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const n=$e,t=ue;e.cosmjsSalt=(0,t.toAscii)("The CosmJS salt.");async function i(C,w){switch(w.algorithm){case"argon2id":{const E=w.params;if(!(0,n.isArgon2idOptions)(E))throw new Error("Invalid format of argon2id params");return n.Argon2id.execute(C,e.cosmjsSalt,E)}default:throw new Error("Unsupported KDF algorithm")}}e.executeKdf=i,e.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"};async function o(C,w,E){switch(E.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=n.Random.getBytes(n.xchacha20NonceLength);return new Uint8Array([...D,...await n.Xchacha20poly1305Ietf.encrypt(C,w,D)])}default:throw new Error(`Unsupported encryption algorithm: '${E.algorithm}'`)}}e.encrypt=o;async function g(C,w,E){switch(E.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=C.slice(0,n.xchacha20NonceLength);return n.Xchacha20poly1305Ietf.decrypt(C.slice(n.xchacha20NonceLength),w,D)}default:throw new Error(`Unsupported encryption algorithm: '${E.algorithm}'`)}}e.decrypt=g})(tc);Object.defineProperty(ui,"__esModule",{value:!0});ui.Secp256k1HdWallet=ui.extractKdfConfiguration=void 0;const Sn=$e,Di=ue,Dr=Ie,Zy=hn,Xy=Po,jy=qt,eS=_n,Ji=tc,la="secp256k1wallet-v1",nS={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function tS(e){return!(!(0,Dr.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function rS(e){return e.kdf}function iS(e){const n=JSON.parse(e);if(!(0,Dr.isNonNullObject)(n))throw new Error("Root document is not an object.");switch(n.type){case la:return rS(n);default:throw new Error("Unsupported serialization type")}}ui.extractKdfConfiguration=iS;const El={bip39Password:"",hdPaths:[(0,Xy.makeCosmoshubPath)(0)],prefix:"cosmos"};class Yt{static async fromMnemonic(n,t={}){const i=new Sn.EnglishMnemonic(n),o=await Sn.Bip39.mnemonicToSeed(i,t.bip39Password);return new Yt(i,{...t,seed:o})}static async generate(n=12,t={}){const i=4*Math.floor(11*n/33),o=Sn.Random.getBytes(i),g=Sn.Bip39.encode(o);return Yt.fromMnemonic(g.toString(),t)}static async deserialize(n,t){const i=JSON.parse(n);if(!(0,Dr.isNonNullObject)(i))throw new Error("Root document is not an object.");switch(i.type){case la:return Yt.deserializeTypeV1(n,t);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(n,t){const i=JSON.parse(n);if(!(0,Dr.isNonNullObject)(i))throw new Error("Root document is not an object.");const o=i;switch(o.type){case la:{const g=await(0,Ji.decrypt)((0,Di.fromBase64)(o.data),t,o.encryption),C=JSON.parse((0,Di.fromUtf8)(g)),{mnemonic:w,accounts:E}=C;if((0,Dr.assert)(typeof w=="string"),!Array.isArray(E))throw new Error("Property 'accounts' is not an array");if(!E.every(b=>tS(b)))throw new Error("Account is not in the correct format.");const D=E[0].prefix;if(!E.every(({prefix:b})=>b===D))throw new Error("Accounts do not all have the same prefix");const J=E.map(({hdPath:b})=>(0,Sn.stringToPath)(b));return Yt.fromMnemonic(w,{hdPaths:J,prefix:D})}default:throw new Error("Unsupported serialization type")}}static async deserializeTypeV1(n,t){const i=JSON.parse(n);if(!(0,Dr.isNonNullObject)(i))throw new Error("Root document is not an object.");const o=await(0,Ji.executeKdf)(t,i.kdf);return Yt.deserializeWithEncryptionKey(n,o)}constructor(n,t){const i=t.hdPaths??El.hdPaths,o=t.prefix??El.prefix;this.secret=n,this.seed=t.seed,this.accounts=i.map(g=>({hdPath:g,prefix:o}))}get mnemonic(){return this.secret.toString()}async getAccounts(){return(await this.getAccountsWithPrivkeys()).map(({algo:t,pubkey:i,address:o})=>({algo:t,pubkey:i,address:o}))}async signAmino(n,t){const o=(await this.getAccountsWithPrivkeys()).find(({address:J})=>J===n);if(o===void 0)throw new Error(`Address ${n} not found in wallet`);const{privkey:g,pubkey:C}=o,w=(0,Sn.sha256)((0,eS.serializeSignDoc)(t)),E=await Sn.Secp256k1.createSignature(w,g),D=new Uint8Array([...E.r(32),...E.s(32)]);return{signed:t,signature:(0,jy.encodeSecp256k1Signature)(C,D)}}async serialize(n){const t=nS,i=await(0,Ji.executeKdf)(n,t);return this.serializeWithEncryptionKey(i,t)}async serializeWithEncryptionKey(n,t){const i={mnemonic:this.mnemonic,accounts:this.accounts.map(({hdPath:E,prefix:D})=>({hdPath:(0,Sn.pathToString)(E),prefix:D}))},o=(0,Di.toUtf8)(JSON.stringify(i)),g={algorithm:Ji.supportedAlgorithms.xchacha20poly1305Ietf},C=await(0,Ji.encrypt)(o,n,g),w={type:la,kdf:t,encryption:g,data:(0,Di.toBase64)(C)};return JSON.stringify(w)}async getKeyPair(n){const{privkey:t}=Sn.Slip10.derivePath(Sn.Slip10Curve.Secp256k1,this.seed,n),{pubkey:i}=await Sn.Secp256k1.makeKeypair(t);return{privkey:t,pubkey:Sn.Secp256k1.compressPubkey(i)}}async getAccountsWithPrivkeys(){return Promise.all(this.accounts.map(async({hdPath:n,prefix:t})=>{const{privkey:i,pubkey:o}=await this.getKeyPair(n),g=(0,Di.toBech32)(t,(0,Zy.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:i,pubkey:o,address:g}}))}}ui.Secp256k1HdWallet=Yt;var Ga={};Object.defineProperty(Ga,"__esModule",{value:!0});Ga.Secp256k1Wallet=void 0;const Fo=$e,oS=ue,aS=hn,sS=qt,dS=_n;class rc{static async fromKey(n,t="cosmos"){const i=(await Fo.Secp256k1.makeKeypair(n)).pubkey;return new rc(n,Fo.Secp256k1.compressPubkey(i),t)}constructor(n,t,i){this.privkey=n,this.pubkey=t,this.prefix=i}get address(){return(0,oS.toBech32)(this.prefix,(0,aS.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signAmino(n,t){if(n!==this.address)throw new Error(`Address ${n} not found in wallet`);const i=new Fo.Sha256((0,dS.serializeSignDoc)(t)).digest(),o=await Fo.Secp256k1.createSignature(i,this.privkey),g=new Uint8Array([...o.r(32),...o.s(32)]);return{signed:t,signature:(0,sS.encodeSecp256k1Signature)(this.pubkey,g)}}}Ga.Secp256k1Wallet=rc;var ci={};Object.defineProperty(ci,"__esModule",{value:!0});ci.makeStdTx=ci.isStdTx=void 0;function uS(e){const{memo:n,msg:t,fee:i,signatures:o}=e;return typeof n=="string"&&Array.isArray(t)&&typeof i=="object"&&Array.isArray(o)}ci.isStdTx=uS;function cS(e,n){return{msg:e.msgs,fee:e.fee,memo:e.memo,signatures:Array.isArray(n)?n:[n]}}ci.makeStdTx=cS;(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 n=hn;Object.defineProperty(e,"pubkeyToAddress",{enumerable:!0,get:function(){return n.pubkeyToAddress}}),Object.defineProperty(e,"pubkeyToRawAddress",{enumerable:!0,get:function(){return n.pubkeyToRawAddress}}),Object.defineProperty(e,"rawEd25519PubkeyToRawAddress",{enumerable:!0,get:function(){return n.rawEd25519PubkeyToRawAddress}}),Object.defineProperty(e,"rawSecp256k1PubkeyToRawAddress",{enumerable:!0,get:function(){return n.rawSecp256k1PubkeyToRawAddress}});var t=tt;Object.defineProperty(e,"addCoins",{enumerable:!0,get:function(){return t.addCoins}}),Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return t.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return t.coins}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return t.parseCoins}});var i=Le;Object.defineProperty(e,"decodeAminoPubkey",{enumerable:!0,get:function(){return i.decodeAminoPubkey}}),Object.defineProperty(e,"decodeBech32Pubkey",{enumerable:!0,get:function(){return i.decodeBech32Pubkey}}),Object.defineProperty(e,"encodeAminoPubkey",{enumerable:!0,get:function(){return i.encodeAminoPubkey}}),Object.defineProperty(e,"encodeBech32Pubkey",{enumerable:!0,get:function(){return i.encodeBech32Pubkey}}),Object.defineProperty(e,"encodeEd25519Pubkey",{enumerable:!0,get:function(){return i.encodeEd25519Pubkey}}),Object.defineProperty(e,"encodeSecp256k1Pubkey",{enumerable:!0,get:function(){return i.encodeSecp256k1Pubkey}});var o=di;Object.defineProperty(e,"createMultisigThresholdPubkey",{enumerable:!0,get:function(){return o.createMultisigThresholdPubkey}});var g=Fa;Object.defineProperty(e,"omitDefault",{enumerable:!0,get:function(){return g.omitDefault}});var C=Po;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return C.makeCosmoshubPath}});var w=ko;Object.defineProperty(e,"isEd25519Pubkey",{enumerable:!0,get:function(){return w.isEd25519Pubkey}}),Object.defineProperty(e,"isMultisigThresholdPubkey",{enumerable:!0,get:function(){return w.isMultisigThresholdPubkey}}),Object.defineProperty(e,"isSecp256k1Pubkey",{enumerable:!0,get:function(){return w.isSecp256k1Pubkey}}),Object.defineProperty(e,"isSinglePubkey",{enumerable:!0,get:function(){return w.isSinglePubkey}}),Object.defineProperty(e,"pubkeyType",{enumerable:!0,get:function(){return w.pubkeyType}});var E=ui;Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return E.extractKdfConfiguration}}),Object.defineProperty(e,"Secp256k1HdWallet",{enumerable:!0,get:function(){return E.Secp256k1HdWallet}});var D=Ga;Object.defineProperty(e,"Secp256k1Wallet",{enumerable:!0,get:function(){return D.Secp256k1Wallet}});var J=qt;Object.defineProperty(e,"decodeSignature",{enumerable:!0,get:function(){return J.decodeSignature}}),Object.defineProperty(e,"encodeSecp256k1Signature",{enumerable:!0,get:function(){return J.encodeSecp256k1Signature}});var b=_n;Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return b.makeSignDoc}}),Object.defineProperty(e,"serializeSignDoc",{enumerable:!0,get:function(){return b.serializeSignDoc}});var p=ci;Object.defineProperty(e,"isStdTx",{enumerable:!0,get:function(){return p.isStdTx}}),Object.defineProperty(e,"makeStdTx",{enumerable:!0,get:function(){return p.makeStdTx}});var S=tc;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return S.executeKdf}})})(zn);var st={};Object.defineProperty(st,"__esModule",{value:!0});st.makeSignBytes=st.makeSignDoc=st.makeAuthInfoBytes=void 0;const Il=Ie,lS=_.signing,ka=_.tx;function fS(e,n){return e.map(({pubkey:t,sequence:i})=>({publicKey:t,modeInfo:{single:{mode:n}},sequence:BigInt(i)}))}function pS(e,n,t,i,o,g=lS.SignMode.SIGN_MODE_DIRECT){(0,Il.assert)(i===void 0||typeof i=="string","feeGranter must be undefined or string"),(0,Il.assert)(o===void 0||typeof o=="string","feePayer must be undefined or string");const C=ka.AuthInfo.fromPartial({signerInfos:fS(e,g),fee:{amount:[...n],gasLimit:BigInt(t),granter:i,payer:o}});return ka.AuthInfo.encode(C).finish()}st.makeAuthInfoBytes=pS;function mS(e,n,t,i){return{bodyBytes:e,authInfoBytes:n,chainId:t,accountNumber:BigInt(i)}}st.makeSignDoc=mS;function hS({accountNumber:e,authInfoBytes:n,bodyBytes:t,chainId:i}){const o=ka.SignDoc.fromPartial({accountNumber:e,authInfoBytes:n,bodyBytes:t,chainId:i});return ka.SignDoc.encode(o).finish()}st.makeSignBytes=hS;var ic={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const n=$e,t=ue;e.cosmjsSalt=(0,t.toAscii)("The CosmJS salt.");async function i(C,w){switch(w.algorithm){case"argon2id":{const E=w.params;if(!(0,n.isArgon2idOptions)(E))throw new Error("Invalid format of argon2id params");return n.Argon2id.execute(C,e.cosmjsSalt,E)}default:throw new Error("Unsupported KDF algorithm")}}e.executeKdf=i,e.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"};async function o(C,w,E){switch(E.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=n.Random.getBytes(n.xchacha20NonceLength);return new Uint8Array([...D,...await n.Xchacha20poly1305Ietf.encrypt(C,w,D)])}default:throw new Error(`Unsupported encryption algorithm: '${E.algorithm}'`)}}e.encrypt=o;async function g(C,w,E){switch(E.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=C.slice(0,n.xchacha20NonceLength);return n.Xchacha20poly1305Ietf.decrypt(C.slice(n.xchacha20NonceLength),w,D)}default:throw new Error(`Unsupported encryption algorithm: '${E.algorithm}'`)}}e.decrypt=g})(ic);Object.defineProperty(jr,"__esModule",{value:!0});jr.DirectSecp256k1HdWallet=jr.extractKdfConfiguration=void 0;const Au=zn,kn=$e,Hi=ue,Jr=Ie,gS=st,qi=ic,fa="directsecp256k1hdwallet-v1",yS={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function SS(e){return!(!(0,Jr.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function kS(e){return e.kdf}function PS(e){const n=JSON.parse(e);if(!(0,Jr.isNonNullObject)(n))throw new Error("Root document is not an object.");switch(n.type){case fa:return kS(n);default:throw new Error("Unsupported serialization type")}}jr.extractKdfConfiguration=PS;const Ol={bip39Password:"",hdPaths:[(0,Au.makeCosmoshubPath)(0)],prefix:"cosmos"};class Zt{static async fromMnemonic(n,t={}){const i=new kn.EnglishMnemonic(n),o=await kn.Bip39.mnemonicToSeed(i,t.bip39Password);return new Zt(i,{...t,seed:o})}static async generate(n=12,t={}){const i=4*Math.floor(11*n/33),o=kn.Random.getBytes(i),g=kn.Bip39.encode(o);return Zt.fromMnemonic(g.toString(),t)}static async deserialize(n,t){const i=JSON.parse(n);if(!(0,Jr.isNonNullObject)(i))throw new Error("Root document is not an object.");switch(i.type){case fa:return Zt.deserializeTypeV1(n,t);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(n,t){const i=JSON.parse(n);if(!(0,Jr.isNonNullObject)(i))throw new Error("Root document is not an object.");const o=i;switch(o.type){case fa:{const g=await(0,qi.decrypt)((0,Hi.fromBase64)(o.data),t,o.encryption),C=JSON.parse((0,Hi.fromUtf8)(g)),{mnemonic:w,accounts:E}=C;if((0,Jr.assert)(typeof w=="string"),!Array.isArray(E))throw new Error("Property 'accounts' is not an array");if(!E.every(b=>SS(b)))throw new Error("Account is not in the correct format.");const D=E[0].prefix;if(!E.every(({prefix:b})=>b===D))throw new Error("Accounts do not all have the same prefix");const J=E.map(({hdPath:b})=>(0,kn.stringToPath)(b));return Zt.fromMnemonic(w,{hdPaths:J,prefix:D})}default:throw new Error("Unsupported serialization type")}}static async deserializeTypeV1(n,t){const i=JSON.parse(n);if(!(0,Jr.isNonNullObject)(i))throw new Error("Root document is not an object.");const o=await(0,qi.executeKdf)(t,i.kdf);return Zt.deserializeWithEncryptionKey(n,o)}constructor(n,t){const i=t.prefix??Ol.prefix,o=t.hdPaths??Ol.hdPaths;this.secret=n,this.seed=t.seed,this.accounts=o.map(g=>({hdPath:g,prefix:i}))}get mnemonic(){return this.secret.toString()}async getAccounts(){return(await this.getAccountsWithPrivkeys()).map(({algo:t,pubkey:i,address:o})=>({algo:t,pubkey:i,address:o}))}async signDirect(n,t){const o=(await this.getAccountsWithPrivkeys()).find(({address:p})=>p===n);if(o===void 0)throw new Error(`Address ${n} not found in wallet`);const{privkey:g,pubkey:C}=o,w=(0,gS.makeSignBytes)(t),E=(0,kn.sha256)(w),D=await kn.Secp256k1.createSignature(E,g),J=new Uint8Array([...D.r(32),...D.s(32)]),b=(0,Au.encodeSecp256k1Signature)(C,J);return{signed:t,signature:b}}async serialize(n){const t=yS,i=await(0,qi.executeKdf)(n,t);return this.serializeWithEncryptionKey(i,t)}async serializeWithEncryptionKey(n,t){const i={mnemonic:this.mnemonic,accounts:this.accounts.map(({hdPath:E,prefix:D})=>({hdPath:(0,kn.pathToString)(E),prefix:D}))},o=(0,Hi.toUtf8)(JSON.stringify(i)),g={algorithm:qi.supportedAlgorithms.xchacha20poly1305Ietf},C=await(0,qi.encrypt)(o,n,g),w={type:fa,kdf:t,encryption:g,data:(0,Hi.toBase64)(C)};return JSON.stringify(w)}async getKeyPair(n){const{privkey:t}=kn.Slip10.derivePath(kn.Slip10Curve.Secp256k1,this.seed,n),{pubkey:i}=await kn.Secp256k1.makeKeypair(t);return{privkey:t,pubkey:kn.Secp256k1.compressPubkey(i)}}async getAccountsWithPrivkeys(){return Promise.all(this.accounts.map(async({hdPath:n,prefix:t})=>{const{privkey:i,pubkey:o}=await this.getKeyPair(n),g=(0,Hi.toBech32)(t,(0,Au.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:i,pubkey:o,address:g}}))}}jr.DirectSecp256k1HdWallet=Zt;var La={};Object.defineProperty(La,"__esModule",{value:!0});La.DirectSecp256k1Wallet=void 0;const Al=zn,Go=$e,vS=ue,CS=st;class oc{static async fromKey(n,t="cosmos"){const i=(await Go.Secp256k1.makeKeypair(n)).pubkey;return new oc(n,Go.Secp256k1.compressPubkey(i),t)}constructor(n,t,i){this.privkey=n,this.pubkey=t,this.prefix=i}get address(){return(0,vS.toBech32)(this.prefix,(0,Al.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signDirect(n,t){const i=(0,CS.makeSignBytes)(t);if(n!==this.address)throw new Error(`Address ${n} not found in wallet`);const o=(0,Go.sha256)(i),g=await Go.Secp256k1.createSignature(o,this.privkey),C=new Uint8Array([...g.r(32),...g.s(32)]),w=(0,Al.encodeSecp256k1Signature)(this.pubkey,C);return{signed:t,signature:w}}}La.DirectSecp256k1Wallet=oc;var $a={};Object.defineProperty($a,"__esModule",{value:!0});$a.makeCosmoshubPath=void 0;const Vi=$e;function RS(e){return[Vi.Slip10RawIndex.hardened(44),Vi.Slip10RawIndex.hardened(118),Vi.Slip10RawIndex.hardened(0),Vi.Slip10RawIndex.normal(0),Vi.Slip10RawIndex.normal(e)]}$a.makeCosmoshubPath=RS;var rt={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.PrivKey=ht.PubKey=ht.protobufPackage=void 0;const Wr=_.binary,Qr=_.helpers;ht.protobufPackage="cosmos.crypto.ed25519";function bd(){return{key:new Uint8Array}}ht.PubKey={typeUrl:"/cosmos.crypto.ed25519.PubKey",encode(e,n=Wr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Wr.BinaryReader?e:new Wr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=bd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.key=t.bytes();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=bd();return(0,Qr.isSet)(e.key)&&(n.key=(0,Qr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Qr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=bd();return n.key=e.key??new Uint8Array,n}};function Ed(){return{key:new Uint8Array}}ht.PrivKey={typeUrl:"/cosmos.crypto.ed25519.PrivKey",encode(e,n=Wr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Wr.BinaryReader?e:new Wr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Ed();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.key=t.bytes();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Ed();return(0,Qr.isSet)(e.key)&&(n.key=(0,Qr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Qr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=Ed();return n.key=e.key??new Uint8Array,n}};var ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.LegacyAminoPubKey=ur.protobufPackage=void 0;const Wi=_.any,Id=_.binary,BS=_.helpers;ur.protobufPackage="cosmos.crypto.multisig";function Od(){return{threshold:0,publicKeys:[]}}ur.LegacyAminoPubKey={typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",encode(e,n=Id.BinaryWriter.create()){e.threshold!==0&&n.uint32(8).uint32(e.threshold);for(const t of e.publicKeys)Wi.Any.encode(t,n.uint32(18).fork()).ldelim();return n},decode(e,n){const t=e instanceof Id.BinaryReader?e:new Id.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Od();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.threshold=t.uint32();break;case 2:o.publicKeys.push(Wi.Any.decode(t,t.uint32()));break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Od();return(0,BS.isSet)(e.threshold)&&(n.threshold=Number(e.threshold)),Array.isArray(e==null?void 0:e.publicKeys)&&(n.publicKeys=e.publicKeys.map(t=>Wi.Any.fromJSON(t))),n},toJSON(e){const n={};return e.threshold!==void 0&&(n.threshold=Math.round(e.threshold)),e.publicKeys?n.publicKeys=e.publicKeys.map(t=>t?Wi.Any.toJSON(t):void 0):n.publicKeys=[],n},fromPartial(e){var t;const n=Od();return n.threshold=e.threshold??0,n.publicKeys=((t=e.publicKeys)==null?void 0:t.map(i=>Wi.Any.fromPartial(i)))||[],n}};var gt={};Object.defineProperty(gt,"__esModule",{value:!0});gt.PrivKey=gt.PubKey=gt.protobufPackage=void 0;const Fr=_.binary,Gr=_.helpers;gt.protobufPackage="cosmos.crypto.secp256k1";function Ad(){return{key:new Uint8Array}}gt.PubKey={typeUrl:"/cosmos.crypto.secp256k1.PubKey",encode(e,n=Fr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Fr.BinaryReader?e:new Fr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Ad();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.key=t.bytes();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Ad();return(0,Gr.isSet)(e.key)&&(n.key=(0,Gr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Gr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=Ad();return n.key=e.key??new Uint8Array,n}};function Td(){return{key:new Uint8Array}}gt.PrivKey={typeUrl:"/cosmos.crypto.secp256k1.PrivKey",encode(e,n=Fr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Fr.BinaryReader?e:new Fr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Td();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.key=t.bytes();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Td();return(0,Gr.isSet)(e.key)&&(n.key=(0,Gr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Gr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=Td();return n.key=e.key??new Uint8Array,n}};Object.defineProperty(rt,"__esModule",{value:!0});rt.decodeOptionalPubkey=rt.decodePubkey=rt.anyToSinglePubkey=rt.encodePubkey=void 0;const eo=zn,Tl=ue,bS=Ne,Tu=ht,Nu=ur,wu=gt,Nd=_.any;function rm(e){if((0,eo.isSecp256k1Pubkey)(e)){const n=wu.PubKey.fromPartial({key:(0,Tl.fromBase64)(e.value)});return Nd.Any.fromPartial({typeUrl:"/cosmos.crypto.secp256k1.PubKey",value:Uint8Array.from(wu.PubKey.encode(n).finish())})}else if((0,eo.isEd25519Pubkey)(e)){const n=Tu.PubKey.fromPartial({key:(0,Tl.fromBase64)(e.value)});return Nd.Any.fromPartial({typeUrl:"/cosmos.crypto.ed25519.PubKey",value:Uint8Array.from(Tu.PubKey.encode(n).finish())})}else if((0,eo.isMultisigThresholdPubkey)(e)){const n=Nu.LegacyAminoPubKey.fromPartial({threshold:bS.Uint53.fromString(e.value.threshold).toNumber(),publicKeys:e.value.pubkeys.map(rm)});return Nd.Any.fromPartial({typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",value:Uint8Array.from(Nu.LegacyAminoPubKey.encode(n).finish())})}else throw new Error(`Pubkey type ${e.type} not recognized`)}rt.encodePubkey=rm;function _u(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":{const{key:n}=wu.PubKey.decode(e.value);return(0,eo.encodeSecp256k1Pubkey)(n)}case"/cosmos.crypto.ed25519.PubKey":{const{key:n}=Tu.PubKey.decode(e.value);return(0,eo.encodeEd25519Pubkey)(n)}default:throw new Error(`Pubkey type_url ${e.typeUrl} not recognized as single public key type`)}}rt.anyToSinglePubkey=_u;function im(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":case"/cosmos.crypto.ed25519.PubKey":return _u(e);case"/cosmos.crypto.multisig.LegacyAminoPubKey":{const{threshold:n,publicKeys:t}=Nu.LegacyAminoPubKey.decode(e.value);return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:n.toString(),pubkeys:t.map(_u)}}}default:throw new Error(`Pubkey type URL '${e.typeUrl}' not recognized`)}}rt.decodePubkey=im;function ES(e){if(!e)return null;if(e.typeUrl){if(e.value.length)return im(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}}rt.decodeOptionalPubkey=ES;var Cn={},Ka={},ac={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=e.DenomUnit=e.Supply=e.Output=e.Input=e.SendEnabled=e.Params=e.protobufPackage=void 0;const n=_.coin,t=_.binary,i=_.helpers;e.protobufPackage="cosmos.bank.v1beta1";function o(){return{sendEnabled:[],defaultSendEnabled:!1}}e.Params={typeUrl:"/cosmos.bank.v1beta1.Params",encode(b,p=t.BinaryWriter.create()){for(const S of b.sendEnabled)e.SendEnabled.encode(S,p.uint32(10).fork()).ldelim();return b.defaultSendEnabled===!0&&p.uint32(16).bool(b.defaultSendEnabled),p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=o();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.sendEnabled.push(e.SendEnabled.decode(S,S.uint32()));break;case 2:u.defaultSendEnabled=S.bool();break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=o();return Array.isArray(b==null?void 0:b.sendEnabled)&&(p.sendEnabled=b.sendEnabled.map(S=>e.SendEnabled.fromJSON(S))),(0,i.isSet)(b.defaultSendEnabled)&&(p.defaultSendEnabled=!!b.defaultSendEnabled),p},toJSON(b){const p={};return b.sendEnabled?p.sendEnabled=b.sendEnabled.map(S=>S?e.SendEnabled.toJSON(S):void 0):p.sendEnabled=[],b.defaultSendEnabled!==void 0&&(p.defaultSendEnabled=b.defaultSendEnabled),p},fromPartial(b){var S;const p=o();return p.sendEnabled=((S=b.sendEnabled)==null?void 0:S.map(R=>e.SendEnabled.fromPartial(R)))||[],p.defaultSendEnabled=b.defaultSendEnabled??!1,p}};function g(){return{denom:"",enabled:!1}}e.SendEnabled={typeUrl:"/cosmos.bank.v1beta1.SendEnabled",encode(b,p=t.BinaryWriter.create()){return b.denom!==""&&p.uint32(10).string(b.denom),b.enabled===!0&&p.uint32(16).bool(b.enabled),p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=g();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.denom=S.string();break;case 2:u.enabled=S.bool();break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=g();return(0,i.isSet)(b.denom)&&(p.denom=String(b.denom)),(0,i.isSet)(b.enabled)&&(p.enabled=!!b.enabled),p},toJSON(b){const p={};return b.denom!==void 0&&(p.denom=b.denom),b.enabled!==void 0&&(p.enabled=b.enabled),p},fromPartial(b){const p=g();return p.denom=b.denom??"",p.enabled=b.enabled??!1,p}};function C(){return{address:"",coins:[]}}e.Input={typeUrl:"/cosmos.bank.v1beta1.Input",encode(b,p=t.BinaryWriter.create()){b.address!==""&&p.uint32(10).string(b.address);for(const S of b.coins)n.Coin.encode(S,p.uint32(18).fork()).ldelim();return p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=C();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.address=S.string();break;case 2:u.coins.push(n.Coin.decode(S,S.uint32()));break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=C();return(0,i.isSet)(b.address)&&(p.address=String(b.address)),Array.isArray(b==null?void 0:b.coins)&&(p.coins=b.coins.map(S=>n.Coin.fromJSON(S))),p},toJSON(b){const p={};return b.address!==void 0&&(p.address=b.address),b.coins?p.coins=b.coins.map(S=>S?n.Coin.toJSON(S):void 0):p.coins=[],p},fromPartial(b){var S;const p=C();return p.address=b.address??"",p.coins=((S=b.coins)==null?void 0:S.map(R=>n.Coin.fromPartial(R)))||[],p}};function w(){return{address:"",coins:[]}}e.Output={typeUrl:"/cosmos.bank.v1beta1.Output",encode(b,p=t.BinaryWriter.create()){b.address!==""&&p.uint32(10).string(b.address);for(const S of b.coins)n.Coin.encode(S,p.uint32(18).fork()).ldelim();return p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=w();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.address=S.string();break;case 2:u.coins.push(n.Coin.decode(S,S.uint32()));break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=w();return(0,i.isSet)(b.address)&&(p.address=String(b.address)),Array.isArray(b==null?void 0:b.coins)&&(p.coins=b.coins.map(S=>n.Coin.fromJSON(S))),p},toJSON(b){const p={};return b.address!==void 0&&(p.address=b.address),b.coins?p.coins=b.coins.map(S=>S?n.Coin.toJSON(S):void 0):p.coins=[],p},fromPartial(b){var S;const p=w();return p.address=b.address??"",p.coins=((S=b.coins)==null?void 0:S.map(R=>n.Coin.fromPartial(R)))||[],p}};function E(){return{total:[]}}e.Supply={typeUrl:"/cosmos.bank.v1beta1.Supply",encode(b,p=t.BinaryWriter.create()){for(const S of b.total)n.Coin.encode(S,p.uint32(10).fork()).ldelim();return p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=E();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.total.push(n.Coin.decode(S,S.uint32()));break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=E();return Array.isArray(b==null?void 0:b.total)&&(p.total=b.total.map(S=>n.Coin.fromJSON(S))),p},toJSON(b){const p={};return b.total?p.total=b.total.map(S=>S?n.Coin.toJSON(S):void 0):p.total=[],p},fromPartial(b){var S;const p=E();return p.total=((S=b.total)==null?void 0:S.map(R=>n.Coin.fromPartial(R)))||[],p}};function D(){return{denom:"",exponent:0,aliases:[]}}e.DenomUnit={typeUrl:"/cosmos.bank.v1beta1.DenomUnit",encode(b,p=t.BinaryWriter.create()){b.denom!==""&&p.uint32(10).string(b.denom),b.exponent!==0&&p.uint32(16).uint32(b.exponent);for(const S of b.aliases)p.uint32(26).string(S);return p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=D();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.denom=S.string();break;case 2:u.exponent=S.uint32();break;case 3:u.aliases.push(S.string());break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=D();return(0,i.isSet)(b.denom)&&(p.denom=String(b.denom)),(0,i.isSet)(b.exponent)&&(p.exponent=Number(b.exponent)),Array.isArray(b==null?void 0:b.aliases)&&(p.aliases=b.aliases.map(S=>String(S))),p},toJSON(b){const p={};return b.denom!==void 0&&(p.denom=b.denom),b.exponent!==void 0&&(p.exponent=Math.round(b.exponent)),b.aliases?p.aliases=b.aliases.map(S=>S):p.aliases=[],p},fromPartial(b){var S;const p=D();return p.denom=b.denom??"",p.exponent=b.exponent??0,p.aliases=((S=b.aliases)==null?void 0:S.map(R=>R))||[],p}};function J(){return{description:"",denomUnits:[],base:"",display:"",name:"",symbol:"",uri:"",uriHash:""}}e.Metadata={typeUrl:"/cosmos.bank.v1beta1.Metadata",encode(b,p=t.BinaryWriter.create()){b.description!==""&&p.uint32(10).string(b.description);for(const S of b.denomUnits)e.DenomUnit.encode(S,p.uint32(18).fork()).ldelim();return b.base!==""&&p.uint32(26).string(b.base),b.display!==""&&p.uint32(34).string(b.display),b.name!==""&&p.uint32(42).string(b.name),b.symbol!==""&&p.uint32(50).string(b.symbol),b.uri!==""&&p.uint32(58).string(b.uri),b.uriHash!==""&&p.uint32(66).string(b.uriHash),p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=J();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.description=S.string();break;case 2:u.denomUnits.push(e.DenomUnit.decode(S,S.uint32()));break;case 3:u.base=S.string();break;case 4:u.display=S.string();break;case 5:u.name=S.string();break;case 6:u.symbol=S.string();break;case 7:u.uri=S.string();break;case 8:u.uriHash=S.string();break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=J();return(0,i.isSet)(b.description)&&(p.description=String(b.description)),Array.isArray(b==null?void 0:b.denomUnits)&&(p.denomUnits=b.denomUnits.map(S=>e.DenomUnit.fromJSON(S))),(0,i.isSet)(b.base)&&(p.base=String(b.base)),(0,i.isSet)(b.display)&&(p.display=String(b.display)),(0,i.isSet)(b.name)&&(p.name=String(b.name)),(0,i.isSet)(b.symbol)&&(p.symbol=String(b.symbol)),(0,i.isSet)(b.uri)&&(p.uri=String(b.uri)),(0,i.isSet)(b.uriHash)&&(p.uriHash=String(b.uriHash)),p},toJSON(b){const p={};return b.description!==void 0&&(p.description=b.description),b.denomUnits?p.denomUnits=b.denomUnits.map(S=>S?e.DenomUnit.toJSON(S):void 0):p.denomUnits=[],b.base!==void 0&&(p.base=b.base),b.display!==void 0&&(p.display=b.display),b.name!==void 0&&(p.name=b.name),b.symbol!==void 0&&(p.symbol=b.symbol),b.uri!==void 0&&(p.uri=b.uri),b.uriHash!==void 0&&(p.uriHash=b.uriHash),p},fromPartial(b){var S;const p=J();return p.description=b.description??"",p.denomUnits=((S=b.denomUnits)==null?void 0:S.map(R=>e.DenomUnit.fromPartial(R)))||[],p.base=b.base??"",p.display=b.display??"",p.name=b.name??"",p.symbol=b.symbol??"",p.uri=b.uri??"",p.uriHash=b.uriHash??"",p}}})(ac);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgSetSendEnabledResponse=e.MsgSetSendEnabled=e.MsgUpdateParamsResponse=e.MsgUpdateParams=e.MsgMultiSendResponse=e.MsgMultiSend=e.MsgSendResponse=e.MsgSend=e.protobufPackage=void 0;const n=_.coin,t=ac,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.bank.v1beta1";function g(){return{fromAddress:"",toAddress:"",amount:[]}}e.MsgSend={typeUrl:"/cosmos.bank.v1beta1.MsgSend",encode(R,u=i.BinaryWriter.create()){R.fromAddress!==""&&u.uint32(10).string(R.fromAddress),R.toAddress!==""&&u.uint32(18).string(R.toAddress);for(const c of R.amount)n.Coin.encode(c,u.uint32(26).fork()).ldelim();return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=g();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.fromAddress=c.string();break;case 2:B.toAddress=c.string();break;case 3:B.amount.push(n.Coin.decode(c,c.uint32()));break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=g();return(0,o.isSet)(R.fromAddress)&&(u.fromAddress=String(R.fromAddress)),(0,o.isSet)(R.toAddress)&&(u.toAddress=String(R.toAddress)),Array.isArray(R==null?void 0:R.amount)&&(u.amount=R.amount.map(c=>n.Coin.fromJSON(c))),u},toJSON(R){const u={};return R.fromAddress!==void 0&&(u.fromAddress=R.fromAddress),R.toAddress!==void 0&&(u.toAddress=R.toAddress),R.amount?u.amount=R.amount.map(c=>c?n.Coin.toJSON(c):void 0):u.amount=[],u},fromPartial(R){var c;const u=g();return u.fromAddress=R.fromAddress??"",u.toAddress=R.toAddress??"",u.amount=((c=R.amount)==null?void 0:c.map(y=>n.Coin.fromPartial(y)))||[],u}};function C(){return{}}e.MsgSendResponse={typeUrl:"/cosmos.bank.v1beta1.MsgSendResponse",encode(R,u=i.BinaryWriter.create()){return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=C();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){default:c.skipType(N&7);break}}return B},fromJSON(R){return C()},toJSON(R){return{}},fromPartial(R){return C()}};function w(){return{inputs:[],outputs:[]}}e.MsgMultiSend={typeUrl:"/cosmos.bank.v1beta1.MsgMultiSend",encode(R,u=i.BinaryWriter.create()){for(const c of R.inputs)t.Input.encode(c,u.uint32(10).fork()).ldelim();for(const c of R.outputs)t.Output.encode(c,u.uint32(18).fork()).ldelim();return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=w();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.inputs.push(t.Input.decode(c,c.uint32()));break;case 2:B.outputs.push(t.Output.decode(c,c.uint32()));break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=w();return Array.isArray(R==null?void 0:R.inputs)&&(u.inputs=R.inputs.map(c=>t.Input.fromJSON(c))),Array.isArray(R==null?void 0:R.outputs)&&(u.outputs=R.outputs.map(c=>t.Output.fromJSON(c))),u},toJSON(R){const u={};return R.inputs?u.inputs=R.inputs.map(c=>c?t.Input.toJSON(c):void 0):u.inputs=[],R.outputs?u.outputs=R.outputs.map(c=>c?t.Output.toJSON(c):void 0):u.outputs=[],u},fromPartial(R){var c,y;const u=w();return u.inputs=((c=R.inputs)==null?void 0:c.map(B=>t.Input.fromPartial(B)))||[],u.outputs=((y=R.outputs)==null?void 0:y.map(B=>t.Output.fromPartial(B)))||[],u}};function E(){return{}}e.MsgMultiSendResponse={typeUrl:"/cosmos.bank.v1beta1.MsgMultiSendResponse",encode(R,u=i.BinaryWriter.create()){return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=E();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){default:c.skipType(N&7);break}}return B},fromJSON(R){return E()},toJSON(R){return{}},fromPartial(R){return E()}};function D(){return{authority:"",params:t.Params.fromPartial({})}}e.MsgUpdateParams={typeUrl:"/cosmos.bank.v1beta1.MsgUpdateParams",encode(R,u=i.BinaryWriter.create()){return R.authority!==""&&u.uint32(10).string(R.authority),R.params!==void 0&&t.Params.encode(R.params,u.uint32(18).fork()).ldelim(),u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=D();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.authority=c.string();break;case 2:B.params=t.Params.decode(c,c.uint32());break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=D();return(0,o.isSet)(R.authority)&&(u.authority=String(R.authority)),(0,o.isSet)(R.params)&&(u.params=t.Params.fromJSON(R.params)),u},toJSON(R){const u={};return R.authority!==void 0&&(u.authority=R.authority),R.params!==void 0&&(u.params=R.params?t.Params.toJSON(R.params):void 0),u},fromPartial(R){const u=D();return u.authority=R.authority??"",R.params!==void 0&&R.params!==null&&(u.params=t.Params.fromPartial(R.params)),u}};function J(){return{}}e.MsgUpdateParamsResponse={typeUrl:"/cosmos.bank.v1beta1.MsgUpdateParamsResponse",encode(R,u=i.BinaryWriter.create()){return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=J();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){default:c.skipType(N&7);break}}return B},fromJSON(R){return J()},toJSON(R){return{}},fromPartial(R){return J()}};function b(){return{authority:"",sendEnabled:[],useDefaultFor:[]}}e.MsgSetSendEnabled={typeUrl:"/cosmos.bank.v1beta1.MsgSetSendEnabled",encode(R,u=i.BinaryWriter.create()){R.authority!==""&&u.uint32(10).string(R.authority);for(const c of R.sendEnabled)t.SendEnabled.encode(c,u.uint32(18).fork()).ldelim();for(const c of R.useDefaultFor)u.uint32(26).string(c);return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=b();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.authority=c.string();break;case 2:B.sendEnabled.push(t.SendEnabled.decode(c,c.uint32()));break;case 3:B.useDefaultFor.push(c.string());break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=b();return(0,o.isSet)(R.authority)&&(u.authority=String(R.authority)),Array.isArray(R==null?void 0:R.sendEnabled)&&(u.sendEnabled=R.sendEnabled.map(c=>t.SendEnabled.fromJSON(c))),Array.isArray(R==null?void 0:R.useDefaultFor)&&(u.useDefaultFor=R.useDefaultFor.map(c=>String(c))),u},toJSON(R){const u={};return R.authority!==void 0&&(u.authority=R.authority),R.sendEnabled?u.sendEnabled=R.sendEnabled.map(c=>c?t.SendEnabled.toJSON(c):void 0):u.sendEnabled=[],R.useDefaultFor?u.useDefaultFor=R.useDefaultFor.map(c=>c):u.useDefaultFor=[],u},fromPartial(R){var c,y;const u=b();return u.authority=R.authority??"",u.sendEnabled=((c=R.sendEnabled)==null?void 0:c.map(B=>t.SendEnabled.fromPartial(B)))||[],u.useDefaultFor=((y=R.useDefaultFor)==null?void 0:y.map(B=>B))||[],u}};function p(){return{}}e.MsgSetSendEnabledResponse={typeUrl:"/cosmos.bank.v1beta1.MsgSetSendEnabledResponse",encode(R,u=i.BinaryWriter.create()){return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=p();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){default:c.skipType(N&7);break}}return B},fromJSON(R){return p()},toJSON(R){return{}},fromPartial(R){return p()}};class S{constructor(u){this.rpc=u,this.Send=this.Send.bind(this),this.MultiSend=this.MultiSend.bind(this),this.UpdateParams=this.UpdateParams.bind(this),this.SetSendEnabled=this.SetSendEnabled.bind(this)}Send(u){const c=e.MsgSend.encode(u).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","Send",c).then(B=>e.MsgSendResponse.decode(new i.BinaryReader(B)))}MultiSend(u){const c=e.MsgMultiSend.encode(u).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","MultiSend",c).then(B=>e.MsgMultiSendResponse.decode(new i.BinaryReader(B)))}UpdateParams(u){const c=e.MsgUpdateParams.encode(u).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","UpdateParams",c).then(B=>e.MsgUpdateParamsResponse.decode(new i.BinaryReader(B)))}SetSendEnabled(u){const c=e.MsgSetSendEnabled.encode(u).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","SetSendEnabled",c).then(B=>e.MsgSetSendEnabledResponse.decode(new i.BinaryReader(B)))}}e.MsgClientImpl=S})(Ka);Object.defineProperty(Cn,"__esModule",{value:!0});Cn.Registry=Cn.isTxBodyEncodeObject=Cn.isPbjsGeneratedType=Cn.isTsProtoGeneratedType=Cn.isTelescopeGeneratedType=void 0;const IS=Ka,OS=_.coin,wd=_.tx,AS=_.any;function om(e){const n=e;return typeof n.fromPartial=="function"&&typeof n.typeUrl=="string"}Cn.isTelescopeGeneratedType=om;function sc(e){return typeof e.fromPartial=="function"}Cn.isTsProtoGeneratedType=sc;function TS(e){return!sc(e)}Cn.isPbjsGeneratedType=TS;const Nl={cosmosCoin:"/cosmos.base.v1beta1.Coin",cosmosMsgSend:"/cosmos.bank.v1beta1.MsgSend",cosmosTxBody:"/cosmos.tx.v1beta1.TxBody",googleAny:"/google.protobuf.Any"};function am(e){return e.typeUrl==="/cosmos.tx.v1beta1.TxBody"}Cn.isTxBodyEncodeObject=am;class NS{constructor(n){const{cosmosCoin:t,cosmosMsgSend:i}=Nl;this.types=n?new Map([...n]):new Map([[t,OS.Coin],[i,IS.MsgSend]])}register(n,t){this.types.set(n,t)}lookupType(n){return this.types.get(n)}lookupTypeWithError(n){const t=this.lookupType(n);if(!t)throw new Error(`Unregistered type url: ${n}`);return t}encode(n){const{value:t,typeUrl:i}=n;if(am(n))return this.encodeTxBody(t);const o=this.lookupTypeWithError(i),g=om(o)||sc(o)?o.fromPartial(t):o.create(t);return o.encode(g).finish()}encodeAsAny(n){const t=this.encode(n);return AS.Any.fromPartial({typeUrl:n.typeUrl,value:t})}encodeTxBody(n){var o;const t=n.messages.map(g=>this.encodeAsAny(g)),i=wd.TxBody.fromPartial({...n,timeoutHeight:BigInt(((o=n.timeoutHeight)==null?void 0:o.toString())??"0"),messages:t});return wd.TxBody.encode(i).finish()}decode({typeUrl:n,value:t}){if(n===Nl.cosmosTxBody)return this.decodeTxBody(t);const o=this.lookupTypeWithError(n).decode(t);return Object.entries(o).forEach(([g,C])=>{typeof L.dist.Buffer<"u"&&typeof L.dist.Buffer.isBuffer<"u"&&L.dist.Buffer.isBuffer(C)&&(o[g]=Uint8Array.from(C))}),o}decodeTxBody(n){const t=wd.TxBody.decode(n);return{...t,messages:t.messages.map(({typeUrl:i,value:o})=>{if(!i)throw new Error("Missing type_url in Any");if(!o)throw new Error("Missing value in Any");return this.decode({typeUrl:i,value:o})})}}}Cn.Registry=NS;var xa={};Object.defineProperty(xa,"__esModule",{value:!0});xa.isOfflineDirectSigner=void 0;function wS(e){return e.signDirect!==void 0}xa.isOfflineDirectSigner=wS;(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 n=Ha;Object.defineProperty(e,"decodeTxRaw",{enumerable:!0,get:function(){return n.decodeTxRaw}});var t=jr;Object.defineProperty(e,"DirectSecp256k1HdWallet",{enumerable:!0,get:function(){return t.DirectSecp256k1HdWallet}}),Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return t.extractKdfConfiguration}});var i=La;Object.defineProperty(e,"DirectSecp256k1Wallet",{enumerable:!0,get:function(){return i.DirectSecp256k1Wallet}});var o=$a;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return o.makeCosmoshubPath}});var g=rt;Object.defineProperty(e,"anyToSinglePubkey",{enumerable:!0,get:function(){return g.anyToSinglePubkey}}),Object.defineProperty(e,"decodeOptionalPubkey",{enumerable:!0,get:function(){return g.decodeOptionalPubkey}}),Object.defineProperty(e,"decodePubkey",{enumerable:!0,get:function(){return g.decodePubkey}}),Object.defineProperty(e,"encodePubkey",{enumerable:!0,get:function(){return g.encodePubkey}});var C=Cn;Object.defineProperty(e,"isPbjsGeneratedType",{enumerable:!0,get:function(){return C.isPbjsGeneratedType}}),Object.defineProperty(e,"isTsProtoGeneratedType",{enumerable:!0,get:function(){return C.isTsProtoGeneratedType}}),Object.defineProperty(e,"isTxBodyEncodeObject",{enumerable:!0,get:function(){return C.isTxBodyEncodeObject}}),Object.defineProperty(e,"Registry",{enumerable:!0,get:function(){return C.Registry}});var w=xa;Object.defineProperty(e,"isOfflineDirectSigner",{enumerable:!0,get:function(){return w.isOfflineDirectSigner}});var E=st;Object.defineProperty(e,"makeAuthInfoBytes",{enumerable:!0,get:function(){return E.makeAuthInfoBytes}}),Object.defineProperty(e,"makeSignBytes",{enumerable:!0,get:function(){return E.makeSignBytes}}),Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return E.makeSignDoc}});var D=ic;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return D.executeKdf}});var J=zn;Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return J.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return J.coins}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return J.parseCoins}})})(ut);var vo={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Params=e.ModuleCredential=e.ModuleAccount=e.BaseAccount=e.protobufPackage=void 0;const n=_.any,t=_.binary,i=_.helpers;e.protobufPackage="cosmos.auth.v1beta1";function o(){return{address:"",pubKey:void 0,accountNumber:BigInt(0),sequence:BigInt(0)}}e.BaseAccount={typeUrl:"/cosmos.auth.v1beta1.BaseAccount",encode(E,D=t.BinaryWriter.create()){return E.address!==""&&D.uint32(10).string(E.address),E.pubKey!==void 0&&n.Any.encode(E.pubKey,D.uint32(18).fork()).ldelim(),E.accountNumber!==BigInt(0)&&D.uint32(24).uint64(E.accountNumber),E.sequence!==BigInt(0)&&D.uint32(32).uint64(E.sequence),D},decode(E,D){const J=E instanceof t.BinaryReader?E:new t.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=o();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.address=J.string();break;case 2:p.pubKey=n.Any.decode(J,J.uint32());break;case 3:p.accountNumber=J.uint64();break;case 4:p.sequence=J.uint64();break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=o();return(0,i.isSet)(E.address)&&(D.address=String(E.address)),(0,i.isSet)(E.pubKey)&&(D.pubKey=n.Any.fromJSON(E.pubKey)),(0,i.isSet)(E.accountNumber)&&(D.accountNumber=BigInt(E.accountNumber.toString())),(0,i.isSet)(E.sequence)&&(D.sequence=BigInt(E.sequence.toString())),D},toJSON(E){const D={};return E.address!==void 0&&(D.address=E.address),E.pubKey!==void 0&&(D.pubKey=E.pubKey?n.Any.toJSON(E.pubKey):void 0),E.accountNumber!==void 0&&(D.accountNumber=(E.accountNumber||BigInt(0)).toString()),E.sequence!==void 0&&(D.sequence=(E.sequence||BigInt(0)).toString()),D},fromPartial(E){const D=o();return D.address=E.address??"",E.pubKey!==void 0&&E.pubKey!==null&&(D.pubKey=n.Any.fromPartial(E.pubKey)),E.accountNumber!==void 0&&E.accountNumber!==null&&(D.accountNumber=BigInt(E.accountNumber.toString())),E.sequence!==void 0&&E.sequence!==null&&(D.sequence=BigInt(E.sequence.toString())),D}};function g(){return{baseAccount:void 0,name:"",permissions:[]}}e.ModuleAccount={typeUrl:"/cosmos.auth.v1beta1.ModuleAccount",encode(E,D=t.BinaryWriter.create()){E.baseAccount!==void 0&&e.BaseAccount.encode(E.baseAccount,D.uint32(10).fork()).ldelim(),E.name!==""&&D.uint32(18).string(E.name);for(const J of E.permissions)D.uint32(26).string(J);return D},decode(E,D){const J=E instanceof t.BinaryReader?E:new t.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=g();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.baseAccount=e.BaseAccount.decode(J,J.uint32());break;case 2:p.name=J.string();break;case 3:p.permissions.push(J.string());break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=g();return(0,i.isSet)(E.baseAccount)&&(D.baseAccount=e.BaseAccount.fromJSON(E.baseAccount)),(0,i.isSet)(E.name)&&(D.name=String(E.name)),Array.isArray(E==null?void 0:E.permissions)&&(D.permissions=E.permissions.map(J=>String(J))),D},toJSON(E){const D={};return E.baseAccount!==void 0&&(D.baseAccount=E.baseAccount?e.BaseAccount.toJSON(E.baseAccount):void 0),E.name!==void 0&&(D.name=E.name),E.permissions?D.permissions=E.permissions.map(J=>J):D.permissions=[],D},fromPartial(E){var J;const D=g();return E.baseAccount!==void 0&&E.baseAccount!==null&&(D.baseAccount=e.BaseAccount.fromPartial(E.baseAccount)),D.name=E.name??"",D.permissions=((J=E.permissions)==null?void 0:J.map(b=>b))||[],D}};function C(){return{moduleName:"",derivationKeys:[]}}e.ModuleCredential={typeUrl:"/cosmos.auth.v1beta1.ModuleCredential",encode(E,D=t.BinaryWriter.create()){E.moduleName!==""&&D.uint32(10).string(E.moduleName);for(const J of E.derivationKeys)D.uint32(18).bytes(J);return D},decode(E,D){const J=E instanceof t.BinaryReader?E:new t.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=C();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.moduleName=J.string();break;case 2:p.derivationKeys.push(J.bytes());break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=C();return(0,i.isSet)(E.moduleName)&&(D.moduleName=String(E.moduleName)),Array.isArray(E==null?void 0:E.derivationKeys)&&(D.derivationKeys=E.derivationKeys.map(J=>(0,i.bytesFromBase64)(J))),D},toJSON(E){const D={};return E.moduleName!==void 0&&(D.moduleName=E.moduleName),E.derivationKeys?D.derivationKeys=E.derivationKeys.map(J=>(0,i.base64FromBytes)(J!==void 0?J:new Uint8Array)):D.derivationKeys=[],D},fromPartial(E){var J;const D=C();return D.moduleName=E.moduleName??"",D.derivationKeys=((J=E.derivationKeys)==null?void 0:J.map(b=>b))||[],D}};function w(){return{maxMemoCharacters:BigInt(0),txSigLimit:BigInt(0),txSizeCostPerByte:BigInt(0),sigVerifyCostEd25519:BigInt(0),sigVerifyCostSecp256k1:BigInt(0)}}e.Params={typeUrl:"/cosmos.auth.v1beta1.Params",encode(E,D=t.BinaryWriter.create()){return E.maxMemoCharacters!==BigInt(0)&&D.uint32(8).uint64(E.maxMemoCharacters),E.txSigLimit!==BigInt(0)&&D.uint32(16).uint64(E.txSigLimit),E.txSizeCostPerByte!==BigInt(0)&&D.uint32(24).uint64(E.txSizeCostPerByte),E.sigVerifyCostEd25519!==BigInt(0)&&D.uint32(32).uint64(E.sigVerifyCostEd25519),E.sigVerifyCostSecp256k1!==BigInt(0)&&D.uint32(40).uint64(E.sigVerifyCostSecp256k1),D},decode(E,D){const J=E instanceof t.BinaryReader?E:new t.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=w();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.maxMemoCharacters=J.uint64();break;case 2:p.txSigLimit=J.uint64();break;case 3:p.txSizeCostPerByte=J.uint64();break;case 4:p.sigVerifyCostEd25519=J.uint64();break;case 5:p.sigVerifyCostSecp256k1=J.uint64();break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=w();return(0,i.isSet)(E.maxMemoCharacters)&&(D.maxMemoCharacters=BigInt(E.maxMemoCharacters.toString())),(0,i.isSet)(E.txSigLimit)&&(D.txSigLimit=BigInt(E.txSigLimit.toString())),(0,i.isSet)(E.txSizeCostPerByte)&&(D.txSizeCostPerByte=BigInt(E.txSizeCostPerByte.toString())),(0,i.isSet)(E.sigVerifyCostEd25519)&&(D.sigVerifyCostEd25519=BigInt(E.sigVerifyCostEd25519.toString())),(0,i.isSet)(E.sigVerifyCostSecp256k1)&&(D.sigVerifyCostSecp256k1=BigInt(E.sigVerifyCostSecp256k1.toString())),D},toJSON(E){const D={};return E.maxMemoCharacters!==void 0&&(D.maxMemoCharacters=(E.maxMemoCharacters||BigInt(0)).toString()),E.txSigLimit!==void 0&&(D.txSigLimit=(E.txSigLimit||BigInt(0)).toString()),E.txSizeCostPerByte!==void 0&&(D.txSizeCostPerByte=(E.txSizeCostPerByte||BigInt(0)).toString()),E.sigVerifyCostEd25519!==void 0&&(D.sigVerifyCostEd25519=(E.sigVerifyCostEd25519||BigInt(0)).toString()),E.sigVerifyCostSecp256k1!==void 0&&(D.sigVerifyCostSecp256k1=(E.sigVerifyCostSecp256k1||BigInt(0)).toString()),D},fromPartial(E){const D=w();return E.maxMemoCharacters!==void 0&&E.maxMemoCharacters!==null&&(D.maxMemoCharacters=BigInt(E.maxMemoCharacters.toString())),E.txSigLimit!==void 0&&E.txSigLimit!==null&&(D.txSigLimit=BigInt(E.txSigLimit.toString())),E.txSizeCostPerByte!==void 0&&E.txSizeCostPerByte!==null&&(D.txSizeCostPerByte=BigInt(E.txSizeCostPerByte.toString())),E.sigVerifyCostEd25519!==void 0&&E.sigVerifyCostEd25519!==null&&(D.sigVerifyCostEd25519=BigInt(E.sigVerifyCostEd25519.toString())),E.sigVerifyCostSecp256k1!==void 0&&E.sigVerifyCostSecp256k1!==null&&(D.sigVerifyCostSecp256k1=BigInt(E.sigVerifyCostSecp256k1.toString())),D}}})(vo);var za={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PermanentLockedAccount=e.PeriodicVestingAccount=e.Period=e.DelayedVestingAccount=e.ContinuousVestingAccount=e.BaseVestingAccount=e.protobufPackage=void 0;const n=vo,t=_.coin,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.vesting.v1beta1";function g(){return{baseAccount:void 0,originalVesting:[],delegatedFree:[],delegatedVesting:[],endTime:BigInt(0)}}e.BaseVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.BaseVestingAccount",encode(b,p=i.BinaryWriter.create()){b.baseAccount!==void 0&&n.BaseAccount.encode(b.baseAccount,p.uint32(10).fork()).ldelim();for(const S of b.originalVesting)t.Coin.encode(S,p.uint32(18).fork()).ldelim();for(const S of b.delegatedFree)t.Coin.encode(S,p.uint32(26).fork()).ldelim();for(const S of b.delegatedVesting)t.Coin.encode(S,p.uint32(34).fork()).ldelim();return b.endTime!==BigInt(0)&&p.uint32(40).int64(b.endTime),p},decode(b,p){const S=b instanceof i.BinaryReader?b:new i.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=g();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.baseAccount=n.BaseAccount.decode(S,S.uint32());break;case 2:u.originalVesting.push(t.Coin.decode(S,S.uint32()));break;case 3:u.delegatedFree.push(t.Coin.decode(S,S.uint32()));break;case 4:u.delegatedVesting.push(t.Coin.decode(S,S.uint32()));break;case 5:u.endTime=S.int64();break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=g();return(0,o.isSet)(b.baseAccount)&&(p.baseAccount=n.BaseAccount.fromJSON(b.baseAccount)),Array.isArray(b==null?void 0:b.originalVesting)&&(p.originalVesting=b.originalVesting.map(S=>t.Coin.fromJSON(S))),Array.isArray(b==null?void 0:b.delegatedFree)&&(p.delegatedFree=b.delegatedFree.map(S=>t.Coin.fromJSON(S))),Array.isArray(b==null?void 0:b.delegatedVesting)&&(p.delegatedVesting=b.delegatedVesting.map(S=>t.Coin.fromJSON(S))),(0,o.isSet)(b.endTime)&&(p.endTime=BigInt(b.endTime.toString())),p},toJSON(b){const p={};return b.baseAccount!==void 0&&(p.baseAccount=b.baseAccount?n.BaseAccount.toJSON(b.baseAccount):void 0),b.originalVesting?p.originalVesting=b.originalVesting.map(S=>S?t.Coin.toJSON(S):void 0):p.originalVesting=[],b.delegatedFree?p.delegatedFree=b.delegatedFree.map(S=>S?t.Coin.toJSON(S):void 0):p.delegatedFree=[],b.delegatedVesting?p.delegatedVesting=b.delegatedVesting.map(S=>S?t.Coin.toJSON(S):void 0):p.delegatedVesting=[],b.endTime!==void 0&&(p.endTime=(b.endTime||BigInt(0)).toString()),p},fromPartial(b){var S,R,u;const p=g();return b.baseAccount!==void 0&&b.baseAccount!==null&&(p.baseAccount=n.BaseAccount.fromPartial(b.baseAccount)),p.originalVesting=((S=b.originalVesting)==null?void 0:S.map(c=>t.Coin.fromPartial(c)))||[],p.delegatedFree=((R=b.delegatedFree)==null?void 0:R.map(c=>t.Coin.fromPartial(c)))||[],p.delegatedVesting=((u=b.delegatedVesting)==null?void 0:u.map(c=>t.Coin.fromPartial(c)))||[],b.endTime!==void 0&&b.endTime!==null&&(p.endTime=BigInt(b.endTime.toString())),p}};function C(){return{baseVestingAccount:void 0,startTime:BigInt(0)}}e.ContinuousVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.ContinuousVestingAccount",encode(b,p=i.BinaryWriter.create()){return b.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(b.baseVestingAccount,p.uint32(10).fork()).ldelim(),b.startTime!==BigInt(0)&&p.uint32(16).int64(b.startTime),p},decode(b,p){const S=b instanceof i.BinaryReader?b:new i.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=C();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.baseVestingAccount=e.BaseVestingAccount.decode(S,S.uint32());break;case 2:u.startTime=S.int64();break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=C();return(0,o.isSet)(b.baseVestingAccount)&&(p.baseVestingAccount=e.BaseVestingAccount.fromJSON(b.baseVestingAccount)),(0,o.isSet)(b.startTime)&&(p.startTime=BigInt(b.startTime.toString())),p},toJSON(b){const p={};return b.baseVestingAccount!==void 0&&(p.baseVestingAccount=b.baseVestingAccount?e.BaseVestingAccount.toJSON(b.baseVestingAccount):void 0),b.startTime!==void 0&&(p.startTime=(b.startTime||BigInt(0)).toString()),p},fromPartial(b){const p=C();return b.baseVestingAccount!==void 0&&b.baseVestingAccount!==null&&(p.baseVestingAccount=e.BaseVestingAccount.fromPartial(b.baseVestingAccount)),b.startTime!==void 0&&b.startTime!==null&&(p.startTime=BigInt(b.startTime.toString())),p}};function w(){return{baseVestingAccount:void 0}}e.DelayedVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.DelayedVestingAccount",encode(b,p=i.BinaryWriter.create()){return b.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(b.baseVestingAccount,p.uint32(10).fork()).ldelim(),p},decode(b,p){const S=b instanceof i.BinaryReader?b:new i.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=w();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.baseVestingAccount=e.BaseVestingAccount.decode(S,S.uint32());break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=w();return(0,o.isSet)(b.baseVestingAccount)&&(p.baseVestingAccount=e.BaseVestingAccount.fromJSON(b.baseVestingAccount)),p},toJSON(b){const p={};return b.baseVestingAccount!==void 0&&(p.baseVestingAccount=b.baseVestingAccount?e.BaseVestingAccount.toJSON(b.baseVestingAccount):void 0),p},fromPartial(b){const p=w();return b.baseVestingAccount!==void 0&&b.baseVestingAccount!==null&&(p.baseVestingAccount=e.BaseVestingAccount.fromPartial(b.baseVestingAccount)),p}};function E(){return{length:BigInt(0),amount:[]}}e.Period={typeUrl:"/cosmos.vesting.v1beta1.Period",encode(b,p=i.BinaryWriter.create()){b.length!==BigInt(0)&&p.uint32(8).int64(b.length);for(const S of b.amount)t.Coin.encode(S,p.uint32(18).fork()).ldelim();return p},decode(b,p){const S=b instanceof i.BinaryReader?b:new i.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=E();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.length=S.int64();break;case 2:u.amount.push(t.Coin.decode(S,S.uint32()));break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=E();return(0,o.isSet)(b.length)&&(p.length=BigInt(b.length.toString())),Array.isArray(b==null?void 0:b.amount)&&(p.amount=b.amount.map(S=>t.Coin.fromJSON(S))),p},toJSON(b){const p={};return b.length!==void 0&&(p.length=(b.length||BigInt(0)).toString()),b.amount?p.amount=b.amount.map(S=>S?t.Coin.toJSON(S):void 0):p.amount=[],p},fromPartial(b){var S;const p=E();return b.length!==void 0&&b.length!==null&&(p.length=BigInt(b.length.toString())),p.amount=((S=b.amount)==null?void 0:S.map(R=>t.Coin.fromPartial(R)))||[],p}};function D(){return{baseVestingAccount:void 0,startTime:BigInt(0),vestingPeriods:[]}}e.PeriodicVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.PeriodicVestingAccount",encode(b,p=i.BinaryWriter.create()){b.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(b.baseVestingAccount,p.uint32(10).fork()).ldelim(),b.startTime!==BigInt(0)&&p.uint32(16).int64(b.startTime);for(const S of b.vestingPeriods)e.Period.encode(S,p.uint32(26).fork()).ldelim();return p},decode(b,p){const S=b instanceof i.BinaryReader?b:new i.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=D();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.baseVestingAccount=e.BaseVestingAccount.decode(S,S.uint32());break;case 2:u.startTime=S.int64();break;case 3:u.vestingPeriods.push(e.Period.decode(S,S.uint32()));break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=D();return(0,o.isSet)(b.baseVestingAccount)&&(p.baseVestingAccount=e.BaseVestingAccount.fromJSON(b.baseVestingAccount)),(0,o.isSet)(b.startTime)&&(p.startTime=BigInt(b.startTime.toString())),Array.isArray(b==null?void 0:b.vestingPeriods)&&(p.vestingPeriods=b.vestingPeriods.map(S=>e.Period.fromJSON(S))),p},toJSON(b){const p={};return b.baseVestingAccount!==void 0&&(p.baseVestingAccount=b.baseVestingAccount?e.BaseVestingAccount.toJSON(b.baseVestingAccount):void 0),b.startTime!==void 0&&(p.startTime=(b.startTime||BigInt(0)).toString()),b.vestingPeriods?p.vestingPeriods=b.vestingPeriods.map(S=>S?e.Period.toJSON(S):void 0):p.vestingPeriods=[],p},fromPartial(b){var S;const p=D();return b.baseVestingAccount!==void 0&&b.baseVestingAccount!==null&&(p.baseVestingAccount=e.BaseVestingAccount.fromPartial(b.baseVestingAccount)),b.startTime!==void 0&&b.startTime!==null&&(p.startTime=BigInt(b.startTime.toString())),p.vestingPeriods=((S=b.vestingPeriods)==null?void 0:S.map(R=>e.Period.fromPartial(R)))||[],p}};function J(){return{baseVestingAccount:void 0}}e.PermanentLockedAccount={typeUrl:"/cosmos.vesting.v1beta1.PermanentLockedAccount",encode(b,p=i.BinaryWriter.create()){return b.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(b.baseVestingAccount,p.uint32(10).fork()).ldelim(),p},decode(b,p){const S=b instanceof i.BinaryReader?b:new i.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=J();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.baseVestingAccount=e.BaseVestingAccount.decode(S,S.uint32());break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=J();return(0,o.isSet)(b.baseVestingAccount)&&(p.baseVestingAccount=e.BaseVestingAccount.fromJSON(b.baseVestingAccount)),p},toJSON(b){const p={};return b.baseVestingAccount!==void 0&&(p.baseVestingAccount=b.baseVestingAccount?e.BaseVestingAccount.toJSON(b.baseVestingAccount):void 0),p},fromPartial(b){const p=J();return b.baseVestingAccount!==void 0&&b.baseVestingAccount!==null&&(p.baseVestingAccount=e.BaseVestingAccount.fromPartial(b.baseVestingAccount)),p}}})(za);Object.defineProperty(yo,"__esModule",{value:!0});yo.accountFromAny=void 0;const _S=Ne,MS=ut,Qi=Ie,wl=vo,Lo=za;function _l(e){return _S.Uint64.fromString(e.toString())}function Cr(e){const{address:n,pubKey:t,accountNumber:i,sequence:o}=e,g=(0,MS.decodeOptionalPubkey)(t);return{address:n,pubkey:g,accountNumber:_l(i).toNumber(),sequence:_l(o).toNumber()}}function US(e){var i,o,g,C,w,E,D;const{typeUrl:n,value:t}=e;switch(n){case"/cosmos.auth.v1beta1.BaseAccount":return Cr(wl.BaseAccount.decode(t));case"/cosmos.auth.v1beta1.ModuleAccount":{const J=wl.ModuleAccount.decode(t).baseAccount;return(0,Qi.assert)(J),Cr(J)}case"/cosmos.vesting.v1beta1.BaseVestingAccount":{const J=(i=Lo.BaseVestingAccount.decode(t))==null?void 0:i.baseAccount;return(0,Qi.assert)(J),Cr(J)}case"/cosmos.vesting.v1beta1.ContinuousVestingAccount":{const J=(g=(o=Lo.ContinuousVestingAccount.decode(t))==null?void 0:o.baseVestingAccount)==null?void 0:g.baseAccount;return(0,Qi.assert)(J),Cr(J)}case"/cosmos.vesting.v1beta1.DelayedVestingAccount":{const J=(w=(C=Lo.DelayedVestingAccount.decode(t))==null?void 0:C.baseVestingAccount)==null?void 0:w.baseAccount;return(0,Qi.assert)(J),Cr(J)}case"/cosmos.vesting.v1beta1.PeriodicVestingAccount":{const J=(D=(E=Lo.PeriodicVestingAccount.decode(t))==null?void 0:E.baseVestingAccount)==null?void 0:D.baseAccount;return(0,Qi.assert)(J),Cr(J)}default:throw new Error(`Unsupported type: '${n}'`)}}yo.accountFromAny=US;var Co={};Object.defineProperty(Co,"__esModule",{value:!0});Co.AminoTypes=void 0;class DS{constructor(n){this.register=n}toAmino({typeUrl:n,value:t}){const i=this.register[n];if(!i)throw new Error(`Type URL '${n}' 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:i.aminoType,value:i.toAmino(t)}}fromAmino({type:n,value:t}){const i=Object.entries(this.register).filter(([o,{aminoType:g}])=>g===n);switch(i.length){case 0:throw new Error(`Amino type identifier '${n}' 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,g]=i[0];return{typeUrl:o,value:g.fromAmino(t)}}default:throw new Error(`Multiple types are registered with Amino type identifier '${n}': '`+i.map(([o,g])=>o).sort().join("', '")+"'. Thus fromAmino cannot be performed.")}}}Co.AminoTypes=DS;var Ro={};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.fromTendermintEvent=void 0;const Ml=ue;function JS(e){return{type:e.type,attributes:e.attributes.map(n=>({key:typeof n.key=="string"?n.key:(0,Ml.fromUtf8)(n.key,!0),value:typeof n.value=="string"?n.value:(0,Ml.fromUtf8)(n.value,!0)}))}}Ro.fromTendermintEvent=JS;var cr={};Object.defineProperty(cr,"__esModule",{value:!0});cr.calculateFee=cr.GasPrice=void 0;const sm=Ne,HS=ut;function qS(e){if(e.length<3||e.length>128)throw new Error("Denom must be between 3 and 128 characters")}class Ya{constructor(n,t){this.amount=n,this.denom=t}static fromString(n){const t=n.match(/^([0-9.]+)([a-zA-Z][a-zA-Z0-9/:._-]*)$/);if(!t)throw new Error("Invalid gas price string");const[i,o,g]=t;qS(g);const w=sm.Decimal.fromUserInput(o,18);return new Ya(w,g)}toString(){return this.amount.toString()+this.denom}}cr.GasPrice=Ya;function VS(e,n){const t=typeof n=="string"?Ya.fromString(n):n,{denom:i,amount:o}=t,g=o.multiply(new sm.Uint53(e)).ceil().toString();return{amount:(0,HS.coins)(g,i),gas:e.toString()}}cr.calculateFee=VS;var rn={};Object.defineProperty(rn,"__esModule",{value:!0});rn.findAttribute=rn.parseRawLog=rn.parseLogs=rn.parseLog=rn.parseEvent=rn.parseAttribute=void 0;const dc=Ie;function dm(e){if(!(0,dc.isNonNullObject)(e))throw new Error("Attribute must be a non-null object");const{key:n,value:t}=e;if(typeof n!="string"||!n)throw new Error("Attribute's key must be a non-empty string");if(typeof t!="string"&&typeof t<"u")throw new Error("Attribute's value must be a string or unset");return{key:n,value:t||""}}rn.parseAttribute=dm;function um(e){if(!(0,dc.isNonNullObject)(e))throw new Error("Event must be a non-null object");const{type:n,attributes:t}=e;if(typeof n!="string"||n==="")throw new Error("Event type must be a non-empty string");if(!Array.isArray(t))throw new Error("Event's attributes must be an array");return{type:n,attributes:t.map(dm)}}rn.parseEvent=um;function cm(e){if(!(0,dc.isNonNullObject)(e))throw new Error("Log must be a non-null object");const{msg_index:n,log:t,events:i}=e;if(typeof n!="number")throw new Error("Log's msg_index must be a number");if(typeof t!="string")throw new Error("Log's log must be a string");if(!Array.isArray(i))throw new Error("Log's events must be an array");return{msg_index:n,log:t,events:i.map(um)}}rn.parseLog=cm;function lm(e){if(!Array.isArray(e))throw new Error("Logs must be an array");return e.map(cm)}rn.parseLogs=lm;function WS(e){if(!e)return[];const n=JSON.parse(e).map(({events:t},i)=>({msg_index:i,events:t,log:""}));return lm(n)}rn.parseRawLog=WS;function QS(e,n,t){var g;const i=e.find(()=>!0),o=(g=i==null?void 0:i.events.find(C=>C.type===n))==null?void 0:g.attributes.find(C=>C.key===t);if(!o)throw new Error(`Could not find attribute '${t}' in first event of type '${n}' in first log.`);return o}rn.findAttribute=QS;var co={},Za={},uc={},Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.PageResponse=Be.PageRequest=Be.protobufPackage=void 0;const Lr=_.binary,Vn=_.helpers;Be.protobufPackage="cosmos.base.query.v1beta1";function _d(){return{key:new Uint8Array,offset:BigInt(0),limit:BigInt(0),countTotal:!1,reverse:!1}}Be.PageRequest={typeUrl:"/cosmos.base.query.v1beta1.PageRequest",encode(e,n=Lr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),e.offset!==BigInt(0)&&n.uint32(16).uint64(e.offset),e.limit!==BigInt(0)&&n.uint32(24).uint64(e.limit),e.countTotal===!0&&n.uint32(32).bool(e.countTotal),e.reverse===!0&&n.uint32(40).bool(e.reverse),n},decode(e,n){const t=e instanceof Lr.BinaryReader?e:new Lr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=_d();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.key=t.bytes();break;case 2:o.offset=t.uint64();break;case 3:o.limit=t.uint64();break;case 4:o.countTotal=t.bool();break;case 5:o.reverse=t.bool();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=_d();return(0,Vn.isSet)(e.key)&&(n.key=(0,Vn.bytesFromBase64)(e.key)),(0,Vn.isSet)(e.offset)&&(n.offset=BigInt(e.offset.toString())),(0,Vn.isSet)(e.limit)&&(n.limit=BigInt(e.limit.toString())),(0,Vn.isSet)(e.countTotal)&&(n.countTotal=!!e.countTotal),(0,Vn.isSet)(e.reverse)&&(n.reverse=!!e.reverse),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Vn.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),e.offset!==void 0&&(n.offset=(e.offset||BigInt(0)).toString()),e.limit!==void 0&&(n.limit=(e.limit||BigInt(0)).toString()),e.countTotal!==void 0&&(n.countTotal=e.countTotal),e.reverse!==void 0&&(n.reverse=e.reverse),n},fromPartial(e){const n=_d();return n.key=e.key??new Uint8Array,e.offset!==void 0&&e.offset!==null&&(n.offset=BigInt(e.offset.toString())),e.limit!==void 0&&e.limit!==null&&(n.limit=BigInt(e.limit.toString())),n.countTotal=e.countTotal??!1,n.reverse=e.reverse??!1,n}};function Md(){return{nextKey:new Uint8Array,total:BigInt(0)}}Be.PageResponse={typeUrl:"/cosmos.base.query.v1beta1.PageResponse",encode(e,n=Lr.BinaryWriter.create()){return e.nextKey.length!==0&&n.uint32(10).bytes(e.nextKey),e.total!==BigInt(0)&&n.uint32(16).uint64(e.total),n},decode(e,n){const t=e instanceof Lr.BinaryReader?e:new Lr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Md();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.nextKey=t.bytes();break;case 2:o.total=t.uint64();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Md();return(0,Vn.isSet)(e.nextKey)&&(n.nextKey=(0,Vn.bytesFromBase64)(e.nextKey)),(0,Vn.isSet)(e.total)&&(n.total=BigInt(e.total.toString())),n},toJSON(e){const n={};return e.nextKey!==void 0&&(n.nextKey=(0,Vn.base64FromBytes)(e.nextKey!==void 0?e.nextKey:new Uint8Array)),e.total!==void 0&&(n.total=(e.total||BigInt(0)).toString()),n},fromPartial(e){const n=Md();return n.nextKey=e.nextKey??new Uint8Array,e.total!==void 0&&e.total!==null&&(n.total=BigInt(e.total.toString())),n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryAccountInfoResponse=e.QueryAccountInfoRequest=e.QueryAccountAddressByIDResponse=e.QueryAccountAddressByIDRequest=e.AddressStringToBytesResponse=e.AddressStringToBytesRequest=e.AddressBytesToStringResponse=e.AddressBytesToStringRequest=e.Bech32PrefixResponse=e.Bech32PrefixRequest=e.QueryModuleAccountByNameResponse=e.QueryModuleAccountByNameRequest=e.QueryModuleAccountsResponse=e.QueryModuleAccountsRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.QueryAccountResponse=e.QueryAccountRequest=e.QueryAccountsResponse=e.QueryAccountsRequest=e.protobufPackage=void 0;const n=Be,t=_.any,i=vo,o=_.binary,g=_.helpers;e.protobufPackage="cosmos.auth.v1beta1";function C(){return{pagination:void 0}}e.QueryAccountsRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountsRequest",encode(l,M=o.BinaryWriter.create()){return l.pagination!==void 0&&n.PageRequest.encode(l.pagination,M.uint32(10).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=C();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.pagination=n.PageRequest.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=C();return(0,g.isSet)(l.pagination)&&(M.pagination=n.PageRequest.fromJSON(l.pagination)),M},toJSON(l){const M={};return l.pagination!==void 0&&(M.pagination=l.pagination?n.PageRequest.toJSON(l.pagination):void 0),M},fromPartial(l){const M=C();return l.pagination!==void 0&&l.pagination!==null&&(M.pagination=n.PageRequest.fromPartial(l.pagination)),M}};function w(){return{accounts:[],pagination:void 0}}e.QueryAccountsResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountsResponse",encode(l,M=o.BinaryWriter.create()){for(const m of l.accounts)t.Any.encode(m,M.uint32(10).fork()).ldelim();return l.pagination!==void 0&&n.PageResponse.encode(l.pagination,M.uint32(18).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=w();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.accounts.push(t.Any.decode(m,m.uint32()));break;case 2:T.pagination=n.PageResponse.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=w();return Array.isArray(l==null?void 0:l.accounts)&&(M.accounts=l.accounts.map(m=>t.Any.fromJSON(m))),(0,g.isSet)(l.pagination)&&(M.pagination=n.PageResponse.fromJSON(l.pagination)),M},toJSON(l){const M={};return l.accounts?M.accounts=l.accounts.map(m=>m?t.Any.toJSON(m):void 0):M.accounts=[],l.pagination!==void 0&&(M.pagination=l.pagination?n.PageResponse.toJSON(l.pagination):void 0),M},fromPartial(l){var m;const M=w();return M.accounts=((m=l.accounts)==null?void 0:m.map(h=>t.Any.fromPartial(h)))||[],l.pagination!==void 0&&l.pagination!==null&&(M.pagination=n.PageResponse.fromPartial(l.pagination)),M}};function E(){return{address:""}}e.QueryAccountRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountRequest",encode(l,M=o.BinaryWriter.create()){return l.address!==""&&M.uint32(10).string(l.address),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=E();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.address=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=E();return(0,g.isSet)(l.address)&&(M.address=String(l.address)),M},toJSON(l){const M={};return l.address!==void 0&&(M.address=l.address),M},fromPartial(l){const M=E();return M.address=l.address??"",M}};function D(){return{account:void 0}}e.QueryAccountResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountResponse",encode(l,M=o.BinaryWriter.create()){return l.account!==void 0&&t.Any.encode(l.account,M.uint32(10).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=D();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.account=t.Any.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=D();return(0,g.isSet)(l.account)&&(M.account=t.Any.fromJSON(l.account)),M},toJSON(l){const M={};return l.account!==void 0&&(M.account=l.account?t.Any.toJSON(l.account):void 0),M},fromPartial(l){const M=D();return l.account!==void 0&&l.account!==null&&(M.account=t.Any.fromPartial(l.account)),M}};function J(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.auth.v1beta1.QueryParamsRequest",encode(l,M=o.BinaryWriter.create()){return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=J();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){default:m.skipType(Q&7);break}}return T},fromJSON(l){return J()},toJSON(l){return{}},fromPartial(l){return J()}};function b(){return{params:i.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.auth.v1beta1.QueryParamsResponse",encode(l,M=o.BinaryWriter.create()){return l.params!==void 0&&i.Params.encode(l.params,M.uint32(10).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=b();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.params=i.Params.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=b();return(0,g.isSet)(l.params)&&(M.params=i.Params.fromJSON(l.params)),M},toJSON(l){const M={};return l.params!==void 0&&(M.params=l.params?i.Params.toJSON(l.params):void 0),M},fromPartial(l){const M=b();return l.params!==void 0&&l.params!==null&&(M.params=i.Params.fromPartial(l.params)),M}};function p(){return{}}e.QueryModuleAccountsRequest={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountsRequest",encode(l,M=o.BinaryWriter.create()){return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=p();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){default:m.skipType(Q&7);break}}return T},fromJSON(l){return p()},toJSON(l){return{}},fromPartial(l){return p()}};function S(){return{accounts:[]}}e.QueryModuleAccountsResponse={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountsResponse",encode(l,M=o.BinaryWriter.create()){for(const m of l.accounts)t.Any.encode(m,M.uint32(10).fork()).ldelim();return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=S();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.accounts.push(t.Any.decode(m,m.uint32()));break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=S();return Array.isArray(l==null?void 0:l.accounts)&&(M.accounts=l.accounts.map(m=>t.Any.fromJSON(m))),M},toJSON(l){const M={};return l.accounts?M.accounts=l.accounts.map(m=>m?t.Any.toJSON(m):void 0):M.accounts=[],M},fromPartial(l){var m;const M=S();return M.accounts=((m=l.accounts)==null?void 0:m.map(h=>t.Any.fromPartial(h)))||[],M}};function R(){return{name:""}}e.QueryModuleAccountByNameRequest={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest",encode(l,M=o.BinaryWriter.create()){return l.name!==""&&M.uint32(10).string(l.name),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=R();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.name=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=R();return(0,g.isSet)(l.name)&&(M.name=String(l.name)),M},toJSON(l){const M={};return l.name!==void 0&&(M.name=l.name),M},fromPartial(l){const M=R();return M.name=l.name??"",M}};function u(){return{account:void 0}}e.QueryModuleAccountByNameResponse={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse",encode(l,M=o.BinaryWriter.create()){return l.account!==void 0&&t.Any.encode(l.account,M.uint32(10).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=u();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.account=t.Any.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=u();return(0,g.isSet)(l.account)&&(M.account=t.Any.fromJSON(l.account)),M},toJSON(l){const M={};return l.account!==void 0&&(M.account=l.account?t.Any.toJSON(l.account):void 0),M},fromPartial(l){const M=u();return l.account!==void 0&&l.account!==null&&(M.account=t.Any.fromPartial(l.account)),M}};function c(){return{}}e.Bech32PrefixRequest={typeUrl:"/cosmos.auth.v1beta1.Bech32PrefixRequest",encode(l,M=o.BinaryWriter.create()){return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=c();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){default:m.skipType(Q&7);break}}return T},fromJSON(l){return c()},toJSON(l){return{}},fromPartial(l){return c()}};function y(){return{bech32Prefix:""}}e.Bech32PrefixResponse={typeUrl:"/cosmos.auth.v1beta1.Bech32PrefixResponse",encode(l,M=o.BinaryWriter.create()){return l.bech32Prefix!==""&&M.uint32(10).string(l.bech32Prefix),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=y();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.bech32Prefix=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=y();return(0,g.isSet)(l.bech32Prefix)&&(M.bech32Prefix=String(l.bech32Prefix)),M},toJSON(l){const M={};return l.bech32Prefix!==void 0&&(M.bech32Prefix=l.bech32Prefix),M},fromPartial(l){const M=y();return M.bech32Prefix=l.bech32Prefix??"",M}};function B(){return{addressBytes:new Uint8Array}}e.AddressBytesToStringRequest={typeUrl:"/cosmos.auth.v1beta1.AddressBytesToStringRequest",encode(l,M=o.BinaryWriter.create()){return l.addressBytes.length!==0&&M.uint32(10).bytes(l.addressBytes),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=B();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.addressBytes=m.bytes();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=B();return(0,g.isSet)(l.addressBytes)&&(M.addressBytes=(0,g.bytesFromBase64)(l.addressBytes)),M},toJSON(l){const M={};return l.addressBytes!==void 0&&(M.addressBytes=(0,g.base64FromBytes)(l.addressBytes!==void 0?l.addressBytes:new Uint8Array)),M},fromPartial(l){const M=B();return M.addressBytes=l.addressBytes??new Uint8Array,M}};function N(){return{addressString:""}}e.AddressBytesToStringResponse={typeUrl:"/cosmos.auth.v1beta1.AddressBytesToStringResponse",encode(l,M=o.BinaryWriter.create()){return l.addressString!==""&&M.uint32(10).string(l.addressString),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=N();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.addressString=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=N();return(0,g.isSet)(l.addressString)&&(M.addressString=String(l.addressString)),M},toJSON(l){const M={};return l.addressString!==void 0&&(M.addressString=l.addressString),M},fromPartial(l){const M=N();return M.addressString=l.addressString??"",M}};function U(){return{addressString:""}}e.AddressStringToBytesRequest={typeUrl:"/cosmos.auth.v1beta1.AddressStringToBytesRequest",encode(l,M=o.BinaryWriter.create()){return l.addressString!==""&&M.uint32(10).string(l.addressString),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=U();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.addressString=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=U();return(0,g.isSet)(l.addressString)&&(M.addressString=String(l.addressString)),M},toJSON(l){const M={};return l.addressString!==void 0&&(M.addressString=l.addressString),M},fromPartial(l){const M=U();return M.addressString=l.addressString??"",M}};function W(){return{addressBytes:new Uint8Array}}e.AddressStringToBytesResponse={typeUrl:"/cosmos.auth.v1beta1.AddressStringToBytesResponse",encode(l,M=o.BinaryWriter.create()){return l.addressBytes.length!==0&&M.uint32(10).bytes(l.addressBytes),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=W();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.addressBytes=m.bytes();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=W();return(0,g.isSet)(l.addressBytes)&&(M.addressBytes=(0,g.bytesFromBase64)(l.addressBytes)),M},toJSON(l){const M={};return l.addressBytes!==void 0&&(M.addressBytes=(0,g.base64FromBytes)(l.addressBytes!==void 0?l.addressBytes:new Uint8Array)),M},fromPartial(l){const M=W();return M.addressBytes=l.addressBytes??new Uint8Array,M}};function r(){return{id:BigInt(0),accountId:BigInt(0)}}e.QueryAccountAddressByIDRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest",encode(l,M=o.BinaryWriter.create()){return l.id!==BigInt(0)&&M.uint32(8).int64(l.id),l.accountId!==BigInt(0)&&M.uint32(16).uint64(l.accountId),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=r();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.id=m.int64();break;case 2:T.accountId=m.uint64();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=r();return(0,g.isSet)(l.id)&&(M.id=BigInt(l.id.toString())),(0,g.isSet)(l.accountId)&&(M.accountId=BigInt(l.accountId.toString())),M},toJSON(l){const M={};return l.id!==void 0&&(M.id=(l.id||BigInt(0)).toString()),l.accountId!==void 0&&(M.accountId=(l.accountId||BigInt(0)).toString()),M},fromPartial(l){const M=r();return l.id!==void 0&&l.id!==null&&(M.id=BigInt(l.id.toString())),l.accountId!==void 0&&l.accountId!==null&&(M.accountId=BigInt(l.accountId.toString())),M}};function s(){return{accountAddress:""}}e.QueryAccountAddressByIDResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse",encode(l,M=o.BinaryWriter.create()){return l.accountAddress!==""&&M.uint32(10).string(l.accountAddress),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=s();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.accountAddress=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=s();return(0,g.isSet)(l.accountAddress)&&(M.accountAddress=String(l.accountAddress)),M},toJSON(l){const M={};return l.accountAddress!==void 0&&(M.accountAddress=l.accountAddress),M},fromPartial(l){const M=s();return M.accountAddress=l.accountAddress??"",M}};function O(){return{address:""}}e.QueryAccountInfoRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountInfoRequest",encode(l,M=o.BinaryWriter.create()){return l.address!==""&&M.uint32(10).string(l.address),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=O();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.address=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=O();return(0,g.isSet)(l.address)&&(M.address=String(l.address)),M},toJSON(l){const M={};return l.address!==void 0&&(M.address=l.address),M},fromPartial(l){const M=O();return M.address=l.address??"",M}};function q(){return{info:void 0}}e.QueryAccountInfoResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountInfoResponse",encode(l,M=o.BinaryWriter.create()){return l.info!==void 0&&i.BaseAccount.encode(l.info,M.uint32(10).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=q();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.info=i.BaseAccount.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=q();return(0,g.isSet)(l.info)&&(M.info=i.BaseAccount.fromJSON(l.info)),M},toJSON(l){const M={};return l.info!==void 0&&(M.info=l.info?i.BaseAccount.toJSON(l.info):void 0),M},fromPartial(l){const M=q();return l.info!==void 0&&l.info!==null&&(M.info=i.BaseAccount.fromPartial(l.info)),M}};class d{constructor(M){this.rpc=M,this.Accounts=this.Accounts.bind(this),this.Account=this.Account.bind(this),this.AccountAddressByID=this.AccountAddressByID.bind(this),this.Params=this.Params.bind(this),this.ModuleAccounts=this.ModuleAccounts.bind(this),this.ModuleAccountByName=this.ModuleAccountByName.bind(this),this.Bech32Prefix=this.Bech32Prefix.bind(this),this.AddressBytesToString=this.AddressBytesToString.bind(this),this.AddressStringToBytes=this.AddressStringToBytes.bind(this),this.AccountInfo=this.AccountInfo.bind(this)}Accounts(M={pagination:n.PageRequest.fromPartial({})}){const m=e.QueryAccountsRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Accounts",m).then(T=>e.QueryAccountsResponse.decode(new o.BinaryReader(T)))}Account(M){const m=e.QueryAccountRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Account",m).then(T=>e.QueryAccountResponse.decode(new o.BinaryReader(T)))}AccountAddressByID(M){const m=e.QueryAccountAddressByIDRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AccountAddressByID",m).then(T=>e.QueryAccountAddressByIDResponse.decode(new o.BinaryReader(T)))}Params(M={}){const m=e.QueryParamsRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Params",m).then(T=>e.QueryParamsResponse.decode(new o.BinaryReader(T)))}ModuleAccounts(M={}){const m=e.QueryModuleAccountsRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","ModuleAccounts",m).then(T=>e.QueryModuleAccountsResponse.decode(new o.BinaryReader(T)))}ModuleAccountByName(M){const m=e.QueryModuleAccountByNameRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","ModuleAccountByName",m).then(T=>e.QueryModuleAccountByNameResponse.decode(new o.BinaryReader(T)))}Bech32Prefix(M={}){const m=e.Bech32PrefixRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Bech32Prefix",m).then(T=>e.Bech32PrefixResponse.decode(new o.BinaryReader(T)))}AddressBytesToString(M){const m=e.AddressBytesToStringRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AddressBytesToString",m).then(T=>e.AddressBytesToStringResponse.decode(new o.BinaryReader(T)))}AddressStringToBytes(M){const m=e.AddressStringToBytesRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AddressStringToBytes",m).then(T=>e.AddressStringToBytesResponse.decode(new o.BinaryReader(T)))}AccountInfo(M){const m=e.QueryAccountInfoRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AccountInfo",m).then(T=>e.QueryAccountInfoResponse.decode(new o.BinaryReader(T)))}}e.QueryClientImpl=d})(uc);var ze={},Xa={},Bo={},ja={};Object.defineProperty(ja,"__esModule",{value:!0});ja.concat=void 0;const FS=Re.xstream;function GS(...e){const n=new Array,t=new Array,i=new Set;let o=0;function g(){for(;n.length>0;)n.shift().unsubscribe();t.length=0,i.clear(),o=0}const C={start:w=>{e.forEach(J=>t.push([]));function E(J){for(;;){const b=t[J].shift();if(b===void 0)return;w.next(b)}}function D(){return o>=e.length}if(D()){w.complete();return}e.forEach((J,b)=>{n.push(J.subscribe({next:p=>{b===o?w.next(p):t[b].push(p)},complete:()=>{for(i.add(b);i.has(o);)E(o),o++;D()?w.complete():E(o)},error:p=>{w.error(p),g()}}))})},stop:()=>{g()}};return FS.Stream.create(C)}ja.concat=GS;var es={};Object.defineProperty(es,"__esModule",{value:!0});es.DefaultValueProducer=void 0;class LS{get value(){return this.internalValue}constructor(n,t){this.callbacks=t,this.internalValue=n}update(n){this.internalValue=n,this.listener&&this.listener.next(n)}error(n){this.listener&&this.listener.error(n)}start(n){this.listener=n,n.next(this.internalValue),this.callbacks&&this.callbacks.onStarted()}stop(){this.callbacks&&this.callbacks.onStop(),this.listener=void 0}}es.DefaultValueProducer=LS;var ns={};Object.defineProperty(ns,"__esModule",{value:!0});ns.dropDuplicates=void 0;function $S(e){return t=>{const i=new Set;return t.filter(g=>!i.has(e(g))).debug(g=>i.add(e(g)))}}ns.dropDuplicates=$S;var At={};Object.defineProperty(At,"__esModule",{value:!0});At.firstEvent=At.toListPromise=At.fromListPromise=void 0;const KS=Re.xstream;function xS(e){const n={start:t=>{e.then(i=>{for(const o of i)t.next(o);t.complete()}).catch(i=>t.error(i))},stop:()=>{}};return KS.Stream.create(n)}At.fromListPromise=xS;async function fm(e,n){return new Promise((t,i)=>{if(n===0){t([]);return}const o=new Array;e.take(n).subscribe({next:g=>{o.push(g),o.length===n&&t(o)},complete:()=>{i(`Stream completed before all events could be collected. Collected ${o.length}, expected ${n}`)},error:g=>i(g)})})}At.toListPromise=fm;async function zS(e){return(await fm(e,1))[0]}At.firstEvent=zS;var it={};Object.defineProperty(it,"__esModule",{value:!0});it.lastValue=it.asArray=it.countStream=it.Reducer=void 0;class ts{constructor(n,t,i){this.stream=n,this.reducer=t,this.state=i,this.completed=new Promise((o,g)=>{const C=this.stream.subscribe({next:w=>{this.state=this.reducer(this.state,w)},complete:()=>{o(),C.unsubscribe()},error:w=>{g(w),C.unsubscribe()}})})}value(){return this.state}async finished(){return this.completed}}it.Reducer=ts;function YS(e,n){return e+1}function ZS(e){return new ts(e,YS,0)}it.countStream=ZS;function XS(e,n){return[...e,n]}function jS(e){return new ts(e,XS,[])}it.asArray=jS;function ek(e,n){return n}function nk(e){return new ts(e,ek,void 0)}it.lastValue=nk;var rs={};Object.defineProperty(rs,"__esModule",{value:!0});rs.ValueAndUpdates=void 0;const tk=Re.xstream;class rk{get value(){return this.producer.value}constructor(n){this.producer=n,this.updates=tk.MemoryStream.createWithMemory(this.producer)}async waitFor(n){const t=typeof n=="function"?n:i=>i===n;return new Promise((i,o)=>{const g=this.updates.subscribe({next:C=>{t(C)&&(i(C),setTimeout(()=>g.unsubscribe(),0))},complete:()=>{g.unsubscribe(),o("Update stream completed without expected value")},error:C=>{o(C)}})})}}rs.ValueAndUpdates=rk;(function(e){var n=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(E,D,J,b){b===void 0&&(b=J);var p=Object.getOwnPropertyDescriptor(D,J);(!p||("get"in p?!D.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return D[J]}}),Object.defineProperty(E,b,p)}:function(E,D,J,b){b===void 0&&(b=J),E[b]=D[J]}),t=L.commonjsGlobal&&L.commonjsGlobal.__exportStar||function(E,D){for(var J in E)J!=="default"&&!Object.prototype.hasOwnProperty.call(D,J)&&n(D,E,J)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueAndUpdates=e.toListPromise=e.fromListPromise=e.firstEvent=e.dropDuplicates=e.DefaultValueProducer=e.concat=void 0;var i=ja;Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return i.concat}});var o=es;Object.defineProperty(e,"DefaultValueProducer",{enumerable:!0,get:function(){return o.DefaultValueProducer}});var g=ns;Object.defineProperty(e,"dropDuplicates",{enumerable:!0,get:function(){return g.dropDuplicates}});var C=At;Object.defineProperty(e,"firstEvent",{enumerable:!0,get:function(){return C.firstEvent}}),Object.defineProperty(e,"fromListPromise",{enumerable:!0,get:function(){return C.fromListPromise}}),Object.defineProperty(e,"toListPromise",{enumerable:!0,get:function(){return C.toListPromise}}),t(it,e);var w=rs;Object.defineProperty(e,"ValueAndUpdates",{enumerable:!0,get:function(){return w.ValueAndUpdates}})})(Bo);Object.defineProperty(Xa,"__esModule",{value:!0});Xa.QueryClient=void 0;const xt=Re.build,Xt=ue,ik=Bo,en=Ie;function $o(e,n,t){if(e.type!==n)throw new Error(`Op expected to be ${n}, got "${e.type}`);if(!(0,en.arrayContentEquals)(t,e.key))throw new Error(`Proven key different than queried key.
1
+ "use strict";var Yh=Object.defineProperty;var Zh=(e,n,t)=>n in e?Yh(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Se=(e,n,t)=>Zh(e,typeof n!="symbol"?n+"":n,t);const L=require("./index-BU_DiszY.js"),Re=require("./pako.esm-Bp8XA5UR.js"),_=require("./index-BbxY_HAX.js"),Pr=require("./index-KWDNKPJe.js"),{Axios:Xh,AxiosError:jh,CanceledError:eg,isCancel:ng,CancelToken:tg,VERSION:rg,all:ig,Cancel:og,isAxiosError:ag,spread:sg,toFormData:dg,AxiosHeaders:ug,HttpStatusCode:cg,formToJSON:lg,getAdapter:fg,mergeConfig:pg}=L.axios,mg=Object.freeze(Object.defineProperty({__proto__:null,Axios:Xh,AxiosError:jh,AxiosHeaders:ug,Cancel:og,CancelToken:tg,CanceledError:eg,HttpStatusCode:cg,VERSION:rg,all:ig,default:L.axios,formToJSON:lg,getAdapter:fg,isAxiosError:ag,isCancel:ng,mergeConfig:pg,spread:sg,toFormData:dg},Symbol.toStringTag,{value:"Module"}));var bt={},yo={},Ne={},Ja={},hg=L.commonjsGlobal&&L.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ja,"__esModule",{value:!0});Ja.Decimal=void 0;const qn=hg(L.bnExports),Sl=100;class Oe{static fromUserInput(n,t){Oe.verifyFractionalDigits(t);const i=n.match(/[^0-9.]/);if(i)throw new Error(`Invalid character at position ${i.index+1}`);let o,g;if(n==="")o="0",g="";else if(n.search(/\./)===-1)o=n,g="";else{const w=n.split(".");switch(w.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!w[1])throw new Error("Fractional part missing");o=w[0],g=w[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(g.length>t)throw new Error("Got more fractional digits than supported");const C=`${o}${g.padEnd(t,"0")}`;return new Oe(C,t)}static fromAtomics(n,t){return Oe.verifyFractionalDigits(t),new Oe(n,t)}static zero(n){return Oe.verifyFractionalDigits(n),new Oe("0",n)}static one(n){return Oe.verifyFractionalDigits(n),new Oe("1"+"0".repeat(n),n)}static verifyFractionalDigits(n){if(!Number.isInteger(n))throw new Error("Fractional digits is not an integer");if(n<0)throw new Error("Fractional digits must not be negative");if(n>Sl)throw new Error(`Fractional digits must not exceed ${Sl}`)}static compare(n,t){if(n.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");return n.data.atomics.cmp(new qn.default(t.atomics))}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}constructor(n,t){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format. Only non-negative integers in decimal representation supported.");this.data={atomics:new qn.default(n),fractionalDigits:t}}clone(){return new Oe(this.atomics,this.fractionalDigits)}floor(){const n=new qn.default(10).pow(new qn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n);return this.data.atomics.mod(n).isZero()?this.clone():Oe.fromAtomics(t.mul(n).toString(),this.fractionalDigits)}ceil(){const n=new qn.default(10).pow(new qn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n);return this.data.atomics.mod(n).isZero()?this.clone():Oe.fromAtomics(t.addn(1).mul(n).toString(),this.fractionalDigits)}toString(){const n=new qn.default(10).pow(new qn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n),i=this.data.atomics.mod(n);if(i.isZero())return t.toString();{const g=i.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${t.toString()}.${g}`}}toFloatApproximation(){const n=Number(this.toString());if(Number.isNaN(n))throw new Error("Conversion to number failed");return n}plus(n){if(this.fractionalDigits!==n.fractionalDigits)throw new Error("Fractional digits do not match");const t=this.data.atomics.add(new qn.default(n.atomics));return new Oe(t.toString(),this.fractionalDigits)}minus(n){if(this.fractionalDigits!==n.fractionalDigits)throw new Error("Fractional digits do not match");const t=this.data.atomics.sub(new qn.default(n.atomics));if(t.ltn(0))throw new Error("Difference must not be negative");return new Oe(t.toString(),this.fractionalDigits)}multiply(n){const t=this.data.atomics.mul(new qn.default(n.toString()));return new Oe(t.toString(),this.fractionalDigits)}equals(n){return Oe.compare(this,n)===0}isLessThan(n){return Oe.compare(this,n)<0}isLessThanOrEqual(n){return Oe.compare(this,n)<=0}isGreaterThan(n){return Oe.compare(this,n)>0}isGreaterThanOrEqual(n){return Oe.compare(this,n)>=0}}Ja.Decimal=Oe;var et={},gg=L.commonjsGlobal&&L.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(et,"__esModule",{value:!0});et.Uint64=et.Uint53=et.Int53=et.Uint32=void 0;const ca=gg(L.bnExports),yg=new ca.default("18446744073709551615",10,"be");class ji{static fromBigEndianBytes(n){return ji.fromBytes(n)}static fromBytes(n,t="be"){if(n.length!==4)throw new Error("Invalid input length. Expected 4 bytes.");for(let o=0;o<n.length;++o)if(!Number.isInteger(n[o])||n[o]>255||n[o]<0)throw new Error("Invalid value in byte. Found: "+n[o]);const i=t==="be"?n:Array.from(n).reverse();return new ji(i[0]*2**24+i[1]*2**16+i[2]*2**8+i[3])}static fromString(n){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format");return new ji(Number.parseInt(n,10))}constructor(n){if(Number.isNaN(n))throw new Error("Input is not a number");if(!Number.isInteger(n))throw new Error("Input is not an integer");if(n<0||n>4294967295)throw new Error("Input not in uint32 range: "+n.toString());this.data=n}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()}}et.Uint32=ji;class so{static fromString(n){if(!n.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new so(Number.parseInt(n,10))}constructor(n){if(Number.isNaN(n))throw new Error("Input is not a number");if(!Number.isInteger(n))throw new Error("Input is not an integer");if(n<Number.MIN_SAFE_INTEGER||n>Number.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+n.toString());this.data=n}toNumber(){return this.data}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}et.Int53=so;class Yu{static fromString(n){const t=so.fromString(n);return new Yu(t.toNumber())}constructor(n){const t=new so(n);if(t.toNumber()<0)throw new Error("Input is negative");this.data=t}toNumber(){return this.data.toNumber()}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}et.Uint53=Yu;class Mr{static fromBytesBigEndian(n){return Mr.fromBytes(n)}static fromBytes(n,t="be"){if(n.length!==8)throw new Error("Invalid input length. Expected 8 bytes.");for(let o=0;o<n.length;++o)if(!Number.isInteger(n[o])||n[o]>255||n[o]<0)throw new Error("Invalid value in byte. Found: "+n[o]);const i=t==="be"?Array.from(n):Array.from(n).reverse();return new Mr(new ca.default(i))}static fromString(n){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format");return new Mr(new ca.default(n,10,"be"))}static fromNumber(n){if(Number.isNaN(n))throw new Error("Input is not a number");if(!Number.isInteger(n))throw new Error("Input is not an integer");let t;try{t=new ca.default(n)}catch{throw new Error("Input is not a safe integer")}return new Mr(t)}constructor(n){if(n.isNeg())throw new Error("Input is negative");if(n.gt(yg))throw new Error("Input exceeds uint64 range");this.data=n}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()}}et.Uint64=Mr;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Uint64=e.Uint53=e.Uint32=e.Int53=e.Decimal=void 0;var n=Ja;Object.defineProperty(e,"Decimal",{enumerable:!0,get:function(){return n.Decimal}});var t=et;Object.defineProperty(e,"Int53",{enumerable:!0,get:function(){return t.Int53}}),Object.defineProperty(e,"Uint32",{enumerable:!0,get:function(){return t.Uint32}}),Object.defineProperty(e,"Uint53",{enumerable:!0,get:function(){return t.Uint53}}),Object.defineProperty(e,"Uint64",{enumerable:!0,get:function(){return t.Uint64}})})(Ne);var ut={},Ha={};Object.defineProperty(Ha,"__esModule",{value:!0});Ha.decodeTxRaw=void 0;const Rd=_.tx;function Sg(e){const n=Rd.TxRaw.decode(e);return{authInfo:Rd.AuthInfo.decode(n.authInfoBytes),body:Rd.TxBody.decode(n.bodyBytes),signatures:n.signatures}}Ha.decodeTxRaw=Sg;var jr={},zn={},hn={},$e={},nt={},ue={},ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.fromAscii=ei.toAscii=void 0;function kg(e){const n=t=>t.split("").map(i=>{const o=i.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(n(e))}ei.toAscii=kg;function Pg(e){return(t=>t.map(i=>{if(i<32||i>126)throw new Error("Cannot decode character that is out of printable ASCII range: "+i);return String.fromCharCode(i)}))(Array.from(e)).join("")}ei.fromAscii=Pg;var ni={},vg=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,o)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),Cg=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Rg=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&vg(n,e,t);return Cg(n,e),n};Object.defineProperty(ni,"__esModule",{value:!0});ni.fromBase64=ni.toBase64=void 0;const Ap=Rg(L.base64Js);function Bg(e){return Ap.fromByteArray(e)}ni.toBase64=Bg;function bg(e){if(!e.match(/^[a-zA-Z0-9+/]*={0,2}$/))throw new Error("Invalid base64 string format");return Ap.toByteArray(e)}ni.fromBase64=bg;var Et={},Eg=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,o)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),Ig=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Og=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&Eg(n,e,t);return Ig(n,e),n};Object.defineProperty(Et,"__esModule",{value:!0});Et.normalizeBech32=Et.fromBech32=Et.toBech32=void 0;const ga=Og(Re.bech32);function Tp(e,n,t){return ga.encode(e,ga.toWords(n),t)}Et.toBech32=Tp;function Np(e,n=1/0){const t=ga.decode(e,n);return{prefix:t.prefix,data:new Uint8Array(ga.fromWords(t.words))}}Et.fromBech32=Np;function Ag(e){const{prefix:n,data:t}=Np(e);return Tp(n,t)}Et.normalizeBech32=Ag;var ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.fromHex=ti.toHex=void 0;function Tg(e){let n="";for(const t of e)n+=("0"+t.toString(16)).slice(-2);return n}ti.toHex=Tg;function Ng(e){if(e.length%2!==0)throw new Error("hex string length must be a multiple of 2");const n=new Uint8Array(e.length/2);for(let t=0;t<n.length;t++){const i=2*t,o=e.slice(i,i+2);if(!o.match(/[0-9a-f]{2}/i))throw new Error("hex string contains invalid characters");n[t]=parseInt(o,16)}return n}ti.fromHex=Ng;var ri={};Object.defineProperty(ri,"__esModule",{value:!0});ri.toRfc3339=ri.fromRfc3339=void 0;const wg=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/;function vr(e,n=2){return e.toString().padStart(n,"0")}function _g(e){const n=wg.exec(e);if(!n)throw new Error("Date string is not in RFC3339 format");const t=+n[1],i=+n[2],o=+n[3],g=+n[4],C=+n[5],w=+n[6],E=n[7]?Math.floor(+n[7]*1e3):0;let D,J,b;n[8]==="Z"?(D=1,J=0,b=0):(D=n[8].substring(0,1)==="-"?-1:1,J=+n[8].substring(1,3),b=+n[8].substring(4,6));const p=D*(J*60+b)*60,S=new Date;return S.setUTCFullYear(t,i-1,o),S.setUTCHours(g,C,w,E),new Date(S.getTime()-p*1e3)}ri.fromRfc3339=_g;function Mg(e){const n=e.getUTCFullYear(),t=vr(e.getUTCMonth()+1),i=vr(e.getUTCDate()),o=vr(e.getUTCHours()),g=vr(e.getUTCMinutes()),C=vr(e.getUTCSeconds()),w=vr(e.getUTCMilliseconds(),3);return`${n}-${t}-${i}T${o}:${g}:${C}.${w}Z`}ri.toRfc3339=Mg;var ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.fromUtf8=ii.toUtf8=void 0;function Ug(e){return new TextEncoder().encode(e)}ii.toUtf8=Ug;function Dg(e,n=!1){const t=!n;return new TextDecoder("utf-8",{fatal:t}).decode(e)}ii.fromUtf8=Dg;(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 n=ei;Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return n.fromAscii}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return n.toAscii}});var t=ni;Object.defineProperty(e,"fromBase64",{enumerable:!0,get:function(){return t.fromBase64}}),Object.defineProperty(e,"toBase64",{enumerable:!0,get:function(){return t.toBase64}});var i=Et;Object.defineProperty(e,"fromBech32",{enumerable:!0,get:function(){return i.fromBech32}}),Object.defineProperty(e,"normalizeBech32",{enumerable:!0,get:function(){return i.normalizeBech32}}),Object.defineProperty(e,"toBech32",{enumerable:!0,get:function(){return i.toBech32}});var o=ti;Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return o.fromHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return o.toHex}});var g=ri;Object.defineProperty(e,"fromRfc3339",{enumerable:!0,get:function(){return g.fromRfc3339}}),Object.defineProperty(e,"toRfc3339",{enumerable:!0,get:function(){return g.toRfc3339}});var C=ii;Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return C.fromUtf8}}),Object.defineProperty(e,"toUtf8",{enumerable:!0,get:function(){return C.toUtf8}})})(ue);var nn={},Ie={},oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.arrayContentStartsWith=oi.arrayContentEquals=void 0;function Jg(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;++t)if(e[t]!==n[t])return!1;return!0}oi.arrayContentEquals=Jg;function Hg(e,n){if(e.length<n.length)return!1;for(let t=0;t<n.length;++t)if(e[t]!==n[t])return!1;return!0}oi.arrayContentStartsWith=Hg;var It={};Object.defineProperty(It,"__esModule",{value:!0});It.assertDefinedAndNotNull=It.assertDefined=It.assert=void 0;function qg(e,n){if(!e)throw new Error(n||"condition is not truthy")}It.assert=qg;function Vg(e,n){if(e===void 0)throw new Error(n??"value is undefined")}It.assertDefined=Vg;function Wg(e,n){if(e==null)throw new Error(n??"value is undefined or null")}It.assertDefinedAndNotNull=Wg;var qa={};Object.defineProperty(qa,"__esModule",{value:!0});qa.sleep=void 0;async function Qg(e){return new Promise(n=>setTimeout(n,e))}qa.sleep=Qg;var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.isDefined=Ot.isUint8Array=Ot.isNonNullObject=void 0;function wp(e){return typeof e=="object"&&e!==null}Ot.isNonNullObject=wp;function Fg(e){return!(!wp(e)||Object.prototype.toString.call(e)!=="[object Uint8Array]"||typeof L.dist.Buffer<"u"&&typeof L.dist.Buffer.isBuffer<"u"&&L.dist.Buffer.isBuffer(e))}Ot.isUint8Array=Fg;function Gg(e){return e!==void 0}Ot.isDefined=Gg;(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 n=oi;Object.defineProperty(e,"arrayContentEquals",{enumerable:!0,get:function(){return n.arrayContentEquals}}),Object.defineProperty(e,"arrayContentStartsWith",{enumerable:!0,get:function(){return n.arrayContentStartsWith}});var t=It;Object.defineProperty(e,"assert",{enumerable:!0,get:function(){return t.assert}}),Object.defineProperty(e,"assertDefined",{enumerable:!0,get:function(){return t.assertDefined}}),Object.defineProperty(e,"assertDefinedAndNotNull",{enumerable:!0,get:function(){return t.assertDefinedAndNotNull}});var i=qa;Object.defineProperty(e,"sleep",{enumerable:!0,get:function(){return i.sleep}});var o=Ot;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}})})(Ie);var Lg=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,o)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),$g=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Kg=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&Lg(n,e,t);return $g(n,e),n};Object.defineProperty(nn,"__esModule",{value:!0});nn.pbkdf2Sha512=nn.pbkdf2Sha512Noble=nn.pbkdf2Sha512NodeCrypto=nn.pbkdf2Sha512Subtle=nn.getSubtle=nn.getNodeCrypto=void 0;const or=Ie,xg=Re.require$$1,zg=Re.require$$1$1;async function _p(){try{const e=await Promise.resolve().then(()=>Kg(L.requireCryptoBrowserify()));return typeof e=="object"&&Object.keys(e).length<=1?void 0:e}catch{return}}nn.getNodeCrypto=_p;async function Mp(){var n,t,i;let e=(n=globalThis==null?void 0:globalThis.crypto)==null?void 0:n.subtle;return e||(e=(i=(t=globalThis==null?void 0:globalThis.crypto)==null?void 0:t.webcrypto)==null?void 0:i.subtle),e}nn.getSubtle=Mp;async function Up(e,n,t,i,o){return(0,or.assert)(e,"Argument subtle is falsy"),(0,or.assert)(typeof e=="object","Argument subtle is not of type object"),(0,or.assert)(typeof e.importKey=="function","subtle.importKey is not a function"),(0,or.assert)(typeof e.deriveBits=="function","subtle.deriveBits is not a function"),e.importKey("raw",n,{name:"PBKDF2"},!1,["deriveBits"]).then(g=>e.deriveBits({name:"PBKDF2",salt:t,iterations:i,hash:{name:"SHA-512"}},g,o*8).then(C=>new Uint8Array(C)))}nn.pbkdf2Sha512Subtle=Up;async function Dp(e,n,t,i,o){return(0,or.assert)(e,"Argument nodeCrypto is falsy"),(0,or.assert)(typeof e=="object","Argument nodeCrypto is not of type object"),(0,or.assert)(typeof e.pbkdf2=="function","nodeCrypto.pbkdf2 is not a function"),new Promise((g,C)=>{e.pbkdf2(n,t,i,o,"sha512",(w,E)=>{w?C(w):g(Uint8Array.from(E))})})}nn.pbkdf2Sha512NodeCrypto=Dp;async function Jp(e,n,t,i){return(0,xg.pbkdf2Async)(zg.sha512,e,n,{c:t,dkLen:i})}nn.pbkdf2Sha512Noble=Jp;async function Yg(e,n,t,i){const o=await Mp();if(o)return Up(o,e,n,t,i);{const g=await _p();return g?Dp(g,e,n,t,i):Jp(e,n,t,i)}}nn.pbkdf2Sha512=Yg;var wn={},Mi={};Object.defineProperty(Mi,"__esModule",{value:!0});Mi.toRealUint8Array=void 0;function Zg(e){return e instanceof Uint8Array?e:Uint8Array.from(e)}Mi.toRealUint8Array=Zg;Object.defineProperty(wn,"__esModule",{value:!0});wn.sha512=wn.Sha512=wn.sha256=wn.Sha256=void 0;const Xg=Re.require$$0,jg=Re.require$$1$1,Hp=Mi;class qp{constructor(n){this.blockSize=512/8,this.impl=Xg.sha256.create(),n&&this.update(n)}update(n){return this.impl.update((0,Hp.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}wn.Sha256=qp;function ey(e){return new qp(e).digest()}wn.sha256=ey;class Vp{constructor(n){this.blockSize=1024/8,this.impl=jg.sha512.create(),n&&this.update(n)}update(n){return this.impl.update((0,Hp.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}wn.Sha512=Vp;function ny(e){return new Vp(e).digest()}wn.sha512=ny;Object.defineProperty(nt,"__esModule",{value:!0});nt.Bip39=nt.EnglishMnemonic=nt.mnemonicToEntropy=nt.entropyToMnemonic=void 0;const kl=ue,ty=nn,ry=wn,Zu=["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 Wp(e){return Array.from(e).map(n=>n.toString(2).padStart(8,"0")).join("")}function Qp(e){const t=e.length*8/32,i=(0,ry.sha256)(e);return Wp(i).slice(0,t)}function Fp(e){return parseInt(e,2)}const iy=[16,20,24,28,32],oy=[12,15,18,21,24];function Gp(e){if(iy.indexOf(e.length)===-1)throw new Error("invalid input length");const n=Wp(e),t=Qp(e);return(n+t).match(/(.{11})/g).map(C=>{const w=Fp(C);return Zu[w]}).join(" ")}nt.entropyToMnemonic=Gp;const ay="Invalid number of words",sy="Found word that is not in the wordlist",dy="Invalid entropy",uy="Invalid mnemonic checksum";function Cu(e){return e.normalize("NFKD")}function Xu(e){const n=Cu(e).split(" ");if(!oy.includes(n.length))throw new Error(ay);const t=n.map(D=>{const J=Zu.indexOf(D);if(J===-1)throw new Error(sy);return J.toString(2).padStart(11,"0")}).join(""),i=Math.floor(t.length/33)*32,o=t.slice(0,i),g=t.slice(i),C=o.match(/(.{1,8})/g).map(Fp);if(C.length<16||C.length>32||C.length%4!==0)throw new Error(dy);const w=Uint8Array.from(C);if(Qp(w)!==g)throw new Error(uy);return w}nt.mnemonicToEntropy=Xu;class sr{constructor(n){if(!sr.mnemonicMatcher.test(n))throw new Error("Invalid mnemonic format");const t=n.split(" "),i=[12,15,18,21,24];if(i.indexOf(t.length)===-1)throw new Error(`Invalid word count in mnemonic (allowed: ${i} got: ${t.length})`);for(const o of t)if(sr.wordlist.indexOf(o)===-1)throw new Error("Mnemonic contains invalid word");Xu(n),this.data=n}toString(){return this.data}}nt.EnglishMnemonic=sr;sr.wordlist=Zu;sr.mnemonicMatcher=/^[a-z]+( [a-z]+)*$/;class cy{static encode(n){return new sr(Gp(n))}static decode(n){return Xu(n.toString())}static async mnemonicToSeed(n,t){const i=(0,kl.toUtf8)(Cu(n.toString())),o="mnemonic"+(t?Cu(t):""),g=(0,kl.toUtf8)(o);return(0,ty.pbkdf2Sha512)(i,g,2048,64)}}nt.Bip39=cy;var So={};Object.defineProperty(So,"__esModule",{value:!0});So.Hmac=void 0;class ly{constructor(n,t){const i=new n().blockSize;this.hash=g=>new n().update(g).digest();let o=t;if(o.length>i&&(o=this.hash(o)),o.length<i){const g=new Uint8Array(i-o.length);o=new Uint8Array([...o,...g])}this.oKeyPad=o.map(g=>g^92),this.iKeyPad=o.map(g=>g^54),this.messageHasher=new n,this.blockSize=i,this.update(this.iKeyPad)}update(n){return this.messageHasher.update(n),this}digest(){const n=this.messageHasher.digest();return this.hash(new Uint8Array([...this.oKeyPad,...n]))}}So.Hmac=ly;var ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.keccak256=ai.Keccak256=void 0;const fy=Re.require$$0$1,py=Mi;class Lp{constructor(n){this.blockSize=512/8,this.impl=fy.keccak_256.create(),n&&this.update(n)}update(n){return this.impl.update((0,py.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}ai.Keccak256=Lp;function my(e){return new Lp(e).digest()}ai.keccak256=my;var tn={},hy=L.commonjsGlobal&&L.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tn,"__esModule",{value:!0});tn.Xchacha20poly1305Ietf=tn.xchacha20NonceLength=tn.Ed25519=tn.Ed25519Keypair=tn.Argon2id=tn.isArgon2idOptions=void 0;const gy=Ie,ln=hy(_.libsodiumWrappers);function yy(e){return!(!(0,gy.isNonNullObject)(e)||typeof e.outputLength!="number"||typeof e.opsLimit!="number"||typeof e.memLimitKib!="number")}tn.isArgon2idOptions=yy;class Sy{static async execute(n,t,i){return await ln.default.ready,ln.default.crypto_pwhash(i.outputLength,n,t,i.opsLimit,i.memLimitKib*1024,ln.default.crypto_pwhash_ALG_ARGON2ID13)}}tn.Argon2id=Sy;class Va{static fromLibsodiumPrivkey(n){if(n.length!==64)throw new Error(`Unexpected key length ${n.length}. Must be 64.`);return new Va(n.slice(0,32),n.slice(32,64))}constructor(n,t){this.privkey=n,this.pubkey=t}toLibsodiumPrivkey(){return new Uint8Array([...this.privkey,...this.pubkey])}}tn.Ed25519Keypair=Va;class ky{static async makeKeypair(n){await ln.default.ready;const t=ln.default.crypto_sign_seed_keypair(n);return Va.fromLibsodiumPrivkey(t.privateKey)}static async createSignature(n,t){return await ln.default.ready,ln.default.crypto_sign_detached(n,t.toLibsodiumPrivkey())}static async verifySignature(n,t,i){return await ln.default.ready,ln.default.crypto_sign_verify_detached(n,t,i)}}tn.Ed25519=ky;tn.xchacha20NonceLength=24;class Py{static async encrypt(n,t,i){return await ln.default.ready,ln.default.crypto_aead_xchacha20poly1305_ietf_encrypt(n,null,null,i,t)}static async decrypt(n,t,i){return await ln.default.ready,ln.default.crypto_aead_xchacha20poly1305_ietf_decrypt(null,n,null,i,t)}}tn.Xchacha20poly1305Ietf=Py;var Wa={};Object.defineProperty(Wa,"__esModule",{value:!0});Wa.Random=void 0;class vy{static getBytes(n){try{const t=typeof window=="object"?window:self,i=typeof t.crypto<"u"?t.crypto:t.msCrypto,o=new Uint8Array(n);return i.getRandomValues(o),o}catch{try{const t=L.requireCryptoBrowserify();return new Uint8Array([...t.randomBytes(n)])}catch{throw new Error("No secure random number generator found")}}}}Wa.Random=vy;var si={};Object.defineProperty(si,"__esModule",{value:!0});si.ripemd160=si.Ripemd160=void 0;const Cy=Re.require$$0$2,Ry=Mi;class $p{constructor(n){this.blockSize=512/8,this.impl=Cy.ripemd160.create(),n&&this.update(n)}update(n){return this.impl.update((0,Ry.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}si.Ripemd160=$p;function By(e){return new $p(e).digest()}si.ripemd160=By;var Qa={},dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.ExtendedSecp256k1Signature=dr.Secp256k1Signature=void 0;function Ur(e){let n=0;for(const t of e)if(t===0)n++;else break;return e.slice(n)}const Wo=2;class uo{static fromFixedLength(n){if(n.length!==64)throw new Error(`Got invalid data length: ${n.length}. Expected 2x 32 bytes for the pair (r, s)`);return new uo(Ur(n.slice(0,32)),Ur(n.slice(32,64)))}static fromDer(n){let t=0;if(n[t++]!==48)throw new Error("Prefix 0x30 expected");const i=n[t++];if(n.length-t!==i)throw new Error("Data length mismatch detected");if(n[t++]!==Wo)throw new Error("INTEGER tag expected");const g=n[t++];if(g>=128)throw new Error("Decoding length values above 127 not supported");const C=n.slice(t,t+g);if(t+=g,n[t++]!==Wo)throw new Error("INTEGER tag expected");const E=n[t++];if(E>=128)throw new Error("Decoding length values above 127 not supported");const D=n.slice(t,t+E);return t+=E,new uo(Ur(C),Ur(D))}constructor(n,t){if(n.length>32||n.length===0||n[0]===0)throw new Error("Unsigned integer r must be encoded as unpadded big endian.");if(t.length>32||t.length===0||t[0]===0)throw new Error("Unsigned integer s must be encoded as unpadded big endian.");this.data={r:n,s:t}}r(n){if(n===void 0)return this.data.r;{const t=n-this.data.r.length;if(t<0)throw new Error("Length too small to hold parameter r");const i=new Uint8Array(t);return new Uint8Array([...i,...this.data.r])}}s(n){if(n===void 0)return this.data.s;{const t=n-this.data.s.length;if(t<0)throw new Error("Length too small to hold parameter s");const i=new Uint8Array(t);return new Uint8Array([...i,...this.data.s])}}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32)])}toDer(){const n=this.data.r[0]>=128?new Uint8Array([0,...this.data.r]):this.data.r,t=this.data.s[0]>=128?new Uint8Array([0,...this.data.s]):this.data.s,i=n.length,o=t.length,g=new Uint8Array([Wo,i,...n,Wo,o,...t]);return new Uint8Array([48,g.length,...g])}}dr.Secp256k1Signature=uo;class ju extends uo{static fromFixedLength(n){if(n.length!==65)throw new Error(`Got invalid data length ${n.length}. Expected 32 + 32 + 1`);return new ju(Ur(n.slice(0,32)),Ur(n.slice(32,64)),n[64])}constructor(n,t,i){if(super(n,t),!Number.isInteger(i))throw new Error("The recovery parameter must be an integer.");if(i<0||i>4)throw new Error("The recovery parameter must be one of 0, 1, 2, 3.");this.recovery=i}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32),this.recovery])}}dr.ExtendedSecp256k1Signature=ju;var Kp=L.commonjsGlobal&&L.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qa,"__esModule",{value:!0});Qa.Secp256k1=void 0;const Qo=ue,xp=Kp(L.bnExports),by=Kp(L.requireElliptic()),Ey=dr,Vt=new by.default.ec("secp256k1"),Iy=new xp.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex");class Oy{static async makeKeypair(n){if(n.length!==32)throw new Error("input data is not a valid secp256k1 private key");const t=Vt.keyFromPrivate(n);if(t.validate().result!==!0)throw new Error("input data is not a valid secp256k1 private key");if(new xp.default(n).gte(Iy))throw new Error("input data is not a valid secp256k1 private key");return{privkey:(0,Qo.fromHex)(t.getPrivate("hex")),pubkey:Uint8Array.from(t.getPublic("array"))}}static async createSignature(n,t){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 i=Vt.keyFromPrivate(t),{r:o,s:g,recoveryParam:C}=i.sign(n,{canonical:!0});if(typeof C!="number")throw new Error("Recovery param missing");return new Ey.ExtendedSecp256k1Signature(Uint8Array.from(o.toArray()),Uint8Array.from(g.toArray()),C)}static async verifySignature(n,t,i){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 o=Vt.keyFromPublic(i);try{return o.verify(t,n.toDer())}catch{return!1}}static recoverPubkey(n,t){const i={r:(0,Qo.toHex)(n.r()),s:(0,Qo.toHex)(n.s())},o=Vt.recoverPubKey(t,i,n.recovery),g=Vt.keyFromPublic(o);return(0,Qo.fromHex)(g.getPublic(!1,"hex"))}static compressPubkey(n){switch(n.length){case 33:return n;case 65:return Uint8Array.from(Vt.keyFromPublic(n).getPublic(!0,"array"));default:throw new Error("Invalid pubkey length")}}static uncompressPubkey(n){switch(n.length){case 33:return Uint8Array.from(Vt.keyFromPublic(n).getPublic(!1,"array"));case 65:return n;default:throw new Error("Invalid pubkey length")}}static trimRecoveryByte(n){switch(n.length){case 64:return n;case 65:return n.slice(0,64);default:throw new Error("Invalid signature length")}}}Qa.Secp256k1=Oy;var zp={};(function(e){var n=L.commonjsGlobal&&L.commonjsGlobal.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.stringToPath=e.pathToString=e.Slip10=e.Slip10RawIndex=e.slip10CurveFromString=e.Slip10Curve=void 0;const t=ue,i=Ne,o=n(L.bnExports),g=n(L.requireElliptic()),C=So,w=wn;var E;(function(u){u.Secp256k1="Bitcoin seed",u.Ed25519="ed25519 seed"})(E=e.Slip10Curve||(e.Slip10Curve={}));function D(u){switch(u){case E.Ed25519:return E.Ed25519;case E.Secp256k1:return E.Secp256k1;default:throw new Error(`Unknown curve string: '${u}'`)}}e.slip10CurveFromString=D;class J extends i.Uint32{static hardened(c){return new J(c+2**31)}static normal(c){return new J(c)}isHardened(){return this.data>=2**31}}e.Slip10RawIndex=J;const b=new g.default.ec("secp256k1");class p{static derivePath(c,y,B){let N=this.master(c,y);for(const U of B)N=this.child(c,N.privkey,N.chainCode,U);return N}static master(c,y){const B=new C.Hmac(w.Sha512,(0,t.toAscii)(c)).update(y).digest(),N=B.slice(0,32),U=B.slice(32,64);return c!==E.Ed25519&&(this.isZero(N)||this.isGteN(c,N))?this.master(c,B):{chainCode:U,privkey:N}}static child(c,y,B,N){let U;if(N.isHardened()){const W=new Uint8Array([0,...y,...N.toBytesBigEndian()]);U=new C.Hmac(w.Sha512,B).update(W).digest()}else{if(c===E.Ed25519)throw new Error("Normal keys are not allowed with ed25519");{const W=new Uint8Array([...p.serializedPoint(c,new o.default(y)),...N.toBytesBigEndian()]);U=new C.Hmac(w.Sha512,B).update(W).digest()}}return this.childImpl(c,y,B,N,U)}static serializedPoint(c,y){switch(c){case E.Secp256k1:return(0,t.fromHex)(b.g.mul(y).encodeCompressed("hex"));default:throw new Error("curve not supported")}}static childImpl(c,y,B,N,U){const W=U.slice(0,32),r=U.slice(32,64),s=r;if(c===E.Ed25519)return{chainCode:s,privkey:W};const O=this.n(c),q=new o.default(W).add(new o.default(y)).mod(O),d=Uint8Array.from(q.toArray("be",32));if(this.isGteN(c,W)||this.isZero(d)){const l=new C.Hmac(w.Sha512,B).update(new Uint8Array([1,...r,...N.toBytesBigEndian()])).digest();return this.childImpl(c,y,B,N,l)}return{chainCode:s,privkey:d}}static isZero(c){return c.every(y=>y===0)}static isGteN(c,y){return new o.default(y).gte(this.n(c))}static n(c){switch(c){case E.Secp256k1:return new o.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",16);default:throw new Error("curve not supported")}}}e.Slip10=p;function S(u){return u.reduce((c,y)=>{const B=y.isHardened()?`${y.toNumber()-2147483648}'`:y.toString();return c+"/"+B},"m")}e.pathToString=S;function R(u){if(!u.startsWith("m"))throw new Error("Path string must start with 'm'");let c=u.slice(1);const y=new Array;for(;c;){const B=c.match(/^\/([0-9]+)('?)/);if(!B)throw new Error("Syntax error while reading path component");const[N,U,W]=B,r=i.Uint53.fromString(U).toNumber();if(r>=2**31)throw new Error("Component value too high. Must not exceed 2**31-1.");W?y.push(J.hardened(r)):y.push(J.normal(r)),c=c.slice(N.length)}return y}e.stringToPath=R})(zp);(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 n=nt;Object.defineProperty(e,"Bip39",{enumerable:!0,get:function(){return n.Bip39}}),Object.defineProperty(e,"EnglishMnemonic",{enumerable:!0,get:function(){return n.EnglishMnemonic}});var t=So;Object.defineProperty(e,"Hmac",{enumerable:!0,get:function(){return t.Hmac}});var i=ai;Object.defineProperty(e,"Keccak256",{enumerable:!0,get:function(){return i.Keccak256}}),Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return i.keccak256}});var o=tn;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 g=Wa;Object.defineProperty(e,"Random",{enumerable:!0,get:function(){return g.Random}});var C=si;Object.defineProperty(e,"Ripemd160",{enumerable:!0,get:function(){return C.Ripemd160}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return C.ripemd160}});var w=Qa;Object.defineProperty(e,"Secp256k1",{enumerable:!0,get:function(){return w.Secp256k1}});var E=dr;Object.defineProperty(e,"ExtendedSecp256k1Signature",{enumerable:!0,get:function(){return E.ExtendedSecp256k1Signature}}),Object.defineProperty(e,"Secp256k1Signature",{enumerable:!0,get:function(){return E.Secp256k1Signature}});var D=wn;Object.defineProperty(e,"Sha256",{enumerable:!0,get:function(){return D.Sha256}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return D.sha256}}),Object.defineProperty(e,"Sha512",{enumerable:!0,get:function(){return D.Sha512}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return D.sha512}});var J=zp;Object.defineProperty(e,"pathToString",{enumerable:!0,get:function(){return J.pathToString}}),Object.defineProperty(e,"Slip10",{enumerable:!0,get:function(){return J.Slip10}}),Object.defineProperty(e,"Slip10Curve",{enumerable:!0,get:function(){return J.Slip10Curve}}),Object.defineProperty(e,"slip10CurveFromString",{enumerable:!0,get:function(){return J.slip10CurveFromString}}),Object.defineProperty(e,"Slip10RawIndex",{enumerable:!0,get:function(){return J.Slip10RawIndex}}),Object.defineProperty(e,"stringToPath",{enumerable:!0,get:function(){return J.stringToPath}})})($e);var Le={},ko={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isMultisigThresholdPubkey=e.isSinglePubkey=e.pubkeyType=e.isSecp256k1Pubkey=e.isEd25519Pubkey=void 0;function n(g){return g.type==="tendermint/PubKeyEd25519"}e.isEd25519Pubkey=n;function t(g){return g.type==="tendermint/PubKeySecp256k1"}e.isSecp256k1Pubkey=t,e.pubkeyType={secp256k1:"tendermint/PubKeySecp256k1",ed25519:"tendermint/PubKeyEd25519",sr25519:"tendermint/PubKeySr25519",multisigThreshold:"tendermint/PubKeyMultisigThreshold"};function i(g){return[e.pubkeyType.ed25519,e.pubkeyType.secp256k1,e.pubkeyType.sr25519].includes(g.type)}e.isSinglePubkey=i;function o(g){return g.type==="tendermint/PubKeyMultisigThreshold"}e.isMultisigThresholdPubkey=o})(ko);Object.defineProperty(Le,"__esModule",{value:!0});Le.encodeBech32Pubkey=Le.encodeAminoPubkey=Le.decodeBech32Pubkey=Le.decodeAminoPubkey=Le.encodeEd25519Pubkey=Le.encodeSecp256k1Pubkey=void 0;const on=ue,Ay=Ne,Yi=Ie,mt=ko;function Ty(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:mt.pubkeyType.secp256k1,value:(0,on.toBase64)(e)}}Le.encodeSecp256k1Pubkey=Ty;function Ny(e){if(e.length!==32)throw new Error("Ed25519 public key must be 32 bytes long");return{type:mt.pubkeyType.ed25519,value:(0,on.toBase64)(e)}}Le.encodeEd25519Pubkey=Ny;const Ru=(0,on.fromHex)("eb5ae98721"),Bu=(0,on.fromHex)("1624de6420"),Pl=(0,on.fromHex)("0dfb100520"),ya=(0,on.fromHex)("22c1f7e2");function ec(e){if((0,Yi.arrayContentStartsWith)(e,Ru)){const n=e.slice(Ru.length);if(n.length!==33)throw new Error("Invalid rest data length. Expected 33 bytes (compressed secp256k1 pubkey).");return{type:mt.pubkeyType.secp256k1,value:(0,on.toBase64)(n)}}else if((0,Yi.arrayContentStartsWith)(e,Bu)){const n=e.slice(Bu.length);if(n.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Ed25519 pubkey).");return{type:mt.pubkeyType.ed25519,value:(0,on.toBase64)(n)}}else if((0,Yi.arrayContentStartsWith)(e,Pl)){const n=e.slice(Pl.length);if(n.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Sr25519 pubkey).");return{type:mt.pubkeyType.sr25519,value:(0,on.toBase64)(n)}}else{if((0,Yi.arrayContentStartsWith)(e,ya))return _y(e);throw new Error("Unsupported public key type. Amino data starts with: "+(0,on.toHex)(e.slice(0,5)))}}Le.decodeAminoPubkey=ec;function wy(e){const{data:n}=(0,on.fromBech32)(e);return ec(n)}Le.decodeBech32Pubkey=wy;function vl(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 _y(e){const n=Array.from(e),t=n.splice(0,ya.length);if(!(0,Yi.arrayContentStartsWith)(t,ya))throw new Error("Invalid multisig prefix.");if(n.shift()!=8)throw new Error("Invalid multisig data. Expecting 0x08 prefix before threshold.");const[i,o]=vl(n);n.splice(0,o);const g=[];for(;n.length>0;){if(n.shift()!=18)throw new Error("Invalid multisig data. Expecting 0x12 prefix before participant pubkey length.");const[C,w]=vl(n);if(n.splice(0,w),n.length<C)throw new Error("Invalid multisig data length.");const E=n.splice(0,C),D=ec(Uint8Array.from(E));g.push(D)}return{type:mt.pubkeyType.multisigThreshold,value:{threshold:i.toString(),pubkeys:g}}}function Cl(e){const n=Ay.Uint53.fromString(e.toString()).toNumber();if(n>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[n]}function nc(e){if((0,mt.isMultisigThresholdPubkey)(e)){const n=Array.from(ya);n.push(8),n.push(...Cl(e.value.threshold));for(const t of e.value.pubkeys.map(i=>nc(i)))n.push(18),n.push(...Cl(t.length)),n.push(...t);return new Uint8Array(n)}else{if((0,mt.isEd25519Pubkey)(e))return new Uint8Array([...Bu,...(0,on.fromBase64)(e.value)]);if((0,mt.isSecp256k1Pubkey)(e))return new Uint8Array([...Ru,...(0,on.fromBase64)(e.value)]);throw new Error("Unsupported pubkey type")}}Le.encodeAminoPubkey=nc;function My(e,n){return(0,on.toBech32)(n,nc(e))}Le.encodeBech32Pubkey=My;Object.defineProperty(hn,"__esModule",{value:!0});hn.pubkeyToAddress=hn.pubkeyToRawAddress=hn.rawSecp256k1PubkeyToRawAddress=hn.rawEd25519PubkeyToRawAddress=void 0;const Sa=$e,bu=ue,Uy=Le,Bd=ko;function Yp(e){if(e.length!==32)throw new Error(`Invalid Ed25519 pubkey length: ${e.length}`);return(0,Sa.sha256)(e).slice(0,20)}hn.rawEd25519PubkeyToRawAddress=Yp;function Zp(e){if(e.length!==33)throw new Error(`Invalid Secp256k1 pubkey length (compressed): ${e.length}`);return(0,Sa.ripemd160)((0,Sa.sha256)(e))}hn.rawSecp256k1PubkeyToRawAddress=Zp;function Xp(e){if((0,Bd.isSecp256k1Pubkey)(e)){const n=(0,bu.fromBase64)(e.value);return Zp(n)}else if((0,Bd.isEd25519Pubkey)(e)){const n=(0,bu.fromBase64)(e.value);return Yp(n)}else if((0,Bd.isMultisigThresholdPubkey)(e)){const n=(0,Uy.encodeAminoPubkey)(e);return(0,Sa.sha256)(n).slice(0,20)}else throw new Error("Unsupported public key type")}hn.pubkeyToRawAddress=Xp;function Dy(e,n){return(0,bu.toBech32)(n,Xp(e))}hn.pubkeyToAddress=Dy;var tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.addCoins=tt.parseCoins=tt.coins=tt.coin=void 0;const Eu=Ne;function jp(e,n){let t;if(typeof e=="number")try{t=new Eu.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");t=e.replace(/^0*/,"")||"0"}return{amount:t,denom:n}}tt.coin=jp;function Jy(e,n){return[jp(e,n)]}tt.coins=Jy;function Hy(e){return e.replace(/\s/g,"").split(",").filter(Boolean).map(n=>{const t=n.match(/^([0-9]+)([a-zA-Z][a-zA-Z0-9/]{2,127})$/);if(!t)throw new Error("Got an invalid coin string");return{amount:t[1].replace(/^0+/,"")||"0",denom:t[2]}})}tt.parseCoins=Hy;function qy(e,n){if(e.denom!==n.denom)throw new Error("Trying to add two coins with different denoms");return{amount:Eu.Decimal.fromAtomics(e.amount,0).plus(Eu.Decimal.fromAtomics(n.amount,0)).atomics,denom:e.denom}}tt.addCoins=qy;var di={};Object.defineProperty(di,"__esModule",{value:!0});di.createMultisigThresholdPubkey=di.compareArrays=void 0;const Rl=ue,Vy=Ne,Bl=hn;function em(e,n){const t=(0,Rl.toHex)(e),i=(0,Rl.toHex)(n);return t===i?0:t<i?-1:1}di.compareArrays=em;function Wy(e,n,t=!1){const i=new Vy.Uint53(n);if(i.toNumber()>e.length)throw new Error(`Threshold k = ${i.toNumber()} exceeds number of keys n = ${e.length}`);const o=t?e:Array.from(e).sort((g,C)=>{const w=(0,Bl.pubkeyToRawAddress)(g),E=(0,Bl.pubkeyToRawAddress)(C);return em(w,E)});return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:i.toString(),pubkeys:o}}}di.createMultisigThresholdPubkey=Wy;var Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});Fa.omitDefault=void 0;function Qy(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}'`)}}Fa.omitDefault=Qy;var Po={};Object.defineProperty(Po,"__esModule",{value:!0});Po.makeCosmoshubPath=void 0;const Ui=$e;function Fy(e){return[Ui.Slip10RawIndex.hardened(44),Ui.Slip10RawIndex.hardened(118),Ui.Slip10RawIndex.hardened(0),Ui.Slip10RawIndex.normal(0),Ui.Slip10RawIndex.normal(e)]}Po.makeCosmoshubPath=Fy;var ui={},qt={};Object.defineProperty(qt,"__esModule",{value:!0});qt.decodeSignature=qt.encodeSecp256k1Signature=void 0;const Iu=ue,Gy=Le,Ly=ko;function $y(e,n){if(n.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,Gy.encodeSecp256k1Pubkey)(e),signature:(0,Iu.toBase64)(n)}}qt.encodeSecp256k1Signature=$y;function Ky(e){switch(e.pub_key.type){case Ly.pubkeyType.secp256k1:return{pubkey:(0,Iu.fromBase64)(e.pub_key.value),signature:(0,Iu.fromBase64)(e.signature)};default:throw new Error("Unsupported pubkey type")}}qt.decodeSignature=Ky;var _n={};Object.defineProperty(_n,"__esModule",{value:!0});_n.serializeSignDoc=_n.escapeCharacters=_n.makeSignDoc=_n.sortedJsonStringify=void 0;const xy=ue,bl=Ne;function Ou(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(Ou);const n=Object.keys(e).sort(),t={};return n.forEach(i=>{t[i]=Ou(e[i])}),t}function nm(e){return JSON.stringify(Ou(e))}_n.sortedJsonStringify=nm;function zy(e,n,t,i,o,g,C){return{chain_id:t,account_number:bl.Uint53.fromString(o.toString()).toString(),sequence:bl.Uint53.fromString(g.toString()).toString(),fee:n,msgs:e,memo:i||"",...C&&{timeout_height:C.toString()}}}_n.makeSignDoc=zy;function tm(e){const n=/&/g,t=/</g,i=/>/g;return e.replace(n,"\\u0026").replace(t,"\\u003c").replace(i,"\\u003e")}_n.escapeCharacters=tm;function Yy(e){const n=tm(nm(e));return(0,xy.toUtf8)(n)}_n.serializeSignDoc=Yy;var tc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const n=$e,t=ue;e.cosmjsSalt=(0,t.toAscii)("The CosmJS salt.");async function i(C,w){switch(w.algorithm){case"argon2id":{const E=w.params;if(!(0,n.isArgon2idOptions)(E))throw new Error("Invalid format of argon2id params");return n.Argon2id.execute(C,e.cosmjsSalt,E)}default:throw new Error("Unsupported KDF algorithm")}}e.executeKdf=i,e.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"};async function o(C,w,E){switch(E.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=n.Random.getBytes(n.xchacha20NonceLength);return new Uint8Array([...D,...await n.Xchacha20poly1305Ietf.encrypt(C,w,D)])}default:throw new Error(`Unsupported encryption algorithm: '${E.algorithm}'`)}}e.encrypt=o;async function g(C,w,E){switch(E.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=C.slice(0,n.xchacha20NonceLength);return n.Xchacha20poly1305Ietf.decrypt(C.slice(n.xchacha20NonceLength),w,D)}default:throw new Error(`Unsupported encryption algorithm: '${E.algorithm}'`)}}e.decrypt=g})(tc);Object.defineProperty(ui,"__esModule",{value:!0});ui.Secp256k1HdWallet=ui.extractKdfConfiguration=void 0;const Sn=$e,Di=ue,Dr=Ie,Zy=hn,Xy=Po,jy=qt,eS=_n,Ji=tc,la="secp256k1wallet-v1",nS={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function tS(e){return!(!(0,Dr.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function rS(e){return e.kdf}function iS(e){const n=JSON.parse(e);if(!(0,Dr.isNonNullObject)(n))throw new Error("Root document is not an object.");switch(n.type){case la:return rS(n);default:throw new Error("Unsupported serialization type")}}ui.extractKdfConfiguration=iS;const El={bip39Password:"",hdPaths:[(0,Xy.makeCosmoshubPath)(0)],prefix:"cosmos"};class Yt{static async fromMnemonic(n,t={}){const i=new Sn.EnglishMnemonic(n),o=await Sn.Bip39.mnemonicToSeed(i,t.bip39Password);return new Yt(i,{...t,seed:o})}static async generate(n=12,t={}){const i=4*Math.floor(11*n/33),o=Sn.Random.getBytes(i),g=Sn.Bip39.encode(o);return Yt.fromMnemonic(g.toString(),t)}static async deserialize(n,t){const i=JSON.parse(n);if(!(0,Dr.isNonNullObject)(i))throw new Error("Root document is not an object.");switch(i.type){case la:return Yt.deserializeTypeV1(n,t);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(n,t){const i=JSON.parse(n);if(!(0,Dr.isNonNullObject)(i))throw new Error("Root document is not an object.");const o=i;switch(o.type){case la:{const g=await(0,Ji.decrypt)((0,Di.fromBase64)(o.data),t,o.encryption),C=JSON.parse((0,Di.fromUtf8)(g)),{mnemonic:w,accounts:E}=C;if((0,Dr.assert)(typeof w=="string"),!Array.isArray(E))throw new Error("Property 'accounts' is not an array");if(!E.every(b=>tS(b)))throw new Error("Account is not in the correct format.");const D=E[0].prefix;if(!E.every(({prefix:b})=>b===D))throw new Error("Accounts do not all have the same prefix");const J=E.map(({hdPath:b})=>(0,Sn.stringToPath)(b));return Yt.fromMnemonic(w,{hdPaths:J,prefix:D})}default:throw new Error("Unsupported serialization type")}}static async deserializeTypeV1(n,t){const i=JSON.parse(n);if(!(0,Dr.isNonNullObject)(i))throw new Error("Root document is not an object.");const o=await(0,Ji.executeKdf)(t,i.kdf);return Yt.deserializeWithEncryptionKey(n,o)}constructor(n,t){const i=t.hdPaths??El.hdPaths,o=t.prefix??El.prefix;this.secret=n,this.seed=t.seed,this.accounts=i.map(g=>({hdPath:g,prefix:o}))}get mnemonic(){return this.secret.toString()}async getAccounts(){return(await this.getAccountsWithPrivkeys()).map(({algo:t,pubkey:i,address:o})=>({algo:t,pubkey:i,address:o}))}async signAmino(n,t){const o=(await this.getAccountsWithPrivkeys()).find(({address:J})=>J===n);if(o===void 0)throw new Error(`Address ${n} not found in wallet`);const{privkey:g,pubkey:C}=o,w=(0,Sn.sha256)((0,eS.serializeSignDoc)(t)),E=await Sn.Secp256k1.createSignature(w,g),D=new Uint8Array([...E.r(32),...E.s(32)]);return{signed:t,signature:(0,jy.encodeSecp256k1Signature)(C,D)}}async serialize(n){const t=nS,i=await(0,Ji.executeKdf)(n,t);return this.serializeWithEncryptionKey(i,t)}async serializeWithEncryptionKey(n,t){const i={mnemonic:this.mnemonic,accounts:this.accounts.map(({hdPath:E,prefix:D})=>({hdPath:(0,Sn.pathToString)(E),prefix:D}))},o=(0,Di.toUtf8)(JSON.stringify(i)),g={algorithm:Ji.supportedAlgorithms.xchacha20poly1305Ietf},C=await(0,Ji.encrypt)(o,n,g),w={type:la,kdf:t,encryption:g,data:(0,Di.toBase64)(C)};return JSON.stringify(w)}async getKeyPair(n){const{privkey:t}=Sn.Slip10.derivePath(Sn.Slip10Curve.Secp256k1,this.seed,n),{pubkey:i}=await Sn.Secp256k1.makeKeypair(t);return{privkey:t,pubkey:Sn.Secp256k1.compressPubkey(i)}}async getAccountsWithPrivkeys(){return Promise.all(this.accounts.map(async({hdPath:n,prefix:t})=>{const{privkey:i,pubkey:o}=await this.getKeyPair(n),g=(0,Di.toBech32)(t,(0,Zy.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:i,pubkey:o,address:g}}))}}ui.Secp256k1HdWallet=Yt;var Ga={};Object.defineProperty(Ga,"__esModule",{value:!0});Ga.Secp256k1Wallet=void 0;const Fo=$e,oS=ue,aS=hn,sS=qt,dS=_n;class rc{static async fromKey(n,t="cosmos"){const i=(await Fo.Secp256k1.makeKeypair(n)).pubkey;return new rc(n,Fo.Secp256k1.compressPubkey(i),t)}constructor(n,t,i){this.privkey=n,this.pubkey=t,this.prefix=i}get address(){return(0,oS.toBech32)(this.prefix,(0,aS.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signAmino(n,t){if(n!==this.address)throw new Error(`Address ${n} not found in wallet`);const i=new Fo.Sha256((0,dS.serializeSignDoc)(t)).digest(),o=await Fo.Secp256k1.createSignature(i,this.privkey),g=new Uint8Array([...o.r(32),...o.s(32)]);return{signed:t,signature:(0,sS.encodeSecp256k1Signature)(this.pubkey,g)}}}Ga.Secp256k1Wallet=rc;var ci={};Object.defineProperty(ci,"__esModule",{value:!0});ci.makeStdTx=ci.isStdTx=void 0;function uS(e){const{memo:n,msg:t,fee:i,signatures:o}=e;return typeof n=="string"&&Array.isArray(t)&&typeof i=="object"&&Array.isArray(o)}ci.isStdTx=uS;function cS(e,n){return{msg:e.msgs,fee:e.fee,memo:e.memo,signatures:Array.isArray(n)?n:[n]}}ci.makeStdTx=cS;(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 n=hn;Object.defineProperty(e,"pubkeyToAddress",{enumerable:!0,get:function(){return n.pubkeyToAddress}}),Object.defineProperty(e,"pubkeyToRawAddress",{enumerable:!0,get:function(){return n.pubkeyToRawAddress}}),Object.defineProperty(e,"rawEd25519PubkeyToRawAddress",{enumerable:!0,get:function(){return n.rawEd25519PubkeyToRawAddress}}),Object.defineProperty(e,"rawSecp256k1PubkeyToRawAddress",{enumerable:!0,get:function(){return n.rawSecp256k1PubkeyToRawAddress}});var t=tt;Object.defineProperty(e,"addCoins",{enumerable:!0,get:function(){return t.addCoins}}),Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return t.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return t.coins}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return t.parseCoins}});var i=Le;Object.defineProperty(e,"decodeAminoPubkey",{enumerable:!0,get:function(){return i.decodeAminoPubkey}}),Object.defineProperty(e,"decodeBech32Pubkey",{enumerable:!0,get:function(){return i.decodeBech32Pubkey}}),Object.defineProperty(e,"encodeAminoPubkey",{enumerable:!0,get:function(){return i.encodeAminoPubkey}}),Object.defineProperty(e,"encodeBech32Pubkey",{enumerable:!0,get:function(){return i.encodeBech32Pubkey}}),Object.defineProperty(e,"encodeEd25519Pubkey",{enumerable:!0,get:function(){return i.encodeEd25519Pubkey}}),Object.defineProperty(e,"encodeSecp256k1Pubkey",{enumerable:!0,get:function(){return i.encodeSecp256k1Pubkey}});var o=di;Object.defineProperty(e,"createMultisigThresholdPubkey",{enumerable:!0,get:function(){return o.createMultisigThresholdPubkey}});var g=Fa;Object.defineProperty(e,"omitDefault",{enumerable:!0,get:function(){return g.omitDefault}});var C=Po;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return C.makeCosmoshubPath}});var w=ko;Object.defineProperty(e,"isEd25519Pubkey",{enumerable:!0,get:function(){return w.isEd25519Pubkey}}),Object.defineProperty(e,"isMultisigThresholdPubkey",{enumerable:!0,get:function(){return w.isMultisigThresholdPubkey}}),Object.defineProperty(e,"isSecp256k1Pubkey",{enumerable:!0,get:function(){return w.isSecp256k1Pubkey}}),Object.defineProperty(e,"isSinglePubkey",{enumerable:!0,get:function(){return w.isSinglePubkey}}),Object.defineProperty(e,"pubkeyType",{enumerable:!0,get:function(){return w.pubkeyType}});var E=ui;Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return E.extractKdfConfiguration}}),Object.defineProperty(e,"Secp256k1HdWallet",{enumerable:!0,get:function(){return E.Secp256k1HdWallet}});var D=Ga;Object.defineProperty(e,"Secp256k1Wallet",{enumerable:!0,get:function(){return D.Secp256k1Wallet}});var J=qt;Object.defineProperty(e,"decodeSignature",{enumerable:!0,get:function(){return J.decodeSignature}}),Object.defineProperty(e,"encodeSecp256k1Signature",{enumerable:!0,get:function(){return J.encodeSecp256k1Signature}});var b=_n;Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return b.makeSignDoc}}),Object.defineProperty(e,"serializeSignDoc",{enumerable:!0,get:function(){return b.serializeSignDoc}});var p=ci;Object.defineProperty(e,"isStdTx",{enumerable:!0,get:function(){return p.isStdTx}}),Object.defineProperty(e,"makeStdTx",{enumerable:!0,get:function(){return p.makeStdTx}});var S=tc;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return S.executeKdf}})})(zn);var st={};Object.defineProperty(st,"__esModule",{value:!0});st.makeSignBytes=st.makeSignDoc=st.makeAuthInfoBytes=void 0;const Il=Ie,lS=_.signing,ka=_.tx;function fS(e,n){return e.map(({pubkey:t,sequence:i})=>({publicKey:t,modeInfo:{single:{mode:n}},sequence:BigInt(i)}))}function pS(e,n,t,i,o,g=lS.SignMode.SIGN_MODE_DIRECT){(0,Il.assert)(i===void 0||typeof i=="string","feeGranter must be undefined or string"),(0,Il.assert)(o===void 0||typeof o=="string","feePayer must be undefined or string");const C=ka.AuthInfo.fromPartial({signerInfos:fS(e,g),fee:{amount:[...n],gasLimit:BigInt(t),granter:i,payer:o}});return ka.AuthInfo.encode(C).finish()}st.makeAuthInfoBytes=pS;function mS(e,n,t,i){return{bodyBytes:e,authInfoBytes:n,chainId:t,accountNumber:BigInt(i)}}st.makeSignDoc=mS;function hS({accountNumber:e,authInfoBytes:n,bodyBytes:t,chainId:i}){const o=ka.SignDoc.fromPartial({accountNumber:e,authInfoBytes:n,bodyBytes:t,chainId:i});return ka.SignDoc.encode(o).finish()}st.makeSignBytes=hS;var ic={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const n=$e,t=ue;e.cosmjsSalt=(0,t.toAscii)("The CosmJS salt.");async function i(C,w){switch(w.algorithm){case"argon2id":{const E=w.params;if(!(0,n.isArgon2idOptions)(E))throw new Error("Invalid format of argon2id params");return n.Argon2id.execute(C,e.cosmjsSalt,E)}default:throw new Error("Unsupported KDF algorithm")}}e.executeKdf=i,e.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"};async function o(C,w,E){switch(E.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=n.Random.getBytes(n.xchacha20NonceLength);return new Uint8Array([...D,...await n.Xchacha20poly1305Ietf.encrypt(C,w,D)])}default:throw new Error(`Unsupported encryption algorithm: '${E.algorithm}'`)}}e.encrypt=o;async function g(C,w,E){switch(E.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=C.slice(0,n.xchacha20NonceLength);return n.Xchacha20poly1305Ietf.decrypt(C.slice(n.xchacha20NonceLength),w,D)}default:throw new Error(`Unsupported encryption algorithm: '${E.algorithm}'`)}}e.decrypt=g})(ic);Object.defineProperty(jr,"__esModule",{value:!0});jr.DirectSecp256k1HdWallet=jr.extractKdfConfiguration=void 0;const Au=zn,kn=$e,Hi=ue,Jr=Ie,gS=st,qi=ic,fa="directsecp256k1hdwallet-v1",yS={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function SS(e){return!(!(0,Jr.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function kS(e){return e.kdf}function PS(e){const n=JSON.parse(e);if(!(0,Jr.isNonNullObject)(n))throw new Error("Root document is not an object.");switch(n.type){case fa:return kS(n);default:throw new Error("Unsupported serialization type")}}jr.extractKdfConfiguration=PS;const Ol={bip39Password:"",hdPaths:[(0,Au.makeCosmoshubPath)(0)],prefix:"cosmos"};class Zt{static async fromMnemonic(n,t={}){const i=new kn.EnglishMnemonic(n),o=await kn.Bip39.mnemonicToSeed(i,t.bip39Password);return new Zt(i,{...t,seed:o})}static async generate(n=12,t={}){const i=4*Math.floor(11*n/33),o=kn.Random.getBytes(i),g=kn.Bip39.encode(o);return Zt.fromMnemonic(g.toString(),t)}static async deserialize(n,t){const i=JSON.parse(n);if(!(0,Jr.isNonNullObject)(i))throw new Error("Root document is not an object.");switch(i.type){case fa:return Zt.deserializeTypeV1(n,t);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(n,t){const i=JSON.parse(n);if(!(0,Jr.isNonNullObject)(i))throw new Error("Root document is not an object.");const o=i;switch(o.type){case fa:{const g=await(0,qi.decrypt)((0,Hi.fromBase64)(o.data),t,o.encryption),C=JSON.parse((0,Hi.fromUtf8)(g)),{mnemonic:w,accounts:E}=C;if((0,Jr.assert)(typeof w=="string"),!Array.isArray(E))throw new Error("Property 'accounts' is not an array");if(!E.every(b=>SS(b)))throw new Error("Account is not in the correct format.");const D=E[0].prefix;if(!E.every(({prefix:b})=>b===D))throw new Error("Accounts do not all have the same prefix");const J=E.map(({hdPath:b})=>(0,kn.stringToPath)(b));return Zt.fromMnemonic(w,{hdPaths:J,prefix:D})}default:throw new Error("Unsupported serialization type")}}static async deserializeTypeV1(n,t){const i=JSON.parse(n);if(!(0,Jr.isNonNullObject)(i))throw new Error("Root document is not an object.");const o=await(0,qi.executeKdf)(t,i.kdf);return Zt.deserializeWithEncryptionKey(n,o)}constructor(n,t){const i=t.prefix??Ol.prefix,o=t.hdPaths??Ol.hdPaths;this.secret=n,this.seed=t.seed,this.accounts=o.map(g=>({hdPath:g,prefix:i}))}get mnemonic(){return this.secret.toString()}async getAccounts(){return(await this.getAccountsWithPrivkeys()).map(({algo:t,pubkey:i,address:o})=>({algo:t,pubkey:i,address:o}))}async signDirect(n,t){const o=(await this.getAccountsWithPrivkeys()).find(({address:p})=>p===n);if(o===void 0)throw new Error(`Address ${n} not found in wallet`);const{privkey:g,pubkey:C}=o,w=(0,gS.makeSignBytes)(t),E=(0,kn.sha256)(w),D=await kn.Secp256k1.createSignature(E,g),J=new Uint8Array([...D.r(32),...D.s(32)]),b=(0,Au.encodeSecp256k1Signature)(C,J);return{signed:t,signature:b}}async serialize(n){const t=yS,i=await(0,qi.executeKdf)(n,t);return this.serializeWithEncryptionKey(i,t)}async serializeWithEncryptionKey(n,t){const i={mnemonic:this.mnemonic,accounts:this.accounts.map(({hdPath:E,prefix:D})=>({hdPath:(0,kn.pathToString)(E),prefix:D}))},o=(0,Hi.toUtf8)(JSON.stringify(i)),g={algorithm:qi.supportedAlgorithms.xchacha20poly1305Ietf},C=await(0,qi.encrypt)(o,n,g),w={type:fa,kdf:t,encryption:g,data:(0,Hi.toBase64)(C)};return JSON.stringify(w)}async getKeyPair(n){const{privkey:t}=kn.Slip10.derivePath(kn.Slip10Curve.Secp256k1,this.seed,n),{pubkey:i}=await kn.Secp256k1.makeKeypair(t);return{privkey:t,pubkey:kn.Secp256k1.compressPubkey(i)}}async getAccountsWithPrivkeys(){return Promise.all(this.accounts.map(async({hdPath:n,prefix:t})=>{const{privkey:i,pubkey:o}=await this.getKeyPair(n),g=(0,Hi.toBech32)(t,(0,Au.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:i,pubkey:o,address:g}}))}}jr.DirectSecp256k1HdWallet=Zt;var La={};Object.defineProperty(La,"__esModule",{value:!0});La.DirectSecp256k1Wallet=void 0;const Al=zn,Go=$e,vS=ue,CS=st;class oc{static async fromKey(n,t="cosmos"){const i=(await Go.Secp256k1.makeKeypair(n)).pubkey;return new oc(n,Go.Secp256k1.compressPubkey(i),t)}constructor(n,t,i){this.privkey=n,this.pubkey=t,this.prefix=i}get address(){return(0,vS.toBech32)(this.prefix,(0,Al.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signDirect(n,t){const i=(0,CS.makeSignBytes)(t);if(n!==this.address)throw new Error(`Address ${n} not found in wallet`);const o=(0,Go.sha256)(i),g=await Go.Secp256k1.createSignature(o,this.privkey),C=new Uint8Array([...g.r(32),...g.s(32)]),w=(0,Al.encodeSecp256k1Signature)(this.pubkey,C);return{signed:t,signature:w}}}La.DirectSecp256k1Wallet=oc;var $a={};Object.defineProperty($a,"__esModule",{value:!0});$a.makeCosmoshubPath=void 0;const Vi=$e;function RS(e){return[Vi.Slip10RawIndex.hardened(44),Vi.Slip10RawIndex.hardened(118),Vi.Slip10RawIndex.hardened(0),Vi.Slip10RawIndex.normal(0),Vi.Slip10RawIndex.normal(e)]}$a.makeCosmoshubPath=RS;var rt={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.PrivKey=ht.PubKey=ht.protobufPackage=void 0;const Wr=_.binary,Qr=_.helpers;ht.protobufPackage="cosmos.crypto.ed25519";function bd(){return{key:new Uint8Array}}ht.PubKey={typeUrl:"/cosmos.crypto.ed25519.PubKey",encode(e,n=Wr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Wr.BinaryReader?e:new Wr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=bd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.key=t.bytes();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=bd();return(0,Qr.isSet)(e.key)&&(n.key=(0,Qr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Qr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=bd();return n.key=e.key??new Uint8Array,n}};function Ed(){return{key:new Uint8Array}}ht.PrivKey={typeUrl:"/cosmos.crypto.ed25519.PrivKey",encode(e,n=Wr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Wr.BinaryReader?e:new Wr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Ed();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.key=t.bytes();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Ed();return(0,Qr.isSet)(e.key)&&(n.key=(0,Qr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Qr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=Ed();return n.key=e.key??new Uint8Array,n}};var ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.LegacyAminoPubKey=ur.protobufPackage=void 0;const Wi=_.any,Id=_.binary,BS=_.helpers;ur.protobufPackage="cosmos.crypto.multisig";function Od(){return{threshold:0,publicKeys:[]}}ur.LegacyAminoPubKey={typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",encode(e,n=Id.BinaryWriter.create()){e.threshold!==0&&n.uint32(8).uint32(e.threshold);for(const t of e.publicKeys)Wi.Any.encode(t,n.uint32(18).fork()).ldelim();return n},decode(e,n){const t=e instanceof Id.BinaryReader?e:new Id.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Od();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.threshold=t.uint32();break;case 2:o.publicKeys.push(Wi.Any.decode(t,t.uint32()));break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Od();return(0,BS.isSet)(e.threshold)&&(n.threshold=Number(e.threshold)),Array.isArray(e==null?void 0:e.publicKeys)&&(n.publicKeys=e.publicKeys.map(t=>Wi.Any.fromJSON(t))),n},toJSON(e){const n={};return e.threshold!==void 0&&(n.threshold=Math.round(e.threshold)),e.publicKeys?n.publicKeys=e.publicKeys.map(t=>t?Wi.Any.toJSON(t):void 0):n.publicKeys=[],n},fromPartial(e){var t;const n=Od();return n.threshold=e.threshold??0,n.publicKeys=((t=e.publicKeys)==null?void 0:t.map(i=>Wi.Any.fromPartial(i)))||[],n}};var gt={};Object.defineProperty(gt,"__esModule",{value:!0});gt.PrivKey=gt.PubKey=gt.protobufPackage=void 0;const Fr=_.binary,Gr=_.helpers;gt.protobufPackage="cosmos.crypto.secp256k1";function Ad(){return{key:new Uint8Array}}gt.PubKey={typeUrl:"/cosmos.crypto.secp256k1.PubKey",encode(e,n=Fr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Fr.BinaryReader?e:new Fr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Ad();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.key=t.bytes();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Ad();return(0,Gr.isSet)(e.key)&&(n.key=(0,Gr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Gr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=Ad();return n.key=e.key??new Uint8Array,n}};function Td(){return{key:new Uint8Array}}gt.PrivKey={typeUrl:"/cosmos.crypto.secp256k1.PrivKey",encode(e,n=Fr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Fr.BinaryReader?e:new Fr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Td();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.key=t.bytes();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Td();return(0,Gr.isSet)(e.key)&&(n.key=(0,Gr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Gr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=Td();return n.key=e.key??new Uint8Array,n}};Object.defineProperty(rt,"__esModule",{value:!0});rt.decodeOptionalPubkey=rt.decodePubkey=rt.anyToSinglePubkey=rt.encodePubkey=void 0;const eo=zn,Tl=ue,bS=Ne,Tu=ht,Nu=ur,wu=gt,Nd=_.any;function rm(e){if((0,eo.isSecp256k1Pubkey)(e)){const n=wu.PubKey.fromPartial({key:(0,Tl.fromBase64)(e.value)});return Nd.Any.fromPartial({typeUrl:"/cosmos.crypto.secp256k1.PubKey",value:Uint8Array.from(wu.PubKey.encode(n).finish())})}else if((0,eo.isEd25519Pubkey)(e)){const n=Tu.PubKey.fromPartial({key:(0,Tl.fromBase64)(e.value)});return Nd.Any.fromPartial({typeUrl:"/cosmos.crypto.ed25519.PubKey",value:Uint8Array.from(Tu.PubKey.encode(n).finish())})}else if((0,eo.isMultisigThresholdPubkey)(e)){const n=Nu.LegacyAminoPubKey.fromPartial({threshold:bS.Uint53.fromString(e.value.threshold).toNumber(),publicKeys:e.value.pubkeys.map(rm)});return Nd.Any.fromPartial({typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",value:Uint8Array.from(Nu.LegacyAminoPubKey.encode(n).finish())})}else throw new Error(`Pubkey type ${e.type} not recognized`)}rt.encodePubkey=rm;function _u(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":{const{key:n}=wu.PubKey.decode(e.value);return(0,eo.encodeSecp256k1Pubkey)(n)}case"/cosmos.crypto.ed25519.PubKey":{const{key:n}=Tu.PubKey.decode(e.value);return(0,eo.encodeEd25519Pubkey)(n)}default:throw new Error(`Pubkey type_url ${e.typeUrl} not recognized as single public key type`)}}rt.anyToSinglePubkey=_u;function im(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":case"/cosmos.crypto.ed25519.PubKey":return _u(e);case"/cosmos.crypto.multisig.LegacyAminoPubKey":{const{threshold:n,publicKeys:t}=Nu.LegacyAminoPubKey.decode(e.value);return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:n.toString(),pubkeys:t.map(_u)}}}default:throw new Error(`Pubkey type URL '${e.typeUrl}' not recognized`)}}rt.decodePubkey=im;function ES(e){if(!e)return null;if(e.typeUrl){if(e.value.length)return im(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}}rt.decodeOptionalPubkey=ES;var Cn={},Ka={},ac={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=e.DenomUnit=e.Supply=e.Output=e.Input=e.SendEnabled=e.Params=e.protobufPackage=void 0;const n=_.coin,t=_.binary,i=_.helpers;e.protobufPackage="cosmos.bank.v1beta1";function o(){return{sendEnabled:[],defaultSendEnabled:!1}}e.Params={typeUrl:"/cosmos.bank.v1beta1.Params",encode(b,p=t.BinaryWriter.create()){for(const S of b.sendEnabled)e.SendEnabled.encode(S,p.uint32(10).fork()).ldelim();return b.defaultSendEnabled===!0&&p.uint32(16).bool(b.defaultSendEnabled),p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=o();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.sendEnabled.push(e.SendEnabled.decode(S,S.uint32()));break;case 2:u.defaultSendEnabled=S.bool();break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=o();return Array.isArray(b==null?void 0:b.sendEnabled)&&(p.sendEnabled=b.sendEnabled.map(S=>e.SendEnabled.fromJSON(S))),(0,i.isSet)(b.defaultSendEnabled)&&(p.defaultSendEnabled=!!b.defaultSendEnabled),p},toJSON(b){const p={};return b.sendEnabled?p.sendEnabled=b.sendEnabled.map(S=>S?e.SendEnabled.toJSON(S):void 0):p.sendEnabled=[],b.defaultSendEnabled!==void 0&&(p.defaultSendEnabled=b.defaultSendEnabled),p},fromPartial(b){var S;const p=o();return p.sendEnabled=((S=b.sendEnabled)==null?void 0:S.map(R=>e.SendEnabled.fromPartial(R)))||[],p.defaultSendEnabled=b.defaultSendEnabled??!1,p}};function g(){return{denom:"",enabled:!1}}e.SendEnabled={typeUrl:"/cosmos.bank.v1beta1.SendEnabled",encode(b,p=t.BinaryWriter.create()){return b.denom!==""&&p.uint32(10).string(b.denom),b.enabled===!0&&p.uint32(16).bool(b.enabled),p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=g();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.denom=S.string();break;case 2:u.enabled=S.bool();break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=g();return(0,i.isSet)(b.denom)&&(p.denom=String(b.denom)),(0,i.isSet)(b.enabled)&&(p.enabled=!!b.enabled),p},toJSON(b){const p={};return b.denom!==void 0&&(p.denom=b.denom),b.enabled!==void 0&&(p.enabled=b.enabled),p},fromPartial(b){const p=g();return p.denom=b.denom??"",p.enabled=b.enabled??!1,p}};function C(){return{address:"",coins:[]}}e.Input={typeUrl:"/cosmos.bank.v1beta1.Input",encode(b,p=t.BinaryWriter.create()){b.address!==""&&p.uint32(10).string(b.address);for(const S of b.coins)n.Coin.encode(S,p.uint32(18).fork()).ldelim();return p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=C();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.address=S.string();break;case 2:u.coins.push(n.Coin.decode(S,S.uint32()));break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=C();return(0,i.isSet)(b.address)&&(p.address=String(b.address)),Array.isArray(b==null?void 0:b.coins)&&(p.coins=b.coins.map(S=>n.Coin.fromJSON(S))),p},toJSON(b){const p={};return b.address!==void 0&&(p.address=b.address),b.coins?p.coins=b.coins.map(S=>S?n.Coin.toJSON(S):void 0):p.coins=[],p},fromPartial(b){var S;const p=C();return p.address=b.address??"",p.coins=((S=b.coins)==null?void 0:S.map(R=>n.Coin.fromPartial(R)))||[],p}};function w(){return{address:"",coins:[]}}e.Output={typeUrl:"/cosmos.bank.v1beta1.Output",encode(b,p=t.BinaryWriter.create()){b.address!==""&&p.uint32(10).string(b.address);for(const S of b.coins)n.Coin.encode(S,p.uint32(18).fork()).ldelim();return p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=w();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.address=S.string();break;case 2:u.coins.push(n.Coin.decode(S,S.uint32()));break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=w();return(0,i.isSet)(b.address)&&(p.address=String(b.address)),Array.isArray(b==null?void 0:b.coins)&&(p.coins=b.coins.map(S=>n.Coin.fromJSON(S))),p},toJSON(b){const p={};return b.address!==void 0&&(p.address=b.address),b.coins?p.coins=b.coins.map(S=>S?n.Coin.toJSON(S):void 0):p.coins=[],p},fromPartial(b){var S;const p=w();return p.address=b.address??"",p.coins=((S=b.coins)==null?void 0:S.map(R=>n.Coin.fromPartial(R)))||[],p}};function E(){return{total:[]}}e.Supply={typeUrl:"/cosmos.bank.v1beta1.Supply",encode(b,p=t.BinaryWriter.create()){for(const S of b.total)n.Coin.encode(S,p.uint32(10).fork()).ldelim();return p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=E();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.total.push(n.Coin.decode(S,S.uint32()));break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=E();return Array.isArray(b==null?void 0:b.total)&&(p.total=b.total.map(S=>n.Coin.fromJSON(S))),p},toJSON(b){const p={};return b.total?p.total=b.total.map(S=>S?n.Coin.toJSON(S):void 0):p.total=[],p},fromPartial(b){var S;const p=E();return p.total=((S=b.total)==null?void 0:S.map(R=>n.Coin.fromPartial(R)))||[],p}};function D(){return{denom:"",exponent:0,aliases:[]}}e.DenomUnit={typeUrl:"/cosmos.bank.v1beta1.DenomUnit",encode(b,p=t.BinaryWriter.create()){b.denom!==""&&p.uint32(10).string(b.denom),b.exponent!==0&&p.uint32(16).uint32(b.exponent);for(const S of b.aliases)p.uint32(26).string(S);return p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=D();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.denom=S.string();break;case 2:u.exponent=S.uint32();break;case 3:u.aliases.push(S.string());break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=D();return(0,i.isSet)(b.denom)&&(p.denom=String(b.denom)),(0,i.isSet)(b.exponent)&&(p.exponent=Number(b.exponent)),Array.isArray(b==null?void 0:b.aliases)&&(p.aliases=b.aliases.map(S=>String(S))),p},toJSON(b){const p={};return b.denom!==void 0&&(p.denom=b.denom),b.exponent!==void 0&&(p.exponent=Math.round(b.exponent)),b.aliases?p.aliases=b.aliases.map(S=>S):p.aliases=[],p},fromPartial(b){var S;const p=D();return p.denom=b.denom??"",p.exponent=b.exponent??0,p.aliases=((S=b.aliases)==null?void 0:S.map(R=>R))||[],p}};function J(){return{description:"",denomUnits:[],base:"",display:"",name:"",symbol:"",uri:"",uriHash:""}}e.Metadata={typeUrl:"/cosmos.bank.v1beta1.Metadata",encode(b,p=t.BinaryWriter.create()){b.description!==""&&p.uint32(10).string(b.description);for(const S of b.denomUnits)e.DenomUnit.encode(S,p.uint32(18).fork()).ldelim();return b.base!==""&&p.uint32(26).string(b.base),b.display!==""&&p.uint32(34).string(b.display),b.name!==""&&p.uint32(42).string(b.name),b.symbol!==""&&p.uint32(50).string(b.symbol),b.uri!==""&&p.uint32(58).string(b.uri),b.uriHash!==""&&p.uint32(66).string(b.uriHash),p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=J();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.description=S.string();break;case 2:u.denomUnits.push(e.DenomUnit.decode(S,S.uint32()));break;case 3:u.base=S.string();break;case 4:u.display=S.string();break;case 5:u.name=S.string();break;case 6:u.symbol=S.string();break;case 7:u.uri=S.string();break;case 8:u.uriHash=S.string();break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=J();return(0,i.isSet)(b.description)&&(p.description=String(b.description)),Array.isArray(b==null?void 0:b.denomUnits)&&(p.denomUnits=b.denomUnits.map(S=>e.DenomUnit.fromJSON(S))),(0,i.isSet)(b.base)&&(p.base=String(b.base)),(0,i.isSet)(b.display)&&(p.display=String(b.display)),(0,i.isSet)(b.name)&&(p.name=String(b.name)),(0,i.isSet)(b.symbol)&&(p.symbol=String(b.symbol)),(0,i.isSet)(b.uri)&&(p.uri=String(b.uri)),(0,i.isSet)(b.uriHash)&&(p.uriHash=String(b.uriHash)),p},toJSON(b){const p={};return b.description!==void 0&&(p.description=b.description),b.denomUnits?p.denomUnits=b.denomUnits.map(S=>S?e.DenomUnit.toJSON(S):void 0):p.denomUnits=[],b.base!==void 0&&(p.base=b.base),b.display!==void 0&&(p.display=b.display),b.name!==void 0&&(p.name=b.name),b.symbol!==void 0&&(p.symbol=b.symbol),b.uri!==void 0&&(p.uri=b.uri),b.uriHash!==void 0&&(p.uriHash=b.uriHash),p},fromPartial(b){var S;const p=J();return p.description=b.description??"",p.denomUnits=((S=b.denomUnits)==null?void 0:S.map(R=>e.DenomUnit.fromPartial(R)))||[],p.base=b.base??"",p.display=b.display??"",p.name=b.name??"",p.symbol=b.symbol??"",p.uri=b.uri??"",p.uriHash=b.uriHash??"",p}}})(ac);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgSetSendEnabledResponse=e.MsgSetSendEnabled=e.MsgUpdateParamsResponse=e.MsgUpdateParams=e.MsgMultiSendResponse=e.MsgMultiSend=e.MsgSendResponse=e.MsgSend=e.protobufPackage=void 0;const n=_.coin,t=ac,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.bank.v1beta1";function g(){return{fromAddress:"",toAddress:"",amount:[]}}e.MsgSend={typeUrl:"/cosmos.bank.v1beta1.MsgSend",encode(R,u=i.BinaryWriter.create()){R.fromAddress!==""&&u.uint32(10).string(R.fromAddress),R.toAddress!==""&&u.uint32(18).string(R.toAddress);for(const c of R.amount)n.Coin.encode(c,u.uint32(26).fork()).ldelim();return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=g();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.fromAddress=c.string();break;case 2:B.toAddress=c.string();break;case 3:B.amount.push(n.Coin.decode(c,c.uint32()));break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=g();return(0,o.isSet)(R.fromAddress)&&(u.fromAddress=String(R.fromAddress)),(0,o.isSet)(R.toAddress)&&(u.toAddress=String(R.toAddress)),Array.isArray(R==null?void 0:R.amount)&&(u.amount=R.amount.map(c=>n.Coin.fromJSON(c))),u},toJSON(R){const u={};return R.fromAddress!==void 0&&(u.fromAddress=R.fromAddress),R.toAddress!==void 0&&(u.toAddress=R.toAddress),R.amount?u.amount=R.amount.map(c=>c?n.Coin.toJSON(c):void 0):u.amount=[],u},fromPartial(R){var c;const u=g();return u.fromAddress=R.fromAddress??"",u.toAddress=R.toAddress??"",u.amount=((c=R.amount)==null?void 0:c.map(y=>n.Coin.fromPartial(y)))||[],u}};function C(){return{}}e.MsgSendResponse={typeUrl:"/cosmos.bank.v1beta1.MsgSendResponse",encode(R,u=i.BinaryWriter.create()){return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=C();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){default:c.skipType(N&7);break}}return B},fromJSON(R){return C()},toJSON(R){return{}},fromPartial(R){return C()}};function w(){return{inputs:[],outputs:[]}}e.MsgMultiSend={typeUrl:"/cosmos.bank.v1beta1.MsgMultiSend",encode(R,u=i.BinaryWriter.create()){for(const c of R.inputs)t.Input.encode(c,u.uint32(10).fork()).ldelim();for(const c of R.outputs)t.Output.encode(c,u.uint32(18).fork()).ldelim();return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=w();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.inputs.push(t.Input.decode(c,c.uint32()));break;case 2:B.outputs.push(t.Output.decode(c,c.uint32()));break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=w();return Array.isArray(R==null?void 0:R.inputs)&&(u.inputs=R.inputs.map(c=>t.Input.fromJSON(c))),Array.isArray(R==null?void 0:R.outputs)&&(u.outputs=R.outputs.map(c=>t.Output.fromJSON(c))),u},toJSON(R){const u={};return R.inputs?u.inputs=R.inputs.map(c=>c?t.Input.toJSON(c):void 0):u.inputs=[],R.outputs?u.outputs=R.outputs.map(c=>c?t.Output.toJSON(c):void 0):u.outputs=[],u},fromPartial(R){var c,y;const u=w();return u.inputs=((c=R.inputs)==null?void 0:c.map(B=>t.Input.fromPartial(B)))||[],u.outputs=((y=R.outputs)==null?void 0:y.map(B=>t.Output.fromPartial(B)))||[],u}};function E(){return{}}e.MsgMultiSendResponse={typeUrl:"/cosmos.bank.v1beta1.MsgMultiSendResponse",encode(R,u=i.BinaryWriter.create()){return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=E();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){default:c.skipType(N&7);break}}return B},fromJSON(R){return E()},toJSON(R){return{}},fromPartial(R){return E()}};function D(){return{authority:"",params:t.Params.fromPartial({})}}e.MsgUpdateParams={typeUrl:"/cosmos.bank.v1beta1.MsgUpdateParams",encode(R,u=i.BinaryWriter.create()){return R.authority!==""&&u.uint32(10).string(R.authority),R.params!==void 0&&t.Params.encode(R.params,u.uint32(18).fork()).ldelim(),u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=D();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.authority=c.string();break;case 2:B.params=t.Params.decode(c,c.uint32());break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=D();return(0,o.isSet)(R.authority)&&(u.authority=String(R.authority)),(0,o.isSet)(R.params)&&(u.params=t.Params.fromJSON(R.params)),u},toJSON(R){const u={};return R.authority!==void 0&&(u.authority=R.authority),R.params!==void 0&&(u.params=R.params?t.Params.toJSON(R.params):void 0),u},fromPartial(R){const u=D();return u.authority=R.authority??"",R.params!==void 0&&R.params!==null&&(u.params=t.Params.fromPartial(R.params)),u}};function J(){return{}}e.MsgUpdateParamsResponse={typeUrl:"/cosmos.bank.v1beta1.MsgUpdateParamsResponse",encode(R,u=i.BinaryWriter.create()){return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=J();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){default:c.skipType(N&7);break}}return B},fromJSON(R){return J()},toJSON(R){return{}},fromPartial(R){return J()}};function b(){return{authority:"",sendEnabled:[],useDefaultFor:[]}}e.MsgSetSendEnabled={typeUrl:"/cosmos.bank.v1beta1.MsgSetSendEnabled",encode(R,u=i.BinaryWriter.create()){R.authority!==""&&u.uint32(10).string(R.authority);for(const c of R.sendEnabled)t.SendEnabled.encode(c,u.uint32(18).fork()).ldelim();for(const c of R.useDefaultFor)u.uint32(26).string(c);return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=b();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.authority=c.string();break;case 2:B.sendEnabled.push(t.SendEnabled.decode(c,c.uint32()));break;case 3:B.useDefaultFor.push(c.string());break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=b();return(0,o.isSet)(R.authority)&&(u.authority=String(R.authority)),Array.isArray(R==null?void 0:R.sendEnabled)&&(u.sendEnabled=R.sendEnabled.map(c=>t.SendEnabled.fromJSON(c))),Array.isArray(R==null?void 0:R.useDefaultFor)&&(u.useDefaultFor=R.useDefaultFor.map(c=>String(c))),u},toJSON(R){const u={};return R.authority!==void 0&&(u.authority=R.authority),R.sendEnabled?u.sendEnabled=R.sendEnabled.map(c=>c?t.SendEnabled.toJSON(c):void 0):u.sendEnabled=[],R.useDefaultFor?u.useDefaultFor=R.useDefaultFor.map(c=>c):u.useDefaultFor=[],u},fromPartial(R){var c,y;const u=b();return u.authority=R.authority??"",u.sendEnabled=((c=R.sendEnabled)==null?void 0:c.map(B=>t.SendEnabled.fromPartial(B)))||[],u.useDefaultFor=((y=R.useDefaultFor)==null?void 0:y.map(B=>B))||[],u}};function p(){return{}}e.MsgSetSendEnabledResponse={typeUrl:"/cosmos.bank.v1beta1.MsgSetSendEnabledResponse",encode(R,u=i.BinaryWriter.create()){return u},decode(R,u){const c=R instanceof i.BinaryReader?R:new i.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=p();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){default:c.skipType(N&7);break}}return B},fromJSON(R){return p()},toJSON(R){return{}},fromPartial(R){return p()}};class S{constructor(u){this.rpc=u,this.Send=this.Send.bind(this),this.MultiSend=this.MultiSend.bind(this),this.UpdateParams=this.UpdateParams.bind(this),this.SetSendEnabled=this.SetSendEnabled.bind(this)}Send(u){const c=e.MsgSend.encode(u).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","Send",c).then(B=>e.MsgSendResponse.decode(new i.BinaryReader(B)))}MultiSend(u){const c=e.MsgMultiSend.encode(u).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","MultiSend",c).then(B=>e.MsgMultiSendResponse.decode(new i.BinaryReader(B)))}UpdateParams(u){const c=e.MsgUpdateParams.encode(u).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","UpdateParams",c).then(B=>e.MsgUpdateParamsResponse.decode(new i.BinaryReader(B)))}SetSendEnabled(u){const c=e.MsgSetSendEnabled.encode(u).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","SetSendEnabled",c).then(B=>e.MsgSetSendEnabledResponse.decode(new i.BinaryReader(B)))}}e.MsgClientImpl=S})(Ka);Object.defineProperty(Cn,"__esModule",{value:!0});Cn.Registry=Cn.isTxBodyEncodeObject=Cn.isPbjsGeneratedType=Cn.isTsProtoGeneratedType=Cn.isTelescopeGeneratedType=void 0;const IS=Ka,OS=_.coin,wd=_.tx,AS=_.any;function om(e){const n=e;return typeof n.fromPartial=="function"&&typeof n.typeUrl=="string"}Cn.isTelescopeGeneratedType=om;function sc(e){return typeof e.fromPartial=="function"}Cn.isTsProtoGeneratedType=sc;function TS(e){return!sc(e)}Cn.isPbjsGeneratedType=TS;const Nl={cosmosCoin:"/cosmos.base.v1beta1.Coin",cosmosMsgSend:"/cosmos.bank.v1beta1.MsgSend",cosmosTxBody:"/cosmos.tx.v1beta1.TxBody",googleAny:"/google.protobuf.Any"};function am(e){return e.typeUrl==="/cosmos.tx.v1beta1.TxBody"}Cn.isTxBodyEncodeObject=am;class NS{constructor(n){const{cosmosCoin:t,cosmosMsgSend:i}=Nl;this.types=n?new Map([...n]):new Map([[t,OS.Coin],[i,IS.MsgSend]])}register(n,t){this.types.set(n,t)}lookupType(n){return this.types.get(n)}lookupTypeWithError(n){const t=this.lookupType(n);if(!t)throw new Error(`Unregistered type url: ${n}`);return t}encode(n){const{value:t,typeUrl:i}=n;if(am(n))return this.encodeTxBody(t);const o=this.lookupTypeWithError(i),g=om(o)||sc(o)?o.fromPartial(t):o.create(t);return o.encode(g).finish()}encodeAsAny(n){const t=this.encode(n);return AS.Any.fromPartial({typeUrl:n.typeUrl,value:t})}encodeTxBody(n){var o;const t=n.messages.map(g=>this.encodeAsAny(g)),i=wd.TxBody.fromPartial({...n,timeoutHeight:BigInt(((o=n.timeoutHeight)==null?void 0:o.toString())??"0"),messages:t});return wd.TxBody.encode(i).finish()}decode({typeUrl:n,value:t}){if(n===Nl.cosmosTxBody)return this.decodeTxBody(t);const o=this.lookupTypeWithError(n).decode(t);return Object.entries(o).forEach(([g,C])=>{typeof L.dist.Buffer<"u"&&typeof L.dist.Buffer.isBuffer<"u"&&L.dist.Buffer.isBuffer(C)&&(o[g]=Uint8Array.from(C))}),o}decodeTxBody(n){const t=wd.TxBody.decode(n);return{...t,messages:t.messages.map(({typeUrl:i,value:o})=>{if(!i)throw new Error("Missing type_url in Any");if(!o)throw new Error("Missing value in Any");return this.decode({typeUrl:i,value:o})})}}}Cn.Registry=NS;var xa={};Object.defineProperty(xa,"__esModule",{value:!0});xa.isOfflineDirectSigner=void 0;function wS(e){return e.signDirect!==void 0}xa.isOfflineDirectSigner=wS;(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 n=Ha;Object.defineProperty(e,"decodeTxRaw",{enumerable:!0,get:function(){return n.decodeTxRaw}});var t=jr;Object.defineProperty(e,"DirectSecp256k1HdWallet",{enumerable:!0,get:function(){return t.DirectSecp256k1HdWallet}}),Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return t.extractKdfConfiguration}});var i=La;Object.defineProperty(e,"DirectSecp256k1Wallet",{enumerable:!0,get:function(){return i.DirectSecp256k1Wallet}});var o=$a;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return o.makeCosmoshubPath}});var g=rt;Object.defineProperty(e,"anyToSinglePubkey",{enumerable:!0,get:function(){return g.anyToSinglePubkey}}),Object.defineProperty(e,"decodeOptionalPubkey",{enumerable:!0,get:function(){return g.decodeOptionalPubkey}}),Object.defineProperty(e,"decodePubkey",{enumerable:!0,get:function(){return g.decodePubkey}}),Object.defineProperty(e,"encodePubkey",{enumerable:!0,get:function(){return g.encodePubkey}});var C=Cn;Object.defineProperty(e,"isPbjsGeneratedType",{enumerable:!0,get:function(){return C.isPbjsGeneratedType}}),Object.defineProperty(e,"isTsProtoGeneratedType",{enumerable:!0,get:function(){return C.isTsProtoGeneratedType}}),Object.defineProperty(e,"isTxBodyEncodeObject",{enumerable:!0,get:function(){return C.isTxBodyEncodeObject}}),Object.defineProperty(e,"Registry",{enumerable:!0,get:function(){return C.Registry}});var w=xa;Object.defineProperty(e,"isOfflineDirectSigner",{enumerable:!0,get:function(){return w.isOfflineDirectSigner}});var E=st;Object.defineProperty(e,"makeAuthInfoBytes",{enumerable:!0,get:function(){return E.makeAuthInfoBytes}}),Object.defineProperty(e,"makeSignBytes",{enumerable:!0,get:function(){return E.makeSignBytes}}),Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return E.makeSignDoc}});var D=ic;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return D.executeKdf}});var J=zn;Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return J.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return J.coins}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return J.parseCoins}})})(ut);var vo={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Params=e.ModuleCredential=e.ModuleAccount=e.BaseAccount=e.protobufPackage=void 0;const n=_.any,t=_.binary,i=_.helpers;e.protobufPackage="cosmos.auth.v1beta1";function o(){return{address:"",pubKey:void 0,accountNumber:BigInt(0),sequence:BigInt(0)}}e.BaseAccount={typeUrl:"/cosmos.auth.v1beta1.BaseAccount",encode(E,D=t.BinaryWriter.create()){return E.address!==""&&D.uint32(10).string(E.address),E.pubKey!==void 0&&n.Any.encode(E.pubKey,D.uint32(18).fork()).ldelim(),E.accountNumber!==BigInt(0)&&D.uint32(24).uint64(E.accountNumber),E.sequence!==BigInt(0)&&D.uint32(32).uint64(E.sequence),D},decode(E,D){const J=E instanceof t.BinaryReader?E:new t.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=o();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.address=J.string();break;case 2:p.pubKey=n.Any.decode(J,J.uint32());break;case 3:p.accountNumber=J.uint64();break;case 4:p.sequence=J.uint64();break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=o();return(0,i.isSet)(E.address)&&(D.address=String(E.address)),(0,i.isSet)(E.pubKey)&&(D.pubKey=n.Any.fromJSON(E.pubKey)),(0,i.isSet)(E.accountNumber)&&(D.accountNumber=BigInt(E.accountNumber.toString())),(0,i.isSet)(E.sequence)&&(D.sequence=BigInt(E.sequence.toString())),D},toJSON(E){const D={};return E.address!==void 0&&(D.address=E.address),E.pubKey!==void 0&&(D.pubKey=E.pubKey?n.Any.toJSON(E.pubKey):void 0),E.accountNumber!==void 0&&(D.accountNumber=(E.accountNumber||BigInt(0)).toString()),E.sequence!==void 0&&(D.sequence=(E.sequence||BigInt(0)).toString()),D},fromPartial(E){const D=o();return D.address=E.address??"",E.pubKey!==void 0&&E.pubKey!==null&&(D.pubKey=n.Any.fromPartial(E.pubKey)),E.accountNumber!==void 0&&E.accountNumber!==null&&(D.accountNumber=BigInt(E.accountNumber.toString())),E.sequence!==void 0&&E.sequence!==null&&(D.sequence=BigInt(E.sequence.toString())),D}};function g(){return{baseAccount:void 0,name:"",permissions:[]}}e.ModuleAccount={typeUrl:"/cosmos.auth.v1beta1.ModuleAccount",encode(E,D=t.BinaryWriter.create()){E.baseAccount!==void 0&&e.BaseAccount.encode(E.baseAccount,D.uint32(10).fork()).ldelim(),E.name!==""&&D.uint32(18).string(E.name);for(const J of E.permissions)D.uint32(26).string(J);return D},decode(E,D){const J=E instanceof t.BinaryReader?E:new t.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=g();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.baseAccount=e.BaseAccount.decode(J,J.uint32());break;case 2:p.name=J.string();break;case 3:p.permissions.push(J.string());break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=g();return(0,i.isSet)(E.baseAccount)&&(D.baseAccount=e.BaseAccount.fromJSON(E.baseAccount)),(0,i.isSet)(E.name)&&(D.name=String(E.name)),Array.isArray(E==null?void 0:E.permissions)&&(D.permissions=E.permissions.map(J=>String(J))),D},toJSON(E){const D={};return E.baseAccount!==void 0&&(D.baseAccount=E.baseAccount?e.BaseAccount.toJSON(E.baseAccount):void 0),E.name!==void 0&&(D.name=E.name),E.permissions?D.permissions=E.permissions.map(J=>J):D.permissions=[],D},fromPartial(E){var J;const D=g();return E.baseAccount!==void 0&&E.baseAccount!==null&&(D.baseAccount=e.BaseAccount.fromPartial(E.baseAccount)),D.name=E.name??"",D.permissions=((J=E.permissions)==null?void 0:J.map(b=>b))||[],D}};function C(){return{moduleName:"",derivationKeys:[]}}e.ModuleCredential={typeUrl:"/cosmos.auth.v1beta1.ModuleCredential",encode(E,D=t.BinaryWriter.create()){E.moduleName!==""&&D.uint32(10).string(E.moduleName);for(const J of E.derivationKeys)D.uint32(18).bytes(J);return D},decode(E,D){const J=E instanceof t.BinaryReader?E:new t.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=C();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.moduleName=J.string();break;case 2:p.derivationKeys.push(J.bytes());break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=C();return(0,i.isSet)(E.moduleName)&&(D.moduleName=String(E.moduleName)),Array.isArray(E==null?void 0:E.derivationKeys)&&(D.derivationKeys=E.derivationKeys.map(J=>(0,i.bytesFromBase64)(J))),D},toJSON(E){const D={};return E.moduleName!==void 0&&(D.moduleName=E.moduleName),E.derivationKeys?D.derivationKeys=E.derivationKeys.map(J=>(0,i.base64FromBytes)(J!==void 0?J:new Uint8Array)):D.derivationKeys=[],D},fromPartial(E){var J;const D=C();return D.moduleName=E.moduleName??"",D.derivationKeys=((J=E.derivationKeys)==null?void 0:J.map(b=>b))||[],D}};function w(){return{maxMemoCharacters:BigInt(0),txSigLimit:BigInt(0),txSizeCostPerByte:BigInt(0),sigVerifyCostEd25519:BigInt(0),sigVerifyCostSecp256k1:BigInt(0)}}e.Params={typeUrl:"/cosmos.auth.v1beta1.Params",encode(E,D=t.BinaryWriter.create()){return E.maxMemoCharacters!==BigInt(0)&&D.uint32(8).uint64(E.maxMemoCharacters),E.txSigLimit!==BigInt(0)&&D.uint32(16).uint64(E.txSigLimit),E.txSizeCostPerByte!==BigInt(0)&&D.uint32(24).uint64(E.txSizeCostPerByte),E.sigVerifyCostEd25519!==BigInt(0)&&D.uint32(32).uint64(E.sigVerifyCostEd25519),E.sigVerifyCostSecp256k1!==BigInt(0)&&D.uint32(40).uint64(E.sigVerifyCostSecp256k1),D},decode(E,D){const J=E instanceof t.BinaryReader?E:new t.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=w();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.maxMemoCharacters=J.uint64();break;case 2:p.txSigLimit=J.uint64();break;case 3:p.txSizeCostPerByte=J.uint64();break;case 4:p.sigVerifyCostEd25519=J.uint64();break;case 5:p.sigVerifyCostSecp256k1=J.uint64();break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=w();return(0,i.isSet)(E.maxMemoCharacters)&&(D.maxMemoCharacters=BigInt(E.maxMemoCharacters.toString())),(0,i.isSet)(E.txSigLimit)&&(D.txSigLimit=BigInt(E.txSigLimit.toString())),(0,i.isSet)(E.txSizeCostPerByte)&&(D.txSizeCostPerByte=BigInt(E.txSizeCostPerByte.toString())),(0,i.isSet)(E.sigVerifyCostEd25519)&&(D.sigVerifyCostEd25519=BigInt(E.sigVerifyCostEd25519.toString())),(0,i.isSet)(E.sigVerifyCostSecp256k1)&&(D.sigVerifyCostSecp256k1=BigInt(E.sigVerifyCostSecp256k1.toString())),D},toJSON(E){const D={};return E.maxMemoCharacters!==void 0&&(D.maxMemoCharacters=(E.maxMemoCharacters||BigInt(0)).toString()),E.txSigLimit!==void 0&&(D.txSigLimit=(E.txSigLimit||BigInt(0)).toString()),E.txSizeCostPerByte!==void 0&&(D.txSizeCostPerByte=(E.txSizeCostPerByte||BigInt(0)).toString()),E.sigVerifyCostEd25519!==void 0&&(D.sigVerifyCostEd25519=(E.sigVerifyCostEd25519||BigInt(0)).toString()),E.sigVerifyCostSecp256k1!==void 0&&(D.sigVerifyCostSecp256k1=(E.sigVerifyCostSecp256k1||BigInt(0)).toString()),D},fromPartial(E){const D=w();return E.maxMemoCharacters!==void 0&&E.maxMemoCharacters!==null&&(D.maxMemoCharacters=BigInt(E.maxMemoCharacters.toString())),E.txSigLimit!==void 0&&E.txSigLimit!==null&&(D.txSigLimit=BigInt(E.txSigLimit.toString())),E.txSizeCostPerByte!==void 0&&E.txSizeCostPerByte!==null&&(D.txSizeCostPerByte=BigInt(E.txSizeCostPerByte.toString())),E.sigVerifyCostEd25519!==void 0&&E.sigVerifyCostEd25519!==null&&(D.sigVerifyCostEd25519=BigInt(E.sigVerifyCostEd25519.toString())),E.sigVerifyCostSecp256k1!==void 0&&E.sigVerifyCostSecp256k1!==null&&(D.sigVerifyCostSecp256k1=BigInt(E.sigVerifyCostSecp256k1.toString())),D}}})(vo);var za={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PermanentLockedAccount=e.PeriodicVestingAccount=e.Period=e.DelayedVestingAccount=e.ContinuousVestingAccount=e.BaseVestingAccount=e.protobufPackage=void 0;const n=vo,t=_.coin,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.vesting.v1beta1";function g(){return{baseAccount:void 0,originalVesting:[],delegatedFree:[],delegatedVesting:[],endTime:BigInt(0)}}e.BaseVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.BaseVestingAccount",encode(b,p=i.BinaryWriter.create()){b.baseAccount!==void 0&&n.BaseAccount.encode(b.baseAccount,p.uint32(10).fork()).ldelim();for(const S of b.originalVesting)t.Coin.encode(S,p.uint32(18).fork()).ldelim();for(const S of b.delegatedFree)t.Coin.encode(S,p.uint32(26).fork()).ldelim();for(const S of b.delegatedVesting)t.Coin.encode(S,p.uint32(34).fork()).ldelim();return b.endTime!==BigInt(0)&&p.uint32(40).int64(b.endTime),p},decode(b,p){const S=b instanceof i.BinaryReader?b:new i.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=g();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.baseAccount=n.BaseAccount.decode(S,S.uint32());break;case 2:u.originalVesting.push(t.Coin.decode(S,S.uint32()));break;case 3:u.delegatedFree.push(t.Coin.decode(S,S.uint32()));break;case 4:u.delegatedVesting.push(t.Coin.decode(S,S.uint32()));break;case 5:u.endTime=S.int64();break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=g();return(0,o.isSet)(b.baseAccount)&&(p.baseAccount=n.BaseAccount.fromJSON(b.baseAccount)),Array.isArray(b==null?void 0:b.originalVesting)&&(p.originalVesting=b.originalVesting.map(S=>t.Coin.fromJSON(S))),Array.isArray(b==null?void 0:b.delegatedFree)&&(p.delegatedFree=b.delegatedFree.map(S=>t.Coin.fromJSON(S))),Array.isArray(b==null?void 0:b.delegatedVesting)&&(p.delegatedVesting=b.delegatedVesting.map(S=>t.Coin.fromJSON(S))),(0,o.isSet)(b.endTime)&&(p.endTime=BigInt(b.endTime.toString())),p},toJSON(b){const p={};return b.baseAccount!==void 0&&(p.baseAccount=b.baseAccount?n.BaseAccount.toJSON(b.baseAccount):void 0),b.originalVesting?p.originalVesting=b.originalVesting.map(S=>S?t.Coin.toJSON(S):void 0):p.originalVesting=[],b.delegatedFree?p.delegatedFree=b.delegatedFree.map(S=>S?t.Coin.toJSON(S):void 0):p.delegatedFree=[],b.delegatedVesting?p.delegatedVesting=b.delegatedVesting.map(S=>S?t.Coin.toJSON(S):void 0):p.delegatedVesting=[],b.endTime!==void 0&&(p.endTime=(b.endTime||BigInt(0)).toString()),p},fromPartial(b){var S,R,u;const p=g();return b.baseAccount!==void 0&&b.baseAccount!==null&&(p.baseAccount=n.BaseAccount.fromPartial(b.baseAccount)),p.originalVesting=((S=b.originalVesting)==null?void 0:S.map(c=>t.Coin.fromPartial(c)))||[],p.delegatedFree=((R=b.delegatedFree)==null?void 0:R.map(c=>t.Coin.fromPartial(c)))||[],p.delegatedVesting=((u=b.delegatedVesting)==null?void 0:u.map(c=>t.Coin.fromPartial(c)))||[],b.endTime!==void 0&&b.endTime!==null&&(p.endTime=BigInt(b.endTime.toString())),p}};function C(){return{baseVestingAccount:void 0,startTime:BigInt(0)}}e.ContinuousVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.ContinuousVestingAccount",encode(b,p=i.BinaryWriter.create()){return b.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(b.baseVestingAccount,p.uint32(10).fork()).ldelim(),b.startTime!==BigInt(0)&&p.uint32(16).int64(b.startTime),p},decode(b,p){const S=b instanceof i.BinaryReader?b:new i.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=C();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.baseVestingAccount=e.BaseVestingAccount.decode(S,S.uint32());break;case 2:u.startTime=S.int64();break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=C();return(0,o.isSet)(b.baseVestingAccount)&&(p.baseVestingAccount=e.BaseVestingAccount.fromJSON(b.baseVestingAccount)),(0,o.isSet)(b.startTime)&&(p.startTime=BigInt(b.startTime.toString())),p},toJSON(b){const p={};return b.baseVestingAccount!==void 0&&(p.baseVestingAccount=b.baseVestingAccount?e.BaseVestingAccount.toJSON(b.baseVestingAccount):void 0),b.startTime!==void 0&&(p.startTime=(b.startTime||BigInt(0)).toString()),p},fromPartial(b){const p=C();return b.baseVestingAccount!==void 0&&b.baseVestingAccount!==null&&(p.baseVestingAccount=e.BaseVestingAccount.fromPartial(b.baseVestingAccount)),b.startTime!==void 0&&b.startTime!==null&&(p.startTime=BigInt(b.startTime.toString())),p}};function w(){return{baseVestingAccount:void 0}}e.DelayedVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.DelayedVestingAccount",encode(b,p=i.BinaryWriter.create()){return b.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(b.baseVestingAccount,p.uint32(10).fork()).ldelim(),p},decode(b,p){const S=b instanceof i.BinaryReader?b:new i.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=w();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.baseVestingAccount=e.BaseVestingAccount.decode(S,S.uint32());break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=w();return(0,o.isSet)(b.baseVestingAccount)&&(p.baseVestingAccount=e.BaseVestingAccount.fromJSON(b.baseVestingAccount)),p},toJSON(b){const p={};return b.baseVestingAccount!==void 0&&(p.baseVestingAccount=b.baseVestingAccount?e.BaseVestingAccount.toJSON(b.baseVestingAccount):void 0),p},fromPartial(b){const p=w();return b.baseVestingAccount!==void 0&&b.baseVestingAccount!==null&&(p.baseVestingAccount=e.BaseVestingAccount.fromPartial(b.baseVestingAccount)),p}};function E(){return{length:BigInt(0),amount:[]}}e.Period={typeUrl:"/cosmos.vesting.v1beta1.Period",encode(b,p=i.BinaryWriter.create()){b.length!==BigInt(0)&&p.uint32(8).int64(b.length);for(const S of b.amount)t.Coin.encode(S,p.uint32(18).fork()).ldelim();return p},decode(b,p){const S=b instanceof i.BinaryReader?b:new i.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=E();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.length=S.int64();break;case 2:u.amount.push(t.Coin.decode(S,S.uint32()));break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=E();return(0,o.isSet)(b.length)&&(p.length=BigInt(b.length.toString())),Array.isArray(b==null?void 0:b.amount)&&(p.amount=b.amount.map(S=>t.Coin.fromJSON(S))),p},toJSON(b){const p={};return b.length!==void 0&&(p.length=(b.length||BigInt(0)).toString()),b.amount?p.amount=b.amount.map(S=>S?t.Coin.toJSON(S):void 0):p.amount=[],p},fromPartial(b){var S;const p=E();return b.length!==void 0&&b.length!==null&&(p.length=BigInt(b.length.toString())),p.amount=((S=b.amount)==null?void 0:S.map(R=>t.Coin.fromPartial(R)))||[],p}};function D(){return{baseVestingAccount:void 0,startTime:BigInt(0),vestingPeriods:[]}}e.PeriodicVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.PeriodicVestingAccount",encode(b,p=i.BinaryWriter.create()){b.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(b.baseVestingAccount,p.uint32(10).fork()).ldelim(),b.startTime!==BigInt(0)&&p.uint32(16).int64(b.startTime);for(const S of b.vestingPeriods)e.Period.encode(S,p.uint32(26).fork()).ldelim();return p},decode(b,p){const S=b instanceof i.BinaryReader?b:new i.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=D();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.baseVestingAccount=e.BaseVestingAccount.decode(S,S.uint32());break;case 2:u.startTime=S.int64();break;case 3:u.vestingPeriods.push(e.Period.decode(S,S.uint32()));break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=D();return(0,o.isSet)(b.baseVestingAccount)&&(p.baseVestingAccount=e.BaseVestingAccount.fromJSON(b.baseVestingAccount)),(0,o.isSet)(b.startTime)&&(p.startTime=BigInt(b.startTime.toString())),Array.isArray(b==null?void 0:b.vestingPeriods)&&(p.vestingPeriods=b.vestingPeriods.map(S=>e.Period.fromJSON(S))),p},toJSON(b){const p={};return b.baseVestingAccount!==void 0&&(p.baseVestingAccount=b.baseVestingAccount?e.BaseVestingAccount.toJSON(b.baseVestingAccount):void 0),b.startTime!==void 0&&(p.startTime=(b.startTime||BigInt(0)).toString()),b.vestingPeriods?p.vestingPeriods=b.vestingPeriods.map(S=>S?e.Period.toJSON(S):void 0):p.vestingPeriods=[],p},fromPartial(b){var S;const p=D();return b.baseVestingAccount!==void 0&&b.baseVestingAccount!==null&&(p.baseVestingAccount=e.BaseVestingAccount.fromPartial(b.baseVestingAccount)),b.startTime!==void 0&&b.startTime!==null&&(p.startTime=BigInt(b.startTime.toString())),p.vestingPeriods=((S=b.vestingPeriods)==null?void 0:S.map(R=>e.Period.fromPartial(R)))||[],p}};function J(){return{baseVestingAccount:void 0}}e.PermanentLockedAccount={typeUrl:"/cosmos.vesting.v1beta1.PermanentLockedAccount",encode(b,p=i.BinaryWriter.create()){return b.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(b.baseVestingAccount,p.uint32(10).fork()).ldelim(),p},decode(b,p){const S=b instanceof i.BinaryReader?b:new i.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=J();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.baseVestingAccount=e.BaseVestingAccount.decode(S,S.uint32());break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=J();return(0,o.isSet)(b.baseVestingAccount)&&(p.baseVestingAccount=e.BaseVestingAccount.fromJSON(b.baseVestingAccount)),p},toJSON(b){const p={};return b.baseVestingAccount!==void 0&&(p.baseVestingAccount=b.baseVestingAccount?e.BaseVestingAccount.toJSON(b.baseVestingAccount):void 0),p},fromPartial(b){const p=J();return b.baseVestingAccount!==void 0&&b.baseVestingAccount!==null&&(p.baseVestingAccount=e.BaseVestingAccount.fromPartial(b.baseVestingAccount)),p}}})(za);Object.defineProperty(yo,"__esModule",{value:!0});yo.accountFromAny=void 0;const _S=Ne,MS=ut,Qi=Ie,wl=vo,Lo=za;function _l(e){return _S.Uint64.fromString(e.toString())}function Cr(e){const{address:n,pubKey:t,accountNumber:i,sequence:o}=e,g=(0,MS.decodeOptionalPubkey)(t);return{address:n,pubkey:g,accountNumber:_l(i).toNumber(),sequence:_l(o).toNumber()}}function US(e){var i,o,g,C,w,E,D;const{typeUrl:n,value:t}=e;switch(n){case"/cosmos.auth.v1beta1.BaseAccount":return Cr(wl.BaseAccount.decode(t));case"/cosmos.auth.v1beta1.ModuleAccount":{const J=wl.ModuleAccount.decode(t).baseAccount;return(0,Qi.assert)(J),Cr(J)}case"/cosmos.vesting.v1beta1.BaseVestingAccount":{const J=(i=Lo.BaseVestingAccount.decode(t))==null?void 0:i.baseAccount;return(0,Qi.assert)(J),Cr(J)}case"/cosmos.vesting.v1beta1.ContinuousVestingAccount":{const J=(g=(o=Lo.ContinuousVestingAccount.decode(t))==null?void 0:o.baseVestingAccount)==null?void 0:g.baseAccount;return(0,Qi.assert)(J),Cr(J)}case"/cosmos.vesting.v1beta1.DelayedVestingAccount":{const J=(w=(C=Lo.DelayedVestingAccount.decode(t))==null?void 0:C.baseVestingAccount)==null?void 0:w.baseAccount;return(0,Qi.assert)(J),Cr(J)}case"/cosmos.vesting.v1beta1.PeriodicVestingAccount":{const J=(D=(E=Lo.PeriodicVestingAccount.decode(t))==null?void 0:E.baseVestingAccount)==null?void 0:D.baseAccount;return(0,Qi.assert)(J),Cr(J)}default:throw new Error(`Unsupported type: '${n}'`)}}yo.accountFromAny=US;var Co={};Object.defineProperty(Co,"__esModule",{value:!0});Co.AminoTypes=void 0;class DS{constructor(n){this.register=n}toAmino({typeUrl:n,value:t}){const i=this.register[n];if(!i)throw new Error(`Type URL '${n}' 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:i.aminoType,value:i.toAmino(t)}}fromAmino({type:n,value:t}){const i=Object.entries(this.register).filter(([o,{aminoType:g}])=>g===n);switch(i.length){case 0:throw new Error(`Amino type identifier '${n}' 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,g]=i[0];return{typeUrl:o,value:g.fromAmino(t)}}default:throw new Error(`Multiple types are registered with Amino type identifier '${n}': '`+i.map(([o,g])=>o).sort().join("', '")+"'. Thus fromAmino cannot be performed.")}}}Co.AminoTypes=DS;var Ro={};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.fromTendermintEvent=void 0;const Ml=ue;function JS(e){return{type:e.type,attributes:e.attributes.map(n=>({key:typeof n.key=="string"?n.key:(0,Ml.fromUtf8)(n.key,!0),value:typeof n.value=="string"?n.value:(0,Ml.fromUtf8)(n.value,!0)}))}}Ro.fromTendermintEvent=JS;var cr={};Object.defineProperty(cr,"__esModule",{value:!0});cr.calculateFee=cr.GasPrice=void 0;const sm=Ne,HS=ut;function qS(e){if(e.length<3||e.length>128)throw new Error("Denom must be between 3 and 128 characters")}class Ya{constructor(n,t){this.amount=n,this.denom=t}static fromString(n){const t=n.match(/^([0-9.]+)([a-zA-Z][a-zA-Z0-9/:._-]*)$/);if(!t)throw new Error("Invalid gas price string");const[i,o,g]=t;qS(g);const w=sm.Decimal.fromUserInput(o,18);return new Ya(w,g)}toString(){return this.amount.toString()+this.denom}}cr.GasPrice=Ya;function VS(e,n){const t=typeof n=="string"?Ya.fromString(n):n,{denom:i,amount:o}=t,g=o.multiply(new sm.Uint53(e)).ceil().toString();return{amount:(0,HS.coins)(g,i),gas:e.toString()}}cr.calculateFee=VS;var rn={};Object.defineProperty(rn,"__esModule",{value:!0});rn.findAttribute=rn.parseRawLog=rn.parseLogs=rn.parseLog=rn.parseEvent=rn.parseAttribute=void 0;const dc=Ie;function dm(e){if(!(0,dc.isNonNullObject)(e))throw new Error("Attribute must be a non-null object");const{key:n,value:t}=e;if(typeof n!="string"||!n)throw new Error("Attribute's key must be a non-empty string");if(typeof t!="string"&&typeof t<"u")throw new Error("Attribute's value must be a string or unset");return{key:n,value:t||""}}rn.parseAttribute=dm;function um(e){if(!(0,dc.isNonNullObject)(e))throw new Error("Event must be a non-null object");const{type:n,attributes:t}=e;if(typeof n!="string"||n==="")throw new Error("Event type must be a non-empty string");if(!Array.isArray(t))throw new Error("Event's attributes must be an array");return{type:n,attributes:t.map(dm)}}rn.parseEvent=um;function cm(e){if(!(0,dc.isNonNullObject)(e))throw new Error("Log must be a non-null object");const{msg_index:n,log:t,events:i}=e;if(typeof n!="number")throw new Error("Log's msg_index must be a number");if(typeof t!="string")throw new Error("Log's log must be a string");if(!Array.isArray(i))throw new Error("Log's events must be an array");return{msg_index:n,log:t,events:i.map(um)}}rn.parseLog=cm;function lm(e){if(!Array.isArray(e))throw new Error("Logs must be an array");return e.map(cm)}rn.parseLogs=lm;function WS(e){if(!e)return[];const n=JSON.parse(e).map(({events:t},i)=>({msg_index:i,events:t,log:""}));return lm(n)}rn.parseRawLog=WS;function QS(e,n,t){var g;const i=e.find(()=>!0),o=(g=i==null?void 0:i.events.find(C=>C.type===n))==null?void 0:g.attributes.find(C=>C.key===t);if(!o)throw new Error(`Could not find attribute '${t}' in first event of type '${n}' in first log.`);return o}rn.findAttribute=QS;var co={},Za={},uc={},Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.PageResponse=Be.PageRequest=Be.protobufPackage=void 0;const Lr=_.binary,Vn=_.helpers;Be.protobufPackage="cosmos.base.query.v1beta1";function _d(){return{key:new Uint8Array,offset:BigInt(0),limit:BigInt(0),countTotal:!1,reverse:!1}}Be.PageRequest={typeUrl:"/cosmos.base.query.v1beta1.PageRequest",encode(e,n=Lr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),e.offset!==BigInt(0)&&n.uint32(16).uint64(e.offset),e.limit!==BigInt(0)&&n.uint32(24).uint64(e.limit),e.countTotal===!0&&n.uint32(32).bool(e.countTotal),e.reverse===!0&&n.uint32(40).bool(e.reverse),n},decode(e,n){const t=e instanceof Lr.BinaryReader?e:new Lr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=_d();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.key=t.bytes();break;case 2:o.offset=t.uint64();break;case 3:o.limit=t.uint64();break;case 4:o.countTotal=t.bool();break;case 5:o.reverse=t.bool();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=_d();return(0,Vn.isSet)(e.key)&&(n.key=(0,Vn.bytesFromBase64)(e.key)),(0,Vn.isSet)(e.offset)&&(n.offset=BigInt(e.offset.toString())),(0,Vn.isSet)(e.limit)&&(n.limit=BigInt(e.limit.toString())),(0,Vn.isSet)(e.countTotal)&&(n.countTotal=!!e.countTotal),(0,Vn.isSet)(e.reverse)&&(n.reverse=!!e.reverse),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Vn.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),e.offset!==void 0&&(n.offset=(e.offset||BigInt(0)).toString()),e.limit!==void 0&&(n.limit=(e.limit||BigInt(0)).toString()),e.countTotal!==void 0&&(n.countTotal=e.countTotal),e.reverse!==void 0&&(n.reverse=e.reverse),n},fromPartial(e){const n=_d();return n.key=e.key??new Uint8Array,e.offset!==void 0&&e.offset!==null&&(n.offset=BigInt(e.offset.toString())),e.limit!==void 0&&e.limit!==null&&(n.limit=BigInt(e.limit.toString())),n.countTotal=e.countTotal??!1,n.reverse=e.reverse??!1,n}};function Md(){return{nextKey:new Uint8Array,total:BigInt(0)}}Be.PageResponse={typeUrl:"/cosmos.base.query.v1beta1.PageResponse",encode(e,n=Lr.BinaryWriter.create()){return e.nextKey.length!==0&&n.uint32(10).bytes(e.nextKey),e.total!==BigInt(0)&&n.uint32(16).uint64(e.total),n},decode(e,n){const t=e instanceof Lr.BinaryReader?e:new Lr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Md();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.nextKey=t.bytes();break;case 2:o.total=t.uint64();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Md();return(0,Vn.isSet)(e.nextKey)&&(n.nextKey=(0,Vn.bytesFromBase64)(e.nextKey)),(0,Vn.isSet)(e.total)&&(n.total=BigInt(e.total.toString())),n},toJSON(e){const n={};return e.nextKey!==void 0&&(n.nextKey=(0,Vn.base64FromBytes)(e.nextKey!==void 0?e.nextKey:new Uint8Array)),e.total!==void 0&&(n.total=(e.total||BigInt(0)).toString()),n},fromPartial(e){const n=Md();return n.nextKey=e.nextKey??new Uint8Array,e.total!==void 0&&e.total!==null&&(n.total=BigInt(e.total.toString())),n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryAccountInfoResponse=e.QueryAccountInfoRequest=e.QueryAccountAddressByIDResponse=e.QueryAccountAddressByIDRequest=e.AddressStringToBytesResponse=e.AddressStringToBytesRequest=e.AddressBytesToStringResponse=e.AddressBytesToStringRequest=e.Bech32PrefixResponse=e.Bech32PrefixRequest=e.QueryModuleAccountByNameResponse=e.QueryModuleAccountByNameRequest=e.QueryModuleAccountsResponse=e.QueryModuleAccountsRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.QueryAccountResponse=e.QueryAccountRequest=e.QueryAccountsResponse=e.QueryAccountsRequest=e.protobufPackage=void 0;const n=Be,t=_.any,i=vo,o=_.binary,g=_.helpers;e.protobufPackage="cosmos.auth.v1beta1";function C(){return{pagination:void 0}}e.QueryAccountsRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountsRequest",encode(l,M=o.BinaryWriter.create()){return l.pagination!==void 0&&n.PageRequest.encode(l.pagination,M.uint32(10).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=C();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.pagination=n.PageRequest.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=C();return(0,g.isSet)(l.pagination)&&(M.pagination=n.PageRequest.fromJSON(l.pagination)),M},toJSON(l){const M={};return l.pagination!==void 0&&(M.pagination=l.pagination?n.PageRequest.toJSON(l.pagination):void 0),M},fromPartial(l){const M=C();return l.pagination!==void 0&&l.pagination!==null&&(M.pagination=n.PageRequest.fromPartial(l.pagination)),M}};function w(){return{accounts:[],pagination:void 0}}e.QueryAccountsResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountsResponse",encode(l,M=o.BinaryWriter.create()){for(const m of l.accounts)t.Any.encode(m,M.uint32(10).fork()).ldelim();return l.pagination!==void 0&&n.PageResponse.encode(l.pagination,M.uint32(18).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=w();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.accounts.push(t.Any.decode(m,m.uint32()));break;case 2:T.pagination=n.PageResponse.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=w();return Array.isArray(l==null?void 0:l.accounts)&&(M.accounts=l.accounts.map(m=>t.Any.fromJSON(m))),(0,g.isSet)(l.pagination)&&(M.pagination=n.PageResponse.fromJSON(l.pagination)),M},toJSON(l){const M={};return l.accounts?M.accounts=l.accounts.map(m=>m?t.Any.toJSON(m):void 0):M.accounts=[],l.pagination!==void 0&&(M.pagination=l.pagination?n.PageResponse.toJSON(l.pagination):void 0),M},fromPartial(l){var m;const M=w();return M.accounts=((m=l.accounts)==null?void 0:m.map(h=>t.Any.fromPartial(h)))||[],l.pagination!==void 0&&l.pagination!==null&&(M.pagination=n.PageResponse.fromPartial(l.pagination)),M}};function E(){return{address:""}}e.QueryAccountRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountRequest",encode(l,M=o.BinaryWriter.create()){return l.address!==""&&M.uint32(10).string(l.address),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=E();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.address=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=E();return(0,g.isSet)(l.address)&&(M.address=String(l.address)),M},toJSON(l){const M={};return l.address!==void 0&&(M.address=l.address),M},fromPartial(l){const M=E();return M.address=l.address??"",M}};function D(){return{account:void 0}}e.QueryAccountResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountResponse",encode(l,M=o.BinaryWriter.create()){return l.account!==void 0&&t.Any.encode(l.account,M.uint32(10).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=D();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.account=t.Any.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=D();return(0,g.isSet)(l.account)&&(M.account=t.Any.fromJSON(l.account)),M},toJSON(l){const M={};return l.account!==void 0&&(M.account=l.account?t.Any.toJSON(l.account):void 0),M},fromPartial(l){const M=D();return l.account!==void 0&&l.account!==null&&(M.account=t.Any.fromPartial(l.account)),M}};function J(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.auth.v1beta1.QueryParamsRequest",encode(l,M=o.BinaryWriter.create()){return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=J();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){default:m.skipType(Q&7);break}}return T},fromJSON(l){return J()},toJSON(l){return{}},fromPartial(l){return J()}};function b(){return{params:i.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.auth.v1beta1.QueryParamsResponse",encode(l,M=o.BinaryWriter.create()){return l.params!==void 0&&i.Params.encode(l.params,M.uint32(10).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=b();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.params=i.Params.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=b();return(0,g.isSet)(l.params)&&(M.params=i.Params.fromJSON(l.params)),M},toJSON(l){const M={};return l.params!==void 0&&(M.params=l.params?i.Params.toJSON(l.params):void 0),M},fromPartial(l){const M=b();return l.params!==void 0&&l.params!==null&&(M.params=i.Params.fromPartial(l.params)),M}};function p(){return{}}e.QueryModuleAccountsRequest={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountsRequest",encode(l,M=o.BinaryWriter.create()){return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=p();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){default:m.skipType(Q&7);break}}return T},fromJSON(l){return p()},toJSON(l){return{}},fromPartial(l){return p()}};function S(){return{accounts:[]}}e.QueryModuleAccountsResponse={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountsResponse",encode(l,M=o.BinaryWriter.create()){for(const m of l.accounts)t.Any.encode(m,M.uint32(10).fork()).ldelim();return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=S();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.accounts.push(t.Any.decode(m,m.uint32()));break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=S();return Array.isArray(l==null?void 0:l.accounts)&&(M.accounts=l.accounts.map(m=>t.Any.fromJSON(m))),M},toJSON(l){const M={};return l.accounts?M.accounts=l.accounts.map(m=>m?t.Any.toJSON(m):void 0):M.accounts=[],M},fromPartial(l){var m;const M=S();return M.accounts=((m=l.accounts)==null?void 0:m.map(h=>t.Any.fromPartial(h)))||[],M}};function R(){return{name:""}}e.QueryModuleAccountByNameRequest={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest",encode(l,M=o.BinaryWriter.create()){return l.name!==""&&M.uint32(10).string(l.name),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=R();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.name=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=R();return(0,g.isSet)(l.name)&&(M.name=String(l.name)),M},toJSON(l){const M={};return l.name!==void 0&&(M.name=l.name),M},fromPartial(l){const M=R();return M.name=l.name??"",M}};function u(){return{account:void 0}}e.QueryModuleAccountByNameResponse={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse",encode(l,M=o.BinaryWriter.create()){return l.account!==void 0&&t.Any.encode(l.account,M.uint32(10).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=u();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.account=t.Any.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=u();return(0,g.isSet)(l.account)&&(M.account=t.Any.fromJSON(l.account)),M},toJSON(l){const M={};return l.account!==void 0&&(M.account=l.account?t.Any.toJSON(l.account):void 0),M},fromPartial(l){const M=u();return l.account!==void 0&&l.account!==null&&(M.account=t.Any.fromPartial(l.account)),M}};function c(){return{}}e.Bech32PrefixRequest={typeUrl:"/cosmos.auth.v1beta1.Bech32PrefixRequest",encode(l,M=o.BinaryWriter.create()){return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=c();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){default:m.skipType(Q&7);break}}return T},fromJSON(l){return c()},toJSON(l){return{}},fromPartial(l){return c()}};function y(){return{bech32Prefix:""}}e.Bech32PrefixResponse={typeUrl:"/cosmos.auth.v1beta1.Bech32PrefixResponse",encode(l,M=o.BinaryWriter.create()){return l.bech32Prefix!==""&&M.uint32(10).string(l.bech32Prefix),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=y();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.bech32Prefix=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=y();return(0,g.isSet)(l.bech32Prefix)&&(M.bech32Prefix=String(l.bech32Prefix)),M},toJSON(l){const M={};return l.bech32Prefix!==void 0&&(M.bech32Prefix=l.bech32Prefix),M},fromPartial(l){const M=y();return M.bech32Prefix=l.bech32Prefix??"",M}};function B(){return{addressBytes:new Uint8Array}}e.AddressBytesToStringRequest={typeUrl:"/cosmos.auth.v1beta1.AddressBytesToStringRequest",encode(l,M=o.BinaryWriter.create()){return l.addressBytes.length!==0&&M.uint32(10).bytes(l.addressBytes),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=B();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.addressBytes=m.bytes();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=B();return(0,g.isSet)(l.addressBytes)&&(M.addressBytes=(0,g.bytesFromBase64)(l.addressBytes)),M},toJSON(l){const M={};return l.addressBytes!==void 0&&(M.addressBytes=(0,g.base64FromBytes)(l.addressBytes!==void 0?l.addressBytes:new Uint8Array)),M},fromPartial(l){const M=B();return M.addressBytes=l.addressBytes??new Uint8Array,M}};function N(){return{addressString:""}}e.AddressBytesToStringResponse={typeUrl:"/cosmos.auth.v1beta1.AddressBytesToStringResponse",encode(l,M=o.BinaryWriter.create()){return l.addressString!==""&&M.uint32(10).string(l.addressString),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=N();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.addressString=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=N();return(0,g.isSet)(l.addressString)&&(M.addressString=String(l.addressString)),M},toJSON(l){const M={};return l.addressString!==void 0&&(M.addressString=l.addressString),M},fromPartial(l){const M=N();return M.addressString=l.addressString??"",M}};function U(){return{addressString:""}}e.AddressStringToBytesRequest={typeUrl:"/cosmos.auth.v1beta1.AddressStringToBytesRequest",encode(l,M=o.BinaryWriter.create()){return l.addressString!==""&&M.uint32(10).string(l.addressString),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=U();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.addressString=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=U();return(0,g.isSet)(l.addressString)&&(M.addressString=String(l.addressString)),M},toJSON(l){const M={};return l.addressString!==void 0&&(M.addressString=l.addressString),M},fromPartial(l){const M=U();return M.addressString=l.addressString??"",M}};function W(){return{addressBytes:new Uint8Array}}e.AddressStringToBytesResponse={typeUrl:"/cosmos.auth.v1beta1.AddressStringToBytesResponse",encode(l,M=o.BinaryWriter.create()){return l.addressBytes.length!==0&&M.uint32(10).bytes(l.addressBytes),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=W();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.addressBytes=m.bytes();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=W();return(0,g.isSet)(l.addressBytes)&&(M.addressBytes=(0,g.bytesFromBase64)(l.addressBytes)),M},toJSON(l){const M={};return l.addressBytes!==void 0&&(M.addressBytes=(0,g.base64FromBytes)(l.addressBytes!==void 0?l.addressBytes:new Uint8Array)),M},fromPartial(l){const M=W();return M.addressBytes=l.addressBytes??new Uint8Array,M}};function r(){return{id:BigInt(0),accountId:BigInt(0)}}e.QueryAccountAddressByIDRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest",encode(l,M=o.BinaryWriter.create()){return l.id!==BigInt(0)&&M.uint32(8).int64(l.id),l.accountId!==BigInt(0)&&M.uint32(16).uint64(l.accountId),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=r();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.id=m.int64();break;case 2:T.accountId=m.uint64();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=r();return(0,g.isSet)(l.id)&&(M.id=BigInt(l.id.toString())),(0,g.isSet)(l.accountId)&&(M.accountId=BigInt(l.accountId.toString())),M},toJSON(l){const M={};return l.id!==void 0&&(M.id=(l.id||BigInt(0)).toString()),l.accountId!==void 0&&(M.accountId=(l.accountId||BigInt(0)).toString()),M},fromPartial(l){const M=r();return l.id!==void 0&&l.id!==null&&(M.id=BigInt(l.id.toString())),l.accountId!==void 0&&l.accountId!==null&&(M.accountId=BigInt(l.accountId.toString())),M}};function s(){return{accountAddress:""}}e.QueryAccountAddressByIDResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse",encode(l,M=o.BinaryWriter.create()){return l.accountAddress!==""&&M.uint32(10).string(l.accountAddress),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=s();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.accountAddress=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=s();return(0,g.isSet)(l.accountAddress)&&(M.accountAddress=String(l.accountAddress)),M},toJSON(l){const M={};return l.accountAddress!==void 0&&(M.accountAddress=l.accountAddress),M},fromPartial(l){const M=s();return M.accountAddress=l.accountAddress??"",M}};function O(){return{address:""}}e.QueryAccountInfoRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountInfoRequest",encode(l,M=o.BinaryWriter.create()){return l.address!==""&&M.uint32(10).string(l.address),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=O();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.address=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=O();return(0,g.isSet)(l.address)&&(M.address=String(l.address)),M},toJSON(l){const M={};return l.address!==void 0&&(M.address=l.address),M},fromPartial(l){const M=O();return M.address=l.address??"",M}};function q(){return{info:void 0}}e.QueryAccountInfoResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountInfoResponse",encode(l,M=o.BinaryWriter.create()){return l.info!==void 0&&i.BaseAccount.encode(l.info,M.uint32(10).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=q();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.info=i.BaseAccount.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=q();return(0,g.isSet)(l.info)&&(M.info=i.BaseAccount.fromJSON(l.info)),M},toJSON(l){const M={};return l.info!==void 0&&(M.info=l.info?i.BaseAccount.toJSON(l.info):void 0),M},fromPartial(l){const M=q();return l.info!==void 0&&l.info!==null&&(M.info=i.BaseAccount.fromPartial(l.info)),M}};class d{constructor(M){this.rpc=M,this.Accounts=this.Accounts.bind(this),this.Account=this.Account.bind(this),this.AccountAddressByID=this.AccountAddressByID.bind(this),this.Params=this.Params.bind(this),this.ModuleAccounts=this.ModuleAccounts.bind(this),this.ModuleAccountByName=this.ModuleAccountByName.bind(this),this.Bech32Prefix=this.Bech32Prefix.bind(this),this.AddressBytesToString=this.AddressBytesToString.bind(this),this.AddressStringToBytes=this.AddressStringToBytes.bind(this),this.AccountInfo=this.AccountInfo.bind(this)}Accounts(M={pagination:n.PageRequest.fromPartial({})}){const m=e.QueryAccountsRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Accounts",m).then(T=>e.QueryAccountsResponse.decode(new o.BinaryReader(T)))}Account(M){const m=e.QueryAccountRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Account",m).then(T=>e.QueryAccountResponse.decode(new o.BinaryReader(T)))}AccountAddressByID(M){const m=e.QueryAccountAddressByIDRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AccountAddressByID",m).then(T=>e.QueryAccountAddressByIDResponse.decode(new o.BinaryReader(T)))}Params(M={}){const m=e.QueryParamsRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Params",m).then(T=>e.QueryParamsResponse.decode(new o.BinaryReader(T)))}ModuleAccounts(M={}){const m=e.QueryModuleAccountsRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","ModuleAccounts",m).then(T=>e.QueryModuleAccountsResponse.decode(new o.BinaryReader(T)))}ModuleAccountByName(M){const m=e.QueryModuleAccountByNameRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","ModuleAccountByName",m).then(T=>e.QueryModuleAccountByNameResponse.decode(new o.BinaryReader(T)))}Bech32Prefix(M={}){const m=e.Bech32PrefixRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Bech32Prefix",m).then(T=>e.Bech32PrefixResponse.decode(new o.BinaryReader(T)))}AddressBytesToString(M){const m=e.AddressBytesToStringRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AddressBytesToString",m).then(T=>e.AddressBytesToStringResponse.decode(new o.BinaryReader(T)))}AddressStringToBytes(M){const m=e.AddressStringToBytesRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AddressStringToBytes",m).then(T=>e.AddressStringToBytesResponse.decode(new o.BinaryReader(T)))}AccountInfo(M){const m=e.QueryAccountInfoRequest.encode(M).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AccountInfo",m).then(T=>e.QueryAccountInfoResponse.decode(new o.BinaryReader(T)))}}e.QueryClientImpl=d})(uc);var ze={},Xa={},Bo={},ja={};Object.defineProperty(ja,"__esModule",{value:!0});ja.concat=void 0;const FS=Re.xstream;function GS(...e){const n=new Array,t=new Array,i=new Set;let o=0;function g(){for(;n.length>0;)n.shift().unsubscribe();t.length=0,i.clear(),o=0}const C={start:w=>{e.forEach(J=>t.push([]));function E(J){for(;;){const b=t[J].shift();if(b===void 0)return;w.next(b)}}function D(){return o>=e.length}if(D()){w.complete();return}e.forEach((J,b)=>{n.push(J.subscribe({next:p=>{b===o?w.next(p):t[b].push(p)},complete:()=>{for(i.add(b);i.has(o);)E(o),o++;D()?w.complete():E(o)},error:p=>{w.error(p),g()}}))})},stop:()=>{g()}};return FS.Stream.create(C)}ja.concat=GS;var es={};Object.defineProperty(es,"__esModule",{value:!0});es.DefaultValueProducer=void 0;class LS{get value(){return this.internalValue}constructor(n,t){this.callbacks=t,this.internalValue=n}update(n){this.internalValue=n,this.listener&&this.listener.next(n)}error(n){this.listener&&this.listener.error(n)}start(n){this.listener=n,n.next(this.internalValue),this.callbacks&&this.callbacks.onStarted()}stop(){this.callbacks&&this.callbacks.onStop(),this.listener=void 0}}es.DefaultValueProducer=LS;var ns={};Object.defineProperty(ns,"__esModule",{value:!0});ns.dropDuplicates=void 0;function $S(e){return t=>{const i=new Set;return t.filter(g=>!i.has(e(g))).debug(g=>i.add(e(g)))}}ns.dropDuplicates=$S;var At={};Object.defineProperty(At,"__esModule",{value:!0});At.firstEvent=At.toListPromise=At.fromListPromise=void 0;const KS=Re.xstream;function xS(e){const n={start:t=>{e.then(i=>{for(const o of i)t.next(o);t.complete()}).catch(i=>t.error(i))},stop:()=>{}};return KS.Stream.create(n)}At.fromListPromise=xS;async function fm(e,n){return new Promise((t,i)=>{if(n===0){t([]);return}const o=new Array;e.take(n).subscribe({next:g=>{o.push(g),o.length===n&&t(o)},complete:()=>{i(`Stream completed before all events could be collected. Collected ${o.length}, expected ${n}`)},error:g=>i(g)})})}At.toListPromise=fm;async function zS(e){return(await fm(e,1))[0]}At.firstEvent=zS;var it={};Object.defineProperty(it,"__esModule",{value:!0});it.lastValue=it.asArray=it.countStream=it.Reducer=void 0;class ts{constructor(n,t,i){this.stream=n,this.reducer=t,this.state=i,this.completed=new Promise((o,g)=>{const C=this.stream.subscribe({next:w=>{this.state=this.reducer(this.state,w)},complete:()=>{o(),C.unsubscribe()},error:w=>{g(w),C.unsubscribe()}})})}value(){return this.state}async finished(){return this.completed}}it.Reducer=ts;function YS(e,n){return e+1}function ZS(e){return new ts(e,YS,0)}it.countStream=ZS;function XS(e,n){return[...e,n]}function jS(e){return new ts(e,XS,[])}it.asArray=jS;function ek(e,n){return n}function nk(e){return new ts(e,ek,void 0)}it.lastValue=nk;var rs={};Object.defineProperty(rs,"__esModule",{value:!0});rs.ValueAndUpdates=void 0;const tk=Re.xstream;class rk{get value(){return this.producer.value}constructor(n){this.producer=n,this.updates=tk.MemoryStream.createWithMemory(this.producer)}async waitFor(n){const t=typeof n=="function"?n:i=>i===n;return new Promise((i,o)=>{const g=this.updates.subscribe({next:C=>{t(C)&&(i(C),setTimeout(()=>g.unsubscribe(),0))},complete:()=>{g.unsubscribe(),o("Update stream completed without expected value")},error:C=>{o(C)}})})}}rs.ValueAndUpdates=rk;(function(e){var n=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(E,D,J,b){b===void 0&&(b=J);var p=Object.getOwnPropertyDescriptor(D,J);(!p||("get"in p?!D.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return D[J]}}),Object.defineProperty(E,b,p)}:function(E,D,J,b){b===void 0&&(b=J),E[b]=D[J]}),t=L.commonjsGlobal&&L.commonjsGlobal.__exportStar||function(E,D){for(var J in E)J!=="default"&&!Object.prototype.hasOwnProperty.call(D,J)&&n(D,E,J)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueAndUpdates=e.toListPromise=e.fromListPromise=e.firstEvent=e.dropDuplicates=e.DefaultValueProducer=e.concat=void 0;var i=ja;Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return i.concat}});var o=es;Object.defineProperty(e,"DefaultValueProducer",{enumerable:!0,get:function(){return o.DefaultValueProducer}});var g=ns;Object.defineProperty(e,"dropDuplicates",{enumerable:!0,get:function(){return g.dropDuplicates}});var C=At;Object.defineProperty(e,"firstEvent",{enumerable:!0,get:function(){return C.firstEvent}}),Object.defineProperty(e,"fromListPromise",{enumerable:!0,get:function(){return C.fromListPromise}}),Object.defineProperty(e,"toListPromise",{enumerable:!0,get:function(){return C.toListPromise}}),t(it,e);var w=rs;Object.defineProperty(e,"ValueAndUpdates",{enumerable:!0,get:function(){return w.ValueAndUpdates}})})(Bo);Object.defineProperty(Xa,"__esModule",{value:!0});Xa.QueryClient=void 0;const xt=Re.build,Xt=ue,ik=Bo,en=Ie;function $o(e,n,t){if(e.type!==n)throw new Error(`Op expected to be ${n}, got "${e.type}`);if(!(0,en.arrayContentEquals)(t,e.key))throw new Error(`Proven key different than queried key.
2
2
  Query: ${(0,Xt.toHex)(t)}
3
3
  Proven: ${(0,Xt.toHex)(e.key)}`);return xt.ics23.CommitmentProof.decode(e.data)}class cc{static withExtensions(n,...t){const i=new cc(n),o=t.map(g=>g(i));for(const g of o){(0,en.assert)((0,en.isNonNullObject)(g),"Extension must be a non-null object");for(const[C,w]of Object.entries(g)){(0,en.assert)((0,en.isNonNullObject)(w),`Module must be a non-null object. Found type ${typeof w} for module "${C}".`);const E=i[C]||{};i[C]={...E,...w}}}return i}constructor(n){this.cometClient=n}async queryStoreVerified(n,t,i){const{height:o,proof:g,key:C,value:w}=await this.queryRawProof(n,t,i),E=$o(g.ops[0],"ics23:iavl",t),D=$o(g.ops[1],"ics23:simple",(0,Xt.toAscii)(n));(0,en.assert)(D.exist),(0,en.assert)(D.exist.value),!w||w.length===0?((0,en.assert)(E.nonexist),(0,xt.verifyNonExistence)(E.nonexist,xt.iavlSpec,D.exist.value,t)):((0,en.assert)(E.exist),(0,en.assert)(E.exist.value),(0,xt.verifyExistence)(E.exist,xt.iavlSpec,D.exist.value,t,w));const J=await this.getNextHeader(o);return(0,xt.verifyExistence)(D.exist,xt.tendermintSpec,J.appHash,(0,Xt.toAscii)(n),D.exist.value),{key:C,value:w,height:o}}async queryRawProof(n,t,i){const{key:o,value:g,height:C,proof:w,code:E,log:D}=await this.cometClient.abciQuery({path:`/store/${n}/key`,data:t,prove:!0,height:i});if(E)throw new Error(`Query failed with (${E}): ${D}`);if(!(0,en.arrayContentEquals)(t,o))throw new Error(`Response key ${(0,Xt.toHex)(o)} doesn't match query key ${(0,Xt.toHex)(t)}`);if(!C)throw new Error("No query height returned");if(!w||w.ops.length!==2)throw new Error(`Expected 2 proof ops, got ${(w==null?void 0:w.ops.length)??0}. Are you using stargate?`);return $o(w.ops[0],"ics23:iavl",o),$o(w.ops[1],"ics23:simple",(0,Xt.toAscii)(n)),{key:o,value:g,height:C,proof:{ops:[...w.ops]}}}async queryAbci(n,t,i){const o=await this.cometClient.abciQuery({path:n,data:t,prove:!1,height:i});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(n){if((0,en.assertDefined)(n),n===0)throw new Error("Query returned height 0, cannot prove it");const t=n+1;let i,o;try{o=this.cometClient.subscribeNewBlockHeader()}catch{}if(o){const g=await(0,ik.firstEvent)(o);g.height===t&&(i=g)}for(;!i;){const g=(await this.cometClient.blockchain(n,t)).blockMetas.map(C=>C.header).find(C=>C.height===t);g?i=g:await(0,en.sleep)(1e3)}return(0,en.assert)(i.height===t,"Got wrong header. This is a bug in the logic above."),i}}Xa.QueryClient=cc;var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.decodeCosmosSdkDecFromProto=Rn.longify=Rn.createProtobufRpcClient=Rn.createPagination=Rn.toAccAddress=void 0;const pm=ue,mm=Ne,Ul=Be;function ok(e){return(0,pm.fromBech32)(e).data}Rn.toAccAddress=ok;function ak(e){return e?Ul.PageRequest.fromPartial({key:e}):Ul.PageRequest.fromPartial({})}Rn.createPagination=ak;function sk(e){return{request:async(n,t,i)=>{const o=`/${n}/${t}`;return(await e.queryAbci(o,i,void 0)).value}}}Rn.createProtobufRpcClient=sk;function dk(e){const n=mm.Uint64.fromString(e.toString());return BigInt(n.toString())}Rn.longify=dk;function uk(e){const n=typeof e=="string"?e:(0,pm.fromAscii)(e);return mm.Decimal.fromAtomics(n,18)}Rn.decodeCosmosSdkDecFromProto=uk;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.longify=e.decodeCosmosSdkDecFromProto=e.createProtobufRpcClient=e.createPagination=e.QueryClient=void 0;var n=Xa;Object.defineProperty(e,"QueryClient",{enumerable:!0,get:function(){return n.QueryClient}});var t=Rn;Object.defineProperty(e,"createPagination",{enumerable:!0,get:function(){return t.createPagination}}),Object.defineProperty(e,"createProtobufRpcClient",{enumerable:!0,get:function(){return t.createProtobufRpcClient}}),Object.defineProperty(e,"decodeCosmosSdkDecFromProto",{enumerable:!0,get:function(){return t.decodeCosmosSdkDecFromProto}}),Object.defineProperty(e,"longify",{enumerable:!0,get:function(){return t.longify}})})(ze);Object.defineProperty(Za,"__esModule",{value:!0});Za.setupAuthExtension=void 0;const ck=uc,lk=ze;function fk(e){const n=(0,lk.createProtobufRpcClient)(e),t=new ck.QueryClientImpl(n);return{auth:{account:async i=>{const{account:o}=await t.Account({address:i});return o??null}}}}Za.setupAuthExtension=fk;var is={};Object.defineProperty(is,"__esModule",{value:!0});is.createAuthzAminoConverters=void 0;function pk(){return{}}is.createAuthzAminoConverters=pk;var os={},lc={},pn={},Je={};Object.defineProperty(Je,"__esModule",{value:!0});Je.Timestamp=Je.protobufPackage=void 0;const Ud=_.binary,Dl=_.helpers;Je.protobufPackage="google.protobuf";function Dd(){return{seconds:BigInt(0),nanos:0}}Je.Timestamp={typeUrl:"/google.protobuf.Timestamp",encode(e,n=Ud.BinaryWriter.create()){return e.seconds!==BigInt(0)&&n.uint32(8).int64(e.seconds),e.nanos!==0&&n.uint32(16).int32(e.nanos),n},decode(e,n){const t=e instanceof Ud.BinaryReader?e:new Ud.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Dd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.seconds=t.int64();break;case 2:o.nanos=t.int32();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Dd();return(0,Dl.isSet)(e.seconds)&&(n.seconds=BigInt(e.seconds.toString())),(0,Dl.isSet)(e.nanos)&&(n.nanos=Number(e.nanos)),n},toJSON(e){const n={};return e.seconds!==void 0&&(n.seconds=(e.seconds||BigInt(0)).toString()),e.nanos!==void 0&&(n.nanos=Math.round(e.nanos)),n},fromPartial(e){const n=Dd();return e.seconds!==void 0&&e.seconds!==null&&(n.seconds=BigInt(e.seconds.toString())),n.nanos=e.nanos??0,n}};Object.defineProperty(pn,"__esModule",{value:!0});pn.GrantQueueItem=pn.GrantAuthorization=pn.Grant=pn.GenericAuthorization=pn.protobufPackage=void 0;const jn=_.any,$r=Je,Dn=_.binary,Wn=_.helpers;pn.protobufPackage="cosmos.authz.v1beta1";function Jd(){return{msg:""}}pn.GenericAuthorization={typeUrl:"/cosmos.authz.v1beta1.GenericAuthorization",encode(e,n=Dn.BinaryWriter.create()){return e.msg!==""&&n.uint32(10).string(e.msg),n},decode(e,n){const t=e instanceof Dn.BinaryReader?e:new Dn.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Jd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.msg=t.string();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Jd();return(0,Wn.isSet)(e.msg)&&(n.msg=String(e.msg)),n},toJSON(e){const n={};return e.msg!==void 0&&(n.msg=e.msg),n},fromPartial(e){const n=Jd();return n.msg=e.msg??"",n}};function Hd(){return{authorization:void 0,expiration:void 0}}pn.Grant={typeUrl:"/cosmos.authz.v1beta1.Grant",encode(e,n=Dn.BinaryWriter.create()){return e.authorization!==void 0&&jn.Any.encode(e.authorization,n.uint32(10).fork()).ldelim(),e.expiration!==void 0&&$r.Timestamp.encode(e.expiration,n.uint32(18).fork()).ldelim(),n},decode(e,n){const t=e instanceof Dn.BinaryReader?e:new Dn.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Hd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.authorization=jn.Any.decode(t,t.uint32());break;case 2:o.expiration=$r.Timestamp.decode(t,t.uint32());break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Hd();return(0,Wn.isSet)(e.authorization)&&(n.authorization=jn.Any.fromJSON(e.authorization)),(0,Wn.isSet)(e.expiration)&&(n.expiration=(0,Wn.fromJsonTimestamp)(e.expiration)),n},toJSON(e){const n={};return e.authorization!==void 0&&(n.authorization=e.authorization?jn.Any.toJSON(e.authorization):void 0),e.expiration!==void 0&&(n.expiration=(0,Wn.fromTimestamp)(e.expiration).toISOString()),n},fromPartial(e){const n=Hd();return e.authorization!==void 0&&e.authorization!==null&&(n.authorization=jn.Any.fromPartial(e.authorization)),e.expiration!==void 0&&e.expiration!==null&&(n.expiration=$r.Timestamp.fromPartial(e.expiration)),n}};function qd(){return{granter:"",grantee:"",authorization:void 0,expiration:void 0}}pn.GrantAuthorization={typeUrl:"/cosmos.authz.v1beta1.GrantAuthorization",encode(e,n=Dn.BinaryWriter.create()){return e.granter!==""&&n.uint32(10).string(e.granter),e.grantee!==""&&n.uint32(18).string(e.grantee),e.authorization!==void 0&&jn.Any.encode(e.authorization,n.uint32(26).fork()).ldelim(),e.expiration!==void 0&&$r.Timestamp.encode(e.expiration,n.uint32(34).fork()).ldelim(),n},decode(e,n){const t=e instanceof Dn.BinaryReader?e:new Dn.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=qd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.granter=t.string();break;case 2:o.grantee=t.string();break;case 3:o.authorization=jn.Any.decode(t,t.uint32());break;case 4:o.expiration=$r.Timestamp.decode(t,t.uint32());break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=qd();return(0,Wn.isSet)(e.granter)&&(n.granter=String(e.granter)),(0,Wn.isSet)(e.grantee)&&(n.grantee=String(e.grantee)),(0,Wn.isSet)(e.authorization)&&(n.authorization=jn.Any.fromJSON(e.authorization)),(0,Wn.isSet)(e.expiration)&&(n.expiration=(0,Wn.fromJsonTimestamp)(e.expiration)),n},toJSON(e){const n={};return e.granter!==void 0&&(n.granter=e.granter),e.grantee!==void 0&&(n.grantee=e.grantee),e.authorization!==void 0&&(n.authorization=e.authorization?jn.Any.toJSON(e.authorization):void 0),e.expiration!==void 0&&(n.expiration=(0,Wn.fromTimestamp)(e.expiration).toISOString()),n},fromPartial(e){const n=qd();return n.granter=e.granter??"",n.grantee=e.grantee??"",e.authorization!==void 0&&e.authorization!==null&&(n.authorization=jn.Any.fromPartial(e.authorization)),e.expiration!==void 0&&e.expiration!==null&&(n.expiration=$r.Timestamp.fromPartial(e.expiration)),n}};function Vd(){return{msgTypeUrls:[]}}pn.GrantQueueItem={typeUrl:"/cosmos.authz.v1beta1.GrantQueueItem",encode(e,n=Dn.BinaryWriter.create()){for(const t of e.msgTypeUrls)n.uint32(10).string(t);return n},decode(e,n){const t=e instanceof Dn.BinaryReader?e:new Dn.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Vd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.msgTypeUrls.push(t.string());break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Vd();return Array.isArray(e==null?void 0:e.msgTypeUrls)&&(n.msgTypeUrls=e.msgTypeUrls.map(t=>String(t))),n},toJSON(e){const n={};return e.msgTypeUrls?n.msgTypeUrls=e.msgTypeUrls.map(t=>t):n.msgTypeUrls=[],n},fromPartial(e){var t;const n=Vd();return n.msgTypeUrls=((t=e.msgTypeUrls)==null?void 0:t.map(i=>i))||[],n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgRevokeResponse=e.MsgRevoke=e.MsgGrantResponse=e.MsgExec=e.MsgExecResponse=e.MsgGrant=e.protobufPackage=void 0;const n=pn,t=_.any,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.authz.v1beta1";function g(){return{granter:"",grantee:"",grant:n.Grant.fromPartial({})}}e.MsgGrant={typeUrl:"/cosmos.authz.v1beta1.MsgGrant",encode(p,S=i.BinaryWriter.create()){return p.granter!==""&&S.uint32(10).string(p.granter),p.grantee!==""&&S.uint32(18).string(p.grantee),p.grant!==void 0&&n.Grant.encode(p.grant,S.uint32(26).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=g();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.granter=R.string();break;case 2:c.grantee=R.string();break;case 3:c.grant=n.Grant.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=g();return(0,o.isSet)(p.granter)&&(S.granter=String(p.granter)),(0,o.isSet)(p.grantee)&&(S.grantee=String(p.grantee)),(0,o.isSet)(p.grant)&&(S.grant=n.Grant.fromJSON(p.grant)),S},toJSON(p){const S={};return p.granter!==void 0&&(S.granter=p.granter),p.grantee!==void 0&&(S.grantee=p.grantee),p.grant!==void 0&&(S.grant=p.grant?n.Grant.toJSON(p.grant):void 0),S},fromPartial(p){const S=g();return S.granter=p.granter??"",S.grantee=p.grantee??"",p.grant!==void 0&&p.grant!==null&&(S.grant=n.Grant.fromPartial(p.grant)),S}};function C(){return{results:[]}}e.MsgExecResponse={typeUrl:"/cosmos.authz.v1beta1.MsgExecResponse",encode(p,S=i.BinaryWriter.create()){for(const R of p.results)S.uint32(10).bytes(R);return S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=C();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.results.push(R.bytes());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=C();return Array.isArray(p==null?void 0:p.results)&&(S.results=p.results.map(R=>(0,o.bytesFromBase64)(R))),S},toJSON(p){const S={};return p.results?S.results=p.results.map(R=>(0,o.base64FromBytes)(R!==void 0?R:new Uint8Array)):S.results=[],S},fromPartial(p){var R;const S=C();return S.results=((R=p.results)==null?void 0:R.map(u=>u))||[],S}};function w(){return{grantee:"",msgs:[]}}e.MsgExec={typeUrl:"/cosmos.authz.v1beta1.MsgExec",encode(p,S=i.BinaryWriter.create()){p.grantee!==""&&S.uint32(10).string(p.grantee);for(const R of p.msgs)t.Any.encode(R,S.uint32(18).fork()).ldelim();return S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=w();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.grantee=R.string();break;case 2:c.msgs.push(t.Any.decode(R,R.uint32()));break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=w();return(0,o.isSet)(p.grantee)&&(S.grantee=String(p.grantee)),Array.isArray(p==null?void 0:p.msgs)&&(S.msgs=p.msgs.map(R=>t.Any.fromJSON(R))),S},toJSON(p){const S={};return p.grantee!==void 0&&(S.grantee=p.grantee),p.msgs?S.msgs=p.msgs.map(R=>R?t.Any.toJSON(R):void 0):S.msgs=[],S},fromPartial(p){var R;const S=w();return S.grantee=p.grantee??"",S.msgs=((R=p.msgs)==null?void 0:R.map(u=>t.Any.fromPartial(u)))||[],S}};function E(){return{}}e.MsgGrantResponse={typeUrl:"/cosmos.authz.v1beta1.MsgGrantResponse",encode(p,S=i.BinaryWriter.create()){return S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=E();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){default:R.skipType(y&7);break}}return c},fromJSON(p){return E()},toJSON(p){return{}},fromPartial(p){return E()}};function D(){return{granter:"",grantee:"",msgTypeUrl:""}}e.MsgRevoke={typeUrl:"/cosmos.authz.v1beta1.MsgRevoke",encode(p,S=i.BinaryWriter.create()){return p.granter!==""&&S.uint32(10).string(p.granter),p.grantee!==""&&S.uint32(18).string(p.grantee),p.msgTypeUrl!==""&&S.uint32(26).string(p.msgTypeUrl),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=D();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.granter=R.string();break;case 2:c.grantee=R.string();break;case 3:c.msgTypeUrl=R.string();break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=D();return(0,o.isSet)(p.granter)&&(S.granter=String(p.granter)),(0,o.isSet)(p.grantee)&&(S.grantee=String(p.grantee)),(0,o.isSet)(p.msgTypeUrl)&&(S.msgTypeUrl=String(p.msgTypeUrl)),S},toJSON(p){const S={};return p.granter!==void 0&&(S.granter=p.granter),p.grantee!==void 0&&(S.grantee=p.grantee),p.msgTypeUrl!==void 0&&(S.msgTypeUrl=p.msgTypeUrl),S},fromPartial(p){const S=D();return S.granter=p.granter??"",S.grantee=p.grantee??"",S.msgTypeUrl=p.msgTypeUrl??"",S}};function J(){return{}}e.MsgRevokeResponse={typeUrl:"/cosmos.authz.v1beta1.MsgRevokeResponse",encode(p,S=i.BinaryWriter.create()){return S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=J();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){default:R.skipType(y&7);break}}return c},fromJSON(p){return J()},toJSON(p){return{}},fromPartial(p){return J()}};class b{constructor(S){this.rpc=S,this.Grant=this.Grant.bind(this),this.Exec=this.Exec.bind(this),this.Revoke=this.Revoke.bind(this)}Grant(S){const R=e.MsgGrant.encode(S).finish();return this.rpc.request("cosmos.authz.v1beta1.Msg","Grant",R).then(c=>e.MsgGrantResponse.decode(new i.BinaryReader(c)))}Exec(S){const R=e.MsgExec.encode(S).finish();return this.rpc.request("cosmos.authz.v1beta1.Msg","Exec",R).then(c=>e.MsgExecResponse.decode(new i.BinaryReader(c)))}Revoke(S){const R=e.MsgRevoke.encode(S).finish();return this.rpc.request("cosmos.authz.v1beta1.Msg","Revoke",R).then(c=>e.MsgRevokeResponse.decode(new i.BinaryReader(c)))}}e.MsgClientImpl=b})(lc);Object.defineProperty(os,"__esModule",{value:!0});os.authzTypes=void 0;const Wd=lc;os.authzTypes=[["/cosmos.authz.v1beta1.MsgExec",Wd.MsgExec],["/cosmos.authz.v1beta1.MsgGrant",Wd.MsgGrant],["/cosmos.authz.v1beta1.MsgRevoke",Wd.MsgRevoke]];var as={},fc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryGranteeGrantsResponse=e.QueryGranteeGrantsRequest=e.QueryGranterGrantsResponse=e.QueryGranterGrantsRequest=e.QueryGrantsResponse=e.QueryGrantsRequest=e.protobufPackage=void 0;const n=Be,t=pn,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.authz.v1beta1";function g(){return{granter:"",grantee:"",msgTypeUrl:"",pagination:void 0}}e.QueryGrantsRequest={typeUrl:"/cosmos.authz.v1beta1.QueryGrantsRequest",encode(p,S=i.BinaryWriter.create()){return p.granter!==""&&S.uint32(10).string(p.granter),p.grantee!==""&&S.uint32(18).string(p.grantee),p.msgTypeUrl!==""&&S.uint32(26).string(p.msgTypeUrl),p.pagination!==void 0&&n.PageRequest.encode(p.pagination,S.uint32(34).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=g();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.granter=R.string();break;case 2:c.grantee=R.string();break;case 3:c.msgTypeUrl=R.string();break;case 4:c.pagination=n.PageRequest.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=g();return(0,o.isSet)(p.granter)&&(S.granter=String(p.granter)),(0,o.isSet)(p.grantee)&&(S.grantee=String(p.grantee)),(0,o.isSet)(p.msgTypeUrl)&&(S.msgTypeUrl=String(p.msgTypeUrl)),(0,o.isSet)(p.pagination)&&(S.pagination=n.PageRequest.fromJSON(p.pagination)),S},toJSON(p){const S={};return p.granter!==void 0&&(S.granter=p.granter),p.grantee!==void 0&&(S.grantee=p.grantee),p.msgTypeUrl!==void 0&&(S.msgTypeUrl=p.msgTypeUrl),p.pagination!==void 0&&(S.pagination=p.pagination?n.PageRequest.toJSON(p.pagination):void 0),S},fromPartial(p){const S=g();return S.granter=p.granter??"",S.grantee=p.grantee??"",S.msgTypeUrl=p.msgTypeUrl??"",p.pagination!==void 0&&p.pagination!==null&&(S.pagination=n.PageRequest.fromPartial(p.pagination)),S}};function C(){return{grants:[],pagination:void 0}}e.QueryGrantsResponse={typeUrl:"/cosmos.authz.v1beta1.QueryGrantsResponse",encode(p,S=i.BinaryWriter.create()){for(const R of p.grants)t.Grant.encode(R,S.uint32(10).fork()).ldelim();return p.pagination!==void 0&&n.PageResponse.encode(p.pagination,S.uint32(18).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=C();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.grants.push(t.Grant.decode(R,R.uint32()));break;case 2:c.pagination=n.PageResponse.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=C();return Array.isArray(p==null?void 0:p.grants)&&(S.grants=p.grants.map(R=>t.Grant.fromJSON(R))),(0,o.isSet)(p.pagination)&&(S.pagination=n.PageResponse.fromJSON(p.pagination)),S},toJSON(p){const S={};return p.grants?S.grants=p.grants.map(R=>R?t.Grant.toJSON(R):void 0):S.grants=[],p.pagination!==void 0&&(S.pagination=p.pagination?n.PageResponse.toJSON(p.pagination):void 0),S},fromPartial(p){var R;const S=C();return S.grants=((R=p.grants)==null?void 0:R.map(u=>t.Grant.fromPartial(u)))||[],p.pagination!==void 0&&p.pagination!==null&&(S.pagination=n.PageResponse.fromPartial(p.pagination)),S}};function w(){return{granter:"",pagination:void 0}}e.QueryGranterGrantsRequest={typeUrl:"/cosmos.authz.v1beta1.QueryGranterGrantsRequest",encode(p,S=i.BinaryWriter.create()){return p.granter!==""&&S.uint32(10).string(p.granter),p.pagination!==void 0&&n.PageRequest.encode(p.pagination,S.uint32(18).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=w();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.granter=R.string();break;case 2:c.pagination=n.PageRequest.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=w();return(0,o.isSet)(p.granter)&&(S.granter=String(p.granter)),(0,o.isSet)(p.pagination)&&(S.pagination=n.PageRequest.fromJSON(p.pagination)),S},toJSON(p){const S={};return p.granter!==void 0&&(S.granter=p.granter),p.pagination!==void 0&&(S.pagination=p.pagination?n.PageRequest.toJSON(p.pagination):void 0),S},fromPartial(p){const S=w();return S.granter=p.granter??"",p.pagination!==void 0&&p.pagination!==null&&(S.pagination=n.PageRequest.fromPartial(p.pagination)),S}};function E(){return{grants:[],pagination:void 0}}e.QueryGranterGrantsResponse={typeUrl:"/cosmos.authz.v1beta1.QueryGranterGrantsResponse",encode(p,S=i.BinaryWriter.create()){for(const R of p.grants)t.GrantAuthorization.encode(R,S.uint32(10).fork()).ldelim();return p.pagination!==void 0&&n.PageResponse.encode(p.pagination,S.uint32(18).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=E();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.grants.push(t.GrantAuthorization.decode(R,R.uint32()));break;case 2:c.pagination=n.PageResponse.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=E();return Array.isArray(p==null?void 0:p.grants)&&(S.grants=p.grants.map(R=>t.GrantAuthorization.fromJSON(R))),(0,o.isSet)(p.pagination)&&(S.pagination=n.PageResponse.fromJSON(p.pagination)),S},toJSON(p){const S={};return p.grants?S.grants=p.grants.map(R=>R?t.GrantAuthorization.toJSON(R):void 0):S.grants=[],p.pagination!==void 0&&(S.pagination=p.pagination?n.PageResponse.toJSON(p.pagination):void 0),S},fromPartial(p){var R;const S=E();return S.grants=((R=p.grants)==null?void 0:R.map(u=>t.GrantAuthorization.fromPartial(u)))||[],p.pagination!==void 0&&p.pagination!==null&&(S.pagination=n.PageResponse.fromPartial(p.pagination)),S}};function D(){return{grantee:"",pagination:void 0}}e.QueryGranteeGrantsRequest={typeUrl:"/cosmos.authz.v1beta1.QueryGranteeGrantsRequest",encode(p,S=i.BinaryWriter.create()){return p.grantee!==""&&S.uint32(10).string(p.grantee),p.pagination!==void 0&&n.PageRequest.encode(p.pagination,S.uint32(18).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=D();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.grantee=R.string();break;case 2:c.pagination=n.PageRequest.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=D();return(0,o.isSet)(p.grantee)&&(S.grantee=String(p.grantee)),(0,o.isSet)(p.pagination)&&(S.pagination=n.PageRequest.fromJSON(p.pagination)),S},toJSON(p){const S={};return p.grantee!==void 0&&(S.grantee=p.grantee),p.pagination!==void 0&&(S.pagination=p.pagination?n.PageRequest.toJSON(p.pagination):void 0),S},fromPartial(p){const S=D();return S.grantee=p.grantee??"",p.pagination!==void 0&&p.pagination!==null&&(S.pagination=n.PageRequest.fromPartial(p.pagination)),S}};function J(){return{grants:[],pagination:void 0}}e.QueryGranteeGrantsResponse={typeUrl:"/cosmos.authz.v1beta1.QueryGranteeGrantsResponse",encode(p,S=i.BinaryWriter.create()){for(const R of p.grants)t.GrantAuthorization.encode(R,S.uint32(10).fork()).ldelim();return p.pagination!==void 0&&n.PageResponse.encode(p.pagination,S.uint32(18).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=J();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.grants.push(t.GrantAuthorization.decode(R,R.uint32()));break;case 2:c.pagination=n.PageResponse.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=J();return Array.isArray(p==null?void 0:p.grants)&&(S.grants=p.grants.map(R=>t.GrantAuthorization.fromJSON(R))),(0,o.isSet)(p.pagination)&&(S.pagination=n.PageResponse.fromJSON(p.pagination)),S},toJSON(p){const S={};return p.grants?S.grants=p.grants.map(R=>R?t.GrantAuthorization.toJSON(R):void 0):S.grants=[],p.pagination!==void 0&&(S.pagination=p.pagination?n.PageResponse.toJSON(p.pagination):void 0),S},fromPartial(p){var R;const S=J();return S.grants=((R=p.grants)==null?void 0:R.map(u=>t.GrantAuthorization.fromPartial(u)))||[],p.pagination!==void 0&&p.pagination!==null&&(S.pagination=n.PageResponse.fromPartial(p.pagination)),S}};class b{constructor(S){this.rpc=S,this.Grants=this.Grants.bind(this),this.GranterGrants=this.GranterGrants.bind(this),this.GranteeGrants=this.GranteeGrants.bind(this)}Grants(S){const R=e.QueryGrantsRequest.encode(S).finish();return this.rpc.request("cosmos.authz.v1beta1.Query","Grants",R).then(c=>e.QueryGrantsResponse.decode(new i.BinaryReader(c)))}GranterGrants(S){const R=e.QueryGranterGrantsRequest.encode(S).finish();return this.rpc.request("cosmos.authz.v1beta1.Query","GranterGrants",R).then(c=>e.QueryGranterGrantsResponse.decode(new i.BinaryReader(c)))}GranteeGrants(S){const R=e.QueryGranteeGrantsRequest.encode(S).finish();return this.rpc.request("cosmos.authz.v1beta1.Query","GranteeGrants",R).then(c=>e.QueryGranteeGrantsResponse.decode(new i.BinaryReader(c)))}}e.QueryClientImpl=b})(fc);Object.defineProperty(as,"__esModule",{value:!0});as.setupAuthzExtension=void 0;const mk=fc,Ko=ze;function hk(e){const n=(0,Ko.createProtobufRpcClient)(e),t=new mk.QueryClientImpl(n);return{authz:{grants:async(i,o,g,C)=>await t.Grants({granter:i,grantee:o,msgTypeUrl:g,pagination:(0,Ko.createPagination)(C)}),granteeGrants:async(i,o)=>await t.GranteeGrants({grantee:i,pagination:(0,Ko.createPagination)(o)}),granterGrants:async(i,o)=>await t.GranterGrants({granter:i,pagination:(0,Ko.createPagination)(o)})}}}as.setupAuthzExtension=hk;var Tt={};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.createBankAminoConverters=Tt.isAminoMsgMultiSend=Tt.isAminoMsgSend=void 0;function gk(e){return e.type==="cosmos-sdk/MsgSend"}Tt.isAminoMsgSend=gk;function yk(e){return e.type==="cosmos-sdk/MsgMultiSend"}Tt.isAminoMsgMultiSend=yk;function Sk(){return{"/cosmos.bank.v1beta1.MsgSend":{aminoType:"cosmos-sdk/MsgSend",toAmino:({fromAddress:e,toAddress:n,amount:t})=>({from_address:e,to_address:n,amount:[...t]}),fromAmino:({from_address:e,to_address:n,amount:t})=>({fromAddress:e,toAddress:n,amount:[...t]})},"/cosmos.bank.v1beta1.MsgMultiSend":{aminoType:"cosmos-sdk/MsgMultiSend",toAmino:({inputs:e,outputs:n})=>({inputs:e.map(t=>({address:t.address,coins:[...t.coins]})),outputs:n.map(t=>({address:t.address,coins:[...t.coins]}))}),fromAmino:({inputs:e,outputs:n})=>({inputs:e.map(t=>({address:t.address,coins:[...t.coins]})),outputs:n.map(t=>({address:t.address,coins:[...t.coins]}))})}}}Tt.createBankAminoConverters=Sk;var li={};Object.defineProperty(li,"__esModule",{value:!0});li.isMsgSendEncodeObject=li.bankTypes=void 0;const Jl=Ka;li.bankTypes=[["/cosmos.bank.v1beta1.MsgMultiSend",Jl.MsgMultiSend],["/cosmos.bank.v1beta1.MsgSend",Jl.MsgSend]];function kk(e){return e.typeUrl==="/cosmos.bank.v1beta1.MsgSend"}li.isMsgSendEncodeObject=kk;var ss={},pc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QuerySendEnabledResponse=e.QuerySendEnabledRequest=e.QueryDenomOwnersResponse=e.DenomOwner=e.QueryDenomOwnersRequest=e.QueryDenomMetadataResponse=e.QueryDenomMetadataRequest=e.QueryDenomsMetadataResponse=e.QueryDenomsMetadataRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.QuerySupplyOfResponse=e.QuerySupplyOfRequest=e.QueryTotalSupplyResponse=e.QueryTotalSupplyRequest=e.QuerySpendableBalanceByDenomResponse=e.QuerySpendableBalanceByDenomRequest=e.QuerySpendableBalancesResponse=e.QuerySpendableBalancesRequest=e.QueryAllBalancesResponse=e.QueryAllBalancesRequest=e.QueryBalanceResponse=e.QueryBalanceRequest=e.protobufPackage=void 0;const n=Be,t=_.coin,i=ac,o=_.binary,g=_.helpers;e.protobufPackage="cosmos.bank.v1beta1";function C(){return{address:"",denom:""}}e.QueryBalanceRequest={typeUrl:"/cosmos.bank.v1beta1.QueryBalanceRequest",encode(h,T=o.BinaryWriter.create()){return h.address!==""&&T.uint32(10).string(h.address),h.denom!==""&&T.uint32(18).string(h.denom),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=C();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.address=Q.string();break;case 2:a.denom=Q.string();break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=C();return(0,g.isSet)(h.address)&&(T.address=String(h.address)),(0,g.isSet)(h.denom)&&(T.denom=String(h.denom)),T},toJSON(h){const T={};return h.address!==void 0&&(T.address=h.address),h.denom!==void 0&&(T.denom=h.denom),T},fromPartial(h){const T=C();return T.address=h.address??"",T.denom=h.denom??"",T}};function w(){return{balance:void 0}}e.QueryBalanceResponse={typeUrl:"/cosmos.bank.v1beta1.QueryBalanceResponse",encode(h,T=o.BinaryWriter.create()){return h.balance!==void 0&&t.Coin.encode(h.balance,T.uint32(10).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=w();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.balance=t.Coin.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=w();return(0,g.isSet)(h.balance)&&(T.balance=t.Coin.fromJSON(h.balance)),T},toJSON(h){const T={};return h.balance!==void 0&&(T.balance=h.balance?t.Coin.toJSON(h.balance):void 0),T},fromPartial(h){const T=w();return h.balance!==void 0&&h.balance!==null&&(T.balance=t.Coin.fromPartial(h.balance)),T}};function E(){return{address:"",pagination:void 0}}e.QueryAllBalancesRequest={typeUrl:"/cosmos.bank.v1beta1.QueryAllBalancesRequest",encode(h,T=o.BinaryWriter.create()){return h.address!==""&&T.uint32(10).string(h.address),h.pagination!==void 0&&n.PageRequest.encode(h.pagination,T.uint32(18).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=E();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.address=Q.string();break;case 2:a.pagination=n.PageRequest.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=E();return(0,g.isSet)(h.address)&&(T.address=String(h.address)),(0,g.isSet)(h.pagination)&&(T.pagination=n.PageRequest.fromJSON(h.pagination)),T},toJSON(h){const T={};return h.address!==void 0&&(T.address=h.address),h.pagination!==void 0&&(T.pagination=h.pagination?n.PageRequest.toJSON(h.pagination):void 0),T},fromPartial(h){const T=E();return T.address=h.address??"",h.pagination!==void 0&&h.pagination!==null&&(T.pagination=n.PageRequest.fromPartial(h.pagination)),T}};function D(){return{balances:[],pagination:void 0}}e.QueryAllBalancesResponse={typeUrl:"/cosmos.bank.v1beta1.QueryAllBalancesResponse",encode(h,T=o.BinaryWriter.create()){for(const Q of h.balances)t.Coin.encode(Q,T.uint32(10).fork()).ldelim();return h.pagination!==void 0&&n.PageResponse.encode(h.pagination,T.uint32(18).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=D();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.balances.push(t.Coin.decode(Q,Q.uint32()));break;case 2:a.pagination=n.PageResponse.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=D();return Array.isArray(h==null?void 0:h.balances)&&(T.balances=h.balances.map(Q=>t.Coin.fromJSON(Q))),(0,g.isSet)(h.pagination)&&(T.pagination=n.PageResponse.fromJSON(h.pagination)),T},toJSON(h){const T={};return h.balances?T.balances=h.balances.map(Q=>Q?t.Coin.toJSON(Q):void 0):T.balances=[],h.pagination!==void 0&&(T.pagination=h.pagination?n.PageResponse.toJSON(h.pagination):void 0),T},fromPartial(h){var Q;const T=D();return T.balances=((Q=h.balances)==null?void 0:Q.map(H=>t.Coin.fromPartial(H)))||[],h.pagination!==void 0&&h.pagination!==null&&(T.pagination=n.PageResponse.fromPartial(h.pagination)),T}};function J(){return{address:"",pagination:void 0}}e.QuerySpendableBalancesRequest={typeUrl:"/cosmos.bank.v1beta1.QuerySpendableBalancesRequest",encode(h,T=o.BinaryWriter.create()){return h.address!==""&&T.uint32(10).string(h.address),h.pagination!==void 0&&n.PageRequest.encode(h.pagination,T.uint32(18).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=J();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.address=Q.string();break;case 2:a.pagination=n.PageRequest.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=J();return(0,g.isSet)(h.address)&&(T.address=String(h.address)),(0,g.isSet)(h.pagination)&&(T.pagination=n.PageRequest.fromJSON(h.pagination)),T},toJSON(h){const T={};return h.address!==void 0&&(T.address=h.address),h.pagination!==void 0&&(T.pagination=h.pagination?n.PageRequest.toJSON(h.pagination):void 0),T},fromPartial(h){const T=J();return T.address=h.address??"",h.pagination!==void 0&&h.pagination!==null&&(T.pagination=n.PageRequest.fromPartial(h.pagination)),T}};function b(){return{balances:[],pagination:void 0}}e.QuerySpendableBalancesResponse={typeUrl:"/cosmos.bank.v1beta1.QuerySpendableBalancesResponse",encode(h,T=o.BinaryWriter.create()){for(const Q of h.balances)t.Coin.encode(Q,T.uint32(10).fork()).ldelim();return h.pagination!==void 0&&n.PageResponse.encode(h.pagination,T.uint32(18).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=b();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.balances.push(t.Coin.decode(Q,Q.uint32()));break;case 2:a.pagination=n.PageResponse.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=b();return Array.isArray(h==null?void 0:h.balances)&&(T.balances=h.balances.map(Q=>t.Coin.fromJSON(Q))),(0,g.isSet)(h.pagination)&&(T.pagination=n.PageResponse.fromJSON(h.pagination)),T},toJSON(h){const T={};return h.balances?T.balances=h.balances.map(Q=>Q?t.Coin.toJSON(Q):void 0):T.balances=[],h.pagination!==void 0&&(T.pagination=h.pagination?n.PageResponse.toJSON(h.pagination):void 0),T},fromPartial(h){var Q;const T=b();return T.balances=((Q=h.balances)==null?void 0:Q.map(H=>t.Coin.fromPartial(H)))||[],h.pagination!==void 0&&h.pagination!==null&&(T.pagination=n.PageResponse.fromPartial(h.pagination)),T}};function p(){return{address:"",denom:""}}e.QuerySpendableBalanceByDenomRequest={typeUrl:"/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest",encode(h,T=o.BinaryWriter.create()){return h.address!==""&&T.uint32(10).string(h.address),h.denom!==""&&T.uint32(18).string(h.denom),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=p();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.address=Q.string();break;case 2:a.denom=Q.string();break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=p();return(0,g.isSet)(h.address)&&(T.address=String(h.address)),(0,g.isSet)(h.denom)&&(T.denom=String(h.denom)),T},toJSON(h){const T={};return h.address!==void 0&&(T.address=h.address),h.denom!==void 0&&(T.denom=h.denom),T},fromPartial(h){const T=p();return T.address=h.address??"",T.denom=h.denom??"",T}};function S(){return{balance:void 0}}e.QuerySpendableBalanceByDenomResponse={typeUrl:"/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse",encode(h,T=o.BinaryWriter.create()){return h.balance!==void 0&&t.Coin.encode(h.balance,T.uint32(10).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=S();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.balance=t.Coin.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=S();return(0,g.isSet)(h.balance)&&(T.balance=t.Coin.fromJSON(h.balance)),T},toJSON(h){const T={};return h.balance!==void 0&&(T.balance=h.balance?t.Coin.toJSON(h.balance):void 0),T},fromPartial(h){const T=S();return h.balance!==void 0&&h.balance!==null&&(T.balance=t.Coin.fromPartial(h.balance)),T}};function R(){return{pagination:void 0}}e.QueryTotalSupplyRequest={typeUrl:"/cosmos.bank.v1beta1.QueryTotalSupplyRequest",encode(h,T=o.BinaryWriter.create()){return h.pagination!==void 0&&n.PageRequest.encode(h.pagination,T.uint32(10).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=R();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.pagination=n.PageRequest.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=R();return(0,g.isSet)(h.pagination)&&(T.pagination=n.PageRequest.fromJSON(h.pagination)),T},toJSON(h){const T={};return h.pagination!==void 0&&(T.pagination=h.pagination?n.PageRequest.toJSON(h.pagination):void 0),T},fromPartial(h){const T=R();return h.pagination!==void 0&&h.pagination!==null&&(T.pagination=n.PageRequest.fromPartial(h.pagination)),T}};function u(){return{supply:[],pagination:void 0}}e.QueryTotalSupplyResponse={typeUrl:"/cosmos.bank.v1beta1.QueryTotalSupplyResponse",encode(h,T=o.BinaryWriter.create()){for(const Q of h.supply)t.Coin.encode(Q,T.uint32(10).fork()).ldelim();return h.pagination!==void 0&&n.PageResponse.encode(h.pagination,T.uint32(18).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=u();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.supply.push(t.Coin.decode(Q,Q.uint32()));break;case 2:a.pagination=n.PageResponse.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=u();return Array.isArray(h==null?void 0:h.supply)&&(T.supply=h.supply.map(Q=>t.Coin.fromJSON(Q))),(0,g.isSet)(h.pagination)&&(T.pagination=n.PageResponse.fromJSON(h.pagination)),T},toJSON(h){const T={};return h.supply?T.supply=h.supply.map(Q=>Q?t.Coin.toJSON(Q):void 0):T.supply=[],h.pagination!==void 0&&(T.pagination=h.pagination?n.PageResponse.toJSON(h.pagination):void 0),T},fromPartial(h){var Q;const T=u();return T.supply=((Q=h.supply)==null?void 0:Q.map(H=>t.Coin.fromPartial(H)))||[],h.pagination!==void 0&&h.pagination!==null&&(T.pagination=n.PageResponse.fromPartial(h.pagination)),T}};function c(){return{denom:""}}e.QuerySupplyOfRequest={typeUrl:"/cosmos.bank.v1beta1.QuerySupplyOfRequest",encode(h,T=o.BinaryWriter.create()){return h.denom!==""&&T.uint32(10).string(h.denom),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=c();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.denom=Q.string();break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=c();return(0,g.isSet)(h.denom)&&(T.denom=String(h.denom)),T},toJSON(h){const T={};return h.denom!==void 0&&(T.denom=h.denom),T},fromPartial(h){const T=c();return T.denom=h.denom??"",T}};function y(){return{amount:t.Coin.fromPartial({})}}e.QuerySupplyOfResponse={typeUrl:"/cosmos.bank.v1beta1.QuerySupplyOfResponse",encode(h,T=o.BinaryWriter.create()){return h.amount!==void 0&&t.Coin.encode(h.amount,T.uint32(10).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=y();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.amount=t.Coin.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=y();return(0,g.isSet)(h.amount)&&(T.amount=t.Coin.fromJSON(h.amount)),T},toJSON(h){const T={};return h.amount!==void 0&&(T.amount=h.amount?t.Coin.toJSON(h.amount):void 0),T},fromPartial(h){const T=y();return h.amount!==void 0&&h.amount!==null&&(T.amount=t.Coin.fromPartial(h.amount)),T}};function B(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.bank.v1beta1.QueryParamsRequest",encode(h,T=o.BinaryWriter.create()){return T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=B();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){default:Q.skipType(P&7);break}}return a},fromJSON(h){return B()},toJSON(h){return{}},fromPartial(h){return B()}};function N(){return{params:i.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.bank.v1beta1.QueryParamsResponse",encode(h,T=o.BinaryWriter.create()){return h.params!==void 0&&i.Params.encode(h.params,T.uint32(10).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=N();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.params=i.Params.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=N();return(0,g.isSet)(h.params)&&(T.params=i.Params.fromJSON(h.params)),T},toJSON(h){const T={};return h.params!==void 0&&(T.params=h.params?i.Params.toJSON(h.params):void 0),T},fromPartial(h){const T=N();return h.params!==void 0&&h.params!==null&&(T.params=i.Params.fromPartial(h.params)),T}};function U(){return{pagination:void 0}}e.QueryDenomsMetadataRequest={typeUrl:"/cosmos.bank.v1beta1.QueryDenomsMetadataRequest",encode(h,T=o.BinaryWriter.create()){return h.pagination!==void 0&&n.PageRequest.encode(h.pagination,T.uint32(10).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=U();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.pagination=n.PageRequest.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=U();return(0,g.isSet)(h.pagination)&&(T.pagination=n.PageRequest.fromJSON(h.pagination)),T},toJSON(h){const T={};return h.pagination!==void 0&&(T.pagination=h.pagination?n.PageRequest.toJSON(h.pagination):void 0),T},fromPartial(h){const T=U();return h.pagination!==void 0&&h.pagination!==null&&(T.pagination=n.PageRequest.fromPartial(h.pagination)),T}};function W(){return{metadatas:[],pagination:void 0}}e.QueryDenomsMetadataResponse={typeUrl:"/cosmos.bank.v1beta1.QueryDenomsMetadataResponse",encode(h,T=o.BinaryWriter.create()){for(const Q of h.metadatas)i.Metadata.encode(Q,T.uint32(10).fork()).ldelim();return h.pagination!==void 0&&n.PageResponse.encode(h.pagination,T.uint32(18).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=W();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.metadatas.push(i.Metadata.decode(Q,Q.uint32()));break;case 2:a.pagination=n.PageResponse.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=W();return Array.isArray(h==null?void 0:h.metadatas)&&(T.metadatas=h.metadatas.map(Q=>i.Metadata.fromJSON(Q))),(0,g.isSet)(h.pagination)&&(T.pagination=n.PageResponse.fromJSON(h.pagination)),T},toJSON(h){const T={};return h.metadatas?T.metadatas=h.metadatas.map(Q=>Q?i.Metadata.toJSON(Q):void 0):T.metadatas=[],h.pagination!==void 0&&(T.pagination=h.pagination?n.PageResponse.toJSON(h.pagination):void 0),T},fromPartial(h){var Q;const T=W();return T.metadatas=((Q=h.metadatas)==null?void 0:Q.map(H=>i.Metadata.fromPartial(H)))||[],h.pagination!==void 0&&h.pagination!==null&&(T.pagination=n.PageResponse.fromPartial(h.pagination)),T}};function r(){return{denom:""}}e.QueryDenomMetadataRequest={typeUrl:"/cosmos.bank.v1beta1.QueryDenomMetadataRequest",encode(h,T=o.BinaryWriter.create()){return h.denom!==""&&T.uint32(10).string(h.denom),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=r();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.denom=Q.string();break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=r();return(0,g.isSet)(h.denom)&&(T.denom=String(h.denom)),T},toJSON(h){const T={};return h.denom!==void 0&&(T.denom=h.denom),T},fromPartial(h){const T=r();return T.denom=h.denom??"",T}};function s(){return{metadata:i.Metadata.fromPartial({})}}e.QueryDenomMetadataResponse={typeUrl:"/cosmos.bank.v1beta1.QueryDenomMetadataResponse",encode(h,T=o.BinaryWriter.create()){return h.metadata!==void 0&&i.Metadata.encode(h.metadata,T.uint32(10).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=s();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.metadata=i.Metadata.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=s();return(0,g.isSet)(h.metadata)&&(T.metadata=i.Metadata.fromJSON(h.metadata)),T},toJSON(h){const T={};return h.metadata!==void 0&&(T.metadata=h.metadata?i.Metadata.toJSON(h.metadata):void 0),T},fromPartial(h){const T=s();return h.metadata!==void 0&&h.metadata!==null&&(T.metadata=i.Metadata.fromPartial(h.metadata)),T}};function O(){return{denom:"",pagination:void 0}}e.QueryDenomOwnersRequest={typeUrl:"/cosmos.bank.v1beta1.QueryDenomOwnersRequest",encode(h,T=o.BinaryWriter.create()){return h.denom!==""&&T.uint32(10).string(h.denom),h.pagination!==void 0&&n.PageRequest.encode(h.pagination,T.uint32(18).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=O();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.denom=Q.string();break;case 2:a.pagination=n.PageRequest.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=O();return(0,g.isSet)(h.denom)&&(T.denom=String(h.denom)),(0,g.isSet)(h.pagination)&&(T.pagination=n.PageRequest.fromJSON(h.pagination)),T},toJSON(h){const T={};return h.denom!==void 0&&(T.denom=h.denom),h.pagination!==void 0&&(T.pagination=h.pagination?n.PageRequest.toJSON(h.pagination):void 0),T},fromPartial(h){const T=O();return T.denom=h.denom??"",h.pagination!==void 0&&h.pagination!==null&&(T.pagination=n.PageRequest.fromPartial(h.pagination)),T}};function q(){return{address:"",balance:t.Coin.fromPartial({})}}e.DenomOwner={typeUrl:"/cosmos.bank.v1beta1.DenomOwner",encode(h,T=o.BinaryWriter.create()){return h.address!==""&&T.uint32(10).string(h.address),h.balance!==void 0&&t.Coin.encode(h.balance,T.uint32(18).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=q();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.address=Q.string();break;case 2:a.balance=t.Coin.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=q();return(0,g.isSet)(h.address)&&(T.address=String(h.address)),(0,g.isSet)(h.balance)&&(T.balance=t.Coin.fromJSON(h.balance)),T},toJSON(h){const T={};return h.address!==void 0&&(T.address=h.address),h.balance!==void 0&&(T.balance=h.balance?t.Coin.toJSON(h.balance):void 0),T},fromPartial(h){const T=q();return T.address=h.address??"",h.balance!==void 0&&h.balance!==null&&(T.balance=t.Coin.fromPartial(h.balance)),T}};function d(){return{denomOwners:[],pagination:void 0}}e.QueryDenomOwnersResponse={typeUrl:"/cosmos.bank.v1beta1.QueryDenomOwnersResponse",encode(h,T=o.BinaryWriter.create()){for(const Q of h.denomOwners)e.DenomOwner.encode(Q,T.uint32(10).fork()).ldelim();return h.pagination!==void 0&&n.PageResponse.encode(h.pagination,T.uint32(18).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=d();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.denomOwners.push(e.DenomOwner.decode(Q,Q.uint32()));break;case 2:a.pagination=n.PageResponse.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=d();return Array.isArray(h==null?void 0:h.denomOwners)&&(T.denomOwners=h.denomOwners.map(Q=>e.DenomOwner.fromJSON(Q))),(0,g.isSet)(h.pagination)&&(T.pagination=n.PageResponse.fromJSON(h.pagination)),T},toJSON(h){const T={};return h.denomOwners?T.denomOwners=h.denomOwners.map(Q=>Q?e.DenomOwner.toJSON(Q):void 0):T.denomOwners=[],h.pagination!==void 0&&(T.pagination=h.pagination?n.PageResponse.toJSON(h.pagination):void 0),T},fromPartial(h){var Q;const T=d();return T.denomOwners=((Q=h.denomOwners)==null?void 0:Q.map(H=>e.DenomOwner.fromPartial(H)))||[],h.pagination!==void 0&&h.pagination!==null&&(T.pagination=n.PageResponse.fromPartial(h.pagination)),T}};function l(){return{denoms:[],pagination:void 0}}e.QuerySendEnabledRequest={typeUrl:"/cosmos.bank.v1beta1.QuerySendEnabledRequest",encode(h,T=o.BinaryWriter.create()){for(const Q of h.denoms)T.uint32(10).string(Q);return h.pagination!==void 0&&n.PageRequest.encode(h.pagination,T.uint32(794).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=l();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.denoms.push(Q.string());break;case 99:a.pagination=n.PageRequest.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=l();return Array.isArray(h==null?void 0:h.denoms)&&(T.denoms=h.denoms.map(Q=>String(Q))),(0,g.isSet)(h.pagination)&&(T.pagination=n.PageRequest.fromJSON(h.pagination)),T},toJSON(h){const T={};return h.denoms?T.denoms=h.denoms.map(Q=>Q):T.denoms=[],h.pagination!==void 0&&(T.pagination=h.pagination?n.PageRequest.toJSON(h.pagination):void 0),T},fromPartial(h){var Q;const T=l();return T.denoms=((Q=h.denoms)==null?void 0:Q.map(H=>H))||[],h.pagination!==void 0&&h.pagination!==null&&(T.pagination=n.PageRequest.fromPartial(h.pagination)),T}};function M(){return{sendEnabled:[],pagination:void 0}}e.QuerySendEnabledResponse={typeUrl:"/cosmos.bank.v1beta1.QuerySendEnabledResponse",encode(h,T=o.BinaryWriter.create()){for(const Q of h.sendEnabled)i.SendEnabled.encode(Q,T.uint32(10).fork()).ldelim();return h.pagination!==void 0&&n.PageResponse.encode(h.pagination,T.uint32(794).fork()).ldelim(),T},decode(h,T){const Q=h instanceof o.BinaryReader?h:new o.BinaryReader(h);let H=T===void 0?Q.len:Q.pos+T;const a=M();for(;Q.pos<H;){const P=Q.uint32();switch(P>>>3){case 1:a.sendEnabled.push(i.SendEnabled.decode(Q,Q.uint32()));break;case 99:a.pagination=n.PageResponse.decode(Q,Q.uint32());break;default:Q.skipType(P&7);break}}return a},fromJSON(h){const T=M();return Array.isArray(h==null?void 0:h.sendEnabled)&&(T.sendEnabled=h.sendEnabled.map(Q=>i.SendEnabled.fromJSON(Q))),(0,g.isSet)(h.pagination)&&(T.pagination=n.PageResponse.fromJSON(h.pagination)),T},toJSON(h){const T={};return h.sendEnabled?T.sendEnabled=h.sendEnabled.map(Q=>Q?i.SendEnabled.toJSON(Q):void 0):T.sendEnabled=[],h.pagination!==void 0&&(T.pagination=h.pagination?n.PageResponse.toJSON(h.pagination):void 0),T},fromPartial(h){var Q;const T=M();return T.sendEnabled=((Q=h.sendEnabled)==null?void 0:Q.map(H=>i.SendEnabled.fromPartial(H)))||[],h.pagination!==void 0&&h.pagination!==null&&(T.pagination=n.PageResponse.fromPartial(h.pagination)),T}};class m{constructor(T){this.rpc=T,this.Balance=this.Balance.bind(this),this.AllBalances=this.AllBalances.bind(this),this.SpendableBalances=this.SpendableBalances.bind(this),this.SpendableBalanceByDenom=this.SpendableBalanceByDenom.bind(this),this.TotalSupply=this.TotalSupply.bind(this),this.SupplyOf=this.SupplyOf.bind(this),this.Params=this.Params.bind(this),this.DenomMetadata=this.DenomMetadata.bind(this),this.DenomsMetadata=this.DenomsMetadata.bind(this),this.DenomOwners=this.DenomOwners.bind(this),this.SendEnabled=this.SendEnabled.bind(this)}Balance(T){const Q=e.QueryBalanceRequest.encode(T).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","Balance",Q).then(a=>e.QueryBalanceResponse.decode(new o.BinaryReader(a)))}AllBalances(T){const Q=e.QueryAllBalancesRequest.encode(T).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","AllBalances",Q).then(a=>e.QueryAllBalancesResponse.decode(new o.BinaryReader(a)))}SpendableBalances(T){const Q=e.QuerySpendableBalancesRequest.encode(T).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","SpendableBalances",Q).then(a=>e.QuerySpendableBalancesResponse.decode(new o.BinaryReader(a)))}SpendableBalanceByDenom(T){const Q=e.QuerySpendableBalanceByDenomRequest.encode(T).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","SpendableBalanceByDenom",Q).then(a=>e.QuerySpendableBalanceByDenomResponse.decode(new o.BinaryReader(a)))}TotalSupply(T={pagination:n.PageRequest.fromPartial({})}){const Q=e.QueryTotalSupplyRequest.encode(T).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","TotalSupply",Q).then(a=>e.QueryTotalSupplyResponse.decode(new o.BinaryReader(a)))}SupplyOf(T){const Q=e.QuerySupplyOfRequest.encode(T).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","SupplyOf",Q).then(a=>e.QuerySupplyOfResponse.decode(new o.BinaryReader(a)))}Params(T={}){const Q=e.QueryParamsRequest.encode(T).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","Params",Q).then(a=>e.QueryParamsResponse.decode(new o.BinaryReader(a)))}DenomMetadata(T){const Q=e.QueryDenomMetadataRequest.encode(T).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","DenomMetadata",Q).then(a=>e.QueryDenomMetadataResponse.decode(new o.BinaryReader(a)))}DenomsMetadata(T={pagination:n.PageRequest.fromPartial({})}){const Q=e.QueryDenomsMetadataRequest.encode(T).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","DenomsMetadata",Q).then(a=>e.QueryDenomsMetadataResponse.decode(new o.BinaryReader(a)))}DenomOwners(T){const Q=e.QueryDenomOwnersRequest.encode(T).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","DenomOwners",Q).then(a=>e.QueryDenomOwnersResponse.decode(new o.BinaryReader(a)))}SendEnabled(T){const Q=e.QuerySendEnabledRequest.encode(T).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","SendEnabled",Q).then(a=>e.QuerySendEnabledResponse.decode(new o.BinaryReader(a)))}}e.QueryClientImpl=m})(pc);Object.defineProperty(ss,"__esModule",{value:!0});ss.setupBankExtension=void 0;const Qd=Ie,Fd=pc,Hl=ze;function Pk(e){const n=(0,Hl.createProtobufRpcClient)(e),t=new Fd.QueryClientImpl(n);return{bank:{balance:async(i,o)=>{const{balance:g}=await t.Balance({address:i,denom:o});return(0,Qd.assert)(g),g},allBalances:async i=>{const{balances:o}=await t.AllBalances(Fd.QueryAllBalancesRequest.fromPartial({address:i}));return o},totalSupply:async i=>await t.TotalSupply({pagination:(0,Hl.createPagination)(i)}),supplyOf:async i=>{const{amount:o}=await t.SupplyOf({denom:i});return(0,Qd.assert)(o),o},denomMetadata:async i=>{const{metadata:o}=await t.DenomMetadata({denom:i});return(0,Qd.assert)(o),o},denomsMetadata:async()=>{const{metadatas:i}=await t.DenomsMetadata(Fd.QueryDenomsMetadataRequest.fromPartial({pagination:void 0}));return i}}}}ss.setupBankExtension=Pk;var fi={};Object.defineProperty(fi,"__esModule",{value:!0});fi.createCrysisAminoConverters=fi.isAminoMsgVerifyInvariant=void 0;function vk(e){return e.type==="cosmos-sdk/MsgVerifyInvariant"}fi.isAminoMsgVerifyInvariant=vk;function Ck(){throw new Error("Not implemented")}fi.createCrysisAminoConverters=Ck;var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.createDistributionAminoConverters=Bn.isAminoMsgFundCommunityPool=Bn.isAminoMsgWithdrawValidatorCommission=Bn.isAminoMsgWithdrawDelegatorReward=Bn.isAminoMsgSetWithdrawAddress=void 0;function Rk(e){return e.type==="cosmos-sdk/MsgModifyWithdrawAddress"}Bn.isAminoMsgSetWithdrawAddress=Rk;function Bk(e){return e.type==="cosmos-sdk/MsgWithdrawDelegationReward"}Bn.isAminoMsgWithdrawDelegatorReward=Bk;function bk(e){return e.type==="cosmos-sdk/MsgWithdrawValidatorCommission"}Bn.isAminoMsgWithdrawValidatorCommission=bk;function Ek(e){return e.type==="cosmos-sdk/MsgFundCommunityPool"}Bn.isAminoMsgFundCommunityPool=Ek;function Ik(){return{"/cosmos.distribution.v1beta1.MsgFundCommunityPool":{aminoType:"cosmos-sdk/MsgFundCommunityPool",toAmino:({amount:e,depositor:n})=>({amount:[...e],depositor:n}),fromAmino:({amount:e,depositor:n})=>({amount:[...e],depositor:n})},"/cosmos.distribution.v1beta1.MsgSetWithdrawAddress":{aminoType:"cosmos-sdk/MsgModifyWithdrawAddress",toAmino:({delegatorAddress:e,withdrawAddress:n})=>({delegator_address:e,withdraw_address:n}),fromAmino:({delegator_address:e,withdraw_address:n})=>({delegatorAddress:e,withdrawAddress:n})},"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward":{aminoType:"cosmos-sdk/MsgWithdrawDelegationReward",toAmino:({delegatorAddress:e,validatorAddress:n})=>({delegator_address:e,validator_address:n}),fromAmino:({delegator_address:e,validator_address:n})=>({delegatorAddress:e,validatorAddress:n})},"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission":{aminoType:"cosmos-sdk/MsgWithdrawValidatorCommission",toAmino:({validatorAddress:e})=>({validator_address:e}),fromAmino:({validator_address:e})=>({validatorAddress:e})}}}Bn.createDistributionAminoConverters=Ik;var pi={},bo={},mc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CommunityPoolSpendProposalWithDeposit=e.DelegationDelegatorReward=e.DelegatorStartingInfo=e.CommunityPoolSpendProposal=e.FeePool=e.ValidatorSlashEvents=e.ValidatorSlashEvent=e.ValidatorOutstandingRewards=e.ValidatorAccumulatedCommission=e.ValidatorCurrentRewards=e.ValidatorHistoricalRewards=e.Params=e.protobufPackage=void 0;const n=_.coin,t=_.binary,i=_.helpers;e.protobufPackage="cosmos.distribution.v1beta1";function o(){return{communityTax:"",baseProposerReward:"",bonusProposerReward:"",withdrawAddrEnabled:!1}}e.Params={typeUrl:"/cosmos.distribution.v1beta1.Params",encode(c,y=t.BinaryWriter.create()){return c.communityTax!==""&&y.uint32(10).string(c.communityTax),c.baseProposerReward!==""&&y.uint32(18).string(c.baseProposerReward),c.bonusProposerReward!==""&&y.uint32(26).string(c.bonusProposerReward),c.withdrawAddrEnabled===!0&&y.uint32(32).bool(c.withdrawAddrEnabled),y},decode(c,y){const B=c instanceof t.BinaryReader?c:new t.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=o();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.communityTax=B.string();break;case 2:U.baseProposerReward=B.string();break;case 3:U.bonusProposerReward=B.string();break;case 4:U.withdrawAddrEnabled=B.bool();break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=o();return(0,i.isSet)(c.communityTax)&&(y.communityTax=String(c.communityTax)),(0,i.isSet)(c.baseProposerReward)&&(y.baseProposerReward=String(c.baseProposerReward)),(0,i.isSet)(c.bonusProposerReward)&&(y.bonusProposerReward=String(c.bonusProposerReward)),(0,i.isSet)(c.withdrawAddrEnabled)&&(y.withdrawAddrEnabled=!!c.withdrawAddrEnabled),y},toJSON(c){const y={};return c.communityTax!==void 0&&(y.communityTax=c.communityTax),c.baseProposerReward!==void 0&&(y.baseProposerReward=c.baseProposerReward),c.bonusProposerReward!==void 0&&(y.bonusProposerReward=c.bonusProposerReward),c.withdrawAddrEnabled!==void 0&&(y.withdrawAddrEnabled=c.withdrawAddrEnabled),y},fromPartial(c){const y=o();return y.communityTax=c.communityTax??"",y.baseProposerReward=c.baseProposerReward??"",y.bonusProposerReward=c.bonusProposerReward??"",y.withdrawAddrEnabled=c.withdrawAddrEnabled??!1,y}};function g(){return{cumulativeRewardRatio:[],referenceCount:0}}e.ValidatorHistoricalRewards={typeUrl:"/cosmos.distribution.v1beta1.ValidatorHistoricalRewards",encode(c,y=t.BinaryWriter.create()){for(const B of c.cumulativeRewardRatio)n.DecCoin.encode(B,y.uint32(10).fork()).ldelim();return c.referenceCount!==0&&y.uint32(16).uint32(c.referenceCount),y},decode(c,y){const B=c instanceof t.BinaryReader?c:new t.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=g();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.cumulativeRewardRatio.push(n.DecCoin.decode(B,B.uint32()));break;case 2:U.referenceCount=B.uint32();break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=g();return Array.isArray(c==null?void 0:c.cumulativeRewardRatio)&&(y.cumulativeRewardRatio=c.cumulativeRewardRatio.map(B=>n.DecCoin.fromJSON(B))),(0,i.isSet)(c.referenceCount)&&(y.referenceCount=Number(c.referenceCount)),y},toJSON(c){const y={};return c.cumulativeRewardRatio?y.cumulativeRewardRatio=c.cumulativeRewardRatio.map(B=>B?n.DecCoin.toJSON(B):void 0):y.cumulativeRewardRatio=[],c.referenceCount!==void 0&&(y.referenceCount=Math.round(c.referenceCount)),y},fromPartial(c){var B;const y=g();return y.cumulativeRewardRatio=((B=c.cumulativeRewardRatio)==null?void 0:B.map(N=>n.DecCoin.fromPartial(N)))||[],y.referenceCount=c.referenceCount??0,y}};function C(){return{rewards:[],period:BigInt(0)}}e.ValidatorCurrentRewards={typeUrl:"/cosmos.distribution.v1beta1.ValidatorCurrentRewards",encode(c,y=t.BinaryWriter.create()){for(const B of c.rewards)n.DecCoin.encode(B,y.uint32(10).fork()).ldelim();return c.period!==BigInt(0)&&y.uint32(16).uint64(c.period),y},decode(c,y){const B=c instanceof t.BinaryReader?c:new t.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=C();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.rewards.push(n.DecCoin.decode(B,B.uint32()));break;case 2:U.period=B.uint64();break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=C();return Array.isArray(c==null?void 0:c.rewards)&&(y.rewards=c.rewards.map(B=>n.DecCoin.fromJSON(B))),(0,i.isSet)(c.period)&&(y.period=BigInt(c.period.toString())),y},toJSON(c){const y={};return c.rewards?y.rewards=c.rewards.map(B=>B?n.DecCoin.toJSON(B):void 0):y.rewards=[],c.period!==void 0&&(y.period=(c.period||BigInt(0)).toString()),y},fromPartial(c){var B;const y=C();return y.rewards=((B=c.rewards)==null?void 0:B.map(N=>n.DecCoin.fromPartial(N)))||[],c.period!==void 0&&c.period!==null&&(y.period=BigInt(c.period.toString())),y}};function w(){return{commission:[]}}e.ValidatorAccumulatedCommission={typeUrl:"/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission",encode(c,y=t.BinaryWriter.create()){for(const B of c.commission)n.DecCoin.encode(B,y.uint32(10).fork()).ldelim();return y},decode(c,y){const B=c instanceof t.BinaryReader?c:new t.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=w();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.commission.push(n.DecCoin.decode(B,B.uint32()));break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=w();return Array.isArray(c==null?void 0:c.commission)&&(y.commission=c.commission.map(B=>n.DecCoin.fromJSON(B))),y},toJSON(c){const y={};return c.commission?y.commission=c.commission.map(B=>B?n.DecCoin.toJSON(B):void 0):y.commission=[],y},fromPartial(c){var B;const y=w();return y.commission=((B=c.commission)==null?void 0:B.map(N=>n.DecCoin.fromPartial(N)))||[],y}};function E(){return{rewards:[]}}e.ValidatorOutstandingRewards={typeUrl:"/cosmos.distribution.v1beta1.ValidatorOutstandingRewards",encode(c,y=t.BinaryWriter.create()){for(const B of c.rewards)n.DecCoin.encode(B,y.uint32(10).fork()).ldelim();return y},decode(c,y){const B=c instanceof t.BinaryReader?c:new t.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=E();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.rewards.push(n.DecCoin.decode(B,B.uint32()));break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=E();return Array.isArray(c==null?void 0:c.rewards)&&(y.rewards=c.rewards.map(B=>n.DecCoin.fromJSON(B))),y},toJSON(c){const y={};return c.rewards?y.rewards=c.rewards.map(B=>B?n.DecCoin.toJSON(B):void 0):y.rewards=[],y},fromPartial(c){var B;const y=E();return y.rewards=((B=c.rewards)==null?void 0:B.map(N=>n.DecCoin.fromPartial(N)))||[],y}};function D(){return{validatorPeriod:BigInt(0),fraction:""}}e.ValidatorSlashEvent={typeUrl:"/cosmos.distribution.v1beta1.ValidatorSlashEvent",encode(c,y=t.BinaryWriter.create()){return c.validatorPeriod!==BigInt(0)&&y.uint32(8).uint64(c.validatorPeriod),c.fraction!==""&&y.uint32(18).string(c.fraction),y},decode(c,y){const B=c instanceof t.BinaryReader?c:new t.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=D();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.validatorPeriod=B.uint64();break;case 2:U.fraction=B.string();break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=D();return(0,i.isSet)(c.validatorPeriod)&&(y.validatorPeriod=BigInt(c.validatorPeriod.toString())),(0,i.isSet)(c.fraction)&&(y.fraction=String(c.fraction)),y},toJSON(c){const y={};return c.validatorPeriod!==void 0&&(y.validatorPeriod=(c.validatorPeriod||BigInt(0)).toString()),c.fraction!==void 0&&(y.fraction=c.fraction),y},fromPartial(c){const y=D();return c.validatorPeriod!==void 0&&c.validatorPeriod!==null&&(y.validatorPeriod=BigInt(c.validatorPeriod.toString())),y.fraction=c.fraction??"",y}};function J(){return{validatorSlashEvents:[]}}e.ValidatorSlashEvents={typeUrl:"/cosmos.distribution.v1beta1.ValidatorSlashEvents",encode(c,y=t.BinaryWriter.create()){for(const B of c.validatorSlashEvents)e.ValidatorSlashEvent.encode(B,y.uint32(10).fork()).ldelim();return y},decode(c,y){const B=c instanceof t.BinaryReader?c:new t.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=J();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.validatorSlashEvents.push(e.ValidatorSlashEvent.decode(B,B.uint32()));break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=J();return Array.isArray(c==null?void 0:c.validatorSlashEvents)&&(y.validatorSlashEvents=c.validatorSlashEvents.map(B=>e.ValidatorSlashEvent.fromJSON(B))),y},toJSON(c){const y={};return c.validatorSlashEvents?y.validatorSlashEvents=c.validatorSlashEvents.map(B=>B?e.ValidatorSlashEvent.toJSON(B):void 0):y.validatorSlashEvents=[],y},fromPartial(c){var B;const y=J();return y.validatorSlashEvents=((B=c.validatorSlashEvents)==null?void 0:B.map(N=>e.ValidatorSlashEvent.fromPartial(N)))||[],y}};function b(){return{communityPool:[]}}e.FeePool={typeUrl:"/cosmos.distribution.v1beta1.FeePool",encode(c,y=t.BinaryWriter.create()){for(const B of c.communityPool)n.DecCoin.encode(B,y.uint32(10).fork()).ldelim();return y},decode(c,y){const B=c instanceof t.BinaryReader?c:new t.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=b();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.communityPool.push(n.DecCoin.decode(B,B.uint32()));break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=b();return Array.isArray(c==null?void 0:c.communityPool)&&(y.communityPool=c.communityPool.map(B=>n.DecCoin.fromJSON(B))),y},toJSON(c){const y={};return c.communityPool?y.communityPool=c.communityPool.map(B=>B?n.DecCoin.toJSON(B):void 0):y.communityPool=[],y},fromPartial(c){var B;const y=b();return y.communityPool=((B=c.communityPool)==null?void 0:B.map(N=>n.DecCoin.fromPartial(N)))||[],y}};function p(){return{title:"",description:"",recipient:"",amount:[]}}e.CommunityPoolSpendProposal={typeUrl:"/cosmos.distribution.v1beta1.CommunityPoolSpendProposal",encode(c,y=t.BinaryWriter.create()){c.title!==""&&y.uint32(10).string(c.title),c.description!==""&&y.uint32(18).string(c.description),c.recipient!==""&&y.uint32(26).string(c.recipient);for(const B of c.amount)n.Coin.encode(B,y.uint32(34).fork()).ldelim();return y},decode(c,y){const B=c instanceof t.BinaryReader?c:new t.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=p();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.title=B.string();break;case 2:U.description=B.string();break;case 3:U.recipient=B.string();break;case 4:U.amount.push(n.Coin.decode(B,B.uint32()));break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=p();return(0,i.isSet)(c.title)&&(y.title=String(c.title)),(0,i.isSet)(c.description)&&(y.description=String(c.description)),(0,i.isSet)(c.recipient)&&(y.recipient=String(c.recipient)),Array.isArray(c==null?void 0:c.amount)&&(y.amount=c.amount.map(B=>n.Coin.fromJSON(B))),y},toJSON(c){const y={};return c.title!==void 0&&(y.title=c.title),c.description!==void 0&&(y.description=c.description),c.recipient!==void 0&&(y.recipient=c.recipient),c.amount?y.amount=c.amount.map(B=>B?n.Coin.toJSON(B):void 0):y.amount=[],y},fromPartial(c){var B;const y=p();return y.title=c.title??"",y.description=c.description??"",y.recipient=c.recipient??"",y.amount=((B=c.amount)==null?void 0:B.map(N=>n.Coin.fromPartial(N)))||[],y}};function S(){return{previousPeriod:BigInt(0),stake:"",height:BigInt(0)}}e.DelegatorStartingInfo={typeUrl:"/cosmos.distribution.v1beta1.DelegatorStartingInfo",encode(c,y=t.BinaryWriter.create()){return c.previousPeriod!==BigInt(0)&&y.uint32(8).uint64(c.previousPeriod),c.stake!==""&&y.uint32(18).string(c.stake),c.height!==BigInt(0)&&y.uint32(24).uint64(c.height),y},decode(c,y){const B=c instanceof t.BinaryReader?c:new t.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=S();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.previousPeriod=B.uint64();break;case 2:U.stake=B.string();break;case 3:U.height=B.uint64();break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=S();return(0,i.isSet)(c.previousPeriod)&&(y.previousPeriod=BigInt(c.previousPeriod.toString())),(0,i.isSet)(c.stake)&&(y.stake=String(c.stake)),(0,i.isSet)(c.height)&&(y.height=BigInt(c.height.toString())),y},toJSON(c){const y={};return c.previousPeriod!==void 0&&(y.previousPeriod=(c.previousPeriod||BigInt(0)).toString()),c.stake!==void 0&&(y.stake=c.stake),c.height!==void 0&&(y.height=(c.height||BigInt(0)).toString()),y},fromPartial(c){const y=S();return c.previousPeriod!==void 0&&c.previousPeriod!==null&&(y.previousPeriod=BigInt(c.previousPeriod.toString())),y.stake=c.stake??"",c.height!==void 0&&c.height!==null&&(y.height=BigInt(c.height.toString())),y}};function R(){return{validatorAddress:"",reward:[]}}e.DelegationDelegatorReward={typeUrl:"/cosmos.distribution.v1beta1.DelegationDelegatorReward",encode(c,y=t.BinaryWriter.create()){c.validatorAddress!==""&&y.uint32(10).string(c.validatorAddress);for(const B of c.reward)n.DecCoin.encode(B,y.uint32(18).fork()).ldelim();return y},decode(c,y){const B=c instanceof t.BinaryReader?c:new t.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=R();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.validatorAddress=B.string();break;case 2:U.reward.push(n.DecCoin.decode(B,B.uint32()));break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=R();return(0,i.isSet)(c.validatorAddress)&&(y.validatorAddress=String(c.validatorAddress)),Array.isArray(c==null?void 0:c.reward)&&(y.reward=c.reward.map(B=>n.DecCoin.fromJSON(B))),y},toJSON(c){const y={};return c.validatorAddress!==void 0&&(y.validatorAddress=c.validatorAddress),c.reward?y.reward=c.reward.map(B=>B?n.DecCoin.toJSON(B):void 0):y.reward=[],y},fromPartial(c){var B;const y=R();return y.validatorAddress=c.validatorAddress??"",y.reward=((B=c.reward)==null?void 0:B.map(N=>n.DecCoin.fromPartial(N)))||[],y}};function u(){return{title:"",description:"",recipient:"",amount:"",deposit:""}}e.CommunityPoolSpendProposalWithDeposit={typeUrl:"/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit",encode(c,y=t.BinaryWriter.create()){return c.title!==""&&y.uint32(10).string(c.title),c.description!==""&&y.uint32(18).string(c.description),c.recipient!==""&&y.uint32(26).string(c.recipient),c.amount!==""&&y.uint32(34).string(c.amount),c.deposit!==""&&y.uint32(42).string(c.deposit),y},decode(c,y){const B=c instanceof t.BinaryReader?c:new t.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=u();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.title=B.string();break;case 2:U.description=B.string();break;case 3:U.recipient=B.string();break;case 4:U.amount=B.string();break;case 5:U.deposit=B.string();break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=u();return(0,i.isSet)(c.title)&&(y.title=String(c.title)),(0,i.isSet)(c.description)&&(y.description=String(c.description)),(0,i.isSet)(c.recipient)&&(y.recipient=String(c.recipient)),(0,i.isSet)(c.amount)&&(y.amount=String(c.amount)),(0,i.isSet)(c.deposit)&&(y.deposit=String(c.deposit)),y},toJSON(c){const y={};return c.title!==void 0&&(y.title=c.title),c.description!==void 0&&(y.description=c.description),c.recipient!==void 0&&(y.recipient=c.recipient),c.amount!==void 0&&(y.amount=c.amount),c.deposit!==void 0&&(y.deposit=c.deposit),y},fromPartial(c){const y=u();return y.title=c.title??"",y.description=c.description??"",y.recipient=c.recipient??"",y.amount=c.amount??"",y.deposit=c.deposit??"",y}}})(mc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgCommunityPoolSpendResponse=e.MsgCommunityPoolSpend=e.MsgUpdateParamsResponse=e.MsgUpdateParams=e.MsgFundCommunityPoolResponse=e.MsgFundCommunityPool=e.MsgWithdrawValidatorCommissionResponse=e.MsgWithdrawValidatorCommission=e.MsgWithdrawDelegatorRewardResponse=e.MsgWithdrawDelegatorReward=e.MsgSetWithdrawAddressResponse=e.MsgSetWithdrawAddress=e.protobufPackage=void 0;const n=_.coin,t=mc,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.distribution.v1beta1";function g(){return{delegatorAddress:"",withdrawAddress:""}}e.MsgSetWithdrawAddress={typeUrl:"/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",encode(B,N=i.BinaryWriter.create()){return B.delegatorAddress!==""&&N.uint32(10).string(B.delegatorAddress),B.withdrawAddress!==""&&N.uint32(18).string(B.withdrawAddress),N},decode(B,N){const U=B instanceof i.BinaryReader?B:new i.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=g();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.delegatorAddress=U.string();break;case 2:r.withdrawAddress=U.string();break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=g();return(0,o.isSet)(B.delegatorAddress)&&(N.delegatorAddress=String(B.delegatorAddress)),(0,o.isSet)(B.withdrawAddress)&&(N.withdrawAddress=String(B.withdrawAddress)),N},toJSON(B){const N={};return B.delegatorAddress!==void 0&&(N.delegatorAddress=B.delegatorAddress),B.withdrawAddress!==void 0&&(N.withdrawAddress=B.withdrawAddress),N},fromPartial(B){const N=g();return N.delegatorAddress=B.delegatorAddress??"",N.withdrawAddress=B.withdrawAddress??"",N}};function C(){return{}}e.MsgSetWithdrawAddressResponse={typeUrl:"/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse",encode(B,N=i.BinaryWriter.create()){return N},decode(B,N){const U=B instanceof i.BinaryReader?B:new i.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=C();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){default:U.skipType(s&7);break}}return r},fromJSON(B){return C()},toJSON(B){return{}},fromPartial(B){return C()}};function w(){return{delegatorAddress:"",validatorAddress:""}}e.MsgWithdrawDelegatorReward={typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",encode(B,N=i.BinaryWriter.create()){return B.delegatorAddress!==""&&N.uint32(10).string(B.delegatorAddress),B.validatorAddress!==""&&N.uint32(18).string(B.validatorAddress),N},decode(B,N){const U=B instanceof i.BinaryReader?B:new i.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=w();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.delegatorAddress=U.string();break;case 2:r.validatorAddress=U.string();break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=w();return(0,o.isSet)(B.delegatorAddress)&&(N.delegatorAddress=String(B.delegatorAddress)),(0,o.isSet)(B.validatorAddress)&&(N.validatorAddress=String(B.validatorAddress)),N},toJSON(B){const N={};return B.delegatorAddress!==void 0&&(N.delegatorAddress=B.delegatorAddress),B.validatorAddress!==void 0&&(N.validatorAddress=B.validatorAddress),N},fromPartial(B){const N=w();return N.delegatorAddress=B.delegatorAddress??"",N.validatorAddress=B.validatorAddress??"",N}};function E(){return{amount:[]}}e.MsgWithdrawDelegatorRewardResponse={typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse",encode(B,N=i.BinaryWriter.create()){for(const U of B.amount)n.Coin.encode(U,N.uint32(10).fork()).ldelim();return N},decode(B,N){const U=B instanceof i.BinaryReader?B:new i.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=E();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.amount.push(n.Coin.decode(U,U.uint32()));break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=E();return Array.isArray(B==null?void 0:B.amount)&&(N.amount=B.amount.map(U=>n.Coin.fromJSON(U))),N},toJSON(B){const N={};return B.amount?N.amount=B.amount.map(U=>U?n.Coin.toJSON(U):void 0):N.amount=[],N},fromPartial(B){var U;const N=E();return N.amount=((U=B.amount)==null?void 0:U.map(W=>n.Coin.fromPartial(W)))||[],N}};function D(){return{validatorAddress:""}}e.MsgWithdrawValidatorCommission={typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",encode(B,N=i.BinaryWriter.create()){return B.validatorAddress!==""&&N.uint32(10).string(B.validatorAddress),N},decode(B,N){const U=B instanceof i.BinaryReader?B:new i.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=D();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.validatorAddress=U.string();break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=D();return(0,o.isSet)(B.validatorAddress)&&(N.validatorAddress=String(B.validatorAddress)),N},toJSON(B){const N={};return B.validatorAddress!==void 0&&(N.validatorAddress=B.validatorAddress),N},fromPartial(B){const N=D();return N.validatorAddress=B.validatorAddress??"",N}};function J(){return{amount:[]}}e.MsgWithdrawValidatorCommissionResponse={typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse",encode(B,N=i.BinaryWriter.create()){for(const U of B.amount)n.Coin.encode(U,N.uint32(10).fork()).ldelim();return N},decode(B,N){const U=B instanceof i.BinaryReader?B:new i.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=J();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.amount.push(n.Coin.decode(U,U.uint32()));break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=J();return Array.isArray(B==null?void 0:B.amount)&&(N.amount=B.amount.map(U=>n.Coin.fromJSON(U))),N},toJSON(B){const N={};return B.amount?N.amount=B.amount.map(U=>U?n.Coin.toJSON(U):void 0):N.amount=[],N},fromPartial(B){var U;const N=J();return N.amount=((U=B.amount)==null?void 0:U.map(W=>n.Coin.fromPartial(W)))||[],N}};function b(){return{amount:[],depositor:""}}e.MsgFundCommunityPool={typeUrl:"/cosmos.distribution.v1beta1.MsgFundCommunityPool",encode(B,N=i.BinaryWriter.create()){for(const U of B.amount)n.Coin.encode(U,N.uint32(10).fork()).ldelim();return B.depositor!==""&&N.uint32(18).string(B.depositor),N},decode(B,N){const U=B instanceof i.BinaryReader?B:new i.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=b();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.amount.push(n.Coin.decode(U,U.uint32()));break;case 2:r.depositor=U.string();break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=b();return Array.isArray(B==null?void 0:B.amount)&&(N.amount=B.amount.map(U=>n.Coin.fromJSON(U))),(0,o.isSet)(B.depositor)&&(N.depositor=String(B.depositor)),N},toJSON(B){const N={};return B.amount?N.amount=B.amount.map(U=>U?n.Coin.toJSON(U):void 0):N.amount=[],B.depositor!==void 0&&(N.depositor=B.depositor),N},fromPartial(B){var U;const N=b();return N.amount=((U=B.amount)==null?void 0:U.map(W=>n.Coin.fromPartial(W)))||[],N.depositor=B.depositor??"",N}};function p(){return{}}e.MsgFundCommunityPoolResponse={typeUrl:"/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse",encode(B,N=i.BinaryWriter.create()){return N},decode(B,N){const U=B instanceof i.BinaryReader?B:new i.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=p();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){default:U.skipType(s&7);break}}return r},fromJSON(B){return p()},toJSON(B){return{}},fromPartial(B){return p()}};function S(){return{authority:"",params:t.Params.fromPartial({})}}e.MsgUpdateParams={typeUrl:"/cosmos.distribution.v1beta1.MsgUpdateParams",encode(B,N=i.BinaryWriter.create()){return B.authority!==""&&N.uint32(10).string(B.authority),B.params!==void 0&&t.Params.encode(B.params,N.uint32(18).fork()).ldelim(),N},decode(B,N){const U=B instanceof i.BinaryReader?B:new i.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=S();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.authority=U.string();break;case 2:r.params=t.Params.decode(U,U.uint32());break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=S();return(0,o.isSet)(B.authority)&&(N.authority=String(B.authority)),(0,o.isSet)(B.params)&&(N.params=t.Params.fromJSON(B.params)),N},toJSON(B){const N={};return B.authority!==void 0&&(N.authority=B.authority),B.params!==void 0&&(N.params=B.params?t.Params.toJSON(B.params):void 0),N},fromPartial(B){const N=S();return N.authority=B.authority??"",B.params!==void 0&&B.params!==null&&(N.params=t.Params.fromPartial(B.params)),N}};function R(){return{}}e.MsgUpdateParamsResponse={typeUrl:"/cosmos.distribution.v1beta1.MsgUpdateParamsResponse",encode(B,N=i.BinaryWriter.create()){return N},decode(B,N){const U=B instanceof i.BinaryReader?B:new i.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=R();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){default:U.skipType(s&7);break}}return r},fromJSON(B){return R()},toJSON(B){return{}},fromPartial(B){return R()}};function u(){return{authority:"",recipient:"",amount:[]}}e.MsgCommunityPoolSpend={typeUrl:"/cosmos.distribution.v1beta1.MsgCommunityPoolSpend",encode(B,N=i.BinaryWriter.create()){B.authority!==""&&N.uint32(10).string(B.authority),B.recipient!==""&&N.uint32(18).string(B.recipient);for(const U of B.amount)n.Coin.encode(U,N.uint32(26).fork()).ldelim();return N},decode(B,N){const U=B instanceof i.BinaryReader?B:new i.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=u();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.authority=U.string();break;case 2:r.recipient=U.string();break;case 3:r.amount.push(n.Coin.decode(U,U.uint32()));break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=u();return(0,o.isSet)(B.authority)&&(N.authority=String(B.authority)),(0,o.isSet)(B.recipient)&&(N.recipient=String(B.recipient)),Array.isArray(B==null?void 0:B.amount)&&(N.amount=B.amount.map(U=>n.Coin.fromJSON(U))),N},toJSON(B){const N={};return B.authority!==void 0&&(N.authority=B.authority),B.recipient!==void 0&&(N.recipient=B.recipient),B.amount?N.amount=B.amount.map(U=>U?n.Coin.toJSON(U):void 0):N.amount=[],N},fromPartial(B){var U;const N=u();return N.authority=B.authority??"",N.recipient=B.recipient??"",N.amount=((U=B.amount)==null?void 0:U.map(W=>n.Coin.fromPartial(W)))||[],N}};function c(){return{}}e.MsgCommunityPoolSpendResponse={typeUrl:"/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse",encode(B,N=i.BinaryWriter.create()){return N},decode(B,N){const U=B instanceof i.BinaryReader?B:new i.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=c();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){default:U.skipType(s&7);break}}return r},fromJSON(B){return c()},toJSON(B){return{}},fromPartial(B){return c()}};class y{constructor(N){this.rpc=N,this.SetWithdrawAddress=this.SetWithdrawAddress.bind(this),this.WithdrawDelegatorReward=this.WithdrawDelegatorReward.bind(this),this.WithdrawValidatorCommission=this.WithdrawValidatorCommission.bind(this),this.FundCommunityPool=this.FundCommunityPool.bind(this),this.UpdateParams=this.UpdateParams.bind(this),this.CommunityPoolSpend=this.CommunityPoolSpend.bind(this)}SetWithdrawAddress(N){const U=e.MsgSetWithdrawAddress.encode(N).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","SetWithdrawAddress",U).then(r=>e.MsgSetWithdrawAddressResponse.decode(new i.BinaryReader(r)))}WithdrawDelegatorReward(N){const U=e.MsgWithdrawDelegatorReward.encode(N).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","WithdrawDelegatorReward",U).then(r=>e.MsgWithdrawDelegatorRewardResponse.decode(new i.BinaryReader(r)))}WithdrawValidatorCommission(N){const U=e.MsgWithdrawValidatorCommission.encode(N).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","WithdrawValidatorCommission",U).then(r=>e.MsgWithdrawValidatorCommissionResponse.decode(new i.BinaryReader(r)))}FundCommunityPool(N){const U=e.MsgFundCommunityPool.encode(N).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","FundCommunityPool",U).then(r=>e.MsgFundCommunityPoolResponse.decode(new i.BinaryReader(r)))}UpdateParams(N){const U=e.MsgUpdateParams.encode(N).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","UpdateParams",U).then(r=>e.MsgUpdateParamsResponse.decode(new i.BinaryReader(r)))}CommunityPoolSpend(N){const U=e.MsgCommunityPoolSpend.encode(N).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","CommunityPoolSpend",U).then(r=>e.MsgCommunityPoolSpendResponse.decode(new i.BinaryReader(r)))}}e.MsgClientImpl=y})(bo);Object.defineProperty(pi,"__esModule",{value:!0});pi.isMsgWithdrawDelegatorRewardEncodeObject=pi.distributionTypes=void 0;const xo=bo;pi.distributionTypes=[["/cosmos.distribution.v1beta1.MsgFundCommunityPool",xo.MsgFundCommunityPool],["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",xo.MsgSetWithdrawAddress],["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",xo.MsgWithdrawDelegatorReward],["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",xo.MsgWithdrawValidatorCommission]];function Ok(e){return e.typeUrl==="/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"}pi.isMsgWithdrawDelegatorRewardEncodeObject=Ok;var ds={},hc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryCommunityPoolResponse=e.QueryCommunityPoolRequest=e.QueryDelegatorWithdrawAddressResponse=e.QueryDelegatorWithdrawAddressRequest=e.QueryDelegatorValidatorsResponse=e.QueryDelegatorValidatorsRequest=e.QueryDelegationTotalRewardsResponse=e.QueryDelegationTotalRewardsRequest=e.QueryDelegationRewardsResponse=e.QueryDelegationRewardsRequest=e.QueryValidatorSlashesResponse=e.QueryValidatorSlashesRequest=e.QueryValidatorCommissionResponse=e.QueryValidatorCommissionRequest=e.QueryValidatorOutstandingRewardsResponse=e.QueryValidatorOutstandingRewardsRequest=e.QueryValidatorDistributionInfoResponse=e.QueryValidatorDistributionInfoRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.protobufPackage=void 0;const n=Be,t=mc,i=_.coin,o=_.binary,g=_.helpers;e.protobufPackage="cosmos.distribution.v1beta1";function C(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryParamsRequest",encode(l,M=o.BinaryWriter.create()){return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=C();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){default:m.skipType(Q&7);break}}return T},fromJSON(l){return C()},toJSON(l){return{}},fromPartial(l){return C()}};function w(){return{params:t.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryParamsResponse",encode(l,M=o.BinaryWriter.create()){return l.params!==void 0&&t.Params.encode(l.params,M.uint32(10).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=w();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.params=t.Params.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=w();return(0,g.isSet)(l.params)&&(M.params=t.Params.fromJSON(l.params)),M},toJSON(l){const M={};return l.params!==void 0&&(M.params=l.params?t.Params.toJSON(l.params):void 0),M},fromPartial(l){const M=w();return l.params!==void 0&&l.params!==null&&(M.params=t.Params.fromPartial(l.params)),M}};function E(){return{validatorAddress:""}}e.QueryValidatorDistributionInfoRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest",encode(l,M=o.BinaryWriter.create()){return l.validatorAddress!==""&&M.uint32(10).string(l.validatorAddress),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=E();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.validatorAddress=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=E();return(0,g.isSet)(l.validatorAddress)&&(M.validatorAddress=String(l.validatorAddress)),M},toJSON(l){const M={};return l.validatorAddress!==void 0&&(M.validatorAddress=l.validatorAddress),M},fromPartial(l){const M=E();return M.validatorAddress=l.validatorAddress??"",M}};function D(){return{operatorAddress:"",selfBondRewards:[],commission:[]}}e.QueryValidatorDistributionInfoResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse",encode(l,M=o.BinaryWriter.create()){l.operatorAddress!==""&&M.uint32(10).string(l.operatorAddress);for(const m of l.selfBondRewards)i.DecCoin.encode(m,M.uint32(18).fork()).ldelim();for(const m of l.commission)i.DecCoin.encode(m,M.uint32(26).fork()).ldelim();return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=D();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.operatorAddress=m.string();break;case 2:T.selfBondRewards.push(i.DecCoin.decode(m,m.uint32()));break;case 3:T.commission.push(i.DecCoin.decode(m,m.uint32()));break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=D();return(0,g.isSet)(l.operatorAddress)&&(M.operatorAddress=String(l.operatorAddress)),Array.isArray(l==null?void 0:l.selfBondRewards)&&(M.selfBondRewards=l.selfBondRewards.map(m=>i.DecCoin.fromJSON(m))),Array.isArray(l==null?void 0:l.commission)&&(M.commission=l.commission.map(m=>i.DecCoin.fromJSON(m))),M},toJSON(l){const M={};return l.operatorAddress!==void 0&&(M.operatorAddress=l.operatorAddress),l.selfBondRewards?M.selfBondRewards=l.selfBondRewards.map(m=>m?i.DecCoin.toJSON(m):void 0):M.selfBondRewards=[],l.commission?M.commission=l.commission.map(m=>m?i.DecCoin.toJSON(m):void 0):M.commission=[],M},fromPartial(l){var m,h;const M=D();return M.operatorAddress=l.operatorAddress??"",M.selfBondRewards=((m=l.selfBondRewards)==null?void 0:m.map(T=>i.DecCoin.fromPartial(T)))||[],M.commission=((h=l.commission)==null?void 0:h.map(T=>i.DecCoin.fromPartial(T)))||[],M}};function J(){return{validatorAddress:""}}e.QueryValidatorOutstandingRewardsRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest",encode(l,M=o.BinaryWriter.create()){return l.validatorAddress!==""&&M.uint32(10).string(l.validatorAddress),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=J();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.validatorAddress=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=J();return(0,g.isSet)(l.validatorAddress)&&(M.validatorAddress=String(l.validatorAddress)),M},toJSON(l){const M={};return l.validatorAddress!==void 0&&(M.validatorAddress=l.validatorAddress),M},fromPartial(l){const M=J();return M.validatorAddress=l.validatorAddress??"",M}};function b(){return{rewards:t.ValidatorOutstandingRewards.fromPartial({})}}e.QueryValidatorOutstandingRewardsResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse",encode(l,M=o.BinaryWriter.create()){return l.rewards!==void 0&&t.ValidatorOutstandingRewards.encode(l.rewards,M.uint32(10).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=b();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.rewards=t.ValidatorOutstandingRewards.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=b();return(0,g.isSet)(l.rewards)&&(M.rewards=t.ValidatorOutstandingRewards.fromJSON(l.rewards)),M},toJSON(l){const M={};return l.rewards!==void 0&&(M.rewards=l.rewards?t.ValidatorOutstandingRewards.toJSON(l.rewards):void 0),M},fromPartial(l){const M=b();return l.rewards!==void 0&&l.rewards!==null&&(M.rewards=t.ValidatorOutstandingRewards.fromPartial(l.rewards)),M}};function p(){return{validatorAddress:""}}e.QueryValidatorCommissionRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorCommissionRequest",encode(l,M=o.BinaryWriter.create()){return l.validatorAddress!==""&&M.uint32(10).string(l.validatorAddress),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=p();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.validatorAddress=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=p();return(0,g.isSet)(l.validatorAddress)&&(M.validatorAddress=String(l.validatorAddress)),M},toJSON(l){const M={};return l.validatorAddress!==void 0&&(M.validatorAddress=l.validatorAddress),M},fromPartial(l){const M=p();return M.validatorAddress=l.validatorAddress??"",M}};function S(){return{commission:t.ValidatorAccumulatedCommission.fromPartial({})}}e.QueryValidatorCommissionResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorCommissionResponse",encode(l,M=o.BinaryWriter.create()){return l.commission!==void 0&&t.ValidatorAccumulatedCommission.encode(l.commission,M.uint32(10).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=S();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.commission=t.ValidatorAccumulatedCommission.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=S();return(0,g.isSet)(l.commission)&&(M.commission=t.ValidatorAccumulatedCommission.fromJSON(l.commission)),M},toJSON(l){const M={};return l.commission!==void 0&&(M.commission=l.commission?t.ValidatorAccumulatedCommission.toJSON(l.commission):void 0),M},fromPartial(l){const M=S();return l.commission!==void 0&&l.commission!==null&&(M.commission=t.ValidatorAccumulatedCommission.fromPartial(l.commission)),M}};function R(){return{validatorAddress:"",startingHeight:BigInt(0),endingHeight:BigInt(0),pagination:void 0}}e.QueryValidatorSlashesRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorSlashesRequest",encode(l,M=o.BinaryWriter.create()){return l.validatorAddress!==""&&M.uint32(10).string(l.validatorAddress),l.startingHeight!==BigInt(0)&&M.uint32(16).uint64(l.startingHeight),l.endingHeight!==BigInt(0)&&M.uint32(24).uint64(l.endingHeight),l.pagination!==void 0&&n.PageRequest.encode(l.pagination,M.uint32(34).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=R();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.validatorAddress=m.string();break;case 2:T.startingHeight=m.uint64();break;case 3:T.endingHeight=m.uint64();break;case 4:T.pagination=n.PageRequest.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=R();return(0,g.isSet)(l.validatorAddress)&&(M.validatorAddress=String(l.validatorAddress)),(0,g.isSet)(l.startingHeight)&&(M.startingHeight=BigInt(l.startingHeight.toString())),(0,g.isSet)(l.endingHeight)&&(M.endingHeight=BigInt(l.endingHeight.toString())),(0,g.isSet)(l.pagination)&&(M.pagination=n.PageRequest.fromJSON(l.pagination)),M},toJSON(l){const M={};return l.validatorAddress!==void 0&&(M.validatorAddress=l.validatorAddress),l.startingHeight!==void 0&&(M.startingHeight=(l.startingHeight||BigInt(0)).toString()),l.endingHeight!==void 0&&(M.endingHeight=(l.endingHeight||BigInt(0)).toString()),l.pagination!==void 0&&(M.pagination=l.pagination?n.PageRequest.toJSON(l.pagination):void 0),M},fromPartial(l){const M=R();return M.validatorAddress=l.validatorAddress??"",l.startingHeight!==void 0&&l.startingHeight!==null&&(M.startingHeight=BigInt(l.startingHeight.toString())),l.endingHeight!==void 0&&l.endingHeight!==null&&(M.endingHeight=BigInt(l.endingHeight.toString())),l.pagination!==void 0&&l.pagination!==null&&(M.pagination=n.PageRequest.fromPartial(l.pagination)),M}};function u(){return{slashes:[],pagination:void 0}}e.QueryValidatorSlashesResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorSlashesResponse",encode(l,M=o.BinaryWriter.create()){for(const m of l.slashes)t.ValidatorSlashEvent.encode(m,M.uint32(10).fork()).ldelim();return l.pagination!==void 0&&n.PageResponse.encode(l.pagination,M.uint32(18).fork()).ldelim(),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=u();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.slashes.push(t.ValidatorSlashEvent.decode(m,m.uint32()));break;case 2:T.pagination=n.PageResponse.decode(m,m.uint32());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=u();return Array.isArray(l==null?void 0:l.slashes)&&(M.slashes=l.slashes.map(m=>t.ValidatorSlashEvent.fromJSON(m))),(0,g.isSet)(l.pagination)&&(M.pagination=n.PageResponse.fromJSON(l.pagination)),M},toJSON(l){const M={};return l.slashes?M.slashes=l.slashes.map(m=>m?t.ValidatorSlashEvent.toJSON(m):void 0):M.slashes=[],l.pagination!==void 0&&(M.pagination=l.pagination?n.PageResponse.toJSON(l.pagination):void 0),M},fromPartial(l){var m;const M=u();return M.slashes=((m=l.slashes)==null?void 0:m.map(h=>t.ValidatorSlashEvent.fromPartial(h)))||[],l.pagination!==void 0&&l.pagination!==null&&(M.pagination=n.PageResponse.fromPartial(l.pagination)),M}};function c(){return{delegatorAddress:"",validatorAddress:""}}e.QueryDelegationRewardsRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegationRewardsRequest",encode(l,M=o.BinaryWriter.create()){return l.delegatorAddress!==""&&M.uint32(10).string(l.delegatorAddress),l.validatorAddress!==""&&M.uint32(18).string(l.validatorAddress),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=c();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.delegatorAddress=m.string();break;case 2:T.validatorAddress=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=c();return(0,g.isSet)(l.delegatorAddress)&&(M.delegatorAddress=String(l.delegatorAddress)),(0,g.isSet)(l.validatorAddress)&&(M.validatorAddress=String(l.validatorAddress)),M},toJSON(l){const M={};return l.delegatorAddress!==void 0&&(M.delegatorAddress=l.delegatorAddress),l.validatorAddress!==void 0&&(M.validatorAddress=l.validatorAddress),M},fromPartial(l){const M=c();return M.delegatorAddress=l.delegatorAddress??"",M.validatorAddress=l.validatorAddress??"",M}};function y(){return{rewards:[]}}e.QueryDelegationRewardsResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegationRewardsResponse",encode(l,M=o.BinaryWriter.create()){for(const m of l.rewards)i.DecCoin.encode(m,M.uint32(10).fork()).ldelim();return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=y();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.rewards.push(i.DecCoin.decode(m,m.uint32()));break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=y();return Array.isArray(l==null?void 0:l.rewards)&&(M.rewards=l.rewards.map(m=>i.DecCoin.fromJSON(m))),M},toJSON(l){const M={};return l.rewards?M.rewards=l.rewards.map(m=>m?i.DecCoin.toJSON(m):void 0):M.rewards=[],M},fromPartial(l){var m;const M=y();return M.rewards=((m=l.rewards)==null?void 0:m.map(h=>i.DecCoin.fromPartial(h)))||[],M}};function B(){return{delegatorAddress:""}}e.QueryDelegationTotalRewardsRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest",encode(l,M=o.BinaryWriter.create()){return l.delegatorAddress!==""&&M.uint32(10).string(l.delegatorAddress),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=B();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.delegatorAddress=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=B();return(0,g.isSet)(l.delegatorAddress)&&(M.delegatorAddress=String(l.delegatorAddress)),M},toJSON(l){const M={};return l.delegatorAddress!==void 0&&(M.delegatorAddress=l.delegatorAddress),M},fromPartial(l){const M=B();return M.delegatorAddress=l.delegatorAddress??"",M}};function N(){return{rewards:[],total:[]}}e.QueryDelegationTotalRewardsResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse",encode(l,M=o.BinaryWriter.create()){for(const m of l.rewards)t.DelegationDelegatorReward.encode(m,M.uint32(10).fork()).ldelim();for(const m of l.total)i.DecCoin.encode(m,M.uint32(18).fork()).ldelim();return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=N();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.rewards.push(t.DelegationDelegatorReward.decode(m,m.uint32()));break;case 2:T.total.push(i.DecCoin.decode(m,m.uint32()));break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=N();return Array.isArray(l==null?void 0:l.rewards)&&(M.rewards=l.rewards.map(m=>t.DelegationDelegatorReward.fromJSON(m))),Array.isArray(l==null?void 0:l.total)&&(M.total=l.total.map(m=>i.DecCoin.fromJSON(m))),M},toJSON(l){const M={};return l.rewards?M.rewards=l.rewards.map(m=>m?t.DelegationDelegatorReward.toJSON(m):void 0):M.rewards=[],l.total?M.total=l.total.map(m=>m?i.DecCoin.toJSON(m):void 0):M.total=[],M},fromPartial(l){var m,h;const M=N();return M.rewards=((m=l.rewards)==null?void 0:m.map(T=>t.DelegationDelegatorReward.fromPartial(T)))||[],M.total=((h=l.total)==null?void 0:h.map(T=>i.DecCoin.fromPartial(T)))||[],M}};function U(){return{delegatorAddress:""}}e.QueryDelegatorValidatorsRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest",encode(l,M=o.BinaryWriter.create()){return l.delegatorAddress!==""&&M.uint32(10).string(l.delegatorAddress),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=U();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.delegatorAddress=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=U();return(0,g.isSet)(l.delegatorAddress)&&(M.delegatorAddress=String(l.delegatorAddress)),M},toJSON(l){const M={};return l.delegatorAddress!==void 0&&(M.delegatorAddress=l.delegatorAddress),M},fromPartial(l){const M=U();return M.delegatorAddress=l.delegatorAddress??"",M}};function W(){return{validators:[]}}e.QueryDelegatorValidatorsResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse",encode(l,M=o.BinaryWriter.create()){for(const m of l.validators)M.uint32(10).string(m);return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=W();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.validators.push(m.string());break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=W();return Array.isArray(l==null?void 0:l.validators)&&(M.validators=l.validators.map(m=>String(m))),M},toJSON(l){const M={};return l.validators?M.validators=l.validators.map(m=>m):M.validators=[],M},fromPartial(l){var m;const M=W();return M.validators=((m=l.validators)==null?void 0:m.map(h=>h))||[],M}};function r(){return{delegatorAddress:""}}e.QueryDelegatorWithdrawAddressRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest",encode(l,M=o.BinaryWriter.create()){return l.delegatorAddress!==""&&M.uint32(10).string(l.delegatorAddress),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=r();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.delegatorAddress=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=r();return(0,g.isSet)(l.delegatorAddress)&&(M.delegatorAddress=String(l.delegatorAddress)),M},toJSON(l){const M={};return l.delegatorAddress!==void 0&&(M.delegatorAddress=l.delegatorAddress),M},fromPartial(l){const M=r();return M.delegatorAddress=l.delegatorAddress??"",M}};function s(){return{withdrawAddress:""}}e.QueryDelegatorWithdrawAddressResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse",encode(l,M=o.BinaryWriter.create()){return l.withdrawAddress!==""&&M.uint32(10).string(l.withdrawAddress),M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=s();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.withdrawAddress=m.string();break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=s();return(0,g.isSet)(l.withdrawAddress)&&(M.withdrawAddress=String(l.withdrawAddress)),M},toJSON(l){const M={};return l.withdrawAddress!==void 0&&(M.withdrawAddress=l.withdrawAddress),M},fromPartial(l){const M=s();return M.withdrawAddress=l.withdrawAddress??"",M}};function O(){return{}}e.QueryCommunityPoolRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryCommunityPoolRequest",encode(l,M=o.BinaryWriter.create()){return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=O();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){default:m.skipType(Q&7);break}}return T},fromJSON(l){return O()},toJSON(l){return{}},fromPartial(l){return O()}};function q(){return{pool:[]}}e.QueryCommunityPoolResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryCommunityPoolResponse",encode(l,M=o.BinaryWriter.create()){for(const m of l.pool)i.DecCoin.encode(m,M.uint32(10).fork()).ldelim();return M},decode(l,M){const m=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let h=M===void 0?m.len:m.pos+M;const T=q();for(;m.pos<h;){const Q=m.uint32();switch(Q>>>3){case 1:T.pool.push(i.DecCoin.decode(m,m.uint32()));break;default:m.skipType(Q&7);break}}return T},fromJSON(l){const M=q();return Array.isArray(l==null?void 0:l.pool)&&(M.pool=l.pool.map(m=>i.DecCoin.fromJSON(m))),M},toJSON(l){const M={};return l.pool?M.pool=l.pool.map(m=>m?i.DecCoin.toJSON(m):void 0):M.pool=[],M},fromPartial(l){var m;const M=q();return M.pool=((m=l.pool)==null?void 0:m.map(h=>i.DecCoin.fromPartial(h)))||[],M}};class d{constructor(M){this.rpc=M,this.Params=this.Params.bind(this),this.ValidatorDistributionInfo=this.ValidatorDistributionInfo.bind(this),this.ValidatorOutstandingRewards=this.ValidatorOutstandingRewards.bind(this),this.ValidatorCommission=this.ValidatorCommission.bind(this),this.ValidatorSlashes=this.ValidatorSlashes.bind(this),this.DelegationRewards=this.DelegationRewards.bind(this),this.DelegationTotalRewards=this.DelegationTotalRewards.bind(this),this.DelegatorValidators=this.DelegatorValidators.bind(this),this.DelegatorWithdrawAddress=this.DelegatorWithdrawAddress.bind(this),this.CommunityPool=this.CommunityPool.bind(this)}Params(M={}){const m=e.QueryParamsRequest.encode(M).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","Params",m).then(T=>e.QueryParamsResponse.decode(new o.BinaryReader(T)))}ValidatorDistributionInfo(M){const m=e.QueryValidatorDistributionInfoRequest.encode(M).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","ValidatorDistributionInfo",m).then(T=>e.QueryValidatorDistributionInfoResponse.decode(new o.BinaryReader(T)))}ValidatorOutstandingRewards(M){const m=e.QueryValidatorOutstandingRewardsRequest.encode(M).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","ValidatorOutstandingRewards",m).then(T=>e.QueryValidatorOutstandingRewardsResponse.decode(new o.BinaryReader(T)))}ValidatorCommission(M){const m=e.QueryValidatorCommissionRequest.encode(M).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","ValidatorCommission",m).then(T=>e.QueryValidatorCommissionResponse.decode(new o.BinaryReader(T)))}ValidatorSlashes(M){const m=e.QueryValidatorSlashesRequest.encode(M).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","ValidatorSlashes",m).then(T=>e.QueryValidatorSlashesResponse.decode(new o.BinaryReader(T)))}DelegationRewards(M){const m=e.QueryDelegationRewardsRequest.encode(M).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","DelegationRewards",m).then(T=>e.QueryDelegationRewardsResponse.decode(new o.BinaryReader(T)))}DelegationTotalRewards(M){const m=e.QueryDelegationTotalRewardsRequest.encode(M).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","DelegationTotalRewards",m).then(T=>e.QueryDelegationTotalRewardsResponse.decode(new o.BinaryReader(T)))}DelegatorValidators(M){const m=e.QueryDelegatorValidatorsRequest.encode(M).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","DelegatorValidators",m).then(T=>e.QueryDelegatorValidatorsResponse.decode(new o.BinaryReader(T)))}DelegatorWithdrawAddress(M){const m=e.QueryDelegatorWithdrawAddressRequest.encode(M).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","DelegatorWithdrawAddress",m).then(T=>e.QueryDelegatorWithdrawAddressResponse.decode(new o.BinaryReader(T)))}CommunityPool(M={}){const m=e.QueryCommunityPoolRequest.encode(M).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","CommunityPool",m).then(T=>e.QueryCommunityPoolResponse.decode(new o.BinaryReader(T)))}}e.QueryClientImpl=d})(hc);Object.defineProperty(ds,"__esModule",{value:!0});ds.setupDistributionExtension=void 0;const Ak=hc,ql=ze;function Tk(e){const n=(0,ql.createProtobufRpcClient)(e),t=new Ak.QueryClientImpl(n);return{distribution:{communityPool:async()=>await t.CommunityPool({}),delegationRewards:async(i,o)=>await t.DelegationRewards({delegatorAddress:i,validatorAddress:o}),delegationTotalRewards:async i=>await t.DelegationTotalRewards({delegatorAddress:i}),delegatorValidators:async i=>await t.DelegatorValidators({delegatorAddress:i}),delegatorWithdrawAddress:async i=>await t.DelegatorWithdrawAddress({delegatorAddress:i}),params:async()=>await t.Params({}),validatorCommission:async i=>await t.ValidatorCommission({validatorAddress:i}),validatorOutstandingRewards:async i=>await t.ValidatorOutstandingRewards({validatorAddress:i}),validatorSlashes:async(i,o,g,C)=>await t.ValidatorSlashes({validatorAddress:i,startingHeight:BigInt(o),endingHeight:BigInt(g),pagination:(0,ql.createPagination)(C)})}}}ds.setupDistributionExtension=Tk;var mi={};Object.defineProperty(mi,"__esModule",{value:!0});mi.createEvidenceAminoConverters=mi.isAminoMsgSubmitEvidence=void 0;function Nk(e){return e.type==="cosmos-sdk/MsgSubmitEvidence"}mi.isAminoMsgSubmitEvidence=Nk;function wk(){throw new Error("Not implemented")}mi.createEvidenceAminoConverters=wk;var us={};Object.defineProperty(us,"__esModule",{value:!0});us.createFeegrantAminoConverters=void 0;function _k(){return{}}us.createFeegrantAminoConverters=_k;var cs={},gc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgRevokeAllowanceResponse=e.MsgRevokeAllowance=e.MsgGrantAllowanceResponse=e.MsgGrantAllowance=e.protobufPackage=void 0;const n=_.any,t=_.binary,i=_.helpers;e.protobufPackage="cosmos.feegrant.v1beta1";function o(){return{granter:"",grantee:"",allowance:void 0}}e.MsgGrantAllowance={typeUrl:"/cosmos.feegrant.v1beta1.MsgGrantAllowance",encode(D,J=t.BinaryWriter.create()){return D.granter!==""&&J.uint32(10).string(D.granter),D.grantee!==""&&J.uint32(18).string(D.grantee),D.allowance!==void 0&&n.Any.encode(D.allowance,J.uint32(26).fork()).ldelim(),J},decode(D,J){const b=D instanceof t.BinaryReader?D:new t.BinaryReader(D);let p=J===void 0?b.len:b.pos+J;const S=o();for(;b.pos<p;){const R=b.uint32();switch(R>>>3){case 1:S.granter=b.string();break;case 2:S.grantee=b.string();break;case 3:S.allowance=n.Any.decode(b,b.uint32());break;default:b.skipType(R&7);break}}return S},fromJSON(D){const J=o();return(0,i.isSet)(D.granter)&&(J.granter=String(D.granter)),(0,i.isSet)(D.grantee)&&(J.grantee=String(D.grantee)),(0,i.isSet)(D.allowance)&&(J.allowance=n.Any.fromJSON(D.allowance)),J},toJSON(D){const J={};return D.granter!==void 0&&(J.granter=D.granter),D.grantee!==void 0&&(J.grantee=D.grantee),D.allowance!==void 0&&(J.allowance=D.allowance?n.Any.toJSON(D.allowance):void 0),J},fromPartial(D){const J=o();return J.granter=D.granter??"",J.grantee=D.grantee??"",D.allowance!==void 0&&D.allowance!==null&&(J.allowance=n.Any.fromPartial(D.allowance)),J}};function g(){return{}}e.MsgGrantAllowanceResponse={typeUrl:"/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse",encode(D,J=t.BinaryWriter.create()){return J},decode(D,J){const b=D instanceof t.BinaryReader?D:new t.BinaryReader(D);let p=J===void 0?b.len:b.pos+J;const S=g();for(;b.pos<p;){const R=b.uint32();switch(R>>>3){default:b.skipType(R&7);break}}return S},fromJSON(D){return g()},toJSON(D){return{}},fromPartial(D){return g()}};function C(){return{granter:"",grantee:""}}e.MsgRevokeAllowance={typeUrl:"/cosmos.feegrant.v1beta1.MsgRevokeAllowance",encode(D,J=t.BinaryWriter.create()){return D.granter!==""&&J.uint32(10).string(D.granter),D.grantee!==""&&J.uint32(18).string(D.grantee),J},decode(D,J){const b=D instanceof t.BinaryReader?D:new t.BinaryReader(D);let p=J===void 0?b.len:b.pos+J;const S=C();for(;b.pos<p;){const R=b.uint32();switch(R>>>3){case 1:S.granter=b.string();break;case 2:S.grantee=b.string();break;default:b.skipType(R&7);break}}return S},fromJSON(D){const J=C();return(0,i.isSet)(D.granter)&&(J.granter=String(D.granter)),(0,i.isSet)(D.grantee)&&(J.grantee=String(D.grantee)),J},toJSON(D){const J={};return D.granter!==void 0&&(J.granter=D.granter),D.grantee!==void 0&&(J.grantee=D.grantee),J},fromPartial(D){const J=C();return J.granter=D.granter??"",J.grantee=D.grantee??"",J}};function w(){return{}}e.MsgRevokeAllowanceResponse={typeUrl:"/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse",encode(D,J=t.BinaryWriter.create()){return J},decode(D,J){const b=D instanceof t.BinaryReader?D:new t.BinaryReader(D);let p=J===void 0?b.len:b.pos+J;const S=w();for(;b.pos<p;){const R=b.uint32();switch(R>>>3){default:b.skipType(R&7);break}}return S},fromJSON(D){return w()},toJSON(D){return{}},fromPartial(D){return w()}};class E{constructor(J){this.rpc=J,this.GrantAllowance=this.GrantAllowance.bind(this),this.RevokeAllowance=this.RevokeAllowance.bind(this)}GrantAllowance(J){const b=e.MsgGrantAllowance.encode(J).finish();return this.rpc.request("cosmos.feegrant.v1beta1.Msg","GrantAllowance",b).then(S=>e.MsgGrantAllowanceResponse.decode(new t.BinaryReader(S)))}RevokeAllowance(J){const b=e.MsgRevokeAllowance.encode(J).finish();return this.rpc.request("cosmos.feegrant.v1beta1.Msg","RevokeAllowance",b).then(S=>e.MsgRevokeAllowanceResponse.decode(new t.BinaryReader(S)))}}e.MsgClientImpl=E})(gc);Object.defineProperty(cs,"__esModule",{value:!0});cs.feegrantTypes=void 0;const Vl=gc;cs.feegrantTypes=[["/cosmos.feegrant.v1beta1.MsgGrantAllowance",Vl.MsgGrantAllowance],["/cosmos.feegrant.v1beta1.MsgRevokeAllowance",Vl.MsgRevokeAllowance]];var ls={},yc={},hm={},yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.Duration=yn.protobufPackage=void 0;const Gd=_.binary,Wl=_.helpers;yn.protobufPackage="google.protobuf";function Ld(){return{seconds:BigInt(0),nanos:0}}yn.Duration={typeUrl:"/google.protobuf.Duration",encode(e,n=Gd.BinaryWriter.create()){return e.seconds!==BigInt(0)&&n.uint32(8).int64(e.seconds),e.nanos!==0&&n.uint32(16).int32(e.nanos),n},decode(e,n){const t=e instanceof Gd.BinaryReader?e:new Gd.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Ld();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.seconds=t.int64();break;case 2:o.nanos=t.int32();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Ld();return(0,Wl.isSet)(e.seconds)&&(n.seconds=BigInt(e.seconds.toString())),(0,Wl.isSet)(e.nanos)&&(n.nanos=Number(e.nanos)),n},toJSON(e){const n={};return e.seconds!==void 0&&(n.seconds=(e.seconds||BigInt(0)).toString()),e.nanos!==void 0&&(n.nanos=Math.round(e.nanos)),n},fromPartial(e){const n=Ld();return e.seconds!==void 0&&e.seconds!==null&&(n.seconds=BigInt(e.seconds.toString())),n.nanos=e.nanos??0,n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Grant=e.AllowedMsgAllowance=e.PeriodicAllowance=e.BasicAllowance=e.protobufPackage=void 0;const n=_.coin,t=Je,i=yn,o=_.any,g=_.binary,C=_.helpers;e.protobufPackage="cosmos.feegrant.v1beta1";function w(){return{spendLimit:[],expiration:void 0}}e.BasicAllowance={typeUrl:"/cosmos.feegrant.v1beta1.BasicAllowance",encode(b,p=g.BinaryWriter.create()){for(const S of b.spendLimit)n.Coin.encode(S,p.uint32(10).fork()).ldelim();return b.expiration!==void 0&&t.Timestamp.encode(b.expiration,p.uint32(18).fork()).ldelim(),p},decode(b,p){const S=b instanceof g.BinaryReader?b:new g.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=w();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.spendLimit.push(n.Coin.decode(S,S.uint32()));break;case 2:u.expiration=t.Timestamp.decode(S,S.uint32());break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=w();return Array.isArray(b==null?void 0:b.spendLimit)&&(p.spendLimit=b.spendLimit.map(S=>n.Coin.fromJSON(S))),(0,C.isSet)(b.expiration)&&(p.expiration=(0,C.fromJsonTimestamp)(b.expiration)),p},toJSON(b){const p={};return b.spendLimit?p.spendLimit=b.spendLimit.map(S=>S?n.Coin.toJSON(S):void 0):p.spendLimit=[],b.expiration!==void 0&&(p.expiration=(0,C.fromTimestamp)(b.expiration).toISOString()),p},fromPartial(b){var S;const p=w();return p.spendLimit=((S=b.spendLimit)==null?void 0:S.map(R=>n.Coin.fromPartial(R)))||[],b.expiration!==void 0&&b.expiration!==null&&(p.expiration=t.Timestamp.fromPartial(b.expiration)),p}};function E(){return{basic:e.BasicAllowance.fromPartial({}),period:i.Duration.fromPartial({}),periodSpendLimit:[],periodCanSpend:[],periodReset:t.Timestamp.fromPartial({})}}e.PeriodicAllowance={typeUrl:"/cosmos.feegrant.v1beta1.PeriodicAllowance",encode(b,p=g.BinaryWriter.create()){b.basic!==void 0&&e.BasicAllowance.encode(b.basic,p.uint32(10).fork()).ldelim(),b.period!==void 0&&i.Duration.encode(b.period,p.uint32(18).fork()).ldelim();for(const S of b.periodSpendLimit)n.Coin.encode(S,p.uint32(26).fork()).ldelim();for(const S of b.periodCanSpend)n.Coin.encode(S,p.uint32(34).fork()).ldelim();return b.periodReset!==void 0&&t.Timestamp.encode(b.periodReset,p.uint32(42).fork()).ldelim(),p},decode(b,p){const S=b instanceof g.BinaryReader?b:new g.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=E();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.basic=e.BasicAllowance.decode(S,S.uint32());break;case 2:u.period=i.Duration.decode(S,S.uint32());break;case 3:u.periodSpendLimit.push(n.Coin.decode(S,S.uint32()));break;case 4:u.periodCanSpend.push(n.Coin.decode(S,S.uint32()));break;case 5:u.periodReset=t.Timestamp.decode(S,S.uint32());break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=E();return(0,C.isSet)(b.basic)&&(p.basic=e.BasicAllowance.fromJSON(b.basic)),(0,C.isSet)(b.period)&&(p.period=i.Duration.fromJSON(b.period)),Array.isArray(b==null?void 0:b.periodSpendLimit)&&(p.periodSpendLimit=b.periodSpendLimit.map(S=>n.Coin.fromJSON(S))),Array.isArray(b==null?void 0:b.periodCanSpend)&&(p.periodCanSpend=b.periodCanSpend.map(S=>n.Coin.fromJSON(S))),(0,C.isSet)(b.periodReset)&&(p.periodReset=(0,C.fromJsonTimestamp)(b.periodReset)),p},toJSON(b){const p={};return b.basic!==void 0&&(p.basic=b.basic?e.BasicAllowance.toJSON(b.basic):void 0),b.period!==void 0&&(p.period=b.period?i.Duration.toJSON(b.period):void 0),b.periodSpendLimit?p.periodSpendLimit=b.periodSpendLimit.map(S=>S?n.Coin.toJSON(S):void 0):p.periodSpendLimit=[],b.periodCanSpend?p.periodCanSpend=b.periodCanSpend.map(S=>S?n.Coin.toJSON(S):void 0):p.periodCanSpend=[],b.periodReset!==void 0&&(p.periodReset=(0,C.fromTimestamp)(b.periodReset).toISOString()),p},fromPartial(b){var S,R;const p=E();return b.basic!==void 0&&b.basic!==null&&(p.basic=e.BasicAllowance.fromPartial(b.basic)),b.period!==void 0&&b.period!==null&&(p.period=i.Duration.fromPartial(b.period)),p.periodSpendLimit=((S=b.periodSpendLimit)==null?void 0:S.map(u=>n.Coin.fromPartial(u)))||[],p.periodCanSpend=((R=b.periodCanSpend)==null?void 0:R.map(u=>n.Coin.fromPartial(u)))||[],b.periodReset!==void 0&&b.periodReset!==null&&(p.periodReset=t.Timestamp.fromPartial(b.periodReset)),p}};function D(){return{allowance:void 0,allowedMessages:[]}}e.AllowedMsgAllowance={typeUrl:"/cosmos.feegrant.v1beta1.AllowedMsgAllowance",encode(b,p=g.BinaryWriter.create()){b.allowance!==void 0&&o.Any.encode(b.allowance,p.uint32(10).fork()).ldelim();for(const S of b.allowedMessages)p.uint32(18).string(S);return p},decode(b,p){const S=b instanceof g.BinaryReader?b:new g.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=D();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.allowance=o.Any.decode(S,S.uint32());break;case 2:u.allowedMessages.push(S.string());break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=D();return(0,C.isSet)(b.allowance)&&(p.allowance=o.Any.fromJSON(b.allowance)),Array.isArray(b==null?void 0:b.allowedMessages)&&(p.allowedMessages=b.allowedMessages.map(S=>String(S))),p},toJSON(b){const p={};return b.allowance!==void 0&&(p.allowance=b.allowance?o.Any.toJSON(b.allowance):void 0),b.allowedMessages?p.allowedMessages=b.allowedMessages.map(S=>S):p.allowedMessages=[],p},fromPartial(b){var S;const p=D();return b.allowance!==void 0&&b.allowance!==null&&(p.allowance=o.Any.fromPartial(b.allowance)),p.allowedMessages=((S=b.allowedMessages)==null?void 0:S.map(R=>R))||[],p}};function J(){return{granter:"",grantee:"",allowance:void 0}}e.Grant={typeUrl:"/cosmos.feegrant.v1beta1.Grant",encode(b,p=g.BinaryWriter.create()){return b.granter!==""&&p.uint32(10).string(b.granter),b.grantee!==""&&p.uint32(18).string(b.grantee),b.allowance!==void 0&&o.Any.encode(b.allowance,p.uint32(26).fork()).ldelim(),p},decode(b,p){const S=b instanceof g.BinaryReader?b:new g.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=J();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.granter=S.string();break;case 2:u.grantee=S.string();break;case 3:u.allowance=o.Any.decode(S,S.uint32());break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=J();return(0,C.isSet)(b.granter)&&(p.granter=String(b.granter)),(0,C.isSet)(b.grantee)&&(p.grantee=String(b.grantee)),(0,C.isSet)(b.allowance)&&(p.allowance=o.Any.fromJSON(b.allowance)),p},toJSON(b){const p={};return b.granter!==void 0&&(p.granter=b.granter),b.grantee!==void 0&&(p.grantee=b.grantee),b.allowance!==void 0&&(p.allowance=b.allowance?o.Any.toJSON(b.allowance):void 0),p},fromPartial(b){const p=J();return p.granter=b.granter??"",p.grantee=b.grantee??"",b.allowance!==void 0&&b.allowance!==null&&(p.allowance=o.Any.fromPartial(b.allowance)),p}}})(hm);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryAllowancesByGranterResponse=e.QueryAllowancesByGranterRequest=e.QueryAllowancesResponse=e.QueryAllowancesRequest=e.QueryAllowanceResponse=e.QueryAllowanceRequest=e.protobufPackage=void 0;const n=Be,t=hm,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.feegrant.v1beta1";function g(){return{granter:"",grantee:""}}e.QueryAllowanceRequest={typeUrl:"/cosmos.feegrant.v1beta1.QueryAllowanceRequest",encode(p,S=i.BinaryWriter.create()){return p.granter!==""&&S.uint32(10).string(p.granter),p.grantee!==""&&S.uint32(18).string(p.grantee),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=g();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.granter=R.string();break;case 2:c.grantee=R.string();break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=g();return(0,o.isSet)(p.granter)&&(S.granter=String(p.granter)),(0,o.isSet)(p.grantee)&&(S.grantee=String(p.grantee)),S},toJSON(p){const S={};return p.granter!==void 0&&(S.granter=p.granter),p.grantee!==void 0&&(S.grantee=p.grantee),S},fromPartial(p){const S=g();return S.granter=p.granter??"",S.grantee=p.grantee??"",S}};function C(){return{allowance:void 0}}e.QueryAllowanceResponse={typeUrl:"/cosmos.feegrant.v1beta1.QueryAllowanceResponse",encode(p,S=i.BinaryWriter.create()){return p.allowance!==void 0&&t.Grant.encode(p.allowance,S.uint32(10).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=C();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.allowance=t.Grant.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=C();return(0,o.isSet)(p.allowance)&&(S.allowance=t.Grant.fromJSON(p.allowance)),S},toJSON(p){const S={};return p.allowance!==void 0&&(S.allowance=p.allowance?t.Grant.toJSON(p.allowance):void 0),S},fromPartial(p){const S=C();return p.allowance!==void 0&&p.allowance!==null&&(S.allowance=t.Grant.fromPartial(p.allowance)),S}};function w(){return{grantee:"",pagination:void 0}}e.QueryAllowancesRequest={typeUrl:"/cosmos.feegrant.v1beta1.QueryAllowancesRequest",encode(p,S=i.BinaryWriter.create()){return p.grantee!==""&&S.uint32(10).string(p.grantee),p.pagination!==void 0&&n.PageRequest.encode(p.pagination,S.uint32(18).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=w();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.grantee=R.string();break;case 2:c.pagination=n.PageRequest.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=w();return(0,o.isSet)(p.grantee)&&(S.grantee=String(p.grantee)),(0,o.isSet)(p.pagination)&&(S.pagination=n.PageRequest.fromJSON(p.pagination)),S},toJSON(p){const S={};return p.grantee!==void 0&&(S.grantee=p.grantee),p.pagination!==void 0&&(S.pagination=p.pagination?n.PageRequest.toJSON(p.pagination):void 0),S},fromPartial(p){const S=w();return S.grantee=p.grantee??"",p.pagination!==void 0&&p.pagination!==null&&(S.pagination=n.PageRequest.fromPartial(p.pagination)),S}};function E(){return{allowances:[],pagination:void 0}}e.QueryAllowancesResponse={typeUrl:"/cosmos.feegrant.v1beta1.QueryAllowancesResponse",encode(p,S=i.BinaryWriter.create()){for(const R of p.allowances)t.Grant.encode(R,S.uint32(10).fork()).ldelim();return p.pagination!==void 0&&n.PageResponse.encode(p.pagination,S.uint32(18).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=E();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.allowances.push(t.Grant.decode(R,R.uint32()));break;case 2:c.pagination=n.PageResponse.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=E();return Array.isArray(p==null?void 0:p.allowances)&&(S.allowances=p.allowances.map(R=>t.Grant.fromJSON(R))),(0,o.isSet)(p.pagination)&&(S.pagination=n.PageResponse.fromJSON(p.pagination)),S},toJSON(p){const S={};return p.allowances?S.allowances=p.allowances.map(R=>R?t.Grant.toJSON(R):void 0):S.allowances=[],p.pagination!==void 0&&(S.pagination=p.pagination?n.PageResponse.toJSON(p.pagination):void 0),S},fromPartial(p){var R;const S=E();return S.allowances=((R=p.allowances)==null?void 0:R.map(u=>t.Grant.fromPartial(u)))||[],p.pagination!==void 0&&p.pagination!==null&&(S.pagination=n.PageResponse.fromPartial(p.pagination)),S}};function D(){return{granter:"",pagination:void 0}}e.QueryAllowancesByGranterRequest={typeUrl:"/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest",encode(p,S=i.BinaryWriter.create()){return p.granter!==""&&S.uint32(10).string(p.granter),p.pagination!==void 0&&n.PageRequest.encode(p.pagination,S.uint32(18).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=D();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.granter=R.string();break;case 2:c.pagination=n.PageRequest.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=D();return(0,o.isSet)(p.granter)&&(S.granter=String(p.granter)),(0,o.isSet)(p.pagination)&&(S.pagination=n.PageRequest.fromJSON(p.pagination)),S},toJSON(p){const S={};return p.granter!==void 0&&(S.granter=p.granter),p.pagination!==void 0&&(S.pagination=p.pagination?n.PageRequest.toJSON(p.pagination):void 0),S},fromPartial(p){const S=D();return S.granter=p.granter??"",p.pagination!==void 0&&p.pagination!==null&&(S.pagination=n.PageRequest.fromPartial(p.pagination)),S}};function J(){return{allowances:[],pagination:void 0}}e.QueryAllowancesByGranterResponse={typeUrl:"/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse",encode(p,S=i.BinaryWriter.create()){for(const R of p.allowances)t.Grant.encode(R,S.uint32(10).fork()).ldelim();return p.pagination!==void 0&&n.PageResponse.encode(p.pagination,S.uint32(18).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=J();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.allowances.push(t.Grant.decode(R,R.uint32()));break;case 2:c.pagination=n.PageResponse.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=J();return Array.isArray(p==null?void 0:p.allowances)&&(S.allowances=p.allowances.map(R=>t.Grant.fromJSON(R))),(0,o.isSet)(p.pagination)&&(S.pagination=n.PageResponse.fromJSON(p.pagination)),S},toJSON(p){const S={};return p.allowances?S.allowances=p.allowances.map(R=>R?t.Grant.toJSON(R):void 0):S.allowances=[],p.pagination!==void 0&&(S.pagination=p.pagination?n.PageResponse.toJSON(p.pagination):void 0),S},fromPartial(p){var R;const S=J();return S.allowances=((R=p.allowances)==null?void 0:R.map(u=>t.Grant.fromPartial(u)))||[],p.pagination!==void 0&&p.pagination!==null&&(S.pagination=n.PageResponse.fromPartial(p.pagination)),S}};class b{constructor(S){this.rpc=S,this.Allowance=this.Allowance.bind(this),this.Allowances=this.Allowances.bind(this),this.AllowancesByGranter=this.AllowancesByGranter.bind(this)}Allowance(S){const R=e.QueryAllowanceRequest.encode(S).finish();return this.rpc.request("cosmos.feegrant.v1beta1.Query","Allowance",R).then(c=>e.QueryAllowanceResponse.decode(new i.BinaryReader(c)))}Allowances(S){const R=e.QueryAllowancesRequest.encode(S).finish();return this.rpc.request("cosmos.feegrant.v1beta1.Query","Allowances",R).then(c=>e.QueryAllowancesResponse.decode(new i.BinaryReader(c)))}AllowancesByGranter(S){const R=e.QueryAllowancesByGranterRequest.encode(S).finish();return this.rpc.request("cosmos.feegrant.v1beta1.Query","AllowancesByGranter",R).then(c=>e.QueryAllowancesByGranterResponse.decode(new i.BinaryReader(c)))}}e.QueryClientImpl=b})(yc);Object.defineProperty(ls,"__esModule",{value:!0});ls.setupFeegrantExtension=void 0;const Mk=yc,Ql=ze;function Uk(e){const n=(0,Ql.createProtobufRpcClient)(e),t=new Mk.QueryClientImpl(n);return{feegrant:{allowance:async(i,o)=>await t.Allowance({granter:i,grantee:o}),allowances:async(i,o)=>await t.Allowances({grantee:i,pagination:(0,Ql.createPagination)(o)})}}}ls.setupFeegrantExtension=Uk;var bn={},Eo={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TallyParams=e.VotingParams=e.DepositParams=e.Vote=e.TallyResult=e.Proposal=e.Deposit=e.TextProposal=e.WeightedVoteOption=e.proposalStatusToJSON=e.proposalStatusFromJSON=e.ProposalStatus=e.voteOptionToJSON=e.voteOptionFromJSON=e.VoteOption=e.protobufPackage=void 0;const n=_.coin,t=_.any,i=Je,o=yn,g=_.binary,C=_.helpers;e.protobufPackage="cosmos.gov.v1beta1";var w;(function(r){r[r.VOTE_OPTION_UNSPECIFIED=0]="VOTE_OPTION_UNSPECIFIED",r[r.VOTE_OPTION_YES=1]="VOTE_OPTION_YES",r[r.VOTE_OPTION_ABSTAIN=2]="VOTE_OPTION_ABSTAIN",r[r.VOTE_OPTION_NO=3]="VOTE_OPTION_NO",r[r.VOTE_OPTION_NO_WITH_VETO=4]="VOTE_OPTION_NO_WITH_VETO",r[r.UNRECOGNIZED=-1]="UNRECOGNIZED"})(w||(e.VoteOption=w={}));function E(r){switch(r){case 0:case"VOTE_OPTION_UNSPECIFIED":return w.VOTE_OPTION_UNSPECIFIED;case 1:case"VOTE_OPTION_YES":return w.VOTE_OPTION_YES;case 2:case"VOTE_OPTION_ABSTAIN":return w.VOTE_OPTION_ABSTAIN;case 3:case"VOTE_OPTION_NO":return w.VOTE_OPTION_NO;case 4:case"VOTE_OPTION_NO_WITH_VETO":return w.VOTE_OPTION_NO_WITH_VETO;case-1:case"UNRECOGNIZED":default:return w.UNRECOGNIZED}}e.voteOptionFromJSON=E;function D(r){switch(r){case w.VOTE_OPTION_UNSPECIFIED:return"VOTE_OPTION_UNSPECIFIED";case w.VOTE_OPTION_YES:return"VOTE_OPTION_YES";case w.VOTE_OPTION_ABSTAIN:return"VOTE_OPTION_ABSTAIN";case w.VOTE_OPTION_NO:return"VOTE_OPTION_NO";case w.VOTE_OPTION_NO_WITH_VETO:return"VOTE_OPTION_NO_WITH_VETO";case w.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.voteOptionToJSON=D;var J;(function(r){r[r.PROPOSAL_STATUS_UNSPECIFIED=0]="PROPOSAL_STATUS_UNSPECIFIED",r[r.PROPOSAL_STATUS_DEPOSIT_PERIOD=1]="PROPOSAL_STATUS_DEPOSIT_PERIOD",r[r.PROPOSAL_STATUS_VOTING_PERIOD=2]="PROPOSAL_STATUS_VOTING_PERIOD",r[r.PROPOSAL_STATUS_PASSED=3]="PROPOSAL_STATUS_PASSED",r[r.PROPOSAL_STATUS_REJECTED=4]="PROPOSAL_STATUS_REJECTED",r[r.PROPOSAL_STATUS_FAILED=5]="PROPOSAL_STATUS_FAILED",r[r.UNRECOGNIZED=-1]="UNRECOGNIZED"})(J||(e.ProposalStatus=J={}));function b(r){switch(r){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return J.PROPOSAL_STATUS_UNSPECIFIED;case 1:case"PROPOSAL_STATUS_DEPOSIT_PERIOD":return J.PROPOSAL_STATUS_DEPOSIT_PERIOD;case 2:case"PROPOSAL_STATUS_VOTING_PERIOD":return J.PROPOSAL_STATUS_VOTING_PERIOD;case 3:case"PROPOSAL_STATUS_PASSED":return J.PROPOSAL_STATUS_PASSED;case 4:case"PROPOSAL_STATUS_REJECTED":return J.PROPOSAL_STATUS_REJECTED;case 5:case"PROPOSAL_STATUS_FAILED":return J.PROPOSAL_STATUS_FAILED;case-1:case"UNRECOGNIZED":default:return J.UNRECOGNIZED}}e.proposalStatusFromJSON=b;function p(r){switch(r){case J.PROPOSAL_STATUS_UNSPECIFIED:return"PROPOSAL_STATUS_UNSPECIFIED";case J.PROPOSAL_STATUS_DEPOSIT_PERIOD:return"PROPOSAL_STATUS_DEPOSIT_PERIOD";case J.PROPOSAL_STATUS_VOTING_PERIOD:return"PROPOSAL_STATUS_VOTING_PERIOD";case J.PROPOSAL_STATUS_PASSED:return"PROPOSAL_STATUS_PASSED";case J.PROPOSAL_STATUS_REJECTED:return"PROPOSAL_STATUS_REJECTED";case J.PROPOSAL_STATUS_FAILED:return"PROPOSAL_STATUS_FAILED";case J.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.proposalStatusToJSON=p;function S(){return{option:0,weight:""}}e.WeightedVoteOption={typeUrl:"/cosmos.gov.v1beta1.WeightedVoteOption",encode(r,s=g.BinaryWriter.create()){return r.option!==0&&s.uint32(8).int32(r.option),r.weight!==""&&s.uint32(18).string(r.weight),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=S();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.option=O.int32();break;case 2:d.weight=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=S();return(0,C.isSet)(r.option)&&(s.option=E(r.option)),(0,C.isSet)(r.weight)&&(s.weight=String(r.weight)),s},toJSON(r){const s={};return r.option!==void 0&&(s.option=D(r.option)),r.weight!==void 0&&(s.weight=r.weight),s},fromPartial(r){const s=S();return s.option=r.option??0,s.weight=r.weight??"",s}};function R(){return{title:"",description:""}}e.TextProposal={typeUrl:"/cosmos.gov.v1beta1.TextProposal",encode(r,s=g.BinaryWriter.create()){return r.title!==""&&s.uint32(10).string(r.title),r.description!==""&&s.uint32(18).string(r.description),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=R();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.title=O.string();break;case 2:d.description=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=R();return(0,C.isSet)(r.title)&&(s.title=String(r.title)),(0,C.isSet)(r.description)&&(s.description=String(r.description)),s},toJSON(r){const s={};return r.title!==void 0&&(s.title=r.title),r.description!==void 0&&(s.description=r.description),s},fromPartial(r){const s=R();return s.title=r.title??"",s.description=r.description??"",s}};function u(){return{proposalId:BigInt(0),depositor:"",amount:[]}}e.Deposit={typeUrl:"/cosmos.gov.v1beta1.Deposit",encode(r,s=g.BinaryWriter.create()){r.proposalId!==BigInt(0)&&s.uint32(8).uint64(r.proposalId),r.depositor!==""&&s.uint32(18).string(r.depositor);for(const O of r.amount)n.Coin.encode(O,s.uint32(26).fork()).ldelim();return s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=u();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposalId=O.uint64();break;case 2:d.depositor=O.string();break;case 3:d.amount.push(n.Coin.decode(O,O.uint32()));break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=u();return(0,C.isSet)(r.proposalId)&&(s.proposalId=BigInt(r.proposalId.toString())),(0,C.isSet)(r.depositor)&&(s.depositor=String(r.depositor)),Array.isArray(r==null?void 0:r.amount)&&(s.amount=r.amount.map(O=>n.Coin.fromJSON(O))),s},toJSON(r){const s={};return r.proposalId!==void 0&&(s.proposalId=(r.proposalId||BigInt(0)).toString()),r.depositor!==void 0&&(s.depositor=r.depositor),r.amount?s.amount=r.amount.map(O=>O?n.Coin.toJSON(O):void 0):s.amount=[],s},fromPartial(r){var O;const s=u();return r.proposalId!==void 0&&r.proposalId!==null&&(s.proposalId=BigInt(r.proposalId.toString())),s.depositor=r.depositor??"",s.amount=((O=r.amount)==null?void 0:O.map(q=>n.Coin.fromPartial(q)))||[],s}};function c(){return{proposalId:BigInt(0),content:void 0,status:0,finalTallyResult:e.TallyResult.fromPartial({}),submitTime:i.Timestamp.fromPartial({}),depositEndTime:i.Timestamp.fromPartial({}),totalDeposit:[],votingStartTime:i.Timestamp.fromPartial({}),votingEndTime:i.Timestamp.fromPartial({})}}e.Proposal={typeUrl:"/cosmos.gov.v1beta1.Proposal",encode(r,s=g.BinaryWriter.create()){r.proposalId!==BigInt(0)&&s.uint32(8).uint64(r.proposalId),r.content!==void 0&&t.Any.encode(r.content,s.uint32(18).fork()).ldelim(),r.status!==0&&s.uint32(24).int32(r.status),r.finalTallyResult!==void 0&&e.TallyResult.encode(r.finalTallyResult,s.uint32(34).fork()).ldelim(),r.submitTime!==void 0&&i.Timestamp.encode(r.submitTime,s.uint32(42).fork()).ldelim(),r.depositEndTime!==void 0&&i.Timestamp.encode(r.depositEndTime,s.uint32(50).fork()).ldelim();for(const O of r.totalDeposit)n.Coin.encode(O,s.uint32(58).fork()).ldelim();return r.votingStartTime!==void 0&&i.Timestamp.encode(r.votingStartTime,s.uint32(66).fork()).ldelim(),r.votingEndTime!==void 0&&i.Timestamp.encode(r.votingEndTime,s.uint32(74).fork()).ldelim(),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=c();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposalId=O.uint64();break;case 2:d.content=t.Any.decode(O,O.uint32());break;case 3:d.status=O.int32();break;case 4:d.finalTallyResult=e.TallyResult.decode(O,O.uint32());break;case 5:d.submitTime=i.Timestamp.decode(O,O.uint32());break;case 6:d.depositEndTime=i.Timestamp.decode(O,O.uint32());break;case 7:d.totalDeposit.push(n.Coin.decode(O,O.uint32()));break;case 8:d.votingStartTime=i.Timestamp.decode(O,O.uint32());break;case 9:d.votingEndTime=i.Timestamp.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=c();return(0,C.isSet)(r.proposalId)&&(s.proposalId=BigInt(r.proposalId.toString())),(0,C.isSet)(r.content)&&(s.content=t.Any.fromJSON(r.content)),(0,C.isSet)(r.status)&&(s.status=b(r.status)),(0,C.isSet)(r.finalTallyResult)&&(s.finalTallyResult=e.TallyResult.fromJSON(r.finalTallyResult)),(0,C.isSet)(r.submitTime)&&(s.submitTime=(0,C.fromJsonTimestamp)(r.submitTime)),(0,C.isSet)(r.depositEndTime)&&(s.depositEndTime=(0,C.fromJsonTimestamp)(r.depositEndTime)),Array.isArray(r==null?void 0:r.totalDeposit)&&(s.totalDeposit=r.totalDeposit.map(O=>n.Coin.fromJSON(O))),(0,C.isSet)(r.votingStartTime)&&(s.votingStartTime=(0,C.fromJsonTimestamp)(r.votingStartTime)),(0,C.isSet)(r.votingEndTime)&&(s.votingEndTime=(0,C.fromJsonTimestamp)(r.votingEndTime)),s},toJSON(r){const s={};return r.proposalId!==void 0&&(s.proposalId=(r.proposalId||BigInt(0)).toString()),r.content!==void 0&&(s.content=r.content?t.Any.toJSON(r.content):void 0),r.status!==void 0&&(s.status=p(r.status)),r.finalTallyResult!==void 0&&(s.finalTallyResult=r.finalTallyResult?e.TallyResult.toJSON(r.finalTallyResult):void 0),r.submitTime!==void 0&&(s.submitTime=(0,C.fromTimestamp)(r.submitTime).toISOString()),r.depositEndTime!==void 0&&(s.depositEndTime=(0,C.fromTimestamp)(r.depositEndTime).toISOString()),r.totalDeposit?s.totalDeposit=r.totalDeposit.map(O=>O?n.Coin.toJSON(O):void 0):s.totalDeposit=[],r.votingStartTime!==void 0&&(s.votingStartTime=(0,C.fromTimestamp)(r.votingStartTime).toISOString()),r.votingEndTime!==void 0&&(s.votingEndTime=(0,C.fromTimestamp)(r.votingEndTime).toISOString()),s},fromPartial(r){var O;const s=c();return r.proposalId!==void 0&&r.proposalId!==null&&(s.proposalId=BigInt(r.proposalId.toString())),r.content!==void 0&&r.content!==null&&(s.content=t.Any.fromPartial(r.content)),s.status=r.status??0,r.finalTallyResult!==void 0&&r.finalTallyResult!==null&&(s.finalTallyResult=e.TallyResult.fromPartial(r.finalTallyResult)),r.submitTime!==void 0&&r.submitTime!==null&&(s.submitTime=i.Timestamp.fromPartial(r.submitTime)),r.depositEndTime!==void 0&&r.depositEndTime!==null&&(s.depositEndTime=i.Timestamp.fromPartial(r.depositEndTime)),s.totalDeposit=((O=r.totalDeposit)==null?void 0:O.map(q=>n.Coin.fromPartial(q)))||[],r.votingStartTime!==void 0&&r.votingStartTime!==null&&(s.votingStartTime=i.Timestamp.fromPartial(r.votingStartTime)),r.votingEndTime!==void 0&&r.votingEndTime!==null&&(s.votingEndTime=i.Timestamp.fromPartial(r.votingEndTime)),s}};function y(){return{yes:"",abstain:"",no:"",noWithVeto:""}}e.TallyResult={typeUrl:"/cosmos.gov.v1beta1.TallyResult",encode(r,s=g.BinaryWriter.create()){return r.yes!==""&&s.uint32(10).string(r.yes),r.abstain!==""&&s.uint32(18).string(r.abstain),r.no!==""&&s.uint32(26).string(r.no),r.noWithVeto!==""&&s.uint32(34).string(r.noWithVeto),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=y();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.yes=O.string();break;case 2:d.abstain=O.string();break;case 3:d.no=O.string();break;case 4:d.noWithVeto=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=y();return(0,C.isSet)(r.yes)&&(s.yes=String(r.yes)),(0,C.isSet)(r.abstain)&&(s.abstain=String(r.abstain)),(0,C.isSet)(r.no)&&(s.no=String(r.no)),(0,C.isSet)(r.noWithVeto)&&(s.noWithVeto=String(r.noWithVeto)),s},toJSON(r){const s={};return r.yes!==void 0&&(s.yes=r.yes),r.abstain!==void 0&&(s.abstain=r.abstain),r.no!==void 0&&(s.no=r.no),r.noWithVeto!==void 0&&(s.noWithVeto=r.noWithVeto),s},fromPartial(r){const s=y();return s.yes=r.yes??"",s.abstain=r.abstain??"",s.no=r.no??"",s.noWithVeto=r.noWithVeto??"",s}};function B(){return{proposalId:BigInt(0),voter:"",option:0,options:[]}}e.Vote={typeUrl:"/cosmos.gov.v1beta1.Vote",encode(r,s=g.BinaryWriter.create()){r.proposalId!==BigInt(0)&&s.uint32(8).uint64(r.proposalId),r.voter!==""&&s.uint32(18).string(r.voter),r.option!==0&&s.uint32(24).int32(r.option);for(const O of r.options)e.WeightedVoteOption.encode(O,s.uint32(34).fork()).ldelim();return s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=B();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposalId=O.uint64();break;case 2:d.voter=O.string();break;case 3:d.option=O.int32();break;case 4:d.options.push(e.WeightedVoteOption.decode(O,O.uint32()));break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=B();return(0,C.isSet)(r.proposalId)&&(s.proposalId=BigInt(r.proposalId.toString())),(0,C.isSet)(r.voter)&&(s.voter=String(r.voter)),(0,C.isSet)(r.option)&&(s.option=E(r.option)),Array.isArray(r==null?void 0:r.options)&&(s.options=r.options.map(O=>e.WeightedVoteOption.fromJSON(O))),s},toJSON(r){const s={};return r.proposalId!==void 0&&(s.proposalId=(r.proposalId||BigInt(0)).toString()),r.voter!==void 0&&(s.voter=r.voter),r.option!==void 0&&(s.option=D(r.option)),r.options?s.options=r.options.map(O=>O?e.WeightedVoteOption.toJSON(O):void 0):s.options=[],s},fromPartial(r){var O;const s=B();return r.proposalId!==void 0&&r.proposalId!==null&&(s.proposalId=BigInt(r.proposalId.toString())),s.voter=r.voter??"",s.option=r.option??0,s.options=((O=r.options)==null?void 0:O.map(q=>e.WeightedVoteOption.fromPartial(q)))||[],s}};function N(){return{minDeposit:[],maxDepositPeriod:o.Duration.fromPartial({})}}e.DepositParams={typeUrl:"/cosmos.gov.v1beta1.DepositParams",encode(r,s=g.BinaryWriter.create()){for(const O of r.minDeposit)n.Coin.encode(O,s.uint32(10).fork()).ldelim();return r.maxDepositPeriod!==void 0&&o.Duration.encode(r.maxDepositPeriod,s.uint32(18).fork()).ldelim(),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=N();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.minDeposit.push(n.Coin.decode(O,O.uint32()));break;case 2:d.maxDepositPeriod=o.Duration.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=N();return Array.isArray(r==null?void 0:r.minDeposit)&&(s.minDeposit=r.minDeposit.map(O=>n.Coin.fromJSON(O))),(0,C.isSet)(r.maxDepositPeriod)&&(s.maxDepositPeriod=o.Duration.fromJSON(r.maxDepositPeriod)),s},toJSON(r){const s={};return r.minDeposit?s.minDeposit=r.minDeposit.map(O=>O?n.Coin.toJSON(O):void 0):s.minDeposit=[],r.maxDepositPeriod!==void 0&&(s.maxDepositPeriod=r.maxDepositPeriod?o.Duration.toJSON(r.maxDepositPeriod):void 0),s},fromPartial(r){var O;const s=N();return s.minDeposit=((O=r.minDeposit)==null?void 0:O.map(q=>n.Coin.fromPartial(q)))||[],r.maxDepositPeriod!==void 0&&r.maxDepositPeriod!==null&&(s.maxDepositPeriod=o.Duration.fromPartial(r.maxDepositPeriod)),s}};function U(){return{votingPeriod:o.Duration.fromPartial({})}}e.VotingParams={typeUrl:"/cosmos.gov.v1beta1.VotingParams",encode(r,s=g.BinaryWriter.create()){return r.votingPeriod!==void 0&&o.Duration.encode(r.votingPeriod,s.uint32(10).fork()).ldelim(),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=U();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.votingPeriod=o.Duration.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=U();return(0,C.isSet)(r.votingPeriod)&&(s.votingPeriod=o.Duration.fromJSON(r.votingPeriod)),s},toJSON(r){const s={};return r.votingPeriod!==void 0&&(s.votingPeriod=r.votingPeriod?o.Duration.toJSON(r.votingPeriod):void 0),s},fromPartial(r){const s=U();return r.votingPeriod!==void 0&&r.votingPeriod!==null&&(s.votingPeriod=o.Duration.fromPartial(r.votingPeriod)),s}};function W(){return{quorum:new Uint8Array,threshold:new Uint8Array,vetoThreshold:new Uint8Array}}e.TallyParams={typeUrl:"/cosmos.gov.v1beta1.TallyParams",encode(r,s=g.BinaryWriter.create()){return r.quorum.length!==0&&s.uint32(10).bytes(r.quorum),r.threshold.length!==0&&s.uint32(18).bytes(r.threshold),r.vetoThreshold.length!==0&&s.uint32(26).bytes(r.vetoThreshold),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=W();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.quorum=O.bytes();break;case 2:d.threshold=O.bytes();break;case 3:d.vetoThreshold=O.bytes();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=W();return(0,C.isSet)(r.quorum)&&(s.quorum=(0,C.bytesFromBase64)(r.quorum)),(0,C.isSet)(r.threshold)&&(s.threshold=(0,C.bytesFromBase64)(r.threshold)),(0,C.isSet)(r.vetoThreshold)&&(s.vetoThreshold=(0,C.bytesFromBase64)(r.vetoThreshold)),s},toJSON(r){const s={};return r.quorum!==void 0&&(s.quorum=(0,C.base64FromBytes)(r.quorum!==void 0?r.quorum:new Uint8Array)),r.threshold!==void 0&&(s.threshold=(0,C.base64FromBytes)(r.threshold!==void 0?r.threshold:new Uint8Array)),r.vetoThreshold!==void 0&&(s.vetoThreshold=(0,C.base64FromBytes)(r.vetoThreshold!==void 0?r.vetoThreshold:new Uint8Array)),s},fromPartial(r){const s=W();return s.quorum=r.quorum??new Uint8Array,s.threshold=r.threshold??new Uint8Array,s.vetoThreshold=r.vetoThreshold??new Uint8Array,s}}})(Eo);Object.defineProperty(bn,"__esModule",{value:!0});bn.createGovAminoConverters=bn.isAminoMsgDeposit=bn.isAminoMsgVoteWeighted=bn.isAminoMsgVote=bn.isAminoMsgSubmitProposal=void 0;const Dk=Ne,Fi=Ie,Gi=Eo,Jk=_.any,Hk=ze;function qk(e){return e.type==="cosmos-sdk/MsgSubmitProposal"}bn.isAminoMsgSubmitProposal=qk;function Vk(e){return e.type==="cosmos-sdk/MsgVote"}bn.isAminoMsgVote=Vk;function Wk(e){return e.type==="cosmos-sdk/MsgVoteWeighted"}bn.isAminoMsgVoteWeighted=Wk;function Qk(e){return e.type==="cosmos-sdk/MsgDeposit"}bn.isAminoMsgDeposit=Qk;function Fk(){return{"/cosmos.gov.v1beta1.MsgDeposit":{aminoType:"cosmos-sdk/MsgDeposit",toAmino:({amount:e,depositor:n,proposalId:t})=>({amount:e,depositor:n,proposal_id:t.toString()}),fromAmino:({amount:e,depositor:n,proposal_id:t})=>({amount:Array.from(e),depositor:n,proposalId:BigInt(t)})},"/cosmos.gov.v1beta1.MsgVote":{aminoType:"cosmos-sdk/MsgVote",toAmino:({option:e,proposalId:n,voter:t})=>({option:e,proposal_id:n.toString(),voter:t}),fromAmino:({option:e,proposal_id:n,voter:t})=>({option:(0,Gi.voteOptionFromJSON)(e),proposalId:BigInt(n),voter:t})},"/cosmos.gov.v1beta1.MsgVoteWeighted":{aminoType:"cosmos-sdk/MsgVoteWeighted",toAmino:({options:e,proposalId:n,voter:t})=>({options:e.map(i=>({option:i.option,weight:(0,Hk.decodeCosmosSdkDecFromProto)(i.weight).toString().padEnd(20,"0")})),proposal_id:n.toString(),voter:t}),fromAmino:({options:e,proposal_id:n,voter:t})=>({proposalId:BigInt(n),voter:t,options:e.map(i=>({option:(0,Gi.voteOptionFromJSON)(i.option),weight:Dk.Decimal.fromUserInput(i.weight,18).atomics}))})},"/cosmos.gov.v1beta1.MsgSubmitProposal":{aminoType:"cosmos-sdk/MsgSubmitProposal",toAmino:({initialDeposit:e,proposer:n,content:t})=>{(0,Fi.assertDefinedAndNotNull)(t);let i;switch(t.typeUrl){case"/cosmos.gov.v1beta1.TextProposal":{const o=Gi.TextProposal.decode(t.value);i={type:"cosmos-sdk/TextProposal",value:{description:o.description,title:o.title}};break}default:throw new Error(`Unsupported proposal type: '${t.typeUrl}'`)}return{initial_deposit:e,proposer:n,content:i}},fromAmino:({initial_deposit:e,proposer:n,content:t})=>{let i;switch(t.type){case"cosmos-sdk/TextProposal":{const{value:o}=t;(0,Fi.assert)((0,Fi.isNonNullObject)(o));const{title:g,description:C}=o;(0,Fi.assert)(typeof g=="string"),(0,Fi.assert)(typeof C=="string"),i=Jk.Any.fromPartial({typeUrl:"/cosmos.gov.v1beta1.TextProposal",value:Gi.TextProposal.encode(Gi.TextProposal.fromPartial({title:g,description:C})).finish()});break}default:throw new Error(`Unsupported proposal type: '${t.type}'`)}return{initialDeposit:Array.from(e),proposer:n,content:i}}}}}bn.createGovAminoConverters=Fk;var En={},Sc={},gm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Params=e.TallyParams=e.VotingParams=e.DepositParams=e.Vote=e.TallyResult=e.Proposal=e.Deposit=e.WeightedVoteOption=e.proposalStatusToJSON=e.proposalStatusFromJSON=e.ProposalStatus=e.voteOptionToJSON=e.voteOptionFromJSON=e.VoteOption=e.protobufPackage=void 0;const n=_.coin,t=_.any,i=Je,o=yn,g=_.binary,C=_.helpers;e.protobufPackage="cosmos.gov.v1";var w;(function(r){r[r.VOTE_OPTION_UNSPECIFIED=0]="VOTE_OPTION_UNSPECIFIED",r[r.VOTE_OPTION_YES=1]="VOTE_OPTION_YES",r[r.VOTE_OPTION_ABSTAIN=2]="VOTE_OPTION_ABSTAIN",r[r.VOTE_OPTION_NO=3]="VOTE_OPTION_NO",r[r.VOTE_OPTION_NO_WITH_VETO=4]="VOTE_OPTION_NO_WITH_VETO",r[r.UNRECOGNIZED=-1]="UNRECOGNIZED"})(w||(e.VoteOption=w={}));function E(r){switch(r){case 0:case"VOTE_OPTION_UNSPECIFIED":return w.VOTE_OPTION_UNSPECIFIED;case 1:case"VOTE_OPTION_YES":return w.VOTE_OPTION_YES;case 2:case"VOTE_OPTION_ABSTAIN":return w.VOTE_OPTION_ABSTAIN;case 3:case"VOTE_OPTION_NO":return w.VOTE_OPTION_NO;case 4:case"VOTE_OPTION_NO_WITH_VETO":return w.VOTE_OPTION_NO_WITH_VETO;case-1:case"UNRECOGNIZED":default:return w.UNRECOGNIZED}}e.voteOptionFromJSON=E;function D(r){switch(r){case w.VOTE_OPTION_UNSPECIFIED:return"VOTE_OPTION_UNSPECIFIED";case w.VOTE_OPTION_YES:return"VOTE_OPTION_YES";case w.VOTE_OPTION_ABSTAIN:return"VOTE_OPTION_ABSTAIN";case w.VOTE_OPTION_NO:return"VOTE_OPTION_NO";case w.VOTE_OPTION_NO_WITH_VETO:return"VOTE_OPTION_NO_WITH_VETO";case w.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.voteOptionToJSON=D;var J;(function(r){r[r.PROPOSAL_STATUS_UNSPECIFIED=0]="PROPOSAL_STATUS_UNSPECIFIED",r[r.PROPOSAL_STATUS_DEPOSIT_PERIOD=1]="PROPOSAL_STATUS_DEPOSIT_PERIOD",r[r.PROPOSAL_STATUS_VOTING_PERIOD=2]="PROPOSAL_STATUS_VOTING_PERIOD",r[r.PROPOSAL_STATUS_PASSED=3]="PROPOSAL_STATUS_PASSED",r[r.PROPOSAL_STATUS_REJECTED=4]="PROPOSAL_STATUS_REJECTED",r[r.PROPOSAL_STATUS_FAILED=5]="PROPOSAL_STATUS_FAILED",r[r.UNRECOGNIZED=-1]="UNRECOGNIZED"})(J||(e.ProposalStatus=J={}));function b(r){switch(r){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return J.PROPOSAL_STATUS_UNSPECIFIED;case 1:case"PROPOSAL_STATUS_DEPOSIT_PERIOD":return J.PROPOSAL_STATUS_DEPOSIT_PERIOD;case 2:case"PROPOSAL_STATUS_VOTING_PERIOD":return J.PROPOSAL_STATUS_VOTING_PERIOD;case 3:case"PROPOSAL_STATUS_PASSED":return J.PROPOSAL_STATUS_PASSED;case 4:case"PROPOSAL_STATUS_REJECTED":return J.PROPOSAL_STATUS_REJECTED;case 5:case"PROPOSAL_STATUS_FAILED":return J.PROPOSAL_STATUS_FAILED;case-1:case"UNRECOGNIZED":default:return J.UNRECOGNIZED}}e.proposalStatusFromJSON=b;function p(r){switch(r){case J.PROPOSAL_STATUS_UNSPECIFIED:return"PROPOSAL_STATUS_UNSPECIFIED";case J.PROPOSAL_STATUS_DEPOSIT_PERIOD:return"PROPOSAL_STATUS_DEPOSIT_PERIOD";case J.PROPOSAL_STATUS_VOTING_PERIOD:return"PROPOSAL_STATUS_VOTING_PERIOD";case J.PROPOSAL_STATUS_PASSED:return"PROPOSAL_STATUS_PASSED";case J.PROPOSAL_STATUS_REJECTED:return"PROPOSAL_STATUS_REJECTED";case J.PROPOSAL_STATUS_FAILED:return"PROPOSAL_STATUS_FAILED";case J.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.proposalStatusToJSON=p;function S(){return{option:0,weight:""}}e.WeightedVoteOption={typeUrl:"/cosmos.gov.v1.WeightedVoteOption",encode(r,s=g.BinaryWriter.create()){return r.option!==0&&s.uint32(8).int32(r.option),r.weight!==""&&s.uint32(18).string(r.weight),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=S();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.option=O.int32();break;case 2:d.weight=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=S();return(0,C.isSet)(r.option)&&(s.option=E(r.option)),(0,C.isSet)(r.weight)&&(s.weight=String(r.weight)),s},toJSON(r){const s={};return r.option!==void 0&&(s.option=D(r.option)),r.weight!==void 0&&(s.weight=r.weight),s},fromPartial(r){const s=S();return s.option=r.option??0,s.weight=r.weight??"",s}};function R(){return{proposalId:BigInt(0),depositor:"",amount:[]}}e.Deposit={typeUrl:"/cosmos.gov.v1.Deposit",encode(r,s=g.BinaryWriter.create()){r.proposalId!==BigInt(0)&&s.uint32(8).uint64(r.proposalId),r.depositor!==""&&s.uint32(18).string(r.depositor);for(const O of r.amount)n.Coin.encode(O,s.uint32(26).fork()).ldelim();return s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=R();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposalId=O.uint64();break;case 2:d.depositor=O.string();break;case 3:d.amount.push(n.Coin.decode(O,O.uint32()));break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=R();return(0,C.isSet)(r.proposalId)&&(s.proposalId=BigInt(r.proposalId.toString())),(0,C.isSet)(r.depositor)&&(s.depositor=String(r.depositor)),Array.isArray(r==null?void 0:r.amount)&&(s.amount=r.amount.map(O=>n.Coin.fromJSON(O))),s},toJSON(r){const s={};return r.proposalId!==void 0&&(s.proposalId=(r.proposalId||BigInt(0)).toString()),r.depositor!==void 0&&(s.depositor=r.depositor),r.amount?s.amount=r.amount.map(O=>O?n.Coin.toJSON(O):void 0):s.amount=[],s},fromPartial(r){var O;const s=R();return r.proposalId!==void 0&&r.proposalId!==null&&(s.proposalId=BigInt(r.proposalId.toString())),s.depositor=r.depositor??"",s.amount=((O=r.amount)==null?void 0:O.map(q=>n.Coin.fromPartial(q)))||[],s}};function u(){return{id:BigInt(0),messages:[],status:0,finalTallyResult:void 0,submitTime:void 0,depositEndTime:void 0,totalDeposit:[],votingStartTime:void 0,votingEndTime:void 0,metadata:"",title:"",summary:"",proposer:""}}e.Proposal={typeUrl:"/cosmos.gov.v1.Proposal",encode(r,s=g.BinaryWriter.create()){r.id!==BigInt(0)&&s.uint32(8).uint64(r.id);for(const O of r.messages)t.Any.encode(O,s.uint32(18).fork()).ldelim();r.status!==0&&s.uint32(24).int32(r.status),r.finalTallyResult!==void 0&&e.TallyResult.encode(r.finalTallyResult,s.uint32(34).fork()).ldelim(),r.submitTime!==void 0&&i.Timestamp.encode(r.submitTime,s.uint32(42).fork()).ldelim(),r.depositEndTime!==void 0&&i.Timestamp.encode(r.depositEndTime,s.uint32(50).fork()).ldelim();for(const O of r.totalDeposit)n.Coin.encode(O,s.uint32(58).fork()).ldelim();return r.votingStartTime!==void 0&&i.Timestamp.encode(r.votingStartTime,s.uint32(66).fork()).ldelim(),r.votingEndTime!==void 0&&i.Timestamp.encode(r.votingEndTime,s.uint32(74).fork()).ldelim(),r.metadata!==""&&s.uint32(82).string(r.metadata),r.title!==""&&s.uint32(90).string(r.title),r.summary!==""&&s.uint32(98).string(r.summary),r.proposer!==""&&s.uint32(106).string(r.proposer),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=u();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.id=O.uint64();break;case 2:d.messages.push(t.Any.decode(O,O.uint32()));break;case 3:d.status=O.int32();break;case 4:d.finalTallyResult=e.TallyResult.decode(O,O.uint32());break;case 5:d.submitTime=i.Timestamp.decode(O,O.uint32());break;case 6:d.depositEndTime=i.Timestamp.decode(O,O.uint32());break;case 7:d.totalDeposit.push(n.Coin.decode(O,O.uint32()));break;case 8:d.votingStartTime=i.Timestamp.decode(O,O.uint32());break;case 9:d.votingEndTime=i.Timestamp.decode(O,O.uint32());break;case 10:d.metadata=O.string();break;case 11:d.title=O.string();break;case 12:d.summary=O.string();break;case 13:d.proposer=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=u();return(0,C.isSet)(r.id)&&(s.id=BigInt(r.id.toString())),Array.isArray(r==null?void 0:r.messages)&&(s.messages=r.messages.map(O=>t.Any.fromJSON(O))),(0,C.isSet)(r.status)&&(s.status=b(r.status)),(0,C.isSet)(r.finalTallyResult)&&(s.finalTallyResult=e.TallyResult.fromJSON(r.finalTallyResult)),(0,C.isSet)(r.submitTime)&&(s.submitTime=(0,C.fromJsonTimestamp)(r.submitTime)),(0,C.isSet)(r.depositEndTime)&&(s.depositEndTime=(0,C.fromJsonTimestamp)(r.depositEndTime)),Array.isArray(r==null?void 0:r.totalDeposit)&&(s.totalDeposit=r.totalDeposit.map(O=>n.Coin.fromJSON(O))),(0,C.isSet)(r.votingStartTime)&&(s.votingStartTime=(0,C.fromJsonTimestamp)(r.votingStartTime)),(0,C.isSet)(r.votingEndTime)&&(s.votingEndTime=(0,C.fromJsonTimestamp)(r.votingEndTime)),(0,C.isSet)(r.metadata)&&(s.metadata=String(r.metadata)),(0,C.isSet)(r.title)&&(s.title=String(r.title)),(0,C.isSet)(r.summary)&&(s.summary=String(r.summary)),(0,C.isSet)(r.proposer)&&(s.proposer=String(r.proposer)),s},toJSON(r){const s={};return r.id!==void 0&&(s.id=(r.id||BigInt(0)).toString()),r.messages?s.messages=r.messages.map(O=>O?t.Any.toJSON(O):void 0):s.messages=[],r.status!==void 0&&(s.status=p(r.status)),r.finalTallyResult!==void 0&&(s.finalTallyResult=r.finalTallyResult?e.TallyResult.toJSON(r.finalTallyResult):void 0),r.submitTime!==void 0&&(s.submitTime=(0,C.fromTimestamp)(r.submitTime).toISOString()),r.depositEndTime!==void 0&&(s.depositEndTime=(0,C.fromTimestamp)(r.depositEndTime).toISOString()),r.totalDeposit?s.totalDeposit=r.totalDeposit.map(O=>O?n.Coin.toJSON(O):void 0):s.totalDeposit=[],r.votingStartTime!==void 0&&(s.votingStartTime=(0,C.fromTimestamp)(r.votingStartTime).toISOString()),r.votingEndTime!==void 0&&(s.votingEndTime=(0,C.fromTimestamp)(r.votingEndTime).toISOString()),r.metadata!==void 0&&(s.metadata=r.metadata),r.title!==void 0&&(s.title=r.title),r.summary!==void 0&&(s.summary=r.summary),r.proposer!==void 0&&(s.proposer=r.proposer),s},fromPartial(r){var O,q;const s=u();return r.id!==void 0&&r.id!==null&&(s.id=BigInt(r.id.toString())),s.messages=((O=r.messages)==null?void 0:O.map(d=>t.Any.fromPartial(d)))||[],s.status=r.status??0,r.finalTallyResult!==void 0&&r.finalTallyResult!==null&&(s.finalTallyResult=e.TallyResult.fromPartial(r.finalTallyResult)),r.submitTime!==void 0&&r.submitTime!==null&&(s.submitTime=i.Timestamp.fromPartial(r.submitTime)),r.depositEndTime!==void 0&&r.depositEndTime!==null&&(s.depositEndTime=i.Timestamp.fromPartial(r.depositEndTime)),s.totalDeposit=((q=r.totalDeposit)==null?void 0:q.map(d=>n.Coin.fromPartial(d)))||[],r.votingStartTime!==void 0&&r.votingStartTime!==null&&(s.votingStartTime=i.Timestamp.fromPartial(r.votingStartTime)),r.votingEndTime!==void 0&&r.votingEndTime!==null&&(s.votingEndTime=i.Timestamp.fromPartial(r.votingEndTime)),s.metadata=r.metadata??"",s.title=r.title??"",s.summary=r.summary??"",s.proposer=r.proposer??"",s}};function c(){return{yesCount:"",abstainCount:"",noCount:"",noWithVetoCount:""}}e.TallyResult={typeUrl:"/cosmos.gov.v1.TallyResult",encode(r,s=g.BinaryWriter.create()){return r.yesCount!==""&&s.uint32(10).string(r.yesCount),r.abstainCount!==""&&s.uint32(18).string(r.abstainCount),r.noCount!==""&&s.uint32(26).string(r.noCount),r.noWithVetoCount!==""&&s.uint32(34).string(r.noWithVetoCount),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=c();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.yesCount=O.string();break;case 2:d.abstainCount=O.string();break;case 3:d.noCount=O.string();break;case 4:d.noWithVetoCount=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=c();return(0,C.isSet)(r.yesCount)&&(s.yesCount=String(r.yesCount)),(0,C.isSet)(r.abstainCount)&&(s.abstainCount=String(r.abstainCount)),(0,C.isSet)(r.noCount)&&(s.noCount=String(r.noCount)),(0,C.isSet)(r.noWithVetoCount)&&(s.noWithVetoCount=String(r.noWithVetoCount)),s},toJSON(r){const s={};return r.yesCount!==void 0&&(s.yesCount=r.yesCount),r.abstainCount!==void 0&&(s.abstainCount=r.abstainCount),r.noCount!==void 0&&(s.noCount=r.noCount),r.noWithVetoCount!==void 0&&(s.noWithVetoCount=r.noWithVetoCount),s},fromPartial(r){const s=c();return s.yesCount=r.yesCount??"",s.abstainCount=r.abstainCount??"",s.noCount=r.noCount??"",s.noWithVetoCount=r.noWithVetoCount??"",s}};function y(){return{proposalId:BigInt(0),voter:"",options:[],metadata:""}}e.Vote={typeUrl:"/cosmos.gov.v1.Vote",encode(r,s=g.BinaryWriter.create()){r.proposalId!==BigInt(0)&&s.uint32(8).uint64(r.proposalId),r.voter!==""&&s.uint32(18).string(r.voter);for(const O of r.options)e.WeightedVoteOption.encode(O,s.uint32(34).fork()).ldelim();return r.metadata!==""&&s.uint32(42).string(r.metadata),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=y();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposalId=O.uint64();break;case 2:d.voter=O.string();break;case 4:d.options.push(e.WeightedVoteOption.decode(O,O.uint32()));break;case 5:d.metadata=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=y();return(0,C.isSet)(r.proposalId)&&(s.proposalId=BigInt(r.proposalId.toString())),(0,C.isSet)(r.voter)&&(s.voter=String(r.voter)),Array.isArray(r==null?void 0:r.options)&&(s.options=r.options.map(O=>e.WeightedVoteOption.fromJSON(O))),(0,C.isSet)(r.metadata)&&(s.metadata=String(r.metadata)),s},toJSON(r){const s={};return r.proposalId!==void 0&&(s.proposalId=(r.proposalId||BigInt(0)).toString()),r.voter!==void 0&&(s.voter=r.voter),r.options?s.options=r.options.map(O=>O?e.WeightedVoteOption.toJSON(O):void 0):s.options=[],r.metadata!==void 0&&(s.metadata=r.metadata),s},fromPartial(r){var O;const s=y();return r.proposalId!==void 0&&r.proposalId!==null&&(s.proposalId=BigInt(r.proposalId.toString())),s.voter=r.voter??"",s.options=((O=r.options)==null?void 0:O.map(q=>e.WeightedVoteOption.fromPartial(q)))||[],s.metadata=r.metadata??"",s}};function B(){return{minDeposit:[],maxDepositPeriod:void 0}}e.DepositParams={typeUrl:"/cosmos.gov.v1.DepositParams",encode(r,s=g.BinaryWriter.create()){for(const O of r.minDeposit)n.Coin.encode(O,s.uint32(10).fork()).ldelim();return r.maxDepositPeriod!==void 0&&o.Duration.encode(r.maxDepositPeriod,s.uint32(18).fork()).ldelim(),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=B();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.minDeposit.push(n.Coin.decode(O,O.uint32()));break;case 2:d.maxDepositPeriod=o.Duration.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=B();return Array.isArray(r==null?void 0:r.minDeposit)&&(s.minDeposit=r.minDeposit.map(O=>n.Coin.fromJSON(O))),(0,C.isSet)(r.maxDepositPeriod)&&(s.maxDepositPeriod=o.Duration.fromJSON(r.maxDepositPeriod)),s},toJSON(r){const s={};return r.minDeposit?s.minDeposit=r.minDeposit.map(O=>O?n.Coin.toJSON(O):void 0):s.minDeposit=[],r.maxDepositPeriod!==void 0&&(s.maxDepositPeriod=r.maxDepositPeriod?o.Duration.toJSON(r.maxDepositPeriod):void 0),s},fromPartial(r){var O;const s=B();return s.minDeposit=((O=r.minDeposit)==null?void 0:O.map(q=>n.Coin.fromPartial(q)))||[],r.maxDepositPeriod!==void 0&&r.maxDepositPeriod!==null&&(s.maxDepositPeriod=o.Duration.fromPartial(r.maxDepositPeriod)),s}};function N(){return{votingPeriod:void 0}}e.VotingParams={typeUrl:"/cosmos.gov.v1.VotingParams",encode(r,s=g.BinaryWriter.create()){return r.votingPeriod!==void 0&&o.Duration.encode(r.votingPeriod,s.uint32(10).fork()).ldelim(),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=N();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.votingPeriod=o.Duration.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=N();return(0,C.isSet)(r.votingPeriod)&&(s.votingPeriod=o.Duration.fromJSON(r.votingPeriod)),s},toJSON(r){const s={};return r.votingPeriod!==void 0&&(s.votingPeriod=r.votingPeriod?o.Duration.toJSON(r.votingPeriod):void 0),s},fromPartial(r){const s=N();return r.votingPeriod!==void 0&&r.votingPeriod!==null&&(s.votingPeriod=o.Duration.fromPartial(r.votingPeriod)),s}};function U(){return{quorum:"",threshold:"",vetoThreshold:""}}e.TallyParams={typeUrl:"/cosmos.gov.v1.TallyParams",encode(r,s=g.BinaryWriter.create()){return r.quorum!==""&&s.uint32(10).string(r.quorum),r.threshold!==""&&s.uint32(18).string(r.threshold),r.vetoThreshold!==""&&s.uint32(26).string(r.vetoThreshold),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=U();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.quorum=O.string();break;case 2:d.threshold=O.string();break;case 3:d.vetoThreshold=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=U();return(0,C.isSet)(r.quorum)&&(s.quorum=String(r.quorum)),(0,C.isSet)(r.threshold)&&(s.threshold=String(r.threshold)),(0,C.isSet)(r.vetoThreshold)&&(s.vetoThreshold=String(r.vetoThreshold)),s},toJSON(r){const s={};return r.quorum!==void 0&&(s.quorum=r.quorum),r.threshold!==void 0&&(s.threshold=r.threshold),r.vetoThreshold!==void 0&&(s.vetoThreshold=r.vetoThreshold),s},fromPartial(r){const s=U();return s.quorum=r.quorum??"",s.threshold=r.threshold??"",s.vetoThreshold=r.vetoThreshold??"",s}};function W(){return{minDeposit:[],maxDepositPeriod:void 0,votingPeriod:void 0,quorum:"",threshold:"",vetoThreshold:"",minInitialDepositRatio:"",burnVoteQuorum:!1,burnProposalDepositPrevote:!1,burnVoteVeto:!1}}e.Params={typeUrl:"/cosmos.gov.v1.Params",encode(r,s=g.BinaryWriter.create()){for(const O of r.minDeposit)n.Coin.encode(O,s.uint32(10).fork()).ldelim();return r.maxDepositPeriod!==void 0&&o.Duration.encode(r.maxDepositPeriod,s.uint32(18).fork()).ldelim(),r.votingPeriod!==void 0&&o.Duration.encode(r.votingPeriod,s.uint32(26).fork()).ldelim(),r.quorum!==""&&s.uint32(34).string(r.quorum),r.threshold!==""&&s.uint32(42).string(r.threshold),r.vetoThreshold!==""&&s.uint32(50).string(r.vetoThreshold),r.minInitialDepositRatio!==""&&s.uint32(58).string(r.minInitialDepositRatio),r.burnVoteQuorum===!0&&s.uint32(104).bool(r.burnVoteQuorum),r.burnProposalDepositPrevote===!0&&s.uint32(112).bool(r.burnProposalDepositPrevote),r.burnVoteVeto===!0&&s.uint32(120).bool(r.burnVoteVeto),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=W();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.minDeposit.push(n.Coin.decode(O,O.uint32()));break;case 2:d.maxDepositPeriod=o.Duration.decode(O,O.uint32());break;case 3:d.votingPeriod=o.Duration.decode(O,O.uint32());break;case 4:d.quorum=O.string();break;case 5:d.threshold=O.string();break;case 6:d.vetoThreshold=O.string();break;case 7:d.minInitialDepositRatio=O.string();break;case 13:d.burnVoteQuorum=O.bool();break;case 14:d.burnProposalDepositPrevote=O.bool();break;case 15:d.burnVoteVeto=O.bool();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=W();return Array.isArray(r==null?void 0:r.minDeposit)&&(s.minDeposit=r.minDeposit.map(O=>n.Coin.fromJSON(O))),(0,C.isSet)(r.maxDepositPeriod)&&(s.maxDepositPeriod=o.Duration.fromJSON(r.maxDepositPeriod)),(0,C.isSet)(r.votingPeriod)&&(s.votingPeriod=o.Duration.fromJSON(r.votingPeriod)),(0,C.isSet)(r.quorum)&&(s.quorum=String(r.quorum)),(0,C.isSet)(r.threshold)&&(s.threshold=String(r.threshold)),(0,C.isSet)(r.vetoThreshold)&&(s.vetoThreshold=String(r.vetoThreshold)),(0,C.isSet)(r.minInitialDepositRatio)&&(s.minInitialDepositRatio=String(r.minInitialDepositRatio)),(0,C.isSet)(r.burnVoteQuorum)&&(s.burnVoteQuorum=!!r.burnVoteQuorum),(0,C.isSet)(r.burnProposalDepositPrevote)&&(s.burnProposalDepositPrevote=!!r.burnProposalDepositPrevote),(0,C.isSet)(r.burnVoteVeto)&&(s.burnVoteVeto=!!r.burnVoteVeto),s},toJSON(r){const s={};return r.minDeposit?s.minDeposit=r.minDeposit.map(O=>O?n.Coin.toJSON(O):void 0):s.minDeposit=[],r.maxDepositPeriod!==void 0&&(s.maxDepositPeriod=r.maxDepositPeriod?o.Duration.toJSON(r.maxDepositPeriod):void 0),r.votingPeriod!==void 0&&(s.votingPeriod=r.votingPeriod?o.Duration.toJSON(r.votingPeriod):void 0),r.quorum!==void 0&&(s.quorum=r.quorum),r.threshold!==void 0&&(s.threshold=r.threshold),r.vetoThreshold!==void 0&&(s.vetoThreshold=r.vetoThreshold),r.minInitialDepositRatio!==void 0&&(s.minInitialDepositRatio=r.minInitialDepositRatio),r.burnVoteQuorum!==void 0&&(s.burnVoteQuorum=r.burnVoteQuorum),r.burnProposalDepositPrevote!==void 0&&(s.burnProposalDepositPrevote=r.burnProposalDepositPrevote),r.burnVoteVeto!==void 0&&(s.burnVoteVeto=r.burnVoteVeto),s},fromPartial(r){var O;const s=W();return s.minDeposit=((O=r.minDeposit)==null?void 0:O.map(q=>n.Coin.fromPartial(q)))||[],r.maxDepositPeriod!==void 0&&r.maxDepositPeriod!==null&&(s.maxDepositPeriod=o.Duration.fromPartial(r.maxDepositPeriod)),r.votingPeriod!==void 0&&r.votingPeriod!==null&&(s.votingPeriod=o.Duration.fromPartial(r.votingPeriod)),s.quorum=r.quorum??"",s.threshold=r.threshold??"",s.vetoThreshold=r.vetoThreshold??"",s.minInitialDepositRatio=r.minInitialDepositRatio??"",s.burnVoteQuorum=r.burnVoteQuorum??!1,s.burnProposalDepositPrevote=r.burnProposalDepositPrevote??!1,s.burnVoteVeto=r.burnVoteVeto??!1,s}}})(gm);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgUpdateParamsResponse=e.MsgUpdateParams=e.MsgDepositResponse=e.MsgDeposit=e.MsgVoteWeightedResponse=e.MsgVoteWeighted=e.MsgVoteResponse=e.MsgVote=e.MsgExecLegacyContentResponse=e.MsgExecLegacyContent=e.MsgSubmitProposalResponse=e.MsgSubmitProposal=e.protobufPackage=void 0;const n=_.any,t=_.coin,i=gm,o=_.binary,g=_.helpers;e.protobufPackage="cosmos.gov.v1";function C(){return{messages:[],initialDeposit:[],proposer:"",metadata:"",title:"",summary:""}}e.MsgSubmitProposal={typeUrl:"/cosmos.gov.v1.MsgSubmitProposal",encode(N,U=o.BinaryWriter.create()){for(const W of N.messages)n.Any.encode(W,U.uint32(10).fork()).ldelim();for(const W of N.initialDeposit)t.Coin.encode(W,U.uint32(18).fork()).ldelim();return N.proposer!==""&&U.uint32(26).string(N.proposer),N.metadata!==""&&U.uint32(34).string(N.metadata),N.title!==""&&U.uint32(42).string(N.title),N.summary!==""&&U.uint32(50).string(N.summary),U},decode(N,U){const W=N instanceof o.BinaryReader?N:new o.BinaryReader(N);let r=U===void 0?W.len:W.pos+U;const s=C();for(;W.pos<r;){const O=W.uint32();switch(O>>>3){case 1:s.messages.push(n.Any.decode(W,W.uint32()));break;case 2:s.initialDeposit.push(t.Coin.decode(W,W.uint32()));break;case 3:s.proposer=W.string();break;case 4:s.metadata=W.string();break;case 5:s.title=W.string();break;case 6:s.summary=W.string();break;default:W.skipType(O&7);break}}return s},fromJSON(N){const U=C();return Array.isArray(N==null?void 0:N.messages)&&(U.messages=N.messages.map(W=>n.Any.fromJSON(W))),Array.isArray(N==null?void 0:N.initialDeposit)&&(U.initialDeposit=N.initialDeposit.map(W=>t.Coin.fromJSON(W))),(0,g.isSet)(N.proposer)&&(U.proposer=String(N.proposer)),(0,g.isSet)(N.metadata)&&(U.metadata=String(N.metadata)),(0,g.isSet)(N.title)&&(U.title=String(N.title)),(0,g.isSet)(N.summary)&&(U.summary=String(N.summary)),U},toJSON(N){const U={};return N.messages?U.messages=N.messages.map(W=>W?n.Any.toJSON(W):void 0):U.messages=[],N.initialDeposit?U.initialDeposit=N.initialDeposit.map(W=>W?t.Coin.toJSON(W):void 0):U.initialDeposit=[],N.proposer!==void 0&&(U.proposer=N.proposer),N.metadata!==void 0&&(U.metadata=N.metadata),N.title!==void 0&&(U.title=N.title),N.summary!==void 0&&(U.summary=N.summary),U},fromPartial(N){var W,r;const U=C();return U.messages=((W=N.messages)==null?void 0:W.map(s=>n.Any.fromPartial(s)))||[],U.initialDeposit=((r=N.initialDeposit)==null?void 0:r.map(s=>t.Coin.fromPartial(s)))||[],U.proposer=N.proposer??"",U.metadata=N.metadata??"",U.title=N.title??"",U.summary=N.summary??"",U}};function w(){return{proposalId:BigInt(0)}}e.MsgSubmitProposalResponse={typeUrl:"/cosmos.gov.v1.MsgSubmitProposalResponse",encode(N,U=o.BinaryWriter.create()){return N.proposalId!==BigInt(0)&&U.uint32(8).uint64(N.proposalId),U},decode(N,U){const W=N instanceof o.BinaryReader?N:new o.BinaryReader(N);let r=U===void 0?W.len:W.pos+U;const s=w();for(;W.pos<r;){const O=W.uint32();switch(O>>>3){case 1:s.proposalId=W.uint64();break;default:W.skipType(O&7);break}}return s},fromJSON(N){const U=w();return(0,g.isSet)(N.proposalId)&&(U.proposalId=BigInt(N.proposalId.toString())),U},toJSON(N){const U={};return N.proposalId!==void 0&&(U.proposalId=(N.proposalId||BigInt(0)).toString()),U},fromPartial(N){const U=w();return N.proposalId!==void 0&&N.proposalId!==null&&(U.proposalId=BigInt(N.proposalId.toString())),U}};function E(){return{content:void 0,authority:""}}e.MsgExecLegacyContent={typeUrl:"/cosmos.gov.v1.MsgExecLegacyContent",encode(N,U=o.BinaryWriter.create()){return N.content!==void 0&&n.Any.encode(N.content,U.uint32(10).fork()).ldelim(),N.authority!==""&&U.uint32(18).string(N.authority),U},decode(N,U){const W=N instanceof o.BinaryReader?N:new o.BinaryReader(N);let r=U===void 0?W.len:W.pos+U;const s=E();for(;W.pos<r;){const O=W.uint32();switch(O>>>3){case 1:s.content=n.Any.decode(W,W.uint32());break;case 2:s.authority=W.string();break;default:W.skipType(O&7);break}}return s},fromJSON(N){const U=E();return(0,g.isSet)(N.content)&&(U.content=n.Any.fromJSON(N.content)),(0,g.isSet)(N.authority)&&(U.authority=String(N.authority)),U},toJSON(N){const U={};return N.content!==void 0&&(U.content=N.content?n.Any.toJSON(N.content):void 0),N.authority!==void 0&&(U.authority=N.authority),U},fromPartial(N){const U=E();return N.content!==void 0&&N.content!==null&&(U.content=n.Any.fromPartial(N.content)),U.authority=N.authority??"",U}};function D(){return{}}e.MsgExecLegacyContentResponse={typeUrl:"/cosmos.gov.v1.MsgExecLegacyContentResponse",encode(N,U=o.BinaryWriter.create()){return U},decode(N,U){const W=N instanceof o.BinaryReader?N:new o.BinaryReader(N);let r=U===void 0?W.len:W.pos+U;const s=D();for(;W.pos<r;){const O=W.uint32();switch(O>>>3){default:W.skipType(O&7);break}}return s},fromJSON(N){return D()},toJSON(N){return{}},fromPartial(N){return D()}};function J(){return{proposalId:BigInt(0),voter:"",option:0,metadata:""}}e.MsgVote={typeUrl:"/cosmos.gov.v1.MsgVote",encode(N,U=o.BinaryWriter.create()){return N.proposalId!==BigInt(0)&&U.uint32(8).uint64(N.proposalId),N.voter!==""&&U.uint32(18).string(N.voter),N.option!==0&&U.uint32(24).int32(N.option),N.metadata!==""&&U.uint32(34).string(N.metadata),U},decode(N,U){const W=N instanceof o.BinaryReader?N:new o.BinaryReader(N);let r=U===void 0?W.len:W.pos+U;const s=J();for(;W.pos<r;){const O=W.uint32();switch(O>>>3){case 1:s.proposalId=W.uint64();break;case 2:s.voter=W.string();break;case 3:s.option=W.int32();break;case 4:s.metadata=W.string();break;default:W.skipType(O&7);break}}return s},fromJSON(N){const U=J();return(0,g.isSet)(N.proposalId)&&(U.proposalId=BigInt(N.proposalId.toString())),(0,g.isSet)(N.voter)&&(U.voter=String(N.voter)),(0,g.isSet)(N.option)&&(U.option=(0,i.voteOptionFromJSON)(N.option)),(0,g.isSet)(N.metadata)&&(U.metadata=String(N.metadata)),U},toJSON(N){const U={};return N.proposalId!==void 0&&(U.proposalId=(N.proposalId||BigInt(0)).toString()),N.voter!==void 0&&(U.voter=N.voter),N.option!==void 0&&(U.option=(0,i.voteOptionToJSON)(N.option)),N.metadata!==void 0&&(U.metadata=N.metadata),U},fromPartial(N){const U=J();return N.proposalId!==void 0&&N.proposalId!==null&&(U.proposalId=BigInt(N.proposalId.toString())),U.voter=N.voter??"",U.option=N.option??0,U.metadata=N.metadata??"",U}};function b(){return{}}e.MsgVoteResponse={typeUrl:"/cosmos.gov.v1.MsgVoteResponse",encode(N,U=o.BinaryWriter.create()){return U},decode(N,U){const W=N instanceof o.BinaryReader?N:new o.BinaryReader(N);let r=U===void 0?W.len:W.pos+U;const s=b();for(;W.pos<r;){const O=W.uint32();switch(O>>>3){default:W.skipType(O&7);break}}return s},fromJSON(N){return b()},toJSON(N){return{}},fromPartial(N){return b()}};function p(){return{proposalId:BigInt(0),voter:"",options:[],metadata:""}}e.MsgVoteWeighted={typeUrl:"/cosmos.gov.v1.MsgVoteWeighted",encode(N,U=o.BinaryWriter.create()){N.proposalId!==BigInt(0)&&U.uint32(8).uint64(N.proposalId),N.voter!==""&&U.uint32(18).string(N.voter);for(const W of N.options)i.WeightedVoteOption.encode(W,U.uint32(26).fork()).ldelim();return N.metadata!==""&&U.uint32(34).string(N.metadata),U},decode(N,U){const W=N instanceof o.BinaryReader?N:new o.BinaryReader(N);let r=U===void 0?W.len:W.pos+U;const s=p();for(;W.pos<r;){const O=W.uint32();switch(O>>>3){case 1:s.proposalId=W.uint64();break;case 2:s.voter=W.string();break;case 3:s.options.push(i.WeightedVoteOption.decode(W,W.uint32()));break;case 4:s.metadata=W.string();break;default:W.skipType(O&7);break}}return s},fromJSON(N){const U=p();return(0,g.isSet)(N.proposalId)&&(U.proposalId=BigInt(N.proposalId.toString())),(0,g.isSet)(N.voter)&&(U.voter=String(N.voter)),Array.isArray(N==null?void 0:N.options)&&(U.options=N.options.map(W=>i.WeightedVoteOption.fromJSON(W))),(0,g.isSet)(N.metadata)&&(U.metadata=String(N.metadata)),U},toJSON(N){const U={};return N.proposalId!==void 0&&(U.proposalId=(N.proposalId||BigInt(0)).toString()),N.voter!==void 0&&(U.voter=N.voter),N.options?U.options=N.options.map(W=>W?i.WeightedVoteOption.toJSON(W):void 0):U.options=[],N.metadata!==void 0&&(U.metadata=N.metadata),U},fromPartial(N){var W;const U=p();return N.proposalId!==void 0&&N.proposalId!==null&&(U.proposalId=BigInt(N.proposalId.toString())),U.voter=N.voter??"",U.options=((W=N.options)==null?void 0:W.map(r=>i.WeightedVoteOption.fromPartial(r)))||[],U.metadata=N.metadata??"",U}};function S(){return{}}e.MsgVoteWeightedResponse={typeUrl:"/cosmos.gov.v1.MsgVoteWeightedResponse",encode(N,U=o.BinaryWriter.create()){return U},decode(N,U){const W=N instanceof o.BinaryReader?N:new o.BinaryReader(N);let r=U===void 0?W.len:W.pos+U;const s=S();for(;W.pos<r;){const O=W.uint32();switch(O>>>3){default:W.skipType(O&7);break}}return s},fromJSON(N){return S()},toJSON(N){return{}},fromPartial(N){return S()}};function R(){return{proposalId:BigInt(0),depositor:"",amount:[]}}e.MsgDeposit={typeUrl:"/cosmos.gov.v1.MsgDeposit",encode(N,U=o.BinaryWriter.create()){N.proposalId!==BigInt(0)&&U.uint32(8).uint64(N.proposalId),N.depositor!==""&&U.uint32(18).string(N.depositor);for(const W of N.amount)t.Coin.encode(W,U.uint32(26).fork()).ldelim();return U},decode(N,U){const W=N instanceof o.BinaryReader?N:new o.BinaryReader(N);let r=U===void 0?W.len:W.pos+U;const s=R();for(;W.pos<r;){const O=W.uint32();switch(O>>>3){case 1:s.proposalId=W.uint64();break;case 2:s.depositor=W.string();break;case 3:s.amount.push(t.Coin.decode(W,W.uint32()));break;default:W.skipType(O&7);break}}return s},fromJSON(N){const U=R();return(0,g.isSet)(N.proposalId)&&(U.proposalId=BigInt(N.proposalId.toString())),(0,g.isSet)(N.depositor)&&(U.depositor=String(N.depositor)),Array.isArray(N==null?void 0:N.amount)&&(U.amount=N.amount.map(W=>t.Coin.fromJSON(W))),U},toJSON(N){const U={};return N.proposalId!==void 0&&(U.proposalId=(N.proposalId||BigInt(0)).toString()),N.depositor!==void 0&&(U.depositor=N.depositor),N.amount?U.amount=N.amount.map(W=>W?t.Coin.toJSON(W):void 0):U.amount=[],U},fromPartial(N){var W;const U=R();return N.proposalId!==void 0&&N.proposalId!==null&&(U.proposalId=BigInt(N.proposalId.toString())),U.depositor=N.depositor??"",U.amount=((W=N.amount)==null?void 0:W.map(r=>t.Coin.fromPartial(r)))||[],U}};function u(){return{}}e.MsgDepositResponse={typeUrl:"/cosmos.gov.v1.MsgDepositResponse",encode(N,U=o.BinaryWriter.create()){return U},decode(N,U){const W=N instanceof o.BinaryReader?N:new o.BinaryReader(N);let r=U===void 0?W.len:W.pos+U;const s=u();for(;W.pos<r;){const O=W.uint32();switch(O>>>3){default:W.skipType(O&7);break}}return s},fromJSON(N){return u()},toJSON(N){return{}},fromPartial(N){return u()}};function c(){return{authority:"",params:i.Params.fromPartial({})}}e.MsgUpdateParams={typeUrl:"/cosmos.gov.v1.MsgUpdateParams",encode(N,U=o.BinaryWriter.create()){return N.authority!==""&&U.uint32(10).string(N.authority),N.params!==void 0&&i.Params.encode(N.params,U.uint32(18).fork()).ldelim(),U},decode(N,U){const W=N instanceof o.BinaryReader?N:new o.BinaryReader(N);let r=U===void 0?W.len:W.pos+U;const s=c();for(;W.pos<r;){const O=W.uint32();switch(O>>>3){case 1:s.authority=W.string();break;case 2:s.params=i.Params.decode(W,W.uint32());break;default:W.skipType(O&7);break}}return s},fromJSON(N){const U=c();return(0,g.isSet)(N.authority)&&(U.authority=String(N.authority)),(0,g.isSet)(N.params)&&(U.params=i.Params.fromJSON(N.params)),U},toJSON(N){const U={};return N.authority!==void 0&&(U.authority=N.authority),N.params!==void 0&&(U.params=N.params?i.Params.toJSON(N.params):void 0),U},fromPartial(N){const U=c();return U.authority=N.authority??"",N.params!==void 0&&N.params!==null&&(U.params=i.Params.fromPartial(N.params)),U}};function y(){return{}}e.MsgUpdateParamsResponse={typeUrl:"/cosmos.gov.v1.MsgUpdateParamsResponse",encode(N,U=o.BinaryWriter.create()){return U},decode(N,U){const W=N instanceof o.BinaryReader?N:new o.BinaryReader(N);let r=U===void 0?W.len:W.pos+U;const s=y();for(;W.pos<r;){const O=W.uint32();switch(O>>>3){default:W.skipType(O&7);break}}return s},fromJSON(N){return y()},toJSON(N){return{}},fromPartial(N){return y()}};class B{constructor(U){this.rpc=U,this.SubmitProposal=this.SubmitProposal.bind(this),this.ExecLegacyContent=this.ExecLegacyContent.bind(this),this.Vote=this.Vote.bind(this),this.VoteWeighted=this.VoteWeighted.bind(this),this.Deposit=this.Deposit.bind(this),this.UpdateParams=this.UpdateParams.bind(this)}SubmitProposal(U){const W=e.MsgSubmitProposal.encode(U).finish();return this.rpc.request("cosmos.gov.v1.Msg","SubmitProposal",W).then(s=>e.MsgSubmitProposalResponse.decode(new o.BinaryReader(s)))}ExecLegacyContent(U){const W=e.MsgExecLegacyContent.encode(U).finish();return this.rpc.request("cosmos.gov.v1.Msg","ExecLegacyContent",W).then(s=>e.MsgExecLegacyContentResponse.decode(new o.BinaryReader(s)))}Vote(U){const W=e.MsgVote.encode(U).finish();return this.rpc.request("cosmos.gov.v1.Msg","Vote",W).then(s=>e.MsgVoteResponse.decode(new o.BinaryReader(s)))}VoteWeighted(U){const W=e.MsgVoteWeighted.encode(U).finish();return this.rpc.request("cosmos.gov.v1.Msg","VoteWeighted",W).then(s=>e.MsgVoteWeightedResponse.decode(new o.BinaryReader(s)))}Deposit(U){const W=e.MsgDeposit.encode(U).finish();return this.rpc.request("cosmos.gov.v1.Msg","Deposit",W).then(s=>e.MsgDepositResponse.decode(new o.BinaryReader(s)))}UpdateParams(U){const W=e.MsgUpdateParams.encode(U).finish();return this.rpc.request("cosmos.gov.v1.Msg","UpdateParams",W).then(s=>e.MsgUpdateParamsResponse.decode(new o.BinaryReader(s)))}}e.MsgClientImpl=B})(Sc);var kc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgDepositResponse=e.MsgDeposit=e.MsgVoteWeightedResponse=e.MsgVoteWeighted=e.MsgVoteResponse=e.MsgVote=e.MsgSubmitProposalResponse=e.MsgSubmitProposal=e.protobufPackage=void 0;const n=_.any,t=_.coin,i=Eo,o=_.binary,g=_.helpers;e.protobufPackage="cosmos.gov.v1beta1";function C(){return{content:void 0,initialDeposit:[],proposer:""}}e.MsgSubmitProposal={typeUrl:"/cosmos.gov.v1beta1.MsgSubmitProposal",encode(u,c=o.BinaryWriter.create()){u.content!==void 0&&n.Any.encode(u.content,c.uint32(10).fork()).ldelim();for(const y of u.initialDeposit)t.Coin.encode(y,c.uint32(18).fork()).ldelim();return u.proposer!==""&&c.uint32(26).string(u.proposer),c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=C();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.content=n.Any.decode(y,y.uint32());break;case 2:N.initialDeposit.push(t.Coin.decode(y,y.uint32()));break;case 3:N.proposer=y.string();break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=C();return(0,g.isSet)(u.content)&&(c.content=n.Any.fromJSON(u.content)),Array.isArray(u==null?void 0:u.initialDeposit)&&(c.initialDeposit=u.initialDeposit.map(y=>t.Coin.fromJSON(y))),(0,g.isSet)(u.proposer)&&(c.proposer=String(u.proposer)),c},toJSON(u){const c={};return u.content!==void 0&&(c.content=u.content?n.Any.toJSON(u.content):void 0),u.initialDeposit?c.initialDeposit=u.initialDeposit.map(y=>y?t.Coin.toJSON(y):void 0):c.initialDeposit=[],u.proposer!==void 0&&(c.proposer=u.proposer),c},fromPartial(u){var y;const c=C();return u.content!==void 0&&u.content!==null&&(c.content=n.Any.fromPartial(u.content)),c.initialDeposit=((y=u.initialDeposit)==null?void 0:y.map(B=>t.Coin.fromPartial(B)))||[],c.proposer=u.proposer??"",c}};function w(){return{proposalId:BigInt(0)}}e.MsgSubmitProposalResponse={typeUrl:"/cosmos.gov.v1beta1.MsgSubmitProposalResponse",encode(u,c=o.BinaryWriter.create()){return u.proposalId!==BigInt(0)&&c.uint32(8).uint64(u.proposalId),c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=w();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.proposalId=y.uint64();break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=w();return(0,g.isSet)(u.proposalId)&&(c.proposalId=BigInt(u.proposalId.toString())),c},toJSON(u){const c={};return u.proposalId!==void 0&&(c.proposalId=(u.proposalId||BigInt(0)).toString()),c},fromPartial(u){const c=w();return u.proposalId!==void 0&&u.proposalId!==null&&(c.proposalId=BigInt(u.proposalId.toString())),c}};function E(){return{proposalId:BigInt(0),voter:"",option:0}}e.MsgVote={typeUrl:"/cosmos.gov.v1beta1.MsgVote",encode(u,c=o.BinaryWriter.create()){return u.proposalId!==BigInt(0)&&c.uint32(8).uint64(u.proposalId),u.voter!==""&&c.uint32(18).string(u.voter),u.option!==0&&c.uint32(24).int32(u.option),c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=E();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.proposalId=y.uint64();break;case 2:N.voter=y.string();break;case 3:N.option=y.int32();break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=E();return(0,g.isSet)(u.proposalId)&&(c.proposalId=BigInt(u.proposalId.toString())),(0,g.isSet)(u.voter)&&(c.voter=String(u.voter)),(0,g.isSet)(u.option)&&(c.option=(0,i.voteOptionFromJSON)(u.option)),c},toJSON(u){const c={};return u.proposalId!==void 0&&(c.proposalId=(u.proposalId||BigInt(0)).toString()),u.voter!==void 0&&(c.voter=u.voter),u.option!==void 0&&(c.option=(0,i.voteOptionToJSON)(u.option)),c},fromPartial(u){const c=E();return u.proposalId!==void 0&&u.proposalId!==null&&(c.proposalId=BigInt(u.proposalId.toString())),c.voter=u.voter??"",c.option=u.option??0,c}};function D(){return{}}e.MsgVoteResponse={typeUrl:"/cosmos.gov.v1beta1.MsgVoteResponse",encode(u,c=o.BinaryWriter.create()){return c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=D();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return N},fromJSON(u){return D()},toJSON(u){return{}},fromPartial(u){return D()}};function J(){return{proposalId:BigInt(0),voter:"",options:[]}}e.MsgVoteWeighted={typeUrl:"/cosmos.gov.v1beta1.MsgVoteWeighted",encode(u,c=o.BinaryWriter.create()){u.proposalId!==BigInt(0)&&c.uint32(8).uint64(u.proposalId),u.voter!==""&&c.uint32(18).string(u.voter);for(const y of u.options)i.WeightedVoteOption.encode(y,c.uint32(26).fork()).ldelim();return c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=J();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.proposalId=y.uint64();break;case 2:N.voter=y.string();break;case 3:N.options.push(i.WeightedVoteOption.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=J();return(0,g.isSet)(u.proposalId)&&(c.proposalId=BigInt(u.proposalId.toString())),(0,g.isSet)(u.voter)&&(c.voter=String(u.voter)),Array.isArray(u==null?void 0:u.options)&&(c.options=u.options.map(y=>i.WeightedVoteOption.fromJSON(y))),c},toJSON(u){const c={};return u.proposalId!==void 0&&(c.proposalId=(u.proposalId||BigInt(0)).toString()),u.voter!==void 0&&(c.voter=u.voter),u.options?c.options=u.options.map(y=>y?i.WeightedVoteOption.toJSON(y):void 0):c.options=[],c},fromPartial(u){var y;const c=J();return u.proposalId!==void 0&&u.proposalId!==null&&(c.proposalId=BigInt(u.proposalId.toString())),c.voter=u.voter??"",c.options=((y=u.options)==null?void 0:y.map(B=>i.WeightedVoteOption.fromPartial(B)))||[],c}};function b(){return{}}e.MsgVoteWeightedResponse={typeUrl:"/cosmos.gov.v1beta1.MsgVoteWeightedResponse",encode(u,c=o.BinaryWriter.create()){return c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=b();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return N},fromJSON(u){return b()},toJSON(u){return{}},fromPartial(u){return b()}};function p(){return{proposalId:BigInt(0),depositor:"",amount:[]}}e.MsgDeposit={typeUrl:"/cosmos.gov.v1beta1.MsgDeposit",encode(u,c=o.BinaryWriter.create()){u.proposalId!==BigInt(0)&&c.uint32(8).uint64(u.proposalId),u.depositor!==""&&c.uint32(18).string(u.depositor);for(const y of u.amount)t.Coin.encode(y,c.uint32(26).fork()).ldelim();return c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=p();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.proposalId=y.uint64();break;case 2:N.depositor=y.string();break;case 3:N.amount.push(t.Coin.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=p();return(0,g.isSet)(u.proposalId)&&(c.proposalId=BigInt(u.proposalId.toString())),(0,g.isSet)(u.depositor)&&(c.depositor=String(u.depositor)),Array.isArray(u==null?void 0:u.amount)&&(c.amount=u.amount.map(y=>t.Coin.fromJSON(y))),c},toJSON(u){const c={};return u.proposalId!==void 0&&(c.proposalId=(u.proposalId||BigInt(0)).toString()),u.depositor!==void 0&&(c.depositor=u.depositor),u.amount?c.amount=u.amount.map(y=>y?t.Coin.toJSON(y):void 0):c.amount=[],c},fromPartial(u){var y;const c=p();return u.proposalId!==void 0&&u.proposalId!==null&&(c.proposalId=BigInt(u.proposalId.toString())),c.depositor=u.depositor??"",c.amount=((y=u.amount)==null?void 0:y.map(B=>t.Coin.fromPartial(B)))||[],c}};function S(){return{}}e.MsgDepositResponse={typeUrl:"/cosmos.gov.v1beta1.MsgDepositResponse",encode(u,c=o.BinaryWriter.create()){return c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=S();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return N},fromJSON(u){return S()},toJSON(u){return{}},fromPartial(u){return S()}};class R{constructor(c){this.rpc=c,this.SubmitProposal=this.SubmitProposal.bind(this),this.Vote=this.Vote.bind(this),this.VoteWeighted=this.VoteWeighted.bind(this),this.Deposit=this.Deposit.bind(this)}SubmitProposal(c){const y=e.MsgSubmitProposal.encode(c).finish();return this.rpc.request("cosmos.gov.v1beta1.Msg","SubmitProposal",y).then(N=>e.MsgSubmitProposalResponse.decode(new o.BinaryReader(N)))}Vote(c){const y=e.MsgVote.encode(c).finish();return this.rpc.request("cosmos.gov.v1beta1.Msg","Vote",y).then(N=>e.MsgVoteResponse.decode(new o.BinaryReader(N)))}VoteWeighted(c){const y=e.MsgVoteWeighted.encode(c).finish();return this.rpc.request("cosmos.gov.v1beta1.Msg","VoteWeighted",y).then(N=>e.MsgVoteWeightedResponse.decode(new o.BinaryReader(N)))}Deposit(c){const y=e.MsgDeposit.encode(c).finish();return this.rpc.request("cosmos.gov.v1beta1.Msg","Deposit",y).then(N=>e.MsgDepositResponse.decode(new o.BinaryReader(N)))}}e.MsgClientImpl=R})(kc);Object.defineProperty(En,"__esModule",{value:!0});En.isMsgVoteWeightedEncodeObject=En.isMsgVoteEncodeObject=En.isMsgSubmitProposalEncodeObject=En.isMsgDepositEncodeObject=En.govTypes=void 0;const Li=Sc,zo=kc;En.govTypes=[["/cosmos.gov.v1.MsgDeposit",Li.MsgDeposit],["/cosmos.gov.v1.MsgSubmitProposal",Li.MsgSubmitProposal],["/cosmos.gov.v1.MsgUpdateParams",Li.MsgUpdateParams],["/cosmos.gov.v1.MsgVote",Li.MsgVote],["/cosmos.gov.v1.MsgVoteWeighted",Li.MsgVoteWeighted],["/cosmos.gov.v1beta1.MsgDeposit",zo.MsgDeposit],["/cosmos.gov.v1beta1.MsgSubmitProposal",zo.MsgSubmitProposal],["/cosmos.gov.v1beta1.MsgVote",zo.MsgVote],["/cosmos.gov.v1beta1.MsgVoteWeighted",zo.MsgVoteWeighted]];function Gk(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgDeposit"}En.isMsgDepositEncodeObject=Gk;function Lk(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgSubmitProposal"}En.isMsgSubmitProposalEncodeObject=Lk;function $k(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgVote"}En.isMsgVoteEncodeObject=$k;function Kk(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgVoteWeighted"}En.isMsgVoteWeightedEncodeObject=Kk;var fs={},Pc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryTallyResultResponse=e.QueryTallyResultRequest=e.QueryDepositsResponse=e.QueryDepositsRequest=e.QueryDepositResponse=e.QueryDepositRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.QueryVotesResponse=e.QueryVotesRequest=e.QueryVoteResponse=e.QueryVoteRequest=e.QueryProposalsResponse=e.QueryProposalsRequest=e.QueryProposalResponse=e.QueryProposalRequest=e.protobufPackage=void 0;const n=Eo,t=Be,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.gov.v1beta1";function g(){return{proposalId:BigInt(0)}}e.QueryProposalRequest={typeUrl:"/cosmos.gov.v1beta1.QueryProposalRequest",encode(r,s=i.BinaryWriter.create()){return r.proposalId!==BigInt(0)&&s.uint32(8).uint64(r.proposalId),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=g();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposalId=O.uint64();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=g();return(0,o.isSet)(r.proposalId)&&(s.proposalId=BigInt(r.proposalId.toString())),s},toJSON(r){const s={};return r.proposalId!==void 0&&(s.proposalId=(r.proposalId||BigInt(0)).toString()),s},fromPartial(r){const s=g();return r.proposalId!==void 0&&r.proposalId!==null&&(s.proposalId=BigInt(r.proposalId.toString())),s}};function C(){return{proposal:n.Proposal.fromPartial({})}}e.QueryProposalResponse={typeUrl:"/cosmos.gov.v1beta1.QueryProposalResponse",encode(r,s=i.BinaryWriter.create()){return r.proposal!==void 0&&n.Proposal.encode(r.proposal,s.uint32(10).fork()).ldelim(),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=C();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposal=n.Proposal.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=C();return(0,o.isSet)(r.proposal)&&(s.proposal=n.Proposal.fromJSON(r.proposal)),s},toJSON(r){const s={};return r.proposal!==void 0&&(s.proposal=r.proposal?n.Proposal.toJSON(r.proposal):void 0),s},fromPartial(r){const s=C();return r.proposal!==void 0&&r.proposal!==null&&(s.proposal=n.Proposal.fromPartial(r.proposal)),s}};function w(){return{proposalStatus:0,voter:"",depositor:"",pagination:void 0}}e.QueryProposalsRequest={typeUrl:"/cosmos.gov.v1beta1.QueryProposalsRequest",encode(r,s=i.BinaryWriter.create()){return r.proposalStatus!==0&&s.uint32(8).int32(r.proposalStatus),r.voter!==""&&s.uint32(18).string(r.voter),r.depositor!==""&&s.uint32(26).string(r.depositor),r.pagination!==void 0&&t.PageRequest.encode(r.pagination,s.uint32(34).fork()).ldelim(),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=w();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposalStatus=O.int32();break;case 2:d.voter=O.string();break;case 3:d.depositor=O.string();break;case 4:d.pagination=t.PageRequest.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=w();return(0,o.isSet)(r.proposalStatus)&&(s.proposalStatus=(0,n.proposalStatusFromJSON)(r.proposalStatus)),(0,o.isSet)(r.voter)&&(s.voter=String(r.voter)),(0,o.isSet)(r.depositor)&&(s.depositor=String(r.depositor)),(0,o.isSet)(r.pagination)&&(s.pagination=t.PageRequest.fromJSON(r.pagination)),s},toJSON(r){const s={};return r.proposalStatus!==void 0&&(s.proposalStatus=(0,n.proposalStatusToJSON)(r.proposalStatus)),r.voter!==void 0&&(s.voter=r.voter),r.depositor!==void 0&&(s.depositor=r.depositor),r.pagination!==void 0&&(s.pagination=r.pagination?t.PageRequest.toJSON(r.pagination):void 0),s},fromPartial(r){const s=w();return s.proposalStatus=r.proposalStatus??0,s.voter=r.voter??"",s.depositor=r.depositor??"",r.pagination!==void 0&&r.pagination!==null&&(s.pagination=t.PageRequest.fromPartial(r.pagination)),s}};function E(){return{proposals:[],pagination:void 0}}e.QueryProposalsResponse={typeUrl:"/cosmos.gov.v1beta1.QueryProposalsResponse",encode(r,s=i.BinaryWriter.create()){for(const O of r.proposals)n.Proposal.encode(O,s.uint32(10).fork()).ldelim();return r.pagination!==void 0&&t.PageResponse.encode(r.pagination,s.uint32(18).fork()).ldelim(),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=E();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposals.push(n.Proposal.decode(O,O.uint32()));break;case 2:d.pagination=t.PageResponse.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=E();return Array.isArray(r==null?void 0:r.proposals)&&(s.proposals=r.proposals.map(O=>n.Proposal.fromJSON(O))),(0,o.isSet)(r.pagination)&&(s.pagination=t.PageResponse.fromJSON(r.pagination)),s},toJSON(r){const s={};return r.proposals?s.proposals=r.proposals.map(O=>O?n.Proposal.toJSON(O):void 0):s.proposals=[],r.pagination!==void 0&&(s.pagination=r.pagination?t.PageResponse.toJSON(r.pagination):void 0),s},fromPartial(r){var O;const s=E();return s.proposals=((O=r.proposals)==null?void 0:O.map(q=>n.Proposal.fromPartial(q)))||[],r.pagination!==void 0&&r.pagination!==null&&(s.pagination=t.PageResponse.fromPartial(r.pagination)),s}};function D(){return{proposalId:BigInt(0),voter:""}}e.QueryVoteRequest={typeUrl:"/cosmos.gov.v1beta1.QueryVoteRequest",encode(r,s=i.BinaryWriter.create()){return r.proposalId!==BigInt(0)&&s.uint32(8).uint64(r.proposalId),r.voter!==""&&s.uint32(18).string(r.voter),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=D();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposalId=O.uint64();break;case 2:d.voter=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=D();return(0,o.isSet)(r.proposalId)&&(s.proposalId=BigInt(r.proposalId.toString())),(0,o.isSet)(r.voter)&&(s.voter=String(r.voter)),s},toJSON(r){const s={};return r.proposalId!==void 0&&(s.proposalId=(r.proposalId||BigInt(0)).toString()),r.voter!==void 0&&(s.voter=r.voter),s},fromPartial(r){const s=D();return r.proposalId!==void 0&&r.proposalId!==null&&(s.proposalId=BigInt(r.proposalId.toString())),s.voter=r.voter??"",s}};function J(){return{vote:n.Vote.fromPartial({})}}e.QueryVoteResponse={typeUrl:"/cosmos.gov.v1beta1.QueryVoteResponse",encode(r,s=i.BinaryWriter.create()){return r.vote!==void 0&&n.Vote.encode(r.vote,s.uint32(10).fork()).ldelim(),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=J();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.vote=n.Vote.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=J();return(0,o.isSet)(r.vote)&&(s.vote=n.Vote.fromJSON(r.vote)),s},toJSON(r){const s={};return r.vote!==void 0&&(s.vote=r.vote?n.Vote.toJSON(r.vote):void 0),s},fromPartial(r){const s=J();return r.vote!==void 0&&r.vote!==null&&(s.vote=n.Vote.fromPartial(r.vote)),s}};function b(){return{proposalId:BigInt(0),pagination:void 0}}e.QueryVotesRequest={typeUrl:"/cosmos.gov.v1beta1.QueryVotesRequest",encode(r,s=i.BinaryWriter.create()){return r.proposalId!==BigInt(0)&&s.uint32(8).uint64(r.proposalId),r.pagination!==void 0&&t.PageRequest.encode(r.pagination,s.uint32(18).fork()).ldelim(),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=b();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposalId=O.uint64();break;case 2:d.pagination=t.PageRequest.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=b();return(0,o.isSet)(r.proposalId)&&(s.proposalId=BigInt(r.proposalId.toString())),(0,o.isSet)(r.pagination)&&(s.pagination=t.PageRequest.fromJSON(r.pagination)),s},toJSON(r){const s={};return r.proposalId!==void 0&&(s.proposalId=(r.proposalId||BigInt(0)).toString()),r.pagination!==void 0&&(s.pagination=r.pagination?t.PageRequest.toJSON(r.pagination):void 0),s},fromPartial(r){const s=b();return r.proposalId!==void 0&&r.proposalId!==null&&(s.proposalId=BigInt(r.proposalId.toString())),r.pagination!==void 0&&r.pagination!==null&&(s.pagination=t.PageRequest.fromPartial(r.pagination)),s}};function p(){return{votes:[],pagination:void 0}}e.QueryVotesResponse={typeUrl:"/cosmos.gov.v1beta1.QueryVotesResponse",encode(r,s=i.BinaryWriter.create()){for(const O of r.votes)n.Vote.encode(O,s.uint32(10).fork()).ldelim();return r.pagination!==void 0&&t.PageResponse.encode(r.pagination,s.uint32(18).fork()).ldelim(),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=p();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.votes.push(n.Vote.decode(O,O.uint32()));break;case 2:d.pagination=t.PageResponse.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=p();return Array.isArray(r==null?void 0:r.votes)&&(s.votes=r.votes.map(O=>n.Vote.fromJSON(O))),(0,o.isSet)(r.pagination)&&(s.pagination=t.PageResponse.fromJSON(r.pagination)),s},toJSON(r){const s={};return r.votes?s.votes=r.votes.map(O=>O?n.Vote.toJSON(O):void 0):s.votes=[],r.pagination!==void 0&&(s.pagination=r.pagination?t.PageResponse.toJSON(r.pagination):void 0),s},fromPartial(r){var O;const s=p();return s.votes=((O=r.votes)==null?void 0:O.map(q=>n.Vote.fromPartial(q)))||[],r.pagination!==void 0&&r.pagination!==null&&(s.pagination=t.PageResponse.fromPartial(r.pagination)),s}};function S(){return{paramsType:""}}e.QueryParamsRequest={typeUrl:"/cosmos.gov.v1beta1.QueryParamsRequest",encode(r,s=i.BinaryWriter.create()){return r.paramsType!==""&&s.uint32(10).string(r.paramsType),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=S();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.paramsType=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=S();return(0,o.isSet)(r.paramsType)&&(s.paramsType=String(r.paramsType)),s},toJSON(r){const s={};return r.paramsType!==void 0&&(s.paramsType=r.paramsType),s},fromPartial(r){const s=S();return s.paramsType=r.paramsType??"",s}};function R(){return{votingParams:n.VotingParams.fromPartial({}),depositParams:n.DepositParams.fromPartial({}),tallyParams:n.TallyParams.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.gov.v1beta1.QueryParamsResponse",encode(r,s=i.BinaryWriter.create()){return r.votingParams!==void 0&&n.VotingParams.encode(r.votingParams,s.uint32(10).fork()).ldelim(),r.depositParams!==void 0&&n.DepositParams.encode(r.depositParams,s.uint32(18).fork()).ldelim(),r.tallyParams!==void 0&&n.TallyParams.encode(r.tallyParams,s.uint32(26).fork()).ldelim(),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=R();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.votingParams=n.VotingParams.decode(O,O.uint32());break;case 2:d.depositParams=n.DepositParams.decode(O,O.uint32());break;case 3:d.tallyParams=n.TallyParams.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=R();return(0,o.isSet)(r.votingParams)&&(s.votingParams=n.VotingParams.fromJSON(r.votingParams)),(0,o.isSet)(r.depositParams)&&(s.depositParams=n.DepositParams.fromJSON(r.depositParams)),(0,o.isSet)(r.tallyParams)&&(s.tallyParams=n.TallyParams.fromJSON(r.tallyParams)),s},toJSON(r){const s={};return r.votingParams!==void 0&&(s.votingParams=r.votingParams?n.VotingParams.toJSON(r.votingParams):void 0),r.depositParams!==void 0&&(s.depositParams=r.depositParams?n.DepositParams.toJSON(r.depositParams):void 0),r.tallyParams!==void 0&&(s.tallyParams=r.tallyParams?n.TallyParams.toJSON(r.tallyParams):void 0),s},fromPartial(r){const s=R();return r.votingParams!==void 0&&r.votingParams!==null&&(s.votingParams=n.VotingParams.fromPartial(r.votingParams)),r.depositParams!==void 0&&r.depositParams!==null&&(s.depositParams=n.DepositParams.fromPartial(r.depositParams)),r.tallyParams!==void 0&&r.tallyParams!==null&&(s.tallyParams=n.TallyParams.fromPartial(r.tallyParams)),s}};function u(){return{proposalId:BigInt(0),depositor:""}}e.QueryDepositRequest={typeUrl:"/cosmos.gov.v1beta1.QueryDepositRequest",encode(r,s=i.BinaryWriter.create()){return r.proposalId!==BigInt(0)&&s.uint32(8).uint64(r.proposalId),r.depositor!==""&&s.uint32(18).string(r.depositor),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=u();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposalId=O.uint64();break;case 2:d.depositor=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=u();return(0,o.isSet)(r.proposalId)&&(s.proposalId=BigInt(r.proposalId.toString())),(0,o.isSet)(r.depositor)&&(s.depositor=String(r.depositor)),s},toJSON(r){const s={};return r.proposalId!==void 0&&(s.proposalId=(r.proposalId||BigInt(0)).toString()),r.depositor!==void 0&&(s.depositor=r.depositor),s},fromPartial(r){const s=u();return r.proposalId!==void 0&&r.proposalId!==null&&(s.proposalId=BigInt(r.proposalId.toString())),s.depositor=r.depositor??"",s}};function c(){return{deposit:n.Deposit.fromPartial({})}}e.QueryDepositResponse={typeUrl:"/cosmos.gov.v1beta1.QueryDepositResponse",encode(r,s=i.BinaryWriter.create()){return r.deposit!==void 0&&n.Deposit.encode(r.deposit,s.uint32(10).fork()).ldelim(),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=c();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.deposit=n.Deposit.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=c();return(0,o.isSet)(r.deposit)&&(s.deposit=n.Deposit.fromJSON(r.deposit)),s},toJSON(r){const s={};return r.deposit!==void 0&&(s.deposit=r.deposit?n.Deposit.toJSON(r.deposit):void 0),s},fromPartial(r){const s=c();return r.deposit!==void 0&&r.deposit!==null&&(s.deposit=n.Deposit.fromPartial(r.deposit)),s}};function y(){return{proposalId:BigInt(0),pagination:void 0}}e.QueryDepositsRequest={typeUrl:"/cosmos.gov.v1beta1.QueryDepositsRequest",encode(r,s=i.BinaryWriter.create()){return r.proposalId!==BigInt(0)&&s.uint32(8).uint64(r.proposalId),r.pagination!==void 0&&t.PageRequest.encode(r.pagination,s.uint32(18).fork()).ldelim(),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=y();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposalId=O.uint64();break;case 2:d.pagination=t.PageRequest.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=y();return(0,o.isSet)(r.proposalId)&&(s.proposalId=BigInt(r.proposalId.toString())),(0,o.isSet)(r.pagination)&&(s.pagination=t.PageRequest.fromJSON(r.pagination)),s},toJSON(r){const s={};return r.proposalId!==void 0&&(s.proposalId=(r.proposalId||BigInt(0)).toString()),r.pagination!==void 0&&(s.pagination=r.pagination?t.PageRequest.toJSON(r.pagination):void 0),s},fromPartial(r){const s=y();return r.proposalId!==void 0&&r.proposalId!==null&&(s.proposalId=BigInt(r.proposalId.toString())),r.pagination!==void 0&&r.pagination!==null&&(s.pagination=t.PageRequest.fromPartial(r.pagination)),s}};function B(){return{deposits:[],pagination:void 0}}e.QueryDepositsResponse={typeUrl:"/cosmos.gov.v1beta1.QueryDepositsResponse",encode(r,s=i.BinaryWriter.create()){for(const O of r.deposits)n.Deposit.encode(O,s.uint32(10).fork()).ldelim();return r.pagination!==void 0&&t.PageResponse.encode(r.pagination,s.uint32(18).fork()).ldelim(),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=B();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.deposits.push(n.Deposit.decode(O,O.uint32()));break;case 2:d.pagination=t.PageResponse.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=B();return Array.isArray(r==null?void 0:r.deposits)&&(s.deposits=r.deposits.map(O=>n.Deposit.fromJSON(O))),(0,o.isSet)(r.pagination)&&(s.pagination=t.PageResponse.fromJSON(r.pagination)),s},toJSON(r){const s={};return r.deposits?s.deposits=r.deposits.map(O=>O?n.Deposit.toJSON(O):void 0):s.deposits=[],r.pagination!==void 0&&(s.pagination=r.pagination?t.PageResponse.toJSON(r.pagination):void 0),s},fromPartial(r){var O;const s=B();return s.deposits=((O=r.deposits)==null?void 0:O.map(q=>n.Deposit.fromPartial(q)))||[],r.pagination!==void 0&&r.pagination!==null&&(s.pagination=t.PageResponse.fromPartial(r.pagination)),s}};function N(){return{proposalId:BigInt(0)}}e.QueryTallyResultRequest={typeUrl:"/cosmos.gov.v1beta1.QueryTallyResultRequest",encode(r,s=i.BinaryWriter.create()){return r.proposalId!==BigInt(0)&&s.uint32(8).uint64(r.proposalId),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=N();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.proposalId=O.uint64();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=N();return(0,o.isSet)(r.proposalId)&&(s.proposalId=BigInt(r.proposalId.toString())),s},toJSON(r){const s={};return r.proposalId!==void 0&&(s.proposalId=(r.proposalId||BigInt(0)).toString()),s},fromPartial(r){const s=N();return r.proposalId!==void 0&&r.proposalId!==null&&(s.proposalId=BigInt(r.proposalId.toString())),s}};function U(){return{tally:n.TallyResult.fromPartial({})}}e.QueryTallyResultResponse={typeUrl:"/cosmos.gov.v1beta1.QueryTallyResultResponse",encode(r,s=i.BinaryWriter.create()){return r.tally!==void 0&&n.TallyResult.encode(r.tally,s.uint32(10).fork()).ldelim(),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=U();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.tally=n.TallyResult.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=U();return(0,o.isSet)(r.tally)&&(s.tally=n.TallyResult.fromJSON(r.tally)),s},toJSON(r){const s={};return r.tally!==void 0&&(s.tally=r.tally?n.TallyResult.toJSON(r.tally):void 0),s},fromPartial(r){const s=U();return r.tally!==void 0&&r.tally!==null&&(s.tally=n.TallyResult.fromPartial(r.tally)),s}};class W{constructor(s){this.rpc=s,this.Proposal=this.Proposal.bind(this),this.Proposals=this.Proposals.bind(this),this.Vote=this.Vote.bind(this),this.Votes=this.Votes.bind(this),this.Params=this.Params.bind(this),this.Deposit=this.Deposit.bind(this),this.Deposits=this.Deposits.bind(this),this.TallyResult=this.TallyResult.bind(this)}Proposal(s){const O=e.QueryProposalRequest.encode(s).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Proposal",O).then(d=>e.QueryProposalResponse.decode(new i.BinaryReader(d)))}Proposals(s){const O=e.QueryProposalsRequest.encode(s).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Proposals",O).then(d=>e.QueryProposalsResponse.decode(new i.BinaryReader(d)))}Vote(s){const O=e.QueryVoteRequest.encode(s).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Vote",O).then(d=>e.QueryVoteResponse.decode(new i.BinaryReader(d)))}Votes(s){const O=e.QueryVotesRequest.encode(s).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Votes",O).then(d=>e.QueryVotesResponse.decode(new i.BinaryReader(d)))}Params(s){const O=e.QueryParamsRequest.encode(s).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Params",O).then(d=>e.QueryParamsResponse.decode(new i.BinaryReader(d)))}Deposit(s){const O=e.QueryDepositRequest.encode(s).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Deposit",O).then(d=>e.QueryDepositResponse.decode(new i.BinaryReader(d)))}Deposits(s){const O=e.QueryDepositsRequest.encode(s).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Deposits",O).then(d=>e.QueryDepositsResponse.decode(new i.BinaryReader(d)))}TallyResult(s){const O=e.QueryTallyResultRequest.encode(s).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","TallyResult",O).then(d=>e.QueryTallyResultResponse.decode(new i.BinaryReader(d)))}}e.QueryClientImpl=W})(Pc);Object.defineProperty(fs,"__esModule",{value:!0});fs.setupGovExtension=void 0;const xk=Pc,Zn=ze;function zk(e){const n=(0,Zn.createProtobufRpcClient)(e),t=new xk.QueryClientImpl(n);return{gov:{params:async i=>await t.Params({paramsType:i}),proposals:async(i,o,g,C)=>await t.Proposals({proposalStatus:i,depositor:o,voter:g,pagination:(0,Zn.createPagination)(C)}),proposal:async i=>await t.Proposal({proposalId:(0,Zn.longify)(i)}),deposits:async(i,o)=>await t.Deposits({proposalId:(0,Zn.longify)(i),pagination:(0,Zn.createPagination)(o)}),deposit:async(i,o)=>await t.Deposit({proposalId:(0,Zn.longify)(i),depositor:o}),tally:async i=>await t.TallyResult({proposalId:(0,Zn.longify)(i)}),votes:async(i,o)=>await t.Votes({proposalId:(0,Zn.longify)(i),pagination:(0,Zn.createPagination)(o)}),vote:async(i,o)=>await t.Vote({proposalId:(0,Zn.longify)(i),voter:o})}}}fs.setupGovExtension=zk;var ps={};Object.defineProperty(ps,"__esModule",{value:!0});ps.createGroupAminoConverters=void 0;function Yk(){return{}}ps.createGroupAminoConverters=Yk;var ms={},vc={},ym={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Vote=e.TallyResult=e.Proposal=e.GroupPolicyInfo=e.GroupMember=e.GroupInfo=e.DecisionPolicyWindows=e.PercentageDecisionPolicy=e.ThresholdDecisionPolicy=e.MemberRequest=e.Member=e.proposalExecutorResultToJSON=e.proposalExecutorResultFromJSON=e.ProposalExecutorResult=e.proposalStatusToJSON=e.proposalStatusFromJSON=e.ProposalStatus=e.voteOptionToJSON=e.voteOptionFromJSON=e.VoteOption=e.protobufPackage=void 0;const n=Je,t=yn,i=_.any,o=_.binary,g=_.helpers;e.protobufPackage="cosmos.group.v1";var C;(function(d){d[d.VOTE_OPTION_UNSPECIFIED=0]="VOTE_OPTION_UNSPECIFIED",d[d.VOTE_OPTION_YES=1]="VOTE_OPTION_YES",d[d.VOTE_OPTION_ABSTAIN=2]="VOTE_OPTION_ABSTAIN",d[d.VOTE_OPTION_NO=3]="VOTE_OPTION_NO",d[d.VOTE_OPTION_NO_WITH_VETO=4]="VOTE_OPTION_NO_WITH_VETO",d[d.UNRECOGNIZED=-1]="UNRECOGNIZED"})(C||(e.VoteOption=C={}));function w(d){switch(d){case 0:case"VOTE_OPTION_UNSPECIFIED":return C.VOTE_OPTION_UNSPECIFIED;case 1:case"VOTE_OPTION_YES":return C.VOTE_OPTION_YES;case 2:case"VOTE_OPTION_ABSTAIN":return C.VOTE_OPTION_ABSTAIN;case 3:case"VOTE_OPTION_NO":return C.VOTE_OPTION_NO;case 4:case"VOTE_OPTION_NO_WITH_VETO":return C.VOTE_OPTION_NO_WITH_VETO;case-1:case"UNRECOGNIZED":default:return C.UNRECOGNIZED}}e.voteOptionFromJSON=w;function E(d){switch(d){case C.VOTE_OPTION_UNSPECIFIED:return"VOTE_OPTION_UNSPECIFIED";case C.VOTE_OPTION_YES:return"VOTE_OPTION_YES";case C.VOTE_OPTION_ABSTAIN:return"VOTE_OPTION_ABSTAIN";case C.VOTE_OPTION_NO:return"VOTE_OPTION_NO";case C.VOTE_OPTION_NO_WITH_VETO:return"VOTE_OPTION_NO_WITH_VETO";case C.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.voteOptionToJSON=E;var D;(function(d){d[d.PROPOSAL_STATUS_UNSPECIFIED=0]="PROPOSAL_STATUS_UNSPECIFIED",d[d.PROPOSAL_STATUS_SUBMITTED=1]="PROPOSAL_STATUS_SUBMITTED",d[d.PROPOSAL_STATUS_ACCEPTED=2]="PROPOSAL_STATUS_ACCEPTED",d[d.PROPOSAL_STATUS_REJECTED=3]="PROPOSAL_STATUS_REJECTED",d[d.PROPOSAL_STATUS_ABORTED=4]="PROPOSAL_STATUS_ABORTED",d[d.PROPOSAL_STATUS_WITHDRAWN=5]="PROPOSAL_STATUS_WITHDRAWN",d[d.UNRECOGNIZED=-1]="UNRECOGNIZED"})(D||(e.ProposalStatus=D={}));function J(d){switch(d){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return D.PROPOSAL_STATUS_UNSPECIFIED;case 1:case"PROPOSAL_STATUS_SUBMITTED":return D.PROPOSAL_STATUS_SUBMITTED;case 2:case"PROPOSAL_STATUS_ACCEPTED":return D.PROPOSAL_STATUS_ACCEPTED;case 3:case"PROPOSAL_STATUS_REJECTED":return D.PROPOSAL_STATUS_REJECTED;case 4:case"PROPOSAL_STATUS_ABORTED":return D.PROPOSAL_STATUS_ABORTED;case 5:case"PROPOSAL_STATUS_WITHDRAWN":return D.PROPOSAL_STATUS_WITHDRAWN;case-1:case"UNRECOGNIZED":default:return D.UNRECOGNIZED}}e.proposalStatusFromJSON=J;function b(d){switch(d){case D.PROPOSAL_STATUS_UNSPECIFIED:return"PROPOSAL_STATUS_UNSPECIFIED";case D.PROPOSAL_STATUS_SUBMITTED:return"PROPOSAL_STATUS_SUBMITTED";case D.PROPOSAL_STATUS_ACCEPTED:return"PROPOSAL_STATUS_ACCEPTED";case D.PROPOSAL_STATUS_REJECTED:return"PROPOSAL_STATUS_REJECTED";case D.PROPOSAL_STATUS_ABORTED:return"PROPOSAL_STATUS_ABORTED";case D.PROPOSAL_STATUS_WITHDRAWN:return"PROPOSAL_STATUS_WITHDRAWN";case D.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.proposalStatusToJSON=b;var p;(function(d){d[d.PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED=0]="PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED",d[d.PROPOSAL_EXECUTOR_RESULT_NOT_RUN=1]="PROPOSAL_EXECUTOR_RESULT_NOT_RUN",d[d.PROPOSAL_EXECUTOR_RESULT_SUCCESS=2]="PROPOSAL_EXECUTOR_RESULT_SUCCESS",d[d.PROPOSAL_EXECUTOR_RESULT_FAILURE=3]="PROPOSAL_EXECUTOR_RESULT_FAILURE",d[d.UNRECOGNIZED=-1]="UNRECOGNIZED"})(p||(e.ProposalExecutorResult=p={}));function S(d){switch(d){case 0:case"PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED":return p.PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED;case 1:case"PROPOSAL_EXECUTOR_RESULT_NOT_RUN":return p.PROPOSAL_EXECUTOR_RESULT_NOT_RUN;case 2:case"PROPOSAL_EXECUTOR_RESULT_SUCCESS":return p.PROPOSAL_EXECUTOR_RESULT_SUCCESS;case 3:case"PROPOSAL_EXECUTOR_RESULT_FAILURE":return p.PROPOSAL_EXECUTOR_RESULT_FAILURE;case-1:case"UNRECOGNIZED":default:return p.UNRECOGNIZED}}e.proposalExecutorResultFromJSON=S;function R(d){switch(d){case p.PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED:return"PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED";case p.PROPOSAL_EXECUTOR_RESULT_NOT_RUN:return"PROPOSAL_EXECUTOR_RESULT_NOT_RUN";case p.PROPOSAL_EXECUTOR_RESULT_SUCCESS:return"PROPOSAL_EXECUTOR_RESULT_SUCCESS";case p.PROPOSAL_EXECUTOR_RESULT_FAILURE:return"PROPOSAL_EXECUTOR_RESULT_FAILURE";case p.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.proposalExecutorResultToJSON=R;function u(){return{address:"",weight:"",metadata:"",addedAt:n.Timestamp.fromPartial({})}}e.Member={typeUrl:"/cosmos.group.v1.Member",encode(d,l=o.BinaryWriter.create()){return d.address!==""&&l.uint32(10).string(d.address),d.weight!==""&&l.uint32(18).string(d.weight),d.metadata!==""&&l.uint32(26).string(d.metadata),d.addedAt!==void 0&&n.Timestamp.encode(d.addedAt,l.uint32(34).fork()).ldelim(),l},decode(d,l){const M=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=u();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.address=M.string();break;case 2:h.weight=M.string();break;case 3:h.metadata=M.string();break;case 4:h.addedAt=n.Timestamp.decode(M,M.uint32());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=u();return(0,g.isSet)(d.address)&&(l.address=String(d.address)),(0,g.isSet)(d.weight)&&(l.weight=String(d.weight)),(0,g.isSet)(d.metadata)&&(l.metadata=String(d.metadata)),(0,g.isSet)(d.addedAt)&&(l.addedAt=(0,g.fromJsonTimestamp)(d.addedAt)),l},toJSON(d){const l={};return d.address!==void 0&&(l.address=d.address),d.weight!==void 0&&(l.weight=d.weight),d.metadata!==void 0&&(l.metadata=d.metadata),d.addedAt!==void 0&&(l.addedAt=(0,g.fromTimestamp)(d.addedAt).toISOString()),l},fromPartial(d){const l=u();return l.address=d.address??"",l.weight=d.weight??"",l.metadata=d.metadata??"",d.addedAt!==void 0&&d.addedAt!==null&&(l.addedAt=n.Timestamp.fromPartial(d.addedAt)),l}};function c(){return{address:"",weight:"",metadata:""}}e.MemberRequest={typeUrl:"/cosmos.group.v1.MemberRequest",encode(d,l=o.BinaryWriter.create()){return d.address!==""&&l.uint32(10).string(d.address),d.weight!==""&&l.uint32(18).string(d.weight),d.metadata!==""&&l.uint32(26).string(d.metadata),l},decode(d,l){const M=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=c();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.address=M.string();break;case 2:h.weight=M.string();break;case 3:h.metadata=M.string();break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=c();return(0,g.isSet)(d.address)&&(l.address=String(d.address)),(0,g.isSet)(d.weight)&&(l.weight=String(d.weight)),(0,g.isSet)(d.metadata)&&(l.metadata=String(d.metadata)),l},toJSON(d){const l={};return d.address!==void 0&&(l.address=d.address),d.weight!==void 0&&(l.weight=d.weight),d.metadata!==void 0&&(l.metadata=d.metadata),l},fromPartial(d){const l=c();return l.address=d.address??"",l.weight=d.weight??"",l.metadata=d.metadata??"",l}};function y(){return{threshold:"",windows:void 0}}e.ThresholdDecisionPolicy={typeUrl:"/cosmos.group.v1.ThresholdDecisionPolicy",encode(d,l=o.BinaryWriter.create()){return d.threshold!==""&&l.uint32(10).string(d.threshold),d.windows!==void 0&&e.DecisionPolicyWindows.encode(d.windows,l.uint32(18).fork()).ldelim(),l},decode(d,l){const M=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=y();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.threshold=M.string();break;case 2:h.windows=e.DecisionPolicyWindows.decode(M,M.uint32());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=y();return(0,g.isSet)(d.threshold)&&(l.threshold=String(d.threshold)),(0,g.isSet)(d.windows)&&(l.windows=e.DecisionPolicyWindows.fromJSON(d.windows)),l},toJSON(d){const l={};return d.threshold!==void 0&&(l.threshold=d.threshold),d.windows!==void 0&&(l.windows=d.windows?e.DecisionPolicyWindows.toJSON(d.windows):void 0),l},fromPartial(d){const l=y();return l.threshold=d.threshold??"",d.windows!==void 0&&d.windows!==null&&(l.windows=e.DecisionPolicyWindows.fromPartial(d.windows)),l}};function B(){return{percentage:"",windows:void 0}}e.PercentageDecisionPolicy={typeUrl:"/cosmos.group.v1.PercentageDecisionPolicy",encode(d,l=o.BinaryWriter.create()){return d.percentage!==""&&l.uint32(10).string(d.percentage),d.windows!==void 0&&e.DecisionPolicyWindows.encode(d.windows,l.uint32(18).fork()).ldelim(),l},decode(d,l){const M=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=B();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.percentage=M.string();break;case 2:h.windows=e.DecisionPolicyWindows.decode(M,M.uint32());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=B();return(0,g.isSet)(d.percentage)&&(l.percentage=String(d.percentage)),(0,g.isSet)(d.windows)&&(l.windows=e.DecisionPolicyWindows.fromJSON(d.windows)),l},toJSON(d){const l={};return d.percentage!==void 0&&(l.percentage=d.percentage),d.windows!==void 0&&(l.windows=d.windows?e.DecisionPolicyWindows.toJSON(d.windows):void 0),l},fromPartial(d){const l=B();return l.percentage=d.percentage??"",d.windows!==void 0&&d.windows!==null&&(l.windows=e.DecisionPolicyWindows.fromPartial(d.windows)),l}};function N(){return{votingPeriod:t.Duration.fromPartial({}),minExecutionPeriod:t.Duration.fromPartial({})}}e.DecisionPolicyWindows={typeUrl:"/cosmos.group.v1.DecisionPolicyWindows",encode(d,l=o.BinaryWriter.create()){return d.votingPeriod!==void 0&&t.Duration.encode(d.votingPeriod,l.uint32(10).fork()).ldelim(),d.minExecutionPeriod!==void 0&&t.Duration.encode(d.minExecutionPeriod,l.uint32(18).fork()).ldelim(),l},decode(d,l){const M=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=N();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.votingPeriod=t.Duration.decode(M,M.uint32());break;case 2:h.minExecutionPeriod=t.Duration.decode(M,M.uint32());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=N();return(0,g.isSet)(d.votingPeriod)&&(l.votingPeriod=t.Duration.fromJSON(d.votingPeriod)),(0,g.isSet)(d.minExecutionPeriod)&&(l.minExecutionPeriod=t.Duration.fromJSON(d.minExecutionPeriod)),l},toJSON(d){const l={};return d.votingPeriod!==void 0&&(l.votingPeriod=d.votingPeriod?t.Duration.toJSON(d.votingPeriod):void 0),d.minExecutionPeriod!==void 0&&(l.minExecutionPeriod=d.minExecutionPeriod?t.Duration.toJSON(d.minExecutionPeriod):void 0),l},fromPartial(d){const l=N();return d.votingPeriod!==void 0&&d.votingPeriod!==null&&(l.votingPeriod=t.Duration.fromPartial(d.votingPeriod)),d.minExecutionPeriod!==void 0&&d.minExecutionPeriod!==null&&(l.minExecutionPeriod=t.Duration.fromPartial(d.minExecutionPeriod)),l}};function U(){return{id:BigInt(0),admin:"",metadata:"",version:BigInt(0),totalWeight:"",createdAt:n.Timestamp.fromPartial({})}}e.GroupInfo={typeUrl:"/cosmos.group.v1.GroupInfo",encode(d,l=o.BinaryWriter.create()){return d.id!==BigInt(0)&&l.uint32(8).uint64(d.id),d.admin!==""&&l.uint32(18).string(d.admin),d.metadata!==""&&l.uint32(26).string(d.metadata),d.version!==BigInt(0)&&l.uint32(32).uint64(d.version),d.totalWeight!==""&&l.uint32(42).string(d.totalWeight),d.createdAt!==void 0&&n.Timestamp.encode(d.createdAt,l.uint32(50).fork()).ldelim(),l},decode(d,l){const M=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=U();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.id=M.uint64();break;case 2:h.admin=M.string();break;case 3:h.metadata=M.string();break;case 4:h.version=M.uint64();break;case 5:h.totalWeight=M.string();break;case 6:h.createdAt=n.Timestamp.decode(M,M.uint32());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=U();return(0,g.isSet)(d.id)&&(l.id=BigInt(d.id.toString())),(0,g.isSet)(d.admin)&&(l.admin=String(d.admin)),(0,g.isSet)(d.metadata)&&(l.metadata=String(d.metadata)),(0,g.isSet)(d.version)&&(l.version=BigInt(d.version.toString())),(0,g.isSet)(d.totalWeight)&&(l.totalWeight=String(d.totalWeight)),(0,g.isSet)(d.createdAt)&&(l.createdAt=(0,g.fromJsonTimestamp)(d.createdAt)),l},toJSON(d){const l={};return d.id!==void 0&&(l.id=(d.id||BigInt(0)).toString()),d.admin!==void 0&&(l.admin=d.admin),d.metadata!==void 0&&(l.metadata=d.metadata),d.version!==void 0&&(l.version=(d.version||BigInt(0)).toString()),d.totalWeight!==void 0&&(l.totalWeight=d.totalWeight),d.createdAt!==void 0&&(l.createdAt=(0,g.fromTimestamp)(d.createdAt).toISOString()),l},fromPartial(d){const l=U();return d.id!==void 0&&d.id!==null&&(l.id=BigInt(d.id.toString())),l.admin=d.admin??"",l.metadata=d.metadata??"",d.version!==void 0&&d.version!==null&&(l.version=BigInt(d.version.toString())),l.totalWeight=d.totalWeight??"",d.createdAt!==void 0&&d.createdAt!==null&&(l.createdAt=n.Timestamp.fromPartial(d.createdAt)),l}};function W(){return{groupId:BigInt(0),member:void 0}}e.GroupMember={typeUrl:"/cosmos.group.v1.GroupMember",encode(d,l=o.BinaryWriter.create()){return d.groupId!==BigInt(0)&&l.uint32(8).uint64(d.groupId),d.member!==void 0&&e.Member.encode(d.member,l.uint32(18).fork()).ldelim(),l},decode(d,l){const M=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=W();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.groupId=M.uint64();break;case 2:h.member=e.Member.decode(M,M.uint32());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=W();return(0,g.isSet)(d.groupId)&&(l.groupId=BigInt(d.groupId.toString())),(0,g.isSet)(d.member)&&(l.member=e.Member.fromJSON(d.member)),l},toJSON(d){const l={};return d.groupId!==void 0&&(l.groupId=(d.groupId||BigInt(0)).toString()),d.member!==void 0&&(l.member=d.member?e.Member.toJSON(d.member):void 0),l},fromPartial(d){const l=W();return d.groupId!==void 0&&d.groupId!==null&&(l.groupId=BigInt(d.groupId.toString())),d.member!==void 0&&d.member!==null&&(l.member=e.Member.fromPartial(d.member)),l}};function r(){return{address:"",groupId:BigInt(0),admin:"",metadata:"",version:BigInt(0),decisionPolicy:void 0,createdAt:n.Timestamp.fromPartial({})}}e.GroupPolicyInfo={typeUrl:"/cosmos.group.v1.GroupPolicyInfo",encode(d,l=o.BinaryWriter.create()){return d.address!==""&&l.uint32(10).string(d.address),d.groupId!==BigInt(0)&&l.uint32(16).uint64(d.groupId),d.admin!==""&&l.uint32(26).string(d.admin),d.metadata!==""&&l.uint32(34).string(d.metadata),d.version!==BigInt(0)&&l.uint32(40).uint64(d.version),d.decisionPolicy!==void 0&&i.Any.encode(d.decisionPolicy,l.uint32(50).fork()).ldelim(),d.createdAt!==void 0&&n.Timestamp.encode(d.createdAt,l.uint32(58).fork()).ldelim(),l},decode(d,l){const M=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=r();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.address=M.string();break;case 2:h.groupId=M.uint64();break;case 3:h.admin=M.string();break;case 4:h.metadata=M.string();break;case 5:h.version=M.uint64();break;case 6:h.decisionPolicy=i.Any.decode(M,M.uint32());break;case 7:h.createdAt=n.Timestamp.decode(M,M.uint32());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=r();return(0,g.isSet)(d.address)&&(l.address=String(d.address)),(0,g.isSet)(d.groupId)&&(l.groupId=BigInt(d.groupId.toString())),(0,g.isSet)(d.admin)&&(l.admin=String(d.admin)),(0,g.isSet)(d.metadata)&&(l.metadata=String(d.metadata)),(0,g.isSet)(d.version)&&(l.version=BigInt(d.version.toString())),(0,g.isSet)(d.decisionPolicy)&&(l.decisionPolicy=i.Any.fromJSON(d.decisionPolicy)),(0,g.isSet)(d.createdAt)&&(l.createdAt=(0,g.fromJsonTimestamp)(d.createdAt)),l},toJSON(d){const l={};return d.address!==void 0&&(l.address=d.address),d.groupId!==void 0&&(l.groupId=(d.groupId||BigInt(0)).toString()),d.admin!==void 0&&(l.admin=d.admin),d.metadata!==void 0&&(l.metadata=d.metadata),d.version!==void 0&&(l.version=(d.version||BigInt(0)).toString()),d.decisionPolicy!==void 0&&(l.decisionPolicy=d.decisionPolicy?i.Any.toJSON(d.decisionPolicy):void 0),d.createdAt!==void 0&&(l.createdAt=(0,g.fromTimestamp)(d.createdAt).toISOString()),l},fromPartial(d){const l=r();return l.address=d.address??"",d.groupId!==void 0&&d.groupId!==null&&(l.groupId=BigInt(d.groupId.toString())),l.admin=d.admin??"",l.metadata=d.metadata??"",d.version!==void 0&&d.version!==null&&(l.version=BigInt(d.version.toString())),d.decisionPolicy!==void 0&&d.decisionPolicy!==null&&(l.decisionPolicy=i.Any.fromPartial(d.decisionPolicy)),d.createdAt!==void 0&&d.createdAt!==null&&(l.createdAt=n.Timestamp.fromPartial(d.createdAt)),l}};function s(){return{id:BigInt(0),groupPolicyAddress:"",metadata:"",proposers:[],submitTime:n.Timestamp.fromPartial({}),groupVersion:BigInt(0),groupPolicyVersion:BigInt(0),status:0,finalTallyResult:e.TallyResult.fromPartial({}),votingPeriodEnd:n.Timestamp.fromPartial({}),executorResult:0,messages:[],title:"",summary:""}}e.Proposal={typeUrl:"/cosmos.group.v1.Proposal",encode(d,l=o.BinaryWriter.create()){d.id!==BigInt(0)&&l.uint32(8).uint64(d.id),d.groupPolicyAddress!==""&&l.uint32(18).string(d.groupPolicyAddress),d.metadata!==""&&l.uint32(26).string(d.metadata);for(const M of d.proposers)l.uint32(34).string(M);d.submitTime!==void 0&&n.Timestamp.encode(d.submitTime,l.uint32(42).fork()).ldelim(),d.groupVersion!==BigInt(0)&&l.uint32(48).uint64(d.groupVersion),d.groupPolicyVersion!==BigInt(0)&&l.uint32(56).uint64(d.groupPolicyVersion),d.status!==0&&l.uint32(64).int32(d.status),d.finalTallyResult!==void 0&&e.TallyResult.encode(d.finalTallyResult,l.uint32(74).fork()).ldelim(),d.votingPeriodEnd!==void 0&&n.Timestamp.encode(d.votingPeriodEnd,l.uint32(82).fork()).ldelim(),d.executorResult!==0&&l.uint32(88).int32(d.executorResult);for(const M of d.messages)i.Any.encode(M,l.uint32(98).fork()).ldelim();return d.title!==""&&l.uint32(106).string(d.title),d.summary!==""&&l.uint32(114).string(d.summary),l},decode(d,l){const M=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=s();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.id=M.uint64();break;case 2:h.groupPolicyAddress=M.string();break;case 3:h.metadata=M.string();break;case 4:h.proposers.push(M.string());break;case 5:h.submitTime=n.Timestamp.decode(M,M.uint32());break;case 6:h.groupVersion=M.uint64();break;case 7:h.groupPolicyVersion=M.uint64();break;case 8:h.status=M.int32();break;case 9:h.finalTallyResult=e.TallyResult.decode(M,M.uint32());break;case 10:h.votingPeriodEnd=n.Timestamp.decode(M,M.uint32());break;case 11:h.executorResult=M.int32();break;case 12:h.messages.push(i.Any.decode(M,M.uint32()));break;case 13:h.title=M.string();break;case 14:h.summary=M.string();break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=s();return(0,g.isSet)(d.id)&&(l.id=BigInt(d.id.toString())),(0,g.isSet)(d.groupPolicyAddress)&&(l.groupPolicyAddress=String(d.groupPolicyAddress)),(0,g.isSet)(d.metadata)&&(l.metadata=String(d.metadata)),Array.isArray(d==null?void 0:d.proposers)&&(l.proposers=d.proposers.map(M=>String(M))),(0,g.isSet)(d.submitTime)&&(l.submitTime=(0,g.fromJsonTimestamp)(d.submitTime)),(0,g.isSet)(d.groupVersion)&&(l.groupVersion=BigInt(d.groupVersion.toString())),(0,g.isSet)(d.groupPolicyVersion)&&(l.groupPolicyVersion=BigInt(d.groupPolicyVersion.toString())),(0,g.isSet)(d.status)&&(l.status=J(d.status)),(0,g.isSet)(d.finalTallyResult)&&(l.finalTallyResult=e.TallyResult.fromJSON(d.finalTallyResult)),(0,g.isSet)(d.votingPeriodEnd)&&(l.votingPeriodEnd=(0,g.fromJsonTimestamp)(d.votingPeriodEnd)),(0,g.isSet)(d.executorResult)&&(l.executorResult=S(d.executorResult)),Array.isArray(d==null?void 0:d.messages)&&(l.messages=d.messages.map(M=>i.Any.fromJSON(M))),(0,g.isSet)(d.title)&&(l.title=String(d.title)),(0,g.isSet)(d.summary)&&(l.summary=String(d.summary)),l},toJSON(d){const l={};return d.id!==void 0&&(l.id=(d.id||BigInt(0)).toString()),d.groupPolicyAddress!==void 0&&(l.groupPolicyAddress=d.groupPolicyAddress),d.metadata!==void 0&&(l.metadata=d.metadata),d.proposers?l.proposers=d.proposers.map(M=>M):l.proposers=[],d.submitTime!==void 0&&(l.submitTime=(0,g.fromTimestamp)(d.submitTime).toISOString()),d.groupVersion!==void 0&&(l.groupVersion=(d.groupVersion||BigInt(0)).toString()),d.groupPolicyVersion!==void 0&&(l.groupPolicyVersion=(d.groupPolicyVersion||BigInt(0)).toString()),d.status!==void 0&&(l.status=b(d.status)),d.finalTallyResult!==void 0&&(l.finalTallyResult=d.finalTallyResult?e.TallyResult.toJSON(d.finalTallyResult):void 0),d.votingPeriodEnd!==void 0&&(l.votingPeriodEnd=(0,g.fromTimestamp)(d.votingPeriodEnd).toISOString()),d.executorResult!==void 0&&(l.executorResult=R(d.executorResult)),d.messages?l.messages=d.messages.map(M=>M?i.Any.toJSON(M):void 0):l.messages=[],d.title!==void 0&&(l.title=d.title),d.summary!==void 0&&(l.summary=d.summary),l},fromPartial(d){var M,m;const l=s();return d.id!==void 0&&d.id!==null&&(l.id=BigInt(d.id.toString())),l.groupPolicyAddress=d.groupPolicyAddress??"",l.metadata=d.metadata??"",l.proposers=((M=d.proposers)==null?void 0:M.map(h=>h))||[],d.submitTime!==void 0&&d.submitTime!==null&&(l.submitTime=n.Timestamp.fromPartial(d.submitTime)),d.groupVersion!==void 0&&d.groupVersion!==null&&(l.groupVersion=BigInt(d.groupVersion.toString())),d.groupPolicyVersion!==void 0&&d.groupPolicyVersion!==null&&(l.groupPolicyVersion=BigInt(d.groupPolicyVersion.toString())),l.status=d.status??0,d.finalTallyResult!==void 0&&d.finalTallyResult!==null&&(l.finalTallyResult=e.TallyResult.fromPartial(d.finalTallyResult)),d.votingPeriodEnd!==void 0&&d.votingPeriodEnd!==null&&(l.votingPeriodEnd=n.Timestamp.fromPartial(d.votingPeriodEnd)),l.executorResult=d.executorResult??0,l.messages=((m=d.messages)==null?void 0:m.map(h=>i.Any.fromPartial(h)))||[],l.title=d.title??"",l.summary=d.summary??"",l}};function O(){return{yesCount:"",abstainCount:"",noCount:"",noWithVetoCount:""}}e.TallyResult={typeUrl:"/cosmos.group.v1.TallyResult",encode(d,l=o.BinaryWriter.create()){return d.yesCount!==""&&l.uint32(10).string(d.yesCount),d.abstainCount!==""&&l.uint32(18).string(d.abstainCount),d.noCount!==""&&l.uint32(26).string(d.noCount),d.noWithVetoCount!==""&&l.uint32(34).string(d.noWithVetoCount),l},decode(d,l){const M=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=O();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.yesCount=M.string();break;case 2:h.abstainCount=M.string();break;case 3:h.noCount=M.string();break;case 4:h.noWithVetoCount=M.string();break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=O();return(0,g.isSet)(d.yesCount)&&(l.yesCount=String(d.yesCount)),(0,g.isSet)(d.abstainCount)&&(l.abstainCount=String(d.abstainCount)),(0,g.isSet)(d.noCount)&&(l.noCount=String(d.noCount)),(0,g.isSet)(d.noWithVetoCount)&&(l.noWithVetoCount=String(d.noWithVetoCount)),l},toJSON(d){const l={};return d.yesCount!==void 0&&(l.yesCount=d.yesCount),d.abstainCount!==void 0&&(l.abstainCount=d.abstainCount),d.noCount!==void 0&&(l.noCount=d.noCount),d.noWithVetoCount!==void 0&&(l.noWithVetoCount=d.noWithVetoCount),l},fromPartial(d){const l=O();return l.yesCount=d.yesCount??"",l.abstainCount=d.abstainCount??"",l.noCount=d.noCount??"",l.noWithVetoCount=d.noWithVetoCount??"",l}};function q(){return{proposalId:BigInt(0),voter:"",option:0,metadata:"",submitTime:n.Timestamp.fromPartial({})}}e.Vote={typeUrl:"/cosmos.group.v1.Vote",encode(d,l=o.BinaryWriter.create()){return d.proposalId!==BigInt(0)&&l.uint32(8).uint64(d.proposalId),d.voter!==""&&l.uint32(18).string(d.voter),d.option!==0&&l.uint32(24).int32(d.option),d.metadata!==""&&l.uint32(34).string(d.metadata),d.submitTime!==void 0&&n.Timestamp.encode(d.submitTime,l.uint32(42).fork()).ldelim(),l},decode(d,l){const M=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=q();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.proposalId=M.uint64();break;case 2:h.voter=M.string();break;case 3:h.option=M.int32();break;case 4:h.metadata=M.string();break;case 5:h.submitTime=n.Timestamp.decode(M,M.uint32());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=q();return(0,g.isSet)(d.proposalId)&&(l.proposalId=BigInt(d.proposalId.toString())),(0,g.isSet)(d.voter)&&(l.voter=String(d.voter)),(0,g.isSet)(d.option)&&(l.option=w(d.option)),(0,g.isSet)(d.metadata)&&(l.metadata=String(d.metadata)),(0,g.isSet)(d.submitTime)&&(l.submitTime=(0,g.fromJsonTimestamp)(d.submitTime)),l},toJSON(d){const l={};return d.proposalId!==void 0&&(l.proposalId=(d.proposalId||BigInt(0)).toString()),d.voter!==void 0&&(l.voter=d.voter),d.option!==void 0&&(l.option=E(d.option)),d.metadata!==void 0&&(l.metadata=d.metadata),d.submitTime!==void 0&&(l.submitTime=(0,g.fromTimestamp)(d.submitTime).toISOString()),l},fromPartial(d){const l=q();return d.proposalId!==void 0&&d.proposalId!==null&&(l.proposalId=BigInt(d.proposalId.toString())),l.voter=d.voter??"",l.option=d.option??0,l.metadata=d.metadata??"",d.submitTime!==void 0&&d.submitTime!==null&&(l.submitTime=n.Timestamp.fromPartial(d.submitTime)),l}}})(ym);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgLeaveGroupResponse=e.MsgLeaveGroup=e.MsgExecResponse=e.MsgExec=e.MsgVoteResponse=e.MsgVote=e.MsgWithdrawProposalResponse=e.MsgWithdrawProposal=e.MsgSubmitProposalResponse=e.MsgSubmitProposal=e.MsgUpdateGroupPolicyMetadataResponse=e.MsgUpdateGroupPolicyMetadata=e.MsgUpdateGroupPolicyDecisionPolicyResponse=e.MsgUpdateGroupPolicyDecisionPolicy=e.MsgCreateGroupWithPolicyResponse=e.MsgCreateGroupWithPolicy=e.MsgUpdateGroupPolicyAdminResponse=e.MsgUpdateGroupPolicyAdmin=e.MsgCreateGroupPolicyResponse=e.MsgCreateGroupPolicy=e.MsgUpdateGroupMetadataResponse=e.MsgUpdateGroupMetadata=e.MsgUpdateGroupAdminResponse=e.MsgUpdateGroupAdmin=e.MsgUpdateGroupMembersResponse=e.MsgUpdateGroupMembers=e.MsgCreateGroupResponse=e.MsgCreateGroup=e.execToJSON=e.execFromJSON=e.Exec=e.protobufPackage=void 0;const n=ym,t=_.any,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.group.v1";var g;(function(v){v[v.EXEC_UNSPECIFIED=0]="EXEC_UNSPECIFIED",v[v.EXEC_TRY=1]="EXEC_TRY",v[v.UNRECOGNIZED=-1]="UNRECOGNIZED"})(g||(e.Exec=g={}));function C(v){switch(v){case 0:case"EXEC_UNSPECIFIED":return g.EXEC_UNSPECIFIED;case 1:case"EXEC_TRY":return g.EXEC_TRY;case-1:case"UNRECOGNIZED":default:return g.UNRECOGNIZED}}e.execFromJSON=C;function w(v){switch(v){case g.EXEC_UNSPECIFIED:return"EXEC_UNSPECIFIED";case g.EXEC_TRY:return"EXEC_TRY";case g.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.execToJSON=w;function E(){return{admin:"",members:[],metadata:""}}e.MsgCreateGroup={typeUrl:"/cosmos.group.v1.MsgCreateGroup",encode(v,A=i.BinaryWriter.create()){v.admin!==""&&A.uint32(10).string(v.admin);for(const F of v.members)n.MemberRequest.encode(F,A.uint32(18).fork()).ldelim();return v.metadata!==""&&A.uint32(26).string(v.metadata),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=E();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.admin=F.string();break;case 2:$.members.push(n.MemberRequest.decode(F,F.uint32()));break;case 3:$.metadata=F.string();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=E();return(0,o.isSet)(v.admin)&&(A.admin=String(v.admin)),Array.isArray(v==null?void 0:v.members)&&(A.members=v.members.map(F=>n.MemberRequest.fromJSON(F))),(0,o.isSet)(v.metadata)&&(A.metadata=String(v.metadata)),A},toJSON(v){const A={};return v.admin!==void 0&&(A.admin=v.admin),v.members?A.members=v.members.map(F=>F?n.MemberRequest.toJSON(F):void 0):A.members=[],v.metadata!==void 0&&(A.metadata=v.metadata),A},fromPartial(v){var F;const A=E();return A.admin=v.admin??"",A.members=((F=v.members)==null?void 0:F.map(K=>n.MemberRequest.fromPartial(K)))||[],A.metadata=v.metadata??"",A}};function D(){return{groupId:BigInt(0)}}e.MsgCreateGroupResponse={typeUrl:"/cosmos.group.v1.MsgCreateGroupResponse",encode(v,A=i.BinaryWriter.create()){return v.groupId!==BigInt(0)&&A.uint32(8).uint64(v.groupId),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=D();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.groupId=F.uint64();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=D();return(0,o.isSet)(v.groupId)&&(A.groupId=BigInt(v.groupId.toString())),A},toJSON(v){const A={};return v.groupId!==void 0&&(A.groupId=(v.groupId||BigInt(0)).toString()),A},fromPartial(v){const A=D();return v.groupId!==void 0&&v.groupId!==null&&(A.groupId=BigInt(v.groupId.toString())),A}};function J(){return{admin:"",groupId:BigInt(0),memberUpdates:[]}}e.MsgUpdateGroupMembers={typeUrl:"/cosmos.group.v1.MsgUpdateGroupMembers",encode(v,A=i.BinaryWriter.create()){v.admin!==""&&A.uint32(10).string(v.admin),v.groupId!==BigInt(0)&&A.uint32(16).uint64(v.groupId);for(const F of v.memberUpdates)n.MemberRequest.encode(F,A.uint32(26).fork()).ldelim();return A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=J();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.admin=F.string();break;case 2:$.groupId=F.uint64();break;case 3:$.memberUpdates.push(n.MemberRequest.decode(F,F.uint32()));break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=J();return(0,o.isSet)(v.admin)&&(A.admin=String(v.admin)),(0,o.isSet)(v.groupId)&&(A.groupId=BigInt(v.groupId.toString())),Array.isArray(v==null?void 0:v.memberUpdates)&&(A.memberUpdates=v.memberUpdates.map(F=>n.MemberRequest.fromJSON(F))),A},toJSON(v){const A={};return v.admin!==void 0&&(A.admin=v.admin),v.groupId!==void 0&&(A.groupId=(v.groupId||BigInt(0)).toString()),v.memberUpdates?A.memberUpdates=v.memberUpdates.map(F=>F?n.MemberRequest.toJSON(F):void 0):A.memberUpdates=[],A},fromPartial(v){var F;const A=J();return A.admin=v.admin??"",v.groupId!==void 0&&v.groupId!==null&&(A.groupId=BigInt(v.groupId.toString())),A.memberUpdates=((F=v.memberUpdates)==null?void 0:F.map(K=>n.MemberRequest.fromPartial(K)))||[],A}};function b(){return{}}e.MsgUpdateGroupMembersResponse={typeUrl:"/cosmos.group.v1.MsgUpdateGroupMembersResponse",encode(v,A=i.BinaryWriter.create()){return A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=b();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){default:F.skipType(j&7);break}}return $},fromJSON(v){return b()},toJSON(v){return{}},fromPartial(v){return b()}};function p(){return{admin:"",groupId:BigInt(0),newAdmin:""}}e.MsgUpdateGroupAdmin={typeUrl:"/cosmos.group.v1.MsgUpdateGroupAdmin",encode(v,A=i.BinaryWriter.create()){return v.admin!==""&&A.uint32(10).string(v.admin),v.groupId!==BigInt(0)&&A.uint32(16).uint64(v.groupId),v.newAdmin!==""&&A.uint32(26).string(v.newAdmin),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=p();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.admin=F.string();break;case 2:$.groupId=F.uint64();break;case 3:$.newAdmin=F.string();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=p();return(0,o.isSet)(v.admin)&&(A.admin=String(v.admin)),(0,o.isSet)(v.groupId)&&(A.groupId=BigInt(v.groupId.toString())),(0,o.isSet)(v.newAdmin)&&(A.newAdmin=String(v.newAdmin)),A},toJSON(v){const A={};return v.admin!==void 0&&(A.admin=v.admin),v.groupId!==void 0&&(A.groupId=(v.groupId||BigInt(0)).toString()),v.newAdmin!==void 0&&(A.newAdmin=v.newAdmin),A},fromPartial(v){const A=p();return A.admin=v.admin??"",v.groupId!==void 0&&v.groupId!==null&&(A.groupId=BigInt(v.groupId.toString())),A.newAdmin=v.newAdmin??"",A}};function S(){return{}}e.MsgUpdateGroupAdminResponse={typeUrl:"/cosmos.group.v1.MsgUpdateGroupAdminResponse",encode(v,A=i.BinaryWriter.create()){return A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=S();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){default:F.skipType(j&7);break}}return $},fromJSON(v){return S()},toJSON(v){return{}},fromPartial(v){return S()}};function R(){return{admin:"",groupId:BigInt(0),metadata:""}}e.MsgUpdateGroupMetadata={typeUrl:"/cosmos.group.v1.MsgUpdateGroupMetadata",encode(v,A=i.BinaryWriter.create()){return v.admin!==""&&A.uint32(10).string(v.admin),v.groupId!==BigInt(0)&&A.uint32(16).uint64(v.groupId),v.metadata!==""&&A.uint32(26).string(v.metadata),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=R();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.admin=F.string();break;case 2:$.groupId=F.uint64();break;case 3:$.metadata=F.string();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=R();return(0,o.isSet)(v.admin)&&(A.admin=String(v.admin)),(0,o.isSet)(v.groupId)&&(A.groupId=BigInt(v.groupId.toString())),(0,o.isSet)(v.metadata)&&(A.metadata=String(v.metadata)),A},toJSON(v){const A={};return v.admin!==void 0&&(A.admin=v.admin),v.groupId!==void 0&&(A.groupId=(v.groupId||BigInt(0)).toString()),v.metadata!==void 0&&(A.metadata=v.metadata),A},fromPartial(v){const A=R();return A.admin=v.admin??"",v.groupId!==void 0&&v.groupId!==null&&(A.groupId=BigInt(v.groupId.toString())),A.metadata=v.metadata??"",A}};function u(){return{}}e.MsgUpdateGroupMetadataResponse={typeUrl:"/cosmos.group.v1.MsgUpdateGroupMetadataResponse",encode(v,A=i.BinaryWriter.create()){return A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=u();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){default:F.skipType(j&7);break}}return $},fromJSON(v){return u()},toJSON(v){return{}},fromPartial(v){return u()}};function c(){return{admin:"",groupId:BigInt(0),metadata:"",decisionPolicy:void 0}}e.MsgCreateGroupPolicy={typeUrl:"/cosmos.group.v1.MsgCreateGroupPolicy",encode(v,A=i.BinaryWriter.create()){return v.admin!==""&&A.uint32(10).string(v.admin),v.groupId!==BigInt(0)&&A.uint32(16).uint64(v.groupId),v.metadata!==""&&A.uint32(26).string(v.metadata),v.decisionPolicy!==void 0&&t.Any.encode(v.decisionPolicy,A.uint32(34).fork()).ldelim(),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=c();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.admin=F.string();break;case 2:$.groupId=F.uint64();break;case 3:$.metadata=F.string();break;case 4:$.decisionPolicy=t.Any.decode(F,F.uint32());break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=c();return(0,o.isSet)(v.admin)&&(A.admin=String(v.admin)),(0,o.isSet)(v.groupId)&&(A.groupId=BigInt(v.groupId.toString())),(0,o.isSet)(v.metadata)&&(A.metadata=String(v.metadata)),(0,o.isSet)(v.decisionPolicy)&&(A.decisionPolicy=t.Any.fromJSON(v.decisionPolicy)),A},toJSON(v){const A={};return v.admin!==void 0&&(A.admin=v.admin),v.groupId!==void 0&&(A.groupId=(v.groupId||BigInt(0)).toString()),v.metadata!==void 0&&(A.metadata=v.metadata),v.decisionPolicy!==void 0&&(A.decisionPolicy=v.decisionPolicy?t.Any.toJSON(v.decisionPolicy):void 0),A},fromPartial(v){const A=c();return A.admin=v.admin??"",v.groupId!==void 0&&v.groupId!==null&&(A.groupId=BigInt(v.groupId.toString())),A.metadata=v.metadata??"",v.decisionPolicy!==void 0&&v.decisionPolicy!==null&&(A.decisionPolicy=t.Any.fromPartial(v.decisionPolicy)),A}};function y(){return{address:""}}e.MsgCreateGroupPolicyResponse={typeUrl:"/cosmos.group.v1.MsgCreateGroupPolicyResponse",encode(v,A=i.BinaryWriter.create()){return v.address!==""&&A.uint32(10).string(v.address),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=y();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.address=F.string();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=y();return(0,o.isSet)(v.address)&&(A.address=String(v.address)),A},toJSON(v){const A={};return v.address!==void 0&&(A.address=v.address),A},fromPartial(v){const A=y();return A.address=v.address??"",A}};function B(){return{admin:"",groupPolicyAddress:"",newAdmin:""}}e.MsgUpdateGroupPolicyAdmin={typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyAdmin",encode(v,A=i.BinaryWriter.create()){return v.admin!==""&&A.uint32(10).string(v.admin),v.groupPolicyAddress!==""&&A.uint32(18).string(v.groupPolicyAddress),v.newAdmin!==""&&A.uint32(26).string(v.newAdmin),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=B();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.admin=F.string();break;case 2:$.groupPolicyAddress=F.string();break;case 3:$.newAdmin=F.string();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=B();return(0,o.isSet)(v.admin)&&(A.admin=String(v.admin)),(0,o.isSet)(v.groupPolicyAddress)&&(A.groupPolicyAddress=String(v.groupPolicyAddress)),(0,o.isSet)(v.newAdmin)&&(A.newAdmin=String(v.newAdmin)),A},toJSON(v){const A={};return v.admin!==void 0&&(A.admin=v.admin),v.groupPolicyAddress!==void 0&&(A.groupPolicyAddress=v.groupPolicyAddress),v.newAdmin!==void 0&&(A.newAdmin=v.newAdmin),A},fromPartial(v){const A=B();return A.admin=v.admin??"",A.groupPolicyAddress=v.groupPolicyAddress??"",A.newAdmin=v.newAdmin??"",A}};function N(){return{}}e.MsgUpdateGroupPolicyAdminResponse={typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse",encode(v,A=i.BinaryWriter.create()){return A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=N();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){default:F.skipType(j&7);break}}return $},fromJSON(v){return N()},toJSON(v){return{}},fromPartial(v){return N()}};function U(){return{admin:"",members:[],groupMetadata:"",groupPolicyMetadata:"",groupPolicyAsAdmin:!1,decisionPolicy:void 0}}e.MsgCreateGroupWithPolicy={typeUrl:"/cosmos.group.v1.MsgCreateGroupWithPolicy",encode(v,A=i.BinaryWriter.create()){v.admin!==""&&A.uint32(10).string(v.admin);for(const F of v.members)n.MemberRequest.encode(F,A.uint32(18).fork()).ldelim();return v.groupMetadata!==""&&A.uint32(26).string(v.groupMetadata),v.groupPolicyMetadata!==""&&A.uint32(34).string(v.groupPolicyMetadata),v.groupPolicyAsAdmin===!0&&A.uint32(40).bool(v.groupPolicyAsAdmin),v.decisionPolicy!==void 0&&t.Any.encode(v.decisionPolicy,A.uint32(50).fork()).ldelim(),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=U();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.admin=F.string();break;case 2:$.members.push(n.MemberRequest.decode(F,F.uint32()));break;case 3:$.groupMetadata=F.string();break;case 4:$.groupPolicyMetadata=F.string();break;case 5:$.groupPolicyAsAdmin=F.bool();break;case 6:$.decisionPolicy=t.Any.decode(F,F.uint32());break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=U();return(0,o.isSet)(v.admin)&&(A.admin=String(v.admin)),Array.isArray(v==null?void 0:v.members)&&(A.members=v.members.map(F=>n.MemberRequest.fromJSON(F))),(0,o.isSet)(v.groupMetadata)&&(A.groupMetadata=String(v.groupMetadata)),(0,o.isSet)(v.groupPolicyMetadata)&&(A.groupPolicyMetadata=String(v.groupPolicyMetadata)),(0,o.isSet)(v.groupPolicyAsAdmin)&&(A.groupPolicyAsAdmin=!!v.groupPolicyAsAdmin),(0,o.isSet)(v.decisionPolicy)&&(A.decisionPolicy=t.Any.fromJSON(v.decisionPolicy)),A},toJSON(v){const A={};return v.admin!==void 0&&(A.admin=v.admin),v.members?A.members=v.members.map(F=>F?n.MemberRequest.toJSON(F):void 0):A.members=[],v.groupMetadata!==void 0&&(A.groupMetadata=v.groupMetadata),v.groupPolicyMetadata!==void 0&&(A.groupPolicyMetadata=v.groupPolicyMetadata),v.groupPolicyAsAdmin!==void 0&&(A.groupPolicyAsAdmin=v.groupPolicyAsAdmin),v.decisionPolicy!==void 0&&(A.decisionPolicy=v.decisionPolicy?t.Any.toJSON(v.decisionPolicy):void 0),A},fromPartial(v){var F;const A=U();return A.admin=v.admin??"",A.members=((F=v.members)==null?void 0:F.map(K=>n.MemberRequest.fromPartial(K)))||[],A.groupMetadata=v.groupMetadata??"",A.groupPolicyMetadata=v.groupPolicyMetadata??"",A.groupPolicyAsAdmin=v.groupPolicyAsAdmin??!1,v.decisionPolicy!==void 0&&v.decisionPolicy!==null&&(A.decisionPolicy=t.Any.fromPartial(v.decisionPolicy)),A}};function W(){return{groupId:BigInt(0),groupPolicyAddress:""}}e.MsgCreateGroupWithPolicyResponse={typeUrl:"/cosmos.group.v1.MsgCreateGroupWithPolicyResponse",encode(v,A=i.BinaryWriter.create()){return v.groupId!==BigInt(0)&&A.uint32(8).uint64(v.groupId),v.groupPolicyAddress!==""&&A.uint32(18).string(v.groupPolicyAddress),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=W();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.groupId=F.uint64();break;case 2:$.groupPolicyAddress=F.string();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=W();return(0,o.isSet)(v.groupId)&&(A.groupId=BigInt(v.groupId.toString())),(0,o.isSet)(v.groupPolicyAddress)&&(A.groupPolicyAddress=String(v.groupPolicyAddress)),A},toJSON(v){const A={};return v.groupId!==void 0&&(A.groupId=(v.groupId||BigInt(0)).toString()),v.groupPolicyAddress!==void 0&&(A.groupPolicyAddress=v.groupPolicyAddress),A},fromPartial(v){const A=W();return v.groupId!==void 0&&v.groupId!==null&&(A.groupId=BigInt(v.groupId.toString())),A.groupPolicyAddress=v.groupPolicyAddress??"",A}};function r(){return{admin:"",groupPolicyAddress:"",decisionPolicy:void 0}}e.MsgUpdateGroupPolicyDecisionPolicy={typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy",encode(v,A=i.BinaryWriter.create()){return v.admin!==""&&A.uint32(10).string(v.admin),v.groupPolicyAddress!==""&&A.uint32(18).string(v.groupPolicyAddress),v.decisionPolicy!==void 0&&t.Any.encode(v.decisionPolicy,A.uint32(26).fork()).ldelim(),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=r();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.admin=F.string();break;case 2:$.groupPolicyAddress=F.string();break;case 3:$.decisionPolicy=t.Any.decode(F,F.uint32());break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=r();return(0,o.isSet)(v.admin)&&(A.admin=String(v.admin)),(0,o.isSet)(v.groupPolicyAddress)&&(A.groupPolicyAddress=String(v.groupPolicyAddress)),(0,o.isSet)(v.decisionPolicy)&&(A.decisionPolicy=t.Any.fromJSON(v.decisionPolicy)),A},toJSON(v){const A={};return v.admin!==void 0&&(A.admin=v.admin),v.groupPolicyAddress!==void 0&&(A.groupPolicyAddress=v.groupPolicyAddress),v.decisionPolicy!==void 0&&(A.decisionPolicy=v.decisionPolicy?t.Any.toJSON(v.decisionPolicy):void 0),A},fromPartial(v){const A=r();return A.admin=v.admin??"",A.groupPolicyAddress=v.groupPolicyAddress??"",v.decisionPolicy!==void 0&&v.decisionPolicy!==null&&(A.decisionPolicy=t.Any.fromPartial(v.decisionPolicy)),A}};function s(){return{}}e.MsgUpdateGroupPolicyDecisionPolicyResponse={typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse",encode(v,A=i.BinaryWriter.create()){return A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=s();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){default:F.skipType(j&7);break}}return $},fromJSON(v){return s()},toJSON(v){return{}},fromPartial(v){return s()}};function O(){return{admin:"",groupPolicyAddress:"",metadata:""}}e.MsgUpdateGroupPolicyMetadata={typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyMetadata",encode(v,A=i.BinaryWriter.create()){return v.admin!==""&&A.uint32(10).string(v.admin),v.groupPolicyAddress!==""&&A.uint32(18).string(v.groupPolicyAddress),v.metadata!==""&&A.uint32(26).string(v.metadata),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=O();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.admin=F.string();break;case 2:$.groupPolicyAddress=F.string();break;case 3:$.metadata=F.string();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=O();return(0,o.isSet)(v.admin)&&(A.admin=String(v.admin)),(0,o.isSet)(v.groupPolicyAddress)&&(A.groupPolicyAddress=String(v.groupPolicyAddress)),(0,o.isSet)(v.metadata)&&(A.metadata=String(v.metadata)),A},toJSON(v){const A={};return v.admin!==void 0&&(A.admin=v.admin),v.groupPolicyAddress!==void 0&&(A.groupPolicyAddress=v.groupPolicyAddress),v.metadata!==void 0&&(A.metadata=v.metadata),A},fromPartial(v){const A=O();return A.admin=v.admin??"",A.groupPolicyAddress=v.groupPolicyAddress??"",A.metadata=v.metadata??"",A}};function q(){return{}}e.MsgUpdateGroupPolicyMetadataResponse={typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse",encode(v,A=i.BinaryWriter.create()){return A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=q();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){default:F.skipType(j&7);break}}return $},fromJSON(v){return q()},toJSON(v){return{}},fromPartial(v){return q()}};function d(){return{groupPolicyAddress:"",proposers:[],metadata:"",messages:[],exec:0,title:"",summary:""}}e.MsgSubmitProposal={typeUrl:"/cosmos.group.v1.MsgSubmitProposal",encode(v,A=i.BinaryWriter.create()){v.groupPolicyAddress!==""&&A.uint32(10).string(v.groupPolicyAddress);for(const F of v.proposers)A.uint32(18).string(F);v.metadata!==""&&A.uint32(26).string(v.metadata);for(const F of v.messages)t.Any.encode(F,A.uint32(34).fork()).ldelim();return v.exec!==0&&A.uint32(40).int32(v.exec),v.title!==""&&A.uint32(50).string(v.title),v.summary!==""&&A.uint32(58).string(v.summary),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=d();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.groupPolicyAddress=F.string();break;case 2:$.proposers.push(F.string());break;case 3:$.metadata=F.string();break;case 4:$.messages.push(t.Any.decode(F,F.uint32()));break;case 5:$.exec=F.int32();break;case 6:$.title=F.string();break;case 7:$.summary=F.string();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=d();return(0,o.isSet)(v.groupPolicyAddress)&&(A.groupPolicyAddress=String(v.groupPolicyAddress)),Array.isArray(v==null?void 0:v.proposers)&&(A.proposers=v.proposers.map(F=>String(F))),(0,o.isSet)(v.metadata)&&(A.metadata=String(v.metadata)),Array.isArray(v==null?void 0:v.messages)&&(A.messages=v.messages.map(F=>t.Any.fromJSON(F))),(0,o.isSet)(v.exec)&&(A.exec=C(v.exec)),(0,o.isSet)(v.title)&&(A.title=String(v.title)),(0,o.isSet)(v.summary)&&(A.summary=String(v.summary)),A},toJSON(v){const A={};return v.groupPolicyAddress!==void 0&&(A.groupPolicyAddress=v.groupPolicyAddress),v.proposers?A.proposers=v.proposers.map(F=>F):A.proposers=[],v.metadata!==void 0&&(A.metadata=v.metadata),v.messages?A.messages=v.messages.map(F=>F?t.Any.toJSON(F):void 0):A.messages=[],v.exec!==void 0&&(A.exec=w(v.exec)),v.title!==void 0&&(A.title=v.title),v.summary!==void 0&&(A.summary=v.summary),A},fromPartial(v){var F,K;const A=d();return A.groupPolicyAddress=v.groupPolicyAddress??"",A.proposers=((F=v.proposers)==null?void 0:F.map($=>$))||[],A.metadata=v.metadata??"",A.messages=((K=v.messages)==null?void 0:K.map($=>t.Any.fromPartial($)))||[],A.exec=v.exec??0,A.title=v.title??"",A.summary=v.summary??"",A}};function l(){return{proposalId:BigInt(0)}}e.MsgSubmitProposalResponse={typeUrl:"/cosmos.group.v1.MsgSubmitProposalResponse",encode(v,A=i.BinaryWriter.create()){return v.proposalId!==BigInt(0)&&A.uint32(8).uint64(v.proposalId),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=l();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.proposalId=F.uint64();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=l();return(0,o.isSet)(v.proposalId)&&(A.proposalId=BigInt(v.proposalId.toString())),A},toJSON(v){const A={};return v.proposalId!==void 0&&(A.proposalId=(v.proposalId||BigInt(0)).toString()),A},fromPartial(v){const A=l();return v.proposalId!==void 0&&v.proposalId!==null&&(A.proposalId=BigInt(v.proposalId.toString())),A}};function M(){return{proposalId:BigInt(0),address:""}}e.MsgWithdrawProposal={typeUrl:"/cosmos.group.v1.MsgWithdrawProposal",encode(v,A=i.BinaryWriter.create()){return v.proposalId!==BigInt(0)&&A.uint32(8).uint64(v.proposalId),v.address!==""&&A.uint32(18).string(v.address),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=M();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.proposalId=F.uint64();break;case 2:$.address=F.string();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=M();return(0,o.isSet)(v.proposalId)&&(A.proposalId=BigInt(v.proposalId.toString())),(0,o.isSet)(v.address)&&(A.address=String(v.address)),A},toJSON(v){const A={};return v.proposalId!==void 0&&(A.proposalId=(v.proposalId||BigInt(0)).toString()),v.address!==void 0&&(A.address=v.address),A},fromPartial(v){const A=M();return v.proposalId!==void 0&&v.proposalId!==null&&(A.proposalId=BigInt(v.proposalId.toString())),A.address=v.address??"",A}};function m(){return{}}e.MsgWithdrawProposalResponse={typeUrl:"/cosmos.group.v1.MsgWithdrawProposalResponse",encode(v,A=i.BinaryWriter.create()){return A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=m();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){default:F.skipType(j&7);break}}return $},fromJSON(v){return m()},toJSON(v){return{}},fromPartial(v){return m()}};function h(){return{proposalId:BigInt(0),voter:"",option:0,metadata:"",exec:0}}e.MsgVote={typeUrl:"/cosmos.group.v1.MsgVote",encode(v,A=i.BinaryWriter.create()){return v.proposalId!==BigInt(0)&&A.uint32(8).uint64(v.proposalId),v.voter!==""&&A.uint32(18).string(v.voter),v.option!==0&&A.uint32(24).int32(v.option),v.metadata!==""&&A.uint32(34).string(v.metadata),v.exec!==0&&A.uint32(40).int32(v.exec),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=h();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.proposalId=F.uint64();break;case 2:$.voter=F.string();break;case 3:$.option=F.int32();break;case 4:$.metadata=F.string();break;case 5:$.exec=F.int32();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=h();return(0,o.isSet)(v.proposalId)&&(A.proposalId=BigInt(v.proposalId.toString())),(0,o.isSet)(v.voter)&&(A.voter=String(v.voter)),(0,o.isSet)(v.option)&&(A.option=(0,n.voteOptionFromJSON)(v.option)),(0,o.isSet)(v.metadata)&&(A.metadata=String(v.metadata)),(0,o.isSet)(v.exec)&&(A.exec=C(v.exec)),A},toJSON(v){const A={};return v.proposalId!==void 0&&(A.proposalId=(v.proposalId||BigInt(0)).toString()),v.voter!==void 0&&(A.voter=v.voter),v.option!==void 0&&(A.option=(0,n.voteOptionToJSON)(v.option)),v.metadata!==void 0&&(A.metadata=v.metadata),v.exec!==void 0&&(A.exec=w(v.exec)),A},fromPartial(v){const A=h();return v.proposalId!==void 0&&v.proposalId!==null&&(A.proposalId=BigInt(v.proposalId.toString())),A.voter=v.voter??"",A.option=v.option??0,A.metadata=v.metadata??"",A.exec=v.exec??0,A}};function T(){return{}}e.MsgVoteResponse={typeUrl:"/cosmos.group.v1.MsgVoteResponse",encode(v,A=i.BinaryWriter.create()){return A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=T();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){default:F.skipType(j&7);break}}return $},fromJSON(v){return T()},toJSON(v){return{}},fromPartial(v){return T()}};function Q(){return{proposalId:BigInt(0),executor:""}}e.MsgExec={typeUrl:"/cosmos.group.v1.MsgExec",encode(v,A=i.BinaryWriter.create()){return v.proposalId!==BigInt(0)&&A.uint32(8).uint64(v.proposalId),v.executor!==""&&A.uint32(18).string(v.executor),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=Q();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.proposalId=F.uint64();break;case 2:$.executor=F.string();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=Q();return(0,o.isSet)(v.proposalId)&&(A.proposalId=BigInt(v.proposalId.toString())),(0,o.isSet)(v.executor)&&(A.executor=String(v.executor)),A},toJSON(v){const A={};return v.proposalId!==void 0&&(A.proposalId=(v.proposalId||BigInt(0)).toString()),v.executor!==void 0&&(A.executor=v.executor),A},fromPartial(v){const A=Q();return v.proposalId!==void 0&&v.proposalId!==null&&(A.proposalId=BigInt(v.proposalId.toString())),A.executor=v.executor??"",A}};function H(){return{result:0}}e.MsgExecResponse={typeUrl:"/cosmos.group.v1.MsgExecResponse",encode(v,A=i.BinaryWriter.create()){return v.result!==0&&A.uint32(16).int32(v.result),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=H();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 2:$.result=F.int32();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=H();return(0,o.isSet)(v.result)&&(A.result=(0,n.proposalExecutorResultFromJSON)(v.result)),A},toJSON(v){const A={};return v.result!==void 0&&(A.result=(0,n.proposalExecutorResultToJSON)(v.result)),A},fromPartial(v){const A=H();return A.result=v.result??0,A}};function a(){return{address:"",groupId:BigInt(0)}}e.MsgLeaveGroup={typeUrl:"/cosmos.group.v1.MsgLeaveGroup",encode(v,A=i.BinaryWriter.create()){return v.address!==""&&A.uint32(10).string(v.address),v.groupId!==BigInt(0)&&A.uint32(16).uint64(v.groupId),A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=a();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){case 1:$.address=F.string();break;case 2:$.groupId=F.uint64();break;default:F.skipType(j&7);break}}return $},fromJSON(v){const A=a();return(0,o.isSet)(v.address)&&(A.address=String(v.address)),(0,o.isSet)(v.groupId)&&(A.groupId=BigInt(v.groupId.toString())),A},toJSON(v){const A={};return v.address!==void 0&&(A.address=v.address),v.groupId!==void 0&&(A.groupId=(v.groupId||BigInt(0)).toString()),A},fromPartial(v){const A=a();return A.address=v.address??"",v.groupId!==void 0&&v.groupId!==null&&(A.groupId=BigInt(v.groupId.toString())),A}};function P(){return{}}e.MsgLeaveGroupResponse={typeUrl:"/cosmos.group.v1.MsgLeaveGroupResponse",encode(v,A=i.BinaryWriter.create()){return A},decode(v,A){const F=v instanceof i.BinaryReader?v:new i.BinaryReader(v);let K=A===void 0?F.len:F.pos+A;const $=P();for(;F.pos<K;){const j=F.uint32();switch(j>>>3){default:F.skipType(j&7);break}}return $},fromJSON(v){return P()},toJSON(v){return{}},fromPartial(v){return P()}};class k{constructor(A){this.rpc=A,this.CreateGroup=this.CreateGroup.bind(this),this.UpdateGroupMembers=this.UpdateGroupMembers.bind(this),this.UpdateGroupAdmin=this.UpdateGroupAdmin.bind(this),this.UpdateGroupMetadata=this.UpdateGroupMetadata.bind(this),this.CreateGroupPolicy=this.CreateGroupPolicy.bind(this),this.CreateGroupWithPolicy=this.CreateGroupWithPolicy.bind(this),this.UpdateGroupPolicyAdmin=this.UpdateGroupPolicyAdmin.bind(this),this.UpdateGroupPolicyDecisionPolicy=this.UpdateGroupPolicyDecisionPolicy.bind(this),this.UpdateGroupPolicyMetadata=this.UpdateGroupPolicyMetadata.bind(this),this.SubmitProposal=this.SubmitProposal.bind(this),this.WithdrawProposal=this.WithdrawProposal.bind(this),this.Vote=this.Vote.bind(this),this.Exec=this.Exec.bind(this),this.LeaveGroup=this.LeaveGroup.bind(this)}CreateGroup(A){const F=e.MsgCreateGroup.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","CreateGroup",F).then($=>e.MsgCreateGroupResponse.decode(new i.BinaryReader($)))}UpdateGroupMembers(A){const F=e.MsgUpdateGroupMembers.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupMembers",F).then($=>e.MsgUpdateGroupMembersResponse.decode(new i.BinaryReader($)))}UpdateGroupAdmin(A){const F=e.MsgUpdateGroupAdmin.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupAdmin",F).then($=>e.MsgUpdateGroupAdminResponse.decode(new i.BinaryReader($)))}UpdateGroupMetadata(A){const F=e.MsgUpdateGroupMetadata.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupMetadata",F).then($=>e.MsgUpdateGroupMetadataResponse.decode(new i.BinaryReader($)))}CreateGroupPolicy(A){const F=e.MsgCreateGroupPolicy.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","CreateGroupPolicy",F).then($=>e.MsgCreateGroupPolicyResponse.decode(new i.BinaryReader($)))}CreateGroupWithPolicy(A){const F=e.MsgCreateGroupWithPolicy.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","CreateGroupWithPolicy",F).then($=>e.MsgCreateGroupWithPolicyResponse.decode(new i.BinaryReader($)))}UpdateGroupPolicyAdmin(A){const F=e.MsgUpdateGroupPolicyAdmin.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupPolicyAdmin",F).then($=>e.MsgUpdateGroupPolicyAdminResponse.decode(new i.BinaryReader($)))}UpdateGroupPolicyDecisionPolicy(A){const F=e.MsgUpdateGroupPolicyDecisionPolicy.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupPolicyDecisionPolicy",F).then($=>e.MsgUpdateGroupPolicyDecisionPolicyResponse.decode(new i.BinaryReader($)))}UpdateGroupPolicyMetadata(A){const F=e.MsgUpdateGroupPolicyMetadata.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupPolicyMetadata",F).then($=>e.MsgUpdateGroupPolicyMetadataResponse.decode(new i.BinaryReader($)))}SubmitProposal(A){const F=e.MsgSubmitProposal.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","SubmitProposal",F).then($=>e.MsgSubmitProposalResponse.decode(new i.BinaryReader($)))}WithdrawProposal(A){const F=e.MsgWithdrawProposal.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","WithdrawProposal",F).then($=>e.MsgWithdrawProposalResponse.decode(new i.BinaryReader($)))}Vote(A){const F=e.MsgVote.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","Vote",F).then($=>e.MsgVoteResponse.decode(new i.BinaryReader($)))}Exec(A){const F=e.MsgExec.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","Exec",F).then($=>e.MsgExecResponse.decode(new i.BinaryReader($)))}LeaveGroup(A){const F=e.MsgLeaveGroup.encode(A).finish();return this.rpc.request("cosmos.group.v1.Msg","LeaveGroup",F).then($=>e.MsgLeaveGroupResponse.decode(new i.BinaryReader($)))}}e.MsgClientImpl=k})(vc);Object.defineProperty(ms,"__esModule",{value:!0});ms.groupTypes=void 0;const Ye=vc;ms.groupTypes=[["/cosmos.group.v1.MsgCreateGroup",Ye.MsgCreateGroup],["/cosmos.group.v1.MsgCreateGroupPolicy",Ye.MsgCreateGroupPolicy],["/cosmos.group.v1.MsgCreateGroupWithPolicy",Ye.MsgCreateGroupWithPolicy],["/cosmos.group.v1.MsgExec",Ye.MsgExec],["/cosmos.group.v1.MsgLeaveGroup",Ye.MsgLeaveGroup],["/cosmos.group.v1.MsgSubmitProposal",Ye.MsgSubmitProposal],["/cosmos.group.v1.MsgUpdateGroupAdmin",Ye.MsgUpdateGroupAdmin],["/cosmos.group.v1.MsgUpdateGroupMembers",Ye.MsgUpdateGroupMembers],["/cosmos.group.v1.MsgUpdateGroupMetadata",Ye.MsgUpdateGroupMetadata],["/cosmos.group.v1.MsgUpdateGroupPolicyAdmin",Ye.MsgUpdateGroupPolicyAdmin],["/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy",Ye.MsgUpdateGroupPolicyDecisionPolicy],["/cosmos.group.v1.MsgUpdateGroupPolicyMetadata",Ye.MsgUpdateGroupPolicyMetadata],["/cosmos.group.v1.MsgVote",Ye.MsgVote],["/cosmos.group.v1.MsgWithdrawProposal",Ye.MsgWithdrawProposal]];var hi={},Io={},kt={},Sm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ModuleVersion=e.CancelSoftwareUpgradeProposal=e.SoftwareUpgradeProposal=e.Plan=e.protobufPackage=void 0;const n=Je,t=_.any,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.upgrade.v1beta1";function g(){return{name:"",time:n.Timestamp.fromPartial({}),height:BigInt(0),info:"",upgradedClientState:void 0}}e.Plan={typeUrl:"/cosmos.upgrade.v1beta1.Plan",encode(D,J=i.BinaryWriter.create()){return D.name!==""&&J.uint32(10).string(D.name),D.time!==void 0&&n.Timestamp.encode(D.time,J.uint32(18).fork()).ldelim(),D.height!==BigInt(0)&&J.uint32(24).int64(D.height),D.info!==""&&J.uint32(34).string(D.info),D.upgradedClientState!==void 0&&t.Any.encode(D.upgradedClientState,J.uint32(42).fork()).ldelim(),J},decode(D,J){const b=D instanceof i.BinaryReader?D:new i.BinaryReader(D);let p=J===void 0?b.len:b.pos+J;const S=g();for(;b.pos<p;){const R=b.uint32();switch(R>>>3){case 1:S.name=b.string();break;case 2:S.time=n.Timestamp.decode(b,b.uint32());break;case 3:S.height=b.int64();break;case 4:S.info=b.string();break;case 5:S.upgradedClientState=t.Any.decode(b,b.uint32());break;default:b.skipType(R&7);break}}return S},fromJSON(D){const J=g();return(0,o.isSet)(D.name)&&(J.name=String(D.name)),(0,o.isSet)(D.time)&&(J.time=(0,o.fromJsonTimestamp)(D.time)),(0,o.isSet)(D.height)&&(J.height=BigInt(D.height.toString())),(0,o.isSet)(D.info)&&(J.info=String(D.info)),(0,o.isSet)(D.upgradedClientState)&&(J.upgradedClientState=t.Any.fromJSON(D.upgradedClientState)),J},toJSON(D){const J={};return D.name!==void 0&&(J.name=D.name),D.time!==void 0&&(J.time=(0,o.fromTimestamp)(D.time).toISOString()),D.height!==void 0&&(J.height=(D.height||BigInt(0)).toString()),D.info!==void 0&&(J.info=D.info),D.upgradedClientState!==void 0&&(J.upgradedClientState=D.upgradedClientState?t.Any.toJSON(D.upgradedClientState):void 0),J},fromPartial(D){const J=g();return J.name=D.name??"",D.time!==void 0&&D.time!==null&&(J.time=n.Timestamp.fromPartial(D.time)),D.height!==void 0&&D.height!==null&&(J.height=BigInt(D.height.toString())),J.info=D.info??"",D.upgradedClientState!==void 0&&D.upgradedClientState!==null&&(J.upgradedClientState=t.Any.fromPartial(D.upgradedClientState)),J}};function C(){return{title:"",description:"",plan:e.Plan.fromPartial({})}}e.SoftwareUpgradeProposal={typeUrl:"/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal",encode(D,J=i.BinaryWriter.create()){return D.title!==""&&J.uint32(10).string(D.title),D.description!==""&&J.uint32(18).string(D.description),D.plan!==void 0&&e.Plan.encode(D.plan,J.uint32(26).fork()).ldelim(),J},decode(D,J){const b=D instanceof i.BinaryReader?D:new i.BinaryReader(D);let p=J===void 0?b.len:b.pos+J;const S=C();for(;b.pos<p;){const R=b.uint32();switch(R>>>3){case 1:S.title=b.string();break;case 2:S.description=b.string();break;case 3:S.plan=e.Plan.decode(b,b.uint32());break;default:b.skipType(R&7);break}}return S},fromJSON(D){const J=C();return(0,o.isSet)(D.title)&&(J.title=String(D.title)),(0,o.isSet)(D.description)&&(J.description=String(D.description)),(0,o.isSet)(D.plan)&&(J.plan=e.Plan.fromJSON(D.plan)),J},toJSON(D){const J={};return D.title!==void 0&&(J.title=D.title),D.description!==void 0&&(J.description=D.description),D.plan!==void 0&&(J.plan=D.plan?e.Plan.toJSON(D.plan):void 0),J},fromPartial(D){const J=C();return J.title=D.title??"",J.description=D.description??"",D.plan!==void 0&&D.plan!==null&&(J.plan=e.Plan.fromPartial(D.plan)),J}};function w(){return{title:"",description:""}}e.CancelSoftwareUpgradeProposal={typeUrl:"/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal",encode(D,J=i.BinaryWriter.create()){return D.title!==""&&J.uint32(10).string(D.title),D.description!==""&&J.uint32(18).string(D.description),J},decode(D,J){const b=D instanceof i.BinaryReader?D:new i.BinaryReader(D);let p=J===void 0?b.len:b.pos+J;const S=w();for(;b.pos<p;){const R=b.uint32();switch(R>>>3){case 1:S.title=b.string();break;case 2:S.description=b.string();break;default:b.skipType(R&7);break}}return S},fromJSON(D){const J=w();return(0,o.isSet)(D.title)&&(J.title=String(D.title)),(0,o.isSet)(D.description)&&(J.description=String(D.description)),J},toJSON(D){const J={};return D.title!==void 0&&(J.title=D.title),D.description!==void 0&&(J.description=D.description),J},fromPartial(D){const J=w();return J.title=D.title??"",J.description=D.description??"",J}};function E(){return{name:"",version:BigInt(0)}}e.ModuleVersion={typeUrl:"/cosmos.upgrade.v1beta1.ModuleVersion",encode(D,J=i.BinaryWriter.create()){return D.name!==""&&J.uint32(10).string(D.name),D.version!==BigInt(0)&&J.uint32(16).uint64(D.version),J},decode(D,J){const b=D instanceof i.BinaryReader?D:new i.BinaryReader(D);let p=J===void 0?b.len:b.pos+J;const S=E();for(;b.pos<p;){const R=b.uint32();switch(R>>>3){case 1:S.name=b.string();break;case 2:S.version=b.uint64();break;default:b.skipType(R&7);break}}return S},fromJSON(D){const J=E();return(0,o.isSet)(D.name)&&(J.name=String(D.name)),(0,o.isSet)(D.version)&&(J.version=BigInt(D.version.toString())),J},toJSON(D){const J={};return D.name!==void 0&&(J.name=D.name),D.version!==void 0&&(J.version=(D.version||BigInt(0)).toString()),J},fromPartial(D){const J=E();return J.name=D.name??"",D.version!==void 0&&D.version!==null&&(J.version=BigInt(D.version.toString())),J}}})(Sm);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Params=e.Height=e.UpgradeProposal=e.ClientUpdateProposal=e.ClientConsensusStates=e.ConsensusStateWithHeight=e.IdentifiedClientState=e.protobufPackage=void 0;const n=_.any,t=Sm,i=_.binary,o=_.helpers;e.protobufPackage="ibc.core.client.v1";function g(){return{clientId:"",clientState:void 0}}e.IdentifiedClientState={typeUrl:"/ibc.core.client.v1.IdentifiedClientState",encode(p,S=i.BinaryWriter.create()){return p.clientId!==""&&S.uint32(10).string(p.clientId),p.clientState!==void 0&&n.Any.encode(p.clientState,S.uint32(18).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=g();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.clientId=R.string();break;case 2:c.clientState=n.Any.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=g();return(0,o.isSet)(p.clientId)&&(S.clientId=String(p.clientId)),(0,o.isSet)(p.clientState)&&(S.clientState=n.Any.fromJSON(p.clientState)),S},toJSON(p){const S={};return p.clientId!==void 0&&(S.clientId=p.clientId),p.clientState!==void 0&&(S.clientState=p.clientState?n.Any.toJSON(p.clientState):void 0),S},fromPartial(p){const S=g();return S.clientId=p.clientId??"",p.clientState!==void 0&&p.clientState!==null&&(S.clientState=n.Any.fromPartial(p.clientState)),S}};function C(){return{height:e.Height.fromPartial({}),consensusState:void 0}}e.ConsensusStateWithHeight={typeUrl:"/ibc.core.client.v1.ConsensusStateWithHeight",encode(p,S=i.BinaryWriter.create()){return p.height!==void 0&&e.Height.encode(p.height,S.uint32(10).fork()).ldelim(),p.consensusState!==void 0&&n.Any.encode(p.consensusState,S.uint32(18).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=C();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.height=e.Height.decode(R,R.uint32());break;case 2:c.consensusState=n.Any.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=C();return(0,o.isSet)(p.height)&&(S.height=e.Height.fromJSON(p.height)),(0,o.isSet)(p.consensusState)&&(S.consensusState=n.Any.fromJSON(p.consensusState)),S},toJSON(p){const S={};return p.height!==void 0&&(S.height=p.height?e.Height.toJSON(p.height):void 0),p.consensusState!==void 0&&(S.consensusState=p.consensusState?n.Any.toJSON(p.consensusState):void 0),S},fromPartial(p){const S=C();return p.height!==void 0&&p.height!==null&&(S.height=e.Height.fromPartial(p.height)),p.consensusState!==void 0&&p.consensusState!==null&&(S.consensusState=n.Any.fromPartial(p.consensusState)),S}};function w(){return{clientId:"",consensusStates:[]}}e.ClientConsensusStates={typeUrl:"/ibc.core.client.v1.ClientConsensusStates",encode(p,S=i.BinaryWriter.create()){p.clientId!==""&&S.uint32(10).string(p.clientId);for(const R of p.consensusStates)e.ConsensusStateWithHeight.encode(R,S.uint32(18).fork()).ldelim();return S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=w();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.clientId=R.string();break;case 2:c.consensusStates.push(e.ConsensusStateWithHeight.decode(R,R.uint32()));break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=w();return(0,o.isSet)(p.clientId)&&(S.clientId=String(p.clientId)),Array.isArray(p==null?void 0:p.consensusStates)&&(S.consensusStates=p.consensusStates.map(R=>e.ConsensusStateWithHeight.fromJSON(R))),S},toJSON(p){const S={};return p.clientId!==void 0&&(S.clientId=p.clientId),p.consensusStates?S.consensusStates=p.consensusStates.map(R=>R?e.ConsensusStateWithHeight.toJSON(R):void 0):S.consensusStates=[],S},fromPartial(p){var R;const S=w();return S.clientId=p.clientId??"",S.consensusStates=((R=p.consensusStates)==null?void 0:R.map(u=>e.ConsensusStateWithHeight.fromPartial(u)))||[],S}};function E(){return{title:"",description:"",subjectClientId:"",substituteClientId:""}}e.ClientUpdateProposal={typeUrl:"/ibc.core.client.v1.ClientUpdateProposal",encode(p,S=i.BinaryWriter.create()){return p.title!==""&&S.uint32(10).string(p.title),p.description!==""&&S.uint32(18).string(p.description),p.subjectClientId!==""&&S.uint32(26).string(p.subjectClientId),p.substituteClientId!==""&&S.uint32(34).string(p.substituteClientId),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=E();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.title=R.string();break;case 2:c.description=R.string();break;case 3:c.subjectClientId=R.string();break;case 4:c.substituteClientId=R.string();break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=E();return(0,o.isSet)(p.title)&&(S.title=String(p.title)),(0,o.isSet)(p.description)&&(S.description=String(p.description)),(0,o.isSet)(p.subjectClientId)&&(S.subjectClientId=String(p.subjectClientId)),(0,o.isSet)(p.substituteClientId)&&(S.substituteClientId=String(p.substituteClientId)),S},toJSON(p){const S={};return p.title!==void 0&&(S.title=p.title),p.description!==void 0&&(S.description=p.description),p.subjectClientId!==void 0&&(S.subjectClientId=p.subjectClientId),p.substituteClientId!==void 0&&(S.substituteClientId=p.substituteClientId),S},fromPartial(p){const S=E();return S.title=p.title??"",S.description=p.description??"",S.subjectClientId=p.subjectClientId??"",S.substituteClientId=p.substituteClientId??"",S}};function D(){return{title:"",description:"",plan:t.Plan.fromPartial({}),upgradedClientState:void 0}}e.UpgradeProposal={typeUrl:"/ibc.core.client.v1.UpgradeProposal",encode(p,S=i.BinaryWriter.create()){return p.title!==""&&S.uint32(10).string(p.title),p.description!==""&&S.uint32(18).string(p.description),p.plan!==void 0&&t.Plan.encode(p.plan,S.uint32(26).fork()).ldelim(),p.upgradedClientState!==void 0&&n.Any.encode(p.upgradedClientState,S.uint32(34).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=D();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.title=R.string();break;case 2:c.description=R.string();break;case 3:c.plan=t.Plan.decode(R,R.uint32());break;case 4:c.upgradedClientState=n.Any.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=D();return(0,o.isSet)(p.title)&&(S.title=String(p.title)),(0,o.isSet)(p.description)&&(S.description=String(p.description)),(0,o.isSet)(p.plan)&&(S.plan=t.Plan.fromJSON(p.plan)),(0,o.isSet)(p.upgradedClientState)&&(S.upgradedClientState=n.Any.fromJSON(p.upgradedClientState)),S},toJSON(p){const S={};return p.title!==void 0&&(S.title=p.title),p.description!==void 0&&(S.description=p.description),p.plan!==void 0&&(S.plan=p.plan?t.Plan.toJSON(p.plan):void 0),p.upgradedClientState!==void 0&&(S.upgradedClientState=p.upgradedClientState?n.Any.toJSON(p.upgradedClientState):void 0),S},fromPartial(p){const S=D();return S.title=p.title??"",S.description=p.description??"",p.plan!==void 0&&p.plan!==null&&(S.plan=t.Plan.fromPartial(p.plan)),p.upgradedClientState!==void 0&&p.upgradedClientState!==null&&(S.upgradedClientState=n.Any.fromPartial(p.upgradedClientState)),S}};function J(){return{revisionNumber:BigInt(0),revisionHeight:BigInt(0)}}e.Height={typeUrl:"/ibc.core.client.v1.Height",encode(p,S=i.BinaryWriter.create()){return p.revisionNumber!==BigInt(0)&&S.uint32(8).uint64(p.revisionNumber),p.revisionHeight!==BigInt(0)&&S.uint32(16).uint64(p.revisionHeight),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=J();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.revisionNumber=R.uint64();break;case 2:c.revisionHeight=R.uint64();break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=J();return(0,o.isSet)(p.revisionNumber)&&(S.revisionNumber=BigInt(p.revisionNumber.toString())),(0,o.isSet)(p.revisionHeight)&&(S.revisionHeight=BigInt(p.revisionHeight.toString())),S},toJSON(p){const S={};return p.revisionNumber!==void 0&&(S.revisionNumber=(p.revisionNumber||BigInt(0)).toString()),p.revisionHeight!==void 0&&(S.revisionHeight=(p.revisionHeight||BigInt(0)).toString()),S},fromPartial(p){const S=J();return p.revisionNumber!==void 0&&p.revisionNumber!==null&&(S.revisionNumber=BigInt(p.revisionNumber.toString())),p.revisionHeight!==void 0&&p.revisionHeight!==null&&(S.revisionHeight=BigInt(p.revisionHeight.toString())),S}};function b(){return{allowedClients:[]}}e.Params={typeUrl:"/ibc.core.client.v1.Params",encode(p,S=i.BinaryWriter.create()){for(const R of p.allowedClients)S.uint32(10).string(R);return S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=b();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.allowedClients.push(R.string());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=b();return Array.isArray(p==null?void 0:p.allowedClients)&&(S.allowedClients=p.allowedClients.map(R=>String(R))),S},toJSON(p){const S={};return p.allowedClients?S.allowedClients=p.allowedClients.map(R=>R):S.allowedClients=[],S},fromPartial(p){var R;const S=b();return S.allowedClients=((R=p.allowedClients)==null?void 0:R.map(u=>u))||[],S}}})(kt);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgTransferResponse=e.MsgTransfer=e.protobufPackage=void 0;const n=_.coin,t=kt,i=_.binary,o=_.helpers;e.protobufPackage="ibc.applications.transfer.v1";function g(){return{sourcePort:"",sourceChannel:"",token:n.Coin.fromPartial({}),sender:"",receiver:"",timeoutHeight:t.Height.fromPartial({}),timeoutTimestamp:BigInt(0),memo:""}}e.MsgTransfer={typeUrl:"/ibc.applications.transfer.v1.MsgTransfer",encode(E,D=i.BinaryWriter.create()){return E.sourcePort!==""&&D.uint32(10).string(E.sourcePort),E.sourceChannel!==""&&D.uint32(18).string(E.sourceChannel),E.token!==void 0&&n.Coin.encode(E.token,D.uint32(26).fork()).ldelim(),E.sender!==""&&D.uint32(34).string(E.sender),E.receiver!==""&&D.uint32(42).string(E.receiver),E.timeoutHeight!==void 0&&t.Height.encode(E.timeoutHeight,D.uint32(50).fork()).ldelim(),E.timeoutTimestamp!==BigInt(0)&&D.uint32(56).uint64(E.timeoutTimestamp),E.memo!==""&&D.uint32(66).string(E.memo),D},decode(E,D){const J=E instanceof i.BinaryReader?E:new i.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=g();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.sourcePort=J.string();break;case 2:p.sourceChannel=J.string();break;case 3:p.token=n.Coin.decode(J,J.uint32());break;case 4:p.sender=J.string();break;case 5:p.receiver=J.string();break;case 6:p.timeoutHeight=t.Height.decode(J,J.uint32());break;case 7:p.timeoutTimestamp=J.uint64();break;case 8:p.memo=J.string();break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=g();return(0,o.isSet)(E.sourcePort)&&(D.sourcePort=String(E.sourcePort)),(0,o.isSet)(E.sourceChannel)&&(D.sourceChannel=String(E.sourceChannel)),(0,o.isSet)(E.token)&&(D.token=n.Coin.fromJSON(E.token)),(0,o.isSet)(E.sender)&&(D.sender=String(E.sender)),(0,o.isSet)(E.receiver)&&(D.receiver=String(E.receiver)),(0,o.isSet)(E.timeoutHeight)&&(D.timeoutHeight=t.Height.fromJSON(E.timeoutHeight)),(0,o.isSet)(E.timeoutTimestamp)&&(D.timeoutTimestamp=BigInt(E.timeoutTimestamp.toString())),(0,o.isSet)(E.memo)&&(D.memo=String(E.memo)),D},toJSON(E){const D={};return E.sourcePort!==void 0&&(D.sourcePort=E.sourcePort),E.sourceChannel!==void 0&&(D.sourceChannel=E.sourceChannel),E.token!==void 0&&(D.token=E.token?n.Coin.toJSON(E.token):void 0),E.sender!==void 0&&(D.sender=E.sender),E.receiver!==void 0&&(D.receiver=E.receiver),E.timeoutHeight!==void 0&&(D.timeoutHeight=E.timeoutHeight?t.Height.toJSON(E.timeoutHeight):void 0),E.timeoutTimestamp!==void 0&&(D.timeoutTimestamp=(E.timeoutTimestamp||BigInt(0)).toString()),E.memo!==void 0&&(D.memo=E.memo),D},fromPartial(E){const D=g();return D.sourcePort=E.sourcePort??"",D.sourceChannel=E.sourceChannel??"",E.token!==void 0&&E.token!==null&&(D.token=n.Coin.fromPartial(E.token)),D.sender=E.sender??"",D.receiver=E.receiver??"",E.timeoutHeight!==void 0&&E.timeoutHeight!==null&&(D.timeoutHeight=t.Height.fromPartial(E.timeoutHeight)),E.timeoutTimestamp!==void 0&&E.timeoutTimestamp!==null&&(D.timeoutTimestamp=BigInt(E.timeoutTimestamp.toString())),D.memo=E.memo??"",D}};function C(){return{sequence:BigInt(0)}}e.MsgTransferResponse={typeUrl:"/ibc.applications.transfer.v1.MsgTransferResponse",encode(E,D=i.BinaryWriter.create()){return E.sequence!==BigInt(0)&&D.uint32(8).uint64(E.sequence),D},decode(E,D){const J=E instanceof i.BinaryReader?E:new i.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=C();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.sequence=J.uint64();break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=C();return(0,o.isSet)(E.sequence)&&(D.sequence=BigInt(E.sequence.toString())),D},toJSON(E){const D={};return E.sequence!==void 0&&(D.sequence=(E.sequence||BigInt(0)).toString()),D},fromPartial(E){const D=C();return E.sequence!==void 0&&E.sequence!==null&&(D.sequence=BigInt(E.sequence.toString())),D}};class w{constructor(D){this.rpc=D,this.Transfer=this.Transfer.bind(this)}Transfer(D){const J=e.MsgTransfer.encode(D).finish();return this.rpc.request("ibc.applications.transfer.v1.Msg","Transfer",J).then(p=>e.MsgTransferResponse.decode(new i.BinaryReader(p)))}}e.MsgClientImpl=w})(Io);Object.defineProperty(hi,"__esModule",{value:!0});hi.createIbcAminoConverters=hi.isAminoMsgTransfer=void 0;const Yo=zn,Zk=Io;function Xk(e){return e.type==="cosmos-sdk/MsgTransfer"}hi.isAminoMsgTransfer=Xk;function jk(){return{"/ibc.applications.transfer.v1.MsgTransfer":{aminoType:"cosmos-sdk/MsgTransfer",toAmino:({sourcePort:e,sourceChannel:n,token:t,sender:i,receiver:o,timeoutHeight:g,timeoutTimestamp:C,memo:w})=>{var E,D,J;return{source_port:e,source_channel:n,token:t,sender:i,receiver:o,timeout_height:g?{revision_height:(E=(0,Yo.omitDefault)(g.revisionHeight))==null?void 0:E.toString(),revision_number:(D=(0,Yo.omitDefault)(g.revisionNumber))==null?void 0:D.toString()}:{},timeout_timestamp:(J=(0,Yo.omitDefault)(C))==null?void 0:J.toString(),memo:(0,Yo.omitDefault)(w)}},fromAmino:({source_port:e,source_channel:n,token:t,sender:i,receiver:o,timeout_height:g,timeout_timestamp:C,memo:w})=>Zk.MsgTransfer.fromPartial({sourcePort:e,sourceChannel:n,token:t,sender:i,receiver:o,timeoutHeight:g?{revisionHeight:BigInt(g.revision_height||"0"),revisionNumber:BigInt(g.revision_number||"0")}:void 0,timeoutTimestamp:BigInt(C||"0"),memo:w??""})}}}hi.createIbcAminoConverters=jk;var gi={},Cc={},Oo={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Acknowledgement=e.PacketId=e.PacketState=e.Packet=e.Counterparty=e.IdentifiedChannel=e.Channel=e.orderToJSON=e.orderFromJSON=e.Order=e.stateToJSON=e.stateFromJSON=e.State=e.protobufPackage=void 0;const n=kt,t=_.binary,i=_.helpers;e.protobufPackage="ibc.core.channel.v1";var o;(function(y){y[y.STATE_UNINITIALIZED_UNSPECIFIED=0]="STATE_UNINITIALIZED_UNSPECIFIED",y[y.STATE_INIT=1]="STATE_INIT",y[y.STATE_TRYOPEN=2]="STATE_TRYOPEN",y[y.STATE_OPEN=3]="STATE_OPEN",y[y.STATE_CLOSED=4]="STATE_CLOSED",y[y.UNRECOGNIZED=-1]="UNRECOGNIZED"})(o||(e.State=o={}));function g(y){switch(y){case 0:case"STATE_UNINITIALIZED_UNSPECIFIED":return o.STATE_UNINITIALIZED_UNSPECIFIED;case 1:case"STATE_INIT":return o.STATE_INIT;case 2:case"STATE_TRYOPEN":return o.STATE_TRYOPEN;case 3:case"STATE_OPEN":return o.STATE_OPEN;case 4:case"STATE_CLOSED":return o.STATE_CLOSED;case-1:case"UNRECOGNIZED":default:return o.UNRECOGNIZED}}e.stateFromJSON=g;function C(y){switch(y){case o.STATE_UNINITIALIZED_UNSPECIFIED:return"STATE_UNINITIALIZED_UNSPECIFIED";case o.STATE_INIT:return"STATE_INIT";case o.STATE_TRYOPEN:return"STATE_TRYOPEN";case o.STATE_OPEN:return"STATE_OPEN";case o.STATE_CLOSED:return"STATE_CLOSED";case o.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.stateToJSON=C;var w;(function(y){y[y.ORDER_NONE_UNSPECIFIED=0]="ORDER_NONE_UNSPECIFIED",y[y.ORDER_UNORDERED=1]="ORDER_UNORDERED",y[y.ORDER_ORDERED=2]="ORDER_ORDERED",y[y.UNRECOGNIZED=-1]="UNRECOGNIZED"})(w||(e.Order=w={}));function E(y){switch(y){case 0:case"ORDER_NONE_UNSPECIFIED":return w.ORDER_NONE_UNSPECIFIED;case 1:case"ORDER_UNORDERED":return w.ORDER_UNORDERED;case 2:case"ORDER_ORDERED":return w.ORDER_ORDERED;case-1:case"UNRECOGNIZED":default:return w.UNRECOGNIZED}}e.orderFromJSON=E;function D(y){switch(y){case w.ORDER_NONE_UNSPECIFIED:return"ORDER_NONE_UNSPECIFIED";case w.ORDER_UNORDERED:return"ORDER_UNORDERED";case w.ORDER_ORDERED:return"ORDER_ORDERED";case w.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.orderToJSON=D;function J(){return{state:0,ordering:0,counterparty:e.Counterparty.fromPartial({}),connectionHops:[],version:""}}e.Channel={typeUrl:"/ibc.core.channel.v1.Channel",encode(y,B=t.BinaryWriter.create()){y.state!==0&&B.uint32(8).int32(y.state),y.ordering!==0&&B.uint32(16).int32(y.ordering),y.counterparty!==void 0&&e.Counterparty.encode(y.counterparty,B.uint32(26).fork()).ldelim();for(const N of y.connectionHops)B.uint32(34).string(N);return y.version!==""&&B.uint32(42).string(y.version),B},decode(y,B){const N=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=B===void 0?N.len:N.pos+B;const W=J();for(;N.pos<U;){const r=N.uint32();switch(r>>>3){case 1:W.state=N.int32();break;case 2:W.ordering=N.int32();break;case 3:W.counterparty=e.Counterparty.decode(N,N.uint32());break;case 4:W.connectionHops.push(N.string());break;case 5:W.version=N.string();break;default:N.skipType(r&7);break}}return W},fromJSON(y){const B=J();return(0,i.isSet)(y.state)&&(B.state=g(y.state)),(0,i.isSet)(y.ordering)&&(B.ordering=E(y.ordering)),(0,i.isSet)(y.counterparty)&&(B.counterparty=e.Counterparty.fromJSON(y.counterparty)),Array.isArray(y==null?void 0:y.connectionHops)&&(B.connectionHops=y.connectionHops.map(N=>String(N))),(0,i.isSet)(y.version)&&(B.version=String(y.version)),B},toJSON(y){const B={};return y.state!==void 0&&(B.state=C(y.state)),y.ordering!==void 0&&(B.ordering=D(y.ordering)),y.counterparty!==void 0&&(B.counterparty=y.counterparty?e.Counterparty.toJSON(y.counterparty):void 0),y.connectionHops?B.connectionHops=y.connectionHops.map(N=>N):B.connectionHops=[],y.version!==void 0&&(B.version=y.version),B},fromPartial(y){var N;const B=J();return B.state=y.state??0,B.ordering=y.ordering??0,y.counterparty!==void 0&&y.counterparty!==null&&(B.counterparty=e.Counterparty.fromPartial(y.counterparty)),B.connectionHops=((N=y.connectionHops)==null?void 0:N.map(U=>U))||[],B.version=y.version??"",B}};function b(){return{state:0,ordering:0,counterparty:e.Counterparty.fromPartial({}),connectionHops:[],version:"",portId:"",channelId:""}}e.IdentifiedChannel={typeUrl:"/ibc.core.channel.v1.IdentifiedChannel",encode(y,B=t.BinaryWriter.create()){y.state!==0&&B.uint32(8).int32(y.state),y.ordering!==0&&B.uint32(16).int32(y.ordering),y.counterparty!==void 0&&e.Counterparty.encode(y.counterparty,B.uint32(26).fork()).ldelim();for(const N of y.connectionHops)B.uint32(34).string(N);return y.version!==""&&B.uint32(42).string(y.version),y.portId!==""&&B.uint32(50).string(y.portId),y.channelId!==""&&B.uint32(58).string(y.channelId),B},decode(y,B){const N=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=B===void 0?N.len:N.pos+B;const W=b();for(;N.pos<U;){const r=N.uint32();switch(r>>>3){case 1:W.state=N.int32();break;case 2:W.ordering=N.int32();break;case 3:W.counterparty=e.Counterparty.decode(N,N.uint32());break;case 4:W.connectionHops.push(N.string());break;case 5:W.version=N.string();break;case 6:W.portId=N.string();break;case 7:W.channelId=N.string();break;default:N.skipType(r&7);break}}return W},fromJSON(y){const B=b();return(0,i.isSet)(y.state)&&(B.state=g(y.state)),(0,i.isSet)(y.ordering)&&(B.ordering=E(y.ordering)),(0,i.isSet)(y.counterparty)&&(B.counterparty=e.Counterparty.fromJSON(y.counterparty)),Array.isArray(y==null?void 0:y.connectionHops)&&(B.connectionHops=y.connectionHops.map(N=>String(N))),(0,i.isSet)(y.version)&&(B.version=String(y.version)),(0,i.isSet)(y.portId)&&(B.portId=String(y.portId)),(0,i.isSet)(y.channelId)&&(B.channelId=String(y.channelId)),B},toJSON(y){const B={};return y.state!==void 0&&(B.state=C(y.state)),y.ordering!==void 0&&(B.ordering=D(y.ordering)),y.counterparty!==void 0&&(B.counterparty=y.counterparty?e.Counterparty.toJSON(y.counterparty):void 0),y.connectionHops?B.connectionHops=y.connectionHops.map(N=>N):B.connectionHops=[],y.version!==void 0&&(B.version=y.version),y.portId!==void 0&&(B.portId=y.portId),y.channelId!==void 0&&(B.channelId=y.channelId),B},fromPartial(y){var N;const B=b();return B.state=y.state??0,B.ordering=y.ordering??0,y.counterparty!==void 0&&y.counterparty!==null&&(B.counterparty=e.Counterparty.fromPartial(y.counterparty)),B.connectionHops=((N=y.connectionHops)==null?void 0:N.map(U=>U))||[],B.version=y.version??"",B.portId=y.portId??"",B.channelId=y.channelId??"",B}};function p(){return{portId:"",channelId:""}}e.Counterparty={typeUrl:"/ibc.core.channel.v1.Counterparty",encode(y,B=t.BinaryWriter.create()){return y.portId!==""&&B.uint32(10).string(y.portId),y.channelId!==""&&B.uint32(18).string(y.channelId),B},decode(y,B){const N=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=B===void 0?N.len:N.pos+B;const W=p();for(;N.pos<U;){const r=N.uint32();switch(r>>>3){case 1:W.portId=N.string();break;case 2:W.channelId=N.string();break;default:N.skipType(r&7);break}}return W},fromJSON(y){const B=p();return(0,i.isSet)(y.portId)&&(B.portId=String(y.portId)),(0,i.isSet)(y.channelId)&&(B.channelId=String(y.channelId)),B},toJSON(y){const B={};return y.portId!==void 0&&(B.portId=y.portId),y.channelId!==void 0&&(B.channelId=y.channelId),B},fromPartial(y){const B=p();return B.portId=y.portId??"",B.channelId=y.channelId??"",B}};function S(){return{sequence:BigInt(0),sourcePort:"",sourceChannel:"",destinationPort:"",destinationChannel:"",data:new Uint8Array,timeoutHeight:n.Height.fromPartial({}),timeoutTimestamp:BigInt(0)}}e.Packet={typeUrl:"/ibc.core.channel.v1.Packet",encode(y,B=t.BinaryWriter.create()){return y.sequence!==BigInt(0)&&B.uint32(8).uint64(y.sequence),y.sourcePort!==""&&B.uint32(18).string(y.sourcePort),y.sourceChannel!==""&&B.uint32(26).string(y.sourceChannel),y.destinationPort!==""&&B.uint32(34).string(y.destinationPort),y.destinationChannel!==""&&B.uint32(42).string(y.destinationChannel),y.data.length!==0&&B.uint32(50).bytes(y.data),y.timeoutHeight!==void 0&&n.Height.encode(y.timeoutHeight,B.uint32(58).fork()).ldelim(),y.timeoutTimestamp!==BigInt(0)&&B.uint32(64).uint64(y.timeoutTimestamp),B},decode(y,B){const N=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=B===void 0?N.len:N.pos+B;const W=S();for(;N.pos<U;){const r=N.uint32();switch(r>>>3){case 1:W.sequence=N.uint64();break;case 2:W.sourcePort=N.string();break;case 3:W.sourceChannel=N.string();break;case 4:W.destinationPort=N.string();break;case 5:W.destinationChannel=N.string();break;case 6:W.data=N.bytes();break;case 7:W.timeoutHeight=n.Height.decode(N,N.uint32());break;case 8:W.timeoutTimestamp=N.uint64();break;default:N.skipType(r&7);break}}return W},fromJSON(y){const B=S();return(0,i.isSet)(y.sequence)&&(B.sequence=BigInt(y.sequence.toString())),(0,i.isSet)(y.sourcePort)&&(B.sourcePort=String(y.sourcePort)),(0,i.isSet)(y.sourceChannel)&&(B.sourceChannel=String(y.sourceChannel)),(0,i.isSet)(y.destinationPort)&&(B.destinationPort=String(y.destinationPort)),(0,i.isSet)(y.destinationChannel)&&(B.destinationChannel=String(y.destinationChannel)),(0,i.isSet)(y.data)&&(B.data=(0,i.bytesFromBase64)(y.data)),(0,i.isSet)(y.timeoutHeight)&&(B.timeoutHeight=n.Height.fromJSON(y.timeoutHeight)),(0,i.isSet)(y.timeoutTimestamp)&&(B.timeoutTimestamp=BigInt(y.timeoutTimestamp.toString())),B},toJSON(y){const B={};return y.sequence!==void 0&&(B.sequence=(y.sequence||BigInt(0)).toString()),y.sourcePort!==void 0&&(B.sourcePort=y.sourcePort),y.sourceChannel!==void 0&&(B.sourceChannel=y.sourceChannel),y.destinationPort!==void 0&&(B.destinationPort=y.destinationPort),y.destinationChannel!==void 0&&(B.destinationChannel=y.destinationChannel),y.data!==void 0&&(B.data=(0,i.base64FromBytes)(y.data!==void 0?y.data:new Uint8Array)),y.timeoutHeight!==void 0&&(B.timeoutHeight=y.timeoutHeight?n.Height.toJSON(y.timeoutHeight):void 0),y.timeoutTimestamp!==void 0&&(B.timeoutTimestamp=(y.timeoutTimestamp||BigInt(0)).toString()),B},fromPartial(y){const B=S();return y.sequence!==void 0&&y.sequence!==null&&(B.sequence=BigInt(y.sequence.toString())),B.sourcePort=y.sourcePort??"",B.sourceChannel=y.sourceChannel??"",B.destinationPort=y.destinationPort??"",B.destinationChannel=y.destinationChannel??"",B.data=y.data??new Uint8Array,y.timeoutHeight!==void 0&&y.timeoutHeight!==null&&(B.timeoutHeight=n.Height.fromPartial(y.timeoutHeight)),y.timeoutTimestamp!==void 0&&y.timeoutTimestamp!==null&&(B.timeoutTimestamp=BigInt(y.timeoutTimestamp.toString())),B}};function R(){return{portId:"",channelId:"",sequence:BigInt(0),data:new Uint8Array}}e.PacketState={typeUrl:"/ibc.core.channel.v1.PacketState",encode(y,B=t.BinaryWriter.create()){return y.portId!==""&&B.uint32(10).string(y.portId),y.channelId!==""&&B.uint32(18).string(y.channelId),y.sequence!==BigInt(0)&&B.uint32(24).uint64(y.sequence),y.data.length!==0&&B.uint32(34).bytes(y.data),B},decode(y,B){const N=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=B===void 0?N.len:N.pos+B;const W=R();for(;N.pos<U;){const r=N.uint32();switch(r>>>3){case 1:W.portId=N.string();break;case 2:W.channelId=N.string();break;case 3:W.sequence=N.uint64();break;case 4:W.data=N.bytes();break;default:N.skipType(r&7);break}}return W},fromJSON(y){const B=R();return(0,i.isSet)(y.portId)&&(B.portId=String(y.portId)),(0,i.isSet)(y.channelId)&&(B.channelId=String(y.channelId)),(0,i.isSet)(y.sequence)&&(B.sequence=BigInt(y.sequence.toString())),(0,i.isSet)(y.data)&&(B.data=(0,i.bytesFromBase64)(y.data)),B},toJSON(y){const B={};return y.portId!==void 0&&(B.portId=y.portId),y.channelId!==void 0&&(B.channelId=y.channelId),y.sequence!==void 0&&(B.sequence=(y.sequence||BigInt(0)).toString()),y.data!==void 0&&(B.data=(0,i.base64FromBytes)(y.data!==void 0?y.data:new Uint8Array)),B},fromPartial(y){const B=R();return B.portId=y.portId??"",B.channelId=y.channelId??"",y.sequence!==void 0&&y.sequence!==null&&(B.sequence=BigInt(y.sequence.toString())),B.data=y.data??new Uint8Array,B}};function u(){return{portId:"",channelId:"",sequence:BigInt(0)}}e.PacketId={typeUrl:"/ibc.core.channel.v1.PacketId",encode(y,B=t.BinaryWriter.create()){return y.portId!==""&&B.uint32(10).string(y.portId),y.channelId!==""&&B.uint32(18).string(y.channelId),y.sequence!==BigInt(0)&&B.uint32(24).uint64(y.sequence),B},decode(y,B){const N=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=B===void 0?N.len:N.pos+B;const W=u();for(;N.pos<U;){const r=N.uint32();switch(r>>>3){case 1:W.portId=N.string();break;case 2:W.channelId=N.string();break;case 3:W.sequence=N.uint64();break;default:N.skipType(r&7);break}}return W},fromJSON(y){const B=u();return(0,i.isSet)(y.portId)&&(B.portId=String(y.portId)),(0,i.isSet)(y.channelId)&&(B.channelId=String(y.channelId)),(0,i.isSet)(y.sequence)&&(B.sequence=BigInt(y.sequence.toString())),B},toJSON(y){const B={};return y.portId!==void 0&&(B.portId=y.portId),y.channelId!==void 0&&(B.channelId=y.channelId),y.sequence!==void 0&&(B.sequence=(y.sequence||BigInt(0)).toString()),B},fromPartial(y){const B=u();return B.portId=y.portId??"",B.channelId=y.channelId??"",y.sequence!==void 0&&y.sequence!==null&&(B.sequence=BigInt(y.sequence.toString())),B}};function c(){return{result:void 0,error:void 0}}e.Acknowledgement={typeUrl:"/ibc.core.channel.v1.Acknowledgement",encode(y,B=t.BinaryWriter.create()){return y.result!==void 0&&B.uint32(170).bytes(y.result),y.error!==void 0&&B.uint32(178).string(y.error),B},decode(y,B){const N=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=B===void 0?N.len:N.pos+B;const W=c();for(;N.pos<U;){const r=N.uint32();switch(r>>>3){case 21:W.result=N.bytes();break;case 22:W.error=N.string();break;default:N.skipType(r&7);break}}return W},fromJSON(y){const B=c();return(0,i.isSet)(y.result)&&(B.result=(0,i.bytesFromBase64)(y.result)),(0,i.isSet)(y.error)&&(B.error=String(y.error)),B},toJSON(y){const B={};return y.result!==void 0&&(B.result=y.result!==void 0?(0,i.base64FromBytes)(y.result):void 0),y.error!==void 0&&(B.error=y.error),B},fromPartial(y){const B=c();return B.result=y.result??void 0,B.error=y.error??void 0,B}}})(Oo);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgAcknowledgementResponse=e.MsgAcknowledgement=e.MsgTimeoutOnCloseResponse=e.MsgTimeoutOnClose=e.MsgTimeoutResponse=e.MsgTimeout=e.MsgRecvPacketResponse=e.MsgRecvPacket=e.MsgChannelCloseConfirmResponse=e.MsgChannelCloseConfirm=e.MsgChannelCloseInitResponse=e.MsgChannelCloseInit=e.MsgChannelOpenConfirmResponse=e.MsgChannelOpenConfirm=e.MsgChannelOpenAckResponse=e.MsgChannelOpenAck=e.MsgChannelOpenTryResponse=e.MsgChannelOpenTry=e.MsgChannelOpenInitResponse=e.MsgChannelOpenInit=e.responseResultTypeToJSON=e.responseResultTypeFromJSON=e.ResponseResultType=e.protobufPackage=void 0;const n=Oo,t=kt,i=_.binary,o=_.helpers;e.protobufPackage="ibc.core.channel.v1";var g;(function(m){m[m.RESPONSE_RESULT_TYPE_UNSPECIFIED=0]="RESPONSE_RESULT_TYPE_UNSPECIFIED",m[m.RESPONSE_RESULT_TYPE_NOOP=1]="RESPONSE_RESULT_TYPE_NOOP",m[m.RESPONSE_RESULT_TYPE_SUCCESS=2]="RESPONSE_RESULT_TYPE_SUCCESS",m[m.UNRECOGNIZED=-1]="UNRECOGNIZED"})(g||(e.ResponseResultType=g={}));function C(m){switch(m){case 0:case"RESPONSE_RESULT_TYPE_UNSPECIFIED":return g.RESPONSE_RESULT_TYPE_UNSPECIFIED;case 1:case"RESPONSE_RESULT_TYPE_NOOP":return g.RESPONSE_RESULT_TYPE_NOOP;case 2:case"RESPONSE_RESULT_TYPE_SUCCESS":return g.RESPONSE_RESULT_TYPE_SUCCESS;case-1:case"UNRECOGNIZED":default:return g.UNRECOGNIZED}}e.responseResultTypeFromJSON=C;function w(m){switch(m){case g.RESPONSE_RESULT_TYPE_UNSPECIFIED:return"RESPONSE_RESULT_TYPE_UNSPECIFIED";case g.RESPONSE_RESULT_TYPE_NOOP:return"RESPONSE_RESULT_TYPE_NOOP";case g.RESPONSE_RESULT_TYPE_SUCCESS:return"RESPONSE_RESULT_TYPE_SUCCESS";case g.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.responseResultTypeToJSON=w;function E(){return{portId:"",channel:n.Channel.fromPartial({}),signer:""}}e.MsgChannelOpenInit={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenInit",encode(m,h=i.BinaryWriter.create()){return m.portId!==""&&h.uint32(10).string(m.portId),m.channel!==void 0&&n.Channel.encode(m.channel,h.uint32(18).fork()).ldelim(),m.signer!==""&&h.uint32(26).string(m.signer),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=E();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.portId=T.string();break;case 2:H.channel=n.Channel.decode(T,T.uint32());break;case 3:H.signer=T.string();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=E();return(0,o.isSet)(m.portId)&&(h.portId=String(m.portId)),(0,o.isSet)(m.channel)&&(h.channel=n.Channel.fromJSON(m.channel)),(0,o.isSet)(m.signer)&&(h.signer=String(m.signer)),h},toJSON(m){const h={};return m.portId!==void 0&&(h.portId=m.portId),m.channel!==void 0&&(h.channel=m.channel?n.Channel.toJSON(m.channel):void 0),m.signer!==void 0&&(h.signer=m.signer),h},fromPartial(m){const h=E();return h.portId=m.portId??"",m.channel!==void 0&&m.channel!==null&&(h.channel=n.Channel.fromPartial(m.channel)),h.signer=m.signer??"",h}};function D(){return{channelId:"",version:""}}e.MsgChannelOpenInitResponse={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenInitResponse",encode(m,h=i.BinaryWriter.create()){return m.channelId!==""&&h.uint32(10).string(m.channelId),m.version!==""&&h.uint32(18).string(m.version),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=D();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.channelId=T.string();break;case 2:H.version=T.string();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=D();return(0,o.isSet)(m.channelId)&&(h.channelId=String(m.channelId)),(0,o.isSet)(m.version)&&(h.version=String(m.version)),h},toJSON(m){const h={};return m.channelId!==void 0&&(h.channelId=m.channelId),m.version!==void 0&&(h.version=m.version),h},fromPartial(m){const h=D();return h.channelId=m.channelId??"",h.version=m.version??"",h}};function J(){return{portId:"",previousChannelId:"",channel:n.Channel.fromPartial({}),counterpartyVersion:"",proofInit:new Uint8Array,proofHeight:t.Height.fromPartial({}),signer:""}}e.MsgChannelOpenTry={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenTry",encode(m,h=i.BinaryWriter.create()){return m.portId!==""&&h.uint32(10).string(m.portId),m.previousChannelId!==""&&h.uint32(18).string(m.previousChannelId),m.channel!==void 0&&n.Channel.encode(m.channel,h.uint32(26).fork()).ldelim(),m.counterpartyVersion!==""&&h.uint32(34).string(m.counterpartyVersion),m.proofInit.length!==0&&h.uint32(42).bytes(m.proofInit),m.proofHeight!==void 0&&t.Height.encode(m.proofHeight,h.uint32(50).fork()).ldelim(),m.signer!==""&&h.uint32(58).string(m.signer),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=J();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.portId=T.string();break;case 2:H.previousChannelId=T.string();break;case 3:H.channel=n.Channel.decode(T,T.uint32());break;case 4:H.counterpartyVersion=T.string();break;case 5:H.proofInit=T.bytes();break;case 6:H.proofHeight=t.Height.decode(T,T.uint32());break;case 7:H.signer=T.string();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=J();return(0,o.isSet)(m.portId)&&(h.portId=String(m.portId)),(0,o.isSet)(m.previousChannelId)&&(h.previousChannelId=String(m.previousChannelId)),(0,o.isSet)(m.channel)&&(h.channel=n.Channel.fromJSON(m.channel)),(0,o.isSet)(m.counterpartyVersion)&&(h.counterpartyVersion=String(m.counterpartyVersion)),(0,o.isSet)(m.proofInit)&&(h.proofInit=(0,o.bytesFromBase64)(m.proofInit)),(0,o.isSet)(m.proofHeight)&&(h.proofHeight=t.Height.fromJSON(m.proofHeight)),(0,o.isSet)(m.signer)&&(h.signer=String(m.signer)),h},toJSON(m){const h={};return m.portId!==void 0&&(h.portId=m.portId),m.previousChannelId!==void 0&&(h.previousChannelId=m.previousChannelId),m.channel!==void 0&&(h.channel=m.channel?n.Channel.toJSON(m.channel):void 0),m.counterpartyVersion!==void 0&&(h.counterpartyVersion=m.counterpartyVersion),m.proofInit!==void 0&&(h.proofInit=(0,o.base64FromBytes)(m.proofInit!==void 0?m.proofInit:new Uint8Array)),m.proofHeight!==void 0&&(h.proofHeight=m.proofHeight?t.Height.toJSON(m.proofHeight):void 0),m.signer!==void 0&&(h.signer=m.signer),h},fromPartial(m){const h=J();return h.portId=m.portId??"",h.previousChannelId=m.previousChannelId??"",m.channel!==void 0&&m.channel!==null&&(h.channel=n.Channel.fromPartial(m.channel)),h.counterpartyVersion=m.counterpartyVersion??"",h.proofInit=m.proofInit??new Uint8Array,m.proofHeight!==void 0&&m.proofHeight!==null&&(h.proofHeight=t.Height.fromPartial(m.proofHeight)),h.signer=m.signer??"",h}};function b(){return{version:""}}e.MsgChannelOpenTryResponse={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenTryResponse",encode(m,h=i.BinaryWriter.create()){return m.version!==""&&h.uint32(10).string(m.version),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=b();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.version=T.string();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=b();return(0,o.isSet)(m.version)&&(h.version=String(m.version)),h},toJSON(m){const h={};return m.version!==void 0&&(h.version=m.version),h},fromPartial(m){const h=b();return h.version=m.version??"",h}};function p(){return{portId:"",channelId:"",counterpartyChannelId:"",counterpartyVersion:"",proofTry:new Uint8Array,proofHeight:t.Height.fromPartial({}),signer:""}}e.MsgChannelOpenAck={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenAck",encode(m,h=i.BinaryWriter.create()){return m.portId!==""&&h.uint32(10).string(m.portId),m.channelId!==""&&h.uint32(18).string(m.channelId),m.counterpartyChannelId!==""&&h.uint32(26).string(m.counterpartyChannelId),m.counterpartyVersion!==""&&h.uint32(34).string(m.counterpartyVersion),m.proofTry.length!==0&&h.uint32(42).bytes(m.proofTry),m.proofHeight!==void 0&&t.Height.encode(m.proofHeight,h.uint32(50).fork()).ldelim(),m.signer!==""&&h.uint32(58).string(m.signer),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=p();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.portId=T.string();break;case 2:H.channelId=T.string();break;case 3:H.counterpartyChannelId=T.string();break;case 4:H.counterpartyVersion=T.string();break;case 5:H.proofTry=T.bytes();break;case 6:H.proofHeight=t.Height.decode(T,T.uint32());break;case 7:H.signer=T.string();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=p();return(0,o.isSet)(m.portId)&&(h.portId=String(m.portId)),(0,o.isSet)(m.channelId)&&(h.channelId=String(m.channelId)),(0,o.isSet)(m.counterpartyChannelId)&&(h.counterpartyChannelId=String(m.counterpartyChannelId)),(0,o.isSet)(m.counterpartyVersion)&&(h.counterpartyVersion=String(m.counterpartyVersion)),(0,o.isSet)(m.proofTry)&&(h.proofTry=(0,o.bytesFromBase64)(m.proofTry)),(0,o.isSet)(m.proofHeight)&&(h.proofHeight=t.Height.fromJSON(m.proofHeight)),(0,o.isSet)(m.signer)&&(h.signer=String(m.signer)),h},toJSON(m){const h={};return m.portId!==void 0&&(h.portId=m.portId),m.channelId!==void 0&&(h.channelId=m.channelId),m.counterpartyChannelId!==void 0&&(h.counterpartyChannelId=m.counterpartyChannelId),m.counterpartyVersion!==void 0&&(h.counterpartyVersion=m.counterpartyVersion),m.proofTry!==void 0&&(h.proofTry=(0,o.base64FromBytes)(m.proofTry!==void 0?m.proofTry:new Uint8Array)),m.proofHeight!==void 0&&(h.proofHeight=m.proofHeight?t.Height.toJSON(m.proofHeight):void 0),m.signer!==void 0&&(h.signer=m.signer),h},fromPartial(m){const h=p();return h.portId=m.portId??"",h.channelId=m.channelId??"",h.counterpartyChannelId=m.counterpartyChannelId??"",h.counterpartyVersion=m.counterpartyVersion??"",h.proofTry=m.proofTry??new Uint8Array,m.proofHeight!==void 0&&m.proofHeight!==null&&(h.proofHeight=t.Height.fromPartial(m.proofHeight)),h.signer=m.signer??"",h}};function S(){return{}}e.MsgChannelOpenAckResponse={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenAckResponse",encode(m,h=i.BinaryWriter.create()){return h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=S();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){default:T.skipType(a&7);break}}return H},fromJSON(m){return S()},toJSON(m){return{}},fromPartial(m){return S()}};function R(){return{portId:"",channelId:"",proofAck:new Uint8Array,proofHeight:t.Height.fromPartial({}),signer:""}}e.MsgChannelOpenConfirm={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenConfirm",encode(m,h=i.BinaryWriter.create()){return m.portId!==""&&h.uint32(10).string(m.portId),m.channelId!==""&&h.uint32(18).string(m.channelId),m.proofAck.length!==0&&h.uint32(26).bytes(m.proofAck),m.proofHeight!==void 0&&t.Height.encode(m.proofHeight,h.uint32(34).fork()).ldelim(),m.signer!==""&&h.uint32(42).string(m.signer),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=R();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.portId=T.string();break;case 2:H.channelId=T.string();break;case 3:H.proofAck=T.bytes();break;case 4:H.proofHeight=t.Height.decode(T,T.uint32());break;case 5:H.signer=T.string();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=R();return(0,o.isSet)(m.portId)&&(h.portId=String(m.portId)),(0,o.isSet)(m.channelId)&&(h.channelId=String(m.channelId)),(0,o.isSet)(m.proofAck)&&(h.proofAck=(0,o.bytesFromBase64)(m.proofAck)),(0,o.isSet)(m.proofHeight)&&(h.proofHeight=t.Height.fromJSON(m.proofHeight)),(0,o.isSet)(m.signer)&&(h.signer=String(m.signer)),h},toJSON(m){const h={};return m.portId!==void 0&&(h.portId=m.portId),m.channelId!==void 0&&(h.channelId=m.channelId),m.proofAck!==void 0&&(h.proofAck=(0,o.base64FromBytes)(m.proofAck!==void 0?m.proofAck:new Uint8Array)),m.proofHeight!==void 0&&(h.proofHeight=m.proofHeight?t.Height.toJSON(m.proofHeight):void 0),m.signer!==void 0&&(h.signer=m.signer),h},fromPartial(m){const h=R();return h.portId=m.portId??"",h.channelId=m.channelId??"",h.proofAck=m.proofAck??new Uint8Array,m.proofHeight!==void 0&&m.proofHeight!==null&&(h.proofHeight=t.Height.fromPartial(m.proofHeight)),h.signer=m.signer??"",h}};function u(){return{}}e.MsgChannelOpenConfirmResponse={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenConfirmResponse",encode(m,h=i.BinaryWriter.create()){return h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=u();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){default:T.skipType(a&7);break}}return H},fromJSON(m){return u()},toJSON(m){return{}},fromPartial(m){return u()}};function c(){return{portId:"",channelId:"",signer:""}}e.MsgChannelCloseInit={typeUrl:"/ibc.core.channel.v1.MsgChannelCloseInit",encode(m,h=i.BinaryWriter.create()){return m.portId!==""&&h.uint32(10).string(m.portId),m.channelId!==""&&h.uint32(18).string(m.channelId),m.signer!==""&&h.uint32(26).string(m.signer),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=c();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.portId=T.string();break;case 2:H.channelId=T.string();break;case 3:H.signer=T.string();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=c();return(0,o.isSet)(m.portId)&&(h.portId=String(m.portId)),(0,o.isSet)(m.channelId)&&(h.channelId=String(m.channelId)),(0,o.isSet)(m.signer)&&(h.signer=String(m.signer)),h},toJSON(m){const h={};return m.portId!==void 0&&(h.portId=m.portId),m.channelId!==void 0&&(h.channelId=m.channelId),m.signer!==void 0&&(h.signer=m.signer),h},fromPartial(m){const h=c();return h.portId=m.portId??"",h.channelId=m.channelId??"",h.signer=m.signer??"",h}};function y(){return{}}e.MsgChannelCloseInitResponse={typeUrl:"/ibc.core.channel.v1.MsgChannelCloseInitResponse",encode(m,h=i.BinaryWriter.create()){return h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=y();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){default:T.skipType(a&7);break}}return H},fromJSON(m){return y()},toJSON(m){return{}},fromPartial(m){return y()}};function B(){return{portId:"",channelId:"",proofInit:new Uint8Array,proofHeight:t.Height.fromPartial({}),signer:""}}e.MsgChannelCloseConfirm={typeUrl:"/ibc.core.channel.v1.MsgChannelCloseConfirm",encode(m,h=i.BinaryWriter.create()){return m.portId!==""&&h.uint32(10).string(m.portId),m.channelId!==""&&h.uint32(18).string(m.channelId),m.proofInit.length!==0&&h.uint32(26).bytes(m.proofInit),m.proofHeight!==void 0&&t.Height.encode(m.proofHeight,h.uint32(34).fork()).ldelim(),m.signer!==""&&h.uint32(42).string(m.signer),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=B();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.portId=T.string();break;case 2:H.channelId=T.string();break;case 3:H.proofInit=T.bytes();break;case 4:H.proofHeight=t.Height.decode(T,T.uint32());break;case 5:H.signer=T.string();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=B();return(0,o.isSet)(m.portId)&&(h.portId=String(m.portId)),(0,o.isSet)(m.channelId)&&(h.channelId=String(m.channelId)),(0,o.isSet)(m.proofInit)&&(h.proofInit=(0,o.bytesFromBase64)(m.proofInit)),(0,o.isSet)(m.proofHeight)&&(h.proofHeight=t.Height.fromJSON(m.proofHeight)),(0,o.isSet)(m.signer)&&(h.signer=String(m.signer)),h},toJSON(m){const h={};return m.portId!==void 0&&(h.portId=m.portId),m.channelId!==void 0&&(h.channelId=m.channelId),m.proofInit!==void 0&&(h.proofInit=(0,o.base64FromBytes)(m.proofInit!==void 0?m.proofInit:new Uint8Array)),m.proofHeight!==void 0&&(h.proofHeight=m.proofHeight?t.Height.toJSON(m.proofHeight):void 0),m.signer!==void 0&&(h.signer=m.signer),h},fromPartial(m){const h=B();return h.portId=m.portId??"",h.channelId=m.channelId??"",h.proofInit=m.proofInit??new Uint8Array,m.proofHeight!==void 0&&m.proofHeight!==null&&(h.proofHeight=t.Height.fromPartial(m.proofHeight)),h.signer=m.signer??"",h}};function N(){return{}}e.MsgChannelCloseConfirmResponse={typeUrl:"/ibc.core.channel.v1.MsgChannelCloseConfirmResponse",encode(m,h=i.BinaryWriter.create()){return h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=N();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){default:T.skipType(a&7);break}}return H},fromJSON(m){return N()},toJSON(m){return{}},fromPartial(m){return N()}};function U(){return{packet:n.Packet.fromPartial({}),proofCommitment:new Uint8Array,proofHeight:t.Height.fromPartial({}),signer:""}}e.MsgRecvPacket={typeUrl:"/ibc.core.channel.v1.MsgRecvPacket",encode(m,h=i.BinaryWriter.create()){return m.packet!==void 0&&n.Packet.encode(m.packet,h.uint32(10).fork()).ldelim(),m.proofCommitment.length!==0&&h.uint32(18).bytes(m.proofCommitment),m.proofHeight!==void 0&&t.Height.encode(m.proofHeight,h.uint32(26).fork()).ldelim(),m.signer!==""&&h.uint32(34).string(m.signer),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=U();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.packet=n.Packet.decode(T,T.uint32());break;case 2:H.proofCommitment=T.bytes();break;case 3:H.proofHeight=t.Height.decode(T,T.uint32());break;case 4:H.signer=T.string();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=U();return(0,o.isSet)(m.packet)&&(h.packet=n.Packet.fromJSON(m.packet)),(0,o.isSet)(m.proofCommitment)&&(h.proofCommitment=(0,o.bytesFromBase64)(m.proofCommitment)),(0,o.isSet)(m.proofHeight)&&(h.proofHeight=t.Height.fromJSON(m.proofHeight)),(0,o.isSet)(m.signer)&&(h.signer=String(m.signer)),h},toJSON(m){const h={};return m.packet!==void 0&&(h.packet=m.packet?n.Packet.toJSON(m.packet):void 0),m.proofCommitment!==void 0&&(h.proofCommitment=(0,o.base64FromBytes)(m.proofCommitment!==void 0?m.proofCommitment:new Uint8Array)),m.proofHeight!==void 0&&(h.proofHeight=m.proofHeight?t.Height.toJSON(m.proofHeight):void 0),m.signer!==void 0&&(h.signer=m.signer),h},fromPartial(m){const h=U();return m.packet!==void 0&&m.packet!==null&&(h.packet=n.Packet.fromPartial(m.packet)),h.proofCommitment=m.proofCommitment??new Uint8Array,m.proofHeight!==void 0&&m.proofHeight!==null&&(h.proofHeight=t.Height.fromPartial(m.proofHeight)),h.signer=m.signer??"",h}};function W(){return{result:0}}e.MsgRecvPacketResponse={typeUrl:"/ibc.core.channel.v1.MsgRecvPacketResponse",encode(m,h=i.BinaryWriter.create()){return m.result!==0&&h.uint32(8).int32(m.result),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=W();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.result=T.int32();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=W();return(0,o.isSet)(m.result)&&(h.result=C(m.result)),h},toJSON(m){const h={};return m.result!==void 0&&(h.result=w(m.result)),h},fromPartial(m){const h=W();return h.result=m.result??0,h}};function r(){return{packet:n.Packet.fromPartial({}),proofUnreceived:new Uint8Array,proofHeight:t.Height.fromPartial({}),nextSequenceRecv:BigInt(0),signer:""}}e.MsgTimeout={typeUrl:"/ibc.core.channel.v1.MsgTimeout",encode(m,h=i.BinaryWriter.create()){return m.packet!==void 0&&n.Packet.encode(m.packet,h.uint32(10).fork()).ldelim(),m.proofUnreceived.length!==0&&h.uint32(18).bytes(m.proofUnreceived),m.proofHeight!==void 0&&t.Height.encode(m.proofHeight,h.uint32(26).fork()).ldelim(),m.nextSequenceRecv!==BigInt(0)&&h.uint32(32).uint64(m.nextSequenceRecv),m.signer!==""&&h.uint32(42).string(m.signer),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=r();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.packet=n.Packet.decode(T,T.uint32());break;case 2:H.proofUnreceived=T.bytes();break;case 3:H.proofHeight=t.Height.decode(T,T.uint32());break;case 4:H.nextSequenceRecv=T.uint64();break;case 5:H.signer=T.string();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=r();return(0,o.isSet)(m.packet)&&(h.packet=n.Packet.fromJSON(m.packet)),(0,o.isSet)(m.proofUnreceived)&&(h.proofUnreceived=(0,o.bytesFromBase64)(m.proofUnreceived)),(0,o.isSet)(m.proofHeight)&&(h.proofHeight=t.Height.fromJSON(m.proofHeight)),(0,o.isSet)(m.nextSequenceRecv)&&(h.nextSequenceRecv=BigInt(m.nextSequenceRecv.toString())),(0,o.isSet)(m.signer)&&(h.signer=String(m.signer)),h},toJSON(m){const h={};return m.packet!==void 0&&(h.packet=m.packet?n.Packet.toJSON(m.packet):void 0),m.proofUnreceived!==void 0&&(h.proofUnreceived=(0,o.base64FromBytes)(m.proofUnreceived!==void 0?m.proofUnreceived:new Uint8Array)),m.proofHeight!==void 0&&(h.proofHeight=m.proofHeight?t.Height.toJSON(m.proofHeight):void 0),m.nextSequenceRecv!==void 0&&(h.nextSequenceRecv=(m.nextSequenceRecv||BigInt(0)).toString()),m.signer!==void 0&&(h.signer=m.signer),h},fromPartial(m){const h=r();return m.packet!==void 0&&m.packet!==null&&(h.packet=n.Packet.fromPartial(m.packet)),h.proofUnreceived=m.proofUnreceived??new Uint8Array,m.proofHeight!==void 0&&m.proofHeight!==null&&(h.proofHeight=t.Height.fromPartial(m.proofHeight)),m.nextSequenceRecv!==void 0&&m.nextSequenceRecv!==null&&(h.nextSequenceRecv=BigInt(m.nextSequenceRecv.toString())),h.signer=m.signer??"",h}};function s(){return{result:0}}e.MsgTimeoutResponse={typeUrl:"/ibc.core.channel.v1.MsgTimeoutResponse",encode(m,h=i.BinaryWriter.create()){return m.result!==0&&h.uint32(8).int32(m.result),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=s();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.result=T.int32();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=s();return(0,o.isSet)(m.result)&&(h.result=C(m.result)),h},toJSON(m){const h={};return m.result!==void 0&&(h.result=w(m.result)),h},fromPartial(m){const h=s();return h.result=m.result??0,h}};function O(){return{packet:n.Packet.fromPartial({}),proofUnreceived:new Uint8Array,proofClose:new Uint8Array,proofHeight:t.Height.fromPartial({}),nextSequenceRecv:BigInt(0),signer:""}}e.MsgTimeoutOnClose={typeUrl:"/ibc.core.channel.v1.MsgTimeoutOnClose",encode(m,h=i.BinaryWriter.create()){return m.packet!==void 0&&n.Packet.encode(m.packet,h.uint32(10).fork()).ldelim(),m.proofUnreceived.length!==0&&h.uint32(18).bytes(m.proofUnreceived),m.proofClose.length!==0&&h.uint32(26).bytes(m.proofClose),m.proofHeight!==void 0&&t.Height.encode(m.proofHeight,h.uint32(34).fork()).ldelim(),m.nextSequenceRecv!==BigInt(0)&&h.uint32(40).uint64(m.nextSequenceRecv),m.signer!==""&&h.uint32(50).string(m.signer),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=O();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.packet=n.Packet.decode(T,T.uint32());break;case 2:H.proofUnreceived=T.bytes();break;case 3:H.proofClose=T.bytes();break;case 4:H.proofHeight=t.Height.decode(T,T.uint32());break;case 5:H.nextSequenceRecv=T.uint64();break;case 6:H.signer=T.string();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=O();return(0,o.isSet)(m.packet)&&(h.packet=n.Packet.fromJSON(m.packet)),(0,o.isSet)(m.proofUnreceived)&&(h.proofUnreceived=(0,o.bytesFromBase64)(m.proofUnreceived)),(0,o.isSet)(m.proofClose)&&(h.proofClose=(0,o.bytesFromBase64)(m.proofClose)),(0,o.isSet)(m.proofHeight)&&(h.proofHeight=t.Height.fromJSON(m.proofHeight)),(0,o.isSet)(m.nextSequenceRecv)&&(h.nextSequenceRecv=BigInt(m.nextSequenceRecv.toString())),(0,o.isSet)(m.signer)&&(h.signer=String(m.signer)),h},toJSON(m){const h={};return m.packet!==void 0&&(h.packet=m.packet?n.Packet.toJSON(m.packet):void 0),m.proofUnreceived!==void 0&&(h.proofUnreceived=(0,o.base64FromBytes)(m.proofUnreceived!==void 0?m.proofUnreceived:new Uint8Array)),m.proofClose!==void 0&&(h.proofClose=(0,o.base64FromBytes)(m.proofClose!==void 0?m.proofClose:new Uint8Array)),m.proofHeight!==void 0&&(h.proofHeight=m.proofHeight?t.Height.toJSON(m.proofHeight):void 0),m.nextSequenceRecv!==void 0&&(h.nextSequenceRecv=(m.nextSequenceRecv||BigInt(0)).toString()),m.signer!==void 0&&(h.signer=m.signer),h},fromPartial(m){const h=O();return m.packet!==void 0&&m.packet!==null&&(h.packet=n.Packet.fromPartial(m.packet)),h.proofUnreceived=m.proofUnreceived??new Uint8Array,h.proofClose=m.proofClose??new Uint8Array,m.proofHeight!==void 0&&m.proofHeight!==null&&(h.proofHeight=t.Height.fromPartial(m.proofHeight)),m.nextSequenceRecv!==void 0&&m.nextSequenceRecv!==null&&(h.nextSequenceRecv=BigInt(m.nextSequenceRecv.toString())),h.signer=m.signer??"",h}};function q(){return{result:0}}e.MsgTimeoutOnCloseResponse={typeUrl:"/ibc.core.channel.v1.MsgTimeoutOnCloseResponse",encode(m,h=i.BinaryWriter.create()){return m.result!==0&&h.uint32(8).int32(m.result),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=q();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.result=T.int32();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=q();return(0,o.isSet)(m.result)&&(h.result=C(m.result)),h},toJSON(m){const h={};return m.result!==void 0&&(h.result=w(m.result)),h},fromPartial(m){const h=q();return h.result=m.result??0,h}};function d(){return{packet:n.Packet.fromPartial({}),acknowledgement:new Uint8Array,proofAcked:new Uint8Array,proofHeight:t.Height.fromPartial({}),signer:""}}e.MsgAcknowledgement={typeUrl:"/ibc.core.channel.v1.MsgAcknowledgement",encode(m,h=i.BinaryWriter.create()){return m.packet!==void 0&&n.Packet.encode(m.packet,h.uint32(10).fork()).ldelim(),m.acknowledgement.length!==0&&h.uint32(18).bytes(m.acknowledgement),m.proofAcked.length!==0&&h.uint32(26).bytes(m.proofAcked),m.proofHeight!==void 0&&t.Height.encode(m.proofHeight,h.uint32(34).fork()).ldelim(),m.signer!==""&&h.uint32(42).string(m.signer),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=d();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.packet=n.Packet.decode(T,T.uint32());break;case 2:H.acknowledgement=T.bytes();break;case 3:H.proofAcked=T.bytes();break;case 4:H.proofHeight=t.Height.decode(T,T.uint32());break;case 5:H.signer=T.string();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=d();return(0,o.isSet)(m.packet)&&(h.packet=n.Packet.fromJSON(m.packet)),(0,o.isSet)(m.acknowledgement)&&(h.acknowledgement=(0,o.bytesFromBase64)(m.acknowledgement)),(0,o.isSet)(m.proofAcked)&&(h.proofAcked=(0,o.bytesFromBase64)(m.proofAcked)),(0,o.isSet)(m.proofHeight)&&(h.proofHeight=t.Height.fromJSON(m.proofHeight)),(0,o.isSet)(m.signer)&&(h.signer=String(m.signer)),h},toJSON(m){const h={};return m.packet!==void 0&&(h.packet=m.packet?n.Packet.toJSON(m.packet):void 0),m.acknowledgement!==void 0&&(h.acknowledgement=(0,o.base64FromBytes)(m.acknowledgement!==void 0?m.acknowledgement:new Uint8Array)),m.proofAcked!==void 0&&(h.proofAcked=(0,o.base64FromBytes)(m.proofAcked!==void 0?m.proofAcked:new Uint8Array)),m.proofHeight!==void 0&&(h.proofHeight=m.proofHeight?t.Height.toJSON(m.proofHeight):void 0),m.signer!==void 0&&(h.signer=m.signer),h},fromPartial(m){const h=d();return m.packet!==void 0&&m.packet!==null&&(h.packet=n.Packet.fromPartial(m.packet)),h.acknowledgement=m.acknowledgement??new Uint8Array,h.proofAcked=m.proofAcked??new Uint8Array,m.proofHeight!==void 0&&m.proofHeight!==null&&(h.proofHeight=t.Height.fromPartial(m.proofHeight)),h.signer=m.signer??"",h}};function l(){return{result:0}}e.MsgAcknowledgementResponse={typeUrl:"/ibc.core.channel.v1.MsgAcknowledgementResponse",encode(m,h=i.BinaryWriter.create()){return m.result!==0&&h.uint32(8).int32(m.result),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=l();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.result=T.int32();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=l();return(0,o.isSet)(m.result)&&(h.result=C(m.result)),h},toJSON(m){const h={};return m.result!==void 0&&(h.result=w(m.result)),h},fromPartial(m){const h=l();return h.result=m.result??0,h}};class M{constructor(h){this.rpc=h,this.ChannelOpenInit=this.ChannelOpenInit.bind(this),this.ChannelOpenTry=this.ChannelOpenTry.bind(this),this.ChannelOpenAck=this.ChannelOpenAck.bind(this),this.ChannelOpenConfirm=this.ChannelOpenConfirm.bind(this),this.ChannelCloseInit=this.ChannelCloseInit.bind(this),this.ChannelCloseConfirm=this.ChannelCloseConfirm.bind(this),this.RecvPacket=this.RecvPacket.bind(this),this.Timeout=this.Timeout.bind(this),this.TimeoutOnClose=this.TimeoutOnClose.bind(this),this.Acknowledgement=this.Acknowledgement.bind(this)}ChannelOpenInit(h){const T=e.MsgChannelOpenInit.encode(h).finish();return this.rpc.request("ibc.core.channel.v1.Msg","ChannelOpenInit",T).then(H=>e.MsgChannelOpenInitResponse.decode(new i.BinaryReader(H)))}ChannelOpenTry(h){const T=e.MsgChannelOpenTry.encode(h).finish();return this.rpc.request("ibc.core.channel.v1.Msg","ChannelOpenTry",T).then(H=>e.MsgChannelOpenTryResponse.decode(new i.BinaryReader(H)))}ChannelOpenAck(h){const T=e.MsgChannelOpenAck.encode(h).finish();return this.rpc.request("ibc.core.channel.v1.Msg","ChannelOpenAck",T).then(H=>e.MsgChannelOpenAckResponse.decode(new i.BinaryReader(H)))}ChannelOpenConfirm(h){const T=e.MsgChannelOpenConfirm.encode(h).finish();return this.rpc.request("ibc.core.channel.v1.Msg","ChannelOpenConfirm",T).then(H=>e.MsgChannelOpenConfirmResponse.decode(new i.BinaryReader(H)))}ChannelCloseInit(h){const T=e.MsgChannelCloseInit.encode(h).finish();return this.rpc.request("ibc.core.channel.v1.Msg","ChannelCloseInit",T).then(H=>e.MsgChannelCloseInitResponse.decode(new i.BinaryReader(H)))}ChannelCloseConfirm(h){const T=e.MsgChannelCloseConfirm.encode(h).finish();return this.rpc.request("ibc.core.channel.v1.Msg","ChannelCloseConfirm",T).then(H=>e.MsgChannelCloseConfirmResponse.decode(new i.BinaryReader(H)))}RecvPacket(h){const T=e.MsgRecvPacket.encode(h).finish();return this.rpc.request("ibc.core.channel.v1.Msg","RecvPacket",T).then(H=>e.MsgRecvPacketResponse.decode(new i.BinaryReader(H)))}Timeout(h){const T=e.MsgTimeout.encode(h).finish();return this.rpc.request("ibc.core.channel.v1.Msg","Timeout",T).then(H=>e.MsgTimeoutResponse.decode(new i.BinaryReader(H)))}TimeoutOnClose(h){const T=e.MsgTimeoutOnClose.encode(h).finish();return this.rpc.request("ibc.core.channel.v1.Msg","TimeoutOnClose",T).then(H=>e.MsgTimeoutOnCloseResponse.decode(new i.BinaryReader(H)))}Acknowledgement(h){const T=e.MsgAcknowledgement.encode(h).finish();return this.rpc.request("ibc.core.channel.v1.Msg","Acknowledgement",T).then(H=>e.MsgAcknowledgementResponse.decode(new i.BinaryReader(H)))}}e.MsgClientImpl=M})(Cc);var Rc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgSubmitMisbehaviourResponse=e.MsgSubmitMisbehaviour=e.MsgUpgradeClientResponse=e.MsgUpgradeClient=e.MsgUpdateClientResponse=e.MsgUpdateClient=e.MsgCreateClientResponse=e.MsgCreateClient=e.protobufPackage=void 0;const n=_.any,t=_.binary,i=_.helpers;e.protobufPackage="ibc.core.client.v1";function o(){return{clientState:void 0,consensusState:void 0,signer:""}}e.MsgCreateClient={typeUrl:"/ibc.core.client.v1.MsgCreateClient",encode(S,R=t.BinaryWriter.create()){return S.clientState!==void 0&&n.Any.encode(S.clientState,R.uint32(10).fork()).ldelim(),S.consensusState!==void 0&&n.Any.encode(S.consensusState,R.uint32(18).fork()).ldelim(),S.signer!==""&&R.uint32(26).string(S.signer),R},decode(S,R){const u=S instanceof t.BinaryReader?S:new t.BinaryReader(S);let c=R===void 0?u.len:u.pos+R;const y=o();for(;u.pos<c;){const B=u.uint32();switch(B>>>3){case 1:y.clientState=n.Any.decode(u,u.uint32());break;case 2:y.consensusState=n.Any.decode(u,u.uint32());break;case 3:y.signer=u.string();break;default:u.skipType(B&7);break}}return y},fromJSON(S){const R=o();return(0,i.isSet)(S.clientState)&&(R.clientState=n.Any.fromJSON(S.clientState)),(0,i.isSet)(S.consensusState)&&(R.consensusState=n.Any.fromJSON(S.consensusState)),(0,i.isSet)(S.signer)&&(R.signer=String(S.signer)),R},toJSON(S){const R={};return S.clientState!==void 0&&(R.clientState=S.clientState?n.Any.toJSON(S.clientState):void 0),S.consensusState!==void 0&&(R.consensusState=S.consensusState?n.Any.toJSON(S.consensusState):void 0),S.signer!==void 0&&(R.signer=S.signer),R},fromPartial(S){const R=o();return S.clientState!==void 0&&S.clientState!==null&&(R.clientState=n.Any.fromPartial(S.clientState)),S.consensusState!==void 0&&S.consensusState!==null&&(R.consensusState=n.Any.fromPartial(S.consensusState)),R.signer=S.signer??"",R}};function g(){return{}}e.MsgCreateClientResponse={typeUrl:"/ibc.core.client.v1.MsgCreateClientResponse",encode(S,R=t.BinaryWriter.create()){return R},decode(S,R){const u=S instanceof t.BinaryReader?S:new t.BinaryReader(S);let c=R===void 0?u.len:u.pos+R;const y=g();for(;u.pos<c;){const B=u.uint32();switch(B>>>3){default:u.skipType(B&7);break}}return y},fromJSON(S){return g()},toJSON(S){return{}},fromPartial(S){return g()}};function C(){return{clientId:"",clientMessage:void 0,signer:""}}e.MsgUpdateClient={typeUrl:"/ibc.core.client.v1.MsgUpdateClient",encode(S,R=t.BinaryWriter.create()){return S.clientId!==""&&R.uint32(10).string(S.clientId),S.clientMessage!==void 0&&n.Any.encode(S.clientMessage,R.uint32(18).fork()).ldelim(),S.signer!==""&&R.uint32(26).string(S.signer),R},decode(S,R){const u=S instanceof t.BinaryReader?S:new t.BinaryReader(S);let c=R===void 0?u.len:u.pos+R;const y=C();for(;u.pos<c;){const B=u.uint32();switch(B>>>3){case 1:y.clientId=u.string();break;case 2:y.clientMessage=n.Any.decode(u,u.uint32());break;case 3:y.signer=u.string();break;default:u.skipType(B&7);break}}return y},fromJSON(S){const R=C();return(0,i.isSet)(S.clientId)&&(R.clientId=String(S.clientId)),(0,i.isSet)(S.clientMessage)&&(R.clientMessage=n.Any.fromJSON(S.clientMessage)),(0,i.isSet)(S.signer)&&(R.signer=String(S.signer)),R},toJSON(S){const R={};return S.clientId!==void 0&&(R.clientId=S.clientId),S.clientMessage!==void 0&&(R.clientMessage=S.clientMessage?n.Any.toJSON(S.clientMessage):void 0),S.signer!==void 0&&(R.signer=S.signer),R},fromPartial(S){const R=C();return R.clientId=S.clientId??"",S.clientMessage!==void 0&&S.clientMessage!==null&&(R.clientMessage=n.Any.fromPartial(S.clientMessage)),R.signer=S.signer??"",R}};function w(){return{}}e.MsgUpdateClientResponse={typeUrl:"/ibc.core.client.v1.MsgUpdateClientResponse",encode(S,R=t.BinaryWriter.create()){return R},decode(S,R){const u=S instanceof t.BinaryReader?S:new t.BinaryReader(S);let c=R===void 0?u.len:u.pos+R;const y=w();for(;u.pos<c;){const B=u.uint32();switch(B>>>3){default:u.skipType(B&7);break}}return y},fromJSON(S){return w()},toJSON(S){return{}},fromPartial(S){return w()}};function E(){return{clientId:"",clientState:void 0,consensusState:void 0,proofUpgradeClient:new Uint8Array,proofUpgradeConsensusState:new Uint8Array,signer:""}}e.MsgUpgradeClient={typeUrl:"/ibc.core.client.v1.MsgUpgradeClient",encode(S,R=t.BinaryWriter.create()){return S.clientId!==""&&R.uint32(10).string(S.clientId),S.clientState!==void 0&&n.Any.encode(S.clientState,R.uint32(18).fork()).ldelim(),S.consensusState!==void 0&&n.Any.encode(S.consensusState,R.uint32(26).fork()).ldelim(),S.proofUpgradeClient.length!==0&&R.uint32(34).bytes(S.proofUpgradeClient),S.proofUpgradeConsensusState.length!==0&&R.uint32(42).bytes(S.proofUpgradeConsensusState),S.signer!==""&&R.uint32(50).string(S.signer),R},decode(S,R){const u=S instanceof t.BinaryReader?S:new t.BinaryReader(S);let c=R===void 0?u.len:u.pos+R;const y=E();for(;u.pos<c;){const B=u.uint32();switch(B>>>3){case 1:y.clientId=u.string();break;case 2:y.clientState=n.Any.decode(u,u.uint32());break;case 3:y.consensusState=n.Any.decode(u,u.uint32());break;case 4:y.proofUpgradeClient=u.bytes();break;case 5:y.proofUpgradeConsensusState=u.bytes();break;case 6:y.signer=u.string();break;default:u.skipType(B&7);break}}return y},fromJSON(S){const R=E();return(0,i.isSet)(S.clientId)&&(R.clientId=String(S.clientId)),(0,i.isSet)(S.clientState)&&(R.clientState=n.Any.fromJSON(S.clientState)),(0,i.isSet)(S.consensusState)&&(R.consensusState=n.Any.fromJSON(S.consensusState)),(0,i.isSet)(S.proofUpgradeClient)&&(R.proofUpgradeClient=(0,i.bytesFromBase64)(S.proofUpgradeClient)),(0,i.isSet)(S.proofUpgradeConsensusState)&&(R.proofUpgradeConsensusState=(0,i.bytesFromBase64)(S.proofUpgradeConsensusState)),(0,i.isSet)(S.signer)&&(R.signer=String(S.signer)),R},toJSON(S){const R={};return S.clientId!==void 0&&(R.clientId=S.clientId),S.clientState!==void 0&&(R.clientState=S.clientState?n.Any.toJSON(S.clientState):void 0),S.consensusState!==void 0&&(R.consensusState=S.consensusState?n.Any.toJSON(S.consensusState):void 0),S.proofUpgradeClient!==void 0&&(R.proofUpgradeClient=(0,i.base64FromBytes)(S.proofUpgradeClient!==void 0?S.proofUpgradeClient:new Uint8Array)),S.proofUpgradeConsensusState!==void 0&&(R.proofUpgradeConsensusState=(0,i.base64FromBytes)(S.proofUpgradeConsensusState!==void 0?S.proofUpgradeConsensusState:new Uint8Array)),S.signer!==void 0&&(R.signer=S.signer),R},fromPartial(S){const R=E();return R.clientId=S.clientId??"",S.clientState!==void 0&&S.clientState!==null&&(R.clientState=n.Any.fromPartial(S.clientState)),S.consensusState!==void 0&&S.consensusState!==null&&(R.consensusState=n.Any.fromPartial(S.consensusState)),R.proofUpgradeClient=S.proofUpgradeClient??new Uint8Array,R.proofUpgradeConsensusState=S.proofUpgradeConsensusState??new Uint8Array,R.signer=S.signer??"",R}};function D(){return{}}e.MsgUpgradeClientResponse={typeUrl:"/ibc.core.client.v1.MsgUpgradeClientResponse",encode(S,R=t.BinaryWriter.create()){return R},decode(S,R){const u=S instanceof t.BinaryReader?S:new t.BinaryReader(S);let c=R===void 0?u.len:u.pos+R;const y=D();for(;u.pos<c;){const B=u.uint32();switch(B>>>3){default:u.skipType(B&7);break}}return y},fromJSON(S){return D()},toJSON(S){return{}},fromPartial(S){return D()}};function J(){return{clientId:"",misbehaviour:void 0,signer:""}}e.MsgSubmitMisbehaviour={typeUrl:"/ibc.core.client.v1.MsgSubmitMisbehaviour",encode(S,R=t.BinaryWriter.create()){return S.clientId!==""&&R.uint32(10).string(S.clientId),S.misbehaviour!==void 0&&n.Any.encode(S.misbehaviour,R.uint32(18).fork()).ldelim(),S.signer!==""&&R.uint32(26).string(S.signer),R},decode(S,R){const u=S instanceof t.BinaryReader?S:new t.BinaryReader(S);let c=R===void 0?u.len:u.pos+R;const y=J();for(;u.pos<c;){const B=u.uint32();switch(B>>>3){case 1:y.clientId=u.string();break;case 2:y.misbehaviour=n.Any.decode(u,u.uint32());break;case 3:y.signer=u.string();break;default:u.skipType(B&7);break}}return y},fromJSON(S){const R=J();return(0,i.isSet)(S.clientId)&&(R.clientId=String(S.clientId)),(0,i.isSet)(S.misbehaviour)&&(R.misbehaviour=n.Any.fromJSON(S.misbehaviour)),(0,i.isSet)(S.signer)&&(R.signer=String(S.signer)),R},toJSON(S){const R={};return S.clientId!==void 0&&(R.clientId=S.clientId),S.misbehaviour!==void 0&&(R.misbehaviour=S.misbehaviour?n.Any.toJSON(S.misbehaviour):void 0),S.signer!==void 0&&(R.signer=S.signer),R},fromPartial(S){const R=J();return R.clientId=S.clientId??"",S.misbehaviour!==void 0&&S.misbehaviour!==null&&(R.misbehaviour=n.Any.fromPartial(S.misbehaviour)),R.signer=S.signer??"",R}};function b(){return{}}e.MsgSubmitMisbehaviourResponse={typeUrl:"/ibc.core.client.v1.MsgSubmitMisbehaviourResponse",encode(S,R=t.BinaryWriter.create()){return R},decode(S,R){const u=S instanceof t.BinaryReader?S:new t.BinaryReader(S);let c=R===void 0?u.len:u.pos+R;const y=b();for(;u.pos<c;){const B=u.uint32();switch(B>>>3){default:u.skipType(B&7);break}}return y},fromJSON(S){return b()},toJSON(S){return{}},fromPartial(S){return b()}};class p{constructor(R){this.rpc=R,this.CreateClient=this.CreateClient.bind(this),this.UpdateClient=this.UpdateClient.bind(this),this.UpgradeClient=this.UpgradeClient.bind(this),this.SubmitMisbehaviour=this.SubmitMisbehaviour.bind(this)}CreateClient(R){const u=e.MsgCreateClient.encode(R).finish();return this.rpc.request("ibc.core.client.v1.Msg","CreateClient",u).then(y=>e.MsgCreateClientResponse.decode(new t.BinaryReader(y)))}UpdateClient(R){const u=e.MsgUpdateClient.encode(R).finish();return this.rpc.request("ibc.core.client.v1.Msg","UpdateClient",u).then(y=>e.MsgUpdateClientResponse.decode(new t.BinaryReader(y)))}UpgradeClient(R){const u=e.MsgUpgradeClient.encode(R).finish();return this.rpc.request("ibc.core.client.v1.Msg","UpgradeClient",u).then(y=>e.MsgUpgradeClientResponse.decode(new t.BinaryReader(y)))}SubmitMisbehaviour(R){const u=e.MsgSubmitMisbehaviour.encode(R).finish();return this.rpc.request("ibc.core.client.v1.Msg","SubmitMisbehaviour",u).then(y=>e.MsgSubmitMisbehaviourResponse.decode(new t.BinaryReader(y)))}}e.MsgClientImpl=p})(Rc);var Bc={},bc={},mn={},Ec={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CompressedNonExistenceProof=e.CompressedExistenceProof=e.CompressedBatchEntry=e.CompressedBatchProof=e.BatchEntry=e.BatchProof=e.InnerSpec=e.ProofSpec=e.InnerOp=e.LeafOp=e.CommitmentProof=e.NonExistenceProof=e.ExistenceProof=e.lengthOpToJSON=e.lengthOpFromJSON=e.LengthOp=e.hashOpToJSON=e.hashOpFromJSON=e.HashOp=e.protobufPackage=void 0;const n=_.binary,t=_.helpers;e.protobufPackage="cosmos.ics23.v1";var i;(function(r){r[r.NO_HASH=0]="NO_HASH",r[r.SHA256=1]="SHA256",r[r.SHA512=2]="SHA512",r[r.KECCAK=3]="KECCAK",r[r.RIPEMD160=4]="RIPEMD160",r[r.BITCOIN=5]="BITCOIN",r[r.SHA512_256=6]="SHA512_256",r[r.UNRECOGNIZED=-1]="UNRECOGNIZED"})(i||(e.HashOp=i={}));function o(r){switch(r){case 0:case"NO_HASH":return i.NO_HASH;case 1:case"SHA256":return i.SHA256;case 2:case"SHA512":return i.SHA512;case 3:case"KECCAK":return i.KECCAK;case 4:case"RIPEMD160":return i.RIPEMD160;case 5:case"BITCOIN":return i.BITCOIN;case 6:case"SHA512_256":return i.SHA512_256;case-1:case"UNRECOGNIZED":default:return i.UNRECOGNIZED}}e.hashOpFromJSON=o;function g(r){switch(r){case i.NO_HASH:return"NO_HASH";case i.SHA256:return"SHA256";case i.SHA512:return"SHA512";case i.KECCAK:return"KECCAK";case i.RIPEMD160:return"RIPEMD160";case i.BITCOIN:return"BITCOIN";case i.SHA512_256:return"SHA512_256";case i.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.hashOpToJSON=g;var C;(function(r){r[r.NO_PREFIX=0]="NO_PREFIX",r[r.VAR_PROTO=1]="VAR_PROTO",r[r.VAR_RLP=2]="VAR_RLP",r[r.FIXED32_BIG=3]="FIXED32_BIG",r[r.FIXED32_LITTLE=4]="FIXED32_LITTLE",r[r.FIXED64_BIG=5]="FIXED64_BIG",r[r.FIXED64_LITTLE=6]="FIXED64_LITTLE",r[r.REQUIRE_32_BYTES=7]="REQUIRE_32_BYTES",r[r.REQUIRE_64_BYTES=8]="REQUIRE_64_BYTES",r[r.UNRECOGNIZED=-1]="UNRECOGNIZED"})(C||(e.LengthOp=C={}));function w(r){switch(r){case 0:case"NO_PREFIX":return C.NO_PREFIX;case 1:case"VAR_PROTO":return C.VAR_PROTO;case 2:case"VAR_RLP":return C.VAR_RLP;case 3:case"FIXED32_BIG":return C.FIXED32_BIG;case 4:case"FIXED32_LITTLE":return C.FIXED32_LITTLE;case 5:case"FIXED64_BIG":return C.FIXED64_BIG;case 6:case"FIXED64_LITTLE":return C.FIXED64_LITTLE;case 7:case"REQUIRE_32_BYTES":return C.REQUIRE_32_BYTES;case 8:case"REQUIRE_64_BYTES":return C.REQUIRE_64_BYTES;case-1:case"UNRECOGNIZED":default:return C.UNRECOGNIZED}}e.lengthOpFromJSON=w;function E(r){switch(r){case C.NO_PREFIX:return"NO_PREFIX";case C.VAR_PROTO:return"VAR_PROTO";case C.VAR_RLP:return"VAR_RLP";case C.FIXED32_BIG:return"FIXED32_BIG";case C.FIXED32_LITTLE:return"FIXED32_LITTLE";case C.FIXED64_BIG:return"FIXED64_BIG";case C.FIXED64_LITTLE:return"FIXED64_LITTLE";case C.REQUIRE_32_BYTES:return"REQUIRE_32_BYTES";case C.REQUIRE_64_BYTES:return"REQUIRE_64_BYTES";case C.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.lengthOpToJSON=E;function D(){return{key:new Uint8Array,value:new Uint8Array,leaf:void 0,path:[]}}e.ExistenceProof={typeUrl:"/cosmos.ics23.v1.ExistenceProof",encode(r,s=n.BinaryWriter.create()){r.key.length!==0&&s.uint32(10).bytes(r.key),r.value.length!==0&&s.uint32(18).bytes(r.value),r.leaf!==void 0&&e.LeafOp.encode(r.leaf,s.uint32(26).fork()).ldelim();for(const O of r.path)e.InnerOp.encode(O,s.uint32(34).fork()).ldelim();return s},decode(r,s){const O=r instanceof n.BinaryReader?r:new n.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=D();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.key=O.bytes();break;case 2:d.value=O.bytes();break;case 3:d.leaf=e.LeafOp.decode(O,O.uint32());break;case 4:d.path.push(e.InnerOp.decode(O,O.uint32()));break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=D();return(0,t.isSet)(r.key)&&(s.key=(0,t.bytesFromBase64)(r.key)),(0,t.isSet)(r.value)&&(s.value=(0,t.bytesFromBase64)(r.value)),(0,t.isSet)(r.leaf)&&(s.leaf=e.LeafOp.fromJSON(r.leaf)),Array.isArray(r==null?void 0:r.path)&&(s.path=r.path.map(O=>e.InnerOp.fromJSON(O))),s},toJSON(r){const s={};return r.key!==void 0&&(s.key=(0,t.base64FromBytes)(r.key!==void 0?r.key:new Uint8Array)),r.value!==void 0&&(s.value=(0,t.base64FromBytes)(r.value!==void 0?r.value:new Uint8Array)),r.leaf!==void 0&&(s.leaf=r.leaf?e.LeafOp.toJSON(r.leaf):void 0),r.path?s.path=r.path.map(O=>O?e.InnerOp.toJSON(O):void 0):s.path=[],s},fromPartial(r){var O;const s=D();return s.key=r.key??new Uint8Array,s.value=r.value??new Uint8Array,r.leaf!==void 0&&r.leaf!==null&&(s.leaf=e.LeafOp.fromPartial(r.leaf)),s.path=((O=r.path)==null?void 0:O.map(q=>e.InnerOp.fromPartial(q)))||[],s}};function J(){return{key:new Uint8Array,left:void 0,right:void 0}}e.NonExistenceProof={typeUrl:"/cosmos.ics23.v1.NonExistenceProof",encode(r,s=n.BinaryWriter.create()){return r.key.length!==0&&s.uint32(10).bytes(r.key),r.left!==void 0&&e.ExistenceProof.encode(r.left,s.uint32(18).fork()).ldelim(),r.right!==void 0&&e.ExistenceProof.encode(r.right,s.uint32(26).fork()).ldelim(),s},decode(r,s){const O=r instanceof n.BinaryReader?r:new n.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=J();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.key=O.bytes();break;case 2:d.left=e.ExistenceProof.decode(O,O.uint32());break;case 3:d.right=e.ExistenceProof.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=J();return(0,t.isSet)(r.key)&&(s.key=(0,t.bytesFromBase64)(r.key)),(0,t.isSet)(r.left)&&(s.left=e.ExistenceProof.fromJSON(r.left)),(0,t.isSet)(r.right)&&(s.right=e.ExistenceProof.fromJSON(r.right)),s},toJSON(r){const s={};return r.key!==void 0&&(s.key=(0,t.base64FromBytes)(r.key!==void 0?r.key:new Uint8Array)),r.left!==void 0&&(s.left=r.left?e.ExistenceProof.toJSON(r.left):void 0),r.right!==void 0&&(s.right=r.right?e.ExistenceProof.toJSON(r.right):void 0),s},fromPartial(r){const s=J();return s.key=r.key??new Uint8Array,r.left!==void 0&&r.left!==null&&(s.left=e.ExistenceProof.fromPartial(r.left)),r.right!==void 0&&r.right!==null&&(s.right=e.ExistenceProof.fromPartial(r.right)),s}};function b(){return{exist:void 0,nonexist:void 0,batch:void 0,compressed:void 0}}e.CommitmentProof={typeUrl:"/cosmos.ics23.v1.CommitmentProof",encode(r,s=n.BinaryWriter.create()){return r.exist!==void 0&&e.ExistenceProof.encode(r.exist,s.uint32(10).fork()).ldelim(),r.nonexist!==void 0&&e.NonExistenceProof.encode(r.nonexist,s.uint32(18).fork()).ldelim(),r.batch!==void 0&&e.BatchProof.encode(r.batch,s.uint32(26).fork()).ldelim(),r.compressed!==void 0&&e.CompressedBatchProof.encode(r.compressed,s.uint32(34).fork()).ldelim(),s},decode(r,s){const O=r instanceof n.BinaryReader?r:new n.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=b();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.exist=e.ExistenceProof.decode(O,O.uint32());break;case 2:d.nonexist=e.NonExistenceProof.decode(O,O.uint32());break;case 3:d.batch=e.BatchProof.decode(O,O.uint32());break;case 4:d.compressed=e.CompressedBatchProof.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=b();return(0,t.isSet)(r.exist)&&(s.exist=e.ExistenceProof.fromJSON(r.exist)),(0,t.isSet)(r.nonexist)&&(s.nonexist=e.NonExistenceProof.fromJSON(r.nonexist)),(0,t.isSet)(r.batch)&&(s.batch=e.BatchProof.fromJSON(r.batch)),(0,t.isSet)(r.compressed)&&(s.compressed=e.CompressedBatchProof.fromJSON(r.compressed)),s},toJSON(r){const s={};return r.exist!==void 0&&(s.exist=r.exist?e.ExistenceProof.toJSON(r.exist):void 0),r.nonexist!==void 0&&(s.nonexist=r.nonexist?e.NonExistenceProof.toJSON(r.nonexist):void 0),r.batch!==void 0&&(s.batch=r.batch?e.BatchProof.toJSON(r.batch):void 0),r.compressed!==void 0&&(s.compressed=r.compressed?e.CompressedBatchProof.toJSON(r.compressed):void 0),s},fromPartial(r){const s=b();return r.exist!==void 0&&r.exist!==null&&(s.exist=e.ExistenceProof.fromPartial(r.exist)),r.nonexist!==void 0&&r.nonexist!==null&&(s.nonexist=e.NonExistenceProof.fromPartial(r.nonexist)),r.batch!==void 0&&r.batch!==null&&(s.batch=e.BatchProof.fromPartial(r.batch)),r.compressed!==void 0&&r.compressed!==null&&(s.compressed=e.CompressedBatchProof.fromPartial(r.compressed)),s}};function p(){return{hash:0,prehashKey:0,prehashValue:0,length:0,prefix:new Uint8Array}}e.LeafOp={typeUrl:"/cosmos.ics23.v1.LeafOp",encode(r,s=n.BinaryWriter.create()){return r.hash!==0&&s.uint32(8).int32(r.hash),r.prehashKey!==0&&s.uint32(16).int32(r.prehashKey),r.prehashValue!==0&&s.uint32(24).int32(r.prehashValue),r.length!==0&&s.uint32(32).int32(r.length),r.prefix.length!==0&&s.uint32(42).bytes(r.prefix),s},decode(r,s){const O=r instanceof n.BinaryReader?r:new n.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=p();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.hash=O.int32();break;case 2:d.prehashKey=O.int32();break;case 3:d.prehashValue=O.int32();break;case 4:d.length=O.int32();break;case 5:d.prefix=O.bytes();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=p();return(0,t.isSet)(r.hash)&&(s.hash=o(r.hash)),(0,t.isSet)(r.prehashKey)&&(s.prehashKey=o(r.prehashKey)),(0,t.isSet)(r.prehashValue)&&(s.prehashValue=o(r.prehashValue)),(0,t.isSet)(r.length)&&(s.length=w(r.length)),(0,t.isSet)(r.prefix)&&(s.prefix=(0,t.bytesFromBase64)(r.prefix)),s},toJSON(r){const s={};return r.hash!==void 0&&(s.hash=g(r.hash)),r.prehashKey!==void 0&&(s.prehashKey=g(r.prehashKey)),r.prehashValue!==void 0&&(s.prehashValue=g(r.prehashValue)),r.length!==void 0&&(s.length=E(r.length)),r.prefix!==void 0&&(s.prefix=(0,t.base64FromBytes)(r.prefix!==void 0?r.prefix:new Uint8Array)),s},fromPartial(r){const s=p();return s.hash=r.hash??0,s.prehashKey=r.prehashKey??0,s.prehashValue=r.prehashValue??0,s.length=r.length??0,s.prefix=r.prefix??new Uint8Array,s}};function S(){return{hash:0,prefix:new Uint8Array,suffix:new Uint8Array}}e.InnerOp={typeUrl:"/cosmos.ics23.v1.InnerOp",encode(r,s=n.BinaryWriter.create()){return r.hash!==0&&s.uint32(8).int32(r.hash),r.prefix.length!==0&&s.uint32(18).bytes(r.prefix),r.suffix.length!==0&&s.uint32(26).bytes(r.suffix),s},decode(r,s){const O=r instanceof n.BinaryReader?r:new n.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=S();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.hash=O.int32();break;case 2:d.prefix=O.bytes();break;case 3:d.suffix=O.bytes();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=S();return(0,t.isSet)(r.hash)&&(s.hash=o(r.hash)),(0,t.isSet)(r.prefix)&&(s.prefix=(0,t.bytesFromBase64)(r.prefix)),(0,t.isSet)(r.suffix)&&(s.suffix=(0,t.bytesFromBase64)(r.suffix)),s},toJSON(r){const s={};return r.hash!==void 0&&(s.hash=g(r.hash)),r.prefix!==void 0&&(s.prefix=(0,t.base64FromBytes)(r.prefix!==void 0?r.prefix:new Uint8Array)),r.suffix!==void 0&&(s.suffix=(0,t.base64FromBytes)(r.suffix!==void 0?r.suffix:new Uint8Array)),s},fromPartial(r){const s=S();return s.hash=r.hash??0,s.prefix=r.prefix??new Uint8Array,s.suffix=r.suffix??new Uint8Array,s}};function R(){return{leafSpec:void 0,innerSpec:void 0,maxDepth:0,minDepth:0}}e.ProofSpec={typeUrl:"/cosmos.ics23.v1.ProofSpec",encode(r,s=n.BinaryWriter.create()){return r.leafSpec!==void 0&&e.LeafOp.encode(r.leafSpec,s.uint32(10).fork()).ldelim(),r.innerSpec!==void 0&&e.InnerSpec.encode(r.innerSpec,s.uint32(18).fork()).ldelim(),r.maxDepth!==0&&s.uint32(24).int32(r.maxDepth),r.minDepth!==0&&s.uint32(32).int32(r.minDepth),s},decode(r,s){const O=r instanceof n.BinaryReader?r:new n.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=R();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.leafSpec=e.LeafOp.decode(O,O.uint32());break;case 2:d.innerSpec=e.InnerSpec.decode(O,O.uint32());break;case 3:d.maxDepth=O.int32();break;case 4:d.minDepth=O.int32();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=R();return(0,t.isSet)(r.leafSpec)&&(s.leafSpec=e.LeafOp.fromJSON(r.leafSpec)),(0,t.isSet)(r.innerSpec)&&(s.innerSpec=e.InnerSpec.fromJSON(r.innerSpec)),(0,t.isSet)(r.maxDepth)&&(s.maxDepth=Number(r.maxDepth)),(0,t.isSet)(r.minDepth)&&(s.minDepth=Number(r.minDepth)),s},toJSON(r){const s={};return r.leafSpec!==void 0&&(s.leafSpec=r.leafSpec?e.LeafOp.toJSON(r.leafSpec):void 0),r.innerSpec!==void 0&&(s.innerSpec=r.innerSpec?e.InnerSpec.toJSON(r.innerSpec):void 0),r.maxDepth!==void 0&&(s.maxDepth=Math.round(r.maxDepth)),r.minDepth!==void 0&&(s.minDepth=Math.round(r.minDepth)),s},fromPartial(r){const s=R();return r.leafSpec!==void 0&&r.leafSpec!==null&&(s.leafSpec=e.LeafOp.fromPartial(r.leafSpec)),r.innerSpec!==void 0&&r.innerSpec!==null&&(s.innerSpec=e.InnerSpec.fromPartial(r.innerSpec)),s.maxDepth=r.maxDepth??0,s.minDepth=r.minDepth??0,s}};function u(){return{childOrder:[],childSize:0,minPrefixLength:0,maxPrefixLength:0,emptyChild:new Uint8Array,hash:0}}e.InnerSpec={typeUrl:"/cosmos.ics23.v1.InnerSpec",encode(r,s=n.BinaryWriter.create()){s.uint32(10).fork();for(const O of r.childOrder)s.int32(O);return s.ldelim(),r.childSize!==0&&s.uint32(16).int32(r.childSize),r.minPrefixLength!==0&&s.uint32(24).int32(r.minPrefixLength),r.maxPrefixLength!==0&&s.uint32(32).int32(r.maxPrefixLength),r.emptyChild.length!==0&&s.uint32(42).bytes(r.emptyChild),r.hash!==0&&s.uint32(48).int32(r.hash),s},decode(r,s){const O=r instanceof n.BinaryReader?r:new n.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=u();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:if((l&7)===2){const M=O.uint32()+O.pos;for(;O.pos<M;)d.childOrder.push(O.int32())}else d.childOrder.push(O.int32());break;case 2:d.childSize=O.int32();break;case 3:d.minPrefixLength=O.int32();break;case 4:d.maxPrefixLength=O.int32();break;case 5:d.emptyChild=O.bytes();break;case 6:d.hash=O.int32();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=u();return Array.isArray(r==null?void 0:r.childOrder)&&(s.childOrder=r.childOrder.map(O=>Number(O))),(0,t.isSet)(r.childSize)&&(s.childSize=Number(r.childSize)),(0,t.isSet)(r.minPrefixLength)&&(s.minPrefixLength=Number(r.minPrefixLength)),(0,t.isSet)(r.maxPrefixLength)&&(s.maxPrefixLength=Number(r.maxPrefixLength)),(0,t.isSet)(r.emptyChild)&&(s.emptyChild=(0,t.bytesFromBase64)(r.emptyChild)),(0,t.isSet)(r.hash)&&(s.hash=o(r.hash)),s},toJSON(r){const s={};return r.childOrder?s.childOrder=r.childOrder.map(O=>Math.round(O)):s.childOrder=[],r.childSize!==void 0&&(s.childSize=Math.round(r.childSize)),r.minPrefixLength!==void 0&&(s.minPrefixLength=Math.round(r.minPrefixLength)),r.maxPrefixLength!==void 0&&(s.maxPrefixLength=Math.round(r.maxPrefixLength)),r.emptyChild!==void 0&&(s.emptyChild=(0,t.base64FromBytes)(r.emptyChild!==void 0?r.emptyChild:new Uint8Array)),r.hash!==void 0&&(s.hash=g(r.hash)),s},fromPartial(r){var O;const s=u();return s.childOrder=((O=r.childOrder)==null?void 0:O.map(q=>q))||[],s.childSize=r.childSize??0,s.minPrefixLength=r.minPrefixLength??0,s.maxPrefixLength=r.maxPrefixLength??0,s.emptyChild=r.emptyChild??new Uint8Array,s.hash=r.hash??0,s}};function c(){return{entries:[]}}e.BatchProof={typeUrl:"/cosmos.ics23.v1.BatchProof",encode(r,s=n.BinaryWriter.create()){for(const O of r.entries)e.BatchEntry.encode(O,s.uint32(10).fork()).ldelim();return s},decode(r,s){const O=r instanceof n.BinaryReader?r:new n.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=c();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.entries.push(e.BatchEntry.decode(O,O.uint32()));break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=c();return Array.isArray(r==null?void 0:r.entries)&&(s.entries=r.entries.map(O=>e.BatchEntry.fromJSON(O))),s},toJSON(r){const s={};return r.entries?s.entries=r.entries.map(O=>O?e.BatchEntry.toJSON(O):void 0):s.entries=[],s},fromPartial(r){var O;const s=c();return s.entries=((O=r.entries)==null?void 0:O.map(q=>e.BatchEntry.fromPartial(q)))||[],s}};function y(){return{exist:void 0,nonexist:void 0}}e.BatchEntry={typeUrl:"/cosmos.ics23.v1.BatchEntry",encode(r,s=n.BinaryWriter.create()){return r.exist!==void 0&&e.ExistenceProof.encode(r.exist,s.uint32(10).fork()).ldelim(),r.nonexist!==void 0&&e.NonExistenceProof.encode(r.nonexist,s.uint32(18).fork()).ldelim(),s},decode(r,s){const O=r instanceof n.BinaryReader?r:new n.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=y();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.exist=e.ExistenceProof.decode(O,O.uint32());break;case 2:d.nonexist=e.NonExistenceProof.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=y();return(0,t.isSet)(r.exist)&&(s.exist=e.ExistenceProof.fromJSON(r.exist)),(0,t.isSet)(r.nonexist)&&(s.nonexist=e.NonExistenceProof.fromJSON(r.nonexist)),s},toJSON(r){const s={};return r.exist!==void 0&&(s.exist=r.exist?e.ExistenceProof.toJSON(r.exist):void 0),r.nonexist!==void 0&&(s.nonexist=r.nonexist?e.NonExistenceProof.toJSON(r.nonexist):void 0),s},fromPartial(r){const s=y();return r.exist!==void 0&&r.exist!==null&&(s.exist=e.ExistenceProof.fromPartial(r.exist)),r.nonexist!==void 0&&r.nonexist!==null&&(s.nonexist=e.NonExistenceProof.fromPartial(r.nonexist)),s}};function B(){return{entries:[],lookupInners:[]}}e.CompressedBatchProof={typeUrl:"/cosmos.ics23.v1.CompressedBatchProof",encode(r,s=n.BinaryWriter.create()){for(const O of r.entries)e.CompressedBatchEntry.encode(O,s.uint32(10).fork()).ldelim();for(const O of r.lookupInners)e.InnerOp.encode(O,s.uint32(18).fork()).ldelim();return s},decode(r,s){const O=r instanceof n.BinaryReader?r:new n.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=B();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.entries.push(e.CompressedBatchEntry.decode(O,O.uint32()));break;case 2:d.lookupInners.push(e.InnerOp.decode(O,O.uint32()));break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=B();return Array.isArray(r==null?void 0:r.entries)&&(s.entries=r.entries.map(O=>e.CompressedBatchEntry.fromJSON(O))),Array.isArray(r==null?void 0:r.lookupInners)&&(s.lookupInners=r.lookupInners.map(O=>e.InnerOp.fromJSON(O))),s},toJSON(r){const s={};return r.entries?s.entries=r.entries.map(O=>O?e.CompressedBatchEntry.toJSON(O):void 0):s.entries=[],r.lookupInners?s.lookupInners=r.lookupInners.map(O=>O?e.InnerOp.toJSON(O):void 0):s.lookupInners=[],s},fromPartial(r){var O,q;const s=B();return s.entries=((O=r.entries)==null?void 0:O.map(d=>e.CompressedBatchEntry.fromPartial(d)))||[],s.lookupInners=((q=r.lookupInners)==null?void 0:q.map(d=>e.InnerOp.fromPartial(d)))||[],s}};function N(){return{exist:void 0,nonexist:void 0}}e.CompressedBatchEntry={typeUrl:"/cosmos.ics23.v1.CompressedBatchEntry",encode(r,s=n.BinaryWriter.create()){return r.exist!==void 0&&e.CompressedExistenceProof.encode(r.exist,s.uint32(10).fork()).ldelim(),r.nonexist!==void 0&&e.CompressedNonExistenceProof.encode(r.nonexist,s.uint32(18).fork()).ldelim(),s},decode(r,s){const O=r instanceof n.BinaryReader?r:new n.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=N();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.exist=e.CompressedExistenceProof.decode(O,O.uint32());break;case 2:d.nonexist=e.CompressedNonExistenceProof.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=N();return(0,t.isSet)(r.exist)&&(s.exist=e.CompressedExistenceProof.fromJSON(r.exist)),(0,t.isSet)(r.nonexist)&&(s.nonexist=e.CompressedNonExistenceProof.fromJSON(r.nonexist)),s},toJSON(r){const s={};return r.exist!==void 0&&(s.exist=r.exist?e.CompressedExistenceProof.toJSON(r.exist):void 0),r.nonexist!==void 0&&(s.nonexist=r.nonexist?e.CompressedNonExistenceProof.toJSON(r.nonexist):void 0),s},fromPartial(r){const s=N();return r.exist!==void 0&&r.exist!==null&&(s.exist=e.CompressedExistenceProof.fromPartial(r.exist)),r.nonexist!==void 0&&r.nonexist!==null&&(s.nonexist=e.CompressedNonExistenceProof.fromPartial(r.nonexist)),s}};function U(){return{key:new Uint8Array,value:new Uint8Array,leaf:void 0,path:[]}}e.CompressedExistenceProof={typeUrl:"/cosmos.ics23.v1.CompressedExistenceProof",encode(r,s=n.BinaryWriter.create()){r.key.length!==0&&s.uint32(10).bytes(r.key),r.value.length!==0&&s.uint32(18).bytes(r.value),r.leaf!==void 0&&e.LeafOp.encode(r.leaf,s.uint32(26).fork()).ldelim(),s.uint32(34).fork();for(const O of r.path)s.int32(O);return s.ldelim(),s},decode(r,s){const O=r instanceof n.BinaryReader?r:new n.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=U();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.key=O.bytes();break;case 2:d.value=O.bytes();break;case 3:d.leaf=e.LeafOp.decode(O,O.uint32());break;case 4:if((l&7)===2){const M=O.uint32()+O.pos;for(;O.pos<M;)d.path.push(O.int32())}else d.path.push(O.int32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=U();return(0,t.isSet)(r.key)&&(s.key=(0,t.bytesFromBase64)(r.key)),(0,t.isSet)(r.value)&&(s.value=(0,t.bytesFromBase64)(r.value)),(0,t.isSet)(r.leaf)&&(s.leaf=e.LeafOp.fromJSON(r.leaf)),Array.isArray(r==null?void 0:r.path)&&(s.path=r.path.map(O=>Number(O))),s},toJSON(r){const s={};return r.key!==void 0&&(s.key=(0,t.base64FromBytes)(r.key!==void 0?r.key:new Uint8Array)),r.value!==void 0&&(s.value=(0,t.base64FromBytes)(r.value!==void 0?r.value:new Uint8Array)),r.leaf!==void 0&&(s.leaf=r.leaf?e.LeafOp.toJSON(r.leaf):void 0),r.path?s.path=r.path.map(O=>Math.round(O)):s.path=[],s},fromPartial(r){var O;const s=U();return s.key=r.key??new Uint8Array,s.value=r.value??new Uint8Array,r.leaf!==void 0&&r.leaf!==null&&(s.leaf=e.LeafOp.fromPartial(r.leaf)),s.path=((O=r.path)==null?void 0:O.map(q=>q))||[],s}};function W(){return{key:new Uint8Array,left:void 0,right:void 0}}e.CompressedNonExistenceProof={typeUrl:"/cosmos.ics23.v1.CompressedNonExistenceProof",encode(r,s=n.BinaryWriter.create()){return r.key.length!==0&&s.uint32(10).bytes(r.key),r.left!==void 0&&e.CompressedExistenceProof.encode(r.left,s.uint32(18).fork()).ldelim(),r.right!==void 0&&e.CompressedExistenceProof.encode(r.right,s.uint32(26).fork()).ldelim(),s},decode(r,s){const O=r instanceof n.BinaryReader?r:new n.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=W();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.key=O.bytes();break;case 2:d.left=e.CompressedExistenceProof.decode(O,O.uint32());break;case 3:d.right=e.CompressedExistenceProof.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=W();return(0,t.isSet)(r.key)&&(s.key=(0,t.bytesFromBase64)(r.key)),(0,t.isSet)(r.left)&&(s.left=e.CompressedExistenceProof.fromJSON(r.left)),(0,t.isSet)(r.right)&&(s.right=e.CompressedExistenceProof.fromJSON(r.right)),s},toJSON(r){const s={};return r.key!==void 0&&(s.key=(0,t.base64FromBytes)(r.key!==void 0?r.key:new Uint8Array)),r.left!==void 0&&(s.left=r.left?e.CompressedExistenceProof.toJSON(r.left):void 0),r.right!==void 0&&(s.right=r.right?e.CompressedExistenceProof.toJSON(r.right):void 0),s},fromPartial(r){const s=W();return s.key=r.key??new Uint8Array,r.left!==void 0&&r.left!==null&&(s.left=e.CompressedExistenceProof.fromPartial(r.left)),r.right!==void 0&&r.right!==null&&(s.right=e.CompressedExistenceProof.fromPartial(r.right)),s}}})(Ec);Object.defineProperty(mn,"__esModule",{value:!0});mn.MerkleProof=mn.MerklePath=mn.MerklePrefix=mn.MerkleRoot=mn.protobufPackage=void 0;const $i=Ec,Jn=_.binary,Kr=_.helpers;mn.protobufPackage="ibc.core.commitment.v1";function $d(){return{hash:new Uint8Array}}mn.MerkleRoot={typeUrl:"/ibc.core.commitment.v1.MerkleRoot",encode(e,n=Jn.BinaryWriter.create()){return e.hash.length!==0&&n.uint32(10).bytes(e.hash),n},decode(e,n){const t=e instanceof Jn.BinaryReader?e:new Jn.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=$d();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.hash=t.bytes();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=$d();return(0,Kr.isSet)(e.hash)&&(n.hash=(0,Kr.bytesFromBase64)(e.hash)),n},toJSON(e){const n={};return e.hash!==void 0&&(n.hash=(0,Kr.base64FromBytes)(e.hash!==void 0?e.hash:new Uint8Array)),n},fromPartial(e){const n=$d();return n.hash=e.hash??new Uint8Array,n}};function Kd(){return{keyPrefix:new Uint8Array}}mn.MerklePrefix={typeUrl:"/ibc.core.commitment.v1.MerklePrefix",encode(e,n=Jn.BinaryWriter.create()){return e.keyPrefix.length!==0&&n.uint32(10).bytes(e.keyPrefix),n},decode(e,n){const t=e instanceof Jn.BinaryReader?e:new Jn.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Kd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.keyPrefix=t.bytes();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Kd();return(0,Kr.isSet)(e.keyPrefix)&&(n.keyPrefix=(0,Kr.bytesFromBase64)(e.keyPrefix)),n},toJSON(e){const n={};return e.keyPrefix!==void 0&&(n.keyPrefix=(0,Kr.base64FromBytes)(e.keyPrefix!==void 0?e.keyPrefix:new Uint8Array)),n},fromPartial(e){const n=Kd();return n.keyPrefix=e.keyPrefix??new Uint8Array,n}};function xd(){return{keyPath:[]}}mn.MerklePath={typeUrl:"/ibc.core.commitment.v1.MerklePath",encode(e,n=Jn.BinaryWriter.create()){for(const t of e.keyPath)n.uint32(10).string(t);return n},decode(e,n){const t=e instanceof Jn.BinaryReader?e:new Jn.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=xd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.keyPath.push(t.string());break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=xd();return Array.isArray(e==null?void 0:e.keyPath)&&(n.keyPath=e.keyPath.map(t=>String(t))),n},toJSON(e){const n={};return e.keyPath?n.keyPath=e.keyPath.map(t=>t):n.keyPath=[],n},fromPartial(e){var t;const n=xd();return n.keyPath=((t=e.keyPath)==null?void 0:t.map(i=>i))||[],n}};function zd(){return{proofs:[]}}mn.MerkleProof={typeUrl:"/ibc.core.commitment.v1.MerkleProof",encode(e,n=Jn.BinaryWriter.create()){for(const t of e.proofs)$i.CommitmentProof.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){const t=e instanceof Jn.BinaryReader?e:new Jn.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=zd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.proofs.push($i.CommitmentProof.decode(t,t.uint32()));break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=zd();return Array.isArray(e==null?void 0:e.proofs)&&(n.proofs=e.proofs.map(t=>$i.CommitmentProof.fromJSON(t))),n},toJSON(e){const n={};return e.proofs?n.proofs=e.proofs.map(t=>t?$i.CommitmentProof.toJSON(t):void 0):n.proofs=[],n},fromPartial(e){var t;const n=zd();return n.proofs=((t=e.proofs)==null?void 0:t.map(i=>$i.CommitmentProof.fromPartial(i)))||[],n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Params=e.Version=e.ConnectionPaths=e.ClientPaths=e.Counterparty=e.IdentifiedConnection=e.ConnectionEnd=e.stateToJSON=e.stateFromJSON=e.State=e.protobufPackage=void 0;const n=mn,t=_.binary,i=_.helpers;e.protobufPackage="ibc.core.connection.v1";var o;(function(R){R[R.STATE_UNINITIALIZED_UNSPECIFIED=0]="STATE_UNINITIALIZED_UNSPECIFIED",R[R.STATE_INIT=1]="STATE_INIT",R[R.STATE_TRYOPEN=2]="STATE_TRYOPEN",R[R.STATE_OPEN=3]="STATE_OPEN",R[R.UNRECOGNIZED=-1]="UNRECOGNIZED"})(o||(e.State=o={}));function g(R){switch(R){case 0:case"STATE_UNINITIALIZED_UNSPECIFIED":return o.STATE_UNINITIALIZED_UNSPECIFIED;case 1:case"STATE_INIT":return o.STATE_INIT;case 2:case"STATE_TRYOPEN":return o.STATE_TRYOPEN;case 3:case"STATE_OPEN":return o.STATE_OPEN;case-1:case"UNRECOGNIZED":default:return o.UNRECOGNIZED}}e.stateFromJSON=g;function C(R){switch(R){case o.STATE_UNINITIALIZED_UNSPECIFIED:return"STATE_UNINITIALIZED_UNSPECIFIED";case o.STATE_INIT:return"STATE_INIT";case o.STATE_TRYOPEN:return"STATE_TRYOPEN";case o.STATE_OPEN:return"STATE_OPEN";case o.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.stateToJSON=C;function w(){return{clientId:"",versions:[],state:0,counterparty:e.Counterparty.fromPartial({}),delayPeriod:BigInt(0)}}e.ConnectionEnd={typeUrl:"/ibc.core.connection.v1.ConnectionEnd",encode(R,u=t.BinaryWriter.create()){R.clientId!==""&&u.uint32(10).string(R.clientId);for(const c of R.versions)e.Version.encode(c,u.uint32(18).fork()).ldelim();return R.state!==0&&u.uint32(24).int32(R.state),R.counterparty!==void 0&&e.Counterparty.encode(R.counterparty,u.uint32(34).fork()).ldelim(),R.delayPeriod!==BigInt(0)&&u.uint32(40).uint64(R.delayPeriod),u},decode(R,u){const c=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=w();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.clientId=c.string();break;case 2:B.versions.push(e.Version.decode(c,c.uint32()));break;case 3:B.state=c.int32();break;case 4:B.counterparty=e.Counterparty.decode(c,c.uint32());break;case 5:B.delayPeriod=c.uint64();break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=w();return(0,i.isSet)(R.clientId)&&(u.clientId=String(R.clientId)),Array.isArray(R==null?void 0:R.versions)&&(u.versions=R.versions.map(c=>e.Version.fromJSON(c))),(0,i.isSet)(R.state)&&(u.state=g(R.state)),(0,i.isSet)(R.counterparty)&&(u.counterparty=e.Counterparty.fromJSON(R.counterparty)),(0,i.isSet)(R.delayPeriod)&&(u.delayPeriod=BigInt(R.delayPeriod.toString())),u},toJSON(R){const u={};return R.clientId!==void 0&&(u.clientId=R.clientId),R.versions?u.versions=R.versions.map(c=>c?e.Version.toJSON(c):void 0):u.versions=[],R.state!==void 0&&(u.state=C(R.state)),R.counterparty!==void 0&&(u.counterparty=R.counterparty?e.Counterparty.toJSON(R.counterparty):void 0),R.delayPeriod!==void 0&&(u.delayPeriod=(R.delayPeriod||BigInt(0)).toString()),u},fromPartial(R){var c;const u=w();return u.clientId=R.clientId??"",u.versions=((c=R.versions)==null?void 0:c.map(y=>e.Version.fromPartial(y)))||[],u.state=R.state??0,R.counterparty!==void 0&&R.counterparty!==null&&(u.counterparty=e.Counterparty.fromPartial(R.counterparty)),R.delayPeriod!==void 0&&R.delayPeriod!==null&&(u.delayPeriod=BigInt(R.delayPeriod.toString())),u}};function E(){return{id:"",clientId:"",versions:[],state:0,counterparty:e.Counterparty.fromPartial({}),delayPeriod:BigInt(0)}}e.IdentifiedConnection={typeUrl:"/ibc.core.connection.v1.IdentifiedConnection",encode(R,u=t.BinaryWriter.create()){R.id!==""&&u.uint32(10).string(R.id),R.clientId!==""&&u.uint32(18).string(R.clientId);for(const c of R.versions)e.Version.encode(c,u.uint32(26).fork()).ldelim();return R.state!==0&&u.uint32(32).int32(R.state),R.counterparty!==void 0&&e.Counterparty.encode(R.counterparty,u.uint32(42).fork()).ldelim(),R.delayPeriod!==BigInt(0)&&u.uint32(48).uint64(R.delayPeriod),u},decode(R,u){const c=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=E();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.id=c.string();break;case 2:B.clientId=c.string();break;case 3:B.versions.push(e.Version.decode(c,c.uint32()));break;case 4:B.state=c.int32();break;case 5:B.counterparty=e.Counterparty.decode(c,c.uint32());break;case 6:B.delayPeriod=c.uint64();break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=E();return(0,i.isSet)(R.id)&&(u.id=String(R.id)),(0,i.isSet)(R.clientId)&&(u.clientId=String(R.clientId)),Array.isArray(R==null?void 0:R.versions)&&(u.versions=R.versions.map(c=>e.Version.fromJSON(c))),(0,i.isSet)(R.state)&&(u.state=g(R.state)),(0,i.isSet)(R.counterparty)&&(u.counterparty=e.Counterparty.fromJSON(R.counterparty)),(0,i.isSet)(R.delayPeriod)&&(u.delayPeriod=BigInt(R.delayPeriod.toString())),u},toJSON(R){const u={};return R.id!==void 0&&(u.id=R.id),R.clientId!==void 0&&(u.clientId=R.clientId),R.versions?u.versions=R.versions.map(c=>c?e.Version.toJSON(c):void 0):u.versions=[],R.state!==void 0&&(u.state=C(R.state)),R.counterparty!==void 0&&(u.counterparty=R.counterparty?e.Counterparty.toJSON(R.counterparty):void 0),R.delayPeriod!==void 0&&(u.delayPeriod=(R.delayPeriod||BigInt(0)).toString()),u},fromPartial(R){var c;const u=E();return u.id=R.id??"",u.clientId=R.clientId??"",u.versions=((c=R.versions)==null?void 0:c.map(y=>e.Version.fromPartial(y)))||[],u.state=R.state??0,R.counterparty!==void 0&&R.counterparty!==null&&(u.counterparty=e.Counterparty.fromPartial(R.counterparty)),R.delayPeriod!==void 0&&R.delayPeriod!==null&&(u.delayPeriod=BigInt(R.delayPeriod.toString())),u}};function D(){return{clientId:"",connectionId:"",prefix:n.MerklePrefix.fromPartial({})}}e.Counterparty={typeUrl:"/ibc.core.connection.v1.Counterparty",encode(R,u=t.BinaryWriter.create()){return R.clientId!==""&&u.uint32(10).string(R.clientId),R.connectionId!==""&&u.uint32(18).string(R.connectionId),R.prefix!==void 0&&n.MerklePrefix.encode(R.prefix,u.uint32(26).fork()).ldelim(),u},decode(R,u){const c=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=D();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.clientId=c.string();break;case 2:B.connectionId=c.string();break;case 3:B.prefix=n.MerklePrefix.decode(c,c.uint32());break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=D();return(0,i.isSet)(R.clientId)&&(u.clientId=String(R.clientId)),(0,i.isSet)(R.connectionId)&&(u.connectionId=String(R.connectionId)),(0,i.isSet)(R.prefix)&&(u.prefix=n.MerklePrefix.fromJSON(R.prefix)),u},toJSON(R){const u={};return R.clientId!==void 0&&(u.clientId=R.clientId),R.connectionId!==void 0&&(u.connectionId=R.connectionId),R.prefix!==void 0&&(u.prefix=R.prefix?n.MerklePrefix.toJSON(R.prefix):void 0),u},fromPartial(R){const u=D();return u.clientId=R.clientId??"",u.connectionId=R.connectionId??"",R.prefix!==void 0&&R.prefix!==null&&(u.prefix=n.MerklePrefix.fromPartial(R.prefix)),u}};function J(){return{paths:[]}}e.ClientPaths={typeUrl:"/ibc.core.connection.v1.ClientPaths",encode(R,u=t.BinaryWriter.create()){for(const c of R.paths)u.uint32(10).string(c);return u},decode(R,u){const c=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=J();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.paths.push(c.string());break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=J();return Array.isArray(R==null?void 0:R.paths)&&(u.paths=R.paths.map(c=>String(c))),u},toJSON(R){const u={};return R.paths?u.paths=R.paths.map(c=>c):u.paths=[],u},fromPartial(R){var c;const u=J();return u.paths=((c=R.paths)==null?void 0:c.map(y=>y))||[],u}};function b(){return{clientId:"",paths:[]}}e.ConnectionPaths={typeUrl:"/ibc.core.connection.v1.ConnectionPaths",encode(R,u=t.BinaryWriter.create()){R.clientId!==""&&u.uint32(10).string(R.clientId);for(const c of R.paths)u.uint32(18).string(c);return u},decode(R,u){const c=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=b();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.clientId=c.string();break;case 2:B.paths.push(c.string());break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=b();return(0,i.isSet)(R.clientId)&&(u.clientId=String(R.clientId)),Array.isArray(R==null?void 0:R.paths)&&(u.paths=R.paths.map(c=>String(c))),u},toJSON(R){const u={};return R.clientId!==void 0&&(u.clientId=R.clientId),R.paths?u.paths=R.paths.map(c=>c):u.paths=[],u},fromPartial(R){var c;const u=b();return u.clientId=R.clientId??"",u.paths=((c=R.paths)==null?void 0:c.map(y=>y))||[],u}};function p(){return{identifier:"",features:[]}}e.Version={typeUrl:"/ibc.core.connection.v1.Version",encode(R,u=t.BinaryWriter.create()){R.identifier!==""&&u.uint32(10).string(R.identifier);for(const c of R.features)u.uint32(18).string(c);return u},decode(R,u){const c=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=p();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.identifier=c.string();break;case 2:B.features.push(c.string());break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=p();return(0,i.isSet)(R.identifier)&&(u.identifier=String(R.identifier)),Array.isArray(R==null?void 0:R.features)&&(u.features=R.features.map(c=>String(c))),u},toJSON(R){const u={};return R.identifier!==void 0&&(u.identifier=R.identifier),R.features?u.features=R.features.map(c=>c):u.features=[],u},fromPartial(R){var c;const u=p();return u.identifier=R.identifier??"",u.features=((c=R.features)==null?void 0:c.map(y=>y))||[],u}};function S(){return{maxExpectedTimePerBlock:BigInt(0)}}e.Params={typeUrl:"/ibc.core.connection.v1.Params",encode(R,u=t.BinaryWriter.create()){return R.maxExpectedTimePerBlock!==BigInt(0)&&u.uint32(8).uint64(R.maxExpectedTimePerBlock),u},decode(R,u){const c=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let y=u===void 0?c.len:c.pos+u;const B=S();for(;c.pos<y;){const N=c.uint32();switch(N>>>3){case 1:B.maxExpectedTimePerBlock=c.uint64();break;default:c.skipType(N&7);break}}return B},fromJSON(R){const u=S();return(0,i.isSet)(R.maxExpectedTimePerBlock)&&(u.maxExpectedTimePerBlock=BigInt(R.maxExpectedTimePerBlock.toString())),u},toJSON(R){const u={};return R.maxExpectedTimePerBlock!==void 0&&(u.maxExpectedTimePerBlock=(R.maxExpectedTimePerBlock||BigInt(0)).toString()),u},fromPartial(R){const u=S();return R.maxExpectedTimePerBlock!==void 0&&R.maxExpectedTimePerBlock!==null&&(u.maxExpectedTimePerBlock=BigInt(R.maxExpectedTimePerBlock.toString())),u}}})(bc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgConnectionOpenConfirmResponse=e.MsgConnectionOpenConfirm=e.MsgConnectionOpenAckResponse=e.MsgConnectionOpenAck=e.MsgConnectionOpenTryResponse=e.MsgConnectionOpenTry=e.MsgConnectionOpenInitResponse=e.MsgConnectionOpenInit=e.protobufPackage=void 0;const n=bc,t=_.any,i=kt,o=_.binary,g=_.helpers;e.protobufPackage="ibc.core.connection.v1";function C(){return{clientId:"",counterparty:n.Counterparty.fromPartial({}),version:void 0,delayPeriod:BigInt(0),signer:""}}e.MsgConnectionOpenInit={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenInit",encode(u,c=o.BinaryWriter.create()){return u.clientId!==""&&c.uint32(10).string(u.clientId),u.counterparty!==void 0&&n.Counterparty.encode(u.counterparty,c.uint32(18).fork()).ldelim(),u.version!==void 0&&n.Version.encode(u.version,c.uint32(26).fork()).ldelim(),u.delayPeriod!==BigInt(0)&&c.uint32(32).uint64(u.delayPeriod),u.signer!==""&&c.uint32(42).string(u.signer),c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=C();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.clientId=y.string();break;case 2:N.counterparty=n.Counterparty.decode(y,y.uint32());break;case 3:N.version=n.Version.decode(y,y.uint32());break;case 4:N.delayPeriod=y.uint64();break;case 5:N.signer=y.string();break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=C();return(0,g.isSet)(u.clientId)&&(c.clientId=String(u.clientId)),(0,g.isSet)(u.counterparty)&&(c.counterparty=n.Counterparty.fromJSON(u.counterparty)),(0,g.isSet)(u.version)&&(c.version=n.Version.fromJSON(u.version)),(0,g.isSet)(u.delayPeriod)&&(c.delayPeriod=BigInt(u.delayPeriod.toString())),(0,g.isSet)(u.signer)&&(c.signer=String(u.signer)),c},toJSON(u){const c={};return u.clientId!==void 0&&(c.clientId=u.clientId),u.counterparty!==void 0&&(c.counterparty=u.counterparty?n.Counterparty.toJSON(u.counterparty):void 0),u.version!==void 0&&(c.version=u.version?n.Version.toJSON(u.version):void 0),u.delayPeriod!==void 0&&(c.delayPeriod=(u.delayPeriod||BigInt(0)).toString()),u.signer!==void 0&&(c.signer=u.signer),c},fromPartial(u){const c=C();return c.clientId=u.clientId??"",u.counterparty!==void 0&&u.counterparty!==null&&(c.counterparty=n.Counterparty.fromPartial(u.counterparty)),u.version!==void 0&&u.version!==null&&(c.version=n.Version.fromPartial(u.version)),u.delayPeriod!==void 0&&u.delayPeriod!==null&&(c.delayPeriod=BigInt(u.delayPeriod.toString())),c.signer=u.signer??"",c}};function w(){return{}}e.MsgConnectionOpenInitResponse={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenInitResponse",encode(u,c=o.BinaryWriter.create()){return c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=w();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return N},fromJSON(u){return w()},toJSON(u){return{}},fromPartial(u){return w()}};function E(){return{clientId:"",previousConnectionId:"",clientState:void 0,counterparty:n.Counterparty.fromPartial({}),delayPeriod:BigInt(0),counterpartyVersions:[],proofHeight:i.Height.fromPartial({}),proofInit:new Uint8Array,proofClient:new Uint8Array,proofConsensus:new Uint8Array,consensusHeight:i.Height.fromPartial({}),signer:"",hostConsensusStateProof:new Uint8Array}}e.MsgConnectionOpenTry={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenTry",encode(u,c=o.BinaryWriter.create()){u.clientId!==""&&c.uint32(10).string(u.clientId),u.previousConnectionId!==""&&c.uint32(18).string(u.previousConnectionId),u.clientState!==void 0&&t.Any.encode(u.clientState,c.uint32(26).fork()).ldelim(),u.counterparty!==void 0&&n.Counterparty.encode(u.counterparty,c.uint32(34).fork()).ldelim(),u.delayPeriod!==BigInt(0)&&c.uint32(40).uint64(u.delayPeriod);for(const y of u.counterpartyVersions)n.Version.encode(y,c.uint32(50).fork()).ldelim();return u.proofHeight!==void 0&&i.Height.encode(u.proofHeight,c.uint32(58).fork()).ldelim(),u.proofInit.length!==0&&c.uint32(66).bytes(u.proofInit),u.proofClient.length!==0&&c.uint32(74).bytes(u.proofClient),u.proofConsensus.length!==0&&c.uint32(82).bytes(u.proofConsensus),u.consensusHeight!==void 0&&i.Height.encode(u.consensusHeight,c.uint32(90).fork()).ldelim(),u.signer!==""&&c.uint32(98).string(u.signer),u.hostConsensusStateProof.length!==0&&c.uint32(106).bytes(u.hostConsensusStateProof),c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=E();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.clientId=y.string();break;case 2:N.previousConnectionId=y.string();break;case 3:N.clientState=t.Any.decode(y,y.uint32());break;case 4:N.counterparty=n.Counterparty.decode(y,y.uint32());break;case 5:N.delayPeriod=y.uint64();break;case 6:N.counterpartyVersions.push(n.Version.decode(y,y.uint32()));break;case 7:N.proofHeight=i.Height.decode(y,y.uint32());break;case 8:N.proofInit=y.bytes();break;case 9:N.proofClient=y.bytes();break;case 10:N.proofConsensus=y.bytes();break;case 11:N.consensusHeight=i.Height.decode(y,y.uint32());break;case 12:N.signer=y.string();break;case 13:N.hostConsensusStateProof=y.bytes();break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=E();return(0,g.isSet)(u.clientId)&&(c.clientId=String(u.clientId)),(0,g.isSet)(u.previousConnectionId)&&(c.previousConnectionId=String(u.previousConnectionId)),(0,g.isSet)(u.clientState)&&(c.clientState=t.Any.fromJSON(u.clientState)),(0,g.isSet)(u.counterparty)&&(c.counterparty=n.Counterparty.fromJSON(u.counterparty)),(0,g.isSet)(u.delayPeriod)&&(c.delayPeriod=BigInt(u.delayPeriod.toString())),Array.isArray(u==null?void 0:u.counterpartyVersions)&&(c.counterpartyVersions=u.counterpartyVersions.map(y=>n.Version.fromJSON(y))),(0,g.isSet)(u.proofHeight)&&(c.proofHeight=i.Height.fromJSON(u.proofHeight)),(0,g.isSet)(u.proofInit)&&(c.proofInit=(0,g.bytesFromBase64)(u.proofInit)),(0,g.isSet)(u.proofClient)&&(c.proofClient=(0,g.bytesFromBase64)(u.proofClient)),(0,g.isSet)(u.proofConsensus)&&(c.proofConsensus=(0,g.bytesFromBase64)(u.proofConsensus)),(0,g.isSet)(u.consensusHeight)&&(c.consensusHeight=i.Height.fromJSON(u.consensusHeight)),(0,g.isSet)(u.signer)&&(c.signer=String(u.signer)),(0,g.isSet)(u.hostConsensusStateProof)&&(c.hostConsensusStateProof=(0,g.bytesFromBase64)(u.hostConsensusStateProof)),c},toJSON(u){const c={};return u.clientId!==void 0&&(c.clientId=u.clientId),u.previousConnectionId!==void 0&&(c.previousConnectionId=u.previousConnectionId),u.clientState!==void 0&&(c.clientState=u.clientState?t.Any.toJSON(u.clientState):void 0),u.counterparty!==void 0&&(c.counterparty=u.counterparty?n.Counterparty.toJSON(u.counterparty):void 0),u.delayPeriod!==void 0&&(c.delayPeriod=(u.delayPeriod||BigInt(0)).toString()),u.counterpartyVersions?c.counterpartyVersions=u.counterpartyVersions.map(y=>y?n.Version.toJSON(y):void 0):c.counterpartyVersions=[],u.proofHeight!==void 0&&(c.proofHeight=u.proofHeight?i.Height.toJSON(u.proofHeight):void 0),u.proofInit!==void 0&&(c.proofInit=(0,g.base64FromBytes)(u.proofInit!==void 0?u.proofInit:new Uint8Array)),u.proofClient!==void 0&&(c.proofClient=(0,g.base64FromBytes)(u.proofClient!==void 0?u.proofClient:new Uint8Array)),u.proofConsensus!==void 0&&(c.proofConsensus=(0,g.base64FromBytes)(u.proofConsensus!==void 0?u.proofConsensus:new Uint8Array)),u.consensusHeight!==void 0&&(c.consensusHeight=u.consensusHeight?i.Height.toJSON(u.consensusHeight):void 0),u.signer!==void 0&&(c.signer=u.signer),u.hostConsensusStateProof!==void 0&&(c.hostConsensusStateProof=(0,g.base64FromBytes)(u.hostConsensusStateProof!==void 0?u.hostConsensusStateProof:new Uint8Array)),c},fromPartial(u){var y;const c=E();return c.clientId=u.clientId??"",c.previousConnectionId=u.previousConnectionId??"",u.clientState!==void 0&&u.clientState!==null&&(c.clientState=t.Any.fromPartial(u.clientState)),u.counterparty!==void 0&&u.counterparty!==null&&(c.counterparty=n.Counterparty.fromPartial(u.counterparty)),u.delayPeriod!==void 0&&u.delayPeriod!==null&&(c.delayPeriod=BigInt(u.delayPeriod.toString())),c.counterpartyVersions=((y=u.counterpartyVersions)==null?void 0:y.map(B=>n.Version.fromPartial(B)))||[],u.proofHeight!==void 0&&u.proofHeight!==null&&(c.proofHeight=i.Height.fromPartial(u.proofHeight)),c.proofInit=u.proofInit??new Uint8Array,c.proofClient=u.proofClient??new Uint8Array,c.proofConsensus=u.proofConsensus??new Uint8Array,u.consensusHeight!==void 0&&u.consensusHeight!==null&&(c.consensusHeight=i.Height.fromPartial(u.consensusHeight)),c.signer=u.signer??"",c.hostConsensusStateProof=u.hostConsensusStateProof??new Uint8Array,c}};function D(){return{}}e.MsgConnectionOpenTryResponse={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenTryResponse",encode(u,c=o.BinaryWriter.create()){return c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=D();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return N},fromJSON(u){return D()},toJSON(u){return{}},fromPartial(u){return D()}};function J(){return{connectionId:"",counterpartyConnectionId:"",version:void 0,clientState:void 0,proofHeight:i.Height.fromPartial({}),proofTry:new Uint8Array,proofClient:new Uint8Array,proofConsensus:new Uint8Array,consensusHeight:i.Height.fromPartial({}),signer:"",hostConsensusStateProof:new Uint8Array}}e.MsgConnectionOpenAck={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenAck",encode(u,c=o.BinaryWriter.create()){return u.connectionId!==""&&c.uint32(10).string(u.connectionId),u.counterpartyConnectionId!==""&&c.uint32(18).string(u.counterpartyConnectionId),u.version!==void 0&&n.Version.encode(u.version,c.uint32(26).fork()).ldelim(),u.clientState!==void 0&&t.Any.encode(u.clientState,c.uint32(34).fork()).ldelim(),u.proofHeight!==void 0&&i.Height.encode(u.proofHeight,c.uint32(42).fork()).ldelim(),u.proofTry.length!==0&&c.uint32(50).bytes(u.proofTry),u.proofClient.length!==0&&c.uint32(58).bytes(u.proofClient),u.proofConsensus.length!==0&&c.uint32(66).bytes(u.proofConsensus),u.consensusHeight!==void 0&&i.Height.encode(u.consensusHeight,c.uint32(74).fork()).ldelim(),u.signer!==""&&c.uint32(82).string(u.signer),u.hostConsensusStateProof.length!==0&&c.uint32(90).bytes(u.hostConsensusStateProof),c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=J();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.connectionId=y.string();break;case 2:N.counterpartyConnectionId=y.string();break;case 3:N.version=n.Version.decode(y,y.uint32());break;case 4:N.clientState=t.Any.decode(y,y.uint32());break;case 5:N.proofHeight=i.Height.decode(y,y.uint32());break;case 6:N.proofTry=y.bytes();break;case 7:N.proofClient=y.bytes();break;case 8:N.proofConsensus=y.bytes();break;case 9:N.consensusHeight=i.Height.decode(y,y.uint32());break;case 10:N.signer=y.string();break;case 11:N.hostConsensusStateProof=y.bytes();break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=J();return(0,g.isSet)(u.connectionId)&&(c.connectionId=String(u.connectionId)),(0,g.isSet)(u.counterpartyConnectionId)&&(c.counterpartyConnectionId=String(u.counterpartyConnectionId)),(0,g.isSet)(u.version)&&(c.version=n.Version.fromJSON(u.version)),(0,g.isSet)(u.clientState)&&(c.clientState=t.Any.fromJSON(u.clientState)),(0,g.isSet)(u.proofHeight)&&(c.proofHeight=i.Height.fromJSON(u.proofHeight)),(0,g.isSet)(u.proofTry)&&(c.proofTry=(0,g.bytesFromBase64)(u.proofTry)),(0,g.isSet)(u.proofClient)&&(c.proofClient=(0,g.bytesFromBase64)(u.proofClient)),(0,g.isSet)(u.proofConsensus)&&(c.proofConsensus=(0,g.bytesFromBase64)(u.proofConsensus)),(0,g.isSet)(u.consensusHeight)&&(c.consensusHeight=i.Height.fromJSON(u.consensusHeight)),(0,g.isSet)(u.signer)&&(c.signer=String(u.signer)),(0,g.isSet)(u.hostConsensusStateProof)&&(c.hostConsensusStateProof=(0,g.bytesFromBase64)(u.hostConsensusStateProof)),c},toJSON(u){const c={};return u.connectionId!==void 0&&(c.connectionId=u.connectionId),u.counterpartyConnectionId!==void 0&&(c.counterpartyConnectionId=u.counterpartyConnectionId),u.version!==void 0&&(c.version=u.version?n.Version.toJSON(u.version):void 0),u.clientState!==void 0&&(c.clientState=u.clientState?t.Any.toJSON(u.clientState):void 0),u.proofHeight!==void 0&&(c.proofHeight=u.proofHeight?i.Height.toJSON(u.proofHeight):void 0),u.proofTry!==void 0&&(c.proofTry=(0,g.base64FromBytes)(u.proofTry!==void 0?u.proofTry:new Uint8Array)),u.proofClient!==void 0&&(c.proofClient=(0,g.base64FromBytes)(u.proofClient!==void 0?u.proofClient:new Uint8Array)),u.proofConsensus!==void 0&&(c.proofConsensus=(0,g.base64FromBytes)(u.proofConsensus!==void 0?u.proofConsensus:new Uint8Array)),u.consensusHeight!==void 0&&(c.consensusHeight=u.consensusHeight?i.Height.toJSON(u.consensusHeight):void 0),u.signer!==void 0&&(c.signer=u.signer),u.hostConsensusStateProof!==void 0&&(c.hostConsensusStateProof=(0,g.base64FromBytes)(u.hostConsensusStateProof!==void 0?u.hostConsensusStateProof:new Uint8Array)),c},fromPartial(u){const c=J();return c.connectionId=u.connectionId??"",c.counterpartyConnectionId=u.counterpartyConnectionId??"",u.version!==void 0&&u.version!==null&&(c.version=n.Version.fromPartial(u.version)),u.clientState!==void 0&&u.clientState!==null&&(c.clientState=t.Any.fromPartial(u.clientState)),u.proofHeight!==void 0&&u.proofHeight!==null&&(c.proofHeight=i.Height.fromPartial(u.proofHeight)),c.proofTry=u.proofTry??new Uint8Array,c.proofClient=u.proofClient??new Uint8Array,c.proofConsensus=u.proofConsensus??new Uint8Array,u.consensusHeight!==void 0&&u.consensusHeight!==null&&(c.consensusHeight=i.Height.fromPartial(u.consensusHeight)),c.signer=u.signer??"",c.hostConsensusStateProof=u.hostConsensusStateProof??new Uint8Array,c}};function b(){return{}}e.MsgConnectionOpenAckResponse={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenAckResponse",encode(u,c=o.BinaryWriter.create()){return c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=b();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return N},fromJSON(u){return b()},toJSON(u){return{}},fromPartial(u){return b()}};function p(){return{connectionId:"",proofAck:new Uint8Array,proofHeight:i.Height.fromPartial({}),signer:""}}e.MsgConnectionOpenConfirm={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenConfirm",encode(u,c=o.BinaryWriter.create()){return u.connectionId!==""&&c.uint32(10).string(u.connectionId),u.proofAck.length!==0&&c.uint32(18).bytes(u.proofAck),u.proofHeight!==void 0&&i.Height.encode(u.proofHeight,c.uint32(26).fork()).ldelim(),u.signer!==""&&c.uint32(34).string(u.signer),c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=p();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.connectionId=y.string();break;case 2:N.proofAck=y.bytes();break;case 3:N.proofHeight=i.Height.decode(y,y.uint32());break;case 4:N.signer=y.string();break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=p();return(0,g.isSet)(u.connectionId)&&(c.connectionId=String(u.connectionId)),(0,g.isSet)(u.proofAck)&&(c.proofAck=(0,g.bytesFromBase64)(u.proofAck)),(0,g.isSet)(u.proofHeight)&&(c.proofHeight=i.Height.fromJSON(u.proofHeight)),(0,g.isSet)(u.signer)&&(c.signer=String(u.signer)),c},toJSON(u){const c={};return u.connectionId!==void 0&&(c.connectionId=u.connectionId),u.proofAck!==void 0&&(c.proofAck=(0,g.base64FromBytes)(u.proofAck!==void 0?u.proofAck:new Uint8Array)),u.proofHeight!==void 0&&(c.proofHeight=u.proofHeight?i.Height.toJSON(u.proofHeight):void 0),u.signer!==void 0&&(c.signer=u.signer),c},fromPartial(u){const c=p();return c.connectionId=u.connectionId??"",c.proofAck=u.proofAck??new Uint8Array,u.proofHeight!==void 0&&u.proofHeight!==null&&(c.proofHeight=i.Height.fromPartial(u.proofHeight)),c.signer=u.signer??"",c}};function S(){return{}}e.MsgConnectionOpenConfirmResponse={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse",encode(u,c=o.BinaryWriter.create()){return c},decode(u,c){const y=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=S();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return N},fromJSON(u){return S()},toJSON(u){return{}},fromPartial(u){return S()}};class R{constructor(c){this.rpc=c,this.ConnectionOpenInit=this.ConnectionOpenInit.bind(this),this.ConnectionOpenTry=this.ConnectionOpenTry.bind(this),this.ConnectionOpenAck=this.ConnectionOpenAck.bind(this),this.ConnectionOpenConfirm=this.ConnectionOpenConfirm.bind(this)}ConnectionOpenInit(c){const y=e.MsgConnectionOpenInit.encode(c).finish();return this.rpc.request("ibc.core.connection.v1.Msg","ConnectionOpenInit",y).then(N=>e.MsgConnectionOpenInitResponse.decode(new o.BinaryReader(N)))}ConnectionOpenTry(c){const y=e.MsgConnectionOpenTry.encode(c).finish();return this.rpc.request("ibc.core.connection.v1.Msg","ConnectionOpenTry",y).then(N=>e.MsgConnectionOpenTryResponse.decode(new o.BinaryReader(N)))}ConnectionOpenAck(c){const y=e.MsgConnectionOpenAck.encode(c).finish();return this.rpc.request("ibc.core.connection.v1.Msg","ConnectionOpenAck",y).then(N=>e.MsgConnectionOpenAckResponse.decode(new o.BinaryReader(N)))}ConnectionOpenConfirm(c){const y=e.MsgConnectionOpenConfirm.encode(c).finish();return this.rpc.request("ibc.core.connection.v1.Msg","ConnectionOpenConfirm",y).then(N=>e.MsgConnectionOpenConfirmResponse.decode(new o.BinaryReader(N)))}}e.MsgClientImpl=R})(Bc);Object.defineProperty(gi,"__esModule",{value:!0});gi.isMsgTransferEncodeObject=gi.ibcTypes=void 0;const eP=Io,Xn=Cc,Zo=Rc,Xo=Bc;gi.ibcTypes=[["/ibc.applications.transfer.v1.MsgTransfer",eP.MsgTransfer],["/ibc.core.channel.v1.MsgAcknowledgement",Xn.MsgAcknowledgement],["/ibc.core.channel.v1.MsgChannelCloseConfirm",Xn.MsgChannelCloseConfirm],["/ibc.core.channel.v1.MsgChannelCloseInit",Xn.MsgChannelCloseInit],["/ibc.core.channel.v1.MsgChannelOpenAck",Xn.MsgChannelOpenAck],["/ibc.core.channel.v1.MsgChannelOpenConfirm",Xn.MsgChannelOpenConfirm],["/ibc.core.channel.v1.MsgChannelOpenInit",Xn.MsgChannelOpenInit],["/ibc.core.channel.v1.MsgChannelOpenTry",Xn.MsgChannelOpenTry],["/ibc.core.channel.v1.MsgRecvPacket",Xn.MsgRecvPacket],["/ibc.core.channel.v1.MsgTimeout",Xn.MsgTimeout],["/ibc.core.channel.v1.MsgTimeoutOnClose",Xn.MsgTimeoutOnClose],["/ibc.core.client.v1.MsgCreateClient",Zo.MsgCreateClient],["/ibc.core.client.v1.MsgSubmitMisbehaviour",Zo.MsgSubmitMisbehaviour],["/ibc.core.client.v1.MsgUpdateClient",Zo.MsgUpdateClient],["/ibc.core.client.v1.MsgUpgradeClient",Zo.MsgUpgradeClient],["/ibc.core.connection.v1.MsgConnectionOpenAck",Xo.MsgConnectionOpenAck],["/ibc.core.connection.v1.MsgConnectionOpenConfirm",Xo.MsgConnectionOpenConfirm],["/ibc.core.connection.v1.MsgConnectionOpenInit",Xo.MsgConnectionOpenInit],["/ibc.core.connection.v1.MsgConnectionOpenTry",Xo.MsgConnectionOpenTry]];function nP(e){return e.typeUrl==="/ibc.applications.transfer.v1.MsgTransfer"}gi.isMsgTransferEncodeObject=nP;var hs={},Ic={},Nt={};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.Params=Nt.DenomTrace=Nt.protobufPackage=void 0;const xr=_.binary,Pa=_.helpers;Nt.protobufPackage="ibc.applications.transfer.v1";function Yd(){return{path:"",baseDenom:""}}Nt.DenomTrace={typeUrl:"/ibc.applications.transfer.v1.DenomTrace",encode(e,n=xr.BinaryWriter.create()){return e.path!==""&&n.uint32(10).string(e.path),e.baseDenom!==""&&n.uint32(18).string(e.baseDenom),n},decode(e,n){const t=e instanceof xr.BinaryReader?e:new xr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Yd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.path=t.string();break;case 2:o.baseDenom=t.string();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Yd();return(0,Pa.isSet)(e.path)&&(n.path=String(e.path)),(0,Pa.isSet)(e.baseDenom)&&(n.baseDenom=String(e.baseDenom)),n},toJSON(e){const n={};return e.path!==void 0&&(n.path=e.path),e.baseDenom!==void 0&&(n.baseDenom=e.baseDenom),n},fromPartial(e){const n=Yd();return n.path=e.path??"",n.baseDenom=e.baseDenom??"",n}};function Zd(){return{sendEnabled:!1,receiveEnabled:!1}}Nt.Params={typeUrl:"/ibc.applications.transfer.v1.Params",encode(e,n=xr.BinaryWriter.create()){return e.sendEnabled===!0&&n.uint32(8).bool(e.sendEnabled),e.receiveEnabled===!0&&n.uint32(16).bool(e.receiveEnabled),n},decode(e,n){const t=e instanceof xr.BinaryReader?e:new xr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Zd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.sendEnabled=t.bool();break;case 2:o.receiveEnabled=t.bool();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Zd();return(0,Pa.isSet)(e.sendEnabled)&&(n.sendEnabled=!!e.sendEnabled),(0,Pa.isSet)(e.receiveEnabled)&&(n.receiveEnabled=!!e.receiveEnabled),n},toJSON(e){const n={};return e.sendEnabled!==void 0&&(n.sendEnabled=e.sendEnabled),e.receiveEnabled!==void 0&&(n.receiveEnabled=e.receiveEnabled),n},fromPartial(e){const n=Zd();return n.sendEnabled=e.sendEnabled??!1,n.receiveEnabled=e.receiveEnabled??!1,n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryEscrowAddressResponse=e.QueryEscrowAddressRequest=e.QueryDenomHashResponse=e.QueryDenomHashRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.QueryDenomTracesResponse=e.QueryDenomTracesRequest=e.QueryDenomTraceResponse=e.QueryDenomTraceRequest=e.protobufPackage=void 0;const n=Be,t=Nt,i=_.binary,o=_.helpers;e.protobufPackage="ibc.applications.transfer.v1";function g(){return{hash:""}}e.QueryDenomTraceRequest={typeUrl:"/ibc.applications.transfer.v1.QueryDenomTraceRequest",encode(c,y=i.BinaryWriter.create()){return c.hash!==""&&y.uint32(10).string(c.hash),y},decode(c,y){const B=c instanceof i.BinaryReader?c:new i.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=g();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.hash=B.string();break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=g();return(0,o.isSet)(c.hash)&&(y.hash=String(c.hash)),y},toJSON(c){const y={};return c.hash!==void 0&&(y.hash=c.hash),y},fromPartial(c){const y=g();return y.hash=c.hash??"",y}};function C(){return{denomTrace:void 0}}e.QueryDenomTraceResponse={typeUrl:"/ibc.applications.transfer.v1.QueryDenomTraceResponse",encode(c,y=i.BinaryWriter.create()){return c.denomTrace!==void 0&&t.DenomTrace.encode(c.denomTrace,y.uint32(10).fork()).ldelim(),y},decode(c,y){const B=c instanceof i.BinaryReader?c:new i.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=C();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.denomTrace=t.DenomTrace.decode(B,B.uint32());break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=C();return(0,o.isSet)(c.denomTrace)&&(y.denomTrace=t.DenomTrace.fromJSON(c.denomTrace)),y},toJSON(c){const y={};return c.denomTrace!==void 0&&(y.denomTrace=c.denomTrace?t.DenomTrace.toJSON(c.denomTrace):void 0),y},fromPartial(c){const y=C();return c.denomTrace!==void 0&&c.denomTrace!==null&&(y.denomTrace=t.DenomTrace.fromPartial(c.denomTrace)),y}};function w(){return{pagination:void 0}}e.QueryDenomTracesRequest={typeUrl:"/ibc.applications.transfer.v1.QueryDenomTracesRequest",encode(c,y=i.BinaryWriter.create()){return c.pagination!==void 0&&n.PageRequest.encode(c.pagination,y.uint32(10).fork()).ldelim(),y},decode(c,y){const B=c instanceof i.BinaryReader?c:new i.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=w();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.pagination=n.PageRequest.decode(B,B.uint32());break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=w();return(0,o.isSet)(c.pagination)&&(y.pagination=n.PageRequest.fromJSON(c.pagination)),y},toJSON(c){const y={};return c.pagination!==void 0&&(y.pagination=c.pagination?n.PageRequest.toJSON(c.pagination):void 0),y},fromPartial(c){const y=w();return c.pagination!==void 0&&c.pagination!==null&&(y.pagination=n.PageRequest.fromPartial(c.pagination)),y}};function E(){return{denomTraces:[],pagination:void 0}}e.QueryDenomTracesResponse={typeUrl:"/ibc.applications.transfer.v1.QueryDenomTracesResponse",encode(c,y=i.BinaryWriter.create()){for(const B of c.denomTraces)t.DenomTrace.encode(B,y.uint32(10).fork()).ldelim();return c.pagination!==void 0&&n.PageResponse.encode(c.pagination,y.uint32(18).fork()).ldelim(),y},decode(c,y){const B=c instanceof i.BinaryReader?c:new i.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=E();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.denomTraces.push(t.DenomTrace.decode(B,B.uint32()));break;case 2:U.pagination=n.PageResponse.decode(B,B.uint32());break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=E();return Array.isArray(c==null?void 0:c.denomTraces)&&(y.denomTraces=c.denomTraces.map(B=>t.DenomTrace.fromJSON(B))),(0,o.isSet)(c.pagination)&&(y.pagination=n.PageResponse.fromJSON(c.pagination)),y},toJSON(c){const y={};return c.denomTraces?y.denomTraces=c.denomTraces.map(B=>B?t.DenomTrace.toJSON(B):void 0):y.denomTraces=[],c.pagination!==void 0&&(y.pagination=c.pagination?n.PageResponse.toJSON(c.pagination):void 0),y},fromPartial(c){var B;const y=E();return y.denomTraces=((B=c.denomTraces)==null?void 0:B.map(N=>t.DenomTrace.fromPartial(N)))||[],c.pagination!==void 0&&c.pagination!==null&&(y.pagination=n.PageResponse.fromPartial(c.pagination)),y}};function D(){return{}}e.QueryParamsRequest={typeUrl:"/ibc.applications.transfer.v1.QueryParamsRequest",encode(c,y=i.BinaryWriter.create()){return y},decode(c,y){const B=c instanceof i.BinaryReader?c:new i.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=D();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){default:B.skipType(W&7);break}}return U},fromJSON(c){return D()},toJSON(c){return{}},fromPartial(c){return D()}};function J(){return{params:void 0}}e.QueryParamsResponse={typeUrl:"/ibc.applications.transfer.v1.QueryParamsResponse",encode(c,y=i.BinaryWriter.create()){return c.params!==void 0&&t.Params.encode(c.params,y.uint32(10).fork()).ldelim(),y},decode(c,y){const B=c instanceof i.BinaryReader?c:new i.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=J();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.params=t.Params.decode(B,B.uint32());break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=J();return(0,o.isSet)(c.params)&&(y.params=t.Params.fromJSON(c.params)),y},toJSON(c){const y={};return c.params!==void 0&&(y.params=c.params?t.Params.toJSON(c.params):void 0),y},fromPartial(c){const y=J();return c.params!==void 0&&c.params!==null&&(y.params=t.Params.fromPartial(c.params)),y}};function b(){return{trace:""}}e.QueryDenomHashRequest={typeUrl:"/ibc.applications.transfer.v1.QueryDenomHashRequest",encode(c,y=i.BinaryWriter.create()){return c.trace!==""&&y.uint32(10).string(c.trace),y},decode(c,y){const B=c instanceof i.BinaryReader?c:new i.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=b();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.trace=B.string();break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=b();return(0,o.isSet)(c.trace)&&(y.trace=String(c.trace)),y},toJSON(c){const y={};return c.trace!==void 0&&(y.trace=c.trace),y},fromPartial(c){const y=b();return y.trace=c.trace??"",y}};function p(){return{hash:""}}e.QueryDenomHashResponse={typeUrl:"/ibc.applications.transfer.v1.QueryDenomHashResponse",encode(c,y=i.BinaryWriter.create()){return c.hash!==""&&y.uint32(10).string(c.hash),y},decode(c,y){const B=c instanceof i.BinaryReader?c:new i.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=p();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.hash=B.string();break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=p();return(0,o.isSet)(c.hash)&&(y.hash=String(c.hash)),y},toJSON(c){const y={};return c.hash!==void 0&&(y.hash=c.hash),y},fromPartial(c){const y=p();return y.hash=c.hash??"",y}};function S(){return{portId:"",channelId:""}}e.QueryEscrowAddressRequest={typeUrl:"/ibc.applications.transfer.v1.QueryEscrowAddressRequest",encode(c,y=i.BinaryWriter.create()){return c.portId!==""&&y.uint32(10).string(c.portId),c.channelId!==""&&y.uint32(18).string(c.channelId),y},decode(c,y){const B=c instanceof i.BinaryReader?c:new i.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=S();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.portId=B.string();break;case 2:U.channelId=B.string();break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=S();return(0,o.isSet)(c.portId)&&(y.portId=String(c.portId)),(0,o.isSet)(c.channelId)&&(y.channelId=String(c.channelId)),y},toJSON(c){const y={};return c.portId!==void 0&&(y.portId=c.portId),c.channelId!==void 0&&(y.channelId=c.channelId),y},fromPartial(c){const y=S();return y.portId=c.portId??"",y.channelId=c.channelId??"",y}};function R(){return{escrowAddress:""}}e.QueryEscrowAddressResponse={typeUrl:"/ibc.applications.transfer.v1.QueryEscrowAddressResponse",encode(c,y=i.BinaryWriter.create()){return c.escrowAddress!==""&&y.uint32(10).string(c.escrowAddress),y},decode(c,y){const B=c instanceof i.BinaryReader?c:new i.BinaryReader(c);let N=y===void 0?B.len:B.pos+y;const U=R();for(;B.pos<N;){const W=B.uint32();switch(W>>>3){case 1:U.escrowAddress=B.string();break;default:B.skipType(W&7);break}}return U},fromJSON(c){const y=R();return(0,o.isSet)(c.escrowAddress)&&(y.escrowAddress=String(c.escrowAddress)),y},toJSON(c){const y={};return c.escrowAddress!==void 0&&(y.escrowAddress=c.escrowAddress),y},fromPartial(c){const y=R();return y.escrowAddress=c.escrowAddress??"",y}};class u{constructor(y){this.rpc=y,this.DenomTrace=this.DenomTrace.bind(this),this.DenomTraces=this.DenomTraces.bind(this),this.Params=this.Params.bind(this),this.DenomHash=this.DenomHash.bind(this),this.EscrowAddress=this.EscrowAddress.bind(this)}DenomTrace(y){const B=e.QueryDenomTraceRequest.encode(y).finish();return this.rpc.request("ibc.applications.transfer.v1.Query","DenomTrace",B).then(U=>e.QueryDenomTraceResponse.decode(new i.BinaryReader(U)))}DenomTraces(y={pagination:n.PageRequest.fromPartial({})}){const B=e.QueryDenomTracesRequest.encode(y).finish();return this.rpc.request("ibc.applications.transfer.v1.Query","DenomTraces",B).then(U=>e.QueryDenomTracesResponse.decode(new i.BinaryReader(U)))}Params(y={}){const B=e.QueryParamsRequest.encode(y).finish();return this.rpc.request("ibc.applications.transfer.v1.Query","Params",B).then(U=>e.QueryParamsResponse.decode(new i.BinaryReader(U)))}DenomHash(y){const B=e.QueryDenomHashRequest.encode(y).finish();return this.rpc.request("ibc.applications.transfer.v1.Query","DenomHash",B).then(U=>e.QueryDenomHashResponse.decode(new i.BinaryReader(U)))}EscrowAddress(y){const B=e.QueryEscrowAddressRequest.encode(y).finish();return this.rpc.request("ibc.applications.transfer.v1.Query","EscrowAddress",B).then(U=>e.QueryEscrowAddressResponse.decode(new i.BinaryReader(U)))}}e.QueryClientImpl=u})(Ic);var Oc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryNextSequenceReceiveResponse=e.QueryNextSequenceReceiveRequest=e.QueryUnreceivedAcksResponse=e.QueryUnreceivedAcksRequest=e.QueryUnreceivedPacketsResponse=e.QueryUnreceivedPacketsRequest=e.QueryPacketAcknowledgementsResponse=e.QueryPacketAcknowledgementsRequest=e.QueryPacketAcknowledgementResponse=e.QueryPacketAcknowledgementRequest=e.QueryPacketReceiptResponse=e.QueryPacketReceiptRequest=e.QueryPacketCommitmentsResponse=e.QueryPacketCommitmentsRequest=e.QueryPacketCommitmentResponse=e.QueryPacketCommitmentRequest=e.QueryChannelConsensusStateResponse=e.QueryChannelConsensusStateRequest=e.QueryChannelClientStateResponse=e.QueryChannelClientStateRequest=e.QueryConnectionChannelsResponse=e.QueryConnectionChannelsRequest=e.QueryChannelsResponse=e.QueryChannelsRequest=e.QueryChannelResponse=e.QueryChannelRequest=e.protobufPackage=void 0;const n=Be,t=Oo,i=kt,o=_.any,g=_.binary,C=_.helpers;e.protobufPackage="ibc.core.channel.v1";function w(){return{portId:"",channelId:""}}e.QueryChannelRequest={typeUrl:"/ibc.core.channel.v1.QueryChannelRequest",encode(a,P=g.BinaryWriter.create()){return a.portId!==""&&P.uint32(10).string(a.portId),a.channelId!==""&&P.uint32(18).string(a.channelId),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=w();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.portId=k.string();break;case 2:A.channelId=k.string();break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=w();return(0,C.isSet)(a.portId)&&(P.portId=String(a.portId)),(0,C.isSet)(a.channelId)&&(P.channelId=String(a.channelId)),P},toJSON(a){const P={};return a.portId!==void 0&&(P.portId=a.portId),a.channelId!==void 0&&(P.channelId=a.channelId),P},fromPartial(a){const P=w();return P.portId=a.portId??"",P.channelId=a.channelId??"",P}};function E(){return{channel:void 0,proof:new Uint8Array,proofHeight:i.Height.fromPartial({})}}e.QueryChannelResponse={typeUrl:"/ibc.core.channel.v1.QueryChannelResponse",encode(a,P=g.BinaryWriter.create()){return a.channel!==void 0&&t.Channel.encode(a.channel,P.uint32(10).fork()).ldelim(),a.proof.length!==0&&P.uint32(18).bytes(a.proof),a.proofHeight!==void 0&&i.Height.encode(a.proofHeight,P.uint32(26).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=E();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.channel=t.Channel.decode(k,k.uint32());break;case 2:A.proof=k.bytes();break;case 3:A.proofHeight=i.Height.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=E();return(0,C.isSet)(a.channel)&&(P.channel=t.Channel.fromJSON(a.channel)),(0,C.isSet)(a.proof)&&(P.proof=(0,C.bytesFromBase64)(a.proof)),(0,C.isSet)(a.proofHeight)&&(P.proofHeight=i.Height.fromJSON(a.proofHeight)),P},toJSON(a){const P={};return a.channel!==void 0&&(P.channel=a.channel?t.Channel.toJSON(a.channel):void 0),a.proof!==void 0&&(P.proof=(0,C.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(P.proofHeight=a.proofHeight?i.Height.toJSON(a.proofHeight):void 0),P},fromPartial(a){const P=E();return a.channel!==void 0&&a.channel!==null&&(P.channel=t.Channel.fromPartial(a.channel)),P.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(P.proofHeight=i.Height.fromPartial(a.proofHeight)),P}};function D(){return{pagination:void 0}}e.QueryChannelsRequest={typeUrl:"/ibc.core.channel.v1.QueryChannelsRequest",encode(a,P=g.BinaryWriter.create()){return a.pagination!==void 0&&n.PageRequest.encode(a.pagination,P.uint32(10).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=D();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.pagination=n.PageRequest.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=D();return(0,C.isSet)(a.pagination)&&(P.pagination=n.PageRequest.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.pagination!==void 0&&(P.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),P},fromPartial(a){const P=D();return a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageRequest.fromPartial(a.pagination)),P}};function J(){return{channels:[],pagination:void 0,height:i.Height.fromPartial({})}}e.QueryChannelsResponse={typeUrl:"/ibc.core.channel.v1.QueryChannelsResponse",encode(a,P=g.BinaryWriter.create()){for(const k of a.channels)t.IdentifiedChannel.encode(k,P.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,P.uint32(18).fork()).ldelim(),a.height!==void 0&&i.Height.encode(a.height,P.uint32(26).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=J();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.channels.push(t.IdentifiedChannel.decode(k,k.uint32()));break;case 2:A.pagination=n.PageResponse.decode(k,k.uint32());break;case 3:A.height=i.Height.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=J();return Array.isArray(a==null?void 0:a.channels)&&(P.channels=a.channels.map(k=>t.IdentifiedChannel.fromJSON(k))),(0,C.isSet)(a.pagination)&&(P.pagination=n.PageResponse.fromJSON(a.pagination)),(0,C.isSet)(a.height)&&(P.height=i.Height.fromJSON(a.height)),P},toJSON(a){const P={};return a.channels?P.channels=a.channels.map(k=>k?t.IdentifiedChannel.toJSON(k):void 0):P.channels=[],a.pagination!==void 0&&(P.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),a.height!==void 0&&(P.height=a.height?i.Height.toJSON(a.height):void 0),P},fromPartial(a){var k;const P=J();return P.channels=((k=a.channels)==null?void 0:k.map(v=>t.IdentifiedChannel.fromPartial(v)))||[],a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageResponse.fromPartial(a.pagination)),a.height!==void 0&&a.height!==null&&(P.height=i.Height.fromPartial(a.height)),P}};function b(){return{connection:"",pagination:void 0}}e.QueryConnectionChannelsRequest={typeUrl:"/ibc.core.channel.v1.QueryConnectionChannelsRequest",encode(a,P=g.BinaryWriter.create()){return a.connection!==""&&P.uint32(10).string(a.connection),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=b();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.connection=k.string();break;case 2:A.pagination=n.PageRequest.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=b();return(0,C.isSet)(a.connection)&&(P.connection=String(a.connection)),(0,C.isSet)(a.pagination)&&(P.pagination=n.PageRequest.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.connection!==void 0&&(P.connection=a.connection),a.pagination!==void 0&&(P.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),P},fromPartial(a){const P=b();return P.connection=a.connection??"",a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageRequest.fromPartial(a.pagination)),P}};function p(){return{channels:[],pagination:void 0,height:i.Height.fromPartial({})}}e.QueryConnectionChannelsResponse={typeUrl:"/ibc.core.channel.v1.QueryConnectionChannelsResponse",encode(a,P=g.BinaryWriter.create()){for(const k of a.channels)t.IdentifiedChannel.encode(k,P.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,P.uint32(18).fork()).ldelim(),a.height!==void 0&&i.Height.encode(a.height,P.uint32(26).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=p();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.channels.push(t.IdentifiedChannel.decode(k,k.uint32()));break;case 2:A.pagination=n.PageResponse.decode(k,k.uint32());break;case 3:A.height=i.Height.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=p();return Array.isArray(a==null?void 0:a.channels)&&(P.channels=a.channels.map(k=>t.IdentifiedChannel.fromJSON(k))),(0,C.isSet)(a.pagination)&&(P.pagination=n.PageResponse.fromJSON(a.pagination)),(0,C.isSet)(a.height)&&(P.height=i.Height.fromJSON(a.height)),P},toJSON(a){const P={};return a.channels?P.channels=a.channels.map(k=>k?t.IdentifiedChannel.toJSON(k):void 0):P.channels=[],a.pagination!==void 0&&(P.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),a.height!==void 0&&(P.height=a.height?i.Height.toJSON(a.height):void 0),P},fromPartial(a){var k;const P=p();return P.channels=((k=a.channels)==null?void 0:k.map(v=>t.IdentifiedChannel.fromPartial(v)))||[],a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageResponse.fromPartial(a.pagination)),a.height!==void 0&&a.height!==null&&(P.height=i.Height.fromPartial(a.height)),P}};function S(){return{portId:"",channelId:""}}e.QueryChannelClientStateRequest={typeUrl:"/ibc.core.channel.v1.QueryChannelClientStateRequest",encode(a,P=g.BinaryWriter.create()){return a.portId!==""&&P.uint32(10).string(a.portId),a.channelId!==""&&P.uint32(18).string(a.channelId),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=S();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.portId=k.string();break;case 2:A.channelId=k.string();break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=S();return(0,C.isSet)(a.portId)&&(P.portId=String(a.portId)),(0,C.isSet)(a.channelId)&&(P.channelId=String(a.channelId)),P},toJSON(a){const P={};return a.portId!==void 0&&(P.portId=a.portId),a.channelId!==void 0&&(P.channelId=a.channelId),P},fromPartial(a){const P=S();return P.portId=a.portId??"",P.channelId=a.channelId??"",P}};function R(){return{identifiedClientState:void 0,proof:new Uint8Array,proofHeight:i.Height.fromPartial({})}}e.QueryChannelClientStateResponse={typeUrl:"/ibc.core.channel.v1.QueryChannelClientStateResponse",encode(a,P=g.BinaryWriter.create()){return a.identifiedClientState!==void 0&&i.IdentifiedClientState.encode(a.identifiedClientState,P.uint32(10).fork()).ldelim(),a.proof.length!==0&&P.uint32(18).bytes(a.proof),a.proofHeight!==void 0&&i.Height.encode(a.proofHeight,P.uint32(26).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=R();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.identifiedClientState=i.IdentifiedClientState.decode(k,k.uint32());break;case 2:A.proof=k.bytes();break;case 3:A.proofHeight=i.Height.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=R();return(0,C.isSet)(a.identifiedClientState)&&(P.identifiedClientState=i.IdentifiedClientState.fromJSON(a.identifiedClientState)),(0,C.isSet)(a.proof)&&(P.proof=(0,C.bytesFromBase64)(a.proof)),(0,C.isSet)(a.proofHeight)&&(P.proofHeight=i.Height.fromJSON(a.proofHeight)),P},toJSON(a){const P={};return a.identifiedClientState!==void 0&&(P.identifiedClientState=a.identifiedClientState?i.IdentifiedClientState.toJSON(a.identifiedClientState):void 0),a.proof!==void 0&&(P.proof=(0,C.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(P.proofHeight=a.proofHeight?i.Height.toJSON(a.proofHeight):void 0),P},fromPartial(a){const P=R();return a.identifiedClientState!==void 0&&a.identifiedClientState!==null&&(P.identifiedClientState=i.IdentifiedClientState.fromPartial(a.identifiedClientState)),P.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(P.proofHeight=i.Height.fromPartial(a.proofHeight)),P}};function u(){return{portId:"",channelId:"",revisionNumber:BigInt(0),revisionHeight:BigInt(0)}}e.QueryChannelConsensusStateRequest={typeUrl:"/ibc.core.channel.v1.QueryChannelConsensusStateRequest",encode(a,P=g.BinaryWriter.create()){return a.portId!==""&&P.uint32(10).string(a.portId),a.channelId!==""&&P.uint32(18).string(a.channelId),a.revisionNumber!==BigInt(0)&&P.uint32(24).uint64(a.revisionNumber),a.revisionHeight!==BigInt(0)&&P.uint32(32).uint64(a.revisionHeight),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=u();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.portId=k.string();break;case 2:A.channelId=k.string();break;case 3:A.revisionNumber=k.uint64();break;case 4:A.revisionHeight=k.uint64();break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=u();return(0,C.isSet)(a.portId)&&(P.portId=String(a.portId)),(0,C.isSet)(a.channelId)&&(P.channelId=String(a.channelId)),(0,C.isSet)(a.revisionNumber)&&(P.revisionNumber=BigInt(a.revisionNumber.toString())),(0,C.isSet)(a.revisionHeight)&&(P.revisionHeight=BigInt(a.revisionHeight.toString())),P},toJSON(a){const P={};return a.portId!==void 0&&(P.portId=a.portId),a.channelId!==void 0&&(P.channelId=a.channelId),a.revisionNumber!==void 0&&(P.revisionNumber=(a.revisionNumber||BigInt(0)).toString()),a.revisionHeight!==void 0&&(P.revisionHeight=(a.revisionHeight||BigInt(0)).toString()),P},fromPartial(a){const P=u();return P.portId=a.portId??"",P.channelId=a.channelId??"",a.revisionNumber!==void 0&&a.revisionNumber!==null&&(P.revisionNumber=BigInt(a.revisionNumber.toString())),a.revisionHeight!==void 0&&a.revisionHeight!==null&&(P.revisionHeight=BigInt(a.revisionHeight.toString())),P}};function c(){return{consensusState:void 0,clientId:"",proof:new Uint8Array,proofHeight:i.Height.fromPartial({})}}e.QueryChannelConsensusStateResponse={typeUrl:"/ibc.core.channel.v1.QueryChannelConsensusStateResponse",encode(a,P=g.BinaryWriter.create()){return a.consensusState!==void 0&&o.Any.encode(a.consensusState,P.uint32(10).fork()).ldelim(),a.clientId!==""&&P.uint32(18).string(a.clientId),a.proof.length!==0&&P.uint32(26).bytes(a.proof),a.proofHeight!==void 0&&i.Height.encode(a.proofHeight,P.uint32(34).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=c();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.consensusState=o.Any.decode(k,k.uint32());break;case 2:A.clientId=k.string();break;case 3:A.proof=k.bytes();break;case 4:A.proofHeight=i.Height.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=c();return(0,C.isSet)(a.consensusState)&&(P.consensusState=o.Any.fromJSON(a.consensusState)),(0,C.isSet)(a.clientId)&&(P.clientId=String(a.clientId)),(0,C.isSet)(a.proof)&&(P.proof=(0,C.bytesFromBase64)(a.proof)),(0,C.isSet)(a.proofHeight)&&(P.proofHeight=i.Height.fromJSON(a.proofHeight)),P},toJSON(a){const P={};return a.consensusState!==void 0&&(P.consensusState=a.consensusState?o.Any.toJSON(a.consensusState):void 0),a.clientId!==void 0&&(P.clientId=a.clientId),a.proof!==void 0&&(P.proof=(0,C.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(P.proofHeight=a.proofHeight?i.Height.toJSON(a.proofHeight):void 0),P},fromPartial(a){const P=c();return a.consensusState!==void 0&&a.consensusState!==null&&(P.consensusState=o.Any.fromPartial(a.consensusState)),P.clientId=a.clientId??"",P.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(P.proofHeight=i.Height.fromPartial(a.proofHeight)),P}};function y(){return{portId:"",channelId:"",sequence:BigInt(0)}}e.QueryPacketCommitmentRequest={typeUrl:"/ibc.core.channel.v1.QueryPacketCommitmentRequest",encode(a,P=g.BinaryWriter.create()){return a.portId!==""&&P.uint32(10).string(a.portId),a.channelId!==""&&P.uint32(18).string(a.channelId),a.sequence!==BigInt(0)&&P.uint32(24).uint64(a.sequence),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=y();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.portId=k.string();break;case 2:A.channelId=k.string();break;case 3:A.sequence=k.uint64();break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=y();return(0,C.isSet)(a.portId)&&(P.portId=String(a.portId)),(0,C.isSet)(a.channelId)&&(P.channelId=String(a.channelId)),(0,C.isSet)(a.sequence)&&(P.sequence=BigInt(a.sequence.toString())),P},toJSON(a){const P={};return a.portId!==void 0&&(P.portId=a.portId),a.channelId!==void 0&&(P.channelId=a.channelId),a.sequence!==void 0&&(P.sequence=(a.sequence||BigInt(0)).toString()),P},fromPartial(a){const P=y();return P.portId=a.portId??"",P.channelId=a.channelId??"",a.sequence!==void 0&&a.sequence!==null&&(P.sequence=BigInt(a.sequence.toString())),P}};function B(){return{commitment:new Uint8Array,proof:new Uint8Array,proofHeight:i.Height.fromPartial({})}}e.QueryPacketCommitmentResponse={typeUrl:"/ibc.core.channel.v1.QueryPacketCommitmentResponse",encode(a,P=g.BinaryWriter.create()){return a.commitment.length!==0&&P.uint32(10).bytes(a.commitment),a.proof.length!==0&&P.uint32(18).bytes(a.proof),a.proofHeight!==void 0&&i.Height.encode(a.proofHeight,P.uint32(26).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=B();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.commitment=k.bytes();break;case 2:A.proof=k.bytes();break;case 3:A.proofHeight=i.Height.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=B();return(0,C.isSet)(a.commitment)&&(P.commitment=(0,C.bytesFromBase64)(a.commitment)),(0,C.isSet)(a.proof)&&(P.proof=(0,C.bytesFromBase64)(a.proof)),(0,C.isSet)(a.proofHeight)&&(P.proofHeight=i.Height.fromJSON(a.proofHeight)),P},toJSON(a){const P={};return a.commitment!==void 0&&(P.commitment=(0,C.base64FromBytes)(a.commitment!==void 0?a.commitment:new Uint8Array)),a.proof!==void 0&&(P.proof=(0,C.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(P.proofHeight=a.proofHeight?i.Height.toJSON(a.proofHeight):void 0),P},fromPartial(a){const P=B();return P.commitment=a.commitment??new Uint8Array,P.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(P.proofHeight=i.Height.fromPartial(a.proofHeight)),P}};function N(){return{portId:"",channelId:"",pagination:void 0}}e.QueryPacketCommitmentsRequest={typeUrl:"/ibc.core.channel.v1.QueryPacketCommitmentsRequest",encode(a,P=g.BinaryWriter.create()){return a.portId!==""&&P.uint32(10).string(a.portId),a.channelId!==""&&P.uint32(18).string(a.channelId),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,P.uint32(26).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=N();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.portId=k.string();break;case 2:A.channelId=k.string();break;case 3:A.pagination=n.PageRequest.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=N();return(0,C.isSet)(a.portId)&&(P.portId=String(a.portId)),(0,C.isSet)(a.channelId)&&(P.channelId=String(a.channelId)),(0,C.isSet)(a.pagination)&&(P.pagination=n.PageRequest.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.portId!==void 0&&(P.portId=a.portId),a.channelId!==void 0&&(P.channelId=a.channelId),a.pagination!==void 0&&(P.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),P},fromPartial(a){const P=N();return P.portId=a.portId??"",P.channelId=a.channelId??"",a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageRequest.fromPartial(a.pagination)),P}};function U(){return{commitments:[],pagination:void 0,height:i.Height.fromPartial({})}}e.QueryPacketCommitmentsResponse={typeUrl:"/ibc.core.channel.v1.QueryPacketCommitmentsResponse",encode(a,P=g.BinaryWriter.create()){for(const k of a.commitments)t.PacketState.encode(k,P.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,P.uint32(18).fork()).ldelim(),a.height!==void 0&&i.Height.encode(a.height,P.uint32(26).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=U();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.commitments.push(t.PacketState.decode(k,k.uint32()));break;case 2:A.pagination=n.PageResponse.decode(k,k.uint32());break;case 3:A.height=i.Height.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=U();return Array.isArray(a==null?void 0:a.commitments)&&(P.commitments=a.commitments.map(k=>t.PacketState.fromJSON(k))),(0,C.isSet)(a.pagination)&&(P.pagination=n.PageResponse.fromJSON(a.pagination)),(0,C.isSet)(a.height)&&(P.height=i.Height.fromJSON(a.height)),P},toJSON(a){const P={};return a.commitments?P.commitments=a.commitments.map(k=>k?t.PacketState.toJSON(k):void 0):P.commitments=[],a.pagination!==void 0&&(P.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),a.height!==void 0&&(P.height=a.height?i.Height.toJSON(a.height):void 0),P},fromPartial(a){var k;const P=U();return P.commitments=((k=a.commitments)==null?void 0:k.map(v=>t.PacketState.fromPartial(v)))||[],a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageResponse.fromPartial(a.pagination)),a.height!==void 0&&a.height!==null&&(P.height=i.Height.fromPartial(a.height)),P}};function W(){return{portId:"",channelId:"",sequence:BigInt(0)}}e.QueryPacketReceiptRequest={typeUrl:"/ibc.core.channel.v1.QueryPacketReceiptRequest",encode(a,P=g.BinaryWriter.create()){return a.portId!==""&&P.uint32(10).string(a.portId),a.channelId!==""&&P.uint32(18).string(a.channelId),a.sequence!==BigInt(0)&&P.uint32(24).uint64(a.sequence),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=W();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.portId=k.string();break;case 2:A.channelId=k.string();break;case 3:A.sequence=k.uint64();break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=W();return(0,C.isSet)(a.portId)&&(P.portId=String(a.portId)),(0,C.isSet)(a.channelId)&&(P.channelId=String(a.channelId)),(0,C.isSet)(a.sequence)&&(P.sequence=BigInt(a.sequence.toString())),P},toJSON(a){const P={};return a.portId!==void 0&&(P.portId=a.portId),a.channelId!==void 0&&(P.channelId=a.channelId),a.sequence!==void 0&&(P.sequence=(a.sequence||BigInt(0)).toString()),P},fromPartial(a){const P=W();return P.portId=a.portId??"",P.channelId=a.channelId??"",a.sequence!==void 0&&a.sequence!==null&&(P.sequence=BigInt(a.sequence.toString())),P}};function r(){return{received:!1,proof:new Uint8Array,proofHeight:i.Height.fromPartial({})}}e.QueryPacketReceiptResponse={typeUrl:"/ibc.core.channel.v1.QueryPacketReceiptResponse",encode(a,P=g.BinaryWriter.create()){return a.received===!0&&P.uint32(16).bool(a.received),a.proof.length!==0&&P.uint32(26).bytes(a.proof),a.proofHeight!==void 0&&i.Height.encode(a.proofHeight,P.uint32(34).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=r();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 2:A.received=k.bool();break;case 3:A.proof=k.bytes();break;case 4:A.proofHeight=i.Height.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=r();return(0,C.isSet)(a.received)&&(P.received=!!a.received),(0,C.isSet)(a.proof)&&(P.proof=(0,C.bytesFromBase64)(a.proof)),(0,C.isSet)(a.proofHeight)&&(P.proofHeight=i.Height.fromJSON(a.proofHeight)),P},toJSON(a){const P={};return a.received!==void 0&&(P.received=a.received),a.proof!==void 0&&(P.proof=(0,C.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(P.proofHeight=a.proofHeight?i.Height.toJSON(a.proofHeight):void 0),P},fromPartial(a){const P=r();return P.received=a.received??!1,P.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(P.proofHeight=i.Height.fromPartial(a.proofHeight)),P}};function s(){return{portId:"",channelId:"",sequence:BigInt(0)}}e.QueryPacketAcknowledgementRequest={typeUrl:"/ibc.core.channel.v1.QueryPacketAcknowledgementRequest",encode(a,P=g.BinaryWriter.create()){return a.portId!==""&&P.uint32(10).string(a.portId),a.channelId!==""&&P.uint32(18).string(a.channelId),a.sequence!==BigInt(0)&&P.uint32(24).uint64(a.sequence),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=s();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.portId=k.string();break;case 2:A.channelId=k.string();break;case 3:A.sequence=k.uint64();break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=s();return(0,C.isSet)(a.portId)&&(P.portId=String(a.portId)),(0,C.isSet)(a.channelId)&&(P.channelId=String(a.channelId)),(0,C.isSet)(a.sequence)&&(P.sequence=BigInt(a.sequence.toString())),P},toJSON(a){const P={};return a.portId!==void 0&&(P.portId=a.portId),a.channelId!==void 0&&(P.channelId=a.channelId),a.sequence!==void 0&&(P.sequence=(a.sequence||BigInt(0)).toString()),P},fromPartial(a){const P=s();return P.portId=a.portId??"",P.channelId=a.channelId??"",a.sequence!==void 0&&a.sequence!==null&&(P.sequence=BigInt(a.sequence.toString())),P}};function O(){return{acknowledgement:new Uint8Array,proof:new Uint8Array,proofHeight:i.Height.fromPartial({})}}e.QueryPacketAcknowledgementResponse={typeUrl:"/ibc.core.channel.v1.QueryPacketAcknowledgementResponse",encode(a,P=g.BinaryWriter.create()){return a.acknowledgement.length!==0&&P.uint32(10).bytes(a.acknowledgement),a.proof.length!==0&&P.uint32(18).bytes(a.proof),a.proofHeight!==void 0&&i.Height.encode(a.proofHeight,P.uint32(26).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=O();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.acknowledgement=k.bytes();break;case 2:A.proof=k.bytes();break;case 3:A.proofHeight=i.Height.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=O();return(0,C.isSet)(a.acknowledgement)&&(P.acknowledgement=(0,C.bytesFromBase64)(a.acknowledgement)),(0,C.isSet)(a.proof)&&(P.proof=(0,C.bytesFromBase64)(a.proof)),(0,C.isSet)(a.proofHeight)&&(P.proofHeight=i.Height.fromJSON(a.proofHeight)),P},toJSON(a){const P={};return a.acknowledgement!==void 0&&(P.acknowledgement=(0,C.base64FromBytes)(a.acknowledgement!==void 0?a.acknowledgement:new Uint8Array)),a.proof!==void 0&&(P.proof=(0,C.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(P.proofHeight=a.proofHeight?i.Height.toJSON(a.proofHeight):void 0),P},fromPartial(a){const P=O();return P.acknowledgement=a.acknowledgement??new Uint8Array,P.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(P.proofHeight=i.Height.fromPartial(a.proofHeight)),P}};function q(){return{portId:"",channelId:"",pagination:void 0,packetCommitmentSequences:[]}}e.QueryPacketAcknowledgementsRequest={typeUrl:"/ibc.core.channel.v1.QueryPacketAcknowledgementsRequest",encode(a,P=g.BinaryWriter.create()){a.portId!==""&&P.uint32(10).string(a.portId),a.channelId!==""&&P.uint32(18).string(a.channelId),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,P.uint32(26).fork()).ldelim(),P.uint32(34).fork();for(const k of a.packetCommitmentSequences)P.uint64(k);return P.ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=q();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.portId=k.string();break;case 2:A.channelId=k.string();break;case 3:A.pagination=n.PageRequest.decode(k,k.uint32());break;case 4:if((F&7)===2){const K=k.uint32()+k.pos;for(;k.pos<K;)A.packetCommitmentSequences.push(k.uint64())}else A.packetCommitmentSequences.push(k.uint64());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=q();return(0,C.isSet)(a.portId)&&(P.portId=String(a.portId)),(0,C.isSet)(a.channelId)&&(P.channelId=String(a.channelId)),(0,C.isSet)(a.pagination)&&(P.pagination=n.PageRequest.fromJSON(a.pagination)),Array.isArray(a==null?void 0:a.packetCommitmentSequences)&&(P.packetCommitmentSequences=a.packetCommitmentSequences.map(k=>BigInt(k.toString()))),P},toJSON(a){const P={};return a.portId!==void 0&&(P.portId=a.portId),a.channelId!==void 0&&(P.channelId=a.channelId),a.pagination!==void 0&&(P.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),a.packetCommitmentSequences?P.packetCommitmentSequences=a.packetCommitmentSequences.map(k=>(k||BigInt(0)).toString()):P.packetCommitmentSequences=[],P},fromPartial(a){var k;const P=q();return P.portId=a.portId??"",P.channelId=a.channelId??"",a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageRequest.fromPartial(a.pagination)),P.packetCommitmentSequences=((k=a.packetCommitmentSequences)==null?void 0:k.map(v=>BigInt(v.toString())))||[],P}};function d(){return{acknowledgements:[],pagination:void 0,height:i.Height.fromPartial({})}}e.QueryPacketAcknowledgementsResponse={typeUrl:"/ibc.core.channel.v1.QueryPacketAcknowledgementsResponse",encode(a,P=g.BinaryWriter.create()){for(const k of a.acknowledgements)t.PacketState.encode(k,P.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,P.uint32(18).fork()).ldelim(),a.height!==void 0&&i.Height.encode(a.height,P.uint32(26).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=d();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.acknowledgements.push(t.PacketState.decode(k,k.uint32()));break;case 2:A.pagination=n.PageResponse.decode(k,k.uint32());break;case 3:A.height=i.Height.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=d();return Array.isArray(a==null?void 0:a.acknowledgements)&&(P.acknowledgements=a.acknowledgements.map(k=>t.PacketState.fromJSON(k))),(0,C.isSet)(a.pagination)&&(P.pagination=n.PageResponse.fromJSON(a.pagination)),(0,C.isSet)(a.height)&&(P.height=i.Height.fromJSON(a.height)),P},toJSON(a){const P={};return a.acknowledgements?P.acknowledgements=a.acknowledgements.map(k=>k?t.PacketState.toJSON(k):void 0):P.acknowledgements=[],a.pagination!==void 0&&(P.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),a.height!==void 0&&(P.height=a.height?i.Height.toJSON(a.height):void 0),P},fromPartial(a){var k;const P=d();return P.acknowledgements=((k=a.acknowledgements)==null?void 0:k.map(v=>t.PacketState.fromPartial(v)))||[],a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageResponse.fromPartial(a.pagination)),a.height!==void 0&&a.height!==null&&(P.height=i.Height.fromPartial(a.height)),P}};function l(){return{portId:"",channelId:"",packetCommitmentSequences:[]}}e.QueryUnreceivedPacketsRequest={typeUrl:"/ibc.core.channel.v1.QueryUnreceivedPacketsRequest",encode(a,P=g.BinaryWriter.create()){a.portId!==""&&P.uint32(10).string(a.portId),a.channelId!==""&&P.uint32(18).string(a.channelId),P.uint32(26).fork();for(const k of a.packetCommitmentSequences)P.uint64(k);return P.ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=l();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.portId=k.string();break;case 2:A.channelId=k.string();break;case 3:if((F&7)===2){const K=k.uint32()+k.pos;for(;k.pos<K;)A.packetCommitmentSequences.push(k.uint64())}else A.packetCommitmentSequences.push(k.uint64());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=l();return(0,C.isSet)(a.portId)&&(P.portId=String(a.portId)),(0,C.isSet)(a.channelId)&&(P.channelId=String(a.channelId)),Array.isArray(a==null?void 0:a.packetCommitmentSequences)&&(P.packetCommitmentSequences=a.packetCommitmentSequences.map(k=>BigInt(k.toString()))),P},toJSON(a){const P={};return a.portId!==void 0&&(P.portId=a.portId),a.channelId!==void 0&&(P.channelId=a.channelId),a.packetCommitmentSequences?P.packetCommitmentSequences=a.packetCommitmentSequences.map(k=>(k||BigInt(0)).toString()):P.packetCommitmentSequences=[],P},fromPartial(a){var k;const P=l();return P.portId=a.portId??"",P.channelId=a.channelId??"",P.packetCommitmentSequences=((k=a.packetCommitmentSequences)==null?void 0:k.map(v=>BigInt(v.toString())))||[],P}};function M(){return{sequences:[],height:i.Height.fromPartial({})}}e.QueryUnreceivedPacketsResponse={typeUrl:"/ibc.core.channel.v1.QueryUnreceivedPacketsResponse",encode(a,P=g.BinaryWriter.create()){P.uint32(10).fork();for(const k of a.sequences)P.uint64(k);return P.ldelim(),a.height!==void 0&&i.Height.encode(a.height,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=M();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:if((F&7)===2){const K=k.uint32()+k.pos;for(;k.pos<K;)A.sequences.push(k.uint64())}else A.sequences.push(k.uint64());break;case 2:A.height=i.Height.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=M();return Array.isArray(a==null?void 0:a.sequences)&&(P.sequences=a.sequences.map(k=>BigInt(k.toString()))),(0,C.isSet)(a.height)&&(P.height=i.Height.fromJSON(a.height)),P},toJSON(a){const P={};return a.sequences?P.sequences=a.sequences.map(k=>(k||BigInt(0)).toString()):P.sequences=[],a.height!==void 0&&(P.height=a.height?i.Height.toJSON(a.height):void 0),P},fromPartial(a){var k;const P=M();return P.sequences=((k=a.sequences)==null?void 0:k.map(v=>BigInt(v.toString())))||[],a.height!==void 0&&a.height!==null&&(P.height=i.Height.fromPartial(a.height)),P}};function m(){return{portId:"",channelId:"",packetAckSequences:[]}}e.QueryUnreceivedAcksRequest={typeUrl:"/ibc.core.channel.v1.QueryUnreceivedAcksRequest",encode(a,P=g.BinaryWriter.create()){a.portId!==""&&P.uint32(10).string(a.portId),a.channelId!==""&&P.uint32(18).string(a.channelId),P.uint32(26).fork();for(const k of a.packetAckSequences)P.uint64(k);return P.ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=m();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.portId=k.string();break;case 2:A.channelId=k.string();break;case 3:if((F&7)===2){const K=k.uint32()+k.pos;for(;k.pos<K;)A.packetAckSequences.push(k.uint64())}else A.packetAckSequences.push(k.uint64());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=m();return(0,C.isSet)(a.portId)&&(P.portId=String(a.portId)),(0,C.isSet)(a.channelId)&&(P.channelId=String(a.channelId)),Array.isArray(a==null?void 0:a.packetAckSequences)&&(P.packetAckSequences=a.packetAckSequences.map(k=>BigInt(k.toString()))),P},toJSON(a){const P={};return a.portId!==void 0&&(P.portId=a.portId),a.channelId!==void 0&&(P.channelId=a.channelId),a.packetAckSequences?P.packetAckSequences=a.packetAckSequences.map(k=>(k||BigInt(0)).toString()):P.packetAckSequences=[],P},fromPartial(a){var k;const P=m();return P.portId=a.portId??"",P.channelId=a.channelId??"",P.packetAckSequences=((k=a.packetAckSequences)==null?void 0:k.map(v=>BigInt(v.toString())))||[],P}};function h(){return{sequences:[],height:i.Height.fromPartial({})}}e.QueryUnreceivedAcksResponse={typeUrl:"/ibc.core.channel.v1.QueryUnreceivedAcksResponse",encode(a,P=g.BinaryWriter.create()){P.uint32(10).fork();for(const k of a.sequences)P.uint64(k);return P.ldelim(),a.height!==void 0&&i.Height.encode(a.height,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=h();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:if((F&7)===2){const K=k.uint32()+k.pos;for(;k.pos<K;)A.sequences.push(k.uint64())}else A.sequences.push(k.uint64());break;case 2:A.height=i.Height.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=h();return Array.isArray(a==null?void 0:a.sequences)&&(P.sequences=a.sequences.map(k=>BigInt(k.toString()))),(0,C.isSet)(a.height)&&(P.height=i.Height.fromJSON(a.height)),P},toJSON(a){const P={};return a.sequences?P.sequences=a.sequences.map(k=>(k||BigInt(0)).toString()):P.sequences=[],a.height!==void 0&&(P.height=a.height?i.Height.toJSON(a.height):void 0),P},fromPartial(a){var k;const P=h();return P.sequences=((k=a.sequences)==null?void 0:k.map(v=>BigInt(v.toString())))||[],a.height!==void 0&&a.height!==null&&(P.height=i.Height.fromPartial(a.height)),P}};function T(){return{portId:"",channelId:""}}e.QueryNextSequenceReceiveRequest={typeUrl:"/ibc.core.channel.v1.QueryNextSequenceReceiveRequest",encode(a,P=g.BinaryWriter.create()){return a.portId!==""&&P.uint32(10).string(a.portId),a.channelId!==""&&P.uint32(18).string(a.channelId),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=T();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.portId=k.string();break;case 2:A.channelId=k.string();break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=T();return(0,C.isSet)(a.portId)&&(P.portId=String(a.portId)),(0,C.isSet)(a.channelId)&&(P.channelId=String(a.channelId)),P},toJSON(a){const P={};return a.portId!==void 0&&(P.portId=a.portId),a.channelId!==void 0&&(P.channelId=a.channelId),P},fromPartial(a){const P=T();return P.portId=a.portId??"",P.channelId=a.channelId??"",P}};function Q(){return{nextSequenceReceive:BigInt(0),proof:new Uint8Array,proofHeight:i.Height.fromPartial({})}}e.QueryNextSequenceReceiveResponse={typeUrl:"/ibc.core.channel.v1.QueryNextSequenceReceiveResponse",encode(a,P=g.BinaryWriter.create()){return a.nextSequenceReceive!==BigInt(0)&&P.uint32(8).uint64(a.nextSequenceReceive),a.proof.length!==0&&P.uint32(18).bytes(a.proof),a.proofHeight!==void 0&&i.Height.encode(a.proofHeight,P.uint32(26).fork()).ldelim(),P},decode(a,P){const k=a instanceof g.BinaryReader?a:new g.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=Q();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.nextSequenceReceive=k.uint64();break;case 2:A.proof=k.bytes();break;case 3:A.proofHeight=i.Height.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=Q();return(0,C.isSet)(a.nextSequenceReceive)&&(P.nextSequenceReceive=BigInt(a.nextSequenceReceive.toString())),(0,C.isSet)(a.proof)&&(P.proof=(0,C.bytesFromBase64)(a.proof)),(0,C.isSet)(a.proofHeight)&&(P.proofHeight=i.Height.fromJSON(a.proofHeight)),P},toJSON(a){const P={};return a.nextSequenceReceive!==void 0&&(P.nextSequenceReceive=(a.nextSequenceReceive||BigInt(0)).toString()),a.proof!==void 0&&(P.proof=(0,C.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(P.proofHeight=a.proofHeight?i.Height.toJSON(a.proofHeight):void 0),P},fromPartial(a){const P=Q();return a.nextSequenceReceive!==void 0&&a.nextSequenceReceive!==null&&(P.nextSequenceReceive=BigInt(a.nextSequenceReceive.toString())),P.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(P.proofHeight=i.Height.fromPartial(a.proofHeight)),P}};class H{constructor(P){this.rpc=P,this.Channel=this.Channel.bind(this),this.Channels=this.Channels.bind(this),this.ConnectionChannels=this.ConnectionChannels.bind(this),this.ChannelClientState=this.ChannelClientState.bind(this),this.ChannelConsensusState=this.ChannelConsensusState.bind(this),this.PacketCommitment=this.PacketCommitment.bind(this),this.PacketCommitments=this.PacketCommitments.bind(this),this.PacketReceipt=this.PacketReceipt.bind(this),this.PacketAcknowledgement=this.PacketAcknowledgement.bind(this),this.PacketAcknowledgements=this.PacketAcknowledgements.bind(this),this.UnreceivedPackets=this.UnreceivedPackets.bind(this),this.UnreceivedAcks=this.UnreceivedAcks.bind(this),this.NextSequenceReceive=this.NextSequenceReceive.bind(this)}Channel(P){const k=e.QueryChannelRequest.encode(P).finish();return this.rpc.request("ibc.core.channel.v1.Query","Channel",k).then(A=>e.QueryChannelResponse.decode(new g.BinaryReader(A)))}Channels(P={pagination:n.PageRequest.fromPartial({})}){const k=e.QueryChannelsRequest.encode(P).finish();return this.rpc.request("ibc.core.channel.v1.Query","Channels",k).then(A=>e.QueryChannelsResponse.decode(new g.BinaryReader(A)))}ConnectionChannels(P){const k=e.QueryConnectionChannelsRequest.encode(P).finish();return this.rpc.request("ibc.core.channel.v1.Query","ConnectionChannels",k).then(A=>e.QueryConnectionChannelsResponse.decode(new g.BinaryReader(A)))}ChannelClientState(P){const k=e.QueryChannelClientStateRequest.encode(P).finish();return this.rpc.request("ibc.core.channel.v1.Query","ChannelClientState",k).then(A=>e.QueryChannelClientStateResponse.decode(new g.BinaryReader(A)))}ChannelConsensusState(P){const k=e.QueryChannelConsensusStateRequest.encode(P).finish();return this.rpc.request("ibc.core.channel.v1.Query","ChannelConsensusState",k).then(A=>e.QueryChannelConsensusStateResponse.decode(new g.BinaryReader(A)))}PacketCommitment(P){const k=e.QueryPacketCommitmentRequest.encode(P).finish();return this.rpc.request("ibc.core.channel.v1.Query","PacketCommitment",k).then(A=>e.QueryPacketCommitmentResponse.decode(new g.BinaryReader(A)))}PacketCommitments(P){const k=e.QueryPacketCommitmentsRequest.encode(P).finish();return this.rpc.request("ibc.core.channel.v1.Query","PacketCommitments",k).then(A=>e.QueryPacketCommitmentsResponse.decode(new g.BinaryReader(A)))}PacketReceipt(P){const k=e.QueryPacketReceiptRequest.encode(P).finish();return this.rpc.request("ibc.core.channel.v1.Query","PacketReceipt",k).then(A=>e.QueryPacketReceiptResponse.decode(new g.BinaryReader(A)))}PacketAcknowledgement(P){const k=e.QueryPacketAcknowledgementRequest.encode(P).finish();return this.rpc.request("ibc.core.channel.v1.Query","PacketAcknowledgement",k).then(A=>e.QueryPacketAcknowledgementResponse.decode(new g.BinaryReader(A)))}PacketAcknowledgements(P){const k=e.QueryPacketAcknowledgementsRequest.encode(P).finish();return this.rpc.request("ibc.core.channel.v1.Query","PacketAcknowledgements",k).then(A=>e.QueryPacketAcknowledgementsResponse.decode(new g.BinaryReader(A)))}UnreceivedPackets(P){const k=e.QueryUnreceivedPacketsRequest.encode(P).finish();return this.rpc.request("ibc.core.channel.v1.Query","UnreceivedPackets",k).then(A=>e.QueryUnreceivedPacketsResponse.decode(new g.BinaryReader(A)))}UnreceivedAcks(P){const k=e.QueryUnreceivedAcksRequest.encode(P).finish();return this.rpc.request("ibc.core.channel.v1.Query","UnreceivedAcks",k).then(A=>e.QueryUnreceivedAcksResponse.decode(new g.BinaryReader(A)))}NextSequenceReceive(P){const k=e.QueryNextSequenceReceiveRequest.encode(P).finish();return this.rpc.request("ibc.core.channel.v1.Query","NextSequenceReceive",k).then(A=>e.QueryNextSequenceReceiveResponse.decode(new g.BinaryReader(A)))}}e.QueryClientImpl=H})(Oc);var Ac={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryUpgradedConsensusStateResponse=e.QueryUpgradedConsensusStateRequest=e.QueryUpgradedClientStateResponse=e.QueryUpgradedClientStateRequest=e.QueryClientParamsResponse=e.QueryClientParamsRequest=e.QueryClientStatusResponse=e.QueryClientStatusRequest=e.QueryConsensusStateHeightsResponse=e.QueryConsensusStateHeightsRequest=e.QueryConsensusStatesResponse=e.QueryConsensusStatesRequest=e.QueryConsensusStateResponse=e.QueryConsensusStateRequest=e.QueryClientStatesResponse=e.QueryClientStatesRequest=e.QueryClientStateResponse=e.QueryClientStateRequest=e.protobufPackage=void 0;const n=Be,t=_.any,i=kt,o=_.binary,g=_.helpers;e.protobufPackage="ibc.core.client.v1";function C(){return{clientId:""}}e.QueryClientStateRequest={typeUrl:"/ibc.core.client.v1.QueryClientStateRequest",encode(q,d=o.BinaryWriter.create()){return q.clientId!==""&&d.uint32(10).string(q.clientId),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=C();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.clientId=l.string();break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=C();return(0,g.isSet)(q.clientId)&&(d.clientId=String(q.clientId)),d},toJSON(q){const d={};return q.clientId!==void 0&&(d.clientId=q.clientId),d},fromPartial(q){const d=C();return d.clientId=q.clientId??"",d}};function w(){return{clientState:void 0,proof:new Uint8Array,proofHeight:i.Height.fromPartial({})}}e.QueryClientStateResponse={typeUrl:"/ibc.core.client.v1.QueryClientStateResponse",encode(q,d=o.BinaryWriter.create()){return q.clientState!==void 0&&t.Any.encode(q.clientState,d.uint32(10).fork()).ldelim(),q.proof.length!==0&&d.uint32(18).bytes(q.proof),q.proofHeight!==void 0&&i.Height.encode(q.proofHeight,d.uint32(26).fork()).ldelim(),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=w();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.clientState=t.Any.decode(l,l.uint32());break;case 2:m.proof=l.bytes();break;case 3:m.proofHeight=i.Height.decode(l,l.uint32());break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=w();return(0,g.isSet)(q.clientState)&&(d.clientState=t.Any.fromJSON(q.clientState)),(0,g.isSet)(q.proof)&&(d.proof=(0,g.bytesFromBase64)(q.proof)),(0,g.isSet)(q.proofHeight)&&(d.proofHeight=i.Height.fromJSON(q.proofHeight)),d},toJSON(q){const d={};return q.clientState!==void 0&&(d.clientState=q.clientState?t.Any.toJSON(q.clientState):void 0),q.proof!==void 0&&(d.proof=(0,g.base64FromBytes)(q.proof!==void 0?q.proof:new Uint8Array)),q.proofHeight!==void 0&&(d.proofHeight=q.proofHeight?i.Height.toJSON(q.proofHeight):void 0),d},fromPartial(q){const d=w();return q.clientState!==void 0&&q.clientState!==null&&(d.clientState=t.Any.fromPartial(q.clientState)),d.proof=q.proof??new Uint8Array,q.proofHeight!==void 0&&q.proofHeight!==null&&(d.proofHeight=i.Height.fromPartial(q.proofHeight)),d}};function E(){return{pagination:void 0}}e.QueryClientStatesRequest={typeUrl:"/ibc.core.client.v1.QueryClientStatesRequest",encode(q,d=o.BinaryWriter.create()){return q.pagination!==void 0&&n.PageRequest.encode(q.pagination,d.uint32(10).fork()).ldelim(),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=E();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.pagination=n.PageRequest.decode(l,l.uint32());break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=E();return(0,g.isSet)(q.pagination)&&(d.pagination=n.PageRequest.fromJSON(q.pagination)),d},toJSON(q){const d={};return q.pagination!==void 0&&(d.pagination=q.pagination?n.PageRequest.toJSON(q.pagination):void 0),d},fromPartial(q){const d=E();return q.pagination!==void 0&&q.pagination!==null&&(d.pagination=n.PageRequest.fromPartial(q.pagination)),d}};function D(){return{clientStates:[],pagination:void 0}}e.QueryClientStatesResponse={typeUrl:"/ibc.core.client.v1.QueryClientStatesResponse",encode(q,d=o.BinaryWriter.create()){for(const l of q.clientStates)i.IdentifiedClientState.encode(l,d.uint32(10).fork()).ldelim();return q.pagination!==void 0&&n.PageResponse.encode(q.pagination,d.uint32(18).fork()).ldelim(),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=D();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.clientStates.push(i.IdentifiedClientState.decode(l,l.uint32()));break;case 2:m.pagination=n.PageResponse.decode(l,l.uint32());break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=D();return Array.isArray(q==null?void 0:q.clientStates)&&(d.clientStates=q.clientStates.map(l=>i.IdentifiedClientState.fromJSON(l))),(0,g.isSet)(q.pagination)&&(d.pagination=n.PageResponse.fromJSON(q.pagination)),d},toJSON(q){const d={};return q.clientStates?d.clientStates=q.clientStates.map(l=>l?i.IdentifiedClientState.toJSON(l):void 0):d.clientStates=[],q.pagination!==void 0&&(d.pagination=q.pagination?n.PageResponse.toJSON(q.pagination):void 0),d},fromPartial(q){var l;const d=D();return d.clientStates=((l=q.clientStates)==null?void 0:l.map(M=>i.IdentifiedClientState.fromPartial(M)))||[],q.pagination!==void 0&&q.pagination!==null&&(d.pagination=n.PageResponse.fromPartial(q.pagination)),d}};function J(){return{clientId:"",revisionNumber:BigInt(0),revisionHeight:BigInt(0),latestHeight:!1}}e.QueryConsensusStateRequest={typeUrl:"/ibc.core.client.v1.QueryConsensusStateRequest",encode(q,d=o.BinaryWriter.create()){return q.clientId!==""&&d.uint32(10).string(q.clientId),q.revisionNumber!==BigInt(0)&&d.uint32(16).uint64(q.revisionNumber),q.revisionHeight!==BigInt(0)&&d.uint32(24).uint64(q.revisionHeight),q.latestHeight===!0&&d.uint32(32).bool(q.latestHeight),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=J();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.clientId=l.string();break;case 2:m.revisionNumber=l.uint64();break;case 3:m.revisionHeight=l.uint64();break;case 4:m.latestHeight=l.bool();break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=J();return(0,g.isSet)(q.clientId)&&(d.clientId=String(q.clientId)),(0,g.isSet)(q.revisionNumber)&&(d.revisionNumber=BigInt(q.revisionNumber.toString())),(0,g.isSet)(q.revisionHeight)&&(d.revisionHeight=BigInt(q.revisionHeight.toString())),(0,g.isSet)(q.latestHeight)&&(d.latestHeight=!!q.latestHeight),d},toJSON(q){const d={};return q.clientId!==void 0&&(d.clientId=q.clientId),q.revisionNumber!==void 0&&(d.revisionNumber=(q.revisionNumber||BigInt(0)).toString()),q.revisionHeight!==void 0&&(d.revisionHeight=(q.revisionHeight||BigInt(0)).toString()),q.latestHeight!==void 0&&(d.latestHeight=q.latestHeight),d},fromPartial(q){const d=J();return d.clientId=q.clientId??"",q.revisionNumber!==void 0&&q.revisionNumber!==null&&(d.revisionNumber=BigInt(q.revisionNumber.toString())),q.revisionHeight!==void 0&&q.revisionHeight!==null&&(d.revisionHeight=BigInt(q.revisionHeight.toString())),d.latestHeight=q.latestHeight??!1,d}};function b(){return{consensusState:void 0,proof:new Uint8Array,proofHeight:i.Height.fromPartial({})}}e.QueryConsensusStateResponse={typeUrl:"/ibc.core.client.v1.QueryConsensusStateResponse",encode(q,d=o.BinaryWriter.create()){return q.consensusState!==void 0&&t.Any.encode(q.consensusState,d.uint32(10).fork()).ldelim(),q.proof.length!==0&&d.uint32(18).bytes(q.proof),q.proofHeight!==void 0&&i.Height.encode(q.proofHeight,d.uint32(26).fork()).ldelim(),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=b();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.consensusState=t.Any.decode(l,l.uint32());break;case 2:m.proof=l.bytes();break;case 3:m.proofHeight=i.Height.decode(l,l.uint32());break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=b();return(0,g.isSet)(q.consensusState)&&(d.consensusState=t.Any.fromJSON(q.consensusState)),(0,g.isSet)(q.proof)&&(d.proof=(0,g.bytesFromBase64)(q.proof)),(0,g.isSet)(q.proofHeight)&&(d.proofHeight=i.Height.fromJSON(q.proofHeight)),d},toJSON(q){const d={};return q.consensusState!==void 0&&(d.consensusState=q.consensusState?t.Any.toJSON(q.consensusState):void 0),q.proof!==void 0&&(d.proof=(0,g.base64FromBytes)(q.proof!==void 0?q.proof:new Uint8Array)),q.proofHeight!==void 0&&(d.proofHeight=q.proofHeight?i.Height.toJSON(q.proofHeight):void 0),d},fromPartial(q){const d=b();return q.consensusState!==void 0&&q.consensusState!==null&&(d.consensusState=t.Any.fromPartial(q.consensusState)),d.proof=q.proof??new Uint8Array,q.proofHeight!==void 0&&q.proofHeight!==null&&(d.proofHeight=i.Height.fromPartial(q.proofHeight)),d}};function p(){return{clientId:"",pagination:void 0}}e.QueryConsensusStatesRequest={typeUrl:"/ibc.core.client.v1.QueryConsensusStatesRequest",encode(q,d=o.BinaryWriter.create()){return q.clientId!==""&&d.uint32(10).string(q.clientId),q.pagination!==void 0&&n.PageRequest.encode(q.pagination,d.uint32(18).fork()).ldelim(),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=p();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.clientId=l.string();break;case 2:m.pagination=n.PageRequest.decode(l,l.uint32());break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=p();return(0,g.isSet)(q.clientId)&&(d.clientId=String(q.clientId)),(0,g.isSet)(q.pagination)&&(d.pagination=n.PageRequest.fromJSON(q.pagination)),d},toJSON(q){const d={};return q.clientId!==void 0&&(d.clientId=q.clientId),q.pagination!==void 0&&(d.pagination=q.pagination?n.PageRequest.toJSON(q.pagination):void 0),d},fromPartial(q){const d=p();return d.clientId=q.clientId??"",q.pagination!==void 0&&q.pagination!==null&&(d.pagination=n.PageRequest.fromPartial(q.pagination)),d}};function S(){return{consensusStates:[],pagination:void 0}}e.QueryConsensusStatesResponse={typeUrl:"/ibc.core.client.v1.QueryConsensusStatesResponse",encode(q,d=o.BinaryWriter.create()){for(const l of q.consensusStates)i.ConsensusStateWithHeight.encode(l,d.uint32(10).fork()).ldelim();return q.pagination!==void 0&&n.PageResponse.encode(q.pagination,d.uint32(18).fork()).ldelim(),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=S();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.consensusStates.push(i.ConsensusStateWithHeight.decode(l,l.uint32()));break;case 2:m.pagination=n.PageResponse.decode(l,l.uint32());break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=S();return Array.isArray(q==null?void 0:q.consensusStates)&&(d.consensusStates=q.consensusStates.map(l=>i.ConsensusStateWithHeight.fromJSON(l))),(0,g.isSet)(q.pagination)&&(d.pagination=n.PageResponse.fromJSON(q.pagination)),d},toJSON(q){const d={};return q.consensusStates?d.consensusStates=q.consensusStates.map(l=>l?i.ConsensusStateWithHeight.toJSON(l):void 0):d.consensusStates=[],q.pagination!==void 0&&(d.pagination=q.pagination?n.PageResponse.toJSON(q.pagination):void 0),d},fromPartial(q){var l;const d=S();return d.consensusStates=((l=q.consensusStates)==null?void 0:l.map(M=>i.ConsensusStateWithHeight.fromPartial(M)))||[],q.pagination!==void 0&&q.pagination!==null&&(d.pagination=n.PageResponse.fromPartial(q.pagination)),d}};function R(){return{clientId:"",pagination:void 0}}e.QueryConsensusStateHeightsRequest={typeUrl:"/ibc.core.client.v1.QueryConsensusStateHeightsRequest",encode(q,d=o.BinaryWriter.create()){return q.clientId!==""&&d.uint32(10).string(q.clientId),q.pagination!==void 0&&n.PageRequest.encode(q.pagination,d.uint32(18).fork()).ldelim(),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=R();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.clientId=l.string();break;case 2:m.pagination=n.PageRequest.decode(l,l.uint32());break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=R();return(0,g.isSet)(q.clientId)&&(d.clientId=String(q.clientId)),(0,g.isSet)(q.pagination)&&(d.pagination=n.PageRequest.fromJSON(q.pagination)),d},toJSON(q){const d={};return q.clientId!==void 0&&(d.clientId=q.clientId),q.pagination!==void 0&&(d.pagination=q.pagination?n.PageRequest.toJSON(q.pagination):void 0),d},fromPartial(q){const d=R();return d.clientId=q.clientId??"",q.pagination!==void 0&&q.pagination!==null&&(d.pagination=n.PageRequest.fromPartial(q.pagination)),d}};function u(){return{consensusStateHeights:[],pagination:void 0}}e.QueryConsensusStateHeightsResponse={typeUrl:"/ibc.core.client.v1.QueryConsensusStateHeightsResponse",encode(q,d=o.BinaryWriter.create()){for(const l of q.consensusStateHeights)i.Height.encode(l,d.uint32(10).fork()).ldelim();return q.pagination!==void 0&&n.PageResponse.encode(q.pagination,d.uint32(18).fork()).ldelim(),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=u();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.consensusStateHeights.push(i.Height.decode(l,l.uint32()));break;case 2:m.pagination=n.PageResponse.decode(l,l.uint32());break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=u();return Array.isArray(q==null?void 0:q.consensusStateHeights)&&(d.consensusStateHeights=q.consensusStateHeights.map(l=>i.Height.fromJSON(l))),(0,g.isSet)(q.pagination)&&(d.pagination=n.PageResponse.fromJSON(q.pagination)),d},toJSON(q){const d={};return q.consensusStateHeights?d.consensusStateHeights=q.consensusStateHeights.map(l=>l?i.Height.toJSON(l):void 0):d.consensusStateHeights=[],q.pagination!==void 0&&(d.pagination=q.pagination?n.PageResponse.toJSON(q.pagination):void 0),d},fromPartial(q){var l;const d=u();return d.consensusStateHeights=((l=q.consensusStateHeights)==null?void 0:l.map(M=>i.Height.fromPartial(M)))||[],q.pagination!==void 0&&q.pagination!==null&&(d.pagination=n.PageResponse.fromPartial(q.pagination)),d}};function c(){return{clientId:""}}e.QueryClientStatusRequest={typeUrl:"/ibc.core.client.v1.QueryClientStatusRequest",encode(q,d=o.BinaryWriter.create()){return q.clientId!==""&&d.uint32(10).string(q.clientId),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=c();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.clientId=l.string();break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=c();return(0,g.isSet)(q.clientId)&&(d.clientId=String(q.clientId)),d},toJSON(q){const d={};return q.clientId!==void 0&&(d.clientId=q.clientId),d},fromPartial(q){const d=c();return d.clientId=q.clientId??"",d}};function y(){return{status:""}}e.QueryClientStatusResponse={typeUrl:"/ibc.core.client.v1.QueryClientStatusResponse",encode(q,d=o.BinaryWriter.create()){return q.status!==""&&d.uint32(10).string(q.status),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=y();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.status=l.string();break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=y();return(0,g.isSet)(q.status)&&(d.status=String(q.status)),d},toJSON(q){const d={};return q.status!==void 0&&(d.status=q.status),d},fromPartial(q){const d=y();return d.status=q.status??"",d}};function B(){return{}}e.QueryClientParamsRequest={typeUrl:"/ibc.core.client.v1.QueryClientParamsRequest",encode(q,d=o.BinaryWriter.create()){return d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=B();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){default:l.skipType(h&7);break}}return m},fromJSON(q){return B()},toJSON(q){return{}},fromPartial(q){return B()}};function N(){return{params:void 0}}e.QueryClientParamsResponse={typeUrl:"/ibc.core.client.v1.QueryClientParamsResponse",encode(q,d=o.BinaryWriter.create()){return q.params!==void 0&&i.Params.encode(q.params,d.uint32(10).fork()).ldelim(),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=N();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.params=i.Params.decode(l,l.uint32());break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=N();return(0,g.isSet)(q.params)&&(d.params=i.Params.fromJSON(q.params)),d},toJSON(q){const d={};return q.params!==void 0&&(d.params=q.params?i.Params.toJSON(q.params):void 0),d},fromPartial(q){const d=N();return q.params!==void 0&&q.params!==null&&(d.params=i.Params.fromPartial(q.params)),d}};function U(){return{}}e.QueryUpgradedClientStateRequest={typeUrl:"/ibc.core.client.v1.QueryUpgradedClientStateRequest",encode(q,d=o.BinaryWriter.create()){return d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=U();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){default:l.skipType(h&7);break}}return m},fromJSON(q){return U()},toJSON(q){return{}},fromPartial(q){return U()}};function W(){return{upgradedClientState:void 0}}e.QueryUpgradedClientStateResponse={typeUrl:"/ibc.core.client.v1.QueryUpgradedClientStateResponse",encode(q,d=o.BinaryWriter.create()){return q.upgradedClientState!==void 0&&t.Any.encode(q.upgradedClientState,d.uint32(10).fork()).ldelim(),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=W();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.upgradedClientState=t.Any.decode(l,l.uint32());break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=W();return(0,g.isSet)(q.upgradedClientState)&&(d.upgradedClientState=t.Any.fromJSON(q.upgradedClientState)),d},toJSON(q){const d={};return q.upgradedClientState!==void 0&&(d.upgradedClientState=q.upgradedClientState?t.Any.toJSON(q.upgradedClientState):void 0),d},fromPartial(q){const d=W();return q.upgradedClientState!==void 0&&q.upgradedClientState!==null&&(d.upgradedClientState=t.Any.fromPartial(q.upgradedClientState)),d}};function r(){return{}}e.QueryUpgradedConsensusStateRequest={typeUrl:"/ibc.core.client.v1.QueryUpgradedConsensusStateRequest",encode(q,d=o.BinaryWriter.create()){return d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=r();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){default:l.skipType(h&7);break}}return m},fromJSON(q){return r()},toJSON(q){return{}},fromPartial(q){return r()}};function s(){return{upgradedConsensusState:void 0}}e.QueryUpgradedConsensusStateResponse={typeUrl:"/ibc.core.client.v1.QueryUpgradedConsensusStateResponse",encode(q,d=o.BinaryWriter.create()){return q.upgradedConsensusState!==void 0&&t.Any.encode(q.upgradedConsensusState,d.uint32(10).fork()).ldelim(),d},decode(q,d){const l=q instanceof o.BinaryReader?q:new o.BinaryReader(q);let M=d===void 0?l.len:l.pos+d;const m=s();for(;l.pos<M;){const h=l.uint32();switch(h>>>3){case 1:m.upgradedConsensusState=t.Any.decode(l,l.uint32());break;default:l.skipType(h&7);break}}return m},fromJSON(q){const d=s();return(0,g.isSet)(q.upgradedConsensusState)&&(d.upgradedConsensusState=t.Any.fromJSON(q.upgradedConsensusState)),d},toJSON(q){const d={};return q.upgradedConsensusState!==void 0&&(d.upgradedConsensusState=q.upgradedConsensusState?t.Any.toJSON(q.upgradedConsensusState):void 0),d},fromPartial(q){const d=s();return q.upgradedConsensusState!==void 0&&q.upgradedConsensusState!==null&&(d.upgradedConsensusState=t.Any.fromPartial(q.upgradedConsensusState)),d}};class O{constructor(d){this.rpc=d,this.ClientState=this.ClientState.bind(this),this.ClientStates=this.ClientStates.bind(this),this.ConsensusState=this.ConsensusState.bind(this),this.ConsensusStates=this.ConsensusStates.bind(this),this.ConsensusStateHeights=this.ConsensusStateHeights.bind(this),this.ClientStatus=this.ClientStatus.bind(this),this.ClientParams=this.ClientParams.bind(this),this.UpgradedClientState=this.UpgradedClientState.bind(this),this.UpgradedConsensusState=this.UpgradedConsensusState.bind(this)}ClientState(d){const l=e.QueryClientStateRequest.encode(d).finish();return this.rpc.request("ibc.core.client.v1.Query","ClientState",l).then(m=>e.QueryClientStateResponse.decode(new o.BinaryReader(m)))}ClientStates(d={pagination:n.PageRequest.fromPartial({})}){const l=e.QueryClientStatesRequest.encode(d).finish();return this.rpc.request("ibc.core.client.v1.Query","ClientStates",l).then(m=>e.QueryClientStatesResponse.decode(new o.BinaryReader(m)))}ConsensusState(d){const l=e.QueryConsensusStateRequest.encode(d).finish();return this.rpc.request("ibc.core.client.v1.Query","ConsensusState",l).then(m=>e.QueryConsensusStateResponse.decode(new o.BinaryReader(m)))}ConsensusStates(d){const l=e.QueryConsensusStatesRequest.encode(d).finish();return this.rpc.request("ibc.core.client.v1.Query","ConsensusStates",l).then(m=>e.QueryConsensusStatesResponse.decode(new o.BinaryReader(m)))}ConsensusStateHeights(d){const l=e.QueryConsensusStateHeightsRequest.encode(d).finish();return this.rpc.request("ibc.core.client.v1.Query","ConsensusStateHeights",l).then(m=>e.QueryConsensusStateHeightsResponse.decode(new o.BinaryReader(m)))}ClientStatus(d){const l=e.QueryClientStatusRequest.encode(d).finish();return this.rpc.request("ibc.core.client.v1.Query","ClientStatus",l).then(m=>e.QueryClientStatusResponse.decode(new o.BinaryReader(m)))}ClientParams(d={}){const l=e.QueryClientParamsRequest.encode(d).finish();return this.rpc.request("ibc.core.client.v1.Query","ClientParams",l).then(m=>e.QueryClientParamsResponse.decode(new o.BinaryReader(m)))}UpgradedClientState(d={}){const l=e.QueryUpgradedClientStateRequest.encode(d).finish();return this.rpc.request("ibc.core.client.v1.Query","UpgradedClientState",l).then(m=>e.QueryUpgradedClientStateResponse.decode(new o.BinaryReader(m)))}UpgradedConsensusState(d={}){const l=e.QueryUpgradedConsensusStateRequest.encode(d).finish();return this.rpc.request("ibc.core.client.v1.Query","UpgradedConsensusState",l).then(m=>e.QueryUpgradedConsensusStateResponse.decode(new o.BinaryReader(m)))}}e.QueryClientImpl=O})(Ac);var Tc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryConnectionParamsResponse=e.QueryConnectionParamsRequest=e.QueryConnectionConsensusStateResponse=e.QueryConnectionConsensusStateRequest=e.QueryConnectionClientStateResponse=e.QueryConnectionClientStateRequest=e.QueryClientConnectionsResponse=e.QueryClientConnectionsRequest=e.QueryConnectionsResponse=e.QueryConnectionsRequest=e.QueryConnectionResponse=e.QueryConnectionRequest=e.protobufPackage=void 0;const n=Be,t=bc,i=kt,o=_.any,g=_.binary,C=_.helpers;e.protobufPackage="ibc.core.connection.v1";function w(){return{connectionId:""}}e.QueryConnectionRequest={typeUrl:"/ibc.core.connection.v1.QueryConnectionRequest",encode(U,W=g.BinaryWriter.create()){return U.connectionId!==""&&W.uint32(10).string(U.connectionId),W},decode(U,W){const r=U instanceof g.BinaryReader?U:new g.BinaryReader(U);let s=W===void 0?r.len:r.pos+W;const O=w();for(;r.pos<s;){const q=r.uint32();switch(q>>>3){case 1:O.connectionId=r.string();break;default:r.skipType(q&7);break}}return O},fromJSON(U){const W=w();return(0,C.isSet)(U.connectionId)&&(W.connectionId=String(U.connectionId)),W},toJSON(U){const W={};return U.connectionId!==void 0&&(W.connectionId=U.connectionId),W},fromPartial(U){const W=w();return W.connectionId=U.connectionId??"",W}};function E(){return{connection:void 0,proof:new Uint8Array,proofHeight:i.Height.fromPartial({})}}e.QueryConnectionResponse={typeUrl:"/ibc.core.connection.v1.QueryConnectionResponse",encode(U,W=g.BinaryWriter.create()){return U.connection!==void 0&&t.ConnectionEnd.encode(U.connection,W.uint32(10).fork()).ldelim(),U.proof.length!==0&&W.uint32(18).bytes(U.proof),U.proofHeight!==void 0&&i.Height.encode(U.proofHeight,W.uint32(26).fork()).ldelim(),W},decode(U,W){const r=U instanceof g.BinaryReader?U:new g.BinaryReader(U);let s=W===void 0?r.len:r.pos+W;const O=E();for(;r.pos<s;){const q=r.uint32();switch(q>>>3){case 1:O.connection=t.ConnectionEnd.decode(r,r.uint32());break;case 2:O.proof=r.bytes();break;case 3:O.proofHeight=i.Height.decode(r,r.uint32());break;default:r.skipType(q&7);break}}return O},fromJSON(U){const W=E();return(0,C.isSet)(U.connection)&&(W.connection=t.ConnectionEnd.fromJSON(U.connection)),(0,C.isSet)(U.proof)&&(W.proof=(0,C.bytesFromBase64)(U.proof)),(0,C.isSet)(U.proofHeight)&&(W.proofHeight=i.Height.fromJSON(U.proofHeight)),W},toJSON(U){const W={};return U.connection!==void 0&&(W.connection=U.connection?t.ConnectionEnd.toJSON(U.connection):void 0),U.proof!==void 0&&(W.proof=(0,C.base64FromBytes)(U.proof!==void 0?U.proof:new Uint8Array)),U.proofHeight!==void 0&&(W.proofHeight=U.proofHeight?i.Height.toJSON(U.proofHeight):void 0),W},fromPartial(U){const W=E();return U.connection!==void 0&&U.connection!==null&&(W.connection=t.ConnectionEnd.fromPartial(U.connection)),W.proof=U.proof??new Uint8Array,U.proofHeight!==void 0&&U.proofHeight!==null&&(W.proofHeight=i.Height.fromPartial(U.proofHeight)),W}};function D(){return{pagination:void 0}}e.QueryConnectionsRequest={typeUrl:"/ibc.core.connection.v1.QueryConnectionsRequest",encode(U,W=g.BinaryWriter.create()){return U.pagination!==void 0&&n.PageRequest.encode(U.pagination,W.uint32(10).fork()).ldelim(),W},decode(U,W){const r=U instanceof g.BinaryReader?U:new g.BinaryReader(U);let s=W===void 0?r.len:r.pos+W;const O=D();for(;r.pos<s;){const q=r.uint32();switch(q>>>3){case 1:O.pagination=n.PageRequest.decode(r,r.uint32());break;default:r.skipType(q&7);break}}return O},fromJSON(U){const W=D();return(0,C.isSet)(U.pagination)&&(W.pagination=n.PageRequest.fromJSON(U.pagination)),W},toJSON(U){const W={};return U.pagination!==void 0&&(W.pagination=U.pagination?n.PageRequest.toJSON(U.pagination):void 0),W},fromPartial(U){const W=D();return U.pagination!==void 0&&U.pagination!==null&&(W.pagination=n.PageRequest.fromPartial(U.pagination)),W}};function J(){return{connections:[],pagination:void 0,height:i.Height.fromPartial({})}}e.QueryConnectionsResponse={typeUrl:"/ibc.core.connection.v1.QueryConnectionsResponse",encode(U,W=g.BinaryWriter.create()){for(const r of U.connections)t.IdentifiedConnection.encode(r,W.uint32(10).fork()).ldelim();return U.pagination!==void 0&&n.PageResponse.encode(U.pagination,W.uint32(18).fork()).ldelim(),U.height!==void 0&&i.Height.encode(U.height,W.uint32(26).fork()).ldelim(),W},decode(U,W){const r=U instanceof g.BinaryReader?U:new g.BinaryReader(U);let s=W===void 0?r.len:r.pos+W;const O=J();for(;r.pos<s;){const q=r.uint32();switch(q>>>3){case 1:O.connections.push(t.IdentifiedConnection.decode(r,r.uint32()));break;case 2:O.pagination=n.PageResponse.decode(r,r.uint32());break;case 3:O.height=i.Height.decode(r,r.uint32());break;default:r.skipType(q&7);break}}return O},fromJSON(U){const W=J();return Array.isArray(U==null?void 0:U.connections)&&(W.connections=U.connections.map(r=>t.IdentifiedConnection.fromJSON(r))),(0,C.isSet)(U.pagination)&&(W.pagination=n.PageResponse.fromJSON(U.pagination)),(0,C.isSet)(U.height)&&(W.height=i.Height.fromJSON(U.height)),W},toJSON(U){const W={};return U.connections?W.connections=U.connections.map(r=>r?t.IdentifiedConnection.toJSON(r):void 0):W.connections=[],U.pagination!==void 0&&(W.pagination=U.pagination?n.PageResponse.toJSON(U.pagination):void 0),U.height!==void 0&&(W.height=U.height?i.Height.toJSON(U.height):void 0),W},fromPartial(U){var r;const W=J();return W.connections=((r=U.connections)==null?void 0:r.map(s=>t.IdentifiedConnection.fromPartial(s)))||[],U.pagination!==void 0&&U.pagination!==null&&(W.pagination=n.PageResponse.fromPartial(U.pagination)),U.height!==void 0&&U.height!==null&&(W.height=i.Height.fromPartial(U.height)),W}};function b(){return{clientId:""}}e.QueryClientConnectionsRequest={typeUrl:"/ibc.core.connection.v1.QueryClientConnectionsRequest",encode(U,W=g.BinaryWriter.create()){return U.clientId!==""&&W.uint32(10).string(U.clientId),W},decode(U,W){const r=U instanceof g.BinaryReader?U:new g.BinaryReader(U);let s=W===void 0?r.len:r.pos+W;const O=b();for(;r.pos<s;){const q=r.uint32();switch(q>>>3){case 1:O.clientId=r.string();break;default:r.skipType(q&7);break}}return O},fromJSON(U){const W=b();return(0,C.isSet)(U.clientId)&&(W.clientId=String(U.clientId)),W},toJSON(U){const W={};return U.clientId!==void 0&&(W.clientId=U.clientId),W},fromPartial(U){const W=b();return W.clientId=U.clientId??"",W}};function p(){return{connectionPaths:[],proof:new Uint8Array,proofHeight:i.Height.fromPartial({})}}e.QueryClientConnectionsResponse={typeUrl:"/ibc.core.connection.v1.QueryClientConnectionsResponse",encode(U,W=g.BinaryWriter.create()){for(const r of U.connectionPaths)W.uint32(10).string(r);return U.proof.length!==0&&W.uint32(18).bytes(U.proof),U.proofHeight!==void 0&&i.Height.encode(U.proofHeight,W.uint32(26).fork()).ldelim(),W},decode(U,W){const r=U instanceof g.BinaryReader?U:new g.BinaryReader(U);let s=W===void 0?r.len:r.pos+W;const O=p();for(;r.pos<s;){const q=r.uint32();switch(q>>>3){case 1:O.connectionPaths.push(r.string());break;case 2:O.proof=r.bytes();break;case 3:O.proofHeight=i.Height.decode(r,r.uint32());break;default:r.skipType(q&7);break}}return O},fromJSON(U){const W=p();return Array.isArray(U==null?void 0:U.connectionPaths)&&(W.connectionPaths=U.connectionPaths.map(r=>String(r))),(0,C.isSet)(U.proof)&&(W.proof=(0,C.bytesFromBase64)(U.proof)),(0,C.isSet)(U.proofHeight)&&(W.proofHeight=i.Height.fromJSON(U.proofHeight)),W},toJSON(U){const W={};return U.connectionPaths?W.connectionPaths=U.connectionPaths.map(r=>r):W.connectionPaths=[],U.proof!==void 0&&(W.proof=(0,C.base64FromBytes)(U.proof!==void 0?U.proof:new Uint8Array)),U.proofHeight!==void 0&&(W.proofHeight=U.proofHeight?i.Height.toJSON(U.proofHeight):void 0),W},fromPartial(U){var r;const W=p();return W.connectionPaths=((r=U.connectionPaths)==null?void 0:r.map(s=>s))||[],W.proof=U.proof??new Uint8Array,U.proofHeight!==void 0&&U.proofHeight!==null&&(W.proofHeight=i.Height.fromPartial(U.proofHeight)),W}};function S(){return{connectionId:""}}e.QueryConnectionClientStateRequest={typeUrl:"/ibc.core.connection.v1.QueryConnectionClientStateRequest",encode(U,W=g.BinaryWriter.create()){return U.connectionId!==""&&W.uint32(10).string(U.connectionId),W},decode(U,W){const r=U instanceof g.BinaryReader?U:new g.BinaryReader(U);let s=W===void 0?r.len:r.pos+W;const O=S();for(;r.pos<s;){const q=r.uint32();switch(q>>>3){case 1:O.connectionId=r.string();break;default:r.skipType(q&7);break}}return O},fromJSON(U){const W=S();return(0,C.isSet)(U.connectionId)&&(W.connectionId=String(U.connectionId)),W},toJSON(U){const W={};return U.connectionId!==void 0&&(W.connectionId=U.connectionId),W},fromPartial(U){const W=S();return W.connectionId=U.connectionId??"",W}};function R(){return{identifiedClientState:void 0,proof:new Uint8Array,proofHeight:i.Height.fromPartial({})}}e.QueryConnectionClientStateResponse={typeUrl:"/ibc.core.connection.v1.QueryConnectionClientStateResponse",encode(U,W=g.BinaryWriter.create()){return U.identifiedClientState!==void 0&&i.IdentifiedClientState.encode(U.identifiedClientState,W.uint32(10).fork()).ldelim(),U.proof.length!==0&&W.uint32(18).bytes(U.proof),U.proofHeight!==void 0&&i.Height.encode(U.proofHeight,W.uint32(26).fork()).ldelim(),W},decode(U,W){const r=U instanceof g.BinaryReader?U:new g.BinaryReader(U);let s=W===void 0?r.len:r.pos+W;const O=R();for(;r.pos<s;){const q=r.uint32();switch(q>>>3){case 1:O.identifiedClientState=i.IdentifiedClientState.decode(r,r.uint32());break;case 2:O.proof=r.bytes();break;case 3:O.proofHeight=i.Height.decode(r,r.uint32());break;default:r.skipType(q&7);break}}return O},fromJSON(U){const W=R();return(0,C.isSet)(U.identifiedClientState)&&(W.identifiedClientState=i.IdentifiedClientState.fromJSON(U.identifiedClientState)),(0,C.isSet)(U.proof)&&(W.proof=(0,C.bytesFromBase64)(U.proof)),(0,C.isSet)(U.proofHeight)&&(W.proofHeight=i.Height.fromJSON(U.proofHeight)),W},toJSON(U){const W={};return U.identifiedClientState!==void 0&&(W.identifiedClientState=U.identifiedClientState?i.IdentifiedClientState.toJSON(U.identifiedClientState):void 0),U.proof!==void 0&&(W.proof=(0,C.base64FromBytes)(U.proof!==void 0?U.proof:new Uint8Array)),U.proofHeight!==void 0&&(W.proofHeight=U.proofHeight?i.Height.toJSON(U.proofHeight):void 0),W},fromPartial(U){const W=R();return U.identifiedClientState!==void 0&&U.identifiedClientState!==null&&(W.identifiedClientState=i.IdentifiedClientState.fromPartial(U.identifiedClientState)),W.proof=U.proof??new Uint8Array,U.proofHeight!==void 0&&U.proofHeight!==null&&(W.proofHeight=i.Height.fromPartial(U.proofHeight)),W}};function u(){return{connectionId:"",revisionNumber:BigInt(0),revisionHeight:BigInt(0)}}e.QueryConnectionConsensusStateRequest={typeUrl:"/ibc.core.connection.v1.QueryConnectionConsensusStateRequest",encode(U,W=g.BinaryWriter.create()){return U.connectionId!==""&&W.uint32(10).string(U.connectionId),U.revisionNumber!==BigInt(0)&&W.uint32(16).uint64(U.revisionNumber),U.revisionHeight!==BigInt(0)&&W.uint32(24).uint64(U.revisionHeight),W},decode(U,W){const r=U instanceof g.BinaryReader?U:new g.BinaryReader(U);let s=W===void 0?r.len:r.pos+W;const O=u();for(;r.pos<s;){const q=r.uint32();switch(q>>>3){case 1:O.connectionId=r.string();break;case 2:O.revisionNumber=r.uint64();break;case 3:O.revisionHeight=r.uint64();break;default:r.skipType(q&7);break}}return O},fromJSON(U){const W=u();return(0,C.isSet)(U.connectionId)&&(W.connectionId=String(U.connectionId)),(0,C.isSet)(U.revisionNumber)&&(W.revisionNumber=BigInt(U.revisionNumber.toString())),(0,C.isSet)(U.revisionHeight)&&(W.revisionHeight=BigInt(U.revisionHeight.toString())),W},toJSON(U){const W={};return U.connectionId!==void 0&&(W.connectionId=U.connectionId),U.revisionNumber!==void 0&&(W.revisionNumber=(U.revisionNumber||BigInt(0)).toString()),U.revisionHeight!==void 0&&(W.revisionHeight=(U.revisionHeight||BigInt(0)).toString()),W},fromPartial(U){const W=u();return W.connectionId=U.connectionId??"",U.revisionNumber!==void 0&&U.revisionNumber!==null&&(W.revisionNumber=BigInt(U.revisionNumber.toString())),U.revisionHeight!==void 0&&U.revisionHeight!==null&&(W.revisionHeight=BigInt(U.revisionHeight.toString())),W}};function c(){return{consensusState:void 0,clientId:"",proof:new Uint8Array,proofHeight:i.Height.fromPartial({})}}e.QueryConnectionConsensusStateResponse={typeUrl:"/ibc.core.connection.v1.QueryConnectionConsensusStateResponse",encode(U,W=g.BinaryWriter.create()){return U.consensusState!==void 0&&o.Any.encode(U.consensusState,W.uint32(10).fork()).ldelim(),U.clientId!==""&&W.uint32(18).string(U.clientId),U.proof.length!==0&&W.uint32(26).bytes(U.proof),U.proofHeight!==void 0&&i.Height.encode(U.proofHeight,W.uint32(34).fork()).ldelim(),W},decode(U,W){const r=U instanceof g.BinaryReader?U:new g.BinaryReader(U);let s=W===void 0?r.len:r.pos+W;const O=c();for(;r.pos<s;){const q=r.uint32();switch(q>>>3){case 1:O.consensusState=o.Any.decode(r,r.uint32());break;case 2:O.clientId=r.string();break;case 3:O.proof=r.bytes();break;case 4:O.proofHeight=i.Height.decode(r,r.uint32());break;default:r.skipType(q&7);break}}return O},fromJSON(U){const W=c();return(0,C.isSet)(U.consensusState)&&(W.consensusState=o.Any.fromJSON(U.consensusState)),(0,C.isSet)(U.clientId)&&(W.clientId=String(U.clientId)),(0,C.isSet)(U.proof)&&(W.proof=(0,C.bytesFromBase64)(U.proof)),(0,C.isSet)(U.proofHeight)&&(W.proofHeight=i.Height.fromJSON(U.proofHeight)),W},toJSON(U){const W={};return U.consensusState!==void 0&&(W.consensusState=U.consensusState?o.Any.toJSON(U.consensusState):void 0),U.clientId!==void 0&&(W.clientId=U.clientId),U.proof!==void 0&&(W.proof=(0,C.base64FromBytes)(U.proof!==void 0?U.proof:new Uint8Array)),U.proofHeight!==void 0&&(W.proofHeight=U.proofHeight?i.Height.toJSON(U.proofHeight):void 0),W},fromPartial(U){const W=c();return U.consensusState!==void 0&&U.consensusState!==null&&(W.consensusState=o.Any.fromPartial(U.consensusState)),W.clientId=U.clientId??"",W.proof=U.proof??new Uint8Array,U.proofHeight!==void 0&&U.proofHeight!==null&&(W.proofHeight=i.Height.fromPartial(U.proofHeight)),W}};function y(){return{}}e.QueryConnectionParamsRequest={typeUrl:"/ibc.core.connection.v1.QueryConnectionParamsRequest",encode(U,W=g.BinaryWriter.create()){return W},decode(U,W){const r=U instanceof g.BinaryReader?U:new g.BinaryReader(U);let s=W===void 0?r.len:r.pos+W;const O=y();for(;r.pos<s;){const q=r.uint32();switch(q>>>3){default:r.skipType(q&7);break}}return O},fromJSON(U){return y()},toJSON(U){return{}},fromPartial(U){return y()}};function B(){return{params:void 0}}e.QueryConnectionParamsResponse={typeUrl:"/ibc.core.connection.v1.QueryConnectionParamsResponse",encode(U,W=g.BinaryWriter.create()){return U.params!==void 0&&i.Params.encode(U.params,W.uint32(10).fork()).ldelim(),W},decode(U,W){const r=U instanceof g.BinaryReader?U:new g.BinaryReader(U);let s=W===void 0?r.len:r.pos+W;const O=B();for(;r.pos<s;){const q=r.uint32();switch(q>>>3){case 1:O.params=i.Params.decode(r,r.uint32());break;default:r.skipType(q&7);break}}return O},fromJSON(U){const W=B();return(0,C.isSet)(U.params)&&(W.params=i.Params.fromJSON(U.params)),W},toJSON(U){const W={};return U.params!==void 0&&(W.params=U.params?i.Params.toJSON(U.params):void 0),W},fromPartial(U){const W=B();return U.params!==void 0&&U.params!==null&&(W.params=i.Params.fromPartial(U.params)),W}};class N{constructor(W){this.rpc=W,this.Connection=this.Connection.bind(this),this.Connections=this.Connections.bind(this),this.ClientConnections=this.ClientConnections.bind(this),this.ConnectionClientState=this.ConnectionClientState.bind(this),this.ConnectionConsensusState=this.ConnectionConsensusState.bind(this),this.ConnectionParams=this.ConnectionParams.bind(this)}Connection(W){const r=e.QueryConnectionRequest.encode(W).finish();return this.rpc.request("ibc.core.connection.v1.Query","Connection",r).then(O=>e.QueryConnectionResponse.decode(new g.BinaryReader(O)))}Connections(W={pagination:n.PageRequest.fromPartial({})}){const r=e.QueryConnectionsRequest.encode(W).finish();return this.rpc.request("ibc.core.connection.v1.Query","Connections",r).then(O=>e.QueryConnectionsResponse.decode(new g.BinaryReader(O)))}ClientConnections(W){const r=e.QueryClientConnectionsRequest.encode(W).finish();return this.rpc.request("ibc.core.connection.v1.Query","ClientConnections",r).then(O=>e.QueryClientConnectionsResponse.decode(new g.BinaryReader(O)))}ConnectionClientState(W){const r=e.QueryConnectionClientStateRequest.encode(W).finish();return this.rpc.request("ibc.core.connection.v1.Query","ConnectionClientState",r).then(O=>e.QueryConnectionClientStateResponse.decode(new g.BinaryReader(O)))}ConnectionConsensusState(W){const r=e.QueryConnectionConsensusStateRequest.encode(W).finish();return this.rpc.request("ibc.core.connection.v1.Query","ConnectionConsensusState",r).then(O=>e.QueryConnectionConsensusStateResponse.decode(new g.BinaryReader(O)))}ConnectionParams(W={}){const r=e.QueryConnectionParamsRequest.encode(W).finish();return this.rpc.request("ibc.core.connection.v1.Query","ConnectionParams",r).then(O=>e.QueryConnectionParamsResponse.decode(new g.BinaryReader(O)))}}e.QueryClientImpl=N})(Tc);var Nc={},mr={},wc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProofOps=e.ProofOp=e.DominoOp=e.ValueOp=e.Proof=e.protobufPackage=void 0;const n=_.binary,t=_.helpers;e.protobufPackage="tendermint.crypto";function i(){return{total:BigInt(0),index:BigInt(0),leafHash:new Uint8Array,aunts:[]}}e.Proof={typeUrl:"/tendermint.crypto.Proof",encode(E,D=n.BinaryWriter.create()){E.total!==BigInt(0)&&D.uint32(8).int64(E.total),E.index!==BigInt(0)&&D.uint32(16).int64(E.index),E.leafHash.length!==0&&D.uint32(26).bytes(E.leafHash);for(const J of E.aunts)D.uint32(34).bytes(J);return D},decode(E,D){const J=E instanceof n.BinaryReader?E:new n.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=i();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.total=J.int64();break;case 2:p.index=J.int64();break;case 3:p.leafHash=J.bytes();break;case 4:p.aunts.push(J.bytes());break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=i();return(0,t.isSet)(E.total)&&(D.total=BigInt(E.total.toString())),(0,t.isSet)(E.index)&&(D.index=BigInt(E.index.toString())),(0,t.isSet)(E.leafHash)&&(D.leafHash=(0,t.bytesFromBase64)(E.leafHash)),Array.isArray(E==null?void 0:E.aunts)&&(D.aunts=E.aunts.map(J=>(0,t.bytesFromBase64)(J))),D},toJSON(E){const D={};return E.total!==void 0&&(D.total=(E.total||BigInt(0)).toString()),E.index!==void 0&&(D.index=(E.index||BigInt(0)).toString()),E.leafHash!==void 0&&(D.leafHash=(0,t.base64FromBytes)(E.leafHash!==void 0?E.leafHash:new Uint8Array)),E.aunts?D.aunts=E.aunts.map(J=>(0,t.base64FromBytes)(J!==void 0?J:new Uint8Array)):D.aunts=[],D},fromPartial(E){var J;const D=i();return E.total!==void 0&&E.total!==null&&(D.total=BigInt(E.total.toString())),E.index!==void 0&&E.index!==null&&(D.index=BigInt(E.index.toString())),D.leafHash=E.leafHash??new Uint8Array,D.aunts=((J=E.aunts)==null?void 0:J.map(b=>b))||[],D}};function o(){return{key:new Uint8Array,proof:void 0}}e.ValueOp={typeUrl:"/tendermint.crypto.ValueOp",encode(E,D=n.BinaryWriter.create()){return E.key.length!==0&&D.uint32(10).bytes(E.key),E.proof!==void 0&&e.Proof.encode(E.proof,D.uint32(18).fork()).ldelim(),D},decode(E,D){const J=E instanceof n.BinaryReader?E:new n.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=o();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.key=J.bytes();break;case 2:p.proof=e.Proof.decode(J,J.uint32());break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=o();return(0,t.isSet)(E.key)&&(D.key=(0,t.bytesFromBase64)(E.key)),(0,t.isSet)(E.proof)&&(D.proof=e.Proof.fromJSON(E.proof)),D},toJSON(E){const D={};return E.key!==void 0&&(D.key=(0,t.base64FromBytes)(E.key!==void 0?E.key:new Uint8Array)),E.proof!==void 0&&(D.proof=E.proof?e.Proof.toJSON(E.proof):void 0),D},fromPartial(E){const D=o();return D.key=E.key??new Uint8Array,E.proof!==void 0&&E.proof!==null&&(D.proof=e.Proof.fromPartial(E.proof)),D}};function g(){return{key:"",input:"",output:""}}e.DominoOp={typeUrl:"/tendermint.crypto.DominoOp",encode(E,D=n.BinaryWriter.create()){return E.key!==""&&D.uint32(10).string(E.key),E.input!==""&&D.uint32(18).string(E.input),E.output!==""&&D.uint32(26).string(E.output),D},decode(E,D){const J=E instanceof n.BinaryReader?E:new n.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=g();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.key=J.string();break;case 2:p.input=J.string();break;case 3:p.output=J.string();break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=g();return(0,t.isSet)(E.key)&&(D.key=String(E.key)),(0,t.isSet)(E.input)&&(D.input=String(E.input)),(0,t.isSet)(E.output)&&(D.output=String(E.output)),D},toJSON(E){const D={};return E.key!==void 0&&(D.key=E.key),E.input!==void 0&&(D.input=E.input),E.output!==void 0&&(D.output=E.output),D},fromPartial(E){const D=g();return D.key=E.key??"",D.input=E.input??"",D.output=E.output??"",D}};function C(){return{type:"",key:new Uint8Array,data:new Uint8Array}}e.ProofOp={typeUrl:"/tendermint.crypto.ProofOp",encode(E,D=n.BinaryWriter.create()){return E.type!==""&&D.uint32(10).string(E.type),E.key.length!==0&&D.uint32(18).bytes(E.key),E.data.length!==0&&D.uint32(26).bytes(E.data),D},decode(E,D){const J=E instanceof n.BinaryReader?E:new n.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=C();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.type=J.string();break;case 2:p.key=J.bytes();break;case 3:p.data=J.bytes();break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=C();return(0,t.isSet)(E.type)&&(D.type=String(E.type)),(0,t.isSet)(E.key)&&(D.key=(0,t.bytesFromBase64)(E.key)),(0,t.isSet)(E.data)&&(D.data=(0,t.bytesFromBase64)(E.data)),D},toJSON(E){const D={};return E.type!==void 0&&(D.type=E.type),E.key!==void 0&&(D.key=(0,t.base64FromBytes)(E.key!==void 0?E.key:new Uint8Array)),E.data!==void 0&&(D.data=(0,t.base64FromBytes)(E.data!==void 0?E.data:new Uint8Array)),D},fromPartial(E){const D=C();return D.type=E.type??"",D.key=E.key??new Uint8Array,D.data=E.data??new Uint8Array,D}};function w(){return{ops:[]}}e.ProofOps={typeUrl:"/tendermint.crypto.ProofOps",encode(E,D=n.BinaryWriter.create()){for(const J of E.ops)e.ProofOp.encode(J,D.uint32(10).fork()).ldelim();return D},decode(E,D){const J=E instanceof n.BinaryReader?E:new n.BinaryReader(E);let b=D===void 0?J.len:J.pos+D;const p=w();for(;J.pos<b;){const S=J.uint32();switch(S>>>3){case 1:p.ops.push(e.ProofOp.decode(J,J.uint32()));break;default:J.skipType(S&7);break}}return p},fromJSON(E){const D=w();return Array.isArray(E==null?void 0:E.ops)&&(D.ops=E.ops.map(J=>e.ProofOp.fromJSON(J))),D},toJSON(E){const D={};return E.ops?D.ops=E.ops.map(J=>J?e.ProofOp.toJSON(J):void 0):D.ops=[],D},fromPartial(E){var J;const D=w();return D.ops=((J=E.ops)==null?void 0:J.map(b=>e.ProofOp.fromPartial(b)))||[],D}}})(wc);var wt={};Object.defineProperty(wt,"__esModule",{value:!0});wt.Consensus=wt.App=wt.protobufPackage=void 0;const zr=_.binary,va=_.helpers;wt.protobufPackage="tendermint.version";function Xd(){return{protocol:BigInt(0),software:""}}wt.App={typeUrl:"/tendermint.version.App",encode(e,n=zr.BinaryWriter.create()){return e.protocol!==BigInt(0)&&n.uint32(8).uint64(e.protocol),e.software!==""&&n.uint32(18).string(e.software),n},decode(e,n){const t=e instanceof zr.BinaryReader?e:new zr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=Xd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.protocol=t.uint64();break;case 2:o.software=t.string();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=Xd();return(0,va.isSet)(e.protocol)&&(n.protocol=BigInt(e.protocol.toString())),(0,va.isSet)(e.software)&&(n.software=String(e.software)),n},toJSON(e){const n={};return e.protocol!==void 0&&(n.protocol=(e.protocol||BigInt(0)).toString()),e.software!==void 0&&(n.software=e.software),n},fromPartial(e){const n=Xd();return e.protocol!==void 0&&e.protocol!==null&&(n.protocol=BigInt(e.protocol.toString())),n.software=e.software??"",n}};function jd(){return{block:BigInt(0),app:BigInt(0)}}wt.Consensus={typeUrl:"/tendermint.version.Consensus",encode(e,n=zr.BinaryWriter.create()){return e.block!==BigInt(0)&&n.uint32(8).uint64(e.block),e.app!==BigInt(0)&&n.uint32(16).uint64(e.app),n},decode(e,n){const t=e instanceof zr.BinaryReader?e:new zr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=jd();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.block=t.uint64();break;case 2:o.app=t.uint64();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=jd();return(0,va.isSet)(e.block)&&(n.block=BigInt(e.block.toString())),(0,va.isSet)(e.app)&&(n.app=BigInt(e.app.toString())),n},toJSON(e){const n={};return e.block!==void 0&&(n.block=(e.block||BigInt(0)).toString()),e.app!==void 0&&(n.app=(e.app||BigInt(0)).toString()),n},fromPartial(e){const n=jd();return e.block!==void 0&&e.block!==null&&(n.block=BigInt(e.block.toString())),e.app!==void 0&&e.app!==null&&(n.app=BigInt(e.app.toString())),n}};var gs={},lr={};Object.defineProperty(lr,"__esModule",{value:!0});lr.PublicKey=lr.protobufPackage=void 0;const eu=_.binary,Rr=_.helpers;lr.protobufPackage="tendermint.crypto";function nu(){return{ed25519:void 0,secp256k1:void 0}}lr.PublicKey={typeUrl:"/tendermint.crypto.PublicKey",encode(e,n=eu.BinaryWriter.create()){return e.ed25519!==void 0&&n.uint32(10).bytes(e.ed25519),e.secp256k1!==void 0&&n.uint32(18).bytes(e.secp256k1),n},decode(e,n){const t=e instanceof eu.BinaryReader?e:new eu.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=nu();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.ed25519=t.bytes();break;case 2:o.secp256k1=t.bytes();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=nu();return(0,Rr.isSet)(e.ed25519)&&(n.ed25519=(0,Rr.bytesFromBase64)(e.ed25519)),(0,Rr.isSet)(e.secp256k1)&&(n.secp256k1=(0,Rr.bytesFromBase64)(e.secp256k1)),n},toJSON(e){const n={};return e.ed25519!==void 0&&(n.ed25519=e.ed25519!==void 0?(0,Rr.base64FromBytes)(e.ed25519):void 0),e.secp256k1!==void 0&&(n.secp256k1=e.secp256k1!==void 0?(0,Rr.base64FromBytes)(e.secp256k1):void 0),n},fromPartial(e){const n=nu();return n.ed25519=e.ed25519??void 0,n.secp256k1=e.secp256k1??void 0,n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleValidator=e.Validator=e.ValidatorSet=e.protobufPackage=void 0;const n=lr,t=_.binary,i=_.helpers;e.protobufPackage="tendermint.types";function o(){return{validators:[],proposer:void 0,totalVotingPower:BigInt(0)}}e.ValidatorSet={typeUrl:"/tendermint.types.ValidatorSet",encode(w,E=t.BinaryWriter.create()){for(const D of w.validators)e.Validator.encode(D,E.uint32(10).fork()).ldelim();return w.proposer!==void 0&&e.Validator.encode(w.proposer,E.uint32(18).fork()).ldelim(),w.totalVotingPower!==BigInt(0)&&E.uint32(24).int64(w.totalVotingPower),E},decode(w,E){const D=w instanceof t.BinaryReader?w:new t.BinaryReader(w);let J=E===void 0?D.len:D.pos+E;const b=o();for(;D.pos<J;){const p=D.uint32();switch(p>>>3){case 1:b.validators.push(e.Validator.decode(D,D.uint32()));break;case 2:b.proposer=e.Validator.decode(D,D.uint32());break;case 3:b.totalVotingPower=D.int64();break;default:D.skipType(p&7);break}}return b},fromJSON(w){const E=o();return Array.isArray(w==null?void 0:w.validators)&&(E.validators=w.validators.map(D=>e.Validator.fromJSON(D))),(0,i.isSet)(w.proposer)&&(E.proposer=e.Validator.fromJSON(w.proposer)),(0,i.isSet)(w.totalVotingPower)&&(E.totalVotingPower=BigInt(w.totalVotingPower.toString())),E},toJSON(w){const E={};return w.validators?E.validators=w.validators.map(D=>D?e.Validator.toJSON(D):void 0):E.validators=[],w.proposer!==void 0&&(E.proposer=w.proposer?e.Validator.toJSON(w.proposer):void 0),w.totalVotingPower!==void 0&&(E.totalVotingPower=(w.totalVotingPower||BigInt(0)).toString()),E},fromPartial(w){var D;const E=o();return E.validators=((D=w.validators)==null?void 0:D.map(J=>e.Validator.fromPartial(J)))||[],w.proposer!==void 0&&w.proposer!==null&&(E.proposer=e.Validator.fromPartial(w.proposer)),w.totalVotingPower!==void 0&&w.totalVotingPower!==null&&(E.totalVotingPower=BigInt(w.totalVotingPower.toString())),E}};function g(){return{address:new Uint8Array,pubKey:n.PublicKey.fromPartial({}),votingPower:BigInt(0),proposerPriority:BigInt(0)}}e.Validator={typeUrl:"/tendermint.types.Validator",encode(w,E=t.BinaryWriter.create()){return w.address.length!==0&&E.uint32(10).bytes(w.address),w.pubKey!==void 0&&n.PublicKey.encode(w.pubKey,E.uint32(18).fork()).ldelim(),w.votingPower!==BigInt(0)&&E.uint32(24).int64(w.votingPower),w.proposerPriority!==BigInt(0)&&E.uint32(32).int64(w.proposerPriority),E},decode(w,E){const D=w instanceof t.BinaryReader?w:new t.BinaryReader(w);let J=E===void 0?D.len:D.pos+E;const b=g();for(;D.pos<J;){const p=D.uint32();switch(p>>>3){case 1:b.address=D.bytes();break;case 2:b.pubKey=n.PublicKey.decode(D,D.uint32());break;case 3:b.votingPower=D.int64();break;case 4:b.proposerPriority=D.int64();break;default:D.skipType(p&7);break}}return b},fromJSON(w){const E=g();return(0,i.isSet)(w.address)&&(E.address=(0,i.bytesFromBase64)(w.address)),(0,i.isSet)(w.pubKey)&&(E.pubKey=n.PublicKey.fromJSON(w.pubKey)),(0,i.isSet)(w.votingPower)&&(E.votingPower=BigInt(w.votingPower.toString())),(0,i.isSet)(w.proposerPriority)&&(E.proposerPriority=BigInt(w.proposerPriority.toString())),E},toJSON(w){const E={};return w.address!==void 0&&(E.address=(0,i.base64FromBytes)(w.address!==void 0?w.address:new Uint8Array)),w.pubKey!==void 0&&(E.pubKey=w.pubKey?n.PublicKey.toJSON(w.pubKey):void 0),w.votingPower!==void 0&&(E.votingPower=(w.votingPower||BigInt(0)).toString()),w.proposerPriority!==void 0&&(E.proposerPriority=(w.proposerPriority||BigInt(0)).toString()),E},fromPartial(w){const E=g();return E.address=w.address??new Uint8Array,w.pubKey!==void 0&&w.pubKey!==null&&(E.pubKey=n.PublicKey.fromPartial(w.pubKey)),w.votingPower!==void 0&&w.votingPower!==null&&(E.votingPower=BigInt(w.votingPower.toString())),w.proposerPriority!==void 0&&w.proposerPriority!==null&&(E.proposerPriority=BigInt(w.proposerPriority.toString())),E}};function C(){return{pubKey:void 0,votingPower:BigInt(0)}}e.SimpleValidator={typeUrl:"/tendermint.types.SimpleValidator",encode(w,E=t.BinaryWriter.create()){return w.pubKey!==void 0&&n.PublicKey.encode(w.pubKey,E.uint32(10).fork()).ldelim(),w.votingPower!==BigInt(0)&&E.uint32(16).int64(w.votingPower),E},decode(w,E){const D=w instanceof t.BinaryReader?w:new t.BinaryReader(w);let J=E===void 0?D.len:D.pos+E;const b=C();for(;D.pos<J;){const p=D.uint32();switch(p>>>3){case 1:b.pubKey=n.PublicKey.decode(D,D.uint32());break;case 2:b.votingPower=D.int64();break;default:D.skipType(p&7);break}}return b},fromJSON(w){const E=C();return(0,i.isSet)(w.pubKey)&&(E.pubKey=n.PublicKey.fromJSON(w.pubKey)),(0,i.isSet)(w.votingPower)&&(E.votingPower=BigInt(w.votingPower.toString())),E},toJSON(w){const E={};return w.pubKey!==void 0&&(E.pubKey=w.pubKey?n.PublicKey.toJSON(w.pubKey):void 0),w.votingPower!==void 0&&(E.votingPower=(w.votingPower||BigInt(0)).toString()),E},fromPartial(w){const E=C();return w.pubKey!==void 0&&w.pubKey!==null&&(E.pubKey=n.PublicKey.fromPartial(w.pubKey)),w.votingPower!==void 0&&w.votingPower!==null&&(E.votingPower=BigInt(w.votingPower.toString())),E}}})(gs);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TxProof=e.BlockMeta=e.LightBlock=e.SignedHeader=e.Proposal=e.CommitSig=e.Commit=e.Vote=e.Data=e.Header=e.BlockID=e.Part=e.PartSetHeader=e.signedMsgTypeToJSON=e.signedMsgTypeFromJSON=e.SignedMsgType=e.blockIDFlagToJSON=e.blockIDFlagFromJSON=e.BlockIDFlag=e.protobufPackage=void 0;const n=wc,t=wt,i=Je,o=gs,g=_.binary,C=_.helpers;e.protobufPackage="tendermint.types";var w;(function(d){d[d.BLOCK_ID_FLAG_UNKNOWN=0]="BLOCK_ID_FLAG_UNKNOWN",d[d.BLOCK_ID_FLAG_ABSENT=1]="BLOCK_ID_FLAG_ABSENT",d[d.BLOCK_ID_FLAG_COMMIT=2]="BLOCK_ID_FLAG_COMMIT",d[d.BLOCK_ID_FLAG_NIL=3]="BLOCK_ID_FLAG_NIL",d[d.UNRECOGNIZED=-1]="UNRECOGNIZED"})(w||(e.BlockIDFlag=w={}));function E(d){switch(d){case 0:case"BLOCK_ID_FLAG_UNKNOWN":return w.BLOCK_ID_FLAG_UNKNOWN;case 1:case"BLOCK_ID_FLAG_ABSENT":return w.BLOCK_ID_FLAG_ABSENT;case 2:case"BLOCK_ID_FLAG_COMMIT":return w.BLOCK_ID_FLAG_COMMIT;case 3:case"BLOCK_ID_FLAG_NIL":return w.BLOCK_ID_FLAG_NIL;case-1:case"UNRECOGNIZED":default:return w.UNRECOGNIZED}}e.blockIDFlagFromJSON=E;function D(d){switch(d){case w.BLOCK_ID_FLAG_UNKNOWN:return"BLOCK_ID_FLAG_UNKNOWN";case w.BLOCK_ID_FLAG_ABSENT:return"BLOCK_ID_FLAG_ABSENT";case w.BLOCK_ID_FLAG_COMMIT:return"BLOCK_ID_FLAG_COMMIT";case w.BLOCK_ID_FLAG_NIL:return"BLOCK_ID_FLAG_NIL";case w.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.blockIDFlagToJSON=D;var J;(function(d){d[d.SIGNED_MSG_TYPE_UNKNOWN=0]="SIGNED_MSG_TYPE_UNKNOWN",d[d.SIGNED_MSG_TYPE_PREVOTE=1]="SIGNED_MSG_TYPE_PREVOTE",d[d.SIGNED_MSG_TYPE_PRECOMMIT=2]="SIGNED_MSG_TYPE_PRECOMMIT",d[d.SIGNED_MSG_TYPE_PROPOSAL=32]="SIGNED_MSG_TYPE_PROPOSAL",d[d.UNRECOGNIZED=-1]="UNRECOGNIZED"})(J||(e.SignedMsgType=J={}));function b(d){switch(d){case 0:case"SIGNED_MSG_TYPE_UNKNOWN":return J.SIGNED_MSG_TYPE_UNKNOWN;case 1:case"SIGNED_MSG_TYPE_PREVOTE":return J.SIGNED_MSG_TYPE_PREVOTE;case 2:case"SIGNED_MSG_TYPE_PRECOMMIT":return J.SIGNED_MSG_TYPE_PRECOMMIT;case 32:case"SIGNED_MSG_TYPE_PROPOSAL":return J.SIGNED_MSG_TYPE_PROPOSAL;case-1:case"UNRECOGNIZED":default:return J.UNRECOGNIZED}}e.signedMsgTypeFromJSON=b;function p(d){switch(d){case J.SIGNED_MSG_TYPE_UNKNOWN:return"SIGNED_MSG_TYPE_UNKNOWN";case J.SIGNED_MSG_TYPE_PREVOTE:return"SIGNED_MSG_TYPE_PREVOTE";case J.SIGNED_MSG_TYPE_PRECOMMIT:return"SIGNED_MSG_TYPE_PRECOMMIT";case J.SIGNED_MSG_TYPE_PROPOSAL:return"SIGNED_MSG_TYPE_PROPOSAL";case J.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.signedMsgTypeToJSON=p;function S(){return{total:0,hash:new Uint8Array}}e.PartSetHeader={typeUrl:"/tendermint.types.PartSetHeader",encode(d,l=g.BinaryWriter.create()){return d.total!==0&&l.uint32(8).uint32(d.total),d.hash.length!==0&&l.uint32(18).bytes(d.hash),l},decode(d,l){const M=d instanceof g.BinaryReader?d:new g.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=S();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.total=M.uint32();break;case 2:h.hash=M.bytes();break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=S();return(0,C.isSet)(d.total)&&(l.total=Number(d.total)),(0,C.isSet)(d.hash)&&(l.hash=(0,C.bytesFromBase64)(d.hash)),l},toJSON(d){const l={};return d.total!==void 0&&(l.total=Math.round(d.total)),d.hash!==void 0&&(l.hash=(0,C.base64FromBytes)(d.hash!==void 0?d.hash:new Uint8Array)),l},fromPartial(d){const l=S();return l.total=d.total??0,l.hash=d.hash??new Uint8Array,l}};function R(){return{index:0,bytes:new Uint8Array,proof:n.Proof.fromPartial({})}}e.Part={typeUrl:"/tendermint.types.Part",encode(d,l=g.BinaryWriter.create()){return d.index!==0&&l.uint32(8).uint32(d.index),d.bytes.length!==0&&l.uint32(18).bytes(d.bytes),d.proof!==void 0&&n.Proof.encode(d.proof,l.uint32(26).fork()).ldelim(),l},decode(d,l){const M=d instanceof g.BinaryReader?d:new g.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=R();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.index=M.uint32();break;case 2:h.bytes=M.bytes();break;case 3:h.proof=n.Proof.decode(M,M.uint32());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=R();return(0,C.isSet)(d.index)&&(l.index=Number(d.index)),(0,C.isSet)(d.bytes)&&(l.bytes=(0,C.bytesFromBase64)(d.bytes)),(0,C.isSet)(d.proof)&&(l.proof=n.Proof.fromJSON(d.proof)),l},toJSON(d){const l={};return d.index!==void 0&&(l.index=Math.round(d.index)),d.bytes!==void 0&&(l.bytes=(0,C.base64FromBytes)(d.bytes!==void 0?d.bytes:new Uint8Array)),d.proof!==void 0&&(l.proof=d.proof?n.Proof.toJSON(d.proof):void 0),l},fromPartial(d){const l=R();return l.index=d.index??0,l.bytes=d.bytes??new Uint8Array,d.proof!==void 0&&d.proof!==null&&(l.proof=n.Proof.fromPartial(d.proof)),l}};function u(){return{hash:new Uint8Array,partSetHeader:e.PartSetHeader.fromPartial({})}}e.BlockID={typeUrl:"/tendermint.types.BlockID",encode(d,l=g.BinaryWriter.create()){return d.hash.length!==0&&l.uint32(10).bytes(d.hash),d.partSetHeader!==void 0&&e.PartSetHeader.encode(d.partSetHeader,l.uint32(18).fork()).ldelim(),l},decode(d,l){const M=d instanceof g.BinaryReader?d:new g.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=u();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.hash=M.bytes();break;case 2:h.partSetHeader=e.PartSetHeader.decode(M,M.uint32());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=u();return(0,C.isSet)(d.hash)&&(l.hash=(0,C.bytesFromBase64)(d.hash)),(0,C.isSet)(d.partSetHeader)&&(l.partSetHeader=e.PartSetHeader.fromJSON(d.partSetHeader)),l},toJSON(d){const l={};return d.hash!==void 0&&(l.hash=(0,C.base64FromBytes)(d.hash!==void 0?d.hash:new Uint8Array)),d.partSetHeader!==void 0&&(l.partSetHeader=d.partSetHeader?e.PartSetHeader.toJSON(d.partSetHeader):void 0),l},fromPartial(d){const l=u();return l.hash=d.hash??new Uint8Array,d.partSetHeader!==void 0&&d.partSetHeader!==null&&(l.partSetHeader=e.PartSetHeader.fromPartial(d.partSetHeader)),l}};function c(){return{version:t.Consensus.fromPartial({}),chainId:"",height:BigInt(0),time:i.Timestamp.fromPartial({}),lastBlockId:e.BlockID.fromPartial({}),lastCommitHash:new Uint8Array,dataHash:new Uint8Array,validatorsHash:new Uint8Array,nextValidatorsHash:new Uint8Array,consensusHash:new Uint8Array,appHash:new Uint8Array,lastResultsHash:new Uint8Array,evidenceHash:new Uint8Array,proposerAddress:new Uint8Array}}e.Header={typeUrl:"/tendermint.types.Header",encode(d,l=g.BinaryWriter.create()){return d.version!==void 0&&t.Consensus.encode(d.version,l.uint32(10).fork()).ldelim(),d.chainId!==""&&l.uint32(18).string(d.chainId),d.height!==BigInt(0)&&l.uint32(24).int64(d.height),d.time!==void 0&&i.Timestamp.encode(d.time,l.uint32(34).fork()).ldelim(),d.lastBlockId!==void 0&&e.BlockID.encode(d.lastBlockId,l.uint32(42).fork()).ldelim(),d.lastCommitHash.length!==0&&l.uint32(50).bytes(d.lastCommitHash),d.dataHash.length!==0&&l.uint32(58).bytes(d.dataHash),d.validatorsHash.length!==0&&l.uint32(66).bytes(d.validatorsHash),d.nextValidatorsHash.length!==0&&l.uint32(74).bytes(d.nextValidatorsHash),d.consensusHash.length!==0&&l.uint32(82).bytes(d.consensusHash),d.appHash.length!==0&&l.uint32(90).bytes(d.appHash),d.lastResultsHash.length!==0&&l.uint32(98).bytes(d.lastResultsHash),d.evidenceHash.length!==0&&l.uint32(106).bytes(d.evidenceHash),d.proposerAddress.length!==0&&l.uint32(114).bytes(d.proposerAddress),l},decode(d,l){const M=d instanceof g.BinaryReader?d:new g.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=c();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.version=t.Consensus.decode(M,M.uint32());break;case 2:h.chainId=M.string();break;case 3:h.height=M.int64();break;case 4:h.time=i.Timestamp.decode(M,M.uint32());break;case 5:h.lastBlockId=e.BlockID.decode(M,M.uint32());break;case 6:h.lastCommitHash=M.bytes();break;case 7:h.dataHash=M.bytes();break;case 8:h.validatorsHash=M.bytes();break;case 9:h.nextValidatorsHash=M.bytes();break;case 10:h.consensusHash=M.bytes();break;case 11:h.appHash=M.bytes();break;case 12:h.lastResultsHash=M.bytes();break;case 13:h.evidenceHash=M.bytes();break;case 14:h.proposerAddress=M.bytes();break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=c();return(0,C.isSet)(d.version)&&(l.version=t.Consensus.fromJSON(d.version)),(0,C.isSet)(d.chainId)&&(l.chainId=String(d.chainId)),(0,C.isSet)(d.height)&&(l.height=BigInt(d.height.toString())),(0,C.isSet)(d.time)&&(l.time=(0,C.fromJsonTimestamp)(d.time)),(0,C.isSet)(d.lastBlockId)&&(l.lastBlockId=e.BlockID.fromJSON(d.lastBlockId)),(0,C.isSet)(d.lastCommitHash)&&(l.lastCommitHash=(0,C.bytesFromBase64)(d.lastCommitHash)),(0,C.isSet)(d.dataHash)&&(l.dataHash=(0,C.bytesFromBase64)(d.dataHash)),(0,C.isSet)(d.validatorsHash)&&(l.validatorsHash=(0,C.bytesFromBase64)(d.validatorsHash)),(0,C.isSet)(d.nextValidatorsHash)&&(l.nextValidatorsHash=(0,C.bytesFromBase64)(d.nextValidatorsHash)),(0,C.isSet)(d.consensusHash)&&(l.consensusHash=(0,C.bytesFromBase64)(d.consensusHash)),(0,C.isSet)(d.appHash)&&(l.appHash=(0,C.bytesFromBase64)(d.appHash)),(0,C.isSet)(d.lastResultsHash)&&(l.lastResultsHash=(0,C.bytesFromBase64)(d.lastResultsHash)),(0,C.isSet)(d.evidenceHash)&&(l.evidenceHash=(0,C.bytesFromBase64)(d.evidenceHash)),(0,C.isSet)(d.proposerAddress)&&(l.proposerAddress=(0,C.bytesFromBase64)(d.proposerAddress)),l},toJSON(d){const l={};return d.version!==void 0&&(l.version=d.version?t.Consensus.toJSON(d.version):void 0),d.chainId!==void 0&&(l.chainId=d.chainId),d.height!==void 0&&(l.height=(d.height||BigInt(0)).toString()),d.time!==void 0&&(l.time=(0,C.fromTimestamp)(d.time).toISOString()),d.lastBlockId!==void 0&&(l.lastBlockId=d.lastBlockId?e.BlockID.toJSON(d.lastBlockId):void 0),d.lastCommitHash!==void 0&&(l.lastCommitHash=(0,C.base64FromBytes)(d.lastCommitHash!==void 0?d.lastCommitHash:new Uint8Array)),d.dataHash!==void 0&&(l.dataHash=(0,C.base64FromBytes)(d.dataHash!==void 0?d.dataHash:new Uint8Array)),d.validatorsHash!==void 0&&(l.validatorsHash=(0,C.base64FromBytes)(d.validatorsHash!==void 0?d.validatorsHash:new Uint8Array)),d.nextValidatorsHash!==void 0&&(l.nextValidatorsHash=(0,C.base64FromBytes)(d.nextValidatorsHash!==void 0?d.nextValidatorsHash:new Uint8Array)),d.consensusHash!==void 0&&(l.consensusHash=(0,C.base64FromBytes)(d.consensusHash!==void 0?d.consensusHash:new Uint8Array)),d.appHash!==void 0&&(l.appHash=(0,C.base64FromBytes)(d.appHash!==void 0?d.appHash:new Uint8Array)),d.lastResultsHash!==void 0&&(l.lastResultsHash=(0,C.base64FromBytes)(d.lastResultsHash!==void 0?d.lastResultsHash:new Uint8Array)),d.evidenceHash!==void 0&&(l.evidenceHash=(0,C.base64FromBytes)(d.evidenceHash!==void 0?d.evidenceHash:new Uint8Array)),d.proposerAddress!==void 0&&(l.proposerAddress=(0,C.base64FromBytes)(d.proposerAddress!==void 0?d.proposerAddress:new Uint8Array)),l},fromPartial(d){const l=c();return d.version!==void 0&&d.version!==null&&(l.version=t.Consensus.fromPartial(d.version)),l.chainId=d.chainId??"",d.height!==void 0&&d.height!==null&&(l.height=BigInt(d.height.toString())),d.time!==void 0&&d.time!==null&&(l.time=i.Timestamp.fromPartial(d.time)),d.lastBlockId!==void 0&&d.lastBlockId!==null&&(l.lastBlockId=e.BlockID.fromPartial(d.lastBlockId)),l.lastCommitHash=d.lastCommitHash??new Uint8Array,l.dataHash=d.dataHash??new Uint8Array,l.validatorsHash=d.validatorsHash??new Uint8Array,l.nextValidatorsHash=d.nextValidatorsHash??new Uint8Array,l.consensusHash=d.consensusHash??new Uint8Array,l.appHash=d.appHash??new Uint8Array,l.lastResultsHash=d.lastResultsHash??new Uint8Array,l.evidenceHash=d.evidenceHash??new Uint8Array,l.proposerAddress=d.proposerAddress??new Uint8Array,l}};function y(){return{txs:[]}}e.Data={typeUrl:"/tendermint.types.Data",encode(d,l=g.BinaryWriter.create()){for(const M of d.txs)l.uint32(10).bytes(M);return l},decode(d,l){const M=d instanceof g.BinaryReader?d:new g.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=y();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.txs.push(M.bytes());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=y();return Array.isArray(d==null?void 0:d.txs)&&(l.txs=d.txs.map(M=>(0,C.bytesFromBase64)(M))),l},toJSON(d){const l={};return d.txs?l.txs=d.txs.map(M=>(0,C.base64FromBytes)(M!==void 0?M:new Uint8Array)):l.txs=[],l},fromPartial(d){var M;const l=y();return l.txs=((M=d.txs)==null?void 0:M.map(m=>m))||[],l}};function B(){return{type:0,height:BigInt(0),round:0,blockId:e.BlockID.fromPartial({}),timestamp:i.Timestamp.fromPartial({}),validatorAddress:new Uint8Array,validatorIndex:0,signature:new Uint8Array}}e.Vote={typeUrl:"/tendermint.types.Vote",encode(d,l=g.BinaryWriter.create()){return d.type!==0&&l.uint32(8).int32(d.type),d.height!==BigInt(0)&&l.uint32(16).int64(d.height),d.round!==0&&l.uint32(24).int32(d.round),d.blockId!==void 0&&e.BlockID.encode(d.blockId,l.uint32(34).fork()).ldelim(),d.timestamp!==void 0&&i.Timestamp.encode(d.timestamp,l.uint32(42).fork()).ldelim(),d.validatorAddress.length!==0&&l.uint32(50).bytes(d.validatorAddress),d.validatorIndex!==0&&l.uint32(56).int32(d.validatorIndex),d.signature.length!==0&&l.uint32(66).bytes(d.signature),l},decode(d,l){const M=d instanceof g.BinaryReader?d:new g.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=B();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.type=M.int32();break;case 2:h.height=M.int64();break;case 3:h.round=M.int32();break;case 4:h.blockId=e.BlockID.decode(M,M.uint32());break;case 5:h.timestamp=i.Timestamp.decode(M,M.uint32());break;case 6:h.validatorAddress=M.bytes();break;case 7:h.validatorIndex=M.int32();break;case 8:h.signature=M.bytes();break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=B();return(0,C.isSet)(d.type)&&(l.type=b(d.type)),(0,C.isSet)(d.height)&&(l.height=BigInt(d.height.toString())),(0,C.isSet)(d.round)&&(l.round=Number(d.round)),(0,C.isSet)(d.blockId)&&(l.blockId=e.BlockID.fromJSON(d.blockId)),(0,C.isSet)(d.timestamp)&&(l.timestamp=(0,C.fromJsonTimestamp)(d.timestamp)),(0,C.isSet)(d.validatorAddress)&&(l.validatorAddress=(0,C.bytesFromBase64)(d.validatorAddress)),(0,C.isSet)(d.validatorIndex)&&(l.validatorIndex=Number(d.validatorIndex)),(0,C.isSet)(d.signature)&&(l.signature=(0,C.bytesFromBase64)(d.signature)),l},toJSON(d){const l={};return d.type!==void 0&&(l.type=p(d.type)),d.height!==void 0&&(l.height=(d.height||BigInt(0)).toString()),d.round!==void 0&&(l.round=Math.round(d.round)),d.blockId!==void 0&&(l.blockId=d.blockId?e.BlockID.toJSON(d.blockId):void 0),d.timestamp!==void 0&&(l.timestamp=(0,C.fromTimestamp)(d.timestamp).toISOString()),d.validatorAddress!==void 0&&(l.validatorAddress=(0,C.base64FromBytes)(d.validatorAddress!==void 0?d.validatorAddress:new Uint8Array)),d.validatorIndex!==void 0&&(l.validatorIndex=Math.round(d.validatorIndex)),d.signature!==void 0&&(l.signature=(0,C.base64FromBytes)(d.signature!==void 0?d.signature:new Uint8Array)),l},fromPartial(d){const l=B();return l.type=d.type??0,d.height!==void 0&&d.height!==null&&(l.height=BigInt(d.height.toString())),l.round=d.round??0,d.blockId!==void 0&&d.blockId!==null&&(l.blockId=e.BlockID.fromPartial(d.blockId)),d.timestamp!==void 0&&d.timestamp!==null&&(l.timestamp=i.Timestamp.fromPartial(d.timestamp)),l.validatorAddress=d.validatorAddress??new Uint8Array,l.validatorIndex=d.validatorIndex??0,l.signature=d.signature??new Uint8Array,l}};function N(){return{height:BigInt(0),round:0,blockId:e.BlockID.fromPartial({}),signatures:[]}}e.Commit={typeUrl:"/tendermint.types.Commit",encode(d,l=g.BinaryWriter.create()){d.height!==BigInt(0)&&l.uint32(8).int64(d.height),d.round!==0&&l.uint32(16).int32(d.round),d.blockId!==void 0&&e.BlockID.encode(d.blockId,l.uint32(26).fork()).ldelim();for(const M of d.signatures)e.CommitSig.encode(M,l.uint32(34).fork()).ldelim();return l},decode(d,l){const M=d instanceof g.BinaryReader?d:new g.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=N();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.height=M.int64();break;case 2:h.round=M.int32();break;case 3:h.blockId=e.BlockID.decode(M,M.uint32());break;case 4:h.signatures.push(e.CommitSig.decode(M,M.uint32()));break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=N();return(0,C.isSet)(d.height)&&(l.height=BigInt(d.height.toString())),(0,C.isSet)(d.round)&&(l.round=Number(d.round)),(0,C.isSet)(d.blockId)&&(l.blockId=e.BlockID.fromJSON(d.blockId)),Array.isArray(d==null?void 0:d.signatures)&&(l.signatures=d.signatures.map(M=>e.CommitSig.fromJSON(M))),l},toJSON(d){const l={};return d.height!==void 0&&(l.height=(d.height||BigInt(0)).toString()),d.round!==void 0&&(l.round=Math.round(d.round)),d.blockId!==void 0&&(l.blockId=d.blockId?e.BlockID.toJSON(d.blockId):void 0),d.signatures?l.signatures=d.signatures.map(M=>M?e.CommitSig.toJSON(M):void 0):l.signatures=[],l},fromPartial(d){var M;const l=N();return d.height!==void 0&&d.height!==null&&(l.height=BigInt(d.height.toString())),l.round=d.round??0,d.blockId!==void 0&&d.blockId!==null&&(l.blockId=e.BlockID.fromPartial(d.blockId)),l.signatures=((M=d.signatures)==null?void 0:M.map(m=>e.CommitSig.fromPartial(m)))||[],l}};function U(){return{blockIdFlag:0,validatorAddress:new Uint8Array,timestamp:i.Timestamp.fromPartial({}),signature:new Uint8Array}}e.CommitSig={typeUrl:"/tendermint.types.CommitSig",encode(d,l=g.BinaryWriter.create()){return d.blockIdFlag!==0&&l.uint32(8).int32(d.blockIdFlag),d.validatorAddress.length!==0&&l.uint32(18).bytes(d.validatorAddress),d.timestamp!==void 0&&i.Timestamp.encode(d.timestamp,l.uint32(26).fork()).ldelim(),d.signature.length!==0&&l.uint32(34).bytes(d.signature),l},decode(d,l){const M=d instanceof g.BinaryReader?d:new g.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=U();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.blockIdFlag=M.int32();break;case 2:h.validatorAddress=M.bytes();break;case 3:h.timestamp=i.Timestamp.decode(M,M.uint32());break;case 4:h.signature=M.bytes();break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=U();return(0,C.isSet)(d.blockIdFlag)&&(l.blockIdFlag=E(d.blockIdFlag)),(0,C.isSet)(d.validatorAddress)&&(l.validatorAddress=(0,C.bytesFromBase64)(d.validatorAddress)),(0,C.isSet)(d.timestamp)&&(l.timestamp=(0,C.fromJsonTimestamp)(d.timestamp)),(0,C.isSet)(d.signature)&&(l.signature=(0,C.bytesFromBase64)(d.signature)),l},toJSON(d){const l={};return d.blockIdFlag!==void 0&&(l.blockIdFlag=D(d.blockIdFlag)),d.validatorAddress!==void 0&&(l.validatorAddress=(0,C.base64FromBytes)(d.validatorAddress!==void 0?d.validatorAddress:new Uint8Array)),d.timestamp!==void 0&&(l.timestamp=(0,C.fromTimestamp)(d.timestamp).toISOString()),d.signature!==void 0&&(l.signature=(0,C.base64FromBytes)(d.signature!==void 0?d.signature:new Uint8Array)),l},fromPartial(d){const l=U();return l.blockIdFlag=d.blockIdFlag??0,l.validatorAddress=d.validatorAddress??new Uint8Array,d.timestamp!==void 0&&d.timestamp!==null&&(l.timestamp=i.Timestamp.fromPartial(d.timestamp)),l.signature=d.signature??new Uint8Array,l}};function W(){return{type:0,height:BigInt(0),round:0,polRound:0,blockId:e.BlockID.fromPartial({}),timestamp:i.Timestamp.fromPartial({}),signature:new Uint8Array}}e.Proposal={typeUrl:"/tendermint.types.Proposal",encode(d,l=g.BinaryWriter.create()){return d.type!==0&&l.uint32(8).int32(d.type),d.height!==BigInt(0)&&l.uint32(16).int64(d.height),d.round!==0&&l.uint32(24).int32(d.round),d.polRound!==0&&l.uint32(32).int32(d.polRound),d.blockId!==void 0&&e.BlockID.encode(d.blockId,l.uint32(42).fork()).ldelim(),d.timestamp!==void 0&&i.Timestamp.encode(d.timestamp,l.uint32(50).fork()).ldelim(),d.signature.length!==0&&l.uint32(58).bytes(d.signature),l},decode(d,l){const M=d instanceof g.BinaryReader?d:new g.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=W();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.type=M.int32();break;case 2:h.height=M.int64();break;case 3:h.round=M.int32();break;case 4:h.polRound=M.int32();break;case 5:h.blockId=e.BlockID.decode(M,M.uint32());break;case 6:h.timestamp=i.Timestamp.decode(M,M.uint32());break;case 7:h.signature=M.bytes();break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=W();return(0,C.isSet)(d.type)&&(l.type=b(d.type)),(0,C.isSet)(d.height)&&(l.height=BigInt(d.height.toString())),(0,C.isSet)(d.round)&&(l.round=Number(d.round)),(0,C.isSet)(d.polRound)&&(l.polRound=Number(d.polRound)),(0,C.isSet)(d.blockId)&&(l.blockId=e.BlockID.fromJSON(d.blockId)),(0,C.isSet)(d.timestamp)&&(l.timestamp=(0,C.fromJsonTimestamp)(d.timestamp)),(0,C.isSet)(d.signature)&&(l.signature=(0,C.bytesFromBase64)(d.signature)),l},toJSON(d){const l={};return d.type!==void 0&&(l.type=p(d.type)),d.height!==void 0&&(l.height=(d.height||BigInt(0)).toString()),d.round!==void 0&&(l.round=Math.round(d.round)),d.polRound!==void 0&&(l.polRound=Math.round(d.polRound)),d.blockId!==void 0&&(l.blockId=d.blockId?e.BlockID.toJSON(d.blockId):void 0),d.timestamp!==void 0&&(l.timestamp=(0,C.fromTimestamp)(d.timestamp).toISOString()),d.signature!==void 0&&(l.signature=(0,C.base64FromBytes)(d.signature!==void 0?d.signature:new Uint8Array)),l},fromPartial(d){const l=W();return l.type=d.type??0,d.height!==void 0&&d.height!==null&&(l.height=BigInt(d.height.toString())),l.round=d.round??0,l.polRound=d.polRound??0,d.blockId!==void 0&&d.blockId!==null&&(l.blockId=e.BlockID.fromPartial(d.blockId)),d.timestamp!==void 0&&d.timestamp!==null&&(l.timestamp=i.Timestamp.fromPartial(d.timestamp)),l.signature=d.signature??new Uint8Array,l}};function r(){return{header:void 0,commit:void 0}}e.SignedHeader={typeUrl:"/tendermint.types.SignedHeader",encode(d,l=g.BinaryWriter.create()){return d.header!==void 0&&e.Header.encode(d.header,l.uint32(10).fork()).ldelim(),d.commit!==void 0&&e.Commit.encode(d.commit,l.uint32(18).fork()).ldelim(),l},decode(d,l){const M=d instanceof g.BinaryReader?d:new g.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=r();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.header=e.Header.decode(M,M.uint32());break;case 2:h.commit=e.Commit.decode(M,M.uint32());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=r();return(0,C.isSet)(d.header)&&(l.header=e.Header.fromJSON(d.header)),(0,C.isSet)(d.commit)&&(l.commit=e.Commit.fromJSON(d.commit)),l},toJSON(d){const l={};return d.header!==void 0&&(l.header=d.header?e.Header.toJSON(d.header):void 0),d.commit!==void 0&&(l.commit=d.commit?e.Commit.toJSON(d.commit):void 0),l},fromPartial(d){const l=r();return d.header!==void 0&&d.header!==null&&(l.header=e.Header.fromPartial(d.header)),d.commit!==void 0&&d.commit!==null&&(l.commit=e.Commit.fromPartial(d.commit)),l}};function s(){return{signedHeader:void 0,validatorSet:void 0}}e.LightBlock={typeUrl:"/tendermint.types.LightBlock",encode(d,l=g.BinaryWriter.create()){return d.signedHeader!==void 0&&e.SignedHeader.encode(d.signedHeader,l.uint32(10).fork()).ldelim(),d.validatorSet!==void 0&&o.ValidatorSet.encode(d.validatorSet,l.uint32(18).fork()).ldelim(),l},decode(d,l){const M=d instanceof g.BinaryReader?d:new g.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=s();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.signedHeader=e.SignedHeader.decode(M,M.uint32());break;case 2:h.validatorSet=o.ValidatorSet.decode(M,M.uint32());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=s();return(0,C.isSet)(d.signedHeader)&&(l.signedHeader=e.SignedHeader.fromJSON(d.signedHeader)),(0,C.isSet)(d.validatorSet)&&(l.validatorSet=o.ValidatorSet.fromJSON(d.validatorSet)),l},toJSON(d){const l={};return d.signedHeader!==void 0&&(l.signedHeader=d.signedHeader?e.SignedHeader.toJSON(d.signedHeader):void 0),d.validatorSet!==void 0&&(l.validatorSet=d.validatorSet?o.ValidatorSet.toJSON(d.validatorSet):void 0),l},fromPartial(d){const l=s();return d.signedHeader!==void 0&&d.signedHeader!==null&&(l.signedHeader=e.SignedHeader.fromPartial(d.signedHeader)),d.validatorSet!==void 0&&d.validatorSet!==null&&(l.validatorSet=o.ValidatorSet.fromPartial(d.validatorSet)),l}};function O(){return{blockId:e.BlockID.fromPartial({}),blockSize:BigInt(0),header:e.Header.fromPartial({}),numTxs:BigInt(0)}}e.BlockMeta={typeUrl:"/tendermint.types.BlockMeta",encode(d,l=g.BinaryWriter.create()){return d.blockId!==void 0&&e.BlockID.encode(d.blockId,l.uint32(10).fork()).ldelim(),d.blockSize!==BigInt(0)&&l.uint32(16).int64(d.blockSize),d.header!==void 0&&e.Header.encode(d.header,l.uint32(26).fork()).ldelim(),d.numTxs!==BigInt(0)&&l.uint32(32).int64(d.numTxs),l},decode(d,l){const M=d instanceof g.BinaryReader?d:new g.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=O();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.blockId=e.BlockID.decode(M,M.uint32());break;case 2:h.blockSize=M.int64();break;case 3:h.header=e.Header.decode(M,M.uint32());break;case 4:h.numTxs=M.int64();break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=O();return(0,C.isSet)(d.blockId)&&(l.blockId=e.BlockID.fromJSON(d.blockId)),(0,C.isSet)(d.blockSize)&&(l.blockSize=BigInt(d.blockSize.toString())),(0,C.isSet)(d.header)&&(l.header=e.Header.fromJSON(d.header)),(0,C.isSet)(d.numTxs)&&(l.numTxs=BigInt(d.numTxs.toString())),l},toJSON(d){const l={};return d.blockId!==void 0&&(l.blockId=d.blockId?e.BlockID.toJSON(d.blockId):void 0),d.blockSize!==void 0&&(l.blockSize=(d.blockSize||BigInt(0)).toString()),d.header!==void 0&&(l.header=d.header?e.Header.toJSON(d.header):void 0),d.numTxs!==void 0&&(l.numTxs=(d.numTxs||BigInt(0)).toString()),l},fromPartial(d){const l=O();return d.blockId!==void 0&&d.blockId!==null&&(l.blockId=e.BlockID.fromPartial(d.blockId)),d.blockSize!==void 0&&d.blockSize!==null&&(l.blockSize=BigInt(d.blockSize.toString())),d.header!==void 0&&d.header!==null&&(l.header=e.Header.fromPartial(d.header)),d.numTxs!==void 0&&d.numTxs!==null&&(l.numTxs=BigInt(d.numTxs.toString())),l}};function q(){return{rootHash:new Uint8Array,data:new Uint8Array,proof:void 0}}e.TxProof={typeUrl:"/tendermint.types.TxProof",encode(d,l=g.BinaryWriter.create()){return d.rootHash.length!==0&&l.uint32(10).bytes(d.rootHash),d.data.length!==0&&l.uint32(18).bytes(d.data),d.proof!==void 0&&n.Proof.encode(d.proof,l.uint32(26).fork()).ldelim(),l},decode(d,l){const M=d instanceof g.BinaryReader?d:new g.BinaryReader(d);let m=l===void 0?M.len:M.pos+l;const h=q();for(;M.pos<m;){const T=M.uint32();switch(T>>>3){case 1:h.rootHash=M.bytes();break;case 2:h.data=M.bytes();break;case 3:h.proof=n.Proof.decode(M,M.uint32());break;default:M.skipType(T&7);break}}return h},fromJSON(d){const l=q();return(0,C.isSet)(d.rootHash)&&(l.rootHash=(0,C.bytesFromBase64)(d.rootHash)),(0,C.isSet)(d.data)&&(l.data=(0,C.bytesFromBase64)(d.data)),(0,C.isSet)(d.proof)&&(l.proof=n.Proof.fromJSON(d.proof)),l},toJSON(d){const l={};return d.rootHash!==void 0&&(l.rootHash=(0,C.base64FromBytes)(d.rootHash!==void 0?d.rootHash:new Uint8Array)),d.data!==void 0&&(l.data=(0,C.base64FromBytes)(d.data!==void 0?d.data:new Uint8Array)),d.proof!==void 0&&(l.proof=d.proof?n.Proof.toJSON(d.proof):void 0),l},fromPartial(d){const l=q();return l.rootHash=d.rootHash??new Uint8Array,l.data=d.data??new Uint8Array,d.proof!==void 0&&d.proof!==null&&(l.proof=n.Proof.fromPartial(d.proof)),l}}})(mr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Fraction=e.Header=e.Misbehaviour=e.ConsensusState=e.ClientState=e.protobufPackage=void 0;const n=yn,t=kt,i=Ec,o=Je,g=mn,C=mr,w=gs,E=_.binary,D=_.helpers;e.protobufPackage="ibc.lightclients.tendermint.v1";function J(){return{chainId:"",trustLevel:e.Fraction.fromPartial({}),trustingPeriod:n.Duration.fromPartial({}),unbondingPeriod:n.Duration.fromPartial({}),maxClockDrift:n.Duration.fromPartial({}),frozenHeight:t.Height.fromPartial({}),latestHeight:t.Height.fromPartial({}),proofSpecs:[],upgradePath:[],allowUpdateAfterExpiry:!1,allowUpdateAfterMisbehaviour:!1}}e.ClientState={typeUrl:"/ibc.lightclients.tendermint.v1.ClientState",encode(u,c=E.BinaryWriter.create()){u.chainId!==""&&c.uint32(10).string(u.chainId),u.trustLevel!==void 0&&e.Fraction.encode(u.trustLevel,c.uint32(18).fork()).ldelim(),u.trustingPeriod!==void 0&&n.Duration.encode(u.trustingPeriod,c.uint32(26).fork()).ldelim(),u.unbondingPeriod!==void 0&&n.Duration.encode(u.unbondingPeriod,c.uint32(34).fork()).ldelim(),u.maxClockDrift!==void 0&&n.Duration.encode(u.maxClockDrift,c.uint32(42).fork()).ldelim(),u.frozenHeight!==void 0&&t.Height.encode(u.frozenHeight,c.uint32(50).fork()).ldelim(),u.latestHeight!==void 0&&t.Height.encode(u.latestHeight,c.uint32(58).fork()).ldelim();for(const y of u.proofSpecs)i.ProofSpec.encode(y,c.uint32(66).fork()).ldelim();for(const y of u.upgradePath)c.uint32(74).string(y);return u.allowUpdateAfterExpiry===!0&&c.uint32(80).bool(u.allowUpdateAfterExpiry),u.allowUpdateAfterMisbehaviour===!0&&c.uint32(88).bool(u.allowUpdateAfterMisbehaviour),c},decode(u,c){const y=u instanceof E.BinaryReader?u:new E.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=J();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.chainId=y.string();break;case 2:N.trustLevel=e.Fraction.decode(y,y.uint32());break;case 3:N.trustingPeriod=n.Duration.decode(y,y.uint32());break;case 4:N.unbondingPeriod=n.Duration.decode(y,y.uint32());break;case 5:N.maxClockDrift=n.Duration.decode(y,y.uint32());break;case 6:N.frozenHeight=t.Height.decode(y,y.uint32());break;case 7:N.latestHeight=t.Height.decode(y,y.uint32());break;case 8:N.proofSpecs.push(i.ProofSpec.decode(y,y.uint32()));break;case 9:N.upgradePath.push(y.string());break;case 10:N.allowUpdateAfterExpiry=y.bool();break;case 11:N.allowUpdateAfterMisbehaviour=y.bool();break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=J();return(0,D.isSet)(u.chainId)&&(c.chainId=String(u.chainId)),(0,D.isSet)(u.trustLevel)&&(c.trustLevel=e.Fraction.fromJSON(u.trustLevel)),(0,D.isSet)(u.trustingPeriod)&&(c.trustingPeriod=n.Duration.fromJSON(u.trustingPeriod)),(0,D.isSet)(u.unbondingPeriod)&&(c.unbondingPeriod=n.Duration.fromJSON(u.unbondingPeriod)),(0,D.isSet)(u.maxClockDrift)&&(c.maxClockDrift=n.Duration.fromJSON(u.maxClockDrift)),(0,D.isSet)(u.frozenHeight)&&(c.frozenHeight=t.Height.fromJSON(u.frozenHeight)),(0,D.isSet)(u.latestHeight)&&(c.latestHeight=t.Height.fromJSON(u.latestHeight)),Array.isArray(u==null?void 0:u.proofSpecs)&&(c.proofSpecs=u.proofSpecs.map(y=>i.ProofSpec.fromJSON(y))),Array.isArray(u==null?void 0:u.upgradePath)&&(c.upgradePath=u.upgradePath.map(y=>String(y))),(0,D.isSet)(u.allowUpdateAfterExpiry)&&(c.allowUpdateAfterExpiry=!!u.allowUpdateAfterExpiry),(0,D.isSet)(u.allowUpdateAfterMisbehaviour)&&(c.allowUpdateAfterMisbehaviour=!!u.allowUpdateAfterMisbehaviour),c},toJSON(u){const c={};return u.chainId!==void 0&&(c.chainId=u.chainId),u.trustLevel!==void 0&&(c.trustLevel=u.trustLevel?e.Fraction.toJSON(u.trustLevel):void 0),u.trustingPeriod!==void 0&&(c.trustingPeriod=u.trustingPeriod?n.Duration.toJSON(u.trustingPeriod):void 0),u.unbondingPeriod!==void 0&&(c.unbondingPeriod=u.unbondingPeriod?n.Duration.toJSON(u.unbondingPeriod):void 0),u.maxClockDrift!==void 0&&(c.maxClockDrift=u.maxClockDrift?n.Duration.toJSON(u.maxClockDrift):void 0),u.frozenHeight!==void 0&&(c.frozenHeight=u.frozenHeight?t.Height.toJSON(u.frozenHeight):void 0),u.latestHeight!==void 0&&(c.latestHeight=u.latestHeight?t.Height.toJSON(u.latestHeight):void 0),u.proofSpecs?c.proofSpecs=u.proofSpecs.map(y=>y?i.ProofSpec.toJSON(y):void 0):c.proofSpecs=[],u.upgradePath?c.upgradePath=u.upgradePath.map(y=>y):c.upgradePath=[],u.allowUpdateAfterExpiry!==void 0&&(c.allowUpdateAfterExpiry=u.allowUpdateAfterExpiry),u.allowUpdateAfterMisbehaviour!==void 0&&(c.allowUpdateAfterMisbehaviour=u.allowUpdateAfterMisbehaviour),c},fromPartial(u){var y,B;const c=J();return c.chainId=u.chainId??"",u.trustLevel!==void 0&&u.trustLevel!==null&&(c.trustLevel=e.Fraction.fromPartial(u.trustLevel)),u.trustingPeriod!==void 0&&u.trustingPeriod!==null&&(c.trustingPeriod=n.Duration.fromPartial(u.trustingPeriod)),u.unbondingPeriod!==void 0&&u.unbondingPeriod!==null&&(c.unbondingPeriod=n.Duration.fromPartial(u.unbondingPeriod)),u.maxClockDrift!==void 0&&u.maxClockDrift!==null&&(c.maxClockDrift=n.Duration.fromPartial(u.maxClockDrift)),u.frozenHeight!==void 0&&u.frozenHeight!==null&&(c.frozenHeight=t.Height.fromPartial(u.frozenHeight)),u.latestHeight!==void 0&&u.latestHeight!==null&&(c.latestHeight=t.Height.fromPartial(u.latestHeight)),c.proofSpecs=((y=u.proofSpecs)==null?void 0:y.map(N=>i.ProofSpec.fromPartial(N)))||[],c.upgradePath=((B=u.upgradePath)==null?void 0:B.map(N=>N))||[],c.allowUpdateAfterExpiry=u.allowUpdateAfterExpiry??!1,c.allowUpdateAfterMisbehaviour=u.allowUpdateAfterMisbehaviour??!1,c}};function b(){return{timestamp:o.Timestamp.fromPartial({}),root:g.MerkleRoot.fromPartial({}),nextValidatorsHash:new Uint8Array}}e.ConsensusState={typeUrl:"/ibc.lightclients.tendermint.v1.ConsensusState",encode(u,c=E.BinaryWriter.create()){return u.timestamp!==void 0&&o.Timestamp.encode(u.timestamp,c.uint32(10).fork()).ldelim(),u.root!==void 0&&g.MerkleRoot.encode(u.root,c.uint32(18).fork()).ldelim(),u.nextValidatorsHash.length!==0&&c.uint32(26).bytes(u.nextValidatorsHash),c},decode(u,c){const y=u instanceof E.BinaryReader?u:new E.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=b();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.timestamp=o.Timestamp.decode(y,y.uint32());break;case 2:N.root=g.MerkleRoot.decode(y,y.uint32());break;case 3:N.nextValidatorsHash=y.bytes();break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=b();return(0,D.isSet)(u.timestamp)&&(c.timestamp=(0,D.fromJsonTimestamp)(u.timestamp)),(0,D.isSet)(u.root)&&(c.root=g.MerkleRoot.fromJSON(u.root)),(0,D.isSet)(u.nextValidatorsHash)&&(c.nextValidatorsHash=(0,D.bytesFromBase64)(u.nextValidatorsHash)),c},toJSON(u){const c={};return u.timestamp!==void 0&&(c.timestamp=(0,D.fromTimestamp)(u.timestamp).toISOString()),u.root!==void 0&&(c.root=u.root?g.MerkleRoot.toJSON(u.root):void 0),u.nextValidatorsHash!==void 0&&(c.nextValidatorsHash=(0,D.base64FromBytes)(u.nextValidatorsHash!==void 0?u.nextValidatorsHash:new Uint8Array)),c},fromPartial(u){const c=b();return u.timestamp!==void 0&&u.timestamp!==null&&(c.timestamp=o.Timestamp.fromPartial(u.timestamp)),u.root!==void 0&&u.root!==null&&(c.root=g.MerkleRoot.fromPartial(u.root)),c.nextValidatorsHash=u.nextValidatorsHash??new Uint8Array,c}};function p(){return{clientId:"",header1:void 0,header2:void 0}}e.Misbehaviour={typeUrl:"/ibc.lightclients.tendermint.v1.Misbehaviour",encode(u,c=E.BinaryWriter.create()){return u.clientId!==""&&c.uint32(10).string(u.clientId),u.header1!==void 0&&e.Header.encode(u.header1,c.uint32(18).fork()).ldelim(),u.header2!==void 0&&e.Header.encode(u.header2,c.uint32(26).fork()).ldelim(),c},decode(u,c){const y=u instanceof E.BinaryReader?u:new E.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=p();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.clientId=y.string();break;case 2:N.header1=e.Header.decode(y,y.uint32());break;case 3:N.header2=e.Header.decode(y,y.uint32());break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=p();return(0,D.isSet)(u.clientId)&&(c.clientId=String(u.clientId)),(0,D.isSet)(u.header1)&&(c.header1=e.Header.fromJSON(u.header1)),(0,D.isSet)(u.header2)&&(c.header2=e.Header.fromJSON(u.header2)),c},toJSON(u){const c={};return u.clientId!==void 0&&(c.clientId=u.clientId),u.header1!==void 0&&(c.header1=u.header1?e.Header.toJSON(u.header1):void 0),u.header2!==void 0&&(c.header2=u.header2?e.Header.toJSON(u.header2):void 0),c},fromPartial(u){const c=p();return c.clientId=u.clientId??"",u.header1!==void 0&&u.header1!==null&&(c.header1=e.Header.fromPartial(u.header1)),u.header2!==void 0&&u.header2!==null&&(c.header2=e.Header.fromPartial(u.header2)),c}};function S(){return{signedHeader:void 0,validatorSet:void 0,trustedHeight:t.Height.fromPartial({}),trustedValidators:void 0}}e.Header={typeUrl:"/ibc.lightclients.tendermint.v1.Header",encode(u,c=E.BinaryWriter.create()){return u.signedHeader!==void 0&&C.SignedHeader.encode(u.signedHeader,c.uint32(10).fork()).ldelim(),u.validatorSet!==void 0&&w.ValidatorSet.encode(u.validatorSet,c.uint32(18).fork()).ldelim(),u.trustedHeight!==void 0&&t.Height.encode(u.trustedHeight,c.uint32(26).fork()).ldelim(),u.trustedValidators!==void 0&&w.ValidatorSet.encode(u.trustedValidators,c.uint32(34).fork()).ldelim(),c},decode(u,c){const y=u instanceof E.BinaryReader?u:new E.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=S();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.signedHeader=C.SignedHeader.decode(y,y.uint32());break;case 2:N.validatorSet=w.ValidatorSet.decode(y,y.uint32());break;case 3:N.trustedHeight=t.Height.decode(y,y.uint32());break;case 4:N.trustedValidators=w.ValidatorSet.decode(y,y.uint32());break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=S();return(0,D.isSet)(u.signedHeader)&&(c.signedHeader=C.SignedHeader.fromJSON(u.signedHeader)),(0,D.isSet)(u.validatorSet)&&(c.validatorSet=w.ValidatorSet.fromJSON(u.validatorSet)),(0,D.isSet)(u.trustedHeight)&&(c.trustedHeight=t.Height.fromJSON(u.trustedHeight)),(0,D.isSet)(u.trustedValidators)&&(c.trustedValidators=w.ValidatorSet.fromJSON(u.trustedValidators)),c},toJSON(u){const c={};return u.signedHeader!==void 0&&(c.signedHeader=u.signedHeader?C.SignedHeader.toJSON(u.signedHeader):void 0),u.validatorSet!==void 0&&(c.validatorSet=u.validatorSet?w.ValidatorSet.toJSON(u.validatorSet):void 0),u.trustedHeight!==void 0&&(c.trustedHeight=u.trustedHeight?t.Height.toJSON(u.trustedHeight):void 0),u.trustedValidators!==void 0&&(c.trustedValidators=u.trustedValidators?w.ValidatorSet.toJSON(u.trustedValidators):void 0),c},fromPartial(u){const c=S();return u.signedHeader!==void 0&&u.signedHeader!==null&&(c.signedHeader=C.SignedHeader.fromPartial(u.signedHeader)),u.validatorSet!==void 0&&u.validatorSet!==null&&(c.validatorSet=w.ValidatorSet.fromPartial(u.validatorSet)),u.trustedHeight!==void 0&&u.trustedHeight!==null&&(c.trustedHeight=t.Height.fromPartial(u.trustedHeight)),u.trustedValidators!==void 0&&u.trustedValidators!==null&&(c.trustedValidators=w.ValidatorSet.fromPartial(u.trustedValidators)),c}};function R(){return{numerator:BigInt(0),denominator:BigInt(0)}}e.Fraction={typeUrl:"/ibc.lightclients.tendermint.v1.Fraction",encode(u,c=E.BinaryWriter.create()){return u.numerator!==BigInt(0)&&c.uint32(8).uint64(u.numerator),u.denominator!==BigInt(0)&&c.uint32(16).uint64(u.denominator),c},decode(u,c){const y=u instanceof E.BinaryReader?u:new E.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=R();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.numerator=y.uint64();break;case 2:N.denominator=y.uint64();break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=R();return(0,D.isSet)(u.numerator)&&(c.numerator=BigInt(u.numerator.toString())),(0,D.isSet)(u.denominator)&&(c.denominator=BigInt(u.denominator.toString())),c},toJSON(u){const c={};return u.numerator!==void 0&&(c.numerator=(u.numerator||BigInt(0)).toString()),u.denominator!==void 0&&(c.denominator=(u.denominator||BigInt(0)).toString()),c},fromPartial(u){const c=R();return u.numerator!==void 0&&u.numerator!==null&&(c.numerator=BigInt(u.numerator.toString())),u.denominator!==void 0&&u.denominator!==null&&(c.denominator=BigInt(u.denominator.toString())),c}}})(Nc);Object.defineProperty(hs,"__esModule",{value:!0});hs.setupIbcExtension=void 0;const jo=ue,tP=Ne,Fl=Ic,rP=Oo,Wt=Oc,Ki=Ac,tu=Tc,km=Nc,be=ze;function ru(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 km.ClientState.decode(e.value)}function iP(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 km.ConsensusState.decode(e.value)}function oP(e){const n=(0,be.createProtobufRpcClient)(e),t=new Wt.QueryClientImpl(n),i=new Ki.QueryClientImpl(n),o=new tu.QueryClientImpl(n),g=new Fl.QueryClientImpl(n);return{ibc:{channel:{channel:async(C,w)=>t.Channel({portId:C,channelId:w}),channels:async C=>t.Channels({pagination:(0,be.createPagination)(C)}),allChannels:async()=>{var D;const C=[];let w,E;do w=await t.Channels({pagination:(0,be.createPagination)(E)}),C.push(...w.channels),E=(D=w.pagination)==null?void 0:D.nextKey;while(E&&E.length);return Wt.QueryChannelsResponse.fromPartial({channels:C,height:w.height})},connectionChannels:async(C,w)=>t.ConnectionChannels({connection:C,pagination:(0,be.createPagination)(w)}),allConnectionChannels:async C=>{var J;const w=[];let E,D;do E=await t.ConnectionChannels({connection:C,pagination:(0,be.createPagination)(D)}),w.push(...E.channels),D=(J=E.pagination)==null?void 0:J.nextKey;while(D&&D.length);return Wt.QueryConnectionChannelsResponse.fromPartial({channels:w,height:E.height})},clientState:async(C,w)=>t.ChannelClientState({portId:C,channelId:w}),consensusState:async(C,w,E,D)=>t.ChannelConsensusState({portId:C,channelId:w,revisionNumber:BigInt(E),revisionHeight:BigInt(D)}),packetCommitment:async(C,w,E)=>t.PacketCommitment({portId:C,channelId:w,sequence:(0,be.longify)(E)}),packetCommitments:async(C,w,E)=>t.PacketCommitments({channelId:w,portId:C,pagination:(0,be.createPagination)(E)}),allPacketCommitments:async(C,w)=>{var b;const E=[];let D,J;do D=await t.PacketCommitments({channelId:w,portId:C,pagination:(0,be.createPagination)(J)}),E.push(...D.commitments),J=(b=D.pagination)==null?void 0:b.nextKey;while(J&&J.length);return Wt.QueryPacketCommitmentsResponse.fromPartial({commitments:E,height:D.height})},packetReceipt:async(C,w,E)=>t.PacketReceipt({portId:C,channelId:w,sequence:(0,be.longify)(E)}),packetAcknowledgement:async(C,w,E)=>t.PacketAcknowledgement({portId:C,channelId:w,sequence:(0,be.longify)(E)}),packetAcknowledgements:async(C,w,E)=>{const D=Wt.QueryPacketAcknowledgementsRequest.fromPartial({portId:C,channelId:w,pagination:(0,be.createPagination)(E)});return t.PacketAcknowledgements(D)},allPacketAcknowledgements:async(C,w)=>{var b;const E=[];let D,J;do{const p=Wt.QueryPacketAcknowledgementsRequest.fromPartial({channelId:w,portId:C,pagination:(0,be.createPagination)(J)});D=await t.PacketAcknowledgements(p),E.push(...D.acknowledgements),J=(b=D.pagination)==null?void 0:b.nextKey}while(J&&J.length);return Wt.QueryPacketAcknowledgementsResponse.fromPartial({acknowledgements:E,height:D.height})},unreceivedPackets:async(C,w,E)=>t.UnreceivedPackets({portId:C,channelId:w,packetCommitmentSequences:E.map(D=>BigInt(D))}),unreceivedAcks:async(C,w,E)=>t.UnreceivedAcks({portId:C,channelId:w,packetAckSequences:E.map(D=>BigInt(D))}),nextSequenceReceive:async(C,w)=>t.NextSequenceReceive({portId:C,channelId:w})},client:{state:async C=>i.ClientState({clientId:C}),states:async C=>i.ClientStates({pagination:(0,be.createPagination)(C)}),allStates:async()=>{var D;const C=[];let w,E;do w=await i.ClientStates({pagination:(0,be.createPagination)(E)}),C.push(...w.clientStates),E=(D=w.pagination)==null?void 0:D.nextKey;while(E&&E.length);return Ki.QueryClientStatesResponse.fromPartial({clientStates:C})},consensusState:async(C,w)=>i.ConsensusState(Ki.QueryConsensusStateRequest.fromPartial({clientId:C,revisionHeight:w!==void 0?BigInt(w):void 0,latestHeight:w===void 0})),consensusStates:async(C,w)=>i.ConsensusStates({clientId:C,pagination:(0,be.createPagination)(w)}),allConsensusStates:async C=>{var J;const w=[];let E,D;do E=await i.ConsensusStates({clientId:C,pagination:(0,be.createPagination)(D)}),w.push(...E.consensusStates),D=(J=E.pagination)==null?void 0:J.nextKey;while(D&&D.length);return Ki.QueryConsensusStatesResponse.fromPartial({consensusStates:w})},params:async()=>i.ClientParams({}),stateTm:async C=>{const w=await i.ClientState({clientId:C});return ru(w.clientState)},statesTm:async C=>{const{clientStates:w}=await i.ClientStates({pagination:(0,be.createPagination)(C)});return w.map(({clientState:E})=>ru(E))},allStatesTm:async()=>{var D;const C=[];let w,E;do w=await i.ClientStates({pagination:(0,be.createPagination)(E)}),C.push(...w.clientStates),E=(D=w.pagination)==null?void 0:D.nextKey;while(E&&E.length);return C.map(({clientState:J})=>ru(J))},consensusStateTm:async(C,w)=>{const E=await i.ConsensusState(Ki.QueryConsensusStateRequest.fromPartial({clientId:C,revisionHeight:w==null?void 0:w.revisionHeight,revisionNumber:w==null?void 0:w.revisionNumber,latestHeight:w===void 0}));return iP(E.consensusState)}},connection:{connection:async C=>o.Connection({connectionId:C}),connections:async C=>o.Connections({pagination:(0,be.createPagination)(C)}),allConnections:async()=>{var D;const C=[];let w,E;do w=await o.Connections({pagination:(0,be.createPagination)(E)}),C.push(...w.connections),E=(D=w.pagination)==null?void 0:D.nextKey;while(E&&E.length);return tu.QueryConnectionsResponse.fromPartial({connections:C,height:w.height})},clientConnections:async C=>o.ClientConnections({clientId:C}),clientState:async C=>o.ConnectionClientState({connectionId:C}),consensusState:async(C,w)=>o.ConnectionConsensusState(tu.QueryConnectionConsensusStateRequest.fromPartial({connectionId:C,revisionHeight:BigInt(w)}))},transfer:{denomTrace:async C=>g.DenomTrace({hash:C}),denomTraces:async C=>g.DenomTraces({pagination:(0,be.createPagination)(C)}),allDenomTraces:async()=>{var D;const C=[];let w,E;do w=await g.DenomTraces({pagination:(0,be.createPagination)(E)}),C.push(...w.denomTraces),E=(D=w.pagination)==null?void 0:D.nextKey;while(E&&E.length);return Fl.QueryDenomTracesResponse.fromPartial({denomTraces:C})},params:async()=>g.Params({})},verified:{channel:{channel:async(C,w)=>{const E=(0,jo.toAscii)(`channelEnds/ports/${C}/channels/${w}`),{value:D}=await e.queryStoreVerified("ibc",E);return D.length?rP.Channel.decode(D):null},packetCommitment:async(C,w,E)=>{const D=(0,jo.toAscii)(`commitments/ports/${C}/channels/${w}/packets/${E}`),{value:J}=await e.queryStoreVerified("ibc",D);return J},packetAcknowledgement:async(C,w,E)=>{const D=(0,jo.toAscii)(`acks/ports/${C}/channels/${w}/acknowledgements/${E}`),{value:J}=await e.queryStoreVerified("ibc",D);return J},nextSequenceReceive:async(C,w)=>{const E=(0,jo.toAscii)(`seqAcks/ports/${C}/channels/${w}/nextSequenceAck`),{value:D}=await e.queryStoreVerified("ibc",E);return D.length?tP.Uint64.fromBytes(D).toNumber():null}}}}}}hs.setupIbcExtension=oP;var ys={},_c={},_t={};Object.defineProperty(_t,"__esModule",{value:!0});_t.Params=_t.Minter=_t.protobufPackage=void 0;const Yr=_.binary,Rt=_.helpers;_t.protobufPackage="cosmos.mint.v1beta1";function iu(){return{inflation:"",annualProvisions:""}}_t.Minter={typeUrl:"/cosmos.mint.v1beta1.Minter",encode(e,n=Yr.BinaryWriter.create()){return e.inflation!==""&&n.uint32(10).string(e.inflation),e.annualProvisions!==""&&n.uint32(18).string(e.annualProvisions),n},decode(e,n){const t=e instanceof Yr.BinaryReader?e:new Yr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=iu();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.inflation=t.string();break;case 2:o.annualProvisions=t.string();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=iu();return(0,Rt.isSet)(e.inflation)&&(n.inflation=String(e.inflation)),(0,Rt.isSet)(e.annualProvisions)&&(n.annualProvisions=String(e.annualProvisions)),n},toJSON(e){const n={};return e.inflation!==void 0&&(n.inflation=e.inflation),e.annualProvisions!==void 0&&(n.annualProvisions=e.annualProvisions),n},fromPartial(e){const n=iu();return n.inflation=e.inflation??"",n.annualProvisions=e.annualProvisions??"",n}};function ou(){return{mintDenom:"",inflationRateChange:"",inflationMax:"",inflationMin:"",goalBonded:"",blocksPerYear:BigInt(0)}}_t.Params={typeUrl:"/cosmos.mint.v1beta1.Params",encode(e,n=Yr.BinaryWriter.create()){return e.mintDenom!==""&&n.uint32(10).string(e.mintDenom),e.inflationRateChange!==""&&n.uint32(18).string(e.inflationRateChange),e.inflationMax!==""&&n.uint32(26).string(e.inflationMax),e.inflationMin!==""&&n.uint32(34).string(e.inflationMin),e.goalBonded!==""&&n.uint32(42).string(e.goalBonded),e.blocksPerYear!==BigInt(0)&&n.uint32(48).uint64(e.blocksPerYear),n},decode(e,n){const t=e instanceof Yr.BinaryReader?e:new Yr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=ou();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.mintDenom=t.string();break;case 2:o.inflationRateChange=t.string();break;case 3:o.inflationMax=t.string();break;case 4:o.inflationMin=t.string();break;case 5:o.goalBonded=t.string();break;case 6:o.blocksPerYear=t.uint64();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=ou();return(0,Rt.isSet)(e.mintDenom)&&(n.mintDenom=String(e.mintDenom)),(0,Rt.isSet)(e.inflationRateChange)&&(n.inflationRateChange=String(e.inflationRateChange)),(0,Rt.isSet)(e.inflationMax)&&(n.inflationMax=String(e.inflationMax)),(0,Rt.isSet)(e.inflationMin)&&(n.inflationMin=String(e.inflationMin)),(0,Rt.isSet)(e.goalBonded)&&(n.goalBonded=String(e.goalBonded)),(0,Rt.isSet)(e.blocksPerYear)&&(n.blocksPerYear=BigInt(e.blocksPerYear.toString())),n},toJSON(e){const n={};return e.mintDenom!==void 0&&(n.mintDenom=e.mintDenom),e.inflationRateChange!==void 0&&(n.inflationRateChange=e.inflationRateChange),e.inflationMax!==void 0&&(n.inflationMax=e.inflationMax),e.inflationMin!==void 0&&(n.inflationMin=e.inflationMin),e.goalBonded!==void 0&&(n.goalBonded=e.goalBonded),e.blocksPerYear!==void 0&&(n.blocksPerYear=(e.blocksPerYear||BigInt(0)).toString()),n},fromPartial(e){const n=ou();return n.mintDenom=e.mintDenom??"",n.inflationRateChange=e.inflationRateChange??"",n.inflationMax=e.inflationMax??"",n.inflationMin=e.inflationMin??"",n.goalBonded=e.goalBonded??"",e.blocksPerYear!==void 0&&e.blocksPerYear!==null&&(n.blocksPerYear=BigInt(e.blocksPerYear.toString())),n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryAnnualProvisionsResponse=e.QueryAnnualProvisionsRequest=e.QueryInflationResponse=e.QueryInflationRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.protobufPackage=void 0;const n=_t,t=_.binary,i=_.helpers;e.protobufPackage="cosmos.mint.v1beta1";function o(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.mint.v1beta1.QueryParamsRequest",encode(b,p=t.BinaryWriter.create()){return p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=o();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){default:S.skipType(c&7);break}}return u},fromJSON(b){return o()},toJSON(b){return{}},fromPartial(b){return o()}};function g(){return{params:n.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.mint.v1beta1.QueryParamsResponse",encode(b,p=t.BinaryWriter.create()){return b.params!==void 0&&n.Params.encode(b.params,p.uint32(10).fork()).ldelim(),p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=g();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.params=n.Params.decode(S,S.uint32());break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=g();return(0,i.isSet)(b.params)&&(p.params=n.Params.fromJSON(b.params)),p},toJSON(b){const p={};return b.params!==void 0&&(p.params=b.params?n.Params.toJSON(b.params):void 0),p},fromPartial(b){const p=g();return b.params!==void 0&&b.params!==null&&(p.params=n.Params.fromPartial(b.params)),p}};function C(){return{}}e.QueryInflationRequest={typeUrl:"/cosmos.mint.v1beta1.QueryInflationRequest",encode(b,p=t.BinaryWriter.create()){return p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=C();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){default:S.skipType(c&7);break}}return u},fromJSON(b){return C()},toJSON(b){return{}},fromPartial(b){return C()}};function w(){return{inflation:new Uint8Array}}e.QueryInflationResponse={typeUrl:"/cosmos.mint.v1beta1.QueryInflationResponse",encode(b,p=t.BinaryWriter.create()){return b.inflation.length!==0&&p.uint32(10).bytes(b.inflation),p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=w();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.inflation=S.bytes();break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=w();return(0,i.isSet)(b.inflation)&&(p.inflation=(0,i.bytesFromBase64)(b.inflation)),p},toJSON(b){const p={};return b.inflation!==void 0&&(p.inflation=(0,i.base64FromBytes)(b.inflation!==void 0?b.inflation:new Uint8Array)),p},fromPartial(b){const p=w();return p.inflation=b.inflation??new Uint8Array,p}};function E(){return{}}e.QueryAnnualProvisionsRequest={typeUrl:"/cosmos.mint.v1beta1.QueryAnnualProvisionsRequest",encode(b,p=t.BinaryWriter.create()){return p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=E();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){default:S.skipType(c&7);break}}return u},fromJSON(b){return E()},toJSON(b){return{}},fromPartial(b){return E()}};function D(){return{annualProvisions:new Uint8Array}}e.QueryAnnualProvisionsResponse={typeUrl:"/cosmos.mint.v1beta1.QueryAnnualProvisionsResponse",encode(b,p=t.BinaryWriter.create()){return b.annualProvisions.length!==0&&p.uint32(10).bytes(b.annualProvisions),p},decode(b,p){const S=b instanceof t.BinaryReader?b:new t.BinaryReader(b);let R=p===void 0?S.len:S.pos+p;const u=D();for(;S.pos<R;){const c=S.uint32();switch(c>>>3){case 1:u.annualProvisions=S.bytes();break;default:S.skipType(c&7);break}}return u},fromJSON(b){const p=D();return(0,i.isSet)(b.annualProvisions)&&(p.annualProvisions=(0,i.bytesFromBase64)(b.annualProvisions)),p},toJSON(b){const p={};return b.annualProvisions!==void 0&&(p.annualProvisions=(0,i.base64FromBytes)(b.annualProvisions!==void 0?b.annualProvisions:new Uint8Array)),p},fromPartial(b){const p=D();return p.annualProvisions=b.annualProvisions??new Uint8Array,p}};class J{constructor(p){this.rpc=p,this.Params=this.Params.bind(this),this.Inflation=this.Inflation.bind(this),this.AnnualProvisions=this.AnnualProvisions.bind(this)}Params(p={}){const S=e.QueryParamsRequest.encode(p).finish();return this.rpc.request("cosmos.mint.v1beta1.Query","Params",S).then(u=>e.QueryParamsResponse.decode(new t.BinaryReader(u)))}Inflation(p={}){const S=e.QueryInflationRequest.encode(p).finish();return this.rpc.request("cosmos.mint.v1beta1.Query","Inflation",S).then(u=>e.QueryInflationResponse.decode(new t.BinaryReader(u)))}AnnualProvisions(p={}){const S=e.QueryAnnualProvisionsRequest.encode(p).finish();return this.rpc.request("cosmos.mint.v1beta1.Query","AnnualProvisions",S).then(u=>e.QueryAnnualProvisionsResponse.decode(new t.BinaryReader(u)))}}e.QueryClientImpl=J})(_c);Object.defineProperty(ys,"__esModule",{value:!0});ys.setupMintExtension=void 0;const aP=Ie,sP=_c,Qt=ze;function dP(e){const n=(0,Qt.createProtobufRpcClient)(e),t=new sP.QueryClientImpl(n);return{mint:{params:async()=>{const{params:i}=await t.Params({});return(0,aP.assert)(i),{blocksPerYear:i.blocksPerYear,goalBonded:(0,Qt.decodeCosmosSdkDecFromProto)(i.goalBonded),inflationMin:(0,Qt.decodeCosmosSdkDecFromProto)(i.inflationMin),inflationMax:(0,Qt.decodeCosmosSdkDecFromProto)(i.inflationMax),inflationRateChange:(0,Qt.decodeCosmosSdkDecFromProto)(i.inflationRateChange),mintDenom:i.mintDenom}},inflation:async()=>{const{inflation:i}=await t.Inflation({});return(0,Qt.decodeCosmosSdkDecFromProto)(i)},annualProvisions:async()=>{const{annualProvisions:i}=await t.AnnualProvisions({});return(0,Qt.decodeCosmosSdkDecFromProto)(i)}}}}ys.setupMintExtension=dP;var yi={};Object.defineProperty(yi,"__esModule",{value:!0});yi.createSlashingAminoConverters=yi.isAminoMsgUnjail=void 0;function uP(e){return e.type==="cosmos-sdk/MsgUnjail"}yi.isAminoMsgUnjail=uP;function cP(){throw new Error("Not implemented")}yi.createSlashingAminoConverters=cP;var Ss={},Mc={},Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.Params=Mt.ValidatorSigningInfo=Mt.protobufPackage=void 0;const pa=Je,Ar=yn,Zr=_.binary,_e=_.helpers;Mt.protobufPackage="cosmos.slashing.v1beta1";function au(){return{address:"",startHeight:BigInt(0),indexOffset:BigInt(0),jailedUntil:pa.Timestamp.fromPartial({}),tombstoned:!1,missedBlocksCounter:BigInt(0)}}Mt.ValidatorSigningInfo={typeUrl:"/cosmos.slashing.v1beta1.ValidatorSigningInfo",encode(e,n=Zr.BinaryWriter.create()){return e.address!==""&&n.uint32(10).string(e.address),e.startHeight!==BigInt(0)&&n.uint32(16).int64(e.startHeight),e.indexOffset!==BigInt(0)&&n.uint32(24).int64(e.indexOffset),e.jailedUntil!==void 0&&pa.Timestamp.encode(e.jailedUntil,n.uint32(34).fork()).ldelim(),e.tombstoned===!0&&n.uint32(40).bool(e.tombstoned),e.missedBlocksCounter!==BigInt(0)&&n.uint32(48).int64(e.missedBlocksCounter),n},decode(e,n){const t=e instanceof Zr.BinaryReader?e:new Zr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=au();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.address=t.string();break;case 2:o.startHeight=t.int64();break;case 3:o.indexOffset=t.int64();break;case 4:o.jailedUntil=pa.Timestamp.decode(t,t.uint32());break;case 5:o.tombstoned=t.bool();break;case 6:o.missedBlocksCounter=t.int64();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=au();return(0,_e.isSet)(e.address)&&(n.address=String(e.address)),(0,_e.isSet)(e.startHeight)&&(n.startHeight=BigInt(e.startHeight.toString())),(0,_e.isSet)(e.indexOffset)&&(n.indexOffset=BigInt(e.indexOffset.toString())),(0,_e.isSet)(e.jailedUntil)&&(n.jailedUntil=(0,_e.fromJsonTimestamp)(e.jailedUntil)),(0,_e.isSet)(e.tombstoned)&&(n.tombstoned=!!e.tombstoned),(0,_e.isSet)(e.missedBlocksCounter)&&(n.missedBlocksCounter=BigInt(e.missedBlocksCounter.toString())),n},toJSON(e){const n={};return e.address!==void 0&&(n.address=e.address),e.startHeight!==void 0&&(n.startHeight=(e.startHeight||BigInt(0)).toString()),e.indexOffset!==void 0&&(n.indexOffset=(e.indexOffset||BigInt(0)).toString()),e.jailedUntil!==void 0&&(n.jailedUntil=(0,_e.fromTimestamp)(e.jailedUntil).toISOString()),e.tombstoned!==void 0&&(n.tombstoned=e.tombstoned),e.missedBlocksCounter!==void 0&&(n.missedBlocksCounter=(e.missedBlocksCounter||BigInt(0)).toString()),n},fromPartial(e){const n=au();return n.address=e.address??"",e.startHeight!==void 0&&e.startHeight!==null&&(n.startHeight=BigInt(e.startHeight.toString())),e.indexOffset!==void 0&&e.indexOffset!==null&&(n.indexOffset=BigInt(e.indexOffset.toString())),e.jailedUntil!==void 0&&e.jailedUntil!==null&&(n.jailedUntil=pa.Timestamp.fromPartial(e.jailedUntil)),n.tombstoned=e.tombstoned??!1,e.missedBlocksCounter!==void 0&&e.missedBlocksCounter!==null&&(n.missedBlocksCounter=BigInt(e.missedBlocksCounter.toString())),n}};function su(){return{signedBlocksWindow:BigInt(0),minSignedPerWindow:new Uint8Array,downtimeJailDuration:Ar.Duration.fromPartial({}),slashFractionDoubleSign:new Uint8Array,slashFractionDowntime:new Uint8Array}}Mt.Params={typeUrl:"/cosmos.slashing.v1beta1.Params",encode(e,n=Zr.BinaryWriter.create()){return e.signedBlocksWindow!==BigInt(0)&&n.uint32(8).int64(e.signedBlocksWindow),e.minSignedPerWindow.length!==0&&n.uint32(18).bytes(e.minSignedPerWindow),e.downtimeJailDuration!==void 0&&Ar.Duration.encode(e.downtimeJailDuration,n.uint32(26).fork()).ldelim(),e.slashFractionDoubleSign.length!==0&&n.uint32(34).bytes(e.slashFractionDoubleSign),e.slashFractionDowntime.length!==0&&n.uint32(42).bytes(e.slashFractionDowntime),n},decode(e,n){const t=e instanceof Zr.BinaryReader?e:new Zr.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=su();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.signedBlocksWindow=t.int64();break;case 2:o.minSignedPerWindow=t.bytes();break;case 3:o.downtimeJailDuration=Ar.Duration.decode(t,t.uint32());break;case 4:o.slashFractionDoubleSign=t.bytes();break;case 5:o.slashFractionDowntime=t.bytes();break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=su();return(0,_e.isSet)(e.signedBlocksWindow)&&(n.signedBlocksWindow=BigInt(e.signedBlocksWindow.toString())),(0,_e.isSet)(e.minSignedPerWindow)&&(n.minSignedPerWindow=(0,_e.bytesFromBase64)(e.minSignedPerWindow)),(0,_e.isSet)(e.downtimeJailDuration)&&(n.downtimeJailDuration=Ar.Duration.fromJSON(e.downtimeJailDuration)),(0,_e.isSet)(e.slashFractionDoubleSign)&&(n.slashFractionDoubleSign=(0,_e.bytesFromBase64)(e.slashFractionDoubleSign)),(0,_e.isSet)(e.slashFractionDowntime)&&(n.slashFractionDowntime=(0,_e.bytesFromBase64)(e.slashFractionDowntime)),n},toJSON(e){const n={};return e.signedBlocksWindow!==void 0&&(n.signedBlocksWindow=(e.signedBlocksWindow||BigInt(0)).toString()),e.minSignedPerWindow!==void 0&&(n.minSignedPerWindow=(0,_e.base64FromBytes)(e.minSignedPerWindow!==void 0?e.minSignedPerWindow:new Uint8Array)),e.downtimeJailDuration!==void 0&&(n.downtimeJailDuration=e.downtimeJailDuration?Ar.Duration.toJSON(e.downtimeJailDuration):void 0),e.slashFractionDoubleSign!==void 0&&(n.slashFractionDoubleSign=(0,_e.base64FromBytes)(e.slashFractionDoubleSign!==void 0?e.slashFractionDoubleSign:new Uint8Array)),e.slashFractionDowntime!==void 0&&(n.slashFractionDowntime=(0,_e.base64FromBytes)(e.slashFractionDowntime!==void 0?e.slashFractionDowntime:new Uint8Array)),n},fromPartial(e){const n=su();return e.signedBlocksWindow!==void 0&&e.signedBlocksWindow!==null&&(n.signedBlocksWindow=BigInt(e.signedBlocksWindow.toString())),n.minSignedPerWindow=e.minSignedPerWindow??new Uint8Array,e.downtimeJailDuration!==void 0&&e.downtimeJailDuration!==null&&(n.downtimeJailDuration=Ar.Duration.fromPartial(e.downtimeJailDuration)),n.slashFractionDoubleSign=e.slashFractionDoubleSign??new Uint8Array,n.slashFractionDowntime=e.slashFractionDowntime??new Uint8Array,n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QuerySigningInfosResponse=e.QuerySigningInfosRequest=e.QuerySigningInfoResponse=e.QuerySigningInfoRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.protobufPackage=void 0;const n=Be,t=Mt,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.slashing.v1beta1";function g(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.slashing.v1beta1.QueryParamsRequest",encode(p,S=i.BinaryWriter.create()){return S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=g();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){default:R.skipType(y&7);break}}return c},fromJSON(p){return g()},toJSON(p){return{}},fromPartial(p){return g()}};function C(){return{params:t.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.slashing.v1beta1.QueryParamsResponse",encode(p,S=i.BinaryWriter.create()){return p.params!==void 0&&t.Params.encode(p.params,S.uint32(10).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=C();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.params=t.Params.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=C();return(0,o.isSet)(p.params)&&(S.params=t.Params.fromJSON(p.params)),S},toJSON(p){const S={};return p.params!==void 0&&(S.params=p.params?t.Params.toJSON(p.params):void 0),S},fromPartial(p){const S=C();return p.params!==void 0&&p.params!==null&&(S.params=t.Params.fromPartial(p.params)),S}};function w(){return{consAddress:""}}e.QuerySigningInfoRequest={typeUrl:"/cosmos.slashing.v1beta1.QuerySigningInfoRequest",encode(p,S=i.BinaryWriter.create()){return p.consAddress!==""&&S.uint32(10).string(p.consAddress),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=w();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.consAddress=R.string();break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=w();return(0,o.isSet)(p.consAddress)&&(S.consAddress=String(p.consAddress)),S},toJSON(p){const S={};return p.consAddress!==void 0&&(S.consAddress=p.consAddress),S},fromPartial(p){const S=w();return S.consAddress=p.consAddress??"",S}};function E(){return{valSigningInfo:t.ValidatorSigningInfo.fromPartial({})}}e.QuerySigningInfoResponse={typeUrl:"/cosmos.slashing.v1beta1.QuerySigningInfoResponse",encode(p,S=i.BinaryWriter.create()){return p.valSigningInfo!==void 0&&t.ValidatorSigningInfo.encode(p.valSigningInfo,S.uint32(10).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=E();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.valSigningInfo=t.ValidatorSigningInfo.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=E();return(0,o.isSet)(p.valSigningInfo)&&(S.valSigningInfo=t.ValidatorSigningInfo.fromJSON(p.valSigningInfo)),S},toJSON(p){const S={};return p.valSigningInfo!==void 0&&(S.valSigningInfo=p.valSigningInfo?t.ValidatorSigningInfo.toJSON(p.valSigningInfo):void 0),S},fromPartial(p){const S=E();return p.valSigningInfo!==void 0&&p.valSigningInfo!==null&&(S.valSigningInfo=t.ValidatorSigningInfo.fromPartial(p.valSigningInfo)),S}};function D(){return{pagination:void 0}}e.QuerySigningInfosRequest={typeUrl:"/cosmos.slashing.v1beta1.QuerySigningInfosRequest",encode(p,S=i.BinaryWriter.create()){return p.pagination!==void 0&&n.PageRequest.encode(p.pagination,S.uint32(10).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=D();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.pagination=n.PageRequest.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=D();return(0,o.isSet)(p.pagination)&&(S.pagination=n.PageRequest.fromJSON(p.pagination)),S},toJSON(p){const S={};return p.pagination!==void 0&&(S.pagination=p.pagination?n.PageRequest.toJSON(p.pagination):void 0),S},fromPartial(p){const S=D();return p.pagination!==void 0&&p.pagination!==null&&(S.pagination=n.PageRequest.fromPartial(p.pagination)),S}};function J(){return{info:[],pagination:void 0}}e.QuerySigningInfosResponse={typeUrl:"/cosmos.slashing.v1beta1.QuerySigningInfosResponse",encode(p,S=i.BinaryWriter.create()){for(const R of p.info)t.ValidatorSigningInfo.encode(R,S.uint32(10).fork()).ldelim();return p.pagination!==void 0&&n.PageResponse.encode(p.pagination,S.uint32(18).fork()).ldelim(),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=J();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.info.push(t.ValidatorSigningInfo.decode(R,R.uint32()));break;case 2:c.pagination=n.PageResponse.decode(R,R.uint32());break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=J();return Array.isArray(p==null?void 0:p.info)&&(S.info=p.info.map(R=>t.ValidatorSigningInfo.fromJSON(R))),(0,o.isSet)(p.pagination)&&(S.pagination=n.PageResponse.fromJSON(p.pagination)),S},toJSON(p){const S={};return p.info?S.info=p.info.map(R=>R?t.ValidatorSigningInfo.toJSON(R):void 0):S.info=[],p.pagination!==void 0&&(S.pagination=p.pagination?n.PageResponse.toJSON(p.pagination):void 0),S},fromPartial(p){var R;const S=J();return S.info=((R=p.info)==null?void 0:R.map(u=>t.ValidatorSigningInfo.fromPartial(u)))||[],p.pagination!==void 0&&p.pagination!==null&&(S.pagination=n.PageResponse.fromPartial(p.pagination)),S}};class b{constructor(S){this.rpc=S,this.Params=this.Params.bind(this),this.SigningInfo=this.SigningInfo.bind(this),this.SigningInfos=this.SigningInfos.bind(this)}Params(S={}){const R=e.QueryParamsRequest.encode(S).finish();return this.rpc.request("cosmos.slashing.v1beta1.Query","Params",R).then(c=>e.QueryParamsResponse.decode(new i.BinaryReader(c)))}SigningInfo(S){const R=e.QuerySigningInfoRequest.encode(S).finish();return this.rpc.request("cosmos.slashing.v1beta1.Query","SigningInfo",R).then(c=>e.QuerySigningInfoResponse.decode(new i.BinaryReader(c)))}SigningInfos(S={pagination:n.PageRequest.fromPartial({})}){const R=e.QuerySigningInfosRequest.encode(S).finish();return this.rpc.request("cosmos.slashing.v1beta1.Query","SigningInfos",R).then(c=>e.QuerySigningInfosResponse.decode(new i.BinaryReader(c)))}}e.QueryClientImpl=b})(Mc);Object.defineProperty(Ss,"__esModule",{value:!0});Ss.setupSlashingExtension=void 0;const lP=Mc,Gl=ze;function fP(e){const n=(0,Gl.createProtobufRpcClient)(e),t=new lP.QueryClientImpl(n);return{slashing:{signingInfo:async i=>await t.SigningInfo({consAddress:i}),signingInfos:async i=>await t.SigningInfos({pagination:(0,Gl.createPagination)(i)}),params:async()=>await t.Params({})}}}Ss.setupSlashingExtension=fP;var Me={};Object.defineProperty(Me,"__esModule",{value:!0});Me.createStakingAminoConverters=Me.isAminoMsgCancelUnbondingDelegation=Me.isAminoMsgUndelegate=Me.isAminoMsgBeginRedelegate=Me.isAminoMsgDelegate=Me.isAminoMsgEditValidator=Me.isAminoMsgCreateValidator=Me.protoDecimalToJson=void 0;const Pm=Ne,Ll=ut,ct=Ie;function Zi(e){const n=Pm.Decimal.fromAtomics(e,18),[t,i]=n.toString().split(".");return`${t}.${(i??"").padEnd(18,"0")}`}Me.protoDecimalToJson=Zi;function ea(e){return Pm.Decimal.fromUserInput(e,18).atomics}function pP(e){return e.type==="cosmos-sdk/MsgCreateValidator"}Me.isAminoMsgCreateValidator=pP;function mP(e){return e.type==="cosmos-sdk/MsgEditValidator"}Me.isAminoMsgEditValidator=mP;function hP(e){return e.type==="cosmos-sdk/MsgDelegate"}Me.isAminoMsgDelegate=hP;function gP(e){return e.type==="cosmos-sdk/MsgBeginRedelegate"}Me.isAminoMsgBeginRedelegate=gP;function yP(e){return e.type==="cosmos-sdk/MsgUndelegate"}Me.isAminoMsgUndelegate=yP;function SP(e){return e.type==="cosmos-sdk/MsgCancelUnbondingDelegation"}Me.isAminoMsgCancelUnbondingDelegation=SP;function kP(){return{"/cosmos.staking.v1beta1.MsgBeginRedelegate":{aminoType:"cosmos-sdk/MsgBeginRedelegate",toAmino:({delegatorAddress:e,validatorSrcAddress:n,validatorDstAddress:t,amount:i})=>((0,ct.assertDefinedAndNotNull)(i,"missing amount"),{delegator_address:e,validator_src_address:n,validator_dst_address:t,amount:i}),fromAmino:({delegator_address:e,validator_src_address:n,validator_dst_address:t,amount:i})=>({delegatorAddress:e,validatorSrcAddress:n,validatorDstAddress:t,amount:i})},"/cosmos.staking.v1beta1.MsgCreateValidator":{aminoType:"cosmos-sdk/MsgCreateValidator",toAmino:({description:e,commission:n,minSelfDelegation:t,delegatorAddress:i,validatorAddress:o,pubkey:g,value:C})=>((0,ct.assertDefinedAndNotNull)(e,"missing description"),(0,ct.assertDefinedAndNotNull)(n,"missing commission"),(0,ct.assertDefinedAndNotNull)(g,"missing pubkey"),(0,ct.assertDefinedAndNotNull)(C,"missing value"),{description:{moniker:e.moniker,identity:e.identity,website:e.website,security_contact:e.securityContact,details:e.details},commission:{rate:Zi(n.rate),max_rate:Zi(n.maxRate),max_change_rate:Zi(n.maxChangeRate)},min_self_delegation:t,delegator_address:i,validator_address:o,pubkey:(0,Ll.decodePubkey)(g),value:C}),fromAmino:({description:e,commission:n,min_self_delegation:t,delegator_address:i,validator_address:o,pubkey:g,value:C})=>({description:{moniker:e.moniker,identity:e.identity,website:e.website,securityContact:e.security_contact,details:e.details},commission:{rate:ea(n.rate),maxRate:ea(n.max_rate),maxChangeRate:ea(n.max_change_rate)},minSelfDelegation:t,delegatorAddress:i,validatorAddress:o,pubkey:(0,Ll.encodePubkey)(g),value:C})},"/cosmos.staking.v1beta1.MsgDelegate":{aminoType:"cosmos-sdk/MsgDelegate",toAmino:({delegatorAddress:e,validatorAddress:n,amount:t})=>((0,ct.assertDefinedAndNotNull)(t,"missing amount"),{delegator_address:e,validator_address:n,amount:t}),fromAmino:({delegator_address:e,validator_address:n,amount:t})=>({delegatorAddress:e,validatorAddress:n,amount:t})},"/cosmos.staking.v1beta1.MsgEditValidator":{aminoType:"cosmos-sdk/MsgEditValidator",toAmino:({description:e,commissionRate:n,minSelfDelegation:t,validatorAddress:i})=>((0,ct.assertDefinedAndNotNull)(e,"missing description"),{description:{moniker:e.moniker,identity:e.identity,website:e.website,security_contact:e.securityContact,details:e.details},commission_rate:n?Zi(n):void 0,min_self_delegation:t||void 0,validator_address:i}),fromAmino:({description:e,commission_rate:n,min_self_delegation:t,validator_address:i})=>({description:{moniker:e.moniker,identity:e.identity,website:e.website,securityContact:e.security_contact,details:e.details},commissionRate:n?ea(n):"",minSelfDelegation:t??"",validatorAddress:i})},"/cosmos.staking.v1beta1.MsgUndelegate":{aminoType:"cosmos-sdk/MsgUndelegate",toAmino:({delegatorAddress:e,validatorAddress:n,amount:t})=>((0,ct.assertDefinedAndNotNull)(t,"missing amount"),{delegator_address:e,validator_address:n,amount:t}),fromAmino:({delegator_address:e,validator_address:n,amount:t})=>({delegatorAddress:e,validatorAddress:n,amount:t})},"/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation":{aminoType:"cosmos-sdk/MsgCancelUnbondingDelegation",toAmino:({delegatorAddress:e,validatorAddress:n,amount:t,creationHeight:i})=>((0,ct.assertDefinedAndNotNull)(t,"missing amount"),{delegator_address:e,validator_address:n,amount:t,creation_height:i.toString()}),fromAmino:({delegator_address:e,validator_address:n,amount:t,creation_height:i})=>({delegatorAddress:e,validatorAddress:n,amount:t,creationHeight:BigInt(i)})}}}Me.createStakingAminoConverters=kP;var Ge={},Ao={},Uc={},Dc={},vm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HashedParams=e.VersionParams=e.ValidatorParams=e.EvidenceParams=e.BlockParams=e.ConsensusParams=e.protobufPackage=void 0;const n=yn,t=_.binary,i=_.helpers;e.protobufPackage="tendermint.types";function o(){return{block:void 0,evidence:void 0,validator:void 0,version:void 0}}e.ConsensusParams={typeUrl:"/tendermint.types.ConsensusParams",encode(J,b=t.BinaryWriter.create()){return J.block!==void 0&&e.BlockParams.encode(J.block,b.uint32(10).fork()).ldelim(),J.evidence!==void 0&&e.EvidenceParams.encode(J.evidence,b.uint32(18).fork()).ldelim(),J.validator!==void 0&&e.ValidatorParams.encode(J.validator,b.uint32(26).fork()).ldelim(),J.version!==void 0&&e.VersionParams.encode(J.version,b.uint32(34).fork()).ldelim(),b},decode(J,b){const p=J instanceof t.BinaryReader?J:new t.BinaryReader(J);let S=b===void 0?p.len:p.pos+b;const R=o();for(;p.pos<S;){const u=p.uint32();switch(u>>>3){case 1:R.block=e.BlockParams.decode(p,p.uint32());break;case 2:R.evidence=e.EvidenceParams.decode(p,p.uint32());break;case 3:R.validator=e.ValidatorParams.decode(p,p.uint32());break;case 4:R.version=e.VersionParams.decode(p,p.uint32());break;default:p.skipType(u&7);break}}return R},fromJSON(J){const b=o();return(0,i.isSet)(J.block)&&(b.block=e.BlockParams.fromJSON(J.block)),(0,i.isSet)(J.evidence)&&(b.evidence=e.EvidenceParams.fromJSON(J.evidence)),(0,i.isSet)(J.validator)&&(b.validator=e.ValidatorParams.fromJSON(J.validator)),(0,i.isSet)(J.version)&&(b.version=e.VersionParams.fromJSON(J.version)),b},toJSON(J){const b={};return J.block!==void 0&&(b.block=J.block?e.BlockParams.toJSON(J.block):void 0),J.evidence!==void 0&&(b.evidence=J.evidence?e.EvidenceParams.toJSON(J.evidence):void 0),J.validator!==void 0&&(b.validator=J.validator?e.ValidatorParams.toJSON(J.validator):void 0),J.version!==void 0&&(b.version=J.version?e.VersionParams.toJSON(J.version):void 0),b},fromPartial(J){const b=o();return J.block!==void 0&&J.block!==null&&(b.block=e.BlockParams.fromPartial(J.block)),J.evidence!==void 0&&J.evidence!==null&&(b.evidence=e.EvidenceParams.fromPartial(J.evidence)),J.validator!==void 0&&J.validator!==null&&(b.validator=e.ValidatorParams.fromPartial(J.validator)),J.version!==void 0&&J.version!==null&&(b.version=e.VersionParams.fromPartial(J.version)),b}};function g(){return{maxBytes:BigInt(0),maxGas:BigInt(0)}}e.BlockParams={typeUrl:"/tendermint.types.BlockParams",encode(J,b=t.BinaryWriter.create()){return J.maxBytes!==BigInt(0)&&b.uint32(8).int64(J.maxBytes),J.maxGas!==BigInt(0)&&b.uint32(16).int64(J.maxGas),b},decode(J,b){const p=J instanceof t.BinaryReader?J:new t.BinaryReader(J);let S=b===void 0?p.len:p.pos+b;const R=g();for(;p.pos<S;){const u=p.uint32();switch(u>>>3){case 1:R.maxBytes=p.int64();break;case 2:R.maxGas=p.int64();break;default:p.skipType(u&7);break}}return R},fromJSON(J){const b=g();return(0,i.isSet)(J.maxBytes)&&(b.maxBytes=BigInt(J.maxBytes.toString())),(0,i.isSet)(J.maxGas)&&(b.maxGas=BigInt(J.maxGas.toString())),b},toJSON(J){const b={};return J.maxBytes!==void 0&&(b.maxBytes=(J.maxBytes||BigInt(0)).toString()),J.maxGas!==void 0&&(b.maxGas=(J.maxGas||BigInt(0)).toString()),b},fromPartial(J){const b=g();return J.maxBytes!==void 0&&J.maxBytes!==null&&(b.maxBytes=BigInt(J.maxBytes.toString())),J.maxGas!==void 0&&J.maxGas!==null&&(b.maxGas=BigInt(J.maxGas.toString())),b}};function C(){return{maxAgeNumBlocks:BigInt(0),maxAgeDuration:n.Duration.fromPartial({}),maxBytes:BigInt(0)}}e.EvidenceParams={typeUrl:"/tendermint.types.EvidenceParams",encode(J,b=t.BinaryWriter.create()){return J.maxAgeNumBlocks!==BigInt(0)&&b.uint32(8).int64(J.maxAgeNumBlocks),J.maxAgeDuration!==void 0&&n.Duration.encode(J.maxAgeDuration,b.uint32(18).fork()).ldelim(),J.maxBytes!==BigInt(0)&&b.uint32(24).int64(J.maxBytes),b},decode(J,b){const p=J instanceof t.BinaryReader?J:new t.BinaryReader(J);let S=b===void 0?p.len:p.pos+b;const R=C();for(;p.pos<S;){const u=p.uint32();switch(u>>>3){case 1:R.maxAgeNumBlocks=p.int64();break;case 2:R.maxAgeDuration=n.Duration.decode(p,p.uint32());break;case 3:R.maxBytes=p.int64();break;default:p.skipType(u&7);break}}return R},fromJSON(J){const b=C();return(0,i.isSet)(J.maxAgeNumBlocks)&&(b.maxAgeNumBlocks=BigInt(J.maxAgeNumBlocks.toString())),(0,i.isSet)(J.maxAgeDuration)&&(b.maxAgeDuration=n.Duration.fromJSON(J.maxAgeDuration)),(0,i.isSet)(J.maxBytes)&&(b.maxBytes=BigInt(J.maxBytes.toString())),b},toJSON(J){const b={};return J.maxAgeNumBlocks!==void 0&&(b.maxAgeNumBlocks=(J.maxAgeNumBlocks||BigInt(0)).toString()),J.maxAgeDuration!==void 0&&(b.maxAgeDuration=J.maxAgeDuration?n.Duration.toJSON(J.maxAgeDuration):void 0),J.maxBytes!==void 0&&(b.maxBytes=(J.maxBytes||BigInt(0)).toString()),b},fromPartial(J){const b=C();return J.maxAgeNumBlocks!==void 0&&J.maxAgeNumBlocks!==null&&(b.maxAgeNumBlocks=BigInt(J.maxAgeNumBlocks.toString())),J.maxAgeDuration!==void 0&&J.maxAgeDuration!==null&&(b.maxAgeDuration=n.Duration.fromPartial(J.maxAgeDuration)),J.maxBytes!==void 0&&J.maxBytes!==null&&(b.maxBytes=BigInt(J.maxBytes.toString())),b}};function w(){return{pubKeyTypes:[]}}e.ValidatorParams={typeUrl:"/tendermint.types.ValidatorParams",encode(J,b=t.BinaryWriter.create()){for(const p of J.pubKeyTypes)b.uint32(10).string(p);return b},decode(J,b){const p=J instanceof t.BinaryReader?J:new t.BinaryReader(J);let S=b===void 0?p.len:p.pos+b;const R=w();for(;p.pos<S;){const u=p.uint32();switch(u>>>3){case 1:R.pubKeyTypes.push(p.string());break;default:p.skipType(u&7);break}}return R},fromJSON(J){const b=w();return Array.isArray(J==null?void 0:J.pubKeyTypes)&&(b.pubKeyTypes=J.pubKeyTypes.map(p=>String(p))),b},toJSON(J){const b={};return J.pubKeyTypes?b.pubKeyTypes=J.pubKeyTypes.map(p=>p):b.pubKeyTypes=[],b},fromPartial(J){var p;const b=w();return b.pubKeyTypes=((p=J.pubKeyTypes)==null?void 0:p.map(S=>S))||[],b}};function E(){return{app:BigInt(0)}}e.VersionParams={typeUrl:"/tendermint.types.VersionParams",encode(J,b=t.BinaryWriter.create()){return J.app!==BigInt(0)&&b.uint32(8).uint64(J.app),b},decode(J,b){const p=J instanceof t.BinaryReader?J:new t.BinaryReader(J);let S=b===void 0?p.len:p.pos+b;const R=E();for(;p.pos<S;){const u=p.uint32();switch(u>>>3){case 1:R.app=p.uint64();break;default:p.skipType(u&7);break}}return R},fromJSON(J){const b=E();return(0,i.isSet)(J.app)&&(b.app=BigInt(J.app.toString())),b},toJSON(J){const b={};return J.app!==void 0&&(b.app=(J.app||BigInt(0)).toString()),b},fromPartial(J){const b=E();return J.app!==void 0&&J.app!==null&&(b.app=BigInt(J.app.toString())),b}};function D(){return{blockMaxBytes:BigInt(0),blockMaxGas:BigInt(0)}}e.HashedParams={typeUrl:"/tendermint.types.HashedParams",encode(J,b=t.BinaryWriter.create()){return J.blockMaxBytes!==BigInt(0)&&b.uint32(8).int64(J.blockMaxBytes),J.blockMaxGas!==BigInt(0)&&b.uint32(16).int64(J.blockMaxGas),b},decode(J,b){const p=J instanceof t.BinaryReader?J:new t.BinaryReader(J);let S=b===void 0?p.len:p.pos+b;const R=D();for(;p.pos<S;){const u=p.uint32();switch(u>>>3){case 1:R.blockMaxBytes=p.int64();break;case 2:R.blockMaxGas=p.int64();break;default:p.skipType(u&7);break}}return R},fromJSON(J){const b=D();return(0,i.isSet)(J.blockMaxBytes)&&(b.blockMaxBytes=BigInt(J.blockMaxBytes.toString())),(0,i.isSet)(J.blockMaxGas)&&(b.blockMaxGas=BigInt(J.blockMaxGas.toString())),b},toJSON(J){const b={};return J.blockMaxBytes!==void 0&&(b.blockMaxBytes=(J.blockMaxBytes||BigInt(0)).toString()),J.blockMaxGas!==void 0&&(b.blockMaxGas=(J.blockMaxGas||BigInt(0)).toString()),b},fromPartial(J){const b=D();return J.blockMaxBytes!==void 0&&J.blockMaxBytes!==null&&(b.blockMaxBytes=BigInt(J.blockMaxBytes.toString())),J.blockMaxGas!==void 0&&J.blockMaxGas!==null&&(b.blockMaxGas=BigInt(J.blockMaxGas.toString())),b}}})(vm);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ResponsePrepareProposal=e.ResponseApplySnapshotChunk=e.ResponseLoadSnapshotChunk=e.ResponseOfferSnapshot=e.ResponseListSnapshots=e.ResponseCommit=e.ResponseEndBlock=e.ResponseDeliverTx=e.ResponseCheckTx=e.ResponseBeginBlock=e.ResponseQuery=e.ResponseInitChain=e.ResponseInfo=e.ResponseFlush=e.ResponseEcho=e.ResponseException=e.Response=e.RequestProcessProposal=e.RequestPrepareProposal=e.RequestApplySnapshotChunk=e.RequestLoadSnapshotChunk=e.RequestOfferSnapshot=e.RequestListSnapshots=e.RequestCommit=e.RequestEndBlock=e.RequestDeliverTx=e.RequestCheckTx=e.RequestBeginBlock=e.RequestQuery=e.RequestInitChain=e.RequestInfo=e.RequestFlush=e.RequestEcho=e.Request=e.misbehaviorTypeToJSON=e.misbehaviorTypeFromJSON=e.MisbehaviorType=e.responseProcessProposal_ProposalStatusToJSON=e.responseProcessProposal_ProposalStatusFromJSON=e.ResponseProcessProposal_ProposalStatus=e.responseApplySnapshotChunk_ResultToJSON=e.responseApplySnapshotChunk_ResultFromJSON=e.ResponseApplySnapshotChunk_Result=e.responseOfferSnapshot_ResultToJSON=e.responseOfferSnapshot_ResultFromJSON=e.ResponseOfferSnapshot_Result=e.checkTxTypeToJSON=e.checkTxTypeFromJSON=e.CheckTxType=e.protobufPackage=void 0,e.ABCIApplicationClientImpl=e.Snapshot=e.Misbehavior=e.ExtendedVoteInfo=e.VoteInfo=e.ValidatorUpdate=e.Validator=e.TxResult=e.EventAttribute=e.Event=e.ExtendedCommitInfo=e.CommitInfo=e.ResponseProcessProposal=void 0;const n=Je,t=vm,i=mr,o=wc,g=lr,C=_.binary,w=_.helpers;e.protobufPackage="tendermint.abci";var E;(function(f){f[f.NEW=0]="NEW",f[f.RECHECK=1]="RECHECK",f[f.UNRECOGNIZED=-1]="UNRECOGNIZED"})(E||(e.CheckTxType=E={}));function D(f){switch(f){case 0:case"NEW":return E.NEW;case 1:case"RECHECK":return E.RECHECK;case-1:case"UNRECOGNIZED":default:return E.UNRECOGNIZED}}e.checkTxTypeFromJSON=D;function J(f){switch(f){case E.NEW:return"NEW";case E.RECHECK:return"RECHECK";case E.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.checkTxTypeToJSON=J;var b;(function(f){f[f.UNKNOWN=0]="UNKNOWN",f[f.ACCEPT=1]="ACCEPT",f[f.ABORT=2]="ABORT",f[f.REJECT=3]="REJECT",f[f.REJECT_FORMAT=4]="REJECT_FORMAT",f[f.REJECT_SENDER=5]="REJECT_SENDER",f[f.UNRECOGNIZED=-1]="UNRECOGNIZED"})(b||(e.ResponseOfferSnapshot_Result=b={}));function p(f){switch(f){case 0:case"UNKNOWN":return b.UNKNOWN;case 1:case"ACCEPT":return b.ACCEPT;case 2:case"ABORT":return b.ABORT;case 3:case"REJECT":return b.REJECT;case 4:case"REJECT_FORMAT":return b.REJECT_FORMAT;case 5:case"REJECT_SENDER":return b.REJECT_SENDER;case-1:case"UNRECOGNIZED":default:return b.UNRECOGNIZED}}e.responseOfferSnapshot_ResultFromJSON=p;function S(f){switch(f){case b.UNKNOWN:return"UNKNOWN";case b.ACCEPT:return"ACCEPT";case b.ABORT:return"ABORT";case b.REJECT:return"REJECT";case b.REJECT_FORMAT:return"REJECT_FORMAT";case b.REJECT_SENDER:return"REJECT_SENDER";case b.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.responseOfferSnapshot_ResultToJSON=S;var R;(function(f){f[f.UNKNOWN=0]="UNKNOWN",f[f.ACCEPT=1]="ACCEPT",f[f.ABORT=2]="ABORT",f[f.RETRY=3]="RETRY",f[f.RETRY_SNAPSHOT=4]="RETRY_SNAPSHOT",f[f.REJECT_SNAPSHOT=5]="REJECT_SNAPSHOT",f[f.UNRECOGNIZED=-1]="UNRECOGNIZED"})(R||(e.ResponseApplySnapshotChunk_Result=R={}));function u(f){switch(f){case 0:case"UNKNOWN":return R.UNKNOWN;case 1:case"ACCEPT":return R.ACCEPT;case 2:case"ABORT":return R.ABORT;case 3:case"RETRY":return R.RETRY;case 4:case"RETRY_SNAPSHOT":return R.RETRY_SNAPSHOT;case 5:case"REJECT_SNAPSHOT":return R.REJECT_SNAPSHOT;case-1:case"UNRECOGNIZED":default:return R.UNRECOGNIZED}}e.responseApplySnapshotChunk_ResultFromJSON=u;function c(f){switch(f){case R.UNKNOWN:return"UNKNOWN";case R.ACCEPT:return"ACCEPT";case R.ABORT:return"ABORT";case R.RETRY:return"RETRY";case R.RETRY_SNAPSHOT:return"RETRY_SNAPSHOT";case R.REJECT_SNAPSHOT:return"REJECT_SNAPSHOT";case R.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.responseApplySnapshotChunk_ResultToJSON=c;var y;(function(f){f[f.UNKNOWN=0]="UNKNOWN",f[f.ACCEPT=1]="ACCEPT",f[f.REJECT=2]="REJECT",f[f.UNRECOGNIZED=-1]="UNRECOGNIZED"})(y||(e.ResponseProcessProposal_ProposalStatus=y={}));function B(f){switch(f){case 0:case"UNKNOWN":return y.UNKNOWN;case 1:case"ACCEPT":return y.ACCEPT;case 2:case"REJECT":return y.REJECT;case-1:case"UNRECOGNIZED":default:return y.UNRECOGNIZED}}e.responseProcessProposal_ProposalStatusFromJSON=B;function N(f){switch(f){case y.UNKNOWN:return"UNKNOWN";case y.ACCEPT:return"ACCEPT";case y.REJECT:return"REJECT";case y.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.responseProcessProposal_ProposalStatusToJSON=N;var U;(function(f){f[f.UNKNOWN=0]="UNKNOWN",f[f.DUPLICATE_VOTE=1]="DUPLICATE_VOTE",f[f.LIGHT_CLIENT_ATTACK=2]="LIGHT_CLIENT_ATTACK",f[f.UNRECOGNIZED=-1]="UNRECOGNIZED"})(U||(e.MisbehaviorType=U={}));function W(f){switch(f){case 0:case"UNKNOWN":return U.UNKNOWN;case 1:case"DUPLICATE_VOTE":return U.DUPLICATE_VOTE;case 2:case"LIGHT_CLIENT_ATTACK":return U.LIGHT_CLIENT_ATTACK;case-1:case"UNRECOGNIZED":default:return U.UNRECOGNIZED}}e.misbehaviorTypeFromJSON=W;function r(f){switch(f){case U.UNKNOWN:return"UNKNOWN";case U.DUPLICATE_VOTE:return"DUPLICATE_VOTE";case U.LIGHT_CLIENT_ATTACK:return"LIGHT_CLIENT_ATTACK";case U.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.misbehaviorTypeToJSON=r;function s(){return{echo:void 0,flush:void 0,info:void 0,initChain:void 0,query:void 0,beginBlock:void 0,checkTx:void 0,deliverTx:void 0,endBlock:void 0,commit:void 0,listSnapshots:void 0,offerSnapshot:void 0,loadSnapshotChunk:void 0,applySnapshotChunk:void 0,prepareProposal:void 0,processProposal:void 0}}e.Request={typeUrl:"/tendermint.abci.Request",encode(f,I=C.BinaryWriter.create()){return f.echo!==void 0&&e.RequestEcho.encode(f.echo,I.uint32(10).fork()).ldelim(),f.flush!==void 0&&e.RequestFlush.encode(f.flush,I.uint32(18).fork()).ldelim(),f.info!==void 0&&e.RequestInfo.encode(f.info,I.uint32(26).fork()).ldelim(),f.initChain!==void 0&&e.RequestInitChain.encode(f.initChain,I.uint32(42).fork()).ldelim(),f.query!==void 0&&e.RequestQuery.encode(f.query,I.uint32(50).fork()).ldelim(),f.beginBlock!==void 0&&e.RequestBeginBlock.encode(f.beginBlock,I.uint32(58).fork()).ldelim(),f.checkTx!==void 0&&e.RequestCheckTx.encode(f.checkTx,I.uint32(66).fork()).ldelim(),f.deliverTx!==void 0&&e.RequestDeliverTx.encode(f.deliverTx,I.uint32(74).fork()).ldelim(),f.endBlock!==void 0&&e.RequestEndBlock.encode(f.endBlock,I.uint32(82).fork()).ldelim(),f.commit!==void 0&&e.RequestCommit.encode(f.commit,I.uint32(90).fork()).ldelim(),f.listSnapshots!==void 0&&e.RequestListSnapshots.encode(f.listSnapshots,I.uint32(98).fork()).ldelim(),f.offerSnapshot!==void 0&&e.RequestOfferSnapshot.encode(f.offerSnapshot,I.uint32(106).fork()).ldelim(),f.loadSnapshotChunk!==void 0&&e.RequestLoadSnapshotChunk.encode(f.loadSnapshotChunk,I.uint32(114).fork()).ldelim(),f.applySnapshotChunk!==void 0&&e.RequestApplySnapshotChunk.encode(f.applySnapshotChunk,I.uint32(122).fork()).ldelim(),f.prepareProposal!==void 0&&e.RequestPrepareProposal.encode(f.prepareProposal,I.uint32(130).fork()).ldelim(),f.processProposal!==void 0&&e.RequestProcessProposal.encode(f.processProposal,I.uint32(138).fork()).ldelim(),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=s();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.echo=e.RequestEcho.decode(V,V.uint32());break;case 2:G.flush=e.RequestFlush.decode(V,V.uint32());break;case 3:G.info=e.RequestInfo.decode(V,V.uint32());break;case 5:G.initChain=e.RequestInitChain.decode(V,V.uint32());break;case 6:G.query=e.RequestQuery.decode(V,V.uint32());break;case 7:G.beginBlock=e.RequestBeginBlock.decode(V,V.uint32());break;case 8:G.checkTx=e.RequestCheckTx.decode(V,V.uint32());break;case 9:G.deliverTx=e.RequestDeliverTx.decode(V,V.uint32());break;case 10:G.endBlock=e.RequestEndBlock.decode(V,V.uint32());break;case 11:G.commit=e.RequestCommit.decode(V,V.uint32());break;case 12:G.listSnapshots=e.RequestListSnapshots.decode(V,V.uint32());break;case 13:G.offerSnapshot=e.RequestOfferSnapshot.decode(V,V.uint32());break;case 14:G.loadSnapshotChunk=e.RequestLoadSnapshotChunk.decode(V,V.uint32());break;case 15:G.applySnapshotChunk=e.RequestApplySnapshotChunk.decode(V,V.uint32());break;case 16:G.prepareProposal=e.RequestPrepareProposal.decode(V,V.uint32());break;case 17:G.processProposal=e.RequestProcessProposal.decode(V,V.uint32());break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=s();return(0,w.isSet)(f.echo)&&(I.echo=e.RequestEcho.fromJSON(f.echo)),(0,w.isSet)(f.flush)&&(I.flush=e.RequestFlush.fromJSON(f.flush)),(0,w.isSet)(f.info)&&(I.info=e.RequestInfo.fromJSON(f.info)),(0,w.isSet)(f.initChain)&&(I.initChain=e.RequestInitChain.fromJSON(f.initChain)),(0,w.isSet)(f.query)&&(I.query=e.RequestQuery.fromJSON(f.query)),(0,w.isSet)(f.beginBlock)&&(I.beginBlock=e.RequestBeginBlock.fromJSON(f.beginBlock)),(0,w.isSet)(f.checkTx)&&(I.checkTx=e.RequestCheckTx.fromJSON(f.checkTx)),(0,w.isSet)(f.deliverTx)&&(I.deliverTx=e.RequestDeliverTx.fromJSON(f.deliverTx)),(0,w.isSet)(f.endBlock)&&(I.endBlock=e.RequestEndBlock.fromJSON(f.endBlock)),(0,w.isSet)(f.commit)&&(I.commit=e.RequestCommit.fromJSON(f.commit)),(0,w.isSet)(f.listSnapshots)&&(I.listSnapshots=e.RequestListSnapshots.fromJSON(f.listSnapshots)),(0,w.isSet)(f.offerSnapshot)&&(I.offerSnapshot=e.RequestOfferSnapshot.fromJSON(f.offerSnapshot)),(0,w.isSet)(f.loadSnapshotChunk)&&(I.loadSnapshotChunk=e.RequestLoadSnapshotChunk.fromJSON(f.loadSnapshotChunk)),(0,w.isSet)(f.applySnapshotChunk)&&(I.applySnapshotChunk=e.RequestApplySnapshotChunk.fromJSON(f.applySnapshotChunk)),(0,w.isSet)(f.prepareProposal)&&(I.prepareProposal=e.RequestPrepareProposal.fromJSON(f.prepareProposal)),(0,w.isSet)(f.processProposal)&&(I.processProposal=e.RequestProcessProposal.fromJSON(f.processProposal)),I},toJSON(f){const I={};return f.echo!==void 0&&(I.echo=f.echo?e.RequestEcho.toJSON(f.echo):void 0),f.flush!==void 0&&(I.flush=f.flush?e.RequestFlush.toJSON(f.flush):void 0),f.info!==void 0&&(I.info=f.info?e.RequestInfo.toJSON(f.info):void 0),f.initChain!==void 0&&(I.initChain=f.initChain?e.RequestInitChain.toJSON(f.initChain):void 0),f.query!==void 0&&(I.query=f.query?e.RequestQuery.toJSON(f.query):void 0),f.beginBlock!==void 0&&(I.beginBlock=f.beginBlock?e.RequestBeginBlock.toJSON(f.beginBlock):void 0),f.checkTx!==void 0&&(I.checkTx=f.checkTx?e.RequestCheckTx.toJSON(f.checkTx):void 0),f.deliverTx!==void 0&&(I.deliverTx=f.deliverTx?e.RequestDeliverTx.toJSON(f.deliverTx):void 0),f.endBlock!==void 0&&(I.endBlock=f.endBlock?e.RequestEndBlock.toJSON(f.endBlock):void 0),f.commit!==void 0&&(I.commit=f.commit?e.RequestCommit.toJSON(f.commit):void 0),f.listSnapshots!==void 0&&(I.listSnapshots=f.listSnapshots?e.RequestListSnapshots.toJSON(f.listSnapshots):void 0),f.offerSnapshot!==void 0&&(I.offerSnapshot=f.offerSnapshot?e.RequestOfferSnapshot.toJSON(f.offerSnapshot):void 0),f.loadSnapshotChunk!==void 0&&(I.loadSnapshotChunk=f.loadSnapshotChunk?e.RequestLoadSnapshotChunk.toJSON(f.loadSnapshotChunk):void 0),f.applySnapshotChunk!==void 0&&(I.applySnapshotChunk=f.applySnapshotChunk?e.RequestApplySnapshotChunk.toJSON(f.applySnapshotChunk):void 0),f.prepareProposal!==void 0&&(I.prepareProposal=f.prepareProposal?e.RequestPrepareProposal.toJSON(f.prepareProposal):void 0),f.processProposal!==void 0&&(I.processProposal=f.processProposal?e.RequestProcessProposal.toJSON(f.processProposal):void 0),I},fromPartial(f){const I=s();return f.echo!==void 0&&f.echo!==null&&(I.echo=e.RequestEcho.fromPartial(f.echo)),f.flush!==void 0&&f.flush!==null&&(I.flush=e.RequestFlush.fromPartial(f.flush)),f.info!==void 0&&f.info!==null&&(I.info=e.RequestInfo.fromPartial(f.info)),f.initChain!==void 0&&f.initChain!==null&&(I.initChain=e.RequestInitChain.fromPartial(f.initChain)),f.query!==void 0&&f.query!==null&&(I.query=e.RequestQuery.fromPartial(f.query)),f.beginBlock!==void 0&&f.beginBlock!==null&&(I.beginBlock=e.RequestBeginBlock.fromPartial(f.beginBlock)),f.checkTx!==void 0&&f.checkTx!==null&&(I.checkTx=e.RequestCheckTx.fromPartial(f.checkTx)),f.deliverTx!==void 0&&f.deliverTx!==null&&(I.deliverTx=e.RequestDeliverTx.fromPartial(f.deliverTx)),f.endBlock!==void 0&&f.endBlock!==null&&(I.endBlock=e.RequestEndBlock.fromPartial(f.endBlock)),f.commit!==void 0&&f.commit!==null&&(I.commit=e.RequestCommit.fromPartial(f.commit)),f.listSnapshots!==void 0&&f.listSnapshots!==null&&(I.listSnapshots=e.RequestListSnapshots.fromPartial(f.listSnapshots)),f.offerSnapshot!==void 0&&f.offerSnapshot!==null&&(I.offerSnapshot=e.RequestOfferSnapshot.fromPartial(f.offerSnapshot)),f.loadSnapshotChunk!==void 0&&f.loadSnapshotChunk!==null&&(I.loadSnapshotChunk=e.RequestLoadSnapshotChunk.fromPartial(f.loadSnapshotChunk)),f.applySnapshotChunk!==void 0&&f.applySnapshotChunk!==null&&(I.applySnapshotChunk=e.RequestApplySnapshotChunk.fromPartial(f.applySnapshotChunk)),f.prepareProposal!==void 0&&f.prepareProposal!==null&&(I.prepareProposal=e.RequestPrepareProposal.fromPartial(f.prepareProposal)),f.processProposal!==void 0&&f.processProposal!==null&&(I.processProposal=e.RequestProcessProposal.fromPartial(f.processProposal)),I}};function O(){return{message:""}}e.RequestEcho={typeUrl:"/tendermint.abci.RequestEcho",encode(f,I=C.BinaryWriter.create()){return f.message!==""&&I.uint32(10).string(f.message),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=O();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.message=V.string();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=O();return(0,w.isSet)(f.message)&&(I.message=String(f.message)),I},toJSON(f){const I={};return f.message!==void 0&&(I.message=f.message),I},fromPartial(f){const I=O();return I.message=f.message??"",I}};function q(){return{}}e.RequestFlush={typeUrl:"/tendermint.abci.RequestFlush",encode(f,I=C.BinaryWriter.create()){return I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=q();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){default:V.skipType(z&7);break}}return G},fromJSON(f){return q()},toJSON(f){return{}},fromPartial(f){return q()}};function d(){return{version:"",blockVersion:BigInt(0),p2pVersion:BigInt(0),abciVersion:""}}e.RequestInfo={typeUrl:"/tendermint.abci.RequestInfo",encode(f,I=C.BinaryWriter.create()){return f.version!==""&&I.uint32(10).string(f.version),f.blockVersion!==BigInt(0)&&I.uint32(16).uint64(f.blockVersion),f.p2pVersion!==BigInt(0)&&I.uint32(24).uint64(f.p2pVersion),f.abciVersion!==""&&I.uint32(34).string(f.abciVersion),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=d();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.version=V.string();break;case 2:G.blockVersion=V.uint64();break;case 3:G.p2pVersion=V.uint64();break;case 4:G.abciVersion=V.string();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=d();return(0,w.isSet)(f.version)&&(I.version=String(f.version)),(0,w.isSet)(f.blockVersion)&&(I.blockVersion=BigInt(f.blockVersion.toString())),(0,w.isSet)(f.p2pVersion)&&(I.p2pVersion=BigInt(f.p2pVersion.toString())),(0,w.isSet)(f.abciVersion)&&(I.abciVersion=String(f.abciVersion)),I},toJSON(f){const I={};return f.version!==void 0&&(I.version=f.version),f.blockVersion!==void 0&&(I.blockVersion=(f.blockVersion||BigInt(0)).toString()),f.p2pVersion!==void 0&&(I.p2pVersion=(f.p2pVersion||BigInt(0)).toString()),f.abciVersion!==void 0&&(I.abciVersion=f.abciVersion),I},fromPartial(f){const I=d();return I.version=f.version??"",f.blockVersion!==void 0&&f.blockVersion!==null&&(I.blockVersion=BigInt(f.blockVersion.toString())),f.p2pVersion!==void 0&&f.p2pVersion!==null&&(I.p2pVersion=BigInt(f.p2pVersion.toString())),I.abciVersion=f.abciVersion??"",I}};function l(){return{time:n.Timestamp.fromPartial({}),chainId:"",consensusParams:void 0,validators:[],appStateBytes:new Uint8Array,initialHeight:BigInt(0)}}e.RequestInitChain={typeUrl:"/tendermint.abci.RequestInitChain",encode(f,I=C.BinaryWriter.create()){f.time!==void 0&&n.Timestamp.encode(f.time,I.uint32(10).fork()).ldelim(),f.chainId!==""&&I.uint32(18).string(f.chainId),f.consensusParams!==void 0&&t.ConsensusParams.encode(f.consensusParams,I.uint32(26).fork()).ldelim();for(const V of f.validators)e.ValidatorUpdate.encode(V,I.uint32(34).fork()).ldelim();return f.appStateBytes.length!==0&&I.uint32(42).bytes(f.appStateBytes),f.initialHeight!==BigInt(0)&&I.uint32(48).int64(f.initialHeight),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=l();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.time=n.Timestamp.decode(V,V.uint32());break;case 2:G.chainId=V.string();break;case 3:G.consensusParams=t.ConsensusParams.decode(V,V.uint32());break;case 4:G.validators.push(e.ValidatorUpdate.decode(V,V.uint32()));break;case 5:G.appStateBytes=V.bytes();break;case 6:G.initialHeight=V.int64();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=l();return(0,w.isSet)(f.time)&&(I.time=(0,w.fromJsonTimestamp)(f.time)),(0,w.isSet)(f.chainId)&&(I.chainId=String(f.chainId)),(0,w.isSet)(f.consensusParams)&&(I.consensusParams=t.ConsensusParams.fromJSON(f.consensusParams)),Array.isArray(f==null?void 0:f.validators)&&(I.validators=f.validators.map(V=>e.ValidatorUpdate.fromJSON(V))),(0,w.isSet)(f.appStateBytes)&&(I.appStateBytes=(0,w.bytesFromBase64)(f.appStateBytes)),(0,w.isSet)(f.initialHeight)&&(I.initialHeight=BigInt(f.initialHeight.toString())),I},toJSON(f){const I={};return f.time!==void 0&&(I.time=(0,w.fromTimestamp)(f.time).toISOString()),f.chainId!==void 0&&(I.chainId=f.chainId),f.consensusParams!==void 0&&(I.consensusParams=f.consensusParams?t.ConsensusParams.toJSON(f.consensusParams):void 0),f.validators?I.validators=f.validators.map(V=>V?e.ValidatorUpdate.toJSON(V):void 0):I.validators=[],f.appStateBytes!==void 0&&(I.appStateBytes=(0,w.base64FromBytes)(f.appStateBytes!==void 0?f.appStateBytes:new Uint8Array)),f.initialHeight!==void 0&&(I.initialHeight=(f.initialHeight||BigInt(0)).toString()),I},fromPartial(f){var V;const I=l();return f.time!==void 0&&f.time!==null&&(I.time=n.Timestamp.fromPartial(f.time)),I.chainId=f.chainId??"",f.consensusParams!==void 0&&f.consensusParams!==null&&(I.consensusParams=t.ConsensusParams.fromPartial(f.consensusParams)),I.validators=((V=f.validators)==null?void 0:V.map(x=>e.ValidatorUpdate.fromPartial(x)))||[],I.appStateBytes=f.appStateBytes??new Uint8Array,f.initialHeight!==void 0&&f.initialHeight!==null&&(I.initialHeight=BigInt(f.initialHeight.toString())),I}};function M(){return{data:new Uint8Array,path:"",height:BigInt(0),prove:!1}}e.RequestQuery={typeUrl:"/tendermint.abci.RequestQuery",encode(f,I=C.BinaryWriter.create()){return f.data.length!==0&&I.uint32(10).bytes(f.data),f.path!==""&&I.uint32(18).string(f.path),f.height!==BigInt(0)&&I.uint32(24).int64(f.height),f.prove===!0&&I.uint32(32).bool(f.prove),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=M();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.data=V.bytes();break;case 2:G.path=V.string();break;case 3:G.height=V.int64();break;case 4:G.prove=V.bool();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=M();return(0,w.isSet)(f.data)&&(I.data=(0,w.bytesFromBase64)(f.data)),(0,w.isSet)(f.path)&&(I.path=String(f.path)),(0,w.isSet)(f.height)&&(I.height=BigInt(f.height.toString())),(0,w.isSet)(f.prove)&&(I.prove=!!f.prove),I},toJSON(f){const I={};return f.data!==void 0&&(I.data=(0,w.base64FromBytes)(f.data!==void 0?f.data:new Uint8Array)),f.path!==void 0&&(I.path=f.path),f.height!==void 0&&(I.height=(f.height||BigInt(0)).toString()),f.prove!==void 0&&(I.prove=f.prove),I},fromPartial(f){const I=M();return I.data=f.data??new Uint8Array,I.path=f.path??"",f.height!==void 0&&f.height!==null&&(I.height=BigInt(f.height.toString())),I.prove=f.prove??!1,I}};function m(){return{hash:new Uint8Array,header:i.Header.fromPartial({}),lastCommitInfo:e.CommitInfo.fromPartial({}),byzantineValidators:[]}}e.RequestBeginBlock={typeUrl:"/tendermint.abci.RequestBeginBlock",encode(f,I=C.BinaryWriter.create()){f.hash.length!==0&&I.uint32(10).bytes(f.hash),f.header!==void 0&&i.Header.encode(f.header,I.uint32(18).fork()).ldelim(),f.lastCommitInfo!==void 0&&e.CommitInfo.encode(f.lastCommitInfo,I.uint32(26).fork()).ldelim();for(const V of f.byzantineValidators)e.Misbehavior.encode(V,I.uint32(34).fork()).ldelim();return I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=m();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.hash=V.bytes();break;case 2:G.header=i.Header.decode(V,V.uint32());break;case 3:G.lastCommitInfo=e.CommitInfo.decode(V,V.uint32());break;case 4:G.byzantineValidators.push(e.Misbehavior.decode(V,V.uint32()));break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=m();return(0,w.isSet)(f.hash)&&(I.hash=(0,w.bytesFromBase64)(f.hash)),(0,w.isSet)(f.header)&&(I.header=i.Header.fromJSON(f.header)),(0,w.isSet)(f.lastCommitInfo)&&(I.lastCommitInfo=e.CommitInfo.fromJSON(f.lastCommitInfo)),Array.isArray(f==null?void 0:f.byzantineValidators)&&(I.byzantineValidators=f.byzantineValidators.map(V=>e.Misbehavior.fromJSON(V))),I},toJSON(f){const I={};return f.hash!==void 0&&(I.hash=(0,w.base64FromBytes)(f.hash!==void 0?f.hash:new Uint8Array)),f.header!==void 0&&(I.header=f.header?i.Header.toJSON(f.header):void 0),f.lastCommitInfo!==void 0&&(I.lastCommitInfo=f.lastCommitInfo?e.CommitInfo.toJSON(f.lastCommitInfo):void 0),f.byzantineValidators?I.byzantineValidators=f.byzantineValidators.map(V=>V?e.Misbehavior.toJSON(V):void 0):I.byzantineValidators=[],I},fromPartial(f){var V;const I=m();return I.hash=f.hash??new Uint8Array,f.header!==void 0&&f.header!==null&&(I.header=i.Header.fromPartial(f.header)),f.lastCommitInfo!==void 0&&f.lastCommitInfo!==null&&(I.lastCommitInfo=e.CommitInfo.fromPartial(f.lastCommitInfo)),I.byzantineValidators=((V=f.byzantineValidators)==null?void 0:V.map(x=>e.Misbehavior.fromPartial(x)))||[],I}};function h(){return{tx:new Uint8Array,type:0}}e.RequestCheckTx={typeUrl:"/tendermint.abci.RequestCheckTx",encode(f,I=C.BinaryWriter.create()){return f.tx.length!==0&&I.uint32(10).bytes(f.tx),f.type!==0&&I.uint32(16).int32(f.type),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=h();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.tx=V.bytes();break;case 2:G.type=V.int32();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=h();return(0,w.isSet)(f.tx)&&(I.tx=(0,w.bytesFromBase64)(f.tx)),(0,w.isSet)(f.type)&&(I.type=D(f.type)),I},toJSON(f){const I={};return f.tx!==void 0&&(I.tx=(0,w.base64FromBytes)(f.tx!==void 0?f.tx:new Uint8Array)),f.type!==void 0&&(I.type=J(f.type)),I},fromPartial(f){const I=h();return I.tx=f.tx??new Uint8Array,I.type=f.type??0,I}};function T(){return{tx:new Uint8Array}}e.RequestDeliverTx={typeUrl:"/tendermint.abci.RequestDeliverTx",encode(f,I=C.BinaryWriter.create()){return f.tx.length!==0&&I.uint32(10).bytes(f.tx),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=T();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.tx=V.bytes();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=T();return(0,w.isSet)(f.tx)&&(I.tx=(0,w.bytesFromBase64)(f.tx)),I},toJSON(f){const I={};return f.tx!==void 0&&(I.tx=(0,w.base64FromBytes)(f.tx!==void 0?f.tx:new Uint8Array)),I},fromPartial(f){const I=T();return I.tx=f.tx??new Uint8Array,I}};function Q(){return{height:BigInt(0)}}e.RequestEndBlock={typeUrl:"/tendermint.abci.RequestEndBlock",encode(f,I=C.BinaryWriter.create()){return f.height!==BigInt(0)&&I.uint32(8).int64(f.height),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=Q();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.height=V.int64();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=Q();return(0,w.isSet)(f.height)&&(I.height=BigInt(f.height.toString())),I},toJSON(f){const I={};return f.height!==void 0&&(I.height=(f.height||BigInt(0)).toString()),I},fromPartial(f){const I=Q();return f.height!==void 0&&f.height!==null&&(I.height=BigInt(f.height.toString())),I}};function H(){return{}}e.RequestCommit={typeUrl:"/tendermint.abci.RequestCommit",encode(f,I=C.BinaryWriter.create()){return I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=H();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){default:V.skipType(z&7);break}}return G},fromJSON(f){return H()},toJSON(f){return{}},fromPartial(f){return H()}};function a(){return{}}e.RequestListSnapshots={typeUrl:"/tendermint.abci.RequestListSnapshots",encode(f,I=C.BinaryWriter.create()){return I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=a();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){default:V.skipType(z&7);break}}return G},fromJSON(f){return a()},toJSON(f){return{}},fromPartial(f){return a()}};function P(){return{snapshot:void 0,appHash:new Uint8Array}}e.RequestOfferSnapshot={typeUrl:"/tendermint.abci.RequestOfferSnapshot",encode(f,I=C.BinaryWriter.create()){return f.snapshot!==void 0&&e.Snapshot.encode(f.snapshot,I.uint32(10).fork()).ldelim(),f.appHash.length!==0&&I.uint32(18).bytes(f.appHash),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=P();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.snapshot=e.Snapshot.decode(V,V.uint32());break;case 2:G.appHash=V.bytes();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=P();return(0,w.isSet)(f.snapshot)&&(I.snapshot=e.Snapshot.fromJSON(f.snapshot)),(0,w.isSet)(f.appHash)&&(I.appHash=(0,w.bytesFromBase64)(f.appHash)),I},toJSON(f){const I={};return f.snapshot!==void 0&&(I.snapshot=f.snapshot?e.Snapshot.toJSON(f.snapshot):void 0),f.appHash!==void 0&&(I.appHash=(0,w.base64FromBytes)(f.appHash!==void 0?f.appHash:new Uint8Array)),I},fromPartial(f){const I=P();return f.snapshot!==void 0&&f.snapshot!==null&&(I.snapshot=e.Snapshot.fromPartial(f.snapshot)),I.appHash=f.appHash??new Uint8Array,I}};function k(){return{height:BigInt(0),format:0,chunk:0}}e.RequestLoadSnapshotChunk={typeUrl:"/tendermint.abci.RequestLoadSnapshotChunk",encode(f,I=C.BinaryWriter.create()){return f.height!==BigInt(0)&&I.uint32(8).uint64(f.height),f.format!==0&&I.uint32(16).uint32(f.format),f.chunk!==0&&I.uint32(24).uint32(f.chunk),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=k();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.height=V.uint64();break;case 2:G.format=V.uint32();break;case 3:G.chunk=V.uint32();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=k();return(0,w.isSet)(f.height)&&(I.height=BigInt(f.height.toString())),(0,w.isSet)(f.format)&&(I.format=Number(f.format)),(0,w.isSet)(f.chunk)&&(I.chunk=Number(f.chunk)),I},toJSON(f){const I={};return f.height!==void 0&&(I.height=(f.height||BigInt(0)).toString()),f.format!==void 0&&(I.format=Math.round(f.format)),f.chunk!==void 0&&(I.chunk=Math.round(f.chunk)),I},fromPartial(f){const I=k();return f.height!==void 0&&f.height!==null&&(I.height=BigInt(f.height.toString())),I.format=f.format??0,I.chunk=f.chunk??0,I}};function v(){return{index:0,chunk:new Uint8Array,sender:""}}e.RequestApplySnapshotChunk={typeUrl:"/tendermint.abci.RequestApplySnapshotChunk",encode(f,I=C.BinaryWriter.create()){return f.index!==0&&I.uint32(8).uint32(f.index),f.chunk.length!==0&&I.uint32(18).bytes(f.chunk),f.sender!==""&&I.uint32(26).string(f.sender),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=v();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.index=V.uint32();break;case 2:G.chunk=V.bytes();break;case 3:G.sender=V.string();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=v();return(0,w.isSet)(f.index)&&(I.index=Number(f.index)),(0,w.isSet)(f.chunk)&&(I.chunk=(0,w.bytesFromBase64)(f.chunk)),(0,w.isSet)(f.sender)&&(I.sender=String(f.sender)),I},toJSON(f){const I={};return f.index!==void 0&&(I.index=Math.round(f.index)),f.chunk!==void 0&&(I.chunk=(0,w.base64FromBytes)(f.chunk!==void 0?f.chunk:new Uint8Array)),f.sender!==void 0&&(I.sender=f.sender),I},fromPartial(f){const I=v();return I.index=f.index??0,I.chunk=f.chunk??new Uint8Array,I.sender=f.sender??"",I}};function A(){return{maxTxBytes:BigInt(0),txs:[],localLastCommit:e.ExtendedCommitInfo.fromPartial({}),misbehavior:[],height:BigInt(0),time:n.Timestamp.fromPartial({}),nextValidatorsHash:new Uint8Array,proposerAddress:new Uint8Array}}e.RequestPrepareProposal={typeUrl:"/tendermint.abci.RequestPrepareProposal",encode(f,I=C.BinaryWriter.create()){f.maxTxBytes!==BigInt(0)&&I.uint32(8).int64(f.maxTxBytes);for(const V of f.txs)I.uint32(18).bytes(V);f.localLastCommit!==void 0&&e.ExtendedCommitInfo.encode(f.localLastCommit,I.uint32(26).fork()).ldelim();for(const V of f.misbehavior)e.Misbehavior.encode(V,I.uint32(34).fork()).ldelim();return f.height!==BigInt(0)&&I.uint32(40).int64(f.height),f.time!==void 0&&n.Timestamp.encode(f.time,I.uint32(50).fork()).ldelim(),f.nextValidatorsHash.length!==0&&I.uint32(58).bytes(f.nextValidatorsHash),f.proposerAddress.length!==0&&I.uint32(66).bytes(f.proposerAddress),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=A();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.maxTxBytes=V.int64();break;case 2:G.txs.push(V.bytes());break;case 3:G.localLastCommit=e.ExtendedCommitInfo.decode(V,V.uint32());break;case 4:G.misbehavior.push(e.Misbehavior.decode(V,V.uint32()));break;case 5:G.height=V.int64();break;case 6:G.time=n.Timestamp.decode(V,V.uint32());break;case 7:G.nextValidatorsHash=V.bytes();break;case 8:G.proposerAddress=V.bytes();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=A();return(0,w.isSet)(f.maxTxBytes)&&(I.maxTxBytes=BigInt(f.maxTxBytes.toString())),Array.isArray(f==null?void 0:f.txs)&&(I.txs=f.txs.map(V=>(0,w.bytesFromBase64)(V))),(0,w.isSet)(f.localLastCommit)&&(I.localLastCommit=e.ExtendedCommitInfo.fromJSON(f.localLastCommit)),Array.isArray(f==null?void 0:f.misbehavior)&&(I.misbehavior=f.misbehavior.map(V=>e.Misbehavior.fromJSON(V))),(0,w.isSet)(f.height)&&(I.height=BigInt(f.height.toString())),(0,w.isSet)(f.time)&&(I.time=(0,w.fromJsonTimestamp)(f.time)),(0,w.isSet)(f.nextValidatorsHash)&&(I.nextValidatorsHash=(0,w.bytesFromBase64)(f.nextValidatorsHash)),(0,w.isSet)(f.proposerAddress)&&(I.proposerAddress=(0,w.bytesFromBase64)(f.proposerAddress)),I},toJSON(f){const I={};return f.maxTxBytes!==void 0&&(I.maxTxBytes=(f.maxTxBytes||BigInt(0)).toString()),f.txs?I.txs=f.txs.map(V=>(0,w.base64FromBytes)(V!==void 0?V:new Uint8Array)):I.txs=[],f.localLastCommit!==void 0&&(I.localLastCommit=f.localLastCommit?e.ExtendedCommitInfo.toJSON(f.localLastCommit):void 0),f.misbehavior?I.misbehavior=f.misbehavior.map(V=>V?e.Misbehavior.toJSON(V):void 0):I.misbehavior=[],f.height!==void 0&&(I.height=(f.height||BigInt(0)).toString()),f.time!==void 0&&(I.time=(0,w.fromTimestamp)(f.time).toISOString()),f.nextValidatorsHash!==void 0&&(I.nextValidatorsHash=(0,w.base64FromBytes)(f.nextValidatorsHash!==void 0?f.nextValidatorsHash:new Uint8Array)),f.proposerAddress!==void 0&&(I.proposerAddress=(0,w.base64FromBytes)(f.proposerAddress!==void 0?f.proposerAddress:new Uint8Array)),I},fromPartial(f){var V,x;const I=A();return f.maxTxBytes!==void 0&&f.maxTxBytes!==null&&(I.maxTxBytes=BigInt(f.maxTxBytes.toString())),I.txs=((V=f.txs)==null?void 0:V.map(G=>G))||[],f.localLastCommit!==void 0&&f.localLastCommit!==null&&(I.localLastCommit=e.ExtendedCommitInfo.fromPartial(f.localLastCommit)),I.misbehavior=((x=f.misbehavior)==null?void 0:x.map(G=>e.Misbehavior.fromPartial(G)))||[],f.height!==void 0&&f.height!==null&&(I.height=BigInt(f.height.toString())),f.time!==void 0&&f.time!==null&&(I.time=n.Timestamp.fromPartial(f.time)),I.nextValidatorsHash=f.nextValidatorsHash??new Uint8Array,I.proposerAddress=f.proposerAddress??new Uint8Array,I}};function F(){return{txs:[],proposedLastCommit:e.CommitInfo.fromPartial({}),misbehavior:[],hash:new Uint8Array,height:BigInt(0),time:n.Timestamp.fromPartial({}),nextValidatorsHash:new Uint8Array,proposerAddress:new Uint8Array}}e.RequestProcessProposal={typeUrl:"/tendermint.abci.RequestProcessProposal",encode(f,I=C.BinaryWriter.create()){for(const V of f.txs)I.uint32(10).bytes(V);f.proposedLastCommit!==void 0&&e.CommitInfo.encode(f.proposedLastCommit,I.uint32(18).fork()).ldelim();for(const V of f.misbehavior)e.Misbehavior.encode(V,I.uint32(26).fork()).ldelim();return f.hash.length!==0&&I.uint32(34).bytes(f.hash),f.height!==BigInt(0)&&I.uint32(40).int64(f.height),f.time!==void 0&&n.Timestamp.encode(f.time,I.uint32(50).fork()).ldelim(),f.nextValidatorsHash.length!==0&&I.uint32(58).bytes(f.nextValidatorsHash),f.proposerAddress.length!==0&&I.uint32(66).bytes(f.proposerAddress),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=F();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.txs.push(V.bytes());break;case 2:G.proposedLastCommit=e.CommitInfo.decode(V,V.uint32());break;case 3:G.misbehavior.push(e.Misbehavior.decode(V,V.uint32()));break;case 4:G.hash=V.bytes();break;case 5:G.height=V.int64();break;case 6:G.time=n.Timestamp.decode(V,V.uint32());break;case 7:G.nextValidatorsHash=V.bytes();break;case 8:G.proposerAddress=V.bytes();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=F();return Array.isArray(f==null?void 0:f.txs)&&(I.txs=f.txs.map(V=>(0,w.bytesFromBase64)(V))),(0,w.isSet)(f.proposedLastCommit)&&(I.proposedLastCommit=e.CommitInfo.fromJSON(f.proposedLastCommit)),Array.isArray(f==null?void 0:f.misbehavior)&&(I.misbehavior=f.misbehavior.map(V=>e.Misbehavior.fromJSON(V))),(0,w.isSet)(f.hash)&&(I.hash=(0,w.bytesFromBase64)(f.hash)),(0,w.isSet)(f.height)&&(I.height=BigInt(f.height.toString())),(0,w.isSet)(f.time)&&(I.time=(0,w.fromJsonTimestamp)(f.time)),(0,w.isSet)(f.nextValidatorsHash)&&(I.nextValidatorsHash=(0,w.bytesFromBase64)(f.nextValidatorsHash)),(0,w.isSet)(f.proposerAddress)&&(I.proposerAddress=(0,w.bytesFromBase64)(f.proposerAddress)),I},toJSON(f){const I={};return f.txs?I.txs=f.txs.map(V=>(0,w.base64FromBytes)(V!==void 0?V:new Uint8Array)):I.txs=[],f.proposedLastCommit!==void 0&&(I.proposedLastCommit=f.proposedLastCommit?e.CommitInfo.toJSON(f.proposedLastCommit):void 0),f.misbehavior?I.misbehavior=f.misbehavior.map(V=>V?e.Misbehavior.toJSON(V):void 0):I.misbehavior=[],f.hash!==void 0&&(I.hash=(0,w.base64FromBytes)(f.hash!==void 0?f.hash:new Uint8Array)),f.height!==void 0&&(I.height=(f.height||BigInt(0)).toString()),f.time!==void 0&&(I.time=(0,w.fromTimestamp)(f.time).toISOString()),f.nextValidatorsHash!==void 0&&(I.nextValidatorsHash=(0,w.base64FromBytes)(f.nextValidatorsHash!==void 0?f.nextValidatorsHash:new Uint8Array)),f.proposerAddress!==void 0&&(I.proposerAddress=(0,w.base64FromBytes)(f.proposerAddress!==void 0?f.proposerAddress:new Uint8Array)),I},fromPartial(f){var V,x;const I=F();return I.txs=((V=f.txs)==null?void 0:V.map(G=>G))||[],f.proposedLastCommit!==void 0&&f.proposedLastCommit!==null&&(I.proposedLastCommit=e.CommitInfo.fromPartial(f.proposedLastCommit)),I.misbehavior=((x=f.misbehavior)==null?void 0:x.map(G=>e.Misbehavior.fromPartial(G)))||[],I.hash=f.hash??new Uint8Array,f.height!==void 0&&f.height!==null&&(I.height=BigInt(f.height.toString())),f.time!==void 0&&f.time!==null&&(I.time=n.Timestamp.fromPartial(f.time)),I.nextValidatorsHash=f.nextValidatorsHash??new Uint8Array,I.proposerAddress=f.proposerAddress??new Uint8Array,I}};function K(){return{exception:void 0,echo:void 0,flush:void 0,info:void 0,initChain:void 0,query:void 0,beginBlock:void 0,checkTx:void 0,deliverTx:void 0,endBlock:void 0,commit:void 0,listSnapshots:void 0,offerSnapshot:void 0,loadSnapshotChunk:void 0,applySnapshotChunk:void 0,prepareProposal:void 0,processProposal:void 0}}e.Response={typeUrl:"/tendermint.abci.Response",encode(f,I=C.BinaryWriter.create()){return f.exception!==void 0&&e.ResponseException.encode(f.exception,I.uint32(10).fork()).ldelim(),f.echo!==void 0&&e.ResponseEcho.encode(f.echo,I.uint32(18).fork()).ldelim(),f.flush!==void 0&&e.ResponseFlush.encode(f.flush,I.uint32(26).fork()).ldelim(),f.info!==void 0&&e.ResponseInfo.encode(f.info,I.uint32(34).fork()).ldelim(),f.initChain!==void 0&&e.ResponseInitChain.encode(f.initChain,I.uint32(50).fork()).ldelim(),f.query!==void 0&&e.ResponseQuery.encode(f.query,I.uint32(58).fork()).ldelim(),f.beginBlock!==void 0&&e.ResponseBeginBlock.encode(f.beginBlock,I.uint32(66).fork()).ldelim(),f.checkTx!==void 0&&e.ResponseCheckTx.encode(f.checkTx,I.uint32(74).fork()).ldelim(),f.deliverTx!==void 0&&e.ResponseDeliverTx.encode(f.deliverTx,I.uint32(82).fork()).ldelim(),f.endBlock!==void 0&&e.ResponseEndBlock.encode(f.endBlock,I.uint32(90).fork()).ldelim(),f.commit!==void 0&&e.ResponseCommit.encode(f.commit,I.uint32(98).fork()).ldelim(),f.listSnapshots!==void 0&&e.ResponseListSnapshots.encode(f.listSnapshots,I.uint32(106).fork()).ldelim(),f.offerSnapshot!==void 0&&e.ResponseOfferSnapshot.encode(f.offerSnapshot,I.uint32(114).fork()).ldelim(),f.loadSnapshotChunk!==void 0&&e.ResponseLoadSnapshotChunk.encode(f.loadSnapshotChunk,I.uint32(122).fork()).ldelim(),f.applySnapshotChunk!==void 0&&e.ResponseApplySnapshotChunk.encode(f.applySnapshotChunk,I.uint32(130).fork()).ldelim(),f.prepareProposal!==void 0&&e.ResponsePrepareProposal.encode(f.prepareProposal,I.uint32(138).fork()).ldelim(),f.processProposal!==void 0&&e.ResponseProcessProposal.encode(f.processProposal,I.uint32(146).fork()).ldelim(),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=K();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.exception=e.ResponseException.decode(V,V.uint32());break;case 2:G.echo=e.ResponseEcho.decode(V,V.uint32());break;case 3:G.flush=e.ResponseFlush.decode(V,V.uint32());break;case 4:G.info=e.ResponseInfo.decode(V,V.uint32());break;case 6:G.initChain=e.ResponseInitChain.decode(V,V.uint32());break;case 7:G.query=e.ResponseQuery.decode(V,V.uint32());break;case 8:G.beginBlock=e.ResponseBeginBlock.decode(V,V.uint32());break;case 9:G.checkTx=e.ResponseCheckTx.decode(V,V.uint32());break;case 10:G.deliverTx=e.ResponseDeliverTx.decode(V,V.uint32());break;case 11:G.endBlock=e.ResponseEndBlock.decode(V,V.uint32());break;case 12:G.commit=e.ResponseCommit.decode(V,V.uint32());break;case 13:G.listSnapshots=e.ResponseListSnapshots.decode(V,V.uint32());break;case 14:G.offerSnapshot=e.ResponseOfferSnapshot.decode(V,V.uint32());break;case 15:G.loadSnapshotChunk=e.ResponseLoadSnapshotChunk.decode(V,V.uint32());break;case 16:G.applySnapshotChunk=e.ResponseApplySnapshotChunk.decode(V,V.uint32());break;case 17:G.prepareProposal=e.ResponsePrepareProposal.decode(V,V.uint32());break;case 18:G.processProposal=e.ResponseProcessProposal.decode(V,V.uint32());break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=K();return(0,w.isSet)(f.exception)&&(I.exception=e.ResponseException.fromJSON(f.exception)),(0,w.isSet)(f.echo)&&(I.echo=e.ResponseEcho.fromJSON(f.echo)),(0,w.isSet)(f.flush)&&(I.flush=e.ResponseFlush.fromJSON(f.flush)),(0,w.isSet)(f.info)&&(I.info=e.ResponseInfo.fromJSON(f.info)),(0,w.isSet)(f.initChain)&&(I.initChain=e.ResponseInitChain.fromJSON(f.initChain)),(0,w.isSet)(f.query)&&(I.query=e.ResponseQuery.fromJSON(f.query)),(0,w.isSet)(f.beginBlock)&&(I.beginBlock=e.ResponseBeginBlock.fromJSON(f.beginBlock)),(0,w.isSet)(f.checkTx)&&(I.checkTx=e.ResponseCheckTx.fromJSON(f.checkTx)),(0,w.isSet)(f.deliverTx)&&(I.deliverTx=e.ResponseDeliverTx.fromJSON(f.deliverTx)),(0,w.isSet)(f.endBlock)&&(I.endBlock=e.ResponseEndBlock.fromJSON(f.endBlock)),(0,w.isSet)(f.commit)&&(I.commit=e.ResponseCommit.fromJSON(f.commit)),(0,w.isSet)(f.listSnapshots)&&(I.listSnapshots=e.ResponseListSnapshots.fromJSON(f.listSnapshots)),(0,w.isSet)(f.offerSnapshot)&&(I.offerSnapshot=e.ResponseOfferSnapshot.fromJSON(f.offerSnapshot)),(0,w.isSet)(f.loadSnapshotChunk)&&(I.loadSnapshotChunk=e.ResponseLoadSnapshotChunk.fromJSON(f.loadSnapshotChunk)),(0,w.isSet)(f.applySnapshotChunk)&&(I.applySnapshotChunk=e.ResponseApplySnapshotChunk.fromJSON(f.applySnapshotChunk)),(0,w.isSet)(f.prepareProposal)&&(I.prepareProposal=e.ResponsePrepareProposal.fromJSON(f.prepareProposal)),(0,w.isSet)(f.processProposal)&&(I.processProposal=e.ResponseProcessProposal.fromJSON(f.processProposal)),I},toJSON(f){const I={};return f.exception!==void 0&&(I.exception=f.exception?e.ResponseException.toJSON(f.exception):void 0),f.echo!==void 0&&(I.echo=f.echo?e.ResponseEcho.toJSON(f.echo):void 0),f.flush!==void 0&&(I.flush=f.flush?e.ResponseFlush.toJSON(f.flush):void 0),f.info!==void 0&&(I.info=f.info?e.ResponseInfo.toJSON(f.info):void 0),f.initChain!==void 0&&(I.initChain=f.initChain?e.ResponseInitChain.toJSON(f.initChain):void 0),f.query!==void 0&&(I.query=f.query?e.ResponseQuery.toJSON(f.query):void 0),f.beginBlock!==void 0&&(I.beginBlock=f.beginBlock?e.ResponseBeginBlock.toJSON(f.beginBlock):void 0),f.checkTx!==void 0&&(I.checkTx=f.checkTx?e.ResponseCheckTx.toJSON(f.checkTx):void 0),f.deliverTx!==void 0&&(I.deliverTx=f.deliverTx?e.ResponseDeliverTx.toJSON(f.deliverTx):void 0),f.endBlock!==void 0&&(I.endBlock=f.endBlock?e.ResponseEndBlock.toJSON(f.endBlock):void 0),f.commit!==void 0&&(I.commit=f.commit?e.ResponseCommit.toJSON(f.commit):void 0),f.listSnapshots!==void 0&&(I.listSnapshots=f.listSnapshots?e.ResponseListSnapshots.toJSON(f.listSnapshots):void 0),f.offerSnapshot!==void 0&&(I.offerSnapshot=f.offerSnapshot?e.ResponseOfferSnapshot.toJSON(f.offerSnapshot):void 0),f.loadSnapshotChunk!==void 0&&(I.loadSnapshotChunk=f.loadSnapshotChunk?e.ResponseLoadSnapshotChunk.toJSON(f.loadSnapshotChunk):void 0),f.applySnapshotChunk!==void 0&&(I.applySnapshotChunk=f.applySnapshotChunk?e.ResponseApplySnapshotChunk.toJSON(f.applySnapshotChunk):void 0),f.prepareProposal!==void 0&&(I.prepareProposal=f.prepareProposal?e.ResponsePrepareProposal.toJSON(f.prepareProposal):void 0),f.processProposal!==void 0&&(I.processProposal=f.processProposal?e.ResponseProcessProposal.toJSON(f.processProposal):void 0),I},fromPartial(f){const I=K();return f.exception!==void 0&&f.exception!==null&&(I.exception=e.ResponseException.fromPartial(f.exception)),f.echo!==void 0&&f.echo!==null&&(I.echo=e.ResponseEcho.fromPartial(f.echo)),f.flush!==void 0&&f.flush!==null&&(I.flush=e.ResponseFlush.fromPartial(f.flush)),f.info!==void 0&&f.info!==null&&(I.info=e.ResponseInfo.fromPartial(f.info)),f.initChain!==void 0&&f.initChain!==null&&(I.initChain=e.ResponseInitChain.fromPartial(f.initChain)),f.query!==void 0&&f.query!==null&&(I.query=e.ResponseQuery.fromPartial(f.query)),f.beginBlock!==void 0&&f.beginBlock!==null&&(I.beginBlock=e.ResponseBeginBlock.fromPartial(f.beginBlock)),f.checkTx!==void 0&&f.checkTx!==null&&(I.checkTx=e.ResponseCheckTx.fromPartial(f.checkTx)),f.deliverTx!==void 0&&f.deliverTx!==null&&(I.deliverTx=e.ResponseDeliverTx.fromPartial(f.deliverTx)),f.endBlock!==void 0&&f.endBlock!==null&&(I.endBlock=e.ResponseEndBlock.fromPartial(f.endBlock)),f.commit!==void 0&&f.commit!==null&&(I.commit=e.ResponseCommit.fromPartial(f.commit)),f.listSnapshots!==void 0&&f.listSnapshots!==null&&(I.listSnapshots=e.ResponseListSnapshots.fromPartial(f.listSnapshots)),f.offerSnapshot!==void 0&&f.offerSnapshot!==null&&(I.offerSnapshot=e.ResponseOfferSnapshot.fromPartial(f.offerSnapshot)),f.loadSnapshotChunk!==void 0&&f.loadSnapshotChunk!==null&&(I.loadSnapshotChunk=e.ResponseLoadSnapshotChunk.fromPartial(f.loadSnapshotChunk)),f.applySnapshotChunk!==void 0&&f.applySnapshotChunk!==null&&(I.applySnapshotChunk=e.ResponseApplySnapshotChunk.fromPartial(f.applySnapshotChunk)),f.prepareProposal!==void 0&&f.prepareProposal!==null&&(I.prepareProposal=e.ResponsePrepareProposal.fromPartial(f.prepareProposal)),f.processProposal!==void 0&&f.processProposal!==null&&(I.processProposal=e.ResponseProcessProposal.fromPartial(f.processProposal)),I}};function $(){return{error:""}}e.ResponseException={typeUrl:"/tendermint.abci.ResponseException",encode(f,I=C.BinaryWriter.create()){return f.error!==""&&I.uint32(10).string(f.error),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=$();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.error=V.string();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=$();return(0,w.isSet)(f.error)&&(I.error=String(f.error)),I},toJSON(f){const I={};return f.error!==void 0&&(I.error=f.error),I},fromPartial(f){const I=$();return I.error=f.error??"",I}};function j(){return{message:""}}e.ResponseEcho={typeUrl:"/tendermint.abci.ResponseEcho",encode(f,I=C.BinaryWriter.create()){return f.message!==""&&I.uint32(10).string(f.message),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=j();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.message=V.string();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=j();return(0,w.isSet)(f.message)&&(I.message=String(f.message)),I},toJSON(f){const I={};return f.message!==void 0&&(I.message=f.message),I},fromPartial(f){const I=j();return I.message=f.message??"",I}};function Zs(){return{}}e.ResponseFlush={typeUrl:"/tendermint.abci.ResponseFlush",encode(f,I=C.BinaryWriter.create()){return I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=Zs();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){default:V.skipType(z&7);break}}return G},fromJSON(f){return Zs()},toJSON(f){return{}},fromPartial(f){return Zs()}};function Xs(){return{data:"",version:"",appVersion:BigInt(0),lastBlockHeight:BigInt(0),lastBlockAppHash:new Uint8Array}}e.ResponseInfo={typeUrl:"/tendermint.abci.ResponseInfo",encode(f,I=C.BinaryWriter.create()){return f.data!==""&&I.uint32(10).string(f.data),f.version!==""&&I.uint32(18).string(f.version),f.appVersion!==BigInt(0)&&I.uint32(24).uint64(f.appVersion),f.lastBlockHeight!==BigInt(0)&&I.uint32(32).int64(f.lastBlockHeight),f.lastBlockAppHash.length!==0&&I.uint32(42).bytes(f.lastBlockAppHash),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=Xs();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.data=V.string();break;case 2:G.version=V.string();break;case 3:G.appVersion=V.uint64();break;case 4:G.lastBlockHeight=V.int64();break;case 5:G.lastBlockAppHash=V.bytes();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=Xs();return(0,w.isSet)(f.data)&&(I.data=String(f.data)),(0,w.isSet)(f.version)&&(I.version=String(f.version)),(0,w.isSet)(f.appVersion)&&(I.appVersion=BigInt(f.appVersion.toString())),(0,w.isSet)(f.lastBlockHeight)&&(I.lastBlockHeight=BigInt(f.lastBlockHeight.toString())),(0,w.isSet)(f.lastBlockAppHash)&&(I.lastBlockAppHash=(0,w.bytesFromBase64)(f.lastBlockAppHash)),I},toJSON(f){const I={};return f.data!==void 0&&(I.data=f.data),f.version!==void 0&&(I.version=f.version),f.appVersion!==void 0&&(I.appVersion=(f.appVersion||BigInt(0)).toString()),f.lastBlockHeight!==void 0&&(I.lastBlockHeight=(f.lastBlockHeight||BigInt(0)).toString()),f.lastBlockAppHash!==void 0&&(I.lastBlockAppHash=(0,w.base64FromBytes)(f.lastBlockAppHash!==void 0?f.lastBlockAppHash:new Uint8Array)),I},fromPartial(f){const I=Xs();return I.data=f.data??"",I.version=f.version??"",f.appVersion!==void 0&&f.appVersion!==null&&(I.appVersion=BigInt(f.appVersion.toString())),f.lastBlockHeight!==void 0&&f.lastBlockHeight!==null&&(I.lastBlockHeight=BigInt(f.lastBlockHeight.toString())),I.lastBlockAppHash=f.lastBlockAppHash??new Uint8Array,I}};function js(){return{consensusParams:void 0,validators:[],appHash:new Uint8Array}}e.ResponseInitChain={typeUrl:"/tendermint.abci.ResponseInitChain",encode(f,I=C.BinaryWriter.create()){f.consensusParams!==void 0&&t.ConsensusParams.encode(f.consensusParams,I.uint32(10).fork()).ldelim();for(const V of f.validators)e.ValidatorUpdate.encode(V,I.uint32(18).fork()).ldelim();return f.appHash.length!==0&&I.uint32(26).bytes(f.appHash),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=js();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.consensusParams=t.ConsensusParams.decode(V,V.uint32());break;case 2:G.validators.push(e.ValidatorUpdate.decode(V,V.uint32()));break;case 3:G.appHash=V.bytes();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=js();return(0,w.isSet)(f.consensusParams)&&(I.consensusParams=t.ConsensusParams.fromJSON(f.consensusParams)),Array.isArray(f==null?void 0:f.validators)&&(I.validators=f.validators.map(V=>e.ValidatorUpdate.fromJSON(V))),(0,w.isSet)(f.appHash)&&(I.appHash=(0,w.bytesFromBase64)(f.appHash)),I},toJSON(f){const I={};return f.consensusParams!==void 0&&(I.consensusParams=f.consensusParams?t.ConsensusParams.toJSON(f.consensusParams):void 0),f.validators?I.validators=f.validators.map(V=>V?e.ValidatorUpdate.toJSON(V):void 0):I.validators=[],f.appHash!==void 0&&(I.appHash=(0,w.base64FromBytes)(f.appHash!==void 0?f.appHash:new Uint8Array)),I},fromPartial(f){var V;const I=js();return f.consensusParams!==void 0&&f.consensusParams!==null&&(I.consensusParams=t.ConsensusParams.fromPartial(f.consensusParams)),I.validators=((V=f.validators)==null?void 0:V.map(x=>e.ValidatorUpdate.fromPartial(x)))||[],I.appHash=f.appHash??new Uint8Array,I}};function ed(){return{code:0,log:"",info:"",index:BigInt(0),key:new Uint8Array,value:new Uint8Array,proofOps:void 0,height:BigInt(0),codespace:""}}e.ResponseQuery={typeUrl:"/tendermint.abci.ResponseQuery",encode(f,I=C.BinaryWriter.create()){return f.code!==0&&I.uint32(8).uint32(f.code),f.log!==""&&I.uint32(26).string(f.log),f.info!==""&&I.uint32(34).string(f.info),f.index!==BigInt(0)&&I.uint32(40).int64(f.index),f.key.length!==0&&I.uint32(50).bytes(f.key),f.value.length!==0&&I.uint32(58).bytes(f.value),f.proofOps!==void 0&&o.ProofOps.encode(f.proofOps,I.uint32(66).fork()).ldelim(),f.height!==BigInt(0)&&I.uint32(72).int64(f.height),f.codespace!==""&&I.uint32(82).string(f.codespace),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=ed();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.code=V.uint32();break;case 3:G.log=V.string();break;case 4:G.info=V.string();break;case 5:G.index=V.int64();break;case 6:G.key=V.bytes();break;case 7:G.value=V.bytes();break;case 8:G.proofOps=o.ProofOps.decode(V,V.uint32());break;case 9:G.height=V.int64();break;case 10:G.codespace=V.string();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=ed();return(0,w.isSet)(f.code)&&(I.code=Number(f.code)),(0,w.isSet)(f.log)&&(I.log=String(f.log)),(0,w.isSet)(f.info)&&(I.info=String(f.info)),(0,w.isSet)(f.index)&&(I.index=BigInt(f.index.toString())),(0,w.isSet)(f.key)&&(I.key=(0,w.bytesFromBase64)(f.key)),(0,w.isSet)(f.value)&&(I.value=(0,w.bytesFromBase64)(f.value)),(0,w.isSet)(f.proofOps)&&(I.proofOps=o.ProofOps.fromJSON(f.proofOps)),(0,w.isSet)(f.height)&&(I.height=BigInt(f.height.toString())),(0,w.isSet)(f.codespace)&&(I.codespace=String(f.codespace)),I},toJSON(f){const I={};return f.code!==void 0&&(I.code=Math.round(f.code)),f.log!==void 0&&(I.log=f.log),f.info!==void 0&&(I.info=f.info),f.index!==void 0&&(I.index=(f.index||BigInt(0)).toString()),f.key!==void 0&&(I.key=(0,w.base64FromBytes)(f.key!==void 0?f.key:new Uint8Array)),f.value!==void 0&&(I.value=(0,w.base64FromBytes)(f.value!==void 0?f.value:new Uint8Array)),f.proofOps!==void 0&&(I.proofOps=f.proofOps?o.ProofOps.toJSON(f.proofOps):void 0),f.height!==void 0&&(I.height=(f.height||BigInt(0)).toString()),f.codespace!==void 0&&(I.codespace=f.codespace),I},fromPartial(f){const I=ed();return I.code=f.code??0,I.log=f.log??"",I.info=f.info??"",f.index!==void 0&&f.index!==null&&(I.index=BigInt(f.index.toString())),I.key=f.key??new Uint8Array,I.value=f.value??new Uint8Array,f.proofOps!==void 0&&f.proofOps!==null&&(I.proofOps=o.ProofOps.fromPartial(f.proofOps)),f.height!==void 0&&f.height!==null&&(I.height=BigInt(f.height.toString())),I.codespace=f.codespace??"",I}};function nd(){return{events:[]}}e.ResponseBeginBlock={typeUrl:"/tendermint.abci.ResponseBeginBlock",encode(f,I=C.BinaryWriter.create()){for(const V of f.events)e.Event.encode(V,I.uint32(10).fork()).ldelim();return I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=nd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.events.push(e.Event.decode(V,V.uint32()));break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=nd();return Array.isArray(f==null?void 0:f.events)&&(I.events=f.events.map(V=>e.Event.fromJSON(V))),I},toJSON(f){const I={};return f.events?I.events=f.events.map(V=>V?e.Event.toJSON(V):void 0):I.events=[],I},fromPartial(f){var V;const I=nd();return I.events=((V=f.events)==null?void 0:V.map(x=>e.Event.fromPartial(x)))||[],I}};function td(){return{code:0,data:new Uint8Array,log:"",info:"",gasWanted:BigInt(0),gasUsed:BigInt(0),events:[],codespace:"",sender:"",priority:BigInt(0),mempoolError:""}}e.ResponseCheckTx={typeUrl:"/tendermint.abci.ResponseCheckTx",encode(f,I=C.BinaryWriter.create()){f.code!==0&&I.uint32(8).uint32(f.code),f.data.length!==0&&I.uint32(18).bytes(f.data),f.log!==""&&I.uint32(26).string(f.log),f.info!==""&&I.uint32(34).string(f.info),f.gasWanted!==BigInt(0)&&I.uint32(40).int64(f.gasWanted),f.gasUsed!==BigInt(0)&&I.uint32(48).int64(f.gasUsed);for(const V of f.events)e.Event.encode(V,I.uint32(58).fork()).ldelim();return f.codespace!==""&&I.uint32(66).string(f.codespace),f.sender!==""&&I.uint32(74).string(f.sender),f.priority!==BigInt(0)&&I.uint32(80).int64(f.priority),f.mempoolError!==""&&I.uint32(90).string(f.mempoolError),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=td();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.code=V.uint32();break;case 2:G.data=V.bytes();break;case 3:G.log=V.string();break;case 4:G.info=V.string();break;case 5:G.gasWanted=V.int64();break;case 6:G.gasUsed=V.int64();break;case 7:G.events.push(e.Event.decode(V,V.uint32()));break;case 8:G.codespace=V.string();break;case 9:G.sender=V.string();break;case 10:G.priority=V.int64();break;case 11:G.mempoolError=V.string();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=td();return(0,w.isSet)(f.code)&&(I.code=Number(f.code)),(0,w.isSet)(f.data)&&(I.data=(0,w.bytesFromBase64)(f.data)),(0,w.isSet)(f.log)&&(I.log=String(f.log)),(0,w.isSet)(f.info)&&(I.info=String(f.info)),(0,w.isSet)(f.gas_wanted)&&(I.gasWanted=BigInt(f.gas_wanted.toString())),(0,w.isSet)(f.gas_used)&&(I.gasUsed=BigInt(f.gas_used.toString())),Array.isArray(f==null?void 0:f.events)&&(I.events=f.events.map(V=>e.Event.fromJSON(V))),(0,w.isSet)(f.codespace)&&(I.codespace=String(f.codespace)),(0,w.isSet)(f.sender)&&(I.sender=String(f.sender)),(0,w.isSet)(f.priority)&&(I.priority=BigInt(f.priority.toString())),(0,w.isSet)(f.mempoolError)&&(I.mempoolError=String(f.mempoolError)),I},toJSON(f){const I={};return f.code!==void 0&&(I.code=Math.round(f.code)),f.data!==void 0&&(I.data=(0,w.base64FromBytes)(f.data!==void 0?f.data:new Uint8Array)),f.log!==void 0&&(I.log=f.log),f.info!==void 0&&(I.info=f.info),f.gasWanted!==void 0&&(I.gas_wanted=(f.gasWanted||BigInt(0)).toString()),f.gasUsed!==void 0&&(I.gas_used=(f.gasUsed||BigInt(0)).toString()),f.events?I.events=f.events.map(V=>V?e.Event.toJSON(V):void 0):I.events=[],f.codespace!==void 0&&(I.codespace=f.codespace),f.sender!==void 0&&(I.sender=f.sender),f.priority!==void 0&&(I.priority=(f.priority||BigInt(0)).toString()),f.mempoolError!==void 0&&(I.mempoolError=f.mempoolError),I},fromPartial(f){var V;const I=td();return I.code=f.code??0,I.data=f.data??new Uint8Array,I.log=f.log??"",I.info=f.info??"",f.gasWanted!==void 0&&f.gasWanted!==null&&(I.gasWanted=BigInt(f.gasWanted.toString())),f.gasUsed!==void 0&&f.gasUsed!==null&&(I.gasUsed=BigInt(f.gasUsed.toString())),I.events=((V=f.events)==null?void 0:V.map(x=>e.Event.fromPartial(x)))||[],I.codespace=f.codespace??"",I.sender=f.sender??"",f.priority!==void 0&&f.priority!==null&&(I.priority=BigInt(f.priority.toString())),I.mempoolError=f.mempoolError??"",I}};function rd(){return{code:0,data:new Uint8Array,log:"",info:"",gasWanted:BigInt(0),gasUsed:BigInt(0),events:[],codespace:""}}e.ResponseDeliverTx={typeUrl:"/tendermint.abci.ResponseDeliverTx",encode(f,I=C.BinaryWriter.create()){f.code!==0&&I.uint32(8).uint32(f.code),f.data.length!==0&&I.uint32(18).bytes(f.data),f.log!==""&&I.uint32(26).string(f.log),f.info!==""&&I.uint32(34).string(f.info),f.gasWanted!==BigInt(0)&&I.uint32(40).int64(f.gasWanted),f.gasUsed!==BigInt(0)&&I.uint32(48).int64(f.gasUsed);for(const V of f.events)e.Event.encode(V,I.uint32(58).fork()).ldelim();return f.codespace!==""&&I.uint32(66).string(f.codespace),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=rd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.code=V.uint32();break;case 2:G.data=V.bytes();break;case 3:G.log=V.string();break;case 4:G.info=V.string();break;case 5:G.gasWanted=V.int64();break;case 6:G.gasUsed=V.int64();break;case 7:G.events.push(e.Event.decode(V,V.uint32()));break;case 8:G.codespace=V.string();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=rd();return(0,w.isSet)(f.code)&&(I.code=Number(f.code)),(0,w.isSet)(f.data)&&(I.data=(0,w.bytesFromBase64)(f.data)),(0,w.isSet)(f.log)&&(I.log=String(f.log)),(0,w.isSet)(f.info)&&(I.info=String(f.info)),(0,w.isSet)(f.gas_wanted)&&(I.gasWanted=BigInt(f.gas_wanted.toString())),(0,w.isSet)(f.gas_used)&&(I.gasUsed=BigInt(f.gas_used.toString())),Array.isArray(f==null?void 0:f.events)&&(I.events=f.events.map(V=>e.Event.fromJSON(V))),(0,w.isSet)(f.codespace)&&(I.codespace=String(f.codespace)),I},toJSON(f){const I={};return f.code!==void 0&&(I.code=Math.round(f.code)),f.data!==void 0&&(I.data=(0,w.base64FromBytes)(f.data!==void 0?f.data:new Uint8Array)),f.log!==void 0&&(I.log=f.log),f.info!==void 0&&(I.info=f.info),f.gasWanted!==void 0&&(I.gas_wanted=(f.gasWanted||BigInt(0)).toString()),f.gasUsed!==void 0&&(I.gas_used=(f.gasUsed||BigInt(0)).toString()),f.events?I.events=f.events.map(V=>V?e.Event.toJSON(V):void 0):I.events=[],f.codespace!==void 0&&(I.codespace=f.codespace),I},fromPartial(f){var V;const I=rd();return I.code=f.code??0,I.data=f.data??new Uint8Array,I.log=f.log??"",I.info=f.info??"",f.gasWanted!==void 0&&f.gasWanted!==null&&(I.gasWanted=BigInt(f.gasWanted.toString())),f.gasUsed!==void 0&&f.gasUsed!==null&&(I.gasUsed=BigInt(f.gasUsed.toString())),I.events=((V=f.events)==null?void 0:V.map(x=>e.Event.fromPartial(x)))||[],I.codespace=f.codespace??"",I}};function id(){return{validatorUpdates:[],consensusParamUpdates:void 0,events:[]}}e.ResponseEndBlock={typeUrl:"/tendermint.abci.ResponseEndBlock",encode(f,I=C.BinaryWriter.create()){for(const V of f.validatorUpdates)e.ValidatorUpdate.encode(V,I.uint32(10).fork()).ldelim();f.consensusParamUpdates!==void 0&&t.ConsensusParams.encode(f.consensusParamUpdates,I.uint32(18).fork()).ldelim();for(const V of f.events)e.Event.encode(V,I.uint32(26).fork()).ldelim();return I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=id();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.validatorUpdates.push(e.ValidatorUpdate.decode(V,V.uint32()));break;case 2:G.consensusParamUpdates=t.ConsensusParams.decode(V,V.uint32());break;case 3:G.events.push(e.Event.decode(V,V.uint32()));break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=id();return Array.isArray(f==null?void 0:f.validatorUpdates)&&(I.validatorUpdates=f.validatorUpdates.map(V=>e.ValidatorUpdate.fromJSON(V))),(0,w.isSet)(f.consensusParamUpdates)&&(I.consensusParamUpdates=t.ConsensusParams.fromJSON(f.consensusParamUpdates)),Array.isArray(f==null?void 0:f.events)&&(I.events=f.events.map(V=>e.Event.fromJSON(V))),I},toJSON(f){const I={};return f.validatorUpdates?I.validatorUpdates=f.validatorUpdates.map(V=>V?e.ValidatorUpdate.toJSON(V):void 0):I.validatorUpdates=[],f.consensusParamUpdates!==void 0&&(I.consensusParamUpdates=f.consensusParamUpdates?t.ConsensusParams.toJSON(f.consensusParamUpdates):void 0),f.events?I.events=f.events.map(V=>V?e.Event.toJSON(V):void 0):I.events=[],I},fromPartial(f){var V,x;const I=id();return I.validatorUpdates=((V=f.validatorUpdates)==null?void 0:V.map(G=>e.ValidatorUpdate.fromPartial(G)))||[],f.consensusParamUpdates!==void 0&&f.consensusParamUpdates!==null&&(I.consensusParamUpdates=t.ConsensusParams.fromPartial(f.consensusParamUpdates)),I.events=((x=f.events)==null?void 0:x.map(G=>e.Event.fromPartial(G)))||[],I}};function od(){return{data:new Uint8Array,retainHeight:BigInt(0)}}e.ResponseCommit={typeUrl:"/tendermint.abci.ResponseCommit",encode(f,I=C.BinaryWriter.create()){return f.data.length!==0&&I.uint32(18).bytes(f.data),f.retainHeight!==BigInt(0)&&I.uint32(24).int64(f.retainHeight),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=od();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 2:G.data=V.bytes();break;case 3:G.retainHeight=V.int64();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=od();return(0,w.isSet)(f.data)&&(I.data=(0,w.bytesFromBase64)(f.data)),(0,w.isSet)(f.retainHeight)&&(I.retainHeight=BigInt(f.retainHeight.toString())),I},toJSON(f){const I={};return f.data!==void 0&&(I.data=(0,w.base64FromBytes)(f.data!==void 0?f.data:new Uint8Array)),f.retainHeight!==void 0&&(I.retainHeight=(f.retainHeight||BigInt(0)).toString()),I},fromPartial(f){const I=od();return I.data=f.data??new Uint8Array,f.retainHeight!==void 0&&f.retainHeight!==null&&(I.retainHeight=BigInt(f.retainHeight.toString())),I}};function ad(){return{snapshots:[]}}e.ResponseListSnapshots={typeUrl:"/tendermint.abci.ResponseListSnapshots",encode(f,I=C.BinaryWriter.create()){for(const V of f.snapshots)e.Snapshot.encode(V,I.uint32(10).fork()).ldelim();return I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=ad();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.snapshots.push(e.Snapshot.decode(V,V.uint32()));break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=ad();return Array.isArray(f==null?void 0:f.snapshots)&&(I.snapshots=f.snapshots.map(V=>e.Snapshot.fromJSON(V))),I},toJSON(f){const I={};return f.snapshots?I.snapshots=f.snapshots.map(V=>V?e.Snapshot.toJSON(V):void 0):I.snapshots=[],I},fromPartial(f){var V;const I=ad();return I.snapshots=((V=f.snapshots)==null?void 0:V.map(x=>e.Snapshot.fromPartial(x)))||[],I}};function sd(){return{result:0}}e.ResponseOfferSnapshot={typeUrl:"/tendermint.abci.ResponseOfferSnapshot",encode(f,I=C.BinaryWriter.create()){return f.result!==0&&I.uint32(8).int32(f.result),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=sd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.result=V.int32();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=sd();return(0,w.isSet)(f.result)&&(I.result=p(f.result)),I},toJSON(f){const I={};return f.result!==void 0&&(I.result=S(f.result)),I},fromPartial(f){const I=sd();return I.result=f.result??0,I}};function dd(){return{chunk:new Uint8Array}}e.ResponseLoadSnapshotChunk={typeUrl:"/tendermint.abci.ResponseLoadSnapshotChunk",encode(f,I=C.BinaryWriter.create()){return f.chunk.length!==0&&I.uint32(10).bytes(f.chunk),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=dd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.chunk=V.bytes();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=dd();return(0,w.isSet)(f.chunk)&&(I.chunk=(0,w.bytesFromBase64)(f.chunk)),I},toJSON(f){const I={};return f.chunk!==void 0&&(I.chunk=(0,w.base64FromBytes)(f.chunk!==void 0?f.chunk:new Uint8Array)),I},fromPartial(f){const I=dd();return I.chunk=f.chunk??new Uint8Array,I}};function ud(){return{result:0,refetchChunks:[],rejectSenders:[]}}e.ResponseApplySnapshotChunk={typeUrl:"/tendermint.abci.ResponseApplySnapshotChunk",encode(f,I=C.BinaryWriter.create()){f.result!==0&&I.uint32(8).int32(f.result),I.uint32(18).fork();for(const V of f.refetchChunks)I.uint32(V);I.ldelim();for(const V of f.rejectSenders)I.uint32(26).string(V);return I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=ud();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.result=V.int32();break;case 2:if((z&7)===2){const zh=V.uint32()+V.pos;for(;V.pos<zh;)G.refetchChunks.push(V.uint32())}else G.refetchChunks.push(V.uint32());break;case 3:G.rejectSenders.push(V.string());break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=ud();return(0,w.isSet)(f.result)&&(I.result=u(f.result)),Array.isArray(f==null?void 0:f.refetchChunks)&&(I.refetchChunks=f.refetchChunks.map(V=>Number(V))),Array.isArray(f==null?void 0:f.rejectSenders)&&(I.rejectSenders=f.rejectSenders.map(V=>String(V))),I},toJSON(f){const I={};return f.result!==void 0&&(I.result=c(f.result)),f.refetchChunks?I.refetchChunks=f.refetchChunks.map(V=>Math.round(V)):I.refetchChunks=[],f.rejectSenders?I.rejectSenders=f.rejectSenders.map(V=>V):I.rejectSenders=[],I},fromPartial(f){var V,x;const I=ud();return I.result=f.result??0,I.refetchChunks=((V=f.refetchChunks)==null?void 0:V.map(G=>G))||[],I.rejectSenders=((x=f.rejectSenders)==null?void 0:x.map(G=>G))||[],I}};function cd(){return{txs:[]}}e.ResponsePrepareProposal={typeUrl:"/tendermint.abci.ResponsePrepareProposal",encode(f,I=C.BinaryWriter.create()){for(const V of f.txs)I.uint32(10).bytes(V);return I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=cd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.txs.push(V.bytes());break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=cd();return Array.isArray(f==null?void 0:f.txs)&&(I.txs=f.txs.map(V=>(0,w.bytesFromBase64)(V))),I},toJSON(f){const I={};return f.txs?I.txs=f.txs.map(V=>(0,w.base64FromBytes)(V!==void 0?V:new Uint8Array)):I.txs=[],I},fromPartial(f){var V;const I=cd();return I.txs=((V=f.txs)==null?void 0:V.map(x=>x))||[],I}};function ld(){return{status:0}}e.ResponseProcessProposal={typeUrl:"/tendermint.abci.ResponseProcessProposal",encode(f,I=C.BinaryWriter.create()){return f.status!==0&&I.uint32(8).int32(f.status),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=ld();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.status=V.int32();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=ld();return(0,w.isSet)(f.status)&&(I.status=B(f.status)),I},toJSON(f){const I={};return f.status!==void 0&&(I.status=N(f.status)),I},fromPartial(f){const I=ld();return I.status=f.status??0,I}};function fd(){return{round:0,votes:[]}}e.CommitInfo={typeUrl:"/tendermint.abci.CommitInfo",encode(f,I=C.BinaryWriter.create()){f.round!==0&&I.uint32(8).int32(f.round);for(const V of f.votes)e.VoteInfo.encode(V,I.uint32(18).fork()).ldelim();return I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=fd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.round=V.int32();break;case 2:G.votes.push(e.VoteInfo.decode(V,V.uint32()));break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=fd();return(0,w.isSet)(f.round)&&(I.round=Number(f.round)),Array.isArray(f==null?void 0:f.votes)&&(I.votes=f.votes.map(V=>e.VoteInfo.fromJSON(V))),I},toJSON(f){const I={};return f.round!==void 0&&(I.round=Math.round(f.round)),f.votes?I.votes=f.votes.map(V=>V?e.VoteInfo.toJSON(V):void 0):I.votes=[],I},fromPartial(f){var V;const I=fd();return I.round=f.round??0,I.votes=((V=f.votes)==null?void 0:V.map(x=>e.VoteInfo.fromPartial(x)))||[],I}};function pd(){return{round:0,votes:[]}}e.ExtendedCommitInfo={typeUrl:"/tendermint.abci.ExtendedCommitInfo",encode(f,I=C.BinaryWriter.create()){f.round!==0&&I.uint32(8).int32(f.round);for(const V of f.votes)e.ExtendedVoteInfo.encode(V,I.uint32(18).fork()).ldelim();return I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=pd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.round=V.int32();break;case 2:G.votes.push(e.ExtendedVoteInfo.decode(V,V.uint32()));break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=pd();return(0,w.isSet)(f.round)&&(I.round=Number(f.round)),Array.isArray(f==null?void 0:f.votes)&&(I.votes=f.votes.map(V=>e.ExtendedVoteInfo.fromJSON(V))),I},toJSON(f){const I={};return f.round!==void 0&&(I.round=Math.round(f.round)),f.votes?I.votes=f.votes.map(V=>V?e.ExtendedVoteInfo.toJSON(V):void 0):I.votes=[],I},fromPartial(f){var V;const I=pd();return I.round=f.round??0,I.votes=((V=f.votes)==null?void 0:V.map(x=>e.ExtendedVoteInfo.fromPartial(x)))||[],I}};function md(){return{type:"",attributes:[]}}e.Event={typeUrl:"/tendermint.abci.Event",encode(f,I=C.BinaryWriter.create()){f.type!==""&&I.uint32(10).string(f.type);for(const V of f.attributes)e.EventAttribute.encode(V,I.uint32(18).fork()).ldelim();return I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=md();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.type=V.string();break;case 2:G.attributes.push(e.EventAttribute.decode(V,V.uint32()));break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=md();return(0,w.isSet)(f.type)&&(I.type=String(f.type)),Array.isArray(f==null?void 0:f.attributes)&&(I.attributes=f.attributes.map(V=>e.EventAttribute.fromJSON(V))),I},toJSON(f){const I={};return f.type!==void 0&&(I.type=f.type),f.attributes?I.attributes=f.attributes.map(V=>V?e.EventAttribute.toJSON(V):void 0):I.attributes=[],I},fromPartial(f){var V;const I=md();return I.type=f.type??"",I.attributes=((V=f.attributes)==null?void 0:V.map(x=>e.EventAttribute.fromPartial(x)))||[],I}};function hd(){return{key:"",value:"",index:!1}}e.EventAttribute={typeUrl:"/tendermint.abci.EventAttribute",encode(f,I=C.BinaryWriter.create()){return f.key!==""&&I.uint32(10).string(f.key),f.value!==""&&I.uint32(18).string(f.value),f.index===!0&&I.uint32(24).bool(f.index),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=hd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.key=V.string();break;case 2:G.value=V.string();break;case 3:G.index=V.bool();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=hd();return(0,w.isSet)(f.key)&&(I.key=String(f.key)),(0,w.isSet)(f.value)&&(I.value=String(f.value)),(0,w.isSet)(f.index)&&(I.index=!!f.index),I},toJSON(f){const I={};return f.key!==void 0&&(I.key=f.key),f.value!==void 0&&(I.value=f.value),f.index!==void 0&&(I.index=f.index),I},fromPartial(f){const I=hd();return I.key=f.key??"",I.value=f.value??"",I.index=f.index??!1,I}};function gd(){return{height:BigInt(0),index:0,tx:new Uint8Array,result:e.ResponseDeliverTx.fromPartial({})}}e.TxResult={typeUrl:"/tendermint.abci.TxResult",encode(f,I=C.BinaryWriter.create()){return f.height!==BigInt(0)&&I.uint32(8).int64(f.height),f.index!==0&&I.uint32(16).uint32(f.index),f.tx.length!==0&&I.uint32(26).bytes(f.tx),f.result!==void 0&&e.ResponseDeliverTx.encode(f.result,I.uint32(34).fork()).ldelim(),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=gd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.height=V.int64();break;case 2:G.index=V.uint32();break;case 3:G.tx=V.bytes();break;case 4:G.result=e.ResponseDeliverTx.decode(V,V.uint32());break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=gd();return(0,w.isSet)(f.height)&&(I.height=BigInt(f.height.toString())),(0,w.isSet)(f.index)&&(I.index=Number(f.index)),(0,w.isSet)(f.tx)&&(I.tx=(0,w.bytesFromBase64)(f.tx)),(0,w.isSet)(f.result)&&(I.result=e.ResponseDeliverTx.fromJSON(f.result)),I},toJSON(f){const I={};return f.height!==void 0&&(I.height=(f.height||BigInt(0)).toString()),f.index!==void 0&&(I.index=Math.round(f.index)),f.tx!==void 0&&(I.tx=(0,w.base64FromBytes)(f.tx!==void 0?f.tx:new Uint8Array)),f.result!==void 0&&(I.result=f.result?e.ResponseDeliverTx.toJSON(f.result):void 0),I},fromPartial(f){const I=gd();return f.height!==void 0&&f.height!==null&&(I.height=BigInt(f.height.toString())),I.index=f.index??0,I.tx=f.tx??new Uint8Array,f.result!==void 0&&f.result!==null&&(I.result=e.ResponseDeliverTx.fromPartial(f.result)),I}};function yd(){return{address:new Uint8Array,power:BigInt(0)}}e.Validator={typeUrl:"/tendermint.abci.Validator",encode(f,I=C.BinaryWriter.create()){return f.address.length!==0&&I.uint32(10).bytes(f.address),f.power!==BigInt(0)&&I.uint32(24).int64(f.power),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=yd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.address=V.bytes();break;case 3:G.power=V.int64();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=yd();return(0,w.isSet)(f.address)&&(I.address=(0,w.bytesFromBase64)(f.address)),(0,w.isSet)(f.power)&&(I.power=BigInt(f.power.toString())),I},toJSON(f){const I={};return f.address!==void 0&&(I.address=(0,w.base64FromBytes)(f.address!==void 0?f.address:new Uint8Array)),f.power!==void 0&&(I.power=(f.power||BigInt(0)).toString()),I},fromPartial(f){const I=yd();return I.address=f.address??new Uint8Array,f.power!==void 0&&f.power!==null&&(I.power=BigInt(f.power.toString())),I}};function Sd(){return{pubKey:g.PublicKey.fromPartial({}),power:BigInt(0)}}e.ValidatorUpdate={typeUrl:"/tendermint.abci.ValidatorUpdate",encode(f,I=C.BinaryWriter.create()){return f.pubKey!==void 0&&g.PublicKey.encode(f.pubKey,I.uint32(10).fork()).ldelim(),f.power!==BigInt(0)&&I.uint32(16).int64(f.power),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=Sd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.pubKey=g.PublicKey.decode(V,V.uint32());break;case 2:G.power=V.int64();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=Sd();return(0,w.isSet)(f.pubKey)&&(I.pubKey=g.PublicKey.fromJSON(f.pubKey)),(0,w.isSet)(f.power)&&(I.power=BigInt(f.power.toString())),I},toJSON(f){const I={};return f.pubKey!==void 0&&(I.pubKey=f.pubKey?g.PublicKey.toJSON(f.pubKey):void 0),f.power!==void 0&&(I.power=(f.power||BigInt(0)).toString()),I},fromPartial(f){const I=Sd();return f.pubKey!==void 0&&f.pubKey!==null&&(I.pubKey=g.PublicKey.fromPartial(f.pubKey)),f.power!==void 0&&f.power!==null&&(I.power=BigInt(f.power.toString())),I}};function kd(){return{validator:e.Validator.fromPartial({}),signedLastBlock:!1}}e.VoteInfo={typeUrl:"/tendermint.abci.VoteInfo",encode(f,I=C.BinaryWriter.create()){return f.validator!==void 0&&e.Validator.encode(f.validator,I.uint32(10).fork()).ldelim(),f.signedLastBlock===!0&&I.uint32(16).bool(f.signedLastBlock),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=kd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.validator=e.Validator.decode(V,V.uint32());break;case 2:G.signedLastBlock=V.bool();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=kd();return(0,w.isSet)(f.validator)&&(I.validator=e.Validator.fromJSON(f.validator)),(0,w.isSet)(f.signedLastBlock)&&(I.signedLastBlock=!!f.signedLastBlock),I},toJSON(f){const I={};return f.validator!==void 0&&(I.validator=f.validator?e.Validator.toJSON(f.validator):void 0),f.signedLastBlock!==void 0&&(I.signedLastBlock=f.signedLastBlock),I},fromPartial(f){const I=kd();return f.validator!==void 0&&f.validator!==null&&(I.validator=e.Validator.fromPartial(f.validator)),I.signedLastBlock=f.signedLastBlock??!1,I}};function Pd(){return{validator:e.Validator.fromPartial({}),signedLastBlock:!1,voteExtension:new Uint8Array}}e.ExtendedVoteInfo={typeUrl:"/tendermint.abci.ExtendedVoteInfo",encode(f,I=C.BinaryWriter.create()){return f.validator!==void 0&&e.Validator.encode(f.validator,I.uint32(10).fork()).ldelim(),f.signedLastBlock===!0&&I.uint32(16).bool(f.signedLastBlock),f.voteExtension.length!==0&&I.uint32(26).bytes(f.voteExtension),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=Pd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.validator=e.Validator.decode(V,V.uint32());break;case 2:G.signedLastBlock=V.bool();break;case 3:G.voteExtension=V.bytes();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=Pd();return(0,w.isSet)(f.validator)&&(I.validator=e.Validator.fromJSON(f.validator)),(0,w.isSet)(f.signedLastBlock)&&(I.signedLastBlock=!!f.signedLastBlock),(0,w.isSet)(f.voteExtension)&&(I.voteExtension=(0,w.bytesFromBase64)(f.voteExtension)),I},toJSON(f){const I={};return f.validator!==void 0&&(I.validator=f.validator?e.Validator.toJSON(f.validator):void 0),f.signedLastBlock!==void 0&&(I.signedLastBlock=f.signedLastBlock),f.voteExtension!==void 0&&(I.voteExtension=(0,w.base64FromBytes)(f.voteExtension!==void 0?f.voteExtension:new Uint8Array)),I},fromPartial(f){const I=Pd();return f.validator!==void 0&&f.validator!==null&&(I.validator=e.Validator.fromPartial(f.validator)),I.signedLastBlock=f.signedLastBlock??!1,I.voteExtension=f.voteExtension??new Uint8Array,I}};function vd(){return{type:0,validator:e.Validator.fromPartial({}),height:BigInt(0),time:n.Timestamp.fromPartial({}),totalVotingPower:BigInt(0)}}e.Misbehavior={typeUrl:"/tendermint.abci.Misbehavior",encode(f,I=C.BinaryWriter.create()){return f.type!==0&&I.uint32(8).int32(f.type),f.validator!==void 0&&e.Validator.encode(f.validator,I.uint32(18).fork()).ldelim(),f.height!==BigInt(0)&&I.uint32(24).int64(f.height),f.time!==void 0&&n.Timestamp.encode(f.time,I.uint32(34).fork()).ldelim(),f.totalVotingPower!==BigInt(0)&&I.uint32(40).int64(f.totalVotingPower),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=vd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.type=V.int32();break;case 2:G.validator=e.Validator.decode(V,V.uint32());break;case 3:G.height=V.int64();break;case 4:G.time=n.Timestamp.decode(V,V.uint32());break;case 5:G.totalVotingPower=V.int64();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=vd();return(0,w.isSet)(f.type)&&(I.type=W(f.type)),(0,w.isSet)(f.validator)&&(I.validator=e.Validator.fromJSON(f.validator)),(0,w.isSet)(f.height)&&(I.height=BigInt(f.height.toString())),(0,w.isSet)(f.time)&&(I.time=(0,w.fromJsonTimestamp)(f.time)),(0,w.isSet)(f.totalVotingPower)&&(I.totalVotingPower=BigInt(f.totalVotingPower.toString())),I},toJSON(f){const I={};return f.type!==void 0&&(I.type=r(f.type)),f.validator!==void 0&&(I.validator=f.validator?e.Validator.toJSON(f.validator):void 0),f.height!==void 0&&(I.height=(f.height||BigInt(0)).toString()),f.time!==void 0&&(I.time=(0,w.fromTimestamp)(f.time).toISOString()),f.totalVotingPower!==void 0&&(I.totalVotingPower=(f.totalVotingPower||BigInt(0)).toString()),I},fromPartial(f){const I=vd();return I.type=f.type??0,f.validator!==void 0&&f.validator!==null&&(I.validator=e.Validator.fromPartial(f.validator)),f.height!==void 0&&f.height!==null&&(I.height=BigInt(f.height.toString())),f.time!==void 0&&f.time!==null&&(I.time=n.Timestamp.fromPartial(f.time)),f.totalVotingPower!==void 0&&f.totalVotingPower!==null&&(I.totalVotingPower=BigInt(f.totalVotingPower.toString())),I}};function Cd(){return{height:BigInt(0),format:0,chunks:0,hash:new Uint8Array,metadata:new Uint8Array}}e.Snapshot={typeUrl:"/tendermint.abci.Snapshot",encode(f,I=C.BinaryWriter.create()){return f.height!==BigInt(0)&&I.uint32(8).uint64(f.height),f.format!==0&&I.uint32(16).uint32(f.format),f.chunks!==0&&I.uint32(24).uint32(f.chunks),f.hash.length!==0&&I.uint32(34).bytes(f.hash),f.metadata.length!==0&&I.uint32(42).bytes(f.metadata),I},decode(f,I){const V=f instanceof C.BinaryReader?f:new C.BinaryReader(f);let x=I===void 0?V.len:V.pos+I;const G=Cd();for(;V.pos<x;){const z=V.uint32();switch(z>>>3){case 1:G.height=V.uint64();break;case 2:G.format=V.uint32();break;case 3:G.chunks=V.uint32();break;case 4:G.hash=V.bytes();break;case 5:G.metadata=V.bytes();break;default:V.skipType(z&7);break}}return G},fromJSON(f){const I=Cd();return(0,w.isSet)(f.height)&&(I.height=BigInt(f.height.toString())),(0,w.isSet)(f.format)&&(I.format=Number(f.format)),(0,w.isSet)(f.chunks)&&(I.chunks=Number(f.chunks)),(0,w.isSet)(f.hash)&&(I.hash=(0,w.bytesFromBase64)(f.hash)),(0,w.isSet)(f.metadata)&&(I.metadata=(0,w.bytesFromBase64)(f.metadata)),I},toJSON(f){const I={};return f.height!==void 0&&(I.height=(f.height||BigInt(0)).toString()),f.format!==void 0&&(I.format=Math.round(f.format)),f.chunks!==void 0&&(I.chunks=Math.round(f.chunks)),f.hash!==void 0&&(I.hash=(0,w.base64FromBytes)(f.hash!==void 0?f.hash:new Uint8Array)),f.metadata!==void 0&&(I.metadata=(0,w.base64FromBytes)(f.metadata!==void 0?f.metadata:new Uint8Array)),I},fromPartial(f){const I=Cd();return f.height!==void 0&&f.height!==null&&(I.height=BigInt(f.height.toString())),I.format=f.format??0,I.chunks=f.chunks??0,I.hash=f.hash??new Uint8Array,I.metadata=f.metadata??new Uint8Array,I}};class xh{constructor(I){this.rpc=I,this.Echo=this.Echo.bind(this),this.Flush=this.Flush.bind(this),this.Info=this.Info.bind(this),this.DeliverTx=this.DeliverTx.bind(this),this.CheckTx=this.CheckTx.bind(this),this.Query=this.Query.bind(this),this.Commit=this.Commit.bind(this),this.InitChain=this.InitChain.bind(this),this.BeginBlock=this.BeginBlock.bind(this),this.EndBlock=this.EndBlock.bind(this),this.ListSnapshots=this.ListSnapshots.bind(this),this.OfferSnapshot=this.OfferSnapshot.bind(this),this.LoadSnapshotChunk=this.LoadSnapshotChunk.bind(this),this.ApplySnapshotChunk=this.ApplySnapshotChunk.bind(this),this.PrepareProposal=this.PrepareProposal.bind(this),this.ProcessProposal=this.ProcessProposal.bind(this)}Echo(I){const V=e.RequestEcho.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","Echo",V).then(G=>e.ResponseEcho.decode(new C.BinaryReader(G)))}Flush(I={}){const V=e.RequestFlush.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","Flush",V).then(G=>e.ResponseFlush.decode(new C.BinaryReader(G)))}Info(I){const V=e.RequestInfo.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","Info",V).then(G=>e.ResponseInfo.decode(new C.BinaryReader(G)))}DeliverTx(I){const V=e.RequestDeliverTx.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","DeliverTx",V).then(G=>e.ResponseDeliverTx.decode(new C.BinaryReader(G)))}CheckTx(I){const V=e.RequestCheckTx.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","CheckTx",V).then(G=>e.ResponseCheckTx.decode(new C.BinaryReader(G)))}Query(I){const V=e.RequestQuery.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","Query",V).then(G=>e.ResponseQuery.decode(new C.BinaryReader(G)))}Commit(I={}){const V=e.RequestCommit.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","Commit",V).then(G=>e.ResponseCommit.decode(new C.BinaryReader(G)))}InitChain(I){const V=e.RequestInitChain.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","InitChain",V).then(G=>e.ResponseInitChain.decode(new C.BinaryReader(G)))}BeginBlock(I){const V=e.RequestBeginBlock.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","BeginBlock",V).then(G=>e.ResponseBeginBlock.decode(new C.BinaryReader(G)))}EndBlock(I){const V=e.RequestEndBlock.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","EndBlock",V).then(G=>e.ResponseEndBlock.decode(new C.BinaryReader(G)))}ListSnapshots(I={}){const V=e.RequestListSnapshots.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","ListSnapshots",V).then(G=>e.ResponseListSnapshots.decode(new C.BinaryReader(G)))}OfferSnapshot(I){const V=e.RequestOfferSnapshot.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","OfferSnapshot",V).then(G=>e.ResponseOfferSnapshot.decode(new C.BinaryReader(G)))}LoadSnapshotChunk(I){const V=e.RequestLoadSnapshotChunk.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","LoadSnapshotChunk",V).then(G=>e.ResponseLoadSnapshotChunk.decode(new C.BinaryReader(G)))}ApplySnapshotChunk(I){const V=e.RequestApplySnapshotChunk.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","ApplySnapshotChunk",V).then(G=>e.ResponseApplySnapshotChunk.decode(new C.BinaryReader(G)))}PrepareProposal(I){const V=e.RequestPrepareProposal.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","PrepareProposal",V).then(G=>e.ResponsePrepareProposal.decode(new C.BinaryReader(G)))}ProcessProposal(I){const V=e.RequestProcessProposal.encode(I).finish();return this.rpc.request("tendermint.abci.ABCIApplication","ProcessProposal",V).then(G=>e.ResponseProcessProposal.decode(new C.BinaryReader(G)))}}e.ABCIApplicationClientImpl=xh})(Dc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValidatorUpdates=e.Pool=e.RedelegationResponse=e.RedelegationEntryResponse=e.DelegationResponse=e.Params=e.Redelegation=e.RedelegationEntry=e.UnbondingDelegationEntry=e.UnbondingDelegation=e.Delegation=e.DVVTriplets=e.DVVTriplet=e.DVPairs=e.DVPair=e.ValAddresses=e.Validator=e.Description=e.Commission=e.CommissionRates=e.HistoricalInfo=e.infractionToJSON=e.infractionFromJSON=e.Infraction=e.bondStatusToJSON=e.bondStatusFromJSON=e.BondStatus=e.protobufPackage=void 0;const n=mr,t=Je,i=_.any,o=yn,g=_.coin,C=Dc,w=_.binary,E=_.helpers;e.protobufPackage="cosmos.staking.v1beta1";var D;(function(k){k[k.BOND_STATUS_UNSPECIFIED=0]="BOND_STATUS_UNSPECIFIED",k[k.BOND_STATUS_UNBONDED=1]="BOND_STATUS_UNBONDED",k[k.BOND_STATUS_UNBONDING=2]="BOND_STATUS_UNBONDING",k[k.BOND_STATUS_BONDED=3]="BOND_STATUS_BONDED",k[k.UNRECOGNIZED=-1]="UNRECOGNIZED"})(D||(e.BondStatus=D={}));function J(k){switch(k){case 0:case"BOND_STATUS_UNSPECIFIED":return D.BOND_STATUS_UNSPECIFIED;case 1:case"BOND_STATUS_UNBONDED":return D.BOND_STATUS_UNBONDED;case 2:case"BOND_STATUS_UNBONDING":return D.BOND_STATUS_UNBONDING;case 3:case"BOND_STATUS_BONDED":return D.BOND_STATUS_BONDED;case-1:case"UNRECOGNIZED":default:return D.UNRECOGNIZED}}e.bondStatusFromJSON=J;function b(k){switch(k){case D.BOND_STATUS_UNSPECIFIED:return"BOND_STATUS_UNSPECIFIED";case D.BOND_STATUS_UNBONDED:return"BOND_STATUS_UNBONDED";case D.BOND_STATUS_UNBONDING:return"BOND_STATUS_UNBONDING";case D.BOND_STATUS_BONDED:return"BOND_STATUS_BONDED";case D.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.bondStatusToJSON=b;var p;(function(k){k[k.INFRACTION_UNSPECIFIED=0]="INFRACTION_UNSPECIFIED",k[k.INFRACTION_DOUBLE_SIGN=1]="INFRACTION_DOUBLE_SIGN",k[k.INFRACTION_DOWNTIME=2]="INFRACTION_DOWNTIME",k[k.UNRECOGNIZED=-1]="UNRECOGNIZED"})(p||(e.Infraction=p={}));function S(k){switch(k){case 0:case"INFRACTION_UNSPECIFIED":return p.INFRACTION_UNSPECIFIED;case 1:case"INFRACTION_DOUBLE_SIGN":return p.INFRACTION_DOUBLE_SIGN;case 2:case"INFRACTION_DOWNTIME":return p.INFRACTION_DOWNTIME;case-1:case"UNRECOGNIZED":default:return p.UNRECOGNIZED}}e.infractionFromJSON=S;function R(k){switch(k){case p.INFRACTION_UNSPECIFIED:return"INFRACTION_UNSPECIFIED";case p.INFRACTION_DOUBLE_SIGN:return"INFRACTION_DOUBLE_SIGN";case p.INFRACTION_DOWNTIME:return"INFRACTION_DOWNTIME";case p.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.infractionToJSON=R;function u(){return{header:n.Header.fromPartial({}),valset:[]}}e.HistoricalInfo={typeUrl:"/cosmos.staking.v1beta1.HistoricalInfo",encode(k,v=w.BinaryWriter.create()){k.header!==void 0&&n.Header.encode(k.header,v.uint32(10).fork()).ldelim();for(const A of k.valset)e.Validator.encode(A,v.uint32(18).fork()).ldelim();return v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=u();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.header=n.Header.decode(A,A.uint32());break;case 2:K.valset.push(e.Validator.decode(A,A.uint32()));break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=u();return(0,E.isSet)(k.header)&&(v.header=n.Header.fromJSON(k.header)),Array.isArray(k==null?void 0:k.valset)&&(v.valset=k.valset.map(A=>e.Validator.fromJSON(A))),v},toJSON(k){const v={};return k.header!==void 0&&(v.header=k.header?n.Header.toJSON(k.header):void 0),k.valset?v.valset=k.valset.map(A=>A?e.Validator.toJSON(A):void 0):v.valset=[],v},fromPartial(k){var A;const v=u();return k.header!==void 0&&k.header!==null&&(v.header=n.Header.fromPartial(k.header)),v.valset=((A=k.valset)==null?void 0:A.map(F=>e.Validator.fromPartial(F)))||[],v}};function c(){return{rate:"",maxRate:"",maxChangeRate:""}}e.CommissionRates={typeUrl:"/cosmos.staking.v1beta1.CommissionRates",encode(k,v=w.BinaryWriter.create()){return k.rate!==""&&v.uint32(10).string(k.rate),k.maxRate!==""&&v.uint32(18).string(k.maxRate),k.maxChangeRate!==""&&v.uint32(26).string(k.maxChangeRate),v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=c();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.rate=A.string();break;case 2:K.maxRate=A.string();break;case 3:K.maxChangeRate=A.string();break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=c();return(0,E.isSet)(k.rate)&&(v.rate=String(k.rate)),(0,E.isSet)(k.maxRate)&&(v.maxRate=String(k.maxRate)),(0,E.isSet)(k.maxChangeRate)&&(v.maxChangeRate=String(k.maxChangeRate)),v},toJSON(k){const v={};return k.rate!==void 0&&(v.rate=k.rate),k.maxRate!==void 0&&(v.maxRate=k.maxRate),k.maxChangeRate!==void 0&&(v.maxChangeRate=k.maxChangeRate),v},fromPartial(k){const v=c();return v.rate=k.rate??"",v.maxRate=k.maxRate??"",v.maxChangeRate=k.maxChangeRate??"",v}};function y(){return{commissionRates:e.CommissionRates.fromPartial({}),updateTime:t.Timestamp.fromPartial({})}}e.Commission={typeUrl:"/cosmos.staking.v1beta1.Commission",encode(k,v=w.BinaryWriter.create()){return k.commissionRates!==void 0&&e.CommissionRates.encode(k.commissionRates,v.uint32(10).fork()).ldelim(),k.updateTime!==void 0&&t.Timestamp.encode(k.updateTime,v.uint32(18).fork()).ldelim(),v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=y();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.commissionRates=e.CommissionRates.decode(A,A.uint32());break;case 2:K.updateTime=t.Timestamp.decode(A,A.uint32());break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=y();return(0,E.isSet)(k.commissionRates)&&(v.commissionRates=e.CommissionRates.fromJSON(k.commissionRates)),(0,E.isSet)(k.updateTime)&&(v.updateTime=(0,E.fromJsonTimestamp)(k.updateTime)),v},toJSON(k){const v={};return k.commissionRates!==void 0&&(v.commissionRates=k.commissionRates?e.CommissionRates.toJSON(k.commissionRates):void 0),k.updateTime!==void 0&&(v.updateTime=(0,E.fromTimestamp)(k.updateTime).toISOString()),v},fromPartial(k){const v=y();return k.commissionRates!==void 0&&k.commissionRates!==null&&(v.commissionRates=e.CommissionRates.fromPartial(k.commissionRates)),k.updateTime!==void 0&&k.updateTime!==null&&(v.updateTime=t.Timestamp.fromPartial(k.updateTime)),v}};function B(){return{moniker:"",identity:"",website:"",securityContact:"",details:""}}e.Description={typeUrl:"/cosmos.staking.v1beta1.Description",encode(k,v=w.BinaryWriter.create()){return k.moniker!==""&&v.uint32(10).string(k.moniker),k.identity!==""&&v.uint32(18).string(k.identity),k.website!==""&&v.uint32(26).string(k.website),k.securityContact!==""&&v.uint32(34).string(k.securityContact),k.details!==""&&v.uint32(42).string(k.details),v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=B();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.moniker=A.string();break;case 2:K.identity=A.string();break;case 3:K.website=A.string();break;case 4:K.securityContact=A.string();break;case 5:K.details=A.string();break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=B();return(0,E.isSet)(k.moniker)&&(v.moniker=String(k.moniker)),(0,E.isSet)(k.identity)&&(v.identity=String(k.identity)),(0,E.isSet)(k.website)&&(v.website=String(k.website)),(0,E.isSet)(k.securityContact)&&(v.securityContact=String(k.securityContact)),(0,E.isSet)(k.details)&&(v.details=String(k.details)),v},toJSON(k){const v={};return k.moniker!==void 0&&(v.moniker=k.moniker),k.identity!==void 0&&(v.identity=k.identity),k.website!==void 0&&(v.website=k.website),k.securityContact!==void 0&&(v.securityContact=k.securityContact),k.details!==void 0&&(v.details=k.details),v},fromPartial(k){const v=B();return v.moniker=k.moniker??"",v.identity=k.identity??"",v.website=k.website??"",v.securityContact=k.securityContact??"",v.details=k.details??"",v}};function N(){return{operatorAddress:"",consensusPubkey:void 0,jailed:!1,status:0,tokens:"",delegatorShares:"",description:e.Description.fromPartial({}),unbondingHeight:BigInt(0),unbondingTime:t.Timestamp.fromPartial({}),commission:e.Commission.fromPartial({}),minSelfDelegation:"",unbondingOnHoldRefCount:BigInt(0),unbondingIds:[]}}e.Validator={typeUrl:"/cosmos.staking.v1beta1.Validator",encode(k,v=w.BinaryWriter.create()){k.operatorAddress!==""&&v.uint32(10).string(k.operatorAddress),k.consensusPubkey!==void 0&&i.Any.encode(k.consensusPubkey,v.uint32(18).fork()).ldelim(),k.jailed===!0&&v.uint32(24).bool(k.jailed),k.status!==0&&v.uint32(32).int32(k.status),k.tokens!==""&&v.uint32(42).string(k.tokens),k.delegatorShares!==""&&v.uint32(50).string(k.delegatorShares),k.description!==void 0&&e.Description.encode(k.description,v.uint32(58).fork()).ldelim(),k.unbondingHeight!==BigInt(0)&&v.uint32(64).int64(k.unbondingHeight),k.unbondingTime!==void 0&&t.Timestamp.encode(k.unbondingTime,v.uint32(74).fork()).ldelim(),k.commission!==void 0&&e.Commission.encode(k.commission,v.uint32(82).fork()).ldelim(),k.minSelfDelegation!==""&&v.uint32(90).string(k.minSelfDelegation),k.unbondingOnHoldRefCount!==BigInt(0)&&v.uint32(96).int64(k.unbondingOnHoldRefCount),v.uint32(106).fork();for(const A of k.unbondingIds)v.uint64(A);return v.ldelim(),v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=N();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.operatorAddress=A.string();break;case 2:K.consensusPubkey=i.Any.decode(A,A.uint32());break;case 3:K.jailed=A.bool();break;case 4:K.status=A.int32();break;case 5:K.tokens=A.string();break;case 6:K.delegatorShares=A.string();break;case 7:K.description=e.Description.decode(A,A.uint32());break;case 8:K.unbondingHeight=A.int64();break;case 9:K.unbondingTime=t.Timestamp.decode(A,A.uint32());break;case 10:K.commission=e.Commission.decode(A,A.uint32());break;case 11:K.minSelfDelegation=A.string();break;case 12:K.unbondingOnHoldRefCount=A.int64();break;case 13:if(($&7)===2){const j=A.uint32()+A.pos;for(;A.pos<j;)K.unbondingIds.push(A.uint64())}else K.unbondingIds.push(A.uint64());break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=N();return(0,E.isSet)(k.operatorAddress)&&(v.operatorAddress=String(k.operatorAddress)),(0,E.isSet)(k.consensusPubkey)&&(v.consensusPubkey=i.Any.fromJSON(k.consensusPubkey)),(0,E.isSet)(k.jailed)&&(v.jailed=!!k.jailed),(0,E.isSet)(k.status)&&(v.status=J(k.status)),(0,E.isSet)(k.tokens)&&(v.tokens=String(k.tokens)),(0,E.isSet)(k.delegatorShares)&&(v.delegatorShares=String(k.delegatorShares)),(0,E.isSet)(k.description)&&(v.description=e.Description.fromJSON(k.description)),(0,E.isSet)(k.unbondingHeight)&&(v.unbondingHeight=BigInt(k.unbondingHeight.toString())),(0,E.isSet)(k.unbondingTime)&&(v.unbondingTime=(0,E.fromJsonTimestamp)(k.unbondingTime)),(0,E.isSet)(k.commission)&&(v.commission=e.Commission.fromJSON(k.commission)),(0,E.isSet)(k.minSelfDelegation)&&(v.minSelfDelegation=String(k.minSelfDelegation)),(0,E.isSet)(k.unbondingOnHoldRefCount)&&(v.unbondingOnHoldRefCount=BigInt(k.unbondingOnHoldRefCount.toString())),Array.isArray(k==null?void 0:k.unbondingIds)&&(v.unbondingIds=k.unbondingIds.map(A=>BigInt(A.toString()))),v},toJSON(k){const v={};return k.operatorAddress!==void 0&&(v.operatorAddress=k.operatorAddress),k.consensusPubkey!==void 0&&(v.consensusPubkey=k.consensusPubkey?i.Any.toJSON(k.consensusPubkey):void 0),k.jailed!==void 0&&(v.jailed=k.jailed),k.status!==void 0&&(v.status=b(k.status)),k.tokens!==void 0&&(v.tokens=k.tokens),k.delegatorShares!==void 0&&(v.delegatorShares=k.delegatorShares),k.description!==void 0&&(v.description=k.description?e.Description.toJSON(k.description):void 0),k.unbondingHeight!==void 0&&(v.unbondingHeight=(k.unbondingHeight||BigInt(0)).toString()),k.unbondingTime!==void 0&&(v.unbondingTime=(0,E.fromTimestamp)(k.unbondingTime).toISOString()),k.commission!==void 0&&(v.commission=k.commission?e.Commission.toJSON(k.commission):void 0),k.minSelfDelegation!==void 0&&(v.minSelfDelegation=k.minSelfDelegation),k.unbondingOnHoldRefCount!==void 0&&(v.unbondingOnHoldRefCount=(k.unbondingOnHoldRefCount||BigInt(0)).toString()),k.unbondingIds?v.unbondingIds=k.unbondingIds.map(A=>(A||BigInt(0)).toString()):v.unbondingIds=[],v},fromPartial(k){var A;const v=N();return v.operatorAddress=k.operatorAddress??"",k.consensusPubkey!==void 0&&k.consensusPubkey!==null&&(v.consensusPubkey=i.Any.fromPartial(k.consensusPubkey)),v.jailed=k.jailed??!1,v.status=k.status??0,v.tokens=k.tokens??"",v.delegatorShares=k.delegatorShares??"",k.description!==void 0&&k.description!==null&&(v.description=e.Description.fromPartial(k.description)),k.unbondingHeight!==void 0&&k.unbondingHeight!==null&&(v.unbondingHeight=BigInt(k.unbondingHeight.toString())),k.unbondingTime!==void 0&&k.unbondingTime!==null&&(v.unbondingTime=t.Timestamp.fromPartial(k.unbondingTime)),k.commission!==void 0&&k.commission!==null&&(v.commission=e.Commission.fromPartial(k.commission)),v.minSelfDelegation=k.minSelfDelegation??"",k.unbondingOnHoldRefCount!==void 0&&k.unbondingOnHoldRefCount!==null&&(v.unbondingOnHoldRefCount=BigInt(k.unbondingOnHoldRefCount.toString())),v.unbondingIds=((A=k.unbondingIds)==null?void 0:A.map(F=>BigInt(F.toString())))||[],v}};function U(){return{addresses:[]}}e.ValAddresses={typeUrl:"/cosmos.staking.v1beta1.ValAddresses",encode(k,v=w.BinaryWriter.create()){for(const A of k.addresses)v.uint32(10).string(A);return v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=U();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.addresses.push(A.string());break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=U();return Array.isArray(k==null?void 0:k.addresses)&&(v.addresses=k.addresses.map(A=>String(A))),v},toJSON(k){const v={};return k.addresses?v.addresses=k.addresses.map(A=>A):v.addresses=[],v},fromPartial(k){var A;const v=U();return v.addresses=((A=k.addresses)==null?void 0:A.map(F=>F))||[],v}};function W(){return{delegatorAddress:"",validatorAddress:""}}e.DVPair={typeUrl:"/cosmos.staking.v1beta1.DVPair",encode(k,v=w.BinaryWriter.create()){return k.delegatorAddress!==""&&v.uint32(10).string(k.delegatorAddress),k.validatorAddress!==""&&v.uint32(18).string(k.validatorAddress),v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=W();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.delegatorAddress=A.string();break;case 2:K.validatorAddress=A.string();break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=W();return(0,E.isSet)(k.delegatorAddress)&&(v.delegatorAddress=String(k.delegatorAddress)),(0,E.isSet)(k.validatorAddress)&&(v.validatorAddress=String(k.validatorAddress)),v},toJSON(k){const v={};return k.delegatorAddress!==void 0&&(v.delegatorAddress=k.delegatorAddress),k.validatorAddress!==void 0&&(v.validatorAddress=k.validatorAddress),v},fromPartial(k){const v=W();return v.delegatorAddress=k.delegatorAddress??"",v.validatorAddress=k.validatorAddress??"",v}};function r(){return{pairs:[]}}e.DVPairs={typeUrl:"/cosmos.staking.v1beta1.DVPairs",encode(k,v=w.BinaryWriter.create()){for(const A of k.pairs)e.DVPair.encode(A,v.uint32(10).fork()).ldelim();return v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=r();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.pairs.push(e.DVPair.decode(A,A.uint32()));break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=r();return Array.isArray(k==null?void 0:k.pairs)&&(v.pairs=k.pairs.map(A=>e.DVPair.fromJSON(A))),v},toJSON(k){const v={};return k.pairs?v.pairs=k.pairs.map(A=>A?e.DVPair.toJSON(A):void 0):v.pairs=[],v},fromPartial(k){var A;const v=r();return v.pairs=((A=k.pairs)==null?void 0:A.map(F=>e.DVPair.fromPartial(F)))||[],v}};function s(){return{delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:""}}e.DVVTriplet={typeUrl:"/cosmos.staking.v1beta1.DVVTriplet",encode(k,v=w.BinaryWriter.create()){return k.delegatorAddress!==""&&v.uint32(10).string(k.delegatorAddress),k.validatorSrcAddress!==""&&v.uint32(18).string(k.validatorSrcAddress),k.validatorDstAddress!==""&&v.uint32(26).string(k.validatorDstAddress),v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=s();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.delegatorAddress=A.string();break;case 2:K.validatorSrcAddress=A.string();break;case 3:K.validatorDstAddress=A.string();break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=s();return(0,E.isSet)(k.delegatorAddress)&&(v.delegatorAddress=String(k.delegatorAddress)),(0,E.isSet)(k.validatorSrcAddress)&&(v.validatorSrcAddress=String(k.validatorSrcAddress)),(0,E.isSet)(k.validatorDstAddress)&&(v.validatorDstAddress=String(k.validatorDstAddress)),v},toJSON(k){const v={};return k.delegatorAddress!==void 0&&(v.delegatorAddress=k.delegatorAddress),k.validatorSrcAddress!==void 0&&(v.validatorSrcAddress=k.validatorSrcAddress),k.validatorDstAddress!==void 0&&(v.validatorDstAddress=k.validatorDstAddress),v},fromPartial(k){const v=s();return v.delegatorAddress=k.delegatorAddress??"",v.validatorSrcAddress=k.validatorSrcAddress??"",v.validatorDstAddress=k.validatorDstAddress??"",v}};function O(){return{triplets:[]}}e.DVVTriplets={typeUrl:"/cosmos.staking.v1beta1.DVVTriplets",encode(k,v=w.BinaryWriter.create()){for(const A of k.triplets)e.DVVTriplet.encode(A,v.uint32(10).fork()).ldelim();return v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=O();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.triplets.push(e.DVVTriplet.decode(A,A.uint32()));break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=O();return Array.isArray(k==null?void 0:k.triplets)&&(v.triplets=k.triplets.map(A=>e.DVVTriplet.fromJSON(A))),v},toJSON(k){const v={};return k.triplets?v.triplets=k.triplets.map(A=>A?e.DVVTriplet.toJSON(A):void 0):v.triplets=[],v},fromPartial(k){var A;const v=O();return v.triplets=((A=k.triplets)==null?void 0:A.map(F=>e.DVVTriplet.fromPartial(F)))||[],v}};function q(){return{delegatorAddress:"",validatorAddress:"",shares:""}}e.Delegation={typeUrl:"/cosmos.staking.v1beta1.Delegation",encode(k,v=w.BinaryWriter.create()){return k.delegatorAddress!==""&&v.uint32(10).string(k.delegatorAddress),k.validatorAddress!==""&&v.uint32(18).string(k.validatorAddress),k.shares!==""&&v.uint32(26).string(k.shares),v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=q();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.delegatorAddress=A.string();break;case 2:K.validatorAddress=A.string();break;case 3:K.shares=A.string();break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=q();return(0,E.isSet)(k.delegatorAddress)&&(v.delegatorAddress=String(k.delegatorAddress)),(0,E.isSet)(k.validatorAddress)&&(v.validatorAddress=String(k.validatorAddress)),(0,E.isSet)(k.shares)&&(v.shares=String(k.shares)),v},toJSON(k){const v={};return k.delegatorAddress!==void 0&&(v.delegatorAddress=k.delegatorAddress),k.validatorAddress!==void 0&&(v.validatorAddress=k.validatorAddress),k.shares!==void 0&&(v.shares=k.shares),v},fromPartial(k){const v=q();return v.delegatorAddress=k.delegatorAddress??"",v.validatorAddress=k.validatorAddress??"",v.shares=k.shares??"",v}};function d(){return{delegatorAddress:"",validatorAddress:"",entries:[]}}e.UnbondingDelegation={typeUrl:"/cosmos.staking.v1beta1.UnbondingDelegation",encode(k,v=w.BinaryWriter.create()){k.delegatorAddress!==""&&v.uint32(10).string(k.delegatorAddress),k.validatorAddress!==""&&v.uint32(18).string(k.validatorAddress);for(const A of k.entries)e.UnbondingDelegationEntry.encode(A,v.uint32(26).fork()).ldelim();return v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=d();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.delegatorAddress=A.string();break;case 2:K.validatorAddress=A.string();break;case 3:K.entries.push(e.UnbondingDelegationEntry.decode(A,A.uint32()));break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=d();return(0,E.isSet)(k.delegatorAddress)&&(v.delegatorAddress=String(k.delegatorAddress)),(0,E.isSet)(k.validatorAddress)&&(v.validatorAddress=String(k.validatorAddress)),Array.isArray(k==null?void 0:k.entries)&&(v.entries=k.entries.map(A=>e.UnbondingDelegationEntry.fromJSON(A))),v},toJSON(k){const v={};return k.delegatorAddress!==void 0&&(v.delegatorAddress=k.delegatorAddress),k.validatorAddress!==void 0&&(v.validatorAddress=k.validatorAddress),k.entries?v.entries=k.entries.map(A=>A?e.UnbondingDelegationEntry.toJSON(A):void 0):v.entries=[],v},fromPartial(k){var A;const v=d();return v.delegatorAddress=k.delegatorAddress??"",v.validatorAddress=k.validatorAddress??"",v.entries=((A=k.entries)==null?void 0:A.map(F=>e.UnbondingDelegationEntry.fromPartial(F)))||[],v}};function l(){return{creationHeight:BigInt(0),completionTime:t.Timestamp.fromPartial({}),initialBalance:"",balance:"",unbondingId:BigInt(0),unbondingOnHoldRefCount:BigInt(0)}}e.UnbondingDelegationEntry={typeUrl:"/cosmos.staking.v1beta1.UnbondingDelegationEntry",encode(k,v=w.BinaryWriter.create()){return k.creationHeight!==BigInt(0)&&v.uint32(8).int64(k.creationHeight),k.completionTime!==void 0&&t.Timestamp.encode(k.completionTime,v.uint32(18).fork()).ldelim(),k.initialBalance!==""&&v.uint32(26).string(k.initialBalance),k.balance!==""&&v.uint32(34).string(k.balance),k.unbondingId!==BigInt(0)&&v.uint32(40).uint64(k.unbondingId),k.unbondingOnHoldRefCount!==BigInt(0)&&v.uint32(48).int64(k.unbondingOnHoldRefCount),v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=l();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.creationHeight=A.int64();break;case 2:K.completionTime=t.Timestamp.decode(A,A.uint32());break;case 3:K.initialBalance=A.string();break;case 4:K.balance=A.string();break;case 5:K.unbondingId=A.uint64();break;case 6:K.unbondingOnHoldRefCount=A.int64();break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=l();return(0,E.isSet)(k.creationHeight)&&(v.creationHeight=BigInt(k.creationHeight.toString())),(0,E.isSet)(k.completionTime)&&(v.completionTime=(0,E.fromJsonTimestamp)(k.completionTime)),(0,E.isSet)(k.initialBalance)&&(v.initialBalance=String(k.initialBalance)),(0,E.isSet)(k.balance)&&(v.balance=String(k.balance)),(0,E.isSet)(k.unbondingId)&&(v.unbondingId=BigInt(k.unbondingId.toString())),(0,E.isSet)(k.unbondingOnHoldRefCount)&&(v.unbondingOnHoldRefCount=BigInt(k.unbondingOnHoldRefCount.toString())),v},toJSON(k){const v={};return k.creationHeight!==void 0&&(v.creationHeight=(k.creationHeight||BigInt(0)).toString()),k.completionTime!==void 0&&(v.completionTime=(0,E.fromTimestamp)(k.completionTime).toISOString()),k.initialBalance!==void 0&&(v.initialBalance=k.initialBalance),k.balance!==void 0&&(v.balance=k.balance),k.unbondingId!==void 0&&(v.unbondingId=(k.unbondingId||BigInt(0)).toString()),k.unbondingOnHoldRefCount!==void 0&&(v.unbondingOnHoldRefCount=(k.unbondingOnHoldRefCount||BigInt(0)).toString()),v},fromPartial(k){const v=l();return k.creationHeight!==void 0&&k.creationHeight!==null&&(v.creationHeight=BigInt(k.creationHeight.toString())),k.completionTime!==void 0&&k.completionTime!==null&&(v.completionTime=t.Timestamp.fromPartial(k.completionTime)),v.initialBalance=k.initialBalance??"",v.balance=k.balance??"",k.unbondingId!==void 0&&k.unbondingId!==null&&(v.unbondingId=BigInt(k.unbondingId.toString())),k.unbondingOnHoldRefCount!==void 0&&k.unbondingOnHoldRefCount!==null&&(v.unbondingOnHoldRefCount=BigInt(k.unbondingOnHoldRefCount.toString())),v}};function M(){return{creationHeight:BigInt(0),completionTime:t.Timestamp.fromPartial({}),initialBalance:"",sharesDst:"",unbondingId:BigInt(0),unbondingOnHoldRefCount:BigInt(0)}}e.RedelegationEntry={typeUrl:"/cosmos.staking.v1beta1.RedelegationEntry",encode(k,v=w.BinaryWriter.create()){return k.creationHeight!==BigInt(0)&&v.uint32(8).int64(k.creationHeight),k.completionTime!==void 0&&t.Timestamp.encode(k.completionTime,v.uint32(18).fork()).ldelim(),k.initialBalance!==""&&v.uint32(26).string(k.initialBalance),k.sharesDst!==""&&v.uint32(34).string(k.sharesDst),k.unbondingId!==BigInt(0)&&v.uint32(40).uint64(k.unbondingId),k.unbondingOnHoldRefCount!==BigInt(0)&&v.uint32(48).int64(k.unbondingOnHoldRefCount),v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=M();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.creationHeight=A.int64();break;case 2:K.completionTime=t.Timestamp.decode(A,A.uint32());break;case 3:K.initialBalance=A.string();break;case 4:K.sharesDst=A.string();break;case 5:K.unbondingId=A.uint64();break;case 6:K.unbondingOnHoldRefCount=A.int64();break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=M();return(0,E.isSet)(k.creationHeight)&&(v.creationHeight=BigInt(k.creationHeight.toString())),(0,E.isSet)(k.completionTime)&&(v.completionTime=(0,E.fromJsonTimestamp)(k.completionTime)),(0,E.isSet)(k.initialBalance)&&(v.initialBalance=String(k.initialBalance)),(0,E.isSet)(k.sharesDst)&&(v.sharesDst=String(k.sharesDst)),(0,E.isSet)(k.unbondingId)&&(v.unbondingId=BigInt(k.unbondingId.toString())),(0,E.isSet)(k.unbondingOnHoldRefCount)&&(v.unbondingOnHoldRefCount=BigInt(k.unbondingOnHoldRefCount.toString())),v},toJSON(k){const v={};return k.creationHeight!==void 0&&(v.creationHeight=(k.creationHeight||BigInt(0)).toString()),k.completionTime!==void 0&&(v.completionTime=(0,E.fromTimestamp)(k.completionTime).toISOString()),k.initialBalance!==void 0&&(v.initialBalance=k.initialBalance),k.sharesDst!==void 0&&(v.sharesDst=k.sharesDst),k.unbondingId!==void 0&&(v.unbondingId=(k.unbondingId||BigInt(0)).toString()),k.unbondingOnHoldRefCount!==void 0&&(v.unbondingOnHoldRefCount=(k.unbondingOnHoldRefCount||BigInt(0)).toString()),v},fromPartial(k){const v=M();return k.creationHeight!==void 0&&k.creationHeight!==null&&(v.creationHeight=BigInt(k.creationHeight.toString())),k.completionTime!==void 0&&k.completionTime!==null&&(v.completionTime=t.Timestamp.fromPartial(k.completionTime)),v.initialBalance=k.initialBalance??"",v.sharesDst=k.sharesDst??"",k.unbondingId!==void 0&&k.unbondingId!==null&&(v.unbondingId=BigInt(k.unbondingId.toString())),k.unbondingOnHoldRefCount!==void 0&&k.unbondingOnHoldRefCount!==null&&(v.unbondingOnHoldRefCount=BigInt(k.unbondingOnHoldRefCount.toString())),v}};function m(){return{delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:"",entries:[]}}e.Redelegation={typeUrl:"/cosmos.staking.v1beta1.Redelegation",encode(k,v=w.BinaryWriter.create()){k.delegatorAddress!==""&&v.uint32(10).string(k.delegatorAddress),k.validatorSrcAddress!==""&&v.uint32(18).string(k.validatorSrcAddress),k.validatorDstAddress!==""&&v.uint32(26).string(k.validatorDstAddress);for(const A of k.entries)e.RedelegationEntry.encode(A,v.uint32(34).fork()).ldelim();return v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=m();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.delegatorAddress=A.string();break;case 2:K.validatorSrcAddress=A.string();break;case 3:K.validatorDstAddress=A.string();break;case 4:K.entries.push(e.RedelegationEntry.decode(A,A.uint32()));break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=m();return(0,E.isSet)(k.delegatorAddress)&&(v.delegatorAddress=String(k.delegatorAddress)),(0,E.isSet)(k.validatorSrcAddress)&&(v.validatorSrcAddress=String(k.validatorSrcAddress)),(0,E.isSet)(k.validatorDstAddress)&&(v.validatorDstAddress=String(k.validatorDstAddress)),Array.isArray(k==null?void 0:k.entries)&&(v.entries=k.entries.map(A=>e.RedelegationEntry.fromJSON(A))),v},toJSON(k){const v={};return k.delegatorAddress!==void 0&&(v.delegatorAddress=k.delegatorAddress),k.validatorSrcAddress!==void 0&&(v.validatorSrcAddress=k.validatorSrcAddress),k.validatorDstAddress!==void 0&&(v.validatorDstAddress=k.validatorDstAddress),k.entries?v.entries=k.entries.map(A=>A?e.RedelegationEntry.toJSON(A):void 0):v.entries=[],v},fromPartial(k){var A;const v=m();return v.delegatorAddress=k.delegatorAddress??"",v.validatorSrcAddress=k.validatorSrcAddress??"",v.validatorDstAddress=k.validatorDstAddress??"",v.entries=((A=k.entries)==null?void 0:A.map(F=>e.RedelegationEntry.fromPartial(F)))||[],v}};function h(){return{unbondingTime:o.Duration.fromPartial({}),maxValidators:0,maxEntries:0,historicalEntries:0,bondDenom:"",minCommissionRate:""}}e.Params={typeUrl:"/cosmos.staking.v1beta1.Params",encode(k,v=w.BinaryWriter.create()){return k.unbondingTime!==void 0&&o.Duration.encode(k.unbondingTime,v.uint32(10).fork()).ldelim(),k.maxValidators!==0&&v.uint32(16).uint32(k.maxValidators),k.maxEntries!==0&&v.uint32(24).uint32(k.maxEntries),k.historicalEntries!==0&&v.uint32(32).uint32(k.historicalEntries),k.bondDenom!==""&&v.uint32(42).string(k.bondDenom),k.minCommissionRate!==""&&v.uint32(50).string(k.minCommissionRate),v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=h();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.unbondingTime=o.Duration.decode(A,A.uint32());break;case 2:K.maxValidators=A.uint32();break;case 3:K.maxEntries=A.uint32();break;case 4:K.historicalEntries=A.uint32();break;case 5:K.bondDenom=A.string();break;case 6:K.minCommissionRate=A.string();break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=h();return(0,E.isSet)(k.unbondingTime)&&(v.unbondingTime=o.Duration.fromJSON(k.unbondingTime)),(0,E.isSet)(k.maxValidators)&&(v.maxValidators=Number(k.maxValidators)),(0,E.isSet)(k.maxEntries)&&(v.maxEntries=Number(k.maxEntries)),(0,E.isSet)(k.historicalEntries)&&(v.historicalEntries=Number(k.historicalEntries)),(0,E.isSet)(k.bondDenom)&&(v.bondDenom=String(k.bondDenom)),(0,E.isSet)(k.minCommissionRate)&&(v.minCommissionRate=String(k.minCommissionRate)),v},toJSON(k){const v={};return k.unbondingTime!==void 0&&(v.unbondingTime=k.unbondingTime?o.Duration.toJSON(k.unbondingTime):void 0),k.maxValidators!==void 0&&(v.maxValidators=Math.round(k.maxValidators)),k.maxEntries!==void 0&&(v.maxEntries=Math.round(k.maxEntries)),k.historicalEntries!==void 0&&(v.historicalEntries=Math.round(k.historicalEntries)),k.bondDenom!==void 0&&(v.bondDenom=k.bondDenom),k.minCommissionRate!==void 0&&(v.minCommissionRate=k.minCommissionRate),v},fromPartial(k){const v=h();return k.unbondingTime!==void 0&&k.unbondingTime!==null&&(v.unbondingTime=o.Duration.fromPartial(k.unbondingTime)),v.maxValidators=k.maxValidators??0,v.maxEntries=k.maxEntries??0,v.historicalEntries=k.historicalEntries??0,v.bondDenom=k.bondDenom??"",v.minCommissionRate=k.minCommissionRate??"",v}};function T(){return{delegation:e.Delegation.fromPartial({}),balance:g.Coin.fromPartial({})}}e.DelegationResponse={typeUrl:"/cosmos.staking.v1beta1.DelegationResponse",encode(k,v=w.BinaryWriter.create()){return k.delegation!==void 0&&e.Delegation.encode(k.delegation,v.uint32(10).fork()).ldelim(),k.balance!==void 0&&g.Coin.encode(k.balance,v.uint32(18).fork()).ldelim(),v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=T();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.delegation=e.Delegation.decode(A,A.uint32());break;case 2:K.balance=g.Coin.decode(A,A.uint32());break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=T();return(0,E.isSet)(k.delegation)&&(v.delegation=e.Delegation.fromJSON(k.delegation)),(0,E.isSet)(k.balance)&&(v.balance=g.Coin.fromJSON(k.balance)),v},toJSON(k){const v={};return k.delegation!==void 0&&(v.delegation=k.delegation?e.Delegation.toJSON(k.delegation):void 0),k.balance!==void 0&&(v.balance=k.balance?g.Coin.toJSON(k.balance):void 0),v},fromPartial(k){const v=T();return k.delegation!==void 0&&k.delegation!==null&&(v.delegation=e.Delegation.fromPartial(k.delegation)),k.balance!==void 0&&k.balance!==null&&(v.balance=g.Coin.fromPartial(k.balance)),v}};function Q(){return{redelegationEntry:e.RedelegationEntry.fromPartial({}),balance:""}}e.RedelegationEntryResponse={typeUrl:"/cosmos.staking.v1beta1.RedelegationEntryResponse",encode(k,v=w.BinaryWriter.create()){return k.redelegationEntry!==void 0&&e.RedelegationEntry.encode(k.redelegationEntry,v.uint32(10).fork()).ldelim(),k.balance!==""&&v.uint32(34).string(k.balance),v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=Q();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.redelegationEntry=e.RedelegationEntry.decode(A,A.uint32());break;case 4:K.balance=A.string();break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=Q();return(0,E.isSet)(k.redelegationEntry)&&(v.redelegationEntry=e.RedelegationEntry.fromJSON(k.redelegationEntry)),(0,E.isSet)(k.balance)&&(v.balance=String(k.balance)),v},toJSON(k){const v={};return k.redelegationEntry!==void 0&&(v.redelegationEntry=k.redelegationEntry?e.RedelegationEntry.toJSON(k.redelegationEntry):void 0),k.balance!==void 0&&(v.balance=k.balance),v},fromPartial(k){const v=Q();return k.redelegationEntry!==void 0&&k.redelegationEntry!==null&&(v.redelegationEntry=e.RedelegationEntry.fromPartial(k.redelegationEntry)),v.balance=k.balance??"",v}};function H(){return{redelegation:e.Redelegation.fromPartial({}),entries:[]}}e.RedelegationResponse={typeUrl:"/cosmos.staking.v1beta1.RedelegationResponse",encode(k,v=w.BinaryWriter.create()){k.redelegation!==void 0&&e.Redelegation.encode(k.redelegation,v.uint32(10).fork()).ldelim();for(const A of k.entries)e.RedelegationEntryResponse.encode(A,v.uint32(18).fork()).ldelim();return v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=H();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.redelegation=e.Redelegation.decode(A,A.uint32());break;case 2:K.entries.push(e.RedelegationEntryResponse.decode(A,A.uint32()));break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=H();return(0,E.isSet)(k.redelegation)&&(v.redelegation=e.Redelegation.fromJSON(k.redelegation)),Array.isArray(k==null?void 0:k.entries)&&(v.entries=k.entries.map(A=>e.RedelegationEntryResponse.fromJSON(A))),v},toJSON(k){const v={};return k.redelegation!==void 0&&(v.redelegation=k.redelegation?e.Redelegation.toJSON(k.redelegation):void 0),k.entries?v.entries=k.entries.map(A=>A?e.RedelegationEntryResponse.toJSON(A):void 0):v.entries=[],v},fromPartial(k){var A;const v=H();return k.redelegation!==void 0&&k.redelegation!==null&&(v.redelegation=e.Redelegation.fromPartial(k.redelegation)),v.entries=((A=k.entries)==null?void 0:A.map(F=>e.RedelegationEntryResponse.fromPartial(F)))||[],v}};function a(){return{notBondedTokens:"",bondedTokens:""}}e.Pool={typeUrl:"/cosmos.staking.v1beta1.Pool",encode(k,v=w.BinaryWriter.create()){return k.notBondedTokens!==""&&v.uint32(10).string(k.notBondedTokens),k.bondedTokens!==""&&v.uint32(18).string(k.bondedTokens),v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=a();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.notBondedTokens=A.string();break;case 2:K.bondedTokens=A.string();break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=a();return(0,E.isSet)(k.notBondedTokens)&&(v.notBondedTokens=String(k.notBondedTokens)),(0,E.isSet)(k.bondedTokens)&&(v.bondedTokens=String(k.bondedTokens)),v},toJSON(k){const v={};return k.notBondedTokens!==void 0&&(v.notBondedTokens=k.notBondedTokens),k.bondedTokens!==void 0&&(v.bondedTokens=k.bondedTokens),v},fromPartial(k){const v=a();return v.notBondedTokens=k.notBondedTokens??"",v.bondedTokens=k.bondedTokens??"",v}};function P(){return{updates:[]}}e.ValidatorUpdates={typeUrl:"/cosmos.staking.v1beta1.ValidatorUpdates",encode(k,v=w.BinaryWriter.create()){for(const A of k.updates)C.ValidatorUpdate.encode(A,v.uint32(10).fork()).ldelim();return v},decode(k,v){const A=k instanceof w.BinaryReader?k:new w.BinaryReader(k);let F=v===void 0?A.len:A.pos+v;const K=P();for(;A.pos<F;){const $=A.uint32();switch($>>>3){case 1:K.updates.push(C.ValidatorUpdate.decode(A,A.uint32()));break;default:A.skipType($&7);break}}return K},fromJSON(k){const v=P();return Array.isArray(k==null?void 0:k.updates)&&(v.updates=k.updates.map(A=>C.ValidatorUpdate.fromJSON(A))),v},toJSON(k){const v={};return k.updates?v.updates=k.updates.map(A=>A?C.ValidatorUpdate.toJSON(A):void 0):v.updates=[],v},fromPartial(k){var A;const v=P();return v.updates=((A=k.updates)==null?void 0:A.map(F=>C.ValidatorUpdate.fromPartial(F)))||[],v}}})(Uc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgUpdateParamsResponse=e.MsgUpdateParams=e.MsgCancelUnbondingDelegationResponse=e.MsgCancelUnbondingDelegation=e.MsgUndelegateResponse=e.MsgUndelegate=e.MsgBeginRedelegateResponse=e.MsgBeginRedelegate=e.MsgDelegateResponse=e.MsgDelegate=e.MsgEditValidatorResponse=e.MsgEditValidator=e.MsgCreateValidatorResponse=e.MsgCreateValidator=e.protobufPackage=void 0;const n=Uc,t=_.any,i=_.coin,o=Je,g=_.binary,C=_.helpers;e.protobufPackage="cosmos.staking.v1beta1";function w(){return{description:n.Description.fromPartial({}),commission:n.CommissionRates.fromPartial({}),minSelfDelegation:"",delegatorAddress:"",validatorAddress:"",pubkey:void 0,value:i.Coin.fromPartial({})}}e.MsgCreateValidator={typeUrl:"/cosmos.staking.v1beta1.MsgCreateValidator",encode(r,s=g.BinaryWriter.create()){return r.description!==void 0&&n.Description.encode(r.description,s.uint32(10).fork()).ldelim(),r.commission!==void 0&&n.CommissionRates.encode(r.commission,s.uint32(18).fork()).ldelim(),r.minSelfDelegation!==""&&s.uint32(26).string(r.minSelfDelegation),r.delegatorAddress!==""&&s.uint32(34).string(r.delegatorAddress),r.validatorAddress!==""&&s.uint32(42).string(r.validatorAddress),r.pubkey!==void 0&&t.Any.encode(r.pubkey,s.uint32(50).fork()).ldelim(),r.value!==void 0&&i.Coin.encode(r.value,s.uint32(58).fork()).ldelim(),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=w();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.description=n.Description.decode(O,O.uint32());break;case 2:d.commission=n.CommissionRates.decode(O,O.uint32());break;case 3:d.minSelfDelegation=O.string();break;case 4:d.delegatorAddress=O.string();break;case 5:d.validatorAddress=O.string();break;case 6:d.pubkey=t.Any.decode(O,O.uint32());break;case 7:d.value=i.Coin.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=w();return(0,C.isSet)(r.description)&&(s.description=n.Description.fromJSON(r.description)),(0,C.isSet)(r.commission)&&(s.commission=n.CommissionRates.fromJSON(r.commission)),(0,C.isSet)(r.minSelfDelegation)&&(s.minSelfDelegation=String(r.minSelfDelegation)),(0,C.isSet)(r.delegatorAddress)&&(s.delegatorAddress=String(r.delegatorAddress)),(0,C.isSet)(r.validatorAddress)&&(s.validatorAddress=String(r.validatorAddress)),(0,C.isSet)(r.pubkey)&&(s.pubkey=t.Any.fromJSON(r.pubkey)),(0,C.isSet)(r.value)&&(s.value=i.Coin.fromJSON(r.value)),s},toJSON(r){const s={};return r.description!==void 0&&(s.description=r.description?n.Description.toJSON(r.description):void 0),r.commission!==void 0&&(s.commission=r.commission?n.CommissionRates.toJSON(r.commission):void 0),r.minSelfDelegation!==void 0&&(s.minSelfDelegation=r.minSelfDelegation),r.delegatorAddress!==void 0&&(s.delegatorAddress=r.delegatorAddress),r.validatorAddress!==void 0&&(s.validatorAddress=r.validatorAddress),r.pubkey!==void 0&&(s.pubkey=r.pubkey?t.Any.toJSON(r.pubkey):void 0),r.value!==void 0&&(s.value=r.value?i.Coin.toJSON(r.value):void 0),s},fromPartial(r){const s=w();return r.description!==void 0&&r.description!==null&&(s.description=n.Description.fromPartial(r.description)),r.commission!==void 0&&r.commission!==null&&(s.commission=n.CommissionRates.fromPartial(r.commission)),s.minSelfDelegation=r.minSelfDelegation??"",s.delegatorAddress=r.delegatorAddress??"",s.validatorAddress=r.validatorAddress??"",r.pubkey!==void 0&&r.pubkey!==null&&(s.pubkey=t.Any.fromPartial(r.pubkey)),r.value!==void 0&&r.value!==null&&(s.value=i.Coin.fromPartial(r.value)),s}};function E(){return{}}e.MsgCreateValidatorResponse={typeUrl:"/cosmos.staking.v1beta1.MsgCreateValidatorResponse",encode(r,s=g.BinaryWriter.create()){return s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=E();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){default:O.skipType(l&7);break}}return d},fromJSON(r){return E()},toJSON(r){return{}},fromPartial(r){return E()}};function D(){return{description:n.Description.fromPartial({}),validatorAddress:"",commissionRate:"",minSelfDelegation:""}}e.MsgEditValidator={typeUrl:"/cosmos.staking.v1beta1.MsgEditValidator",encode(r,s=g.BinaryWriter.create()){return r.description!==void 0&&n.Description.encode(r.description,s.uint32(10).fork()).ldelim(),r.validatorAddress!==""&&s.uint32(18).string(r.validatorAddress),r.commissionRate!==""&&s.uint32(26).string(r.commissionRate),r.minSelfDelegation!==""&&s.uint32(34).string(r.minSelfDelegation),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=D();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.description=n.Description.decode(O,O.uint32());break;case 2:d.validatorAddress=O.string();break;case 3:d.commissionRate=O.string();break;case 4:d.minSelfDelegation=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=D();return(0,C.isSet)(r.description)&&(s.description=n.Description.fromJSON(r.description)),(0,C.isSet)(r.validatorAddress)&&(s.validatorAddress=String(r.validatorAddress)),(0,C.isSet)(r.commissionRate)&&(s.commissionRate=String(r.commissionRate)),(0,C.isSet)(r.minSelfDelegation)&&(s.minSelfDelegation=String(r.minSelfDelegation)),s},toJSON(r){const s={};return r.description!==void 0&&(s.description=r.description?n.Description.toJSON(r.description):void 0),r.validatorAddress!==void 0&&(s.validatorAddress=r.validatorAddress),r.commissionRate!==void 0&&(s.commissionRate=r.commissionRate),r.minSelfDelegation!==void 0&&(s.minSelfDelegation=r.minSelfDelegation),s},fromPartial(r){const s=D();return r.description!==void 0&&r.description!==null&&(s.description=n.Description.fromPartial(r.description)),s.validatorAddress=r.validatorAddress??"",s.commissionRate=r.commissionRate??"",s.minSelfDelegation=r.minSelfDelegation??"",s}};function J(){return{}}e.MsgEditValidatorResponse={typeUrl:"/cosmos.staking.v1beta1.MsgEditValidatorResponse",encode(r,s=g.BinaryWriter.create()){return s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=J();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){default:O.skipType(l&7);break}}return d},fromJSON(r){return J()},toJSON(r){return{}},fromPartial(r){return J()}};function b(){return{delegatorAddress:"",validatorAddress:"",amount:i.Coin.fromPartial({})}}e.MsgDelegate={typeUrl:"/cosmos.staking.v1beta1.MsgDelegate",encode(r,s=g.BinaryWriter.create()){return r.delegatorAddress!==""&&s.uint32(10).string(r.delegatorAddress),r.validatorAddress!==""&&s.uint32(18).string(r.validatorAddress),r.amount!==void 0&&i.Coin.encode(r.amount,s.uint32(26).fork()).ldelim(),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=b();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.delegatorAddress=O.string();break;case 2:d.validatorAddress=O.string();break;case 3:d.amount=i.Coin.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=b();return(0,C.isSet)(r.delegatorAddress)&&(s.delegatorAddress=String(r.delegatorAddress)),(0,C.isSet)(r.validatorAddress)&&(s.validatorAddress=String(r.validatorAddress)),(0,C.isSet)(r.amount)&&(s.amount=i.Coin.fromJSON(r.amount)),s},toJSON(r){const s={};return r.delegatorAddress!==void 0&&(s.delegatorAddress=r.delegatorAddress),r.validatorAddress!==void 0&&(s.validatorAddress=r.validatorAddress),r.amount!==void 0&&(s.amount=r.amount?i.Coin.toJSON(r.amount):void 0),s},fromPartial(r){const s=b();return s.delegatorAddress=r.delegatorAddress??"",s.validatorAddress=r.validatorAddress??"",r.amount!==void 0&&r.amount!==null&&(s.amount=i.Coin.fromPartial(r.amount)),s}};function p(){return{}}e.MsgDelegateResponse={typeUrl:"/cosmos.staking.v1beta1.MsgDelegateResponse",encode(r,s=g.BinaryWriter.create()){return s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=p();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){default:O.skipType(l&7);break}}return d},fromJSON(r){return p()},toJSON(r){return{}},fromPartial(r){return p()}};function S(){return{delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:"",amount:i.Coin.fromPartial({})}}e.MsgBeginRedelegate={typeUrl:"/cosmos.staking.v1beta1.MsgBeginRedelegate",encode(r,s=g.BinaryWriter.create()){return r.delegatorAddress!==""&&s.uint32(10).string(r.delegatorAddress),r.validatorSrcAddress!==""&&s.uint32(18).string(r.validatorSrcAddress),r.validatorDstAddress!==""&&s.uint32(26).string(r.validatorDstAddress),r.amount!==void 0&&i.Coin.encode(r.amount,s.uint32(34).fork()).ldelim(),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=S();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.delegatorAddress=O.string();break;case 2:d.validatorSrcAddress=O.string();break;case 3:d.validatorDstAddress=O.string();break;case 4:d.amount=i.Coin.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=S();return(0,C.isSet)(r.delegatorAddress)&&(s.delegatorAddress=String(r.delegatorAddress)),(0,C.isSet)(r.validatorSrcAddress)&&(s.validatorSrcAddress=String(r.validatorSrcAddress)),(0,C.isSet)(r.validatorDstAddress)&&(s.validatorDstAddress=String(r.validatorDstAddress)),(0,C.isSet)(r.amount)&&(s.amount=i.Coin.fromJSON(r.amount)),s},toJSON(r){const s={};return r.delegatorAddress!==void 0&&(s.delegatorAddress=r.delegatorAddress),r.validatorSrcAddress!==void 0&&(s.validatorSrcAddress=r.validatorSrcAddress),r.validatorDstAddress!==void 0&&(s.validatorDstAddress=r.validatorDstAddress),r.amount!==void 0&&(s.amount=r.amount?i.Coin.toJSON(r.amount):void 0),s},fromPartial(r){const s=S();return s.delegatorAddress=r.delegatorAddress??"",s.validatorSrcAddress=r.validatorSrcAddress??"",s.validatorDstAddress=r.validatorDstAddress??"",r.amount!==void 0&&r.amount!==null&&(s.amount=i.Coin.fromPartial(r.amount)),s}};function R(){return{completionTime:o.Timestamp.fromPartial({})}}e.MsgBeginRedelegateResponse={typeUrl:"/cosmos.staking.v1beta1.MsgBeginRedelegateResponse",encode(r,s=g.BinaryWriter.create()){return r.completionTime!==void 0&&o.Timestamp.encode(r.completionTime,s.uint32(10).fork()).ldelim(),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=R();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.completionTime=o.Timestamp.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=R();return(0,C.isSet)(r.completionTime)&&(s.completionTime=(0,C.fromJsonTimestamp)(r.completionTime)),s},toJSON(r){const s={};return r.completionTime!==void 0&&(s.completionTime=(0,C.fromTimestamp)(r.completionTime).toISOString()),s},fromPartial(r){const s=R();return r.completionTime!==void 0&&r.completionTime!==null&&(s.completionTime=o.Timestamp.fromPartial(r.completionTime)),s}};function u(){return{delegatorAddress:"",validatorAddress:"",amount:i.Coin.fromPartial({})}}e.MsgUndelegate={typeUrl:"/cosmos.staking.v1beta1.MsgUndelegate",encode(r,s=g.BinaryWriter.create()){return r.delegatorAddress!==""&&s.uint32(10).string(r.delegatorAddress),r.validatorAddress!==""&&s.uint32(18).string(r.validatorAddress),r.amount!==void 0&&i.Coin.encode(r.amount,s.uint32(26).fork()).ldelim(),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=u();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.delegatorAddress=O.string();break;case 2:d.validatorAddress=O.string();break;case 3:d.amount=i.Coin.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=u();return(0,C.isSet)(r.delegatorAddress)&&(s.delegatorAddress=String(r.delegatorAddress)),(0,C.isSet)(r.validatorAddress)&&(s.validatorAddress=String(r.validatorAddress)),(0,C.isSet)(r.amount)&&(s.amount=i.Coin.fromJSON(r.amount)),s},toJSON(r){const s={};return r.delegatorAddress!==void 0&&(s.delegatorAddress=r.delegatorAddress),r.validatorAddress!==void 0&&(s.validatorAddress=r.validatorAddress),r.amount!==void 0&&(s.amount=r.amount?i.Coin.toJSON(r.amount):void 0),s},fromPartial(r){const s=u();return s.delegatorAddress=r.delegatorAddress??"",s.validatorAddress=r.validatorAddress??"",r.amount!==void 0&&r.amount!==null&&(s.amount=i.Coin.fromPartial(r.amount)),s}};function c(){return{completionTime:o.Timestamp.fromPartial({})}}e.MsgUndelegateResponse={typeUrl:"/cosmos.staking.v1beta1.MsgUndelegateResponse",encode(r,s=g.BinaryWriter.create()){return r.completionTime!==void 0&&o.Timestamp.encode(r.completionTime,s.uint32(10).fork()).ldelim(),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=c();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.completionTime=o.Timestamp.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=c();return(0,C.isSet)(r.completionTime)&&(s.completionTime=(0,C.fromJsonTimestamp)(r.completionTime)),s},toJSON(r){const s={};return r.completionTime!==void 0&&(s.completionTime=(0,C.fromTimestamp)(r.completionTime).toISOString()),s},fromPartial(r){const s=c();return r.completionTime!==void 0&&r.completionTime!==null&&(s.completionTime=o.Timestamp.fromPartial(r.completionTime)),s}};function y(){return{delegatorAddress:"",validatorAddress:"",amount:i.Coin.fromPartial({}),creationHeight:BigInt(0)}}e.MsgCancelUnbondingDelegation={typeUrl:"/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation",encode(r,s=g.BinaryWriter.create()){return r.delegatorAddress!==""&&s.uint32(10).string(r.delegatorAddress),r.validatorAddress!==""&&s.uint32(18).string(r.validatorAddress),r.amount!==void 0&&i.Coin.encode(r.amount,s.uint32(26).fork()).ldelim(),r.creationHeight!==BigInt(0)&&s.uint32(32).int64(r.creationHeight),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=y();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.delegatorAddress=O.string();break;case 2:d.validatorAddress=O.string();break;case 3:d.amount=i.Coin.decode(O,O.uint32());break;case 4:d.creationHeight=O.int64();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=y();return(0,C.isSet)(r.delegatorAddress)&&(s.delegatorAddress=String(r.delegatorAddress)),(0,C.isSet)(r.validatorAddress)&&(s.validatorAddress=String(r.validatorAddress)),(0,C.isSet)(r.amount)&&(s.amount=i.Coin.fromJSON(r.amount)),(0,C.isSet)(r.creationHeight)&&(s.creationHeight=BigInt(r.creationHeight.toString())),s},toJSON(r){const s={};return r.delegatorAddress!==void 0&&(s.delegatorAddress=r.delegatorAddress),r.validatorAddress!==void 0&&(s.validatorAddress=r.validatorAddress),r.amount!==void 0&&(s.amount=r.amount?i.Coin.toJSON(r.amount):void 0),r.creationHeight!==void 0&&(s.creationHeight=(r.creationHeight||BigInt(0)).toString()),s},fromPartial(r){const s=y();return s.delegatorAddress=r.delegatorAddress??"",s.validatorAddress=r.validatorAddress??"",r.amount!==void 0&&r.amount!==null&&(s.amount=i.Coin.fromPartial(r.amount)),r.creationHeight!==void 0&&r.creationHeight!==null&&(s.creationHeight=BigInt(r.creationHeight.toString())),s}};function B(){return{}}e.MsgCancelUnbondingDelegationResponse={typeUrl:"/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse",encode(r,s=g.BinaryWriter.create()){return s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=B();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){default:O.skipType(l&7);break}}return d},fromJSON(r){return B()},toJSON(r){return{}},fromPartial(r){return B()}};function N(){return{authority:"",params:n.Params.fromPartial({})}}e.MsgUpdateParams={typeUrl:"/cosmos.staking.v1beta1.MsgUpdateParams",encode(r,s=g.BinaryWriter.create()){return r.authority!==""&&s.uint32(10).string(r.authority),r.params!==void 0&&n.Params.encode(r.params,s.uint32(18).fork()).ldelim(),s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=N();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.authority=O.string();break;case 2:d.params=n.Params.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=N();return(0,C.isSet)(r.authority)&&(s.authority=String(r.authority)),(0,C.isSet)(r.params)&&(s.params=n.Params.fromJSON(r.params)),s},toJSON(r){const s={};return r.authority!==void 0&&(s.authority=r.authority),r.params!==void 0&&(s.params=r.params?n.Params.toJSON(r.params):void 0),s},fromPartial(r){const s=N();return s.authority=r.authority??"",r.params!==void 0&&r.params!==null&&(s.params=n.Params.fromPartial(r.params)),s}};function U(){return{}}e.MsgUpdateParamsResponse={typeUrl:"/cosmos.staking.v1beta1.MsgUpdateParamsResponse",encode(r,s=g.BinaryWriter.create()){return s},decode(r,s){const O=r instanceof g.BinaryReader?r:new g.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=U();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){default:O.skipType(l&7);break}}return d},fromJSON(r){return U()},toJSON(r){return{}},fromPartial(r){return U()}};class W{constructor(s){this.rpc=s,this.CreateValidator=this.CreateValidator.bind(this),this.EditValidator=this.EditValidator.bind(this),this.Delegate=this.Delegate.bind(this),this.BeginRedelegate=this.BeginRedelegate.bind(this),this.Undelegate=this.Undelegate.bind(this),this.CancelUnbondingDelegation=this.CancelUnbondingDelegation.bind(this),this.UpdateParams=this.UpdateParams.bind(this)}CreateValidator(s){const O=e.MsgCreateValidator.encode(s).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","CreateValidator",O).then(d=>e.MsgCreateValidatorResponse.decode(new g.BinaryReader(d)))}EditValidator(s){const O=e.MsgEditValidator.encode(s).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","EditValidator",O).then(d=>e.MsgEditValidatorResponse.decode(new g.BinaryReader(d)))}Delegate(s){const O=e.MsgDelegate.encode(s).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","Delegate",O).then(d=>e.MsgDelegateResponse.decode(new g.BinaryReader(d)))}BeginRedelegate(s){const O=e.MsgBeginRedelegate.encode(s).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","BeginRedelegate",O).then(d=>e.MsgBeginRedelegateResponse.decode(new g.BinaryReader(d)))}Undelegate(s){const O=e.MsgUndelegate.encode(s).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","Undelegate",O).then(d=>e.MsgUndelegateResponse.decode(new g.BinaryReader(d)))}CancelUnbondingDelegation(s){const O=e.MsgCancelUnbondingDelegation.encode(s).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","CancelUnbondingDelegation",O).then(d=>e.MsgCancelUnbondingDelegationResponse.decode(new g.BinaryReader(d)))}UpdateParams(s){const O=e.MsgUpdateParams.encode(s).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","UpdateParams",O).then(d=>e.MsgUpdateParamsResponse.decode(new g.BinaryReader(d)))}}e.MsgClientImpl=W})(Ao);Object.defineProperty(Ge,"__esModule",{value:!0});Ge.isMsgCancelUnbondingDelegationEncodeObject=Ge.isMsgUndelegateEncodeObject=Ge.isMsgEditValidatorEncodeObject=Ge.isMsgDelegateEncodeObject=Ge.isMsgCreateValidatorEncodeObject=Ge.isMsgBeginRedelegateEncodeObject=Ge.stakingTypes=void 0;const Br=Ao;Ge.stakingTypes=[["/cosmos.staking.v1beta1.MsgBeginRedelegate",Br.MsgBeginRedelegate],["/cosmos.staking.v1beta1.MsgCreateValidator",Br.MsgCreateValidator],["/cosmos.staking.v1beta1.MsgDelegate",Br.MsgDelegate],["/cosmos.staking.v1beta1.MsgEditValidator",Br.MsgEditValidator],["/cosmos.staking.v1beta1.MsgUndelegate",Br.MsgUndelegate],["/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation",Br.MsgCancelUnbondingDelegation]];function PP(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgBeginRedelegate"}Ge.isMsgBeginRedelegateEncodeObject=PP;function vP(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgCreateValidator"}Ge.isMsgCreateValidatorEncodeObject=vP;function CP(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgDelegate"}Ge.isMsgDelegateEncodeObject=CP;function RP(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgEditValidator"}Ge.isMsgEditValidatorEncodeObject=RP;function BP(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgUndelegate"}Ge.isMsgUndelegateEncodeObject=BP;function bP(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation"}Ge.isMsgCancelUnbondingDelegationEncodeObject=bP;var ks={},Jc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryParamsResponse=e.QueryParamsRequest=e.QueryPoolResponse=e.QueryPoolRequest=e.QueryHistoricalInfoResponse=e.QueryHistoricalInfoRequest=e.QueryDelegatorValidatorResponse=e.QueryDelegatorValidatorRequest=e.QueryDelegatorValidatorsResponse=e.QueryDelegatorValidatorsRequest=e.QueryRedelegationsResponse=e.QueryRedelegationsRequest=e.QueryDelegatorUnbondingDelegationsResponse=e.QueryDelegatorUnbondingDelegationsRequest=e.QueryDelegatorDelegationsResponse=e.QueryDelegatorDelegationsRequest=e.QueryUnbondingDelegationResponse=e.QueryUnbondingDelegationRequest=e.QueryDelegationResponse=e.QueryDelegationRequest=e.QueryValidatorUnbondingDelegationsResponse=e.QueryValidatorUnbondingDelegationsRequest=e.QueryValidatorDelegationsResponse=e.QueryValidatorDelegationsRequest=e.QueryValidatorResponse=e.QueryValidatorRequest=e.QueryValidatorsResponse=e.QueryValidatorsRequest=e.protobufPackage=void 0;const n=Be,t=Uc,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.staking.v1beta1";function g(){return{status:"",pagination:void 0}}e.QueryValidatorsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorsRequest",encode(a,P=i.BinaryWriter.create()){return a.status!==""&&P.uint32(10).string(a.status),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=g();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.status=k.string();break;case 2:A.pagination=n.PageRequest.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=g();return(0,o.isSet)(a.status)&&(P.status=String(a.status)),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageRequest.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.status!==void 0&&(P.status=a.status),a.pagination!==void 0&&(P.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),P},fromPartial(a){const P=g();return P.status=a.status??"",a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageRequest.fromPartial(a.pagination)),P}};function C(){return{validators:[],pagination:void 0}}e.QueryValidatorsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorsResponse",encode(a,P=i.BinaryWriter.create()){for(const k of a.validators)t.Validator.encode(k,P.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=C();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.validators.push(t.Validator.decode(k,k.uint32()));break;case 2:A.pagination=n.PageResponse.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=C();return Array.isArray(a==null?void 0:a.validators)&&(P.validators=a.validators.map(k=>t.Validator.fromJSON(k))),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageResponse.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.validators?P.validators=a.validators.map(k=>k?t.Validator.toJSON(k):void 0):P.validators=[],a.pagination!==void 0&&(P.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),P},fromPartial(a){var k;const P=C();return P.validators=((k=a.validators)==null?void 0:k.map(v=>t.Validator.fromPartial(v)))||[],a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageResponse.fromPartial(a.pagination)),P}};function w(){return{validatorAddr:""}}e.QueryValidatorRequest={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorRequest",encode(a,P=i.BinaryWriter.create()){return a.validatorAddr!==""&&P.uint32(10).string(a.validatorAddr),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=w();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.validatorAddr=k.string();break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=w();return(0,o.isSet)(a.validatorAddr)&&(P.validatorAddr=String(a.validatorAddr)),P},toJSON(a){const P={};return a.validatorAddr!==void 0&&(P.validatorAddr=a.validatorAddr),P},fromPartial(a){const P=w();return P.validatorAddr=a.validatorAddr??"",P}};function E(){return{validator:t.Validator.fromPartial({})}}e.QueryValidatorResponse={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorResponse",encode(a,P=i.BinaryWriter.create()){return a.validator!==void 0&&t.Validator.encode(a.validator,P.uint32(10).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=E();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.validator=t.Validator.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=E();return(0,o.isSet)(a.validator)&&(P.validator=t.Validator.fromJSON(a.validator)),P},toJSON(a){const P={};return a.validator!==void 0&&(P.validator=a.validator?t.Validator.toJSON(a.validator):void 0),P},fromPartial(a){const P=E();return a.validator!==void 0&&a.validator!==null&&(P.validator=t.Validator.fromPartial(a.validator)),P}};function D(){return{validatorAddr:"",pagination:void 0}}e.QueryValidatorDelegationsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest",encode(a,P=i.BinaryWriter.create()){return a.validatorAddr!==""&&P.uint32(10).string(a.validatorAddr),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=D();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.validatorAddr=k.string();break;case 2:A.pagination=n.PageRequest.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=D();return(0,o.isSet)(a.validatorAddr)&&(P.validatorAddr=String(a.validatorAddr)),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageRequest.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.validatorAddr!==void 0&&(P.validatorAddr=a.validatorAddr),a.pagination!==void 0&&(P.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),P},fromPartial(a){const P=D();return P.validatorAddr=a.validatorAddr??"",a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageRequest.fromPartial(a.pagination)),P}};function J(){return{delegationResponses:[],pagination:void 0}}e.QueryValidatorDelegationsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse",encode(a,P=i.BinaryWriter.create()){for(const k of a.delegationResponses)t.DelegationResponse.encode(k,P.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=J();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.delegationResponses.push(t.DelegationResponse.decode(k,k.uint32()));break;case 2:A.pagination=n.PageResponse.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=J();return Array.isArray(a==null?void 0:a.delegationResponses)&&(P.delegationResponses=a.delegationResponses.map(k=>t.DelegationResponse.fromJSON(k))),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageResponse.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.delegationResponses?P.delegationResponses=a.delegationResponses.map(k=>k?t.DelegationResponse.toJSON(k):void 0):P.delegationResponses=[],a.pagination!==void 0&&(P.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),P},fromPartial(a){var k;const P=J();return P.delegationResponses=((k=a.delegationResponses)==null?void 0:k.map(v=>t.DelegationResponse.fromPartial(v)))||[],a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageResponse.fromPartial(a.pagination)),P}};function b(){return{validatorAddr:"",pagination:void 0}}e.QueryValidatorUnbondingDelegationsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest",encode(a,P=i.BinaryWriter.create()){return a.validatorAddr!==""&&P.uint32(10).string(a.validatorAddr),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=b();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.validatorAddr=k.string();break;case 2:A.pagination=n.PageRequest.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=b();return(0,o.isSet)(a.validatorAddr)&&(P.validatorAddr=String(a.validatorAddr)),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageRequest.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.validatorAddr!==void 0&&(P.validatorAddr=a.validatorAddr),a.pagination!==void 0&&(P.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),P},fromPartial(a){const P=b();return P.validatorAddr=a.validatorAddr??"",a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageRequest.fromPartial(a.pagination)),P}};function p(){return{unbondingResponses:[],pagination:void 0}}e.QueryValidatorUnbondingDelegationsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse",encode(a,P=i.BinaryWriter.create()){for(const k of a.unbondingResponses)t.UnbondingDelegation.encode(k,P.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=p();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.unbondingResponses.push(t.UnbondingDelegation.decode(k,k.uint32()));break;case 2:A.pagination=n.PageResponse.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=p();return Array.isArray(a==null?void 0:a.unbondingResponses)&&(P.unbondingResponses=a.unbondingResponses.map(k=>t.UnbondingDelegation.fromJSON(k))),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageResponse.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.unbondingResponses?P.unbondingResponses=a.unbondingResponses.map(k=>k?t.UnbondingDelegation.toJSON(k):void 0):P.unbondingResponses=[],a.pagination!==void 0&&(P.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),P},fromPartial(a){var k;const P=p();return P.unbondingResponses=((k=a.unbondingResponses)==null?void 0:k.map(v=>t.UnbondingDelegation.fromPartial(v)))||[],a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageResponse.fromPartial(a.pagination)),P}};function S(){return{delegatorAddr:"",validatorAddr:""}}e.QueryDelegationRequest={typeUrl:"/cosmos.staking.v1beta1.QueryDelegationRequest",encode(a,P=i.BinaryWriter.create()){return a.delegatorAddr!==""&&P.uint32(10).string(a.delegatorAddr),a.validatorAddr!==""&&P.uint32(18).string(a.validatorAddr),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=S();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.delegatorAddr=k.string();break;case 2:A.validatorAddr=k.string();break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=S();return(0,o.isSet)(a.delegatorAddr)&&(P.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.validatorAddr)&&(P.validatorAddr=String(a.validatorAddr)),P},toJSON(a){const P={};return a.delegatorAddr!==void 0&&(P.delegatorAddr=a.delegatorAddr),a.validatorAddr!==void 0&&(P.validatorAddr=a.validatorAddr),P},fromPartial(a){const P=S();return P.delegatorAddr=a.delegatorAddr??"",P.validatorAddr=a.validatorAddr??"",P}};function R(){return{delegationResponse:void 0}}e.QueryDelegationResponse={typeUrl:"/cosmos.staking.v1beta1.QueryDelegationResponse",encode(a,P=i.BinaryWriter.create()){return a.delegationResponse!==void 0&&t.DelegationResponse.encode(a.delegationResponse,P.uint32(10).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=R();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.delegationResponse=t.DelegationResponse.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=R();return(0,o.isSet)(a.delegationResponse)&&(P.delegationResponse=t.DelegationResponse.fromJSON(a.delegationResponse)),P},toJSON(a){const P={};return a.delegationResponse!==void 0&&(P.delegationResponse=a.delegationResponse?t.DelegationResponse.toJSON(a.delegationResponse):void 0),P},fromPartial(a){const P=R();return a.delegationResponse!==void 0&&a.delegationResponse!==null&&(P.delegationResponse=t.DelegationResponse.fromPartial(a.delegationResponse)),P}};function u(){return{delegatorAddr:"",validatorAddr:""}}e.QueryUnbondingDelegationRequest={typeUrl:"/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest",encode(a,P=i.BinaryWriter.create()){return a.delegatorAddr!==""&&P.uint32(10).string(a.delegatorAddr),a.validatorAddr!==""&&P.uint32(18).string(a.validatorAddr),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=u();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.delegatorAddr=k.string();break;case 2:A.validatorAddr=k.string();break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=u();return(0,o.isSet)(a.delegatorAddr)&&(P.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.validatorAddr)&&(P.validatorAddr=String(a.validatorAddr)),P},toJSON(a){const P={};return a.delegatorAddr!==void 0&&(P.delegatorAddr=a.delegatorAddr),a.validatorAddr!==void 0&&(P.validatorAddr=a.validatorAddr),P},fromPartial(a){const P=u();return P.delegatorAddr=a.delegatorAddr??"",P.validatorAddr=a.validatorAddr??"",P}};function c(){return{unbond:t.UnbondingDelegation.fromPartial({})}}e.QueryUnbondingDelegationResponse={typeUrl:"/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse",encode(a,P=i.BinaryWriter.create()){return a.unbond!==void 0&&t.UnbondingDelegation.encode(a.unbond,P.uint32(10).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=c();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.unbond=t.UnbondingDelegation.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=c();return(0,o.isSet)(a.unbond)&&(P.unbond=t.UnbondingDelegation.fromJSON(a.unbond)),P},toJSON(a){const P={};return a.unbond!==void 0&&(P.unbond=a.unbond?t.UnbondingDelegation.toJSON(a.unbond):void 0),P},fromPartial(a){const P=c();return a.unbond!==void 0&&a.unbond!==null&&(P.unbond=t.UnbondingDelegation.fromPartial(a.unbond)),P}};function y(){return{delegatorAddr:"",pagination:void 0}}e.QueryDelegatorDelegationsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest",encode(a,P=i.BinaryWriter.create()){return a.delegatorAddr!==""&&P.uint32(10).string(a.delegatorAddr),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=y();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.delegatorAddr=k.string();break;case 2:A.pagination=n.PageRequest.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=y();return(0,o.isSet)(a.delegatorAddr)&&(P.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageRequest.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.delegatorAddr!==void 0&&(P.delegatorAddr=a.delegatorAddr),a.pagination!==void 0&&(P.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),P},fromPartial(a){const P=y();return P.delegatorAddr=a.delegatorAddr??"",a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageRequest.fromPartial(a.pagination)),P}};function B(){return{delegationResponses:[],pagination:void 0}}e.QueryDelegatorDelegationsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse",encode(a,P=i.BinaryWriter.create()){for(const k of a.delegationResponses)t.DelegationResponse.encode(k,P.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=B();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.delegationResponses.push(t.DelegationResponse.decode(k,k.uint32()));break;case 2:A.pagination=n.PageResponse.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=B();return Array.isArray(a==null?void 0:a.delegationResponses)&&(P.delegationResponses=a.delegationResponses.map(k=>t.DelegationResponse.fromJSON(k))),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageResponse.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.delegationResponses?P.delegationResponses=a.delegationResponses.map(k=>k?t.DelegationResponse.toJSON(k):void 0):P.delegationResponses=[],a.pagination!==void 0&&(P.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),P},fromPartial(a){var k;const P=B();return P.delegationResponses=((k=a.delegationResponses)==null?void 0:k.map(v=>t.DelegationResponse.fromPartial(v)))||[],a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageResponse.fromPartial(a.pagination)),P}};function N(){return{delegatorAddr:"",pagination:void 0}}e.QueryDelegatorUnbondingDelegationsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest",encode(a,P=i.BinaryWriter.create()){return a.delegatorAddr!==""&&P.uint32(10).string(a.delegatorAddr),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=N();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.delegatorAddr=k.string();break;case 2:A.pagination=n.PageRequest.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=N();return(0,o.isSet)(a.delegatorAddr)&&(P.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageRequest.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.delegatorAddr!==void 0&&(P.delegatorAddr=a.delegatorAddr),a.pagination!==void 0&&(P.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),P},fromPartial(a){const P=N();return P.delegatorAddr=a.delegatorAddr??"",a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageRequest.fromPartial(a.pagination)),P}};function U(){return{unbondingResponses:[],pagination:void 0}}e.QueryDelegatorUnbondingDelegationsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse",encode(a,P=i.BinaryWriter.create()){for(const k of a.unbondingResponses)t.UnbondingDelegation.encode(k,P.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=U();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.unbondingResponses.push(t.UnbondingDelegation.decode(k,k.uint32()));break;case 2:A.pagination=n.PageResponse.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=U();return Array.isArray(a==null?void 0:a.unbondingResponses)&&(P.unbondingResponses=a.unbondingResponses.map(k=>t.UnbondingDelegation.fromJSON(k))),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageResponse.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.unbondingResponses?P.unbondingResponses=a.unbondingResponses.map(k=>k?t.UnbondingDelegation.toJSON(k):void 0):P.unbondingResponses=[],a.pagination!==void 0&&(P.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),P},fromPartial(a){var k;const P=U();return P.unbondingResponses=((k=a.unbondingResponses)==null?void 0:k.map(v=>t.UnbondingDelegation.fromPartial(v)))||[],a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageResponse.fromPartial(a.pagination)),P}};function W(){return{delegatorAddr:"",srcValidatorAddr:"",dstValidatorAddr:"",pagination:void 0}}e.QueryRedelegationsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryRedelegationsRequest",encode(a,P=i.BinaryWriter.create()){return a.delegatorAddr!==""&&P.uint32(10).string(a.delegatorAddr),a.srcValidatorAddr!==""&&P.uint32(18).string(a.srcValidatorAddr),a.dstValidatorAddr!==""&&P.uint32(26).string(a.dstValidatorAddr),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,P.uint32(34).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=W();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.delegatorAddr=k.string();break;case 2:A.srcValidatorAddr=k.string();break;case 3:A.dstValidatorAddr=k.string();break;case 4:A.pagination=n.PageRequest.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=W();return(0,o.isSet)(a.delegatorAddr)&&(P.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.srcValidatorAddr)&&(P.srcValidatorAddr=String(a.srcValidatorAddr)),(0,o.isSet)(a.dstValidatorAddr)&&(P.dstValidatorAddr=String(a.dstValidatorAddr)),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageRequest.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.delegatorAddr!==void 0&&(P.delegatorAddr=a.delegatorAddr),a.srcValidatorAddr!==void 0&&(P.srcValidatorAddr=a.srcValidatorAddr),a.dstValidatorAddr!==void 0&&(P.dstValidatorAddr=a.dstValidatorAddr),a.pagination!==void 0&&(P.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),P},fromPartial(a){const P=W();return P.delegatorAddr=a.delegatorAddr??"",P.srcValidatorAddr=a.srcValidatorAddr??"",P.dstValidatorAddr=a.dstValidatorAddr??"",a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageRequest.fromPartial(a.pagination)),P}};function r(){return{redelegationResponses:[],pagination:void 0}}e.QueryRedelegationsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryRedelegationsResponse",encode(a,P=i.BinaryWriter.create()){for(const k of a.redelegationResponses)t.RedelegationResponse.encode(k,P.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=r();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.redelegationResponses.push(t.RedelegationResponse.decode(k,k.uint32()));break;case 2:A.pagination=n.PageResponse.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=r();return Array.isArray(a==null?void 0:a.redelegationResponses)&&(P.redelegationResponses=a.redelegationResponses.map(k=>t.RedelegationResponse.fromJSON(k))),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageResponse.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.redelegationResponses?P.redelegationResponses=a.redelegationResponses.map(k=>k?t.RedelegationResponse.toJSON(k):void 0):P.redelegationResponses=[],a.pagination!==void 0&&(P.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),P},fromPartial(a){var k;const P=r();return P.redelegationResponses=((k=a.redelegationResponses)==null?void 0:k.map(v=>t.RedelegationResponse.fromPartial(v)))||[],a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageResponse.fromPartial(a.pagination)),P}};function s(){return{delegatorAddr:"",pagination:void 0}}e.QueryDelegatorValidatorsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest",encode(a,P=i.BinaryWriter.create()){return a.delegatorAddr!==""&&P.uint32(10).string(a.delegatorAddr),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=s();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.delegatorAddr=k.string();break;case 2:A.pagination=n.PageRequest.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=s();return(0,o.isSet)(a.delegatorAddr)&&(P.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageRequest.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.delegatorAddr!==void 0&&(P.delegatorAddr=a.delegatorAddr),a.pagination!==void 0&&(P.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),P},fromPartial(a){const P=s();return P.delegatorAddr=a.delegatorAddr??"",a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageRequest.fromPartial(a.pagination)),P}};function O(){return{validators:[],pagination:void 0}}e.QueryDelegatorValidatorsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse",encode(a,P=i.BinaryWriter.create()){for(const k of a.validators)t.Validator.encode(k,P.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,P.uint32(18).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=O();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.validators.push(t.Validator.decode(k,k.uint32()));break;case 2:A.pagination=n.PageResponse.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=O();return Array.isArray(a==null?void 0:a.validators)&&(P.validators=a.validators.map(k=>t.Validator.fromJSON(k))),(0,o.isSet)(a.pagination)&&(P.pagination=n.PageResponse.fromJSON(a.pagination)),P},toJSON(a){const P={};return a.validators?P.validators=a.validators.map(k=>k?t.Validator.toJSON(k):void 0):P.validators=[],a.pagination!==void 0&&(P.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),P},fromPartial(a){var k;const P=O();return P.validators=((k=a.validators)==null?void 0:k.map(v=>t.Validator.fromPartial(v)))||[],a.pagination!==void 0&&a.pagination!==null&&(P.pagination=n.PageResponse.fromPartial(a.pagination)),P}};function q(){return{delegatorAddr:"",validatorAddr:""}}e.QueryDelegatorValidatorRequest={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest",encode(a,P=i.BinaryWriter.create()){return a.delegatorAddr!==""&&P.uint32(10).string(a.delegatorAddr),a.validatorAddr!==""&&P.uint32(18).string(a.validatorAddr),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=q();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.delegatorAddr=k.string();break;case 2:A.validatorAddr=k.string();break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=q();return(0,o.isSet)(a.delegatorAddr)&&(P.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.validatorAddr)&&(P.validatorAddr=String(a.validatorAddr)),P},toJSON(a){const P={};return a.delegatorAddr!==void 0&&(P.delegatorAddr=a.delegatorAddr),a.validatorAddr!==void 0&&(P.validatorAddr=a.validatorAddr),P},fromPartial(a){const P=q();return P.delegatorAddr=a.delegatorAddr??"",P.validatorAddr=a.validatorAddr??"",P}};function d(){return{validator:t.Validator.fromPartial({})}}e.QueryDelegatorValidatorResponse={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse",encode(a,P=i.BinaryWriter.create()){return a.validator!==void 0&&t.Validator.encode(a.validator,P.uint32(10).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=d();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.validator=t.Validator.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=d();return(0,o.isSet)(a.validator)&&(P.validator=t.Validator.fromJSON(a.validator)),P},toJSON(a){const P={};return a.validator!==void 0&&(P.validator=a.validator?t.Validator.toJSON(a.validator):void 0),P},fromPartial(a){const P=d();return a.validator!==void 0&&a.validator!==null&&(P.validator=t.Validator.fromPartial(a.validator)),P}};function l(){return{height:BigInt(0)}}e.QueryHistoricalInfoRequest={typeUrl:"/cosmos.staking.v1beta1.QueryHistoricalInfoRequest",encode(a,P=i.BinaryWriter.create()){return a.height!==BigInt(0)&&P.uint32(8).int64(a.height),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=l();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.height=k.int64();break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=l();return(0,o.isSet)(a.height)&&(P.height=BigInt(a.height.toString())),P},toJSON(a){const P={};return a.height!==void 0&&(P.height=(a.height||BigInt(0)).toString()),P},fromPartial(a){const P=l();return a.height!==void 0&&a.height!==null&&(P.height=BigInt(a.height.toString())),P}};function M(){return{hist:void 0}}e.QueryHistoricalInfoResponse={typeUrl:"/cosmos.staking.v1beta1.QueryHistoricalInfoResponse",encode(a,P=i.BinaryWriter.create()){return a.hist!==void 0&&t.HistoricalInfo.encode(a.hist,P.uint32(10).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=M();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.hist=t.HistoricalInfo.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=M();return(0,o.isSet)(a.hist)&&(P.hist=t.HistoricalInfo.fromJSON(a.hist)),P},toJSON(a){const P={};return a.hist!==void 0&&(P.hist=a.hist?t.HistoricalInfo.toJSON(a.hist):void 0),P},fromPartial(a){const P=M();return a.hist!==void 0&&a.hist!==null&&(P.hist=t.HistoricalInfo.fromPartial(a.hist)),P}};function m(){return{}}e.QueryPoolRequest={typeUrl:"/cosmos.staking.v1beta1.QueryPoolRequest",encode(a,P=i.BinaryWriter.create()){return P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=m();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){default:k.skipType(F&7);break}}return A},fromJSON(a){return m()},toJSON(a){return{}},fromPartial(a){return m()}};function h(){return{pool:t.Pool.fromPartial({})}}e.QueryPoolResponse={typeUrl:"/cosmos.staking.v1beta1.QueryPoolResponse",encode(a,P=i.BinaryWriter.create()){return a.pool!==void 0&&t.Pool.encode(a.pool,P.uint32(10).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=h();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.pool=t.Pool.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=h();return(0,o.isSet)(a.pool)&&(P.pool=t.Pool.fromJSON(a.pool)),P},toJSON(a){const P={};return a.pool!==void 0&&(P.pool=a.pool?t.Pool.toJSON(a.pool):void 0),P},fromPartial(a){const P=h();return a.pool!==void 0&&a.pool!==null&&(P.pool=t.Pool.fromPartial(a.pool)),P}};function T(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryParamsRequest",encode(a,P=i.BinaryWriter.create()){return P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=T();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){default:k.skipType(F&7);break}}return A},fromJSON(a){return T()},toJSON(a){return{}},fromPartial(a){return T()}};function Q(){return{params:t.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryParamsResponse",encode(a,P=i.BinaryWriter.create()){return a.params!==void 0&&t.Params.encode(a.params,P.uint32(10).fork()).ldelim(),P},decode(a,P){const k=a instanceof i.BinaryReader?a:new i.BinaryReader(a);let v=P===void 0?k.len:k.pos+P;const A=Q();for(;k.pos<v;){const F=k.uint32();switch(F>>>3){case 1:A.params=t.Params.decode(k,k.uint32());break;default:k.skipType(F&7);break}}return A},fromJSON(a){const P=Q();return(0,o.isSet)(a.params)&&(P.params=t.Params.fromJSON(a.params)),P},toJSON(a){const P={};return a.params!==void 0&&(P.params=a.params?t.Params.toJSON(a.params):void 0),P},fromPartial(a){const P=Q();return a.params!==void 0&&a.params!==null&&(P.params=t.Params.fromPartial(a.params)),P}};class H{constructor(P){this.rpc=P,this.Validators=this.Validators.bind(this),this.Validator=this.Validator.bind(this),this.ValidatorDelegations=this.ValidatorDelegations.bind(this),this.ValidatorUnbondingDelegations=this.ValidatorUnbondingDelegations.bind(this),this.Delegation=this.Delegation.bind(this),this.UnbondingDelegation=this.UnbondingDelegation.bind(this),this.DelegatorDelegations=this.DelegatorDelegations.bind(this),this.DelegatorUnbondingDelegations=this.DelegatorUnbondingDelegations.bind(this),this.Redelegations=this.Redelegations.bind(this),this.DelegatorValidators=this.DelegatorValidators.bind(this),this.DelegatorValidator=this.DelegatorValidator.bind(this),this.HistoricalInfo=this.HistoricalInfo.bind(this),this.Pool=this.Pool.bind(this),this.Params=this.Params.bind(this)}Validators(P){const k=e.QueryValidatorsRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","Validators",k).then(A=>e.QueryValidatorsResponse.decode(new i.BinaryReader(A)))}Validator(P){const k=e.QueryValidatorRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","Validator",k).then(A=>e.QueryValidatorResponse.decode(new i.BinaryReader(A)))}ValidatorDelegations(P){const k=e.QueryValidatorDelegationsRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","ValidatorDelegations",k).then(A=>e.QueryValidatorDelegationsResponse.decode(new i.BinaryReader(A)))}ValidatorUnbondingDelegations(P){const k=e.QueryValidatorUnbondingDelegationsRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","ValidatorUnbondingDelegations",k).then(A=>e.QueryValidatorUnbondingDelegationsResponse.decode(new i.BinaryReader(A)))}Delegation(P){const k=e.QueryDelegationRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","Delegation",k).then(A=>e.QueryDelegationResponse.decode(new i.BinaryReader(A)))}UnbondingDelegation(P){const k=e.QueryUnbondingDelegationRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","UnbondingDelegation",k).then(A=>e.QueryUnbondingDelegationResponse.decode(new i.BinaryReader(A)))}DelegatorDelegations(P){const k=e.QueryDelegatorDelegationsRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","DelegatorDelegations",k).then(A=>e.QueryDelegatorDelegationsResponse.decode(new i.BinaryReader(A)))}DelegatorUnbondingDelegations(P){const k=e.QueryDelegatorUnbondingDelegationsRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","DelegatorUnbondingDelegations",k).then(A=>e.QueryDelegatorUnbondingDelegationsResponse.decode(new i.BinaryReader(A)))}Redelegations(P){const k=e.QueryRedelegationsRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","Redelegations",k).then(A=>e.QueryRedelegationsResponse.decode(new i.BinaryReader(A)))}DelegatorValidators(P){const k=e.QueryDelegatorValidatorsRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","DelegatorValidators",k).then(A=>e.QueryDelegatorValidatorsResponse.decode(new i.BinaryReader(A)))}DelegatorValidator(P){const k=e.QueryDelegatorValidatorRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","DelegatorValidator",k).then(A=>e.QueryDelegatorValidatorResponse.decode(new i.BinaryReader(A)))}HistoricalInfo(P){const k=e.QueryHistoricalInfoRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","HistoricalInfo",k).then(A=>e.QueryHistoricalInfoResponse.decode(new i.BinaryReader(A)))}Pool(P={}){const k=e.QueryPoolRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","Pool",k).then(A=>e.QueryPoolResponse.decode(new i.BinaryReader(A)))}Params(P={}){const k=e.QueryParamsRequest.encode(P).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","Params",k).then(A=>e.QueryParamsResponse.decode(new i.BinaryReader(A)))}}e.QueryClientImpl=H})(Jc);Object.defineProperty(ks,"__esModule",{value:!0});ks.setupStakingExtension=void 0;const EP=Jc,vt=ze;function IP(e){const n=(0,vt.createProtobufRpcClient)(e),t=new EP.QueryClientImpl(n);return{staking:{delegation:async(i,o)=>await t.Delegation({delegatorAddr:i,validatorAddr:o}),delegatorDelegations:async(i,o)=>await t.DelegatorDelegations({delegatorAddr:i,pagination:(0,vt.createPagination)(o)}),delegatorUnbondingDelegations:async(i,o)=>await t.DelegatorUnbondingDelegations({delegatorAddr:i,pagination:(0,vt.createPagination)(o)}),delegatorValidator:async(i,o)=>await t.DelegatorValidator({delegatorAddr:i,validatorAddr:o}),delegatorValidators:async(i,o)=>await t.DelegatorValidators({delegatorAddr:i,pagination:(0,vt.createPagination)(o)}),historicalInfo:async i=>await t.HistoricalInfo({height:BigInt(i)}),params:async()=>await t.Params({}),pool:async()=>await t.Pool({}),redelegations:async(i,o,g,C)=>await t.Redelegations({delegatorAddr:i,srcValidatorAddr:o,dstValidatorAddr:g,pagination:(0,vt.createPagination)(C)}),unbondingDelegation:async(i,o)=>await t.UnbondingDelegation({delegatorAddr:i,validatorAddr:o}),validator:async i=>await t.Validator({validatorAddr:i}),validatorDelegations:async(i,o)=>await t.ValidatorDelegations({validatorAddr:i,pagination:(0,vt.createPagination)(o)}),validators:async(i,o)=>await t.Validators({status:i,pagination:(0,vt.createPagination)(o)}),validatorUnbondingDelegations:async(i,o)=>await t.ValidatorUnbondingDelegations({validatorAddr:i,pagination:(0,vt.createPagination)(o)})}}}ks.setupStakingExtension=IP;var Ps={},Hc={},To={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SearchTxsResult=e.TxMsgData=e.MsgData=e.SimulationResponse=e.Result=e.GasInfo=e.Attribute=e.StringEvent=e.ABCIMessageLog=e.TxResponse=e.protobufPackage=void 0;const n=_.any,t=Dc,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.base.abci.v1beta1";function g(){return{height:BigInt(0),txhash:"",codespace:"",code:0,data:"",rawLog:"",logs:[],info:"",gasWanted:BigInt(0),gasUsed:BigInt(0),tx:void 0,timestamp:"",events:[]}}e.TxResponse={typeUrl:"/cosmos.base.abci.v1beta1.TxResponse",encode(u,c=i.BinaryWriter.create()){u.height!==BigInt(0)&&c.uint32(8).int64(u.height),u.txhash!==""&&c.uint32(18).string(u.txhash),u.codespace!==""&&c.uint32(26).string(u.codespace),u.code!==0&&c.uint32(32).uint32(u.code),u.data!==""&&c.uint32(42).string(u.data),u.rawLog!==""&&c.uint32(50).string(u.rawLog);for(const y of u.logs)e.ABCIMessageLog.encode(y,c.uint32(58).fork()).ldelim();u.info!==""&&c.uint32(66).string(u.info),u.gasWanted!==BigInt(0)&&c.uint32(72).int64(u.gasWanted),u.gasUsed!==BigInt(0)&&c.uint32(80).int64(u.gasUsed),u.tx!==void 0&&n.Any.encode(u.tx,c.uint32(90).fork()).ldelim(),u.timestamp!==""&&c.uint32(98).string(u.timestamp);for(const y of u.events)t.Event.encode(y,c.uint32(106).fork()).ldelim();return c},decode(u,c){const y=u instanceof i.BinaryReader?u:new i.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=g();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.height=y.int64();break;case 2:N.txhash=y.string();break;case 3:N.codespace=y.string();break;case 4:N.code=y.uint32();break;case 5:N.data=y.string();break;case 6:N.rawLog=y.string();break;case 7:N.logs.push(e.ABCIMessageLog.decode(y,y.uint32()));break;case 8:N.info=y.string();break;case 9:N.gasWanted=y.int64();break;case 10:N.gasUsed=y.int64();break;case 11:N.tx=n.Any.decode(y,y.uint32());break;case 12:N.timestamp=y.string();break;case 13:N.events.push(t.Event.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=g();return(0,o.isSet)(u.height)&&(c.height=BigInt(u.height.toString())),(0,o.isSet)(u.txhash)&&(c.txhash=String(u.txhash)),(0,o.isSet)(u.codespace)&&(c.codespace=String(u.codespace)),(0,o.isSet)(u.code)&&(c.code=Number(u.code)),(0,o.isSet)(u.data)&&(c.data=String(u.data)),(0,o.isSet)(u.rawLog)&&(c.rawLog=String(u.rawLog)),Array.isArray(u==null?void 0:u.logs)&&(c.logs=u.logs.map(y=>e.ABCIMessageLog.fromJSON(y))),(0,o.isSet)(u.info)&&(c.info=String(u.info)),(0,o.isSet)(u.gasWanted)&&(c.gasWanted=BigInt(u.gasWanted.toString())),(0,o.isSet)(u.gasUsed)&&(c.gasUsed=BigInt(u.gasUsed.toString())),(0,o.isSet)(u.tx)&&(c.tx=n.Any.fromJSON(u.tx)),(0,o.isSet)(u.timestamp)&&(c.timestamp=String(u.timestamp)),Array.isArray(u==null?void 0:u.events)&&(c.events=u.events.map(y=>t.Event.fromJSON(y))),c},toJSON(u){const c={};return u.height!==void 0&&(c.height=(u.height||BigInt(0)).toString()),u.txhash!==void 0&&(c.txhash=u.txhash),u.codespace!==void 0&&(c.codespace=u.codespace),u.code!==void 0&&(c.code=Math.round(u.code)),u.data!==void 0&&(c.data=u.data),u.rawLog!==void 0&&(c.rawLog=u.rawLog),u.logs?c.logs=u.logs.map(y=>y?e.ABCIMessageLog.toJSON(y):void 0):c.logs=[],u.info!==void 0&&(c.info=u.info),u.gasWanted!==void 0&&(c.gasWanted=(u.gasWanted||BigInt(0)).toString()),u.gasUsed!==void 0&&(c.gasUsed=(u.gasUsed||BigInt(0)).toString()),u.tx!==void 0&&(c.tx=u.tx?n.Any.toJSON(u.tx):void 0),u.timestamp!==void 0&&(c.timestamp=u.timestamp),u.events?c.events=u.events.map(y=>y?t.Event.toJSON(y):void 0):c.events=[],c},fromPartial(u){var y,B;const c=g();return u.height!==void 0&&u.height!==null&&(c.height=BigInt(u.height.toString())),c.txhash=u.txhash??"",c.codespace=u.codespace??"",c.code=u.code??0,c.data=u.data??"",c.rawLog=u.rawLog??"",c.logs=((y=u.logs)==null?void 0:y.map(N=>e.ABCIMessageLog.fromPartial(N)))||[],c.info=u.info??"",u.gasWanted!==void 0&&u.gasWanted!==null&&(c.gasWanted=BigInt(u.gasWanted.toString())),u.gasUsed!==void 0&&u.gasUsed!==null&&(c.gasUsed=BigInt(u.gasUsed.toString())),u.tx!==void 0&&u.tx!==null&&(c.tx=n.Any.fromPartial(u.tx)),c.timestamp=u.timestamp??"",c.events=((B=u.events)==null?void 0:B.map(N=>t.Event.fromPartial(N)))||[],c}};function C(){return{msgIndex:0,log:"",events:[]}}e.ABCIMessageLog={typeUrl:"/cosmos.base.abci.v1beta1.ABCIMessageLog",encode(u,c=i.BinaryWriter.create()){u.msgIndex!==0&&c.uint32(8).uint32(u.msgIndex),u.log!==""&&c.uint32(18).string(u.log);for(const y of u.events)e.StringEvent.encode(y,c.uint32(26).fork()).ldelim();return c},decode(u,c){const y=u instanceof i.BinaryReader?u:new i.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=C();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.msgIndex=y.uint32();break;case 2:N.log=y.string();break;case 3:N.events.push(e.StringEvent.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=C();return(0,o.isSet)(u.msgIndex)&&(c.msgIndex=Number(u.msgIndex)),(0,o.isSet)(u.log)&&(c.log=String(u.log)),Array.isArray(u==null?void 0:u.events)&&(c.events=u.events.map(y=>e.StringEvent.fromJSON(y))),c},toJSON(u){const c={};return u.msgIndex!==void 0&&(c.msgIndex=Math.round(u.msgIndex)),u.log!==void 0&&(c.log=u.log),u.events?c.events=u.events.map(y=>y?e.StringEvent.toJSON(y):void 0):c.events=[],c},fromPartial(u){var y;const c=C();return c.msgIndex=u.msgIndex??0,c.log=u.log??"",c.events=((y=u.events)==null?void 0:y.map(B=>e.StringEvent.fromPartial(B)))||[],c}};function w(){return{type:"",attributes:[]}}e.StringEvent={typeUrl:"/cosmos.base.abci.v1beta1.StringEvent",encode(u,c=i.BinaryWriter.create()){u.type!==""&&c.uint32(10).string(u.type);for(const y of u.attributes)e.Attribute.encode(y,c.uint32(18).fork()).ldelim();return c},decode(u,c){const y=u instanceof i.BinaryReader?u:new i.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=w();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.type=y.string();break;case 2:N.attributes.push(e.Attribute.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=w();return(0,o.isSet)(u.type)&&(c.type=String(u.type)),Array.isArray(u==null?void 0:u.attributes)&&(c.attributes=u.attributes.map(y=>e.Attribute.fromJSON(y))),c},toJSON(u){const c={};return u.type!==void 0&&(c.type=u.type),u.attributes?c.attributes=u.attributes.map(y=>y?e.Attribute.toJSON(y):void 0):c.attributes=[],c},fromPartial(u){var y;const c=w();return c.type=u.type??"",c.attributes=((y=u.attributes)==null?void 0:y.map(B=>e.Attribute.fromPartial(B)))||[],c}};function E(){return{key:"",value:""}}e.Attribute={typeUrl:"/cosmos.base.abci.v1beta1.Attribute",encode(u,c=i.BinaryWriter.create()){return u.key!==""&&c.uint32(10).string(u.key),u.value!==""&&c.uint32(18).string(u.value),c},decode(u,c){const y=u instanceof i.BinaryReader?u:new i.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=E();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.key=y.string();break;case 2:N.value=y.string();break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=E();return(0,o.isSet)(u.key)&&(c.key=String(u.key)),(0,o.isSet)(u.value)&&(c.value=String(u.value)),c},toJSON(u){const c={};return u.key!==void 0&&(c.key=u.key),u.value!==void 0&&(c.value=u.value),c},fromPartial(u){const c=E();return c.key=u.key??"",c.value=u.value??"",c}};function D(){return{gasWanted:BigInt(0),gasUsed:BigInt(0)}}e.GasInfo={typeUrl:"/cosmos.base.abci.v1beta1.GasInfo",encode(u,c=i.BinaryWriter.create()){return u.gasWanted!==BigInt(0)&&c.uint32(8).uint64(u.gasWanted),u.gasUsed!==BigInt(0)&&c.uint32(16).uint64(u.gasUsed),c},decode(u,c){const y=u instanceof i.BinaryReader?u:new i.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=D();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.gasWanted=y.uint64();break;case 2:N.gasUsed=y.uint64();break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=D();return(0,o.isSet)(u.gasWanted)&&(c.gasWanted=BigInt(u.gasWanted.toString())),(0,o.isSet)(u.gasUsed)&&(c.gasUsed=BigInt(u.gasUsed.toString())),c},toJSON(u){const c={};return u.gasWanted!==void 0&&(c.gasWanted=(u.gasWanted||BigInt(0)).toString()),u.gasUsed!==void 0&&(c.gasUsed=(u.gasUsed||BigInt(0)).toString()),c},fromPartial(u){const c=D();return u.gasWanted!==void 0&&u.gasWanted!==null&&(c.gasWanted=BigInt(u.gasWanted.toString())),u.gasUsed!==void 0&&u.gasUsed!==null&&(c.gasUsed=BigInt(u.gasUsed.toString())),c}};function J(){return{data:new Uint8Array,log:"",events:[],msgResponses:[]}}e.Result={typeUrl:"/cosmos.base.abci.v1beta1.Result",encode(u,c=i.BinaryWriter.create()){u.data.length!==0&&c.uint32(10).bytes(u.data),u.log!==""&&c.uint32(18).string(u.log);for(const y of u.events)t.Event.encode(y,c.uint32(26).fork()).ldelim();for(const y of u.msgResponses)n.Any.encode(y,c.uint32(34).fork()).ldelim();return c},decode(u,c){const y=u instanceof i.BinaryReader?u:new i.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=J();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.data=y.bytes();break;case 2:N.log=y.string();break;case 3:N.events.push(t.Event.decode(y,y.uint32()));break;case 4:N.msgResponses.push(n.Any.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=J();return(0,o.isSet)(u.data)&&(c.data=(0,o.bytesFromBase64)(u.data)),(0,o.isSet)(u.log)&&(c.log=String(u.log)),Array.isArray(u==null?void 0:u.events)&&(c.events=u.events.map(y=>t.Event.fromJSON(y))),Array.isArray(u==null?void 0:u.msgResponses)&&(c.msgResponses=u.msgResponses.map(y=>n.Any.fromJSON(y))),c},toJSON(u){const c={};return u.data!==void 0&&(c.data=(0,o.base64FromBytes)(u.data!==void 0?u.data:new Uint8Array)),u.log!==void 0&&(c.log=u.log),u.events?c.events=u.events.map(y=>y?t.Event.toJSON(y):void 0):c.events=[],u.msgResponses?c.msgResponses=u.msgResponses.map(y=>y?n.Any.toJSON(y):void 0):c.msgResponses=[],c},fromPartial(u){var y,B;const c=J();return c.data=u.data??new Uint8Array,c.log=u.log??"",c.events=((y=u.events)==null?void 0:y.map(N=>t.Event.fromPartial(N)))||[],c.msgResponses=((B=u.msgResponses)==null?void 0:B.map(N=>n.Any.fromPartial(N)))||[],c}};function b(){return{gasInfo:e.GasInfo.fromPartial({}),result:void 0}}e.SimulationResponse={typeUrl:"/cosmos.base.abci.v1beta1.SimulationResponse",encode(u,c=i.BinaryWriter.create()){return u.gasInfo!==void 0&&e.GasInfo.encode(u.gasInfo,c.uint32(10).fork()).ldelim(),u.result!==void 0&&e.Result.encode(u.result,c.uint32(18).fork()).ldelim(),c},decode(u,c){const y=u instanceof i.BinaryReader?u:new i.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=b();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.gasInfo=e.GasInfo.decode(y,y.uint32());break;case 2:N.result=e.Result.decode(y,y.uint32());break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=b();return(0,o.isSet)(u.gasInfo)&&(c.gasInfo=e.GasInfo.fromJSON(u.gasInfo)),(0,o.isSet)(u.result)&&(c.result=e.Result.fromJSON(u.result)),c},toJSON(u){const c={};return u.gasInfo!==void 0&&(c.gasInfo=u.gasInfo?e.GasInfo.toJSON(u.gasInfo):void 0),u.result!==void 0&&(c.result=u.result?e.Result.toJSON(u.result):void 0),c},fromPartial(u){const c=b();return u.gasInfo!==void 0&&u.gasInfo!==null&&(c.gasInfo=e.GasInfo.fromPartial(u.gasInfo)),u.result!==void 0&&u.result!==null&&(c.result=e.Result.fromPartial(u.result)),c}};function p(){return{msgType:"",data:new Uint8Array}}e.MsgData={typeUrl:"/cosmos.base.abci.v1beta1.MsgData",encode(u,c=i.BinaryWriter.create()){return u.msgType!==""&&c.uint32(10).string(u.msgType),u.data.length!==0&&c.uint32(18).bytes(u.data),c},decode(u,c){const y=u instanceof i.BinaryReader?u:new i.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=p();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.msgType=y.string();break;case 2:N.data=y.bytes();break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=p();return(0,o.isSet)(u.msgType)&&(c.msgType=String(u.msgType)),(0,o.isSet)(u.data)&&(c.data=(0,o.bytesFromBase64)(u.data)),c},toJSON(u){const c={};return u.msgType!==void 0&&(c.msgType=u.msgType),u.data!==void 0&&(c.data=(0,o.base64FromBytes)(u.data!==void 0?u.data:new Uint8Array)),c},fromPartial(u){const c=p();return c.msgType=u.msgType??"",c.data=u.data??new Uint8Array,c}};function S(){return{data:[],msgResponses:[]}}e.TxMsgData={typeUrl:"/cosmos.base.abci.v1beta1.TxMsgData",encode(u,c=i.BinaryWriter.create()){for(const y of u.data)e.MsgData.encode(y,c.uint32(10).fork()).ldelim();for(const y of u.msgResponses)n.Any.encode(y,c.uint32(18).fork()).ldelim();return c},decode(u,c){const y=u instanceof i.BinaryReader?u:new i.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=S();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.data.push(e.MsgData.decode(y,y.uint32()));break;case 2:N.msgResponses.push(n.Any.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=S();return Array.isArray(u==null?void 0:u.data)&&(c.data=u.data.map(y=>e.MsgData.fromJSON(y))),Array.isArray(u==null?void 0:u.msgResponses)&&(c.msgResponses=u.msgResponses.map(y=>n.Any.fromJSON(y))),c},toJSON(u){const c={};return u.data?c.data=u.data.map(y=>y?e.MsgData.toJSON(y):void 0):c.data=[],u.msgResponses?c.msgResponses=u.msgResponses.map(y=>y?n.Any.toJSON(y):void 0):c.msgResponses=[],c},fromPartial(u){var y,B;const c=S();return c.data=((y=u.data)==null?void 0:y.map(N=>e.MsgData.fromPartial(N)))||[],c.msgResponses=((B=u.msgResponses)==null?void 0:B.map(N=>n.Any.fromPartial(N)))||[],c}};function R(){return{totalCount:BigInt(0),count:BigInt(0),pageNumber:BigInt(0),pageTotal:BigInt(0),limit:BigInt(0),txs:[]}}e.SearchTxsResult={typeUrl:"/cosmos.base.abci.v1beta1.SearchTxsResult",encode(u,c=i.BinaryWriter.create()){u.totalCount!==BigInt(0)&&c.uint32(8).uint64(u.totalCount),u.count!==BigInt(0)&&c.uint32(16).uint64(u.count),u.pageNumber!==BigInt(0)&&c.uint32(24).uint64(u.pageNumber),u.pageTotal!==BigInt(0)&&c.uint32(32).uint64(u.pageTotal),u.limit!==BigInt(0)&&c.uint32(40).uint64(u.limit);for(const y of u.txs)e.TxResponse.encode(y,c.uint32(50).fork()).ldelim();return c},decode(u,c){const y=u instanceof i.BinaryReader?u:new i.BinaryReader(u);let B=c===void 0?y.len:y.pos+c;const N=R();for(;y.pos<B;){const U=y.uint32();switch(U>>>3){case 1:N.totalCount=y.uint64();break;case 2:N.count=y.uint64();break;case 3:N.pageNumber=y.uint64();break;case 4:N.pageTotal=y.uint64();break;case 5:N.limit=y.uint64();break;case 6:N.txs.push(e.TxResponse.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return N},fromJSON(u){const c=R();return(0,o.isSet)(u.totalCount)&&(c.totalCount=BigInt(u.totalCount.toString())),(0,o.isSet)(u.count)&&(c.count=BigInt(u.count.toString())),(0,o.isSet)(u.pageNumber)&&(c.pageNumber=BigInt(u.pageNumber.toString())),(0,o.isSet)(u.pageTotal)&&(c.pageTotal=BigInt(u.pageTotal.toString())),(0,o.isSet)(u.limit)&&(c.limit=BigInt(u.limit.toString())),Array.isArray(u==null?void 0:u.txs)&&(c.txs=u.txs.map(y=>e.TxResponse.fromJSON(y))),c},toJSON(u){const c={};return u.totalCount!==void 0&&(c.totalCount=(u.totalCount||BigInt(0)).toString()),u.count!==void 0&&(c.count=(u.count||BigInt(0)).toString()),u.pageNumber!==void 0&&(c.pageNumber=(u.pageNumber||BigInt(0)).toString()),u.pageTotal!==void 0&&(c.pageTotal=(u.pageTotal||BigInt(0)).toString()),u.limit!==void 0&&(c.limit=(u.limit||BigInt(0)).toString()),u.txs?c.txs=u.txs.map(y=>y?e.TxResponse.toJSON(y):void 0):c.txs=[],c},fromPartial(u){var y;const c=R();return u.totalCount!==void 0&&u.totalCount!==null&&(c.totalCount=BigInt(u.totalCount.toString())),u.count!==void 0&&u.count!==null&&(c.count=BigInt(u.count.toString())),u.pageNumber!==void 0&&u.pageNumber!==null&&(c.pageNumber=BigInt(u.pageNumber.toString())),u.pageTotal!==void 0&&u.pageTotal!==null&&(c.pageTotal=BigInt(u.pageTotal.toString())),u.limit!==void 0&&u.limit!==null&&(c.limit=BigInt(u.limit.toString())),c.txs=((y=u.txs)==null?void 0:y.map(B=>e.TxResponse.fromPartial(B)))||[],c}}})(To);var Si={},Cm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EvidenceList=e.LightClientAttackEvidence=e.DuplicateVoteEvidence=e.Evidence=e.protobufPackage=void 0;const n=mr,t=Je,i=gs,o=_.binary,g=_.helpers;e.protobufPackage="tendermint.types";function C(){return{duplicateVoteEvidence:void 0,lightClientAttackEvidence:void 0}}e.Evidence={typeUrl:"/tendermint.types.Evidence",encode(J,b=o.BinaryWriter.create()){return J.duplicateVoteEvidence!==void 0&&e.DuplicateVoteEvidence.encode(J.duplicateVoteEvidence,b.uint32(10).fork()).ldelim(),J.lightClientAttackEvidence!==void 0&&e.LightClientAttackEvidence.encode(J.lightClientAttackEvidence,b.uint32(18).fork()).ldelim(),b},decode(J,b){const p=J instanceof o.BinaryReader?J:new o.BinaryReader(J);let S=b===void 0?p.len:p.pos+b;const R=C();for(;p.pos<S;){const u=p.uint32();switch(u>>>3){case 1:R.duplicateVoteEvidence=e.DuplicateVoteEvidence.decode(p,p.uint32());break;case 2:R.lightClientAttackEvidence=e.LightClientAttackEvidence.decode(p,p.uint32());break;default:p.skipType(u&7);break}}return R},fromJSON(J){const b=C();return(0,g.isSet)(J.duplicateVoteEvidence)&&(b.duplicateVoteEvidence=e.DuplicateVoteEvidence.fromJSON(J.duplicateVoteEvidence)),(0,g.isSet)(J.lightClientAttackEvidence)&&(b.lightClientAttackEvidence=e.LightClientAttackEvidence.fromJSON(J.lightClientAttackEvidence)),b},toJSON(J){const b={};return J.duplicateVoteEvidence!==void 0&&(b.duplicateVoteEvidence=J.duplicateVoteEvidence?e.DuplicateVoteEvidence.toJSON(J.duplicateVoteEvidence):void 0),J.lightClientAttackEvidence!==void 0&&(b.lightClientAttackEvidence=J.lightClientAttackEvidence?e.LightClientAttackEvidence.toJSON(J.lightClientAttackEvidence):void 0),b},fromPartial(J){const b=C();return J.duplicateVoteEvidence!==void 0&&J.duplicateVoteEvidence!==null&&(b.duplicateVoteEvidence=e.DuplicateVoteEvidence.fromPartial(J.duplicateVoteEvidence)),J.lightClientAttackEvidence!==void 0&&J.lightClientAttackEvidence!==null&&(b.lightClientAttackEvidence=e.LightClientAttackEvidence.fromPartial(J.lightClientAttackEvidence)),b}};function w(){return{voteA:void 0,voteB:void 0,totalVotingPower:BigInt(0),validatorPower:BigInt(0),timestamp:t.Timestamp.fromPartial({})}}e.DuplicateVoteEvidence={typeUrl:"/tendermint.types.DuplicateVoteEvidence",encode(J,b=o.BinaryWriter.create()){return J.voteA!==void 0&&n.Vote.encode(J.voteA,b.uint32(10).fork()).ldelim(),J.voteB!==void 0&&n.Vote.encode(J.voteB,b.uint32(18).fork()).ldelim(),J.totalVotingPower!==BigInt(0)&&b.uint32(24).int64(J.totalVotingPower),J.validatorPower!==BigInt(0)&&b.uint32(32).int64(J.validatorPower),J.timestamp!==void 0&&t.Timestamp.encode(J.timestamp,b.uint32(42).fork()).ldelim(),b},decode(J,b){const p=J instanceof o.BinaryReader?J:new o.BinaryReader(J);let S=b===void 0?p.len:p.pos+b;const R=w();for(;p.pos<S;){const u=p.uint32();switch(u>>>3){case 1:R.voteA=n.Vote.decode(p,p.uint32());break;case 2:R.voteB=n.Vote.decode(p,p.uint32());break;case 3:R.totalVotingPower=p.int64();break;case 4:R.validatorPower=p.int64();break;case 5:R.timestamp=t.Timestamp.decode(p,p.uint32());break;default:p.skipType(u&7);break}}return R},fromJSON(J){const b=w();return(0,g.isSet)(J.voteA)&&(b.voteA=n.Vote.fromJSON(J.voteA)),(0,g.isSet)(J.voteB)&&(b.voteB=n.Vote.fromJSON(J.voteB)),(0,g.isSet)(J.totalVotingPower)&&(b.totalVotingPower=BigInt(J.totalVotingPower.toString())),(0,g.isSet)(J.validatorPower)&&(b.validatorPower=BigInt(J.validatorPower.toString())),(0,g.isSet)(J.timestamp)&&(b.timestamp=(0,g.fromJsonTimestamp)(J.timestamp)),b},toJSON(J){const b={};return J.voteA!==void 0&&(b.voteA=J.voteA?n.Vote.toJSON(J.voteA):void 0),J.voteB!==void 0&&(b.voteB=J.voteB?n.Vote.toJSON(J.voteB):void 0),J.totalVotingPower!==void 0&&(b.totalVotingPower=(J.totalVotingPower||BigInt(0)).toString()),J.validatorPower!==void 0&&(b.validatorPower=(J.validatorPower||BigInt(0)).toString()),J.timestamp!==void 0&&(b.timestamp=(0,g.fromTimestamp)(J.timestamp).toISOString()),b},fromPartial(J){const b=w();return J.voteA!==void 0&&J.voteA!==null&&(b.voteA=n.Vote.fromPartial(J.voteA)),J.voteB!==void 0&&J.voteB!==null&&(b.voteB=n.Vote.fromPartial(J.voteB)),J.totalVotingPower!==void 0&&J.totalVotingPower!==null&&(b.totalVotingPower=BigInt(J.totalVotingPower.toString())),J.validatorPower!==void 0&&J.validatorPower!==null&&(b.validatorPower=BigInt(J.validatorPower.toString())),J.timestamp!==void 0&&J.timestamp!==null&&(b.timestamp=t.Timestamp.fromPartial(J.timestamp)),b}};function E(){return{conflictingBlock:void 0,commonHeight:BigInt(0),byzantineValidators:[],totalVotingPower:BigInt(0),timestamp:t.Timestamp.fromPartial({})}}e.LightClientAttackEvidence={typeUrl:"/tendermint.types.LightClientAttackEvidence",encode(J,b=o.BinaryWriter.create()){J.conflictingBlock!==void 0&&n.LightBlock.encode(J.conflictingBlock,b.uint32(10).fork()).ldelim(),J.commonHeight!==BigInt(0)&&b.uint32(16).int64(J.commonHeight);for(const p of J.byzantineValidators)i.Validator.encode(p,b.uint32(26).fork()).ldelim();return J.totalVotingPower!==BigInt(0)&&b.uint32(32).int64(J.totalVotingPower),J.timestamp!==void 0&&t.Timestamp.encode(J.timestamp,b.uint32(42).fork()).ldelim(),b},decode(J,b){const p=J instanceof o.BinaryReader?J:new o.BinaryReader(J);let S=b===void 0?p.len:p.pos+b;const R=E();for(;p.pos<S;){const u=p.uint32();switch(u>>>3){case 1:R.conflictingBlock=n.LightBlock.decode(p,p.uint32());break;case 2:R.commonHeight=p.int64();break;case 3:R.byzantineValidators.push(i.Validator.decode(p,p.uint32()));break;case 4:R.totalVotingPower=p.int64();break;case 5:R.timestamp=t.Timestamp.decode(p,p.uint32());break;default:p.skipType(u&7);break}}return R},fromJSON(J){const b=E();return(0,g.isSet)(J.conflictingBlock)&&(b.conflictingBlock=n.LightBlock.fromJSON(J.conflictingBlock)),(0,g.isSet)(J.commonHeight)&&(b.commonHeight=BigInt(J.commonHeight.toString())),Array.isArray(J==null?void 0:J.byzantineValidators)&&(b.byzantineValidators=J.byzantineValidators.map(p=>i.Validator.fromJSON(p))),(0,g.isSet)(J.totalVotingPower)&&(b.totalVotingPower=BigInt(J.totalVotingPower.toString())),(0,g.isSet)(J.timestamp)&&(b.timestamp=(0,g.fromJsonTimestamp)(J.timestamp)),b},toJSON(J){const b={};return J.conflictingBlock!==void 0&&(b.conflictingBlock=J.conflictingBlock?n.LightBlock.toJSON(J.conflictingBlock):void 0),J.commonHeight!==void 0&&(b.commonHeight=(J.commonHeight||BigInt(0)).toString()),J.byzantineValidators?b.byzantineValidators=J.byzantineValidators.map(p=>p?i.Validator.toJSON(p):void 0):b.byzantineValidators=[],J.totalVotingPower!==void 0&&(b.totalVotingPower=(J.totalVotingPower||BigInt(0)).toString()),J.timestamp!==void 0&&(b.timestamp=(0,g.fromTimestamp)(J.timestamp).toISOString()),b},fromPartial(J){var p;const b=E();return J.conflictingBlock!==void 0&&J.conflictingBlock!==null&&(b.conflictingBlock=n.LightBlock.fromPartial(J.conflictingBlock)),J.commonHeight!==void 0&&J.commonHeight!==null&&(b.commonHeight=BigInt(J.commonHeight.toString())),b.byzantineValidators=((p=J.byzantineValidators)==null?void 0:p.map(S=>i.Validator.fromPartial(S)))||[],J.totalVotingPower!==void 0&&J.totalVotingPower!==null&&(b.totalVotingPower=BigInt(J.totalVotingPower.toString())),J.timestamp!==void 0&&J.timestamp!==null&&(b.timestamp=t.Timestamp.fromPartial(J.timestamp)),b}};function D(){return{evidence:[]}}e.EvidenceList={typeUrl:"/tendermint.types.EvidenceList",encode(J,b=o.BinaryWriter.create()){for(const p of J.evidence)e.Evidence.encode(p,b.uint32(10).fork()).ldelim();return b},decode(J,b){const p=J instanceof o.BinaryReader?J:new o.BinaryReader(J);let S=b===void 0?p.len:p.pos+b;const R=D();for(;p.pos<S;){const u=p.uint32();switch(u>>>3){case 1:R.evidence.push(e.Evidence.decode(p,p.uint32()));break;default:p.skipType(u&7);break}}return R},fromJSON(J){const b=D();return Array.isArray(J==null?void 0:J.evidence)&&(b.evidence=J.evidence.map(p=>e.Evidence.fromJSON(p))),b},toJSON(J){const b={};return J.evidence?b.evidence=J.evidence.map(p=>p?e.Evidence.toJSON(p):void 0):b.evidence=[],b},fromPartial(J){var p;const b=D();return b.evidence=((p=J.evidence)==null?void 0:p.map(S=>e.Evidence.fromPartial(S)))||[],b}}})(Cm);Object.defineProperty(Si,"__esModule",{value:!0});Si.Block=Si.protobufPackage=void 0;const He=mr,Tr=Cm,du=_.binary,na=_.helpers;Si.protobufPackage="tendermint.types";function uu(){return{header:He.Header.fromPartial({}),data:He.Data.fromPartial({}),evidence:Tr.EvidenceList.fromPartial({}),lastCommit:void 0}}Si.Block={typeUrl:"/tendermint.types.Block",encode(e,n=du.BinaryWriter.create()){return e.header!==void 0&&He.Header.encode(e.header,n.uint32(10).fork()).ldelim(),e.data!==void 0&&He.Data.encode(e.data,n.uint32(18).fork()).ldelim(),e.evidence!==void 0&&Tr.EvidenceList.encode(e.evidence,n.uint32(26).fork()).ldelim(),e.lastCommit!==void 0&&He.Commit.encode(e.lastCommit,n.uint32(34).fork()).ldelim(),n},decode(e,n){const t=e instanceof du.BinaryReader?e:new du.BinaryReader(e);let i=n===void 0?t.len:t.pos+n;const o=uu();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:o.header=He.Header.decode(t,t.uint32());break;case 2:o.data=He.Data.decode(t,t.uint32());break;case 3:o.evidence=Tr.EvidenceList.decode(t,t.uint32());break;case 4:o.lastCommit=He.Commit.decode(t,t.uint32());break;default:t.skipType(g&7);break}}return o},fromJSON(e){const n=uu();return(0,na.isSet)(e.header)&&(n.header=He.Header.fromJSON(e.header)),(0,na.isSet)(e.data)&&(n.data=He.Data.fromJSON(e.data)),(0,na.isSet)(e.evidence)&&(n.evidence=Tr.EvidenceList.fromJSON(e.evidence)),(0,na.isSet)(e.lastCommit)&&(n.lastCommit=He.Commit.fromJSON(e.lastCommit)),n},toJSON(e){const n={};return e.header!==void 0&&(n.header=e.header?He.Header.toJSON(e.header):void 0),e.data!==void 0&&(n.data=e.data?He.Data.toJSON(e.data):void 0),e.evidence!==void 0&&(n.evidence=e.evidence?Tr.EvidenceList.toJSON(e.evidence):void 0),e.lastCommit!==void 0&&(n.lastCommit=e.lastCommit?He.Commit.toJSON(e.lastCommit):void 0),n},fromPartial(e){const n=uu();return e.header!==void 0&&e.header!==null&&(n.header=He.Header.fromPartial(e.header)),e.data!==void 0&&e.data!==null&&(n.data=He.Data.fromPartial(e.data)),e.evidence!==void 0&&e.evidence!==null&&(n.evidence=Tr.EvidenceList.fromPartial(e.evidence)),e.lastCommit!==void 0&&e.lastCommit!==null&&(n.lastCommit=He.Commit.fromPartial(e.lastCommit)),n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ServiceClientImpl=e.TxDecodeAminoResponse=e.TxDecodeAminoRequest=e.TxEncodeAminoResponse=e.TxEncodeAminoRequest=e.TxEncodeResponse=e.TxEncodeRequest=e.TxDecodeResponse=e.TxDecodeRequest=e.GetBlockWithTxsResponse=e.GetBlockWithTxsRequest=e.GetTxResponse=e.GetTxRequest=e.SimulateResponse=e.SimulateRequest=e.BroadcastTxResponse=e.BroadcastTxRequest=e.GetTxsEventResponse=e.GetTxsEventRequest=e.broadcastModeToJSON=e.broadcastModeFromJSON=e.BroadcastMode=e.orderByToJSON=e.orderByFromJSON=e.OrderBy=e.protobufPackage=void 0;const n=_.tx,t=Be,i=To,o=mr,g=Si,C=_.binary,w=_.helpers;e.protobufPackage="cosmos.tx.v1beta1";var E;(function(H){H[H.ORDER_BY_UNSPECIFIED=0]="ORDER_BY_UNSPECIFIED",H[H.ORDER_BY_ASC=1]="ORDER_BY_ASC",H[H.ORDER_BY_DESC=2]="ORDER_BY_DESC",H[H.UNRECOGNIZED=-1]="UNRECOGNIZED"})(E||(e.OrderBy=E={}));function D(H){switch(H){case 0:case"ORDER_BY_UNSPECIFIED":return E.ORDER_BY_UNSPECIFIED;case 1:case"ORDER_BY_ASC":return E.ORDER_BY_ASC;case 2:case"ORDER_BY_DESC":return E.ORDER_BY_DESC;case-1:case"UNRECOGNIZED":default:return E.UNRECOGNIZED}}e.orderByFromJSON=D;function J(H){switch(H){case E.ORDER_BY_UNSPECIFIED:return"ORDER_BY_UNSPECIFIED";case E.ORDER_BY_ASC:return"ORDER_BY_ASC";case E.ORDER_BY_DESC:return"ORDER_BY_DESC";case E.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.orderByToJSON=J;var b;(function(H){H[H.BROADCAST_MODE_UNSPECIFIED=0]="BROADCAST_MODE_UNSPECIFIED",H[H.BROADCAST_MODE_BLOCK=1]="BROADCAST_MODE_BLOCK",H[H.BROADCAST_MODE_SYNC=2]="BROADCAST_MODE_SYNC",H[H.BROADCAST_MODE_ASYNC=3]="BROADCAST_MODE_ASYNC",H[H.UNRECOGNIZED=-1]="UNRECOGNIZED"})(b||(e.BroadcastMode=b={}));function p(H){switch(H){case 0:case"BROADCAST_MODE_UNSPECIFIED":return b.BROADCAST_MODE_UNSPECIFIED;case 1:case"BROADCAST_MODE_BLOCK":return b.BROADCAST_MODE_BLOCK;case 2:case"BROADCAST_MODE_SYNC":return b.BROADCAST_MODE_SYNC;case 3:case"BROADCAST_MODE_ASYNC":return b.BROADCAST_MODE_ASYNC;case-1:case"UNRECOGNIZED":default:return b.UNRECOGNIZED}}e.broadcastModeFromJSON=p;function S(H){switch(H){case b.BROADCAST_MODE_UNSPECIFIED:return"BROADCAST_MODE_UNSPECIFIED";case b.BROADCAST_MODE_BLOCK:return"BROADCAST_MODE_BLOCK";case b.BROADCAST_MODE_SYNC:return"BROADCAST_MODE_SYNC";case b.BROADCAST_MODE_ASYNC:return"BROADCAST_MODE_ASYNC";case b.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.broadcastModeToJSON=S;function R(){return{events:[],pagination:void 0,orderBy:0,page:BigInt(0),limit:BigInt(0)}}e.GetTxsEventRequest={typeUrl:"/cosmos.tx.v1beta1.GetTxsEventRequest",encode(H,a=C.BinaryWriter.create()){for(const P of H.events)a.uint32(10).string(P);return H.pagination!==void 0&&t.PageRequest.encode(H.pagination,a.uint32(18).fork()).ldelim(),H.orderBy!==0&&a.uint32(24).int32(H.orderBy),H.page!==BigInt(0)&&a.uint32(32).uint64(H.page),H.limit!==BigInt(0)&&a.uint32(40).uint64(H.limit),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=R();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.events.push(P.string());break;case 2:v.pagination=t.PageRequest.decode(P,P.uint32());break;case 3:v.orderBy=P.int32();break;case 4:v.page=P.uint64();break;case 5:v.limit=P.uint64();break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=R();return Array.isArray(H==null?void 0:H.events)&&(a.events=H.events.map(P=>String(P))),(0,w.isSet)(H.pagination)&&(a.pagination=t.PageRequest.fromJSON(H.pagination)),(0,w.isSet)(H.orderBy)&&(a.orderBy=D(H.orderBy)),(0,w.isSet)(H.page)&&(a.page=BigInt(H.page.toString())),(0,w.isSet)(H.limit)&&(a.limit=BigInt(H.limit.toString())),a},toJSON(H){const a={};return H.events?a.events=H.events.map(P=>P):a.events=[],H.pagination!==void 0&&(a.pagination=H.pagination?t.PageRequest.toJSON(H.pagination):void 0),H.orderBy!==void 0&&(a.orderBy=J(H.orderBy)),H.page!==void 0&&(a.page=(H.page||BigInt(0)).toString()),H.limit!==void 0&&(a.limit=(H.limit||BigInt(0)).toString()),a},fromPartial(H){var P;const a=R();return a.events=((P=H.events)==null?void 0:P.map(k=>k))||[],H.pagination!==void 0&&H.pagination!==null&&(a.pagination=t.PageRequest.fromPartial(H.pagination)),a.orderBy=H.orderBy??0,H.page!==void 0&&H.page!==null&&(a.page=BigInt(H.page.toString())),H.limit!==void 0&&H.limit!==null&&(a.limit=BigInt(H.limit.toString())),a}};function u(){return{txs:[],txResponses:[],pagination:void 0,total:BigInt(0)}}e.GetTxsEventResponse={typeUrl:"/cosmos.tx.v1beta1.GetTxsEventResponse",encode(H,a=C.BinaryWriter.create()){for(const P of H.txs)n.Tx.encode(P,a.uint32(10).fork()).ldelim();for(const P of H.txResponses)i.TxResponse.encode(P,a.uint32(18).fork()).ldelim();return H.pagination!==void 0&&t.PageResponse.encode(H.pagination,a.uint32(26).fork()).ldelim(),H.total!==BigInt(0)&&a.uint32(32).uint64(H.total),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=u();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.txs.push(n.Tx.decode(P,P.uint32()));break;case 2:v.txResponses.push(i.TxResponse.decode(P,P.uint32()));break;case 3:v.pagination=t.PageResponse.decode(P,P.uint32());break;case 4:v.total=P.uint64();break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=u();return Array.isArray(H==null?void 0:H.txs)&&(a.txs=H.txs.map(P=>n.Tx.fromJSON(P))),Array.isArray(H==null?void 0:H.txResponses)&&(a.txResponses=H.txResponses.map(P=>i.TxResponse.fromJSON(P))),(0,w.isSet)(H.pagination)&&(a.pagination=t.PageResponse.fromJSON(H.pagination)),(0,w.isSet)(H.total)&&(a.total=BigInt(H.total.toString())),a},toJSON(H){const a={};return H.txs?a.txs=H.txs.map(P=>P?n.Tx.toJSON(P):void 0):a.txs=[],H.txResponses?a.txResponses=H.txResponses.map(P=>P?i.TxResponse.toJSON(P):void 0):a.txResponses=[],H.pagination!==void 0&&(a.pagination=H.pagination?t.PageResponse.toJSON(H.pagination):void 0),H.total!==void 0&&(a.total=(H.total||BigInt(0)).toString()),a},fromPartial(H){var P,k;const a=u();return a.txs=((P=H.txs)==null?void 0:P.map(v=>n.Tx.fromPartial(v)))||[],a.txResponses=((k=H.txResponses)==null?void 0:k.map(v=>i.TxResponse.fromPartial(v)))||[],H.pagination!==void 0&&H.pagination!==null&&(a.pagination=t.PageResponse.fromPartial(H.pagination)),H.total!==void 0&&H.total!==null&&(a.total=BigInt(H.total.toString())),a}};function c(){return{txBytes:new Uint8Array,mode:0}}e.BroadcastTxRequest={typeUrl:"/cosmos.tx.v1beta1.BroadcastTxRequest",encode(H,a=C.BinaryWriter.create()){return H.txBytes.length!==0&&a.uint32(10).bytes(H.txBytes),H.mode!==0&&a.uint32(16).int32(H.mode),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=c();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.txBytes=P.bytes();break;case 2:v.mode=P.int32();break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=c();return(0,w.isSet)(H.txBytes)&&(a.txBytes=(0,w.bytesFromBase64)(H.txBytes)),(0,w.isSet)(H.mode)&&(a.mode=p(H.mode)),a},toJSON(H){const a={};return H.txBytes!==void 0&&(a.txBytes=(0,w.base64FromBytes)(H.txBytes!==void 0?H.txBytes:new Uint8Array)),H.mode!==void 0&&(a.mode=S(H.mode)),a},fromPartial(H){const a=c();return a.txBytes=H.txBytes??new Uint8Array,a.mode=H.mode??0,a}};function y(){return{txResponse:void 0}}e.BroadcastTxResponse={typeUrl:"/cosmos.tx.v1beta1.BroadcastTxResponse",encode(H,a=C.BinaryWriter.create()){return H.txResponse!==void 0&&i.TxResponse.encode(H.txResponse,a.uint32(10).fork()).ldelim(),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=y();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.txResponse=i.TxResponse.decode(P,P.uint32());break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=y();return(0,w.isSet)(H.txResponse)&&(a.txResponse=i.TxResponse.fromJSON(H.txResponse)),a},toJSON(H){const a={};return H.txResponse!==void 0&&(a.txResponse=H.txResponse?i.TxResponse.toJSON(H.txResponse):void 0),a},fromPartial(H){const a=y();return H.txResponse!==void 0&&H.txResponse!==null&&(a.txResponse=i.TxResponse.fromPartial(H.txResponse)),a}};function B(){return{tx:void 0,txBytes:new Uint8Array}}e.SimulateRequest={typeUrl:"/cosmos.tx.v1beta1.SimulateRequest",encode(H,a=C.BinaryWriter.create()){return H.tx!==void 0&&n.Tx.encode(H.tx,a.uint32(10).fork()).ldelim(),H.txBytes.length!==0&&a.uint32(18).bytes(H.txBytes),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=B();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.tx=n.Tx.decode(P,P.uint32());break;case 2:v.txBytes=P.bytes();break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=B();return(0,w.isSet)(H.tx)&&(a.tx=n.Tx.fromJSON(H.tx)),(0,w.isSet)(H.txBytes)&&(a.txBytes=(0,w.bytesFromBase64)(H.txBytes)),a},toJSON(H){const a={};return H.tx!==void 0&&(a.tx=H.tx?n.Tx.toJSON(H.tx):void 0),H.txBytes!==void 0&&(a.txBytes=(0,w.base64FromBytes)(H.txBytes!==void 0?H.txBytes:new Uint8Array)),a},fromPartial(H){const a=B();return H.tx!==void 0&&H.tx!==null&&(a.tx=n.Tx.fromPartial(H.tx)),a.txBytes=H.txBytes??new Uint8Array,a}};function N(){return{gasInfo:void 0,result:void 0}}e.SimulateResponse={typeUrl:"/cosmos.tx.v1beta1.SimulateResponse",encode(H,a=C.BinaryWriter.create()){return H.gasInfo!==void 0&&i.GasInfo.encode(H.gasInfo,a.uint32(10).fork()).ldelim(),H.result!==void 0&&i.Result.encode(H.result,a.uint32(18).fork()).ldelim(),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=N();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.gasInfo=i.GasInfo.decode(P,P.uint32());break;case 2:v.result=i.Result.decode(P,P.uint32());break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=N();return(0,w.isSet)(H.gasInfo)&&(a.gasInfo=i.GasInfo.fromJSON(H.gasInfo)),(0,w.isSet)(H.result)&&(a.result=i.Result.fromJSON(H.result)),a},toJSON(H){const a={};return H.gasInfo!==void 0&&(a.gasInfo=H.gasInfo?i.GasInfo.toJSON(H.gasInfo):void 0),H.result!==void 0&&(a.result=H.result?i.Result.toJSON(H.result):void 0),a},fromPartial(H){const a=N();return H.gasInfo!==void 0&&H.gasInfo!==null&&(a.gasInfo=i.GasInfo.fromPartial(H.gasInfo)),H.result!==void 0&&H.result!==null&&(a.result=i.Result.fromPartial(H.result)),a}};function U(){return{hash:""}}e.GetTxRequest={typeUrl:"/cosmos.tx.v1beta1.GetTxRequest",encode(H,a=C.BinaryWriter.create()){return H.hash!==""&&a.uint32(10).string(H.hash),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=U();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.hash=P.string();break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=U();return(0,w.isSet)(H.hash)&&(a.hash=String(H.hash)),a},toJSON(H){const a={};return H.hash!==void 0&&(a.hash=H.hash),a},fromPartial(H){const a=U();return a.hash=H.hash??"",a}};function W(){return{tx:void 0,txResponse:void 0}}e.GetTxResponse={typeUrl:"/cosmos.tx.v1beta1.GetTxResponse",encode(H,a=C.BinaryWriter.create()){return H.tx!==void 0&&n.Tx.encode(H.tx,a.uint32(10).fork()).ldelim(),H.txResponse!==void 0&&i.TxResponse.encode(H.txResponse,a.uint32(18).fork()).ldelim(),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=W();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.tx=n.Tx.decode(P,P.uint32());break;case 2:v.txResponse=i.TxResponse.decode(P,P.uint32());break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=W();return(0,w.isSet)(H.tx)&&(a.tx=n.Tx.fromJSON(H.tx)),(0,w.isSet)(H.txResponse)&&(a.txResponse=i.TxResponse.fromJSON(H.txResponse)),a},toJSON(H){const a={};return H.tx!==void 0&&(a.tx=H.tx?n.Tx.toJSON(H.tx):void 0),H.txResponse!==void 0&&(a.txResponse=H.txResponse?i.TxResponse.toJSON(H.txResponse):void 0),a},fromPartial(H){const a=W();return H.tx!==void 0&&H.tx!==null&&(a.tx=n.Tx.fromPartial(H.tx)),H.txResponse!==void 0&&H.txResponse!==null&&(a.txResponse=i.TxResponse.fromPartial(H.txResponse)),a}};function r(){return{height:BigInt(0),pagination:void 0}}e.GetBlockWithTxsRequest={typeUrl:"/cosmos.tx.v1beta1.GetBlockWithTxsRequest",encode(H,a=C.BinaryWriter.create()){return H.height!==BigInt(0)&&a.uint32(8).int64(H.height),H.pagination!==void 0&&t.PageRequest.encode(H.pagination,a.uint32(18).fork()).ldelim(),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=r();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.height=P.int64();break;case 2:v.pagination=t.PageRequest.decode(P,P.uint32());break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=r();return(0,w.isSet)(H.height)&&(a.height=BigInt(H.height.toString())),(0,w.isSet)(H.pagination)&&(a.pagination=t.PageRequest.fromJSON(H.pagination)),a},toJSON(H){const a={};return H.height!==void 0&&(a.height=(H.height||BigInt(0)).toString()),H.pagination!==void 0&&(a.pagination=H.pagination?t.PageRequest.toJSON(H.pagination):void 0),a},fromPartial(H){const a=r();return H.height!==void 0&&H.height!==null&&(a.height=BigInt(H.height.toString())),H.pagination!==void 0&&H.pagination!==null&&(a.pagination=t.PageRequest.fromPartial(H.pagination)),a}};function s(){return{txs:[],blockId:void 0,block:void 0,pagination:void 0}}e.GetBlockWithTxsResponse={typeUrl:"/cosmos.tx.v1beta1.GetBlockWithTxsResponse",encode(H,a=C.BinaryWriter.create()){for(const P of H.txs)n.Tx.encode(P,a.uint32(10).fork()).ldelim();return H.blockId!==void 0&&o.BlockID.encode(H.blockId,a.uint32(18).fork()).ldelim(),H.block!==void 0&&g.Block.encode(H.block,a.uint32(26).fork()).ldelim(),H.pagination!==void 0&&t.PageResponse.encode(H.pagination,a.uint32(34).fork()).ldelim(),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=s();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.txs.push(n.Tx.decode(P,P.uint32()));break;case 2:v.blockId=o.BlockID.decode(P,P.uint32());break;case 3:v.block=g.Block.decode(P,P.uint32());break;case 4:v.pagination=t.PageResponse.decode(P,P.uint32());break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=s();return Array.isArray(H==null?void 0:H.txs)&&(a.txs=H.txs.map(P=>n.Tx.fromJSON(P))),(0,w.isSet)(H.blockId)&&(a.blockId=o.BlockID.fromJSON(H.blockId)),(0,w.isSet)(H.block)&&(a.block=g.Block.fromJSON(H.block)),(0,w.isSet)(H.pagination)&&(a.pagination=t.PageResponse.fromJSON(H.pagination)),a},toJSON(H){const a={};return H.txs?a.txs=H.txs.map(P=>P?n.Tx.toJSON(P):void 0):a.txs=[],H.blockId!==void 0&&(a.blockId=H.blockId?o.BlockID.toJSON(H.blockId):void 0),H.block!==void 0&&(a.block=H.block?g.Block.toJSON(H.block):void 0),H.pagination!==void 0&&(a.pagination=H.pagination?t.PageResponse.toJSON(H.pagination):void 0),a},fromPartial(H){var P;const a=s();return a.txs=((P=H.txs)==null?void 0:P.map(k=>n.Tx.fromPartial(k)))||[],H.blockId!==void 0&&H.blockId!==null&&(a.blockId=o.BlockID.fromPartial(H.blockId)),H.block!==void 0&&H.block!==null&&(a.block=g.Block.fromPartial(H.block)),H.pagination!==void 0&&H.pagination!==null&&(a.pagination=t.PageResponse.fromPartial(H.pagination)),a}};function O(){return{txBytes:new Uint8Array}}e.TxDecodeRequest={typeUrl:"/cosmos.tx.v1beta1.TxDecodeRequest",encode(H,a=C.BinaryWriter.create()){return H.txBytes.length!==0&&a.uint32(10).bytes(H.txBytes),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=O();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.txBytes=P.bytes();break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=O();return(0,w.isSet)(H.txBytes)&&(a.txBytes=(0,w.bytesFromBase64)(H.txBytes)),a},toJSON(H){const a={};return H.txBytes!==void 0&&(a.txBytes=(0,w.base64FromBytes)(H.txBytes!==void 0?H.txBytes:new Uint8Array)),a},fromPartial(H){const a=O();return a.txBytes=H.txBytes??new Uint8Array,a}};function q(){return{tx:void 0}}e.TxDecodeResponse={typeUrl:"/cosmos.tx.v1beta1.TxDecodeResponse",encode(H,a=C.BinaryWriter.create()){return H.tx!==void 0&&n.Tx.encode(H.tx,a.uint32(10).fork()).ldelim(),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=q();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.tx=n.Tx.decode(P,P.uint32());break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=q();return(0,w.isSet)(H.tx)&&(a.tx=n.Tx.fromJSON(H.tx)),a},toJSON(H){const a={};return H.tx!==void 0&&(a.tx=H.tx?n.Tx.toJSON(H.tx):void 0),a},fromPartial(H){const a=q();return H.tx!==void 0&&H.tx!==null&&(a.tx=n.Tx.fromPartial(H.tx)),a}};function d(){return{tx:void 0}}e.TxEncodeRequest={typeUrl:"/cosmos.tx.v1beta1.TxEncodeRequest",encode(H,a=C.BinaryWriter.create()){return H.tx!==void 0&&n.Tx.encode(H.tx,a.uint32(10).fork()).ldelim(),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=d();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.tx=n.Tx.decode(P,P.uint32());break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=d();return(0,w.isSet)(H.tx)&&(a.tx=n.Tx.fromJSON(H.tx)),a},toJSON(H){const a={};return H.tx!==void 0&&(a.tx=H.tx?n.Tx.toJSON(H.tx):void 0),a},fromPartial(H){const a=d();return H.tx!==void 0&&H.tx!==null&&(a.tx=n.Tx.fromPartial(H.tx)),a}};function l(){return{txBytes:new Uint8Array}}e.TxEncodeResponse={typeUrl:"/cosmos.tx.v1beta1.TxEncodeResponse",encode(H,a=C.BinaryWriter.create()){return H.txBytes.length!==0&&a.uint32(10).bytes(H.txBytes),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=l();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.txBytes=P.bytes();break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=l();return(0,w.isSet)(H.txBytes)&&(a.txBytes=(0,w.bytesFromBase64)(H.txBytes)),a},toJSON(H){const a={};return H.txBytes!==void 0&&(a.txBytes=(0,w.base64FromBytes)(H.txBytes!==void 0?H.txBytes:new Uint8Array)),a},fromPartial(H){const a=l();return a.txBytes=H.txBytes??new Uint8Array,a}};function M(){return{aminoJson:""}}e.TxEncodeAminoRequest={typeUrl:"/cosmos.tx.v1beta1.TxEncodeAminoRequest",encode(H,a=C.BinaryWriter.create()){return H.aminoJson!==""&&a.uint32(10).string(H.aminoJson),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=M();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.aminoJson=P.string();break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=M();return(0,w.isSet)(H.aminoJson)&&(a.aminoJson=String(H.aminoJson)),a},toJSON(H){const a={};return H.aminoJson!==void 0&&(a.aminoJson=H.aminoJson),a},fromPartial(H){const a=M();return a.aminoJson=H.aminoJson??"",a}};function m(){return{aminoBinary:new Uint8Array}}e.TxEncodeAminoResponse={typeUrl:"/cosmos.tx.v1beta1.TxEncodeAminoResponse",encode(H,a=C.BinaryWriter.create()){return H.aminoBinary.length!==0&&a.uint32(10).bytes(H.aminoBinary),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=m();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.aminoBinary=P.bytes();break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=m();return(0,w.isSet)(H.aminoBinary)&&(a.aminoBinary=(0,w.bytesFromBase64)(H.aminoBinary)),a},toJSON(H){const a={};return H.aminoBinary!==void 0&&(a.aminoBinary=(0,w.base64FromBytes)(H.aminoBinary!==void 0?H.aminoBinary:new Uint8Array)),a},fromPartial(H){const a=m();return a.aminoBinary=H.aminoBinary??new Uint8Array,a}};function h(){return{aminoBinary:new Uint8Array}}e.TxDecodeAminoRequest={typeUrl:"/cosmos.tx.v1beta1.TxDecodeAminoRequest",encode(H,a=C.BinaryWriter.create()){return H.aminoBinary.length!==0&&a.uint32(10).bytes(H.aminoBinary),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=h();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.aminoBinary=P.bytes();break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=h();return(0,w.isSet)(H.aminoBinary)&&(a.aminoBinary=(0,w.bytesFromBase64)(H.aminoBinary)),a},toJSON(H){const a={};return H.aminoBinary!==void 0&&(a.aminoBinary=(0,w.base64FromBytes)(H.aminoBinary!==void 0?H.aminoBinary:new Uint8Array)),a},fromPartial(H){const a=h();return a.aminoBinary=H.aminoBinary??new Uint8Array,a}};function T(){return{aminoJson:""}}e.TxDecodeAminoResponse={typeUrl:"/cosmos.tx.v1beta1.TxDecodeAminoResponse",encode(H,a=C.BinaryWriter.create()){return H.aminoJson!==""&&a.uint32(10).string(H.aminoJson),a},decode(H,a){const P=H instanceof C.BinaryReader?H:new C.BinaryReader(H);let k=a===void 0?P.len:P.pos+a;const v=T();for(;P.pos<k;){const A=P.uint32();switch(A>>>3){case 1:v.aminoJson=P.string();break;default:P.skipType(A&7);break}}return v},fromJSON(H){const a=T();return(0,w.isSet)(H.aminoJson)&&(a.aminoJson=String(H.aminoJson)),a},toJSON(H){const a={};return H.aminoJson!==void 0&&(a.aminoJson=H.aminoJson),a},fromPartial(H){const a=T();return a.aminoJson=H.aminoJson??"",a}};class Q{constructor(a){this.rpc=a,this.Simulate=this.Simulate.bind(this),this.GetTx=this.GetTx.bind(this),this.BroadcastTx=this.BroadcastTx.bind(this),this.GetTxsEvent=this.GetTxsEvent.bind(this),this.GetBlockWithTxs=this.GetBlockWithTxs.bind(this),this.TxDecode=this.TxDecode.bind(this),this.TxEncode=this.TxEncode.bind(this),this.TxEncodeAmino=this.TxEncodeAmino.bind(this),this.TxDecodeAmino=this.TxDecodeAmino.bind(this)}Simulate(a){const P=e.SimulateRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","Simulate",P).then(v=>e.SimulateResponse.decode(new C.BinaryReader(v)))}GetTx(a){const P=e.GetTxRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","GetTx",P).then(v=>e.GetTxResponse.decode(new C.BinaryReader(v)))}BroadcastTx(a){const P=e.BroadcastTxRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","BroadcastTx",P).then(v=>e.BroadcastTxResponse.decode(new C.BinaryReader(v)))}GetTxsEvent(a){const P=e.GetTxsEventRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","GetTxsEvent",P).then(v=>e.GetTxsEventResponse.decode(new C.BinaryReader(v)))}GetBlockWithTxs(a){const P=e.GetBlockWithTxsRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","GetBlockWithTxs",P).then(v=>e.GetBlockWithTxsResponse.decode(new C.BinaryReader(v)))}TxDecode(a){const P=e.TxDecodeRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","TxDecode",P).then(v=>e.TxDecodeResponse.decode(new C.BinaryReader(v)))}TxEncode(a){const P=e.TxEncodeRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","TxEncode",P).then(v=>e.TxEncodeResponse.decode(new C.BinaryReader(v)))}TxEncodeAmino(a){const P=e.TxEncodeAminoRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","TxEncodeAmino",P).then(v=>e.TxEncodeAminoResponse.decode(new C.BinaryReader(v)))}TxDecodeAmino(a){const P=e.TxDecodeAminoRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","TxDecodeAmino",P).then(v=>e.TxDecodeAminoResponse.decode(new C.BinaryReader(v)))}}e.ServiceClientImpl=Q})(Hc);Object.defineProperty(Ps,"__esModule",{value:!0});Ps.setupTxExtension=void 0;const OP=ut,AP=_.signing,$l=Hc,xi=_.tx,TP=ze;function NP(e){const n=(0,TP.createProtobufRpcClient)(e),t=new $l.ServiceClientImpl(n);return{tx:{getTx:async i=>{const o={hash:i};return await t.GetTx(o)},simulate:async(i,o,g,C)=>{const w=xi.Tx.fromPartial({authInfo:xi.AuthInfo.fromPartial({fee:xi.Fee.fromPartial({}),signerInfos:[{publicKey:(0,OP.encodePubkey)(g),sequence:BigInt(C),modeInfo:{single:{mode:AP.SignMode.SIGN_MODE_UNSPECIFIED}}}]}),body:xi.TxBody.fromPartial({messages:Array.from(i),memo:o}),signatures:[new Uint8Array]}),E=$l.SimulateRequest.fromPartial({txBytes:xi.Tx.encode(w).finish()});return await t.Simulate(E)}}}}Ps.setupTxExtension=NP;var ki={};Object.defineProperty(ki,"__esModule",{value:!0});ki.createVestingAminoConverters=ki.isAminoMsgCreateVestingAccount=void 0;function wP(e){return e.type==="cosmos-sdk/MsgCreateVestingAccount"}ki.isAminoMsgCreateVestingAccount=wP;function _P(){return{"/cosmos.vesting.v1beta1.MsgCreateVestingAccount":{aminoType:"cosmos-sdk/MsgCreateVestingAccount",toAmino:({fromAddress:e,toAddress:n,amount:t,endTime:i,delayed:o})=>({from_address:e,to_address:n,amount:[...t],end_time:i.toString(),delayed:o}),fromAmino:({from_address:e,to_address:n,amount:t,end_time:i,delayed:o})=>({fromAddress:e,toAddress:n,amount:[...t],endTime:BigInt(i),delayed:o})}}}ki.createVestingAminoConverters=_P;var vs={},qc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgCreatePeriodicVestingAccountResponse=e.MsgCreatePeriodicVestingAccount=e.MsgCreatePermanentLockedAccountResponse=e.MsgCreatePermanentLockedAccount=e.MsgCreateVestingAccountResponse=e.MsgCreateVestingAccount=e.protobufPackage=void 0;const n=_.coin,t=za,i=_.binary,o=_.helpers;e.protobufPackage="cosmos.vesting.v1beta1";function g(){return{fromAddress:"",toAddress:"",amount:[],endTime:BigInt(0),delayed:!1}}e.MsgCreateVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.MsgCreateVestingAccount",encode(p,S=i.BinaryWriter.create()){p.fromAddress!==""&&S.uint32(10).string(p.fromAddress),p.toAddress!==""&&S.uint32(18).string(p.toAddress);for(const R of p.amount)n.Coin.encode(R,S.uint32(26).fork()).ldelim();return p.endTime!==BigInt(0)&&S.uint32(32).int64(p.endTime),p.delayed===!0&&S.uint32(40).bool(p.delayed),S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=g();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.fromAddress=R.string();break;case 2:c.toAddress=R.string();break;case 3:c.amount.push(n.Coin.decode(R,R.uint32()));break;case 4:c.endTime=R.int64();break;case 5:c.delayed=R.bool();break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=g();return(0,o.isSet)(p.fromAddress)&&(S.fromAddress=String(p.fromAddress)),(0,o.isSet)(p.toAddress)&&(S.toAddress=String(p.toAddress)),Array.isArray(p==null?void 0:p.amount)&&(S.amount=p.amount.map(R=>n.Coin.fromJSON(R))),(0,o.isSet)(p.endTime)&&(S.endTime=BigInt(p.endTime.toString())),(0,o.isSet)(p.delayed)&&(S.delayed=!!p.delayed),S},toJSON(p){const S={};return p.fromAddress!==void 0&&(S.fromAddress=p.fromAddress),p.toAddress!==void 0&&(S.toAddress=p.toAddress),p.amount?S.amount=p.amount.map(R=>R?n.Coin.toJSON(R):void 0):S.amount=[],p.endTime!==void 0&&(S.endTime=(p.endTime||BigInt(0)).toString()),p.delayed!==void 0&&(S.delayed=p.delayed),S},fromPartial(p){var R;const S=g();return S.fromAddress=p.fromAddress??"",S.toAddress=p.toAddress??"",S.amount=((R=p.amount)==null?void 0:R.map(u=>n.Coin.fromPartial(u)))||[],p.endTime!==void 0&&p.endTime!==null&&(S.endTime=BigInt(p.endTime.toString())),S.delayed=p.delayed??!1,S}};function C(){return{}}e.MsgCreateVestingAccountResponse={typeUrl:"/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse",encode(p,S=i.BinaryWriter.create()){return S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=C();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){default:R.skipType(y&7);break}}return c},fromJSON(p){return C()},toJSON(p){return{}},fromPartial(p){return C()}};function w(){return{fromAddress:"",toAddress:"",amount:[]}}e.MsgCreatePermanentLockedAccount={typeUrl:"/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount",encode(p,S=i.BinaryWriter.create()){p.fromAddress!==""&&S.uint32(10).string(p.fromAddress),p.toAddress!==""&&S.uint32(18).string(p.toAddress);for(const R of p.amount)n.Coin.encode(R,S.uint32(26).fork()).ldelim();return S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=w();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.fromAddress=R.string();break;case 2:c.toAddress=R.string();break;case 3:c.amount.push(n.Coin.decode(R,R.uint32()));break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=w();return(0,o.isSet)(p.fromAddress)&&(S.fromAddress=String(p.fromAddress)),(0,o.isSet)(p.toAddress)&&(S.toAddress=String(p.toAddress)),Array.isArray(p==null?void 0:p.amount)&&(S.amount=p.amount.map(R=>n.Coin.fromJSON(R))),S},toJSON(p){const S={};return p.fromAddress!==void 0&&(S.fromAddress=p.fromAddress),p.toAddress!==void 0&&(S.toAddress=p.toAddress),p.amount?S.amount=p.amount.map(R=>R?n.Coin.toJSON(R):void 0):S.amount=[],S},fromPartial(p){var R;const S=w();return S.fromAddress=p.fromAddress??"",S.toAddress=p.toAddress??"",S.amount=((R=p.amount)==null?void 0:R.map(u=>n.Coin.fromPartial(u)))||[],S}};function E(){return{}}e.MsgCreatePermanentLockedAccountResponse={typeUrl:"/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse",encode(p,S=i.BinaryWriter.create()){return S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=E();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){default:R.skipType(y&7);break}}return c},fromJSON(p){return E()},toJSON(p){return{}},fromPartial(p){return E()}};function D(){return{fromAddress:"",toAddress:"",startTime:BigInt(0),vestingPeriods:[]}}e.MsgCreatePeriodicVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount",encode(p,S=i.BinaryWriter.create()){p.fromAddress!==""&&S.uint32(10).string(p.fromAddress),p.toAddress!==""&&S.uint32(18).string(p.toAddress),p.startTime!==BigInt(0)&&S.uint32(24).int64(p.startTime);for(const R of p.vestingPeriods)t.Period.encode(R,S.uint32(34).fork()).ldelim();return S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=D();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){case 1:c.fromAddress=R.string();break;case 2:c.toAddress=R.string();break;case 3:c.startTime=R.int64();break;case 4:c.vestingPeriods.push(t.Period.decode(R,R.uint32()));break;default:R.skipType(y&7);break}}return c},fromJSON(p){const S=D();return(0,o.isSet)(p.fromAddress)&&(S.fromAddress=String(p.fromAddress)),(0,o.isSet)(p.toAddress)&&(S.toAddress=String(p.toAddress)),(0,o.isSet)(p.startTime)&&(S.startTime=BigInt(p.startTime.toString())),Array.isArray(p==null?void 0:p.vestingPeriods)&&(S.vestingPeriods=p.vestingPeriods.map(R=>t.Period.fromJSON(R))),S},toJSON(p){const S={};return p.fromAddress!==void 0&&(S.fromAddress=p.fromAddress),p.toAddress!==void 0&&(S.toAddress=p.toAddress),p.startTime!==void 0&&(S.startTime=(p.startTime||BigInt(0)).toString()),p.vestingPeriods?S.vestingPeriods=p.vestingPeriods.map(R=>R?t.Period.toJSON(R):void 0):S.vestingPeriods=[],S},fromPartial(p){var R;const S=D();return S.fromAddress=p.fromAddress??"",S.toAddress=p.toAddress??"",p.startTime!==void 0&&p.startTime!==null&&(S.startTime=BigInt(p.startTime.toString())),S.vestingPeriods=((R=p.vestingPeriods)==null?void 0:R.map(u=>t.Period.fromPartial(u)))||[],S}};function J(){return{}}e.MsgCreatePeriodicVestingAccountResponse={typeUrl:"/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse",encode(p,S=i.BinaryWriter.create()){return S},decode(p,S){const R=p instanceof i.BinaryReader?p:new i.BinaryReader(p);let u=S===void 0?R.len:R.pos+S;const c=J();for(;R.pos<u;){const y=R.uint32();switch(y>>>3){default:R.skipType(y&7);break}}return c},fromJSON(p){return J()},toJSON(p){return{}},fromPartial(p){return J()}};class b{constructor(S){this.rpc=S,this.CreateVestingAccount=this.CreateVestingAccount.bind(this),this.CreatePermanentLockedAccount=this.CreatePermanentLockedAccount.bind(this),this.CreatePeriodicVestingAccount=this.CreatePeriodicVestingAccount.bind(this)}CreateVestingAccount(S){const R=e.MsgCreateVestingAccount.encode(S).finish();return this.rpc.request("cosmos.vesting.v1beta1.Msg","CreateVestingAccount",R).then(c=>e.MsgCreateVestingAccountResponse.decode(new i.BinaryReader(c)))}CreatePermanentLockedAccount(S){const R=e.MsgCreatePermanentLockedAccount.encode(S).finish();return this.rpc.request("cosmos.vesting.v1beta1.Msg","CreatePermanentLockedAccount",R).then(c=>e.MsgCreatePermanentLockedAccountResponse.decode(new i.BinaryReader(c)))}CreatePeriodicVestingAccount(S){const R=e.MsgCreatePeriodicVestingAccount.encode(S).finish();return this.rpc.request("cosmos.vesting.v1beta1.Msg","CreatePeriodicVestingAccount",R).then(c=>e.MsgCreatePeriodicVestingAccountResponse.decode(new i.BinaryReader(c)))}}e.MsgClientImpl=b})(qc);Object.defineProperty(vs,"__esModule",{value:!0});vs.vestingTypes=void 0;const MP=qc;vs.vestingTypes=[["/cosmos.vesting.v1beta1.MsgCreateVestingAccount",MP.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 n=Za;Object.defineProperty(e,"setupAuthExtension",{enumerable:!0,get:function(){return n.setupAuthExtension}});var t=is;Object.defineProperty(e,"createAuthzAminoConverters",{enumerable:!0,get:function(){return t.createAuthzAminoConverters}});var i=os;Object.defineProperty(e,"authzTypes",{enumerable:!0,get:function(){return i.authzTypes}});var o=as;Object.defineProperty(e,"setupAuthzExtension",{enumerable:!0,get:function(){return o.setupAuthzExtension}});var g=Tt;Object.defineProperty(e,"createBankAminoConverters",{enumerable:!0,get:function(){return g.createBankAminoConverters}}),Object.defineProperty(e,"isAminoMsgMultiSend",{enumerable:!0,get:function(){return g.isAminoMsgMultiSend}}),Object.defineProperty(e,"isAminoMsgSend",{enumerable:!0,get:function(){return g.isAminoMsgSend}});var C=li;Object.defineProperty(e,"bankTypes",{enumerable:!0,get:function(){return C.bankTypes}}),Object.defineProperty(e,"isMsgSendEncodeObject",{enumerable:!0,get:function(){return C.isMsgSendEncodeObject}});var w=ss;Object.defineProperty(e,"setupBankExtension",{enumerable:!0,get:function(){return w.setupBankExtension}});var E=fi;Object.defineProperty(e,"createCrysisAminoConverters",{enumerable:!0,get:function(){return E.createCrysisAminoConverters}}),Object.defineProperty(e,"isAminoMsgVerifyInvariant",{enumerable:!0,get:function(){return E.isAminoMsgVerifyInvariant}});var D=Bn;Object.defineProperty(e,"createDistributionAminoConverters",{enumerable:!0,get:function(){return D.createDistributionAminoConverters}}),Object.defineProperty(e,"isAminoMsgFundCommunityPool",{enumerable:!0,get:function(){return D.isAminoMsgFundCommunityPool}}),Object.defineProperty(e,"isAminoMsgSetWithdrawAddress",{enumerable:!0,get:function(){return D.isAminoMsgSetWithdrawAddress}}),Object.defineProperty(e,"isAminoMsgWithdrawDelegatorReward",{enumerable:!0,get:function(){return D.isAminoMsgWithdrawDelegatorReward}}),Object.defineProperty(e,"isAminoMsgWithdrawValidatorCommission",{enumerable:!0,get:function(){return D.isAminoMsgWithdrawValidatorCommission}});var J=pi;Object.defineProperty(e,"distributionTypes",{enumerable:!0,get:function(){return J.distributionTypes}}),Object.defineProperty(e,"isMsgWithdrawDelegatorRewardEncodeObject",{enumerable:!0,get:function(){return J.isMsgWithdrawDelegatorRewardEncodeObject}});var b=ds;Object.defineProperty(e,"setupDistributionExtension",{enumerable:!0,get:function(){return b.setupDistributionExtension}});var p=mi;Object.defineProperty(e,"createEvidenceAminoConverters",{enumerable:!0,get:function(){return p.createEvidenceAminoConverters}}),Object.defineProperty(e,"isAminoMsgSubmitEvidence",{enumerable:!0,get:function(){return p.isAminoMsgSubmitEvidence}});var S=us;Object.defineProperty(e,"createFeegrantAminoConverters",{enumerable:!0,get:function(){return S.createFeegrantAminoConverters}});var R=cs;Object.defineProperty(e,"feegrantTypes",{enumerable:!0,get:function(){return R.feegrantTypes}});var u=ls;Object.defineProperty(e,"setupFeegrantExtension",{enumerable:!0,get:function(){return u.setupFeegrantExtension}});var c=bn;Object.defineProperty(e,"createGovAminoConverters",{enumerable:!0,get:function(){return c.createGovAminoConverters}}),Object.defineProperty(e,"isAminoMsgDeposit",{enumerable:!0,get:function(){return c.isAminoMsgDeposit}}),Object.defineProperty(e,"isAminoMsgSubmitProposal",{enumerable:!0,get:function(){return c.isAminoMsgSubmitProposal}}),Object.defineProperty(e,"isAminoMsgVote",{enumerable:!0,get:function(){return c.isAminoMsgVote}}),Object.defineProperty(e,"isAminoMsgVoteWeighted",{enumerable:!0,get:function(){return c.isAminoMsgVoteWeighted}});var y=En;Object.defineProperty(e,"govTypes",{enumerable:!0,get:function(){return y.govTypes}}),Object.defineProperty(e,"isMsgDepositEncodeObject",{enumerable:!0,get:function(){return y.isMsgDepositEncodeObject}}),Object.defineProperty(e,"isMsgSubmitProposalEncodeObject",{enumerable:!0,get:function(){return y.isMsgSubmitProposalEncodeObject}}),Object.defineProperty(e,"isMsgVoteEncodeObject",{enumerable:!0,get:function(){return y.isMsgVoteEncodeObject}}),Object.defineProperty(e,"isMsgVoteWeightedEncodeObject",{enumerable:!0,get:function(){return y.isMsgVoteWeightedEncodeObject}});var B=fs;Object.defineProperty(e,"setupGovExtension",{enumerable:!0,get:function(){return B.setupGovExtension}});var N=ps;Object.defineProperty(e,"createGroupAminoConverters",{enumerable:!0,get:function(){return N.createGroupAminoConverters}});var U=ms;Object.defineProperty(e,"groupTypes",{enumerable:!0,get:function(){return U.groupTypes}});var W=hi;Object.defineProperty(e,"createIbcAminoConverters",{enumerable:!0,get:function(){return W.createIbcAminoConverters}}),Object.defineProperty(e,"isAminoMsgTransfer",{enumerable:!0,get:function(){return W.isAminoMsgTransfer}});var r=gi;Object.defineProperty(e,"ibcTypes",{enumerable:!0,get:function(){return r.ibcTypes}}),Object.defineProperty(e,"isMsgTransferEncodeObject",{enumerable:!0,get:function(){return r.isMsgTransferEncodeObject}});var s=hs;Object.defineProperty(e,"setupIbcExtension",{enumerable:!0,get:function(){return s.setupIbcExtension}});var O=ys;Object.defineProperty(e,"setupMintExtension",{enumerable:!0,get:function(){return O.setupMintExtension}});var q=yi;Object.defineProperty(e,"createSlashingAminoConverters",{enumerable:!0,get:function(){return q.createSlashingAminoConverters}}),Object.defineProperty(e,"isAminoMsgUnjail",{enumerable:!0,get:function(){return q.isAminoMsgUnjail}});var d=Ss;Object.defineProperty(e,"setupSlashingExtension",{enumerable:!0,get:function(){return d.setupSlashingExtension}});var l=Me;Object.defineProperty(e,"createStakingAminoConverters",{enumerable:!0,get:function(){return l.createStakingAminoConverters}}),Object.defineProperty(e,"isAminoMsgBeginRedelegate",{enumerable:!0,get:function(){return l.isAminoMsgBeginRedelegate}}),Object.defineProperty(e,"isAminoMsgCreateValidator",{enumerable:!0,get:function(){return l.isAminoMsgCreateValidator}}),Object.defineProperty(e,"isAminoMsgDelegate",{enumerable:!0,get:function(){return l.isAminoMsgDelegate}}),Object.defineProperty(e,"isAminoMsgEditValidator",{enumerable:!0,get:function(){return l.isAminoMsgEditValidator}}),Object.defineProperty(e,"isAminoMsgUndelegate",{enumerable:!0,get:function(){return l.isAminoMsgUndelegate}});var M=Ge;Object.defineProperty(e,"isMsgBeginRedelegateEncodeObject",{enumerable:!0,get:function(){return M.isMsgBeginRedelegateEncodeObject}}),Object.defineProperty(e,"isMsgCancelUnbondingDelegationEncodeObject",{enumerable:!0,get:function(){return M.isMsgCancelUnbondingDelegationEncodeObject}}),Object.defineProperty(e,"isMsgCreateValidatorEncodeObject",{enumerable:!0,get:function(){return M.isMsgCreateValidatorEncodeObject}}),Object.defineProperty(e,"isMsgDelegateEncodeObject",{enumerable:!0,get:function(){return M.isMsgDelegateEncodeObject}}),Object.defineProperty(e,"isMsgEditValidatorEncodeObject",{enumerable:!0,get:function(){return M.isMsgEditValidatorEncodeObject}}),Object.defineProperty(e,"isMsgUndelegateEncodeObject",{enumerable:!0,get:function(){return M.isMsgUndelegateEncodeObject}}),Object.defineProperty(e,"stakingTypes",{enumerable:!0,get:function(){return M.stakingTypes}});var m=ks;Object.defineProperty(e,"setupStakingExtension",{enumerable:!0,get:function(){return m.setupStakingExtension}});var h=Ps;Object.defineProperty(e,"setupTxExtension",{enumerable:!0,get:function(){return h.setupTxExtension}});var T=ki;Object.defineProperty(e,"createVestingAminoConverters",{enumerable:!0,get:function(){return T.createVestingAminoConverters}}),Object.defineProperty(e,"isAminoMsgCreateVestingAccount",{enumerable:!0,get:function(){return T.isAminoMsgCreateVestingAccount}});var Q=vs;Object.defineProperty(e,"vestingTypes",{enumerable:!0,get:function(){return Q.vestingTypes}})})(co);var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.makeMultisignedTxBytes=Ut.makeMultisignedTx=Ut.makeCompactBitArray=void 0;const UP=zn,DP=ue,JP=ut,Mu=_.multisig,HP=_.signing,Kl=_.tx,Rm=_.tx;function Bm(e){const n=Math.ceil(e.length/8),t=e.length-Math.floor(e.length/8)*8,i=new Uint8Array(n);return e.forEach((o,g)=>{const C=Math.floor(g/8),w=g%8;o&&(i[C]|=1<<7-w)}),Mu.CompactBitArray.fromPartial({elems:i,extraBitsStored:t})}Ut.makeCompactBitArray=Bm;function bm(e,n,t,i,o){const g=Array.from(o.keys()),C=(0,DP.fromBech32)(g[0]).prefix,w=Array(e.value.pubkeys.length).fill(!1),E=new Array;for(let S=0;S<e.value.pubkeys.length;S++){const R=(0,UP.pubkeyToAddress)(e.value.pubkeys[S],C),u=o.get(R);u&&(w[S]=!0,E.push(u))}const D={publicKey:(0,JP.encodePubkey)(e),modeInfo:{multi:{bitarray:Bm(w),modeInfos:E.map(S=>({single:{mode:HP.SignMode.SIGN_MODE_LEGACY_AMINO_JSON}}))}},sequence:BigInt(n)},J=Kl.AuthInfo.fromPartial({signerInfos:[D],fee:{amount:[...t.amount],gasLimit:BigInt(t.gas)}}),b=Kl.AuthInfo.encode(J).finish();return Rm.TxRaw.fromPartial({bodyBytes:i,authInfoBytes:b,signatures:[Mu.MultiSignature.encode(Mu.MultiSignature.fromPartial({signatures:E})).finish()]})}Ut.makeMultisignedTx=bm;function qP(e,n,t,i,o){const g=bm(e,n,t,i,o);return Uint8Array.from(Rm.TxRaw.encode(g).finish())}Ut.makeMultisignedTxBytes=qP;var No={};Object.defineProperty(No,"__esModule",{value:!0});No.isSearchTxQueryArray=void 0;function VP(e){return Array.isArray(e)}No.isSearchTxQueryArray=VP;var Em={},wo={},ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.pubkeyToAddress=ot.pubkeyToRawAddress=ot.rawSecp256k1PubkeyToRawAddress=ot.rawEd25519PubkeyToRawAddress=void 0;const Uu=$e,WP=ue;function Im(e){if(e.length!==32)throw new Error(`Invalid Ed25519 pubkey length: ${e.length}`);return(0,Uu.sha256)(e).slice(0,20)}ot.rawEd25519PubkeyToRawAddress=Im;function Om(e){if(e.length!==33)throw new Error(`Invalid Secp256k1 pubkey length (compressed): ${e.length}`);return(0,Uu.ripemd160)((0,Uu.sha256)(e))}ot.rawSecp256k1PubkeyToRawAddress=Om;function Am(e,n){switch(e){case"ed25519":return Im(n);case"secp256k1":return Om(n);default:throw new Error(`Pubkey type ${e} not supported`)}}ot.pubkeyToRawAddress=Am;function QP(e,n){return(0,WP.toHex)(Am(e,n)).toUpperCase()}ot.pubkeyToAddress=QP;var xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.DateTime=xe.toSeconds=xe.fromSeconds=xe.toRfc3339WithNanoseconds=xe.fromRfc3339WithNanoseconds=void 0;const FP=ue,GP=Ne;function Tm(e){const n=(0,FP.fromRfc3339)(e),t=e.match(/\.(\d+)Z$/),i=t?t[1].slice(3):"";return n.nanoseconds=parseInt(i.padEnd(6,"0"),10),n}xe.fromRfc3339WithNanoseconds=Tm;function Nm(e){var i;const n=e.toISOString(),t=((i=e.nanoseconds)==null?void 0:i.toString())??"";return`${n.slice(0,-1)}${t.padStart(6,"0")}Z`}xe.toRfc3339WithNanoseconds=Nm;function LP(e,n=0){const t=new GP.Uint32(n).toNumber();if(t>999999999)throw new Error("Nano seconds must not exceed 999999999");const i=new Date(e*1e3+Math.floor(t/1e6));return i.nanoseconds=t%1e6,i}xe.fromSeconds=LP;function $P(e){return{seconds:Math.floor(e.getTime()/1e3),nanos:e.getTime()%1e3*1e6+(e.nanoseconds??0)}}xe.toSeconds=$P;class KP{static decode(n){return Tm(n)}static encode(n){return Nm(n)}}xe.DateTime=KP;var Ca={},Cs={},Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.createJsonRpcRequest=void 0;const xl="123456789";function xP(){return xl[Math.floor(Math.random()*xl.length)]}function zP(){return parseInt(Array.from({length:12}).map(()=>xP()).join(""),10)}function YP(e,n){const t=n?{...n}:{};return{jsonrpc:"2.0",id:zP(),method:e,params:t}}Pt.createJsonRpcRequest=YP;var _o={},Rs={},Bs={},bs={};Object.defineProperty(bs,"__esModule",{value:!0});bs.makeJsonRpcId=void 0;let ZP=1e4;function XP(){return ZP+=1}bs.makeJsonRpcId=XP;var Es={},yt={};Object.defineProperty(yt,"__esModule",{value:!0});yt.jsonRpcCode=yt.isJsonRpcSuccessResponse=yt.isJsonRpcErrorResponse=void 0;function wm(e){return typeof e.error=="object"}yt.isJsonRpcErrorResponse=wm;function jP(e){return!wm(e)}yt.isJsonRpcSuccessResponse=jP;yt.jsonRpcCode={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:{default:-32e3}};Object.defineProperty(Es,"__esModule",{value:!0});Es.JsonRpcClient=void 0;const ev=Bo,nv=yt;class tv{constructor(n){this.connection=n}async run(n){const t=this.connection.responseStream.filter(g=>g.id===n.id),i=(0,ev.firstEvent)(t);this.connection.sendRequest(n);const o=await i;if((0,nv.isJsonRpcErrorResponse)(o)){const g=o.error;throw new Error(`JSON RPC error: code=${g.code}; message='${g.message}'`)}return o}}Es.JsonRpcClient=tv;var In={},Dt={};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.isJsonCompatibleDictionary=Dt.isJsonCompatibleArray=Dt.isJsonCompatibleValue=void 0;function Vc(e){return!!(typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null||_m(e)||Mm(e))}Dt.isJsonCompatibleValue=Vc;function _m(e){if(!Array.isArray(e))return!1;for(const n of e)if(!Vc(n))return!1;return!0}Dt.isJsonCompatibleArray=_m;function Mm(e){return typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]"?!1:Object.values(e).every(Vc)}Dt.isJsonCompatibleDictionary=Mm;Object.defineProperty(In,"__esModule",{value:!0});In.parseJsonRpcResponse=In.parseJsonRpcSuccessResponse=In.parseJsonRpcErrorResponse=In.parseJsonRpcRequest=In.parseJsonRpcId=void 0;const Jt=Dt;function Um(e){if(!(0,Jt.isJsonCompatibleDictionary)(e))throw new Error("Data must be JSON compatible dictionary");const n=e.id;return typeof n!="number"&&typeof n!="string"?null:n}In.parseJsonRpcId=Um;function rv(e){if(!(0,Jt.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 n=Um(e);if(n===null)throw new Error("Invalid id field");const t=e.method;if(typeof t!="string")throw new Error("Invalid method field");if(!(0,Jt.isJsonCompatibleArray)(e.params)&&!(0,Jt.isJsonCompatibleDictionary)(e.params))throw new Error("Invalid params field");return{jsonrpc:"2.0",id:n,method:t,params:e.params}}In.parseJsonRpcRequest=rv;function iv(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 n;if(e.data===void 0)n=void 0;else if((0,Jt.isJsonCompatibleValue)(e.data))n=e.data;else throw new Error("Error property 'data' is defined but not a JSON compatible value.");return{code:e.code,message:e.message,...n!==void 0?{data:n}:{}}}function Dm(e){if(!(0,Jt.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 n=e.id;if(typeof n!="number"&&typeof n!="string"&&n!==null)throw new Error("Invalid id field");if(typeof e.error>"u"||!(0,Jt.isJsonCompatibleDictionary)(e.error))throw new Error("Invalid error field");return{jsonrpc:"2.0",id:n,error:iv(e.error)}}In.parseJsonRpcErrorResponse=Dm;function Jm(e){if(!(0,Jt.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 n=e.id;if(typeof n!="number"&&typeof n!="string")throw new Error("Invalid id field");if(typeof e.result>"u")throw new Error("Invalid result field");const t=e.result;return{jsonrpc:"2.0",id:n,result:t}}In.parseJsonRpcSuccessResponse=Jm;function ov(e){let n;try{n=Dm(e)}catch{n=Jm(e)}return n}In.parseJsonRpcResponse=ov;(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 n=bs;Object.defineProperty(e,"makeJsonRpcId",{enumerable:!0,get:function(){return n.makeJsonRpcId}});var t=Es;Object.defineProperty(e,"JsonRpcClient",{enumerable:!0,get:function(){return t.JsonRpcClient}});var i=In;Object.defineProperty(e,"parseJsonRpcErrorResponse",{enumerable:!0,get:function(){return i.parseJsonRpcErrorResponse}}),Object.defineProperty(e,"parseJsonRpcId",{enumerable:!0,get:function(){return i.parseJsonRpcId}}),Object.defineProperty(e,"parseJsonRpcRequest",{enumerable:!0,get:function(){return i.parseJsonRpcRequest}}),Object.defineProperty(e,"parseJsonRpcResponse",{enumerable:!0,get:function(){return i.parseJsonRpcResponse}}),Object.defineProperty(e,"parseJsonRpcSuccessResponse",{enumerable:!0,get:function(){return i.parseJsonRpcSuccessResponse}});var o=yt;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}})})(Bs);var Mo={};const Hm=L.getAugmentedNamespace(mg);var av=L.commonjsGlobal&&L.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.http=void 0;const sv=av(Hm);function dv(e){if(e.status>=400)throw new Error(`Bad status on response: ${e.status}`);return e}function uv(e){return e.toString().includes("emitExperimentalWarning")}async function cv(e,n,t,i){if(typeof fetch=="function"&&!uv(fetch)){const o={method:e,body:i?JSON.stringify(i):void 0,headers:{"Content-Type":"application/json",...t}};return fetch(n,o).then(dv).then(g=>g.json())}else return sv.default.request({url:n,method:e,data:i,headers:t}).then(o=>o.data)}Mo.http=cv;var St={};Object.defineProperty(St,"__esModule",{value:!0});St.hasProtocol=St.instanceOfRpcStreamingClient=void 0;function lv(e){return typeof e.listen=="function"}St.instanceOfRpcStreamingClient=lv;function fv(e){return e.search("://")!==-1}St.hasProtocol=fv;Object.defineProperty(Rs,"__esModule",{value:!0});Rs.HttpBatchClient=void 0;const zl=Bs,pv=Mo,mv=St,Yl={dispatchInterval:20,batchSizeLimit:20};class hv{constructor(n,t={}){if(this.queue=[],this.options={batchSizeLimit:t.batchSizeLimit??Yl.batchSizeLimit,dispatchInterval:t.dispatchInterval??Yl.dispatchInterval},typeof n=="string"){if(!(0,mv.hasProtocol)(n))throw new Error("Endpoint URL is missing a protocol. Expected 'https://' or 'http://'.");this.url=n}else this.url=n.url,this.headers=n.headers;this.timer=setInterval(()=>this.tick(),t.dispatchInterval),this.validate()}disconnect(){this.timer&&clearInterval(this.timer),this.timer=void 0}async execute(n){return new Promise((t,i)=>{this.queue.push({request:n,resolve:t,reject:i}),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 n=this.queue.splice(0,this.options.batchSizeLimit);if(!n.length)return;const t=n.map(o=>o.request),i=t.map(o=>o.id);(0,pv.http)("POST",this.url,this.headers,t).then(o=>{(Array.isArray(o)?o:[o]).forEach(C=>{const w=n.find(b=>b.request.id===C.id);if(!w)return;const{reject:E,resolve:D}=w,J=(0,zl.parseJsonRpcResponse)(C);(0,zl.isJsonRpcErrorResponse)(J)?E(new Error(JSON.stringify(J.error))):D(J)})},o=>{for(const g of i){const C=n.find(w=>w.request.id===g);if(!C)return;C.reject(o)}})}}Rs.HttpBatchClient=hv;var Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.HttpClient=void 0;const Zl=Bs,gv=Mo,yv=St;let Sv=class{constructor(n){if(typeof n=="string"){if(!(0,yv.hasProtocol)(n))throw new Error("Endpoint URL is missing a protocol. Expected 'https://' or 'http://'.");this.url=n}else this.url=n.url,this.headers=n.headers}disconnect(){}async execute(n){const t=(0,Zl.parseJsonRpcResponse)(await(0,gv.http)("POST",this.url,this.headers,n));if((0,Zl.isJsonRpcErrorResponse)(t))throw new Error(JSON.stringify(t.error));return t}};Is.HttpClient=Sv;var Os={},qm={},Wc={},Uo={},Do={},kv=L.commonjsGlobal&&L.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Do,"__esModule",{value:!0});Do.SocketWrapper=void 0;const br=kv(Re.browser);function Pv(){return typeof L.dist.process<"u"&&typeof L.dist.process.versions<"u"&&typeof L.dist.process.versions.node<"u"}class vv{constructor(n,t,i,o,g,C=1e4){this.closed=!1,this.connected=new Promise((w,E)=>{this.connectedResolver=w,this.connectedRejecter=E}),this.url=n,this.messageHandler=t,this.errorHandler=i,this.openHandler=o,this.closeHandler=g,this.timeout=C}connect(){const n=new br.default(this.url);n.onerror=i=>{this.clearTimeout(),this.errorHandler&&this.errorHandler(i)},n.onmessage=i=>{this.messageHandler({type:i.type,data:i.data})},n.onopen=i=>{this.clearTimeout(),this.connectedResolver(),this.openHandler&&this.openHandler()},n.onclose=i=>{this.closed=!0,this.closeHandler&&this.closeHandler(i)};const t=Date.now();this.timeoutId=setTimeout(()=>{n.onmessage=()=>0,n.onerror=()=>0,n.onopen=()=>0,n.onclose=()=>0,n.close(),this.socket=void 0;const i=Math.floor(Date.now()-t);this.connectedRejecter(`Connection attempt timed out after ${i} ms`)},this.timeout),this.socket=n}disconnect(){if(!this.socket)throw new Error("Socket undefined. This must be called after connecting.");switch(this.clearTimeout(),this.socket.readyState){case br.default.OPEN:this.socket.close(1e3);break;case br.default.CLOSED:break;case br.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 br.default.CLOSING:break;default:throw new Error(`Unknown readyState: ${this.socket.readyState}`)}}async send(n){return new Promise((t,i)=>{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!==br.default.OPEN)throw new Error("Websocket is not open");Pv()?this.socket.send(n,o=>o?i(o):t()):(this.socket.send(n),t())})}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)}}Do.SocketWrapper=vv;Object.defineProperty(Uo,"__esModule",{value:!0});Uo.StreamingSocket=void 0;const Cv=Re.xstream,Rv=Do;class Bv{constructor(n,t=1e4){this.socket=new Rv.SocketWrapper(n,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"))},t),this.connected=this.socket.connected;const i={start:o=>this.eventProducerListener=o,stop:()=>this.eventProducerListener=void 0};this.events=Cv.Stream.create(i)}connect(){this.socket.connect()}disconnect(){this.socket.disconnect()}async send(n){return this.socket.send(n)}}Uo.StreamingSocket=Bv;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueueingStreamingSocket=e.ConnectionStatus=void 0;const n=Bo,t=Re.xstream,i=Uo;var o;(function(C){C[C.Unconnected=0]="Unconnected",C[C.Connecting=1]="Connecting",C[C.Connected=2]="Connected",C[C.Disconnected=3]="Disconnected"})(o=e.ConnectionStatus||(e.ConnectionStatus={}));class g{constructor(w,E=1e4,D){this.queue=[],this.isProcessingQueue=!1,this.url=w,this.timeout=E,this.reconnectedHandler=D;const J={start:b=>this.eventProducerListener=b,stop:()=>this.eventProducerListener=void 0};this.events=t.Stream.create(J),this.connectionStatusProducer=new n.DefaultValueProducer(o.Unconnected),this.connectionStatus=new n.ValueAndUpdates(this.connectionStatusProducer),this.socket=new i.StreamingSocket(this.url,this.timeout),this.socket.events.subscribe({next:b=>{if(!this.eventProducerListener)throw new Error("No event producer listener set");this.eventProducerListener.next(b)},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 i.StreamingSocket(this.url,this.timeout),this.socket.events.subscribe({next:w=>{if(!this.eventProducerListener)throw new Error("No event producer listener set");this.eventProducerListener.next(w)},error:()=>this.connectionStatusProducer.update(o.Disconnected)}),this.socket.connected.then(()=>{this.reconnectedHandler&&this.reconnectedHandler()}),this.connect()}getQueueLength(){return this.queue.length}queueRequest(w){this.queue.push(w),this.processQueue()}async processQueue(){if(this.isProcessingQueue||this.connectionStatus.value!==o.Connected)return;this.isProcessingQueue=!0;let w;for(;w=this.queue.shift();)try{await this.socket.send(w),this.isProcessingQueue=!1}catch{this.queue.unshift(w),this.isProcessingQueue=!1;return}}}e.QueueingStreamingSocket=g})(Wc);var As={};Object.defineProperty(As,"__esModule",{value:!0});As.ReconnectingSocket=void 0;const bv=Re.xstream,cu=Wc;class Qc{static calculateTimeout(n){return Math.min(2**n*100,5e3)}constructor(n,t=1e4,i){this.unconnected=!0,this.disconnected=!1,this.timeoutIndex=0,this.reconnectTimeout=null;const o={start:g=>this.eventProducerListener=g,stop:()=>this.eventProducerListener=void 0};this.events=bv.Stream.create(o),this.socket=new cu.QueueingStreamingSocket(n,t,i),this.socket.events.subscribe({next:g=>{this.eventProducerListener&&this.eventProducerListener.next(g)},error:g=>{this.eventProducerListener&&this.eventProducerListener.error(g)}}),this.connectionStatus=this.socket.connectionStatus,this.connectionStatus.updates.subscribe({next:g=>{g===cu.ConnectionStatus.Connected&&(this.timeoutIndex=0),g===cu.ConnectionStatus.Disconnected&&(this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.reconnectTimeout=setTimeout(()=>this.socket.reconnect(),Qc.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(n){if(this.disconnected)throw new Error("Cannot queue request: socket has disconnected");this.socket.queueRequest(n)}}As.ReconnectingSocket=Qc;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamingSocket=e.SocketWrapper=e.ReconnectingSocket=e.QueueingStreamingSocket=e.ConnectionStatus=void 0;var n=Wc;Object.defineProperty(e,"ConnectionStatus",{enumerable:!0,get:function(){return n.ConnectionStatus}}),Object.defineProperty(e,"QueueingStreamingSocket",{enumerable:!0,get:function(){return n.QueueingStreamingSocket}});var t=As;Object.defineProperty(e,"ReconnectingSocket",{enumerable:!0,get:function(){return t.ReconnectingSocket}});var i=Do;Object.defineProperty(e,"SocketWrapper",{enumerable:!0,get:function(){return i.SocketWrapper}});var o=Uo;Object.defineProperty(e,"StreamingSocket",{enumerable:!0,get:function(){return o.StreamingSocket}})})(qm);Object.defineProperty(Os,"__esModule",{value:!0});Os.WebsocketClient=void 0;const Ra=Bs,Xl=qm,Ev=Bo,Iv=Re.xstream,Ov=St;function Av(e){throw e}function Vm(e){if(e.type!=="message")throw new Error(`Unexcepted message type on websocket: ${e.type}`);return(0,Ra.parseJsonRpcResponse)(JSON.parse(e.data))}class Tv{constructor(n,t){this.running=!1,this.subscriptions=[],this.request=n,this.socket=t}start(n){if(this.running)throw Error("Already started. Please stop first before restarting.");this.running=!0,this.connectToClient(n),this.socket.queueRequest(JSON.stringify(this.request))}stop(){this.running=!1;const n={...this.request,method:"unsubscribe"};try{this.socket.queueRequest(JSON.stringify(n))}catch(t){if(!(t instanceof Error&&t.message.match(/socket has disconnected/i)))throw t}}connectToClient(n){const t=this.socket.events.map(Vm),i=t.filter(C=>C.id===this.request.id).subscribe({next:C=>{(0,Ra.isJsonRpcErrorResponse)(C)&&(this.closeSubscriptions(),n.error(JSON.stringify(C.error))),i.unsubscribe()}}),o=t.filter(C=>C.id===this.request.id).subscribe({next:C=>{(0,Ra.isJsonRpcErrorResponse)(C)?(this.closeSubscriptions(),n.error(JSON.stringify(C.error))):n.next(C.result)}}),g=t.subscribe({error:C=>{this.closeSubscriptions(),n.error(C)},complete:()=>{this.closeSubscriptions(),n.complete()}});this.subscriptions.push(i,o,g)}closeSubscriptions(){for(const n of this.subscriptions)n.unsubscribe();this.subscriptions=[]}}class Nv{constructor(n,t=Av){if(this.subscriptionStreams=new Map,!(0,Ov.hasProtocol)(n))throw new Error("Base URL is missing a protocol. Expected 'ws://' or 'wss://'.");const i=n.endsWith("/")?"websocket":"/websocket";this.url=n+i,this.socket=new Xl.ReconnectingSocket(this.url);const o=this.socket.events.subscribe({error:g=>{t(g),o.unsubscribe()}});this.jsonRpcResponseStream=this.socket.events.map(Vm),this.socket.connect()}async execute(n){const t=this.responseForRequestId(n.id);this.socket.queueRequest(JSON.stringify(n));const i=await t;if((0,Ra.isJsonRpcErrorResponse)(i))throw new Error(JSON.stringify(i.error));return i}listen(n){if(n.method!=="subscribe")throw new Error('Request method must be "subscribe" to start event listening');const t=n.params.query;if(typeof t!="string")throw new Error("request.params.query must be a string");if(!this.subscriptionStreams.has(t)){const i=new Tv(n,this.socket),o=Iv.Stream.create(i);this.subscriptionStreams.set(t,o)}return this.subscriptionStreams.get(t).filter(i=>i.query!==void 0)}async connected(){await this.socket.connectionStatus.waitFor(Xl.ConnectionStatus.Connected)}disconnect(){this.socket.disconnect()}async responseForRequestId(n){return(0,Ev.firstEvent)(this.jsonRpcResponseStream.filter(t=>t.id===n))}}Os.WebsocketClient=Nv;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WebsocketClient=e.instanceOfRpcStreamingClient=e.HttpClient=e.HttpBatchClient=void 0;var n=Rs;Object.defineProperty(e,"HttpBatchClient",{enumerable:!0,get:function(){return n.HttpBatchClient}});var t=Is;Object.defineProperty(e,"HttpClient",{enumerable:!0,get:function(){return t.HttpClient}});var i=St;Object.defineProperty(e,"instanceOfRpcStreamingClient",{enumerable:!0,get:function(){return i.instanceOfRpcStreamingClient}});var o=Os;Object.defineProperty(e,"WebsocketClient",{enumerable:!0,get:function(){return o.WebsocketClient}})})(_o);var Wm={},Ts={},gn={},pe={};Object.defineProperty(pe,"__esModule",{value:!0});pe.encodeBlockId=pe.encodeVersion=pe.encodeBytes=pe.encodeTime=pe.encodeUvarint=pe.encodeString=pe.dictionaryToStringMap=pe.may=pe.assertNotEmpty=pe.assertObject=pe.assertArray=pe.assertNumber=pe.assertString=pe.assertBoolean=pe.assertSet=void 0;const wv=ue;function hr(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}pe.assertSet=hr;function _v(e){if(hr(e),typeof e!="boolean")throw new Error("Value must be a boolean");return e}pe.assertBoolean=_v;function Mv(e){if(hr(e),typeof e!="string")throw new Error("Value must be a string");return e}pe.assertString=Mv;function Uv(e){if(hr(e),typeof e!="number")throw new Error("Value must be a number");return e}pe.assertNumber=Uv;function Dv(e){if(hr(e),!Array.isArray(e))throw new Error("Value must be a an array");return e}pe.assertArray=Dv;function Jv(e){if(hr(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}pe.assertObject=Jv;function Hv(e){if(hr(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}pe.assertNotEmpty=Hv;function qv(e,n){return n==null?void 0:e(n)}pe.may=qv;function Vv(e){const n=new Map;for(const t of Object.keys(e)){const i=e[t];if(typeof i!="string")throw new Error("Found dictionary value of type other than string");n.set(t,i)}return n}pe.dictionaryToStringMap=Vv;function Wv(e){const n=(0,wv.toUtf8)(e);return Uint8Array.from([n.length,...n])}pe.encodeString=Wv;function Pi(e){return e>=128?Uint8Array.from([e&255|128,...Pi(e>>7)]):Uint8Array.from([e&255])}pe.encodeUvarint=Pi;function Qv(e){const n=e.getTime(),t=Math.floor(n/1e3),i=t?[8,...Pi(t)]:new Uint8Array,o=(e.nanoseconds||0)+n%1e3*1e6,g=o?[16,...Pi(o)]:new Uint8Array;return Uint8Array.from([...i,...g])}pe.encodeTime=Qv;function Fv(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}pe.encodeBytes=Fv;function Gv(e){const n=e.block?Uint8Array.from([8,...Pi(e.block)]):new Uint8Array,t=e.app?Uint8Array.from([16,...Pi(e.app)]):new Uint8Array;return Uint8Array.from([...n,...t])}pe.encodeVersion=Gv;function Lv(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])}pe.encodeBlockId=Lv;Object.defineProperty(gn,"__esModule",{value:!0});gn.smallIntToApi=gn.apiToBigInt=gn.apiToSmallInt=void 0;const Du=Ne,$v=pe;function Kv(e){return(typeof e=="number"?new Du.Int53(e):Du.Int53.fromString(e)).toNumber()}gn.apiToSmallInt=Kv;function xv(e){if((0,$v.assertString)(e),!e.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return BigInt(e)}gn.apiToBigInt=xv;function zv(e){return new Du.Int53(e).toString()}gn.smallIntToApi=zv;var me={};Object.defineProperty(me,"__esModule",{value:!0});me.encodeBlockId=me.encodeVersion=me.encodeBytes=me.encodeTime=me.encodeUvarint=me.encodeString=me.dictionaryToStringMap=me.may=me.assertNotEmpty=me.assertObject=me.assertArray=me.assertNumber=me.assertString=me.assertBoolean=me.assertSet=void 0;const Yv=ue;function gr(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}me.assertSet=gr;function Zv(e){if(gr(e),typeof e!="boolean")throw new Error("Value must be a boolean");return e}me.assertBoolean=Zv;function Xv(e){if(gr(e),typeof e!="string")throw new Error("Value must be a string");return e}me.assertString=Xv;function jv(e){if(gr(e),typeof e!="number")throw new Error("Value must be a number");return e}me.assertNumber=jv;function eC(e){if(gr(e),!Array.isArray(e))throw new Error("Value must be a an array");return e}me.assertArray=eC;function nC(e){if(gr(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}me.assertObject=nC;function tC(e){if(gr(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}me.assertNotEmpty=tC;function rC(e,n){return n==null?void 0:e(n)}me.may=rC;function iC(e){const n=new Map;for(const t of Object.keys(e)){const i=e[t];if(typeof i!="string")throw new Error("Found dictionary value of type other than string");n.set(t,i)}return n}me.dictionaryToStringMap=iC;function oC(e){const n=(0,Yv.toUtf8)(e);return Uint8Array.from([n.length,...n])}me.encodeString=oC;function vi(e){return e>=128?Uint8Array.from([e&255|128,...vi(e>>7)]):Uint8Array.from([e&255])}me.encodeUvarint=vi;function aC(e){const n=e.getTime(),t=Math.floor(n/1e3),i=t?[8,...vi(t)]:new Uint8Array,o=(e.nanoseconds||0)+n%1e3*1e6,g=o?[16,...vi(o)]:new Uint8Array;return Uint8Array.from([...i,...g])}me.encodeTime=aC;function sC(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}me.encodeBytes=sC;function dC(e){const n=e.block?Uint8Array.from([8,...vi(e.block)]):new Uint8Array,t=e.app?Uint8Array.from([16,...vi(e.app)]):new Uint8Array;return Uint8Array.from([...n,...t])}me.encodeVersion=dC;function uC(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])}me.encodeBlockId=uC;var Ns={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buildQuery=e.SubscriptionEventType=e.Method=void 0,function(t){t.AbciInfo="abci_info",t.AbciQuery="abci_query",t.Block="block",t.Blockchain="blockchain",t.BlockResults="block_results",t.BlockSearch="block_search",t.BroadcastTxAsync="broadcast_tx_async",t.BroadcastTxSync="broadcast_tx_sync",t.BroadcastTxCommit="broadcast_tx_commit",t.Commit="commit",t.Genesis="genesis",t.Health="health",t.NumUnconfirmedTxs="num_unconfirmed_txs",t.Status="status",t.Subscribe="subscribe",t.Tx="tx",t.TxSearch="tx_search",t.Validators="validators",t.Unsubscribe="unsubscribe"}(e.Method||(e.Method={})),function(t){t.NewBlock="NewBlock",t.NewBlockHeader="NewBlockHeader",t.Tx="Tx"}(e.SubscriptionEventType||(e.SubscriptionEventType={}));function n(t){const o=(t.tags?t.tags:[]).map(C=>`${C.key}='${C.value}'`),g=t.raw?[t.raw]:[];return[...o,...g].join(" AND ")}e.buildQuery=n})(Ns);var cC=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,o)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),lC=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),fC=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&cC(n,e,t);return lC(n,e),n};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.Params=void 0;const Fc=ue,Gn=gn,We=Pt,sn=me,pC=fC(Ns);function lu(e){return{height:(0,sn.may)(Gn.smallIntToApi,e.height)}}function mC(e){return{minHeight:(0,sn.may)(Gn.smallIntToApi,e.minHeight),maxHeight:(0,sn.may)(Gn.smallIntToApi,e.maxHeight)}}function hC(e){return{query:e.query,page:(0,sn.may)(Gn.smallIntToApi,e.page),per_page:(0,sn.may)(Gn.smallIntToApi,e.per_page),order_by:e.order_by}}function gC(e){return{path:(0,sn.assertNotEmpty)(e.path),data:(0,Fc.toHex)(e.data),height:(0,sn.may)(Gn.smallIntToApi,e.height),prove:e.prove}}function yC(e){return{tx:(0,Fc.toBase64)((0,sn.assertNotEmpty)(e.tx))}}function SC(e){return{hash:(0,Fc.toBase64)((0,sn.assertNotEmpty)(e.hash)),prove:e.prove}}function kC(e){return{query:e.query,prove:e.prove,page:(0,sn.may)(Gn.smallIntToApi,e.page),per_page:(0,sn.may)(Gn.smallIntToApi,e.per_page),order_by:e.order_by}}function PC(e){return{height:(0,sn.may)(Gn.smallIntToApi,e.height),page:(0,sn.may)(Gn.smallIntToApi,e.page),per_page:(0,sn.may)(Gn.smallIntToApi,e.per_page)}}let vC=class{static encodeAbciInfo(n){return(0,We.createJsonRpcRequest)(n.method)}static encodeAbciQuery(n){return(0,We.createJsonRpcRequest)(n.method,gC(n.params))}static encodeBlock(n){return(0,We.createJsonRpcRequest)(n.method,lu(n.params))}static encodeBlockchain(n){return(0,We.createJsonRpcRequest)(n.method,mC(n.params))}static encodeBlockResults(n){return(0,We.createJsonRpcRequest)(n.method,lu(n.params))}static encodeBlockSearch(n){return(0,We.createJsonRpcRequest)(n.method,hC(n.params))}static encodeBroadcastTx(n){return(0,We.createJsonRpcRequest)(n.method,yC(n.params))}static encodeCommit(n){return(0,We.createJsonRpcRequest)(n.method,lu(n.params))}static encodeGenesis(n){return(0,We.createJsonRpcRequest)(n.method)}static encodeHealth(n){return(0,We.createJsonRpcRequest)(n.method)}static encodeNumUnconfirmedTxs(n){return(0,We.createJsonRpcRequest)(n.method)}static encodeStatus(n){return(0,We.createJsonRpcRequest)(n.method)}static encodeSubscribe(n){const t={key:"tm.event",value:n.query.type},i=pC.buildQuery({tags:[t],raw:n.query.raw});return(0,We.createJsonRpcRequest)("subscribe",{query:i})}static encodeTx(n){return(0,We.createJsonRpcRequest)(n.method,SC(n.params))}static encodeTxSearch(n){return(0,We.createJsonRpcRequest)(n.method,kC(n.params))}static encodeValidators(n){return(0,We.createJsonRpcRequest)(n.method,PC(n.params))}};Ts.Params=vC;var On={},Jo={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BlockIdFlag=void 0,function(n){n[n.Unknown=0]="Unknown",n[n.Absent=1]="Absent",n[n.Commit=2]="Commit",n[n.Nil=3]="Nil",n[n.Unrecognized=-1]="Unrecognized"}(e.BlockIdFlag||(e.BlockIdFlag={}))})(Jo);var Ci={};Object.defineProperty(Ci,"__esModule",{value:!0});Ci.hashBlock=Ci.hashTx=void 0;const Gc=$e,Ze=me;function CC(e){return(0,Gc.sha256)(e)}Ci.hashTx=CC;function RC(e){if(e<1)throw new Error("Cannot split an empty tree");const n=2**Math.floor(Math.log2(e));return n<e?n:n/2}function BC(e){const n=new Gc.Sha256(Uint8Array.from([0]));return n.update(e),n.digest()}function bC(e,n){const t=new Gc.Sha256(Uint8Array.from([1]));return t.update(e),t.update(n),t.digest()}function Ju(e){switch(e.length){case 0:throw new Error("Cannot hash empty tree");case 1:return BC(e[0]);default:{const n=RC(e.length),t=Ju(e.slice(0,n)),i=Ju(e.slice(n));return bC(t,i)}}}function EC(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 n=[(0,Ze.encodeVersion)(e.version),(0,Ze.encodeString)(e.chainId),(0,Ze.encodeUvarint)(e.height),(0,Ze.encodeTime)(e.time),(0,Ze.encodeBlockId)(e.lastBlockId),(0,Ze.encodeBytes)(e.lastCommitHash),(0,Ze.encodeBytes)(e.dataHash),(0,Ze.encodeBytes)(e.validatorsHash),(0,Ze.encodeBytes)(e.nextValidatorsHash),(0,Ze.encodeBytes)(e.consensusHash),(0,Ze.encodeBytes)(e.appHash),(0,Ze.encodeBytes)(e.lastResultsHash),(0,Ze.encodeBytes)(e.evidenceHash),(0,Ze.encodeBytes)(e.proposerAddress)];return Ju(n)}Ci.hashBlock=EC;Object.defineProperty(On,"__esModule",{value:!0});On.Responses=On.decodeValidatorInfo=On.decodeValidatorGenesis=On.decodeValidatorUpdate=On.decodeEvent=void 0;const se=ue,Qm=Ie,lo=xe,ie=gn,IC=Jo,X=me,OC=Ci;function AC(e){return{data:e.data,lastBlockHeight:(0,X.may)(ie.apiToSmallInt,e.last_block_height),lastBlockAppHash:(0,X.may)(se.fromBase64,e.last_block_app_hash)}}function TC(e){return{ops:e.ops.map(n=>({type:n.type,key:(0,se.fromBase64)(n.key),data:(0,se.fromBase64)(n.data)}))}}function NC(e){return{key:(0,se.fromBase64)((0,X.assertString)(e.key??"")),value:(0,se.fromBase64)((0,X.assertString)(e.value??"")),proof:(0,X.may)(TC,e.proofOps),height:(0,X.may)(ie.apiToSmallInt,e.height),code:(0,X.may)(ie.apiToSmallInt,e.code),codespace:(0,X.assertString)(e.codespace??""),index:(0,X.may)(ie.apiToSmallInt,e.index),log:e.log,info:(0,X.assertString)(e.info??"")}}function wC(e){return{key:(0,X.assertNotEmpty)(e.key),value:e.value??""}}function _C(e){return(0,X.assertArray)(e).map(wC)}function Fm(e){return{type:e.type,attributes:e.attributes?_C(e.attributes):[]}}On.decodeEvent=Fm;function Hu(e){return(0,X.assertArray)(e).map(Fm)}function Ri(e){return{code:(0,ie.apiToSmallInt)((0,X.assertNumber)(e.code??0)),codespace:e.codespace,log:e.log,data:(0,X.may)(se.fromBase64,e.data),events:e.events?Hu(e.events):[],gasWanted:(0,ie.apiToBigInt)(e.gas_wanted??"0"),gasUsed:(0,ie.apiToBigInt)(e.gas_used??"0")}}function Lc(e){if("Sum"in e){const[[n,t]]=Object.entries(e.Sum.value);return(0,Qm.assert)(n==="ed25519"||n==="secp256k1",`unknown pubkey type: ${n}`),{algorithm:n,data:(0,se.fromBase64)((0,X.assertNotEmpty)(t))}}else switch(e.type){case"tendermint/PubKeyEd25519":return{algorithm:"ed25519",data:(0,se.fromBase64)((0,X.assertNotEmpty)(e.value))};case"tendermint/PubKeySecp256k1":return{algorithm:"secp256k1",data:(0,se.fromBase64)((0,X.assertNotEmpty)(e.value))};default:throw new Error(`unknown pubkey type: ${e.type}`)}}function MC(e){return{maxBytes:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.max_bytes)),maxGas:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.max_gas))}}function UC(e){return{maxAgeNumBlocks:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.max_age_num_blocks)),maxAgeDuration:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.max_age_duration))}}function Gm(e){return{block:MC((0,X.assertObject)(e.block)),evidence:UC((0,X.assertObject)(e.evidence))}}function Lm(e){return{pubkey:Lc((0,X.assertObject)(e.pub_key)),votingPower:(0,ie.apiToBigInt)(e.power??"0")}}On.decodeValidatorUpdate=Lm;function DC(e){return{height:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.height)),results:(e.txs_results||[]).map(Ri),validatorUpdates:(e.validator_updates||[]).map(Lm),consensusUpdates:(0,X.may)(Gm,e.consensus_param_updates),beginBlockEvents:Hu(e.begin_block_events||[]),endBlockEvents:Hu(e.end_block_events||[])}}function ws(e){return{hash:(0,se.fromHex)((0,X.assertNotEmpty)(e.hash)),parts:{total:(0,X.assertNotEmpty)(e.parts.total),hash:(0,se.fromHex)((0,X.assertNotEmpty)(e.parts.hash))}}}function JC(e){return{block:(0,ie.apiToSmallInt)(e.block),app:(0,ie.apiToSmallInt)(e.app??0)}}function _s(e){return{version:JC(e.version),chainId:(0,X.assertNotEmpty)(e.chain_id),height:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.height)),time:(0,lo.fromRfc3339WithNanoseconds)((0,X.assertNotEmpty)(e.time)),lastBlockId:e.last_block_id.hash?ws(e.last_block_id):null,lastCommitHash:(0,se.fromHex)((0,X.assertSet)(e.last_commit_hash)),dataHash:(0,se.fromHex)((0,X.assertSet)(e.data_hash)),validatorsHash:(0,se.fromHex)((0,X.assertSet)(e.validators_hash)),nextValidatorsHash:(0,se.fromHex)((0,X.assertSet)(e.next_validators_hash)),consensusHash:(0,se.fromHex)((0,X.assertSet)(e.consensus_hash)),appHash:(0,se.fromHex)((0,X.assertSet)(e.app_hash)),lastResultsHash:(0,se.fromHex)((0,X.assertSet)(e.last_results_hash)),evidenceHash:(0,se.fromHex)((0,X.assertSet)(e.evidence_hash)),proposerAddress:(0,se.fromHex)((0,X.assertNotEmpty)(e.proposer_address))}}function HC(e){return{blockId:ws(e.block_id),blockSize:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.block_size)),header:_s(e.header),numTxs:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.num_txs))}}function qC(e){return{lastHeight:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.last_height)),blockMetas:(0,X.assertArray)(e.block_metas).map(HC)}}function VC(e){return{...Ri(e),hash:(0,se.fromHex)((0,X.assertNotEmpty)(e.hash))}}function WC(e){const n=e.tx_result?Ri(e.tx_result):void 0;return{height:(0,ie.apiToSmallInt)(e.height),hash:(0,se.fromHex)((0,X.assertNotEmpty)(e.hash)),checkTx:Ri((0,X.assertObject)(e.check_tx)),deliverTx:n,txResult:n}}function QC(e){return(0,Qm.assert)(e in IC.BlockIdFlag),e}function FC(e){return{blockIdFlag:QC(e.block_id_flag),validatorAddress:e.validator_address?(0,se.fromHex)(e.validator_address):void 0,timestamp:e.timestamp?(0,lo.fromRfc3339WithNanoseconds)(e.timestamp):void 0,signature:e.signature?(0,se.fromBase64)(e.signature):void 0}}function $m(e){return{blockId:ws((0,X.assertObject)(e.block_id)),height:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.height)),round:(0,ie.apiToSmallInt)(e.round),signatures:(0,X.assertArray)(e.signatures).map(FC)}}function GC(e){return{canonical:(0,X.assertBoolean)(e.canonical),header:_s(e.signed_header.header),commit:$m(e.signed_header.commit)}}function Km(e){return{address:(0,se.fromHex)((0,X.assertNotEmpty)(e.address)),pubkey:Lc((0,X.assertObject)(e.pub_key)),votingPower:(0,ie.apiToBigInt)((0,X.assertNotEmpty)(e.power))}}On.decodeValidatorGenesis=Km;function LC(e){return{genesisTime:(0,lo.fromRfc3339WithNanoseconds)((0,X.assertNotEmpty)(e.genesis_time)),chainId:(0,X.assertNotEmpty)(e.chain_id),consensusParams:Gm(e.consensus_params),validators:e.validators?(0,X.assertArray)(e.validators).map(Km):[],appHash:(0,se.fromHex)((0,X.assertSet)(e.app_hash)),appState:e.app_state}}function $c(e){return{pubkey:Lc((0,X.assertObject)(e.pub_key)),votingPower:(0,ie.apiToBigInt)((0,X.assertNotEmpty)(e.voting_power)),address:(0,se.fromHex)((0,X.assertNotEmpty)(e.address)),proposerPriority:e.proposer_priority?(0,ie.apiToSmallInt)(e.proposer_priority):void 0}}On.decodeValidatorInfo=$c;function $C(e){return{id:(0,se.fromHex)((0,X.assertNotEmpty)(e.id)),listenAddr:(0,X.assertNotEmpty)(e.listen_addr),network:(0,X.assertNotEmpty)(e.network),version:(0,X.assertString)(e.version),channels:(0,X.assertString)(e.channels),moniker:(0,X.assertNotEmpty)(e.moniker),other:(0,X.dictionaryToStringMap)(e.other),protocolVersion:{app:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.protocol_version.app)),block:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.protocol_version.block)),p2p:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.protocol_version.p2p))}}}function KC(e){const n=e.earliest_block_height?(0,ie.apiToSmallInt)(e.earliest_block_height):void 0,t=e.earliest_block_time?(0,lo.fromRfc3339WithNanoseconds)(e.earliest_block_time):void 0;return{earliestAppHash:e.earliest_app_hash?(0,se.fromHex)(e.earliest_app_hash):void 0,earliestBlockHash:e.earliest_block_hash?(0,se.fromHex)(e.earliest_block_hash):void 0,earliestBlockHeight:n||void 0,earliestBlockTime:t!=null&&t.getTime()?t:void 0,latestBlockHash:(0,se.fromHex)((0,X.assertNotEmpty)(e.latest_block_hash)),latestAppHash:(0,se.fromHex)((0,X.assertNotEmpty)(e.latest_app_hash)),latestBlockTime:(0,lo.fromRfc3339WithNanoseconds)((0,X.assertNotEmpty)(e.latest_block_time)),latestBlockHeight:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.latest_block_height)),catchingUp:(0,X.assertBoolean)(e.catching_up)}}function xC(e){return{nodeInfo:$C(e.node_info),syncInfo:KC(e.sync_info),validatorInfo:$c(e.validator_info)}}function zC(e){return{data:(0,se.fromBase64)((0,X.assertNotEmpty)(e.data)),rootHash:(0,se.fromHex)((0,X.assertNotEmpty)(e.root_hash)),proof:{total:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.proof.total)),index:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.proof.index)),leafHash:(0,se.fromBase64)((0,X.assertNotEmpty)(e.proof.leaf_hash)),aunts:(0,X.assertArray)(e.proof.aunts).map(se.fromBase64)}}}function xm(e){return{tx:(0,se.fromBase64)((0,X.assertNotEmpty)(e.tx)),result:Ri((0,X.assertObject)(e.tx_result)),height:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.height)),index:(0,ie.apiToSmallInt)((0,X.assertNumber)(e.index)),hash:(0,se.fromHex)((0,X.assertNotEmpty)(e.hash)),proof:(0,X.may)(zC,e.proof)}}function YC(e){return{totalCount:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.total_count)),txs:(0,X.assertArray)(e.txs).map(xm)}}function ZC(e){const n=(0,se.fromBase64)((0,X.assertNotEmpty)(e.tx));return{tx:n,hash:(0,OC.hashTx)(n),result:Ri(e.result),height:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.height))}}function XC(e){return{blockHeight:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.block_height)),validators:(0,X.assertArray)(e.validators).map($c),count:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.count)),total:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.total))}}function zm(e){var n;return{header:_s((0,X.assertObject)(e.header)),lastCommit:e.last_commit.block_id.hash?$m((0,X.assertObject)(e.last_commit)):null,txs:e.data.txs?(0,X.assertArray)(e.data.txs).map(se.fromBase64):[],evidence:((n=e.evidence)==null?void 0:n.evidence)??[]}}function Ym(e){return{blockId:ws(e.block_id),block:zm(e.block)}}function jC(e){return{totalCount:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.total_count)),blocks:(0,X.assertArray)(e.blocks).map(Ym)}}function eR(e){return{total:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.total)),totalBytes:(0,ie.apiToSmallInt)((0,X.assertNotEmpty)(e.total_bytes))}}let nR=class Zm{static decodeAbciInfo(n){return AC((0,X.assertObject)(n.result.response))}static decodeAbciQuery(n){return NC((0,X.assertObject)(n.result.response))}static decodeBlock(n){return Ym(n.result)}static decodeBlockResults(n){return DC(n.result)}static decodeBlockSearch(n){return jC(n.result)}static decodeBlockchain(n){return qC(n.result)}static decodeBroadcastTxSync(n){return VC(n.result)}static decodeBroadcastTxAsync(n){return Zm.decodeBroadcastTxSync(n)}static decodeBroadcastTxCommit(n){return WC(n.result)}static decodeCommit(n){return GC(n.result)}static decodeGenesis(n){return LC((0,X.assertObject)(n.result.genesis))}static decodeHealth(){return null}static decodeNumUnconfirmedTxs(n){return eR(n.result)}static decodeStatus(n){return xC(n.result)}static decodeNewBlockEvent(n){return zm(n.data.value.block)}static decodeNewBlockHeaderEvent(n){return _s(n.data.value.header)}static decodeTxEvent(n){return ZC(n.data.value.TxResult)}static decodeTx(n){return xm(n.result)}static decodeTxSearch(n){return YC(n.result)}static decodeValidators(n){return XC(n.result)}};On.Responses=nR;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Responses=e.Params=void 0;var n=Ts;Object.defineProperty(e,"Params",{enumerable:!0,get:function(){return n.Params}});var t=On;Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return t.Responses}})})(Wm);var tR=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,o)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),rR=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),iR=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&tR(n,e,t);return rR(n,e),n};Object.defineProperty(Cs,"__esModule",{value:!0});Cs.Comet38Client=void 0;const oR=Pt,ta=_o,ce=Wm,ke=iR(Ns);class Ba{static async connect(n){let t;return typeof n=="object"?t=new ta.HttpClient(n):t=n.startsWith("http://")||n.startsWith("https://")?new ta.HttpClient(n):new ta.WebsocketClient(n),await this.detectVersion(t),Ba.create(t)}static async create(n){return new Ba(n)}static async detectVersion(n){const t=(0,oR.createJsonRpcRequest)(ke.Method.Status),o=(await n.execute(t)).result;if(!o||!o.node_info)throw new Error("Unrecognized format for status response");const g=o.node_info.version;if(typeof g!="string")throw new Error("Unrecognized version format: must be string");return g}constructor(n){this.client=n}disconnect(){this.client.disconnect()}async abciInfo(){const n={method:ke.Method.AbciInfo};return this.doCall(n,ce.Params.encodeAbciInfo,ce.Responses.decodeAbciInfo)}async abciQuery(n){const t={params:n,method:ke.Method.AbciQuery};return this.doCall(t,ce.Params.encodeAbciQuery,ce.Responses.decodeAbciQuery)}async block(n){const t={method:ke.Method.Block,params:{height:n}};return this.doCall(t,ce.Params.encodeBlock,ce.Responses.decodeBlock)}async blockResults(n){const t={method:ke.Method.BlockResults,params:{height:n}};return this.doCall(t,ce.Params.encodeBlockResults,ce.Responses.decodeBlockResults)}async blockSearch(n){const t={params:n,method:ke.Method.BlockSearch},i=await this.doCall(t,ce.Params.encodeBlockSearch,ce.Responses.decodeBlockSearch);return{...i,blocks:[...i.blocks].sort((o,g)=>o.block.header.height-g.block.header.height)}}async blockSearchAll(n){let t=n.page||1;const i=[];let o=!1;for(;!o;){const g=await this.blockSearch({...n,page:t});i.push(...g.blocks),i.length<g.totalCount?t++:o=!0}return i.sort((g,C)=>g.block.header.height-C.block.header.height),{totalCount:i.length,blocks:i}}async blockchain(n,t){const i={method:ke.Method.Blockchain,params:{minHeight:n,maxHeight:t}};return this.doCall(i,ce.Params.encodeBlockchain,ce.Responses.decodeBlockchain)}async broadcastTxSync(n){const t={params:n,method:ke.Method.BroadcastTxSync};return this.doCall(t,ce.Params.encodeBroadcastTx,ce.Responses.decodeBroadcastTxSync)}async broadcastTxAsync(n){const t={params:n,method:ke.Method.BroadcastTxAsync};return this.doCall(t,ce.Params.encodeBroadcastTx,ce.Responses.decodeBroadcastTxAsync)}async broadcastTxCommit(n){const t={params:n,method:ke.Method.BroadcastTxCommit};return this.doCall(t,ce.Params.encodeBroadcastTx,ce.Responses.decodeBroadcastTxCommit)}async commit(n){const t={method:ke.Method.Commit,params:{height:n}};return this.doCall(t,ce.Params.encodeCommit,ce.Responses.decodeCommit)}async genesis(){const n={method:ke.Method.Genesis};return this.doCall(n,ce.Params.encodeGenesis,ce.Responses.decodeGenesis)}async health(){const n={method:ke.Method.Health};return this.doCall(n,ce.Params.encodeHealth,ce.Responses.decodeHealth)}async numUnconfirmedTxs(){const n={method:ke.Method.NumUnconfirmedTxs};return this.doCall(n,ce.Params.encodeNumUnconfirmedTxs,ce.Responses.decodeNumUnconfirmedTxs)}async status(){const n={method:ke.Method.Status};return this.doCall(n,ce.Params.encodeStatus,ce.Responses.decodeStatus)}subscribeNewBlock(){const n={method:ke.Method.Subscribe,query:{type:ke.SubscriptionEventType.NewBlock}};return this.subscribe(n,ce.Responses.decodeNewBlockEvent)}subscribeNewBlockHeader(){const n={method:ke.Method.Subscribe,query:{type:ke.SubscriptionEventType.NewBlockHeader}};return this.subscribe(n,ce.Responses.decodeNewBlockHeaderEvent)}subscribeTx(n){const t={method:ke.Method.Subscribe,query:{type:ke.SubscriptionEventType.Tx,raw:n}};return this.subscribe(t,ce.Responses.decodeTxEvent)}async tx(n){const t={params:n,method:ke.Method.Tx};return this.doCall(t,ce.Params.encodeTx,ce.Responses.decodeTx)}async txSearch(n){const t={params:n,method:ke.Method.TxSearch};return this.doCall(t,ce.Params.encodeTxSearch,ce.Responses.decodeTxSearch)}async txSearchAll(n){let t=n.page||1;const i=[];let o=!1;for(;!o;){const g=await this.txSearch({...n,page:t});i.push(...g.txs),i.length<g.totalCount?t++:o=!0}return{totalCount:i.length,txs:i}}async validators(n){const t={method:ke.Method.Validators,params:n};return this.doCall(t,ce.Params.encodeValidators,ce.Responses.decodeValidators)}async validatorsAll(n){const t=[];let i=1,o=!1,g=n;for(;!o;){const C=await this.validators({per_page:50,height:g,page:i});t.push(...C.validators),g=g||C.blockHeight,t.length<C.total?i++:o=!0}return{blockHeight:g??0,count:t.length,total:t.length,validators:t}}async doCall(n,t,i){const o=t(n),g=await this.client.execute(o);return i(g)}subscribe(n,t){if(!(0,ta.instanceOfRpcStreamingClient)(this.client))throw new Error("This RPC client type cannot subscribe to events");const i=ce.Params.encodeSubscribe(n);return this.client.listen(i).map(g=>t(g))}}Cs.Comet38Client=Ba;var Xm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VoteType=e.broadcastTxCommitSuccess=e.broadcastTxSyncSuccess=void 0;function n(i){return i.code===0}e.broadcastTxSyncSuccess=n;function t(i){return i.checkTx.code===0&&!!i.deliverTx&&i.deliverTx.code===0}e.broadcastTxCommitSuccess=t,function(i){i[i.PreVote=1]="PreVote",i[i.PreCommit=2]="PreCommit"}(e.VoteType||(e.VoteType={}))})(Xm);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VoteType=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.SubscriptionEventType=e.Method=e.Comet38Client=void 0;var n=Cs;Object.defineProperty(e,"Comet38Client",{enumerable:!0,get:function(){return n.Comet38Client}});var t=Ns;Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return t.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return t.SubscriptionEventType}});var i=Xm;Object.defineProperty(e,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return i.broadcastTxCommitSuccess}}),Object.defineProperty(e,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return i.broadcastTxSyncSuccess}}),Object.defineProperty(e,"VoteType",{enumerable:!0,get:function(){return i.VoteType}})})(Ca);var no={},Ms={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buildQuery=e.SubscriptionEventType=e.Method=void 0,function(t){t.AbciInfo="abci_info",t.AbciQuery="abci_query",t.Block="block",t.Blockchain="blockchain",t.BlockResults="block_results",t.BlockSearch="block_search",t.BroadcastTxAsync="broadcast_tx_async",t.BroadcastTxSync="broadcast_tx_sync",t.BroadcastTxCommit="broadcast_tx_commit",t.Commit="commit",t.Genesis="genesis",t.Health="health",t.NumUnconfirmedTxs="num_unconfirmed_txs",t.Status="status",t.Subscribe="subscribe",t.Tx="tx",t.TxSearch="tx_search",t.Validators="validators",t.Unsubscribe="unsubscribe"}(e.Method||(e.Method={})),function(t){t.NewBlock="NewBlock",t.NewBlockHeader="NewBlockHeader",t.Tx="Tx"}(e.SubscriptionEventType||(e.SubscriptionEventType={}));function n(t){const o=(t.tags?t.tags:[]).map(C=>`${C.key}='${C.value}'`),g=t.raw?[t.raw]:[];return[...o,...g].join(" AND ")}e.buildQuery=n})(Ms);var jm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VoteType=e.broadcastTxCommitSuccess=e.broadcastTxSyncSuccess=void 0;function n(i){return i.code===0}e.broadcastTxSyncSuccess=n;function t(i){return i.checkTx.code===0&&!!i.deliverTx&&i.deliverTx.code===0}e.broadcastTxCommitSuccess=t,function(i){i[i.PreVote=1]="PreVote",i[i.PreCommit=2]="PreCommit"}(e.VoteType||(e.VoteType={}))})(jm);var Us={},eh={},Ds={},aR=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,o)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),sR=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),dR=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&aR(n,e,t);return sR(n,e),n};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.Params=void 0;const Kc=ue,Ln=gn,Qe=Pt,dn=pe,uR=dR(Ms);function fu(e){return{height:(0,dn.may)(Ln.smallIntToApi,e.height)}}function cR(e){return{minHeight:(0,dn.may)(Ln.smallIntToApi,e.minHeight),maxHeight:(0,dn.may)(Ln.smallIntToApi,e.maxHeight)}}function lR(e){return{query:e.query,page:(0,dn.may)(Ln.smallIntToApi,e.page),per_page:(0,dn.may)(Ln.smallIntToApi,e.per_page),order_by:e.order_by}}function fR(e){return{path:(0,dn.assertNotEmpty)(e.path),data:(0,Kc.toHex)(e.data),height:(0,dn.may)(Ln.smallIntToApi,e.height),prove:e.prove}}function pR(e){return{tx:(0,Kc.toBase64)((0,dn.assertNotEmpty)(e.tx))}}function mR(e){return{hash:(0,Kc.toBase64)((0,dn.assertNotEmpty)(e.hash)),prove:e.prove}}function hR(e){return{query:e.query,prove:e.prove,page:(0,dn.may)(Ln.smallIntToApi,e.page),per_page:(0,dn.may)(Ln.smallIntToApi,e.per_page),order_by:e.order_by}}function gR(e){return{height:(0,dn.may)(Ln.smallIntToApi,e.height),page:(0,dn.may)(Ln.smallIntToApi,e.page),per_page:(0,dn.may)(Ln.smallIntToApi,e.per_page)}}let yR=class{static encodeAbciInfo(n){return(0,Qe.createJsonRpcRequest)(n.method)}static encodeAbciQuery(n){return(0,Qe.createJsonRpcRequest)(n.method,fR(n.params))}static encodeBlock(n){return(0,Qe.createJsonRpcRequest)(n.method,fu(n.params))}static encodeBlockchain(n){return(0,Qe.createJsonRpcRequest)(n.method,cR(n.params))}static encodeBlockResults(n){return(0,Qe.createJsonRpcRequest)(n.method,fu(n.params))}static encodeBlockSearch(n){return(0,Qe.createJsonRpcRequest)(n.method,lR(n.params))}static encodeBroadcastTx(n){return(0,Qe.createJsonRpcRequest)(n.method,pR(n.params))}static encodeCommit(n){return(0,Qe.createJsonRpcRequest)(n.method,fu(n.params))}static encodeGenesis(n){return(0,Qe.createJsonRpcRequest)(n.method)}static encodeHealth(n){return(0,Qe.createJsonRpcRequest)(n.method)}static encodeNumUnconfirmedTxs(n){return(0,Qe.createJsonRpcRequest)(n.method)}static encodeStatus(n){return(0,Qe.createJsonRpcRequest)(n.method)}static encodeSubscribe(n){const t={key:"tm.event",value:n.query.type},i=uR.buildQuery({tags:[t],raw:n.query.raw});return(0,Qe.createJsonRpcRequest)("subscribe",{query:i})}static encodeTx(n){return(0,Qe.createJsonRpcRequest)(n.method,mR(n.params))}static encodeTxSearch(n){return(0,Qe.createJsonRpcRequest)(n.method,hR(n.params))}static encodeValidators(n){return(0,Qe.createJsonRpcRequest)(n.method,gR(n.params))}};Ds.Params=yR;var An={},Bi={};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.hashBlock=Bi.hashTx=void 0;const xc=$e,Xe=pe;function SR(e){return(0,xc.sha256)(e)}Bi.hashTx=SR;function kR(e){if(e<1)throw new Error("Cannot split an empty tree");const n=2**Math.floor(Math.log2(e));return n<e?n:n/2}function PR(e){const n=new xc.Sha256(Uint8Array.from([0]));return n.update(e),n.digest()}function vR(e,n){const t=new xc.Sha256(Uint8Array.from([1]));return t.update(e),t.update(n),t.digest()}function qu(e){switch(e.length){case 0:throw new Error("Cannot hash empty tree");case 1:return PR(e[0]);default:{const n=kR(e.length),t=qu(e.slice(0,n)),i=qu(e.slice(n));return vR(t,i)}}}function CR(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 n=[(0,Xe.encodeVersion)(e.version),(0,Xe.encodeString)(e.chainId),(0,Xe.encodeUvarint)(e.height),(0,Xe.encodeTime)(e.time),(0,Xe.encodeBlockId)(e.lastBlockId),(0,Xe.encodeBytes)(e.lastCommitHash),(0,Xe.encodeBytes)(e.dataHash),(0,Xe.encodeBytes)(e.validatorsHash),(0,Xe.encodeBytes)(e.nextValidatorsHash),(0,Xe.encodeBytes)(e.consensusHash),(0,Xe.encodeBytes)(e.appHash),(0,Xe.encodeBytes)(e.lastResultsHash),(0,Xe.encodeBytes)(e.evidenceHash),(0,Xe.encodeBytes)(e.proposerAddress)];return qu(n)}Bi.hashBlock=CR;Object.defineProperty(An,"__esModule",{value:!0});An.Responses=An.decodeValidatorInfo=An.decodeValidatorGenesis=An.decodeValidatorUpdate=An.decodeEvent=void 0;const re=ue,nh=Ie,fo=xe,oe=gn,RR=Jo,Y=pe,BR=Bi;function bR(e){return{data:e.data,lastBlockHeight:(0,Y.may)(oe.apiToSmallInt,e.last_block_height),lastBlockAppHash:(0,Y.may)(re.fromBase64,e.last_block_app_hash)}}function ER(e){return{ops:e.ops.map(n=>({type:n.type,key:(0,re.fromBase64)(n.key),data:(0,re.fromBase64)(n.data)}))}}function IR(e){return{key:(0,re.fromBase64)((0,Y.assertString)(e.key??"")),value:(0,re.fromBase64)((0,Y.assertString)(e.value??"")),proof:(0,Y.may)(ER,e.proofOps),height:(0,Y.may)(oe.apiToSmallInt,e.height),code:(0,Y.may)(oe.apiToSmallInt,e.code),codespace:(0,Y.assertString)(e.codespace??""),index:(0,Y.may)(oe.apiToSmallInt,e.index),log:e.log,info:(0,Y.assertString)(e.info??"")}}function OR(e){return{key:(0,re.fromBase64)((0,Y.assertNotEmpty)(e.key)),value:(0,re.fromBase64)((0,Y.assertString)(e.value??""))}}function AR(e){return(0,Y.assertArray)(e).map(OR)}function th(e){return{type:e.type,attributes:e.attributes?AR(e.attributes):[]}}An.decodeEvent=th;function Vu(e){return(0,Y.assertArray)(e).map(th)}function bi(e){return{code:(0,oe.apiToSmallInt)((0,Y.assertNumber)(e.code??0)),codespace:e.codespace,log:e.log,data:(0,Y.may)(re.fromBase64,e.data),events:e.events?Vu(e.events):[],gasWanted:(0,oe.apiToBigInt)(e.gas_wanted??"0"),gasUsed:(0,oe.apiToBigInt)(e.gas_used??"0")}}function zc(e){if("Sum"in e){const[[n,t]]=Object.entries(e.Sum.value);return(0,nh.assert)(n==="ed25519"||n==="secp256k1",`unknown pubkey type: ${n}`),{algorithm:n,data:(0,re.fromBase64)((0,Y.assertNotEmpty)(t))}}else switch(e.type){case"tendermint/PubKeyEd25519":return{algorithm:"ed25519",data:(0,re.fromBase64)((0,Y.assertNotEmpty)(e.value))};case"tendermint/PubKeySecp256k1":return{algorithm:"secp256k1",data:(0,re.fromBase64)((0,Y.assertNotEmpty)(e.value))};default:throw new Error(`unknown pubkey type: ${e.type}`)}}function TR(e){return{maxBytes:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.max_bytes)),maxGas:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.max_gas))}}function NR(e){return{maxAgeNumBlocks:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.max_age_num_blocks)),maxAgeDuration:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.max_age_duration))}}function rh(e){return{block:TR((0,Y.assertObject)(e.block)),evidence:NR((0,Y.assertObject)(e.evidence))}}function ih(e){return{pubkey:zc((0,Y.assertObject)(e.pub_key)),votingPower:(0,oe.apiToBigInt)(e.power??"0")}}An.decodeValidatorUpdate=ih;function wR(e){return{height:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.height)),results:(e.txs_results||[]).map(bi),validatorUpdates:(e.validator_updates||[]).map(ih),consensusUpdates:(0,Y.may)(rh,e.consensus_param_updates),beginBlockEvents:Vu(e.begin_block_events||[]),endBlockEvents:Vu(e.end_block_events||[])}}function Js(e){return{hash:(0,re.fromHex)((0,Y.assertNotEmpty)(e.hash)),parts:{total:(0,Y.assertNotEmpty)(e.parts.total),hash:(0,re.fromHex)((0,Y.assertNotEmpty)(e.parts.hash))}}}function _R(e){return{block:(0,oe.apiToSmallInt)(e.block),app:(0,oe.apiToSmallInt)(e.app??0)}}function Hs(e){return{version:_R(e.version),chainId:(0,Y.assertNotEmpty)(e.chain_id),height:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.height)),time:(0,fo.fromRfc3339WithNanoseconds)((0,Y.assertNotEmpty)(e.time)),lastBlockId:e.last_block_id.hash?Js(e.last_block_id):null,lastCommitHash:(0,re.fromHex)((0,Y.assertSet)(e.last_commit_hash)),dataHash:(0,re.fromHex)((0,Y.assertSet)(e.data_hash)),validatorsHash:(0,re.fromHex)((0,Y.assertSet)(e.validators_hash)),nextValidatorsHash:(0,re.fromHex)((0,Y.assertSet)(e.next_validators_hash)),consensusHash:(0,re.fromHex)((0,Y.assertSet)(e.consensus_hash)),appHash:(0,re.fromHex)((0,Y.assertSet)(e.app_hash)),lastResultsHash:(0,re.fromHex)((0,Y.assertSet)(e.last_results_hash)),evidenceHash:(0,re.fromHex)((0,Y.assertSet)(e.evidence_hash)),proposerAddress:(0,re.fromHex)((0,Y.assertNotEmpty)(e.proposer_address))}}function MR(e){return{blockId:Js(e.block_id),blockSize:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.block_size)),header:Hs(e.header),numTxs:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.num_txs))}}function UR(e){return{lastHeight:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.last_height)),blockMetas:(0,Y.assertArray)(e.block_metas).map(MR)}}function DR(e){return{...bi(e),hash:(0,re.fromHex)((0,Y.assertNotEmpty)(e.hash))}}function JR(e){return{height:(0,oe.apiToSmallInt)(e.height),hash:(0,re.fromHex)((0,Y.assertNotEmpty)(e.hash)),checkTx:bi((0,Y.assertObject)(e.check_tx)),deliverTx:(0,Y.may)(bi,e.deliver_tx)}}function HR(e){return(0,nh.assert)(e in RR.BlockIdFlag),e}function qR(e){return{blockIdFlag:HR(e.block_id_flag),validatorAddress:e.validator_address?(0,re.fromHex)(e.validator_address):void 0,timestamp:e.timestamp?(0,fo.fromRfc3339WithNanoseconds)(e.timestamp):void 0,signature:e.signature?(0,re.fromBase64)(e.signature):void 0}}function oh(e){return{blockId:Js((0,Y.assertObject)(e.block_id)),height:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.height)),round:(0,oe.apiToSmallInt)(e.round),signatures:(0,Y.assertArray)(e.signatures).map(qR)}}function VR(e){return{canonical:(0,Y.assertBoolean)(e.canonical),header:Hs(e.signed_header.header),commit:oh(e.signed_header.commit)}}function ah(e){return{address:(0,re.fromHex)((0,Y.assertNotEmpty)(e.address)),pubkey:zc((0,Y.assertObject)(e.pub_key)),votingPower:(0,oe.apiToBigInt)((0,Y.assertNotEmpty)(e.power))}}An.decodeValidatorGenesis=ah;function WR(e){return{genesisTime:(0,fo.fromRfc3339WithNanoseconds)((0,Y.assertNotEmpty)(e.genesis_time)),chainId:(0,Y.assertNotEmpty)(e.chain_id),consensusParams:rh(e.consensus_params),validators:e.validators?(0,Y.assertArray)(e.validators).map(ah):[],appHash:(0,re.fromHex)((0,Y.assertSet)(e.app_hash)),appState:e.app_state}}function Yc(e){return{pubkey:zc((0,Y.assertObject)(e.pub_key)),votingPower:(0,oe.apiToBigInt)((0,Y.assertNotEmpty)(e.voting_power)),address:(0,re.fromHex)((0,Y.assertNotEmpty)(e.address)),proposerPriority:e.proposer_priority?(0,oe.apiToSmallInt)(e.proposer_priority):void 0}}An.decodeValidatorInfo=Yc;function QR(e){return{id:(0,re.fromHex)((0,Y.assertNotEmpty)(e.id)),listenAddr:(0,Y.assertNotEmpty)(e.listen_addr),network:(0,Y.assertNotEmpty)(e.network),version:(0,Y.assertString)(e.version),channels:(0,Y.assertNotEmpty)(e.channels),moniker:(0,Y.assertNotEmpty)(e.moniker),other:(0,Y.dictionaryToStringMap)(e.other),protocolVersion:{app:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.protocol_version.app)),block:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.protocol_version.block)),p2p:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.protocol_version.p2p))}}}function FR(e){const n=e.earliest_block_height?(0,oe.apiToSmallInt)(e.earliest_block_height):void 0,t=e.earliest_block_time?(0,fo.fromRfc3339WithNanoseconds)(e.earliest_block_time):void 0;return{earliestAppHash:e.earliest_app_hash?(0,re.fromHex)(e.earliest_app_hash):void 0,earliestBlockHash:e.earliest_block_hash?(0,re.fromHex)(e.earliest_block_hash):void 0,earliestBlockHeight:n||void 0,earliestBlockTime:t!=null&&t.getTime()?t:void 0,latestBlockHash:(0,re.fromHex)((0,Y.assertNotEmpty)(e.latest_block_hash)),latestAppHash:(0,re.fromHex)((0,Y.assertNotEmpty)(e.latest_app_hash)),latestBlockTime:(0,fo.fromRfc3339WithNanoseconds)((0,Y.assertNotEmpty)(e.latest_block_time)),latestBlockHeight:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.latest_block_height)),catchingUp:(0,Y.assertBoolean)(e.catching_up)}}function GR(e){return{nodeInfo:QR(e.node_info),syncInfo:FR(e.sync_info),validatorInfo:Yc(e.validator_info)}}function LR(e){return{data:(0,re.fromBase64)((0,Y.assertNotEmpty)(e.data)),rootHash:(0,re.fromHex)((0,Y.assertNotEmpty)(e.root_hash)),proof:{total:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.proof.total)),index:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.proof.index)),leafHash:(0,re.fromBase64)((0,Y.assertNotEmpty)(e.proof.leaf_hash)),aunts:(0,Y.assertArray)(e.proof.aunts).map(re.fromBase64)}}}function sh(e){return{tx:(0,re.fromBase64)((0,Y.assertNotEmpty)(e.tx)),result:bi((0,Y.assertObject)(e.tx_result)),height:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.height)),index:(0,oe.apiToSmallInt)((0,Y.assertNumber)(e.index)),hash:(0,re.fromHex)((0,Y.assertNotEmpty)(e.hash)),proof:(0,Y.may)(LR,e.proof)}}function $R(e){return{totalCount:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.total_count)),txs:(0,Y.assertArray)(e.txs).map(sh)}}function KR(e){const n=(0,re.fromBase64)((0,Y.assertNotEmpty)(e.tx));return{tx:n,hash:(0,BR.hashTx)(n),result:bi(e.result),height:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.height))}}function xR(e){return{blockHeight:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.block_height)),validators:(0,Y.assertArray)(e.validators).map(Yc),count:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.count)),total:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.total))}}function dh(e){var n;return{header:Hs((0,Y.assertObject)(e.header)),lastCommit:e.last_commit.block_id.hash?oh((0,Y.assertObject)(e.last_commit)):null,txs:e.data.txs?(0,Y.assertArray)(e.data.txs).map(re.fromBase64):[],evidence:((n=e.evidence)==null?void 0:n.evidence)??[]}}function uh(e){return{blockId:Js(e.block_id),block:dh(e.block)}}function zR(e){return{totalCount:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.total_count)),blocks:(0,Y.assertArray)(e.blocks).map(uh)}}function YR(e){return{total:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.total)),totalBytes:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.total_bytes))}}let ZR=class ch{static decodeAbciInfo(n){return bR((0,Y.assertObject)(n.result.response))}static decodeAbciQuery(n){return IR((0,Y.assertObject)(n.result.response))}static decodeBlock(n){return uh(n.result)}static decodeBlockResults(n){return wR(n.result)}static decodeBlockSearch(n){return zR(n.result)}static decodeBlockchain(n){return UR(n.result)}static decodeBroadcastTxSync(n){return DR(n.result)}static decodeBroadcastTxAsync(n){return ch.decodeBroadcastTxSync(n)}static decodeBroadcastTxCommit(n){return JR(n.result)}static decodeCommit(n){return VR(n.result)}static decodeGenesis(n){return WR((0,Y.assertObject)(n.result.genesis))}static decodeHealth(){return null}static decodeNumUnconfirmedTxs(n){return YR(n.result)}static decodeStatus(n){return GR(n.result)}static decodeNewBlockEvent(n){return dh(n.data.value.block)}static decodeNewBlockHeaderEvent(n){return Hs(n.data.value.header)}static decodeTxEvent(n){return KR(n.data.value.TxResult)}static decodeTx(n){return sh(n.result)}static decodeTxSearch(n){return $R(n.result)}static decodeValidators(n){return xR(n.result)}};An.Responses=ZR;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Responses=e.Params=void 0;var n=Ds;Object.defineProperty(e,"Params",{enumerable:!0,get:function(){return n.Params}});var t=An;Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return t.Responses}})})(eh);var XR=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,o)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),jR=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),eB=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&XR(n,e,t);return jR(n,e),n};Object.defineProperty(Us,"__esModule",{value:!0});Us.Tendermint34Client=void 0;const nB=Pt,ra=_o,le=eh,Pe=eB(Ms);class ba{static async connect(n){let t;return typeof n=="object"?t=new ra.HttpClient(n):t=n.startsWith("http://")||n.startsWith("https://")?new ra.HttpClient(n):new ra.WebsocketClient(n),await this.detectVersion(t),ba.create(t)}static async create(n){return new ba(n)}static async detectVersion(n){const t=(0,nB.createJsonRpcRequest)(Pe.Method.Status),o=(await n.execute(t)).result;if(!o||!o.node_info)throw new Error("Unrecognized format for status response");const g=o.node_info.version;if(typeof g!="string")throw new Error("Unrecognized version format: must be string");return g}constructor(n){this.client=n}disconnect(){this.client.disconnect()}async abciInfo(){const n={method:Pe.Method.AbciInfo};return this.doCall(n,le.Params.encodeAbciInfo,le.Responses.decodeAbciInfo)}async abciQuery(n){const t={params:n,method:Pe.Method.AbciQuery};return this.doCall(t,le.Params.encodeAbciQuery,le.Responses.decodeAbciQuery)}async block(n){const t={method:Pe.Method.Block,params:{height:n}};return this.doCall(t,le.Params.encodeBlock,le.Responses.decodeBlock)}async blockResults(n){const t={method:Pe.Method.BlockResults,params:{height:n}};return this.doCall(t,le.Params.encodeBlockResults,le.Responses.decodeBlockResults)}async blockSearch(n){const t={params:n,method:Pe.Method.BlockSearch},i=await this.doCall(t,le.Params.encodeBlockSearch,le.Responses.decodeBlockSearch);return{...i,blocks:[...i.blocks].sort((o,g)=>o.block.header.height-g.block.header.height)}}async blockSearchAll(n){let t=n.page||1;const i=[];let o=!1;for(;!o;){const g=await this.blockSearch({...n,page:t});i.push(...g.blocks),i.length<g.totalCount?t++:o=!0}return i.sort((g,C)=>g.block.header.height-C.block.header.height),{totalCount:i.length,blocks:i}}async blockchain(n,t){const i={method:Pe.Method.Blockchain,params:{minHeight:n,maxHeight:t}};return this.doCall(i,le.Params.encodeBlockchain,le.Responses.decodeBlockchain)}async broadcastTxSync(n){const t={params:n,method:Pe.Method.BroadcastTxSync};return this.doCall(t,le.Params.encodeBroadcastTx,le.Responses.decodeBroadcastTxSync)}async broadcastTxAsync(n){const t={params:n,method:Pe.Method.BroadcastTxAsync};return this.doCall(t,le.Params.encodeBroadcastTx,le.Responses.decodeBroadcastTxAsync)}async broadcastTxCommit(n){const t={params:n,method:Pe.Method.BroadcastTxCommit};return this.doCall(t,le.Params.encodeBroadcastTx,le.Responses.decodeBroadcastTxCommit)}async commit(n){const t={method:Pe.Method.Commit,params:{height:n}};return this.doCall(t,le.Params.encodeCommit,le.Responses.decodeCommit)}async genesis(){const n={method:Pe.Method.Genesis};return this.doCall(n,le.Params.encodeGenesis,le.Responses.decodeGenesis)}async health(){const n={method:Pe.Method.Health};return this.doCall(n,le.Params.encodeHealth,le.Responses.decodeHealth)}async numUnconfirmedTxs(){const n={method:Pe.Method.NumUnconfirmedTxs};return this.doCall(n,le.Params.encodeNumUnconfirmedTxs,le.Responses.decodeNumUnconfirmedTxs)}async status(){const n={method:Pe.Method.Status};return this.doCall(n,le.Params.encodeStatus,le.Responses.decodeStatus)}subscribeNewBlock(){const n={method:Pe.Method.Subscribe,query:{type:Pe.SubscriptionEventType.NewBlock}};return this.subscribe(n,le.Responses.decodeNewBlockEvent)}subscribeNewBlockHeader(){const n={method:Pe.Method.Subscribe,query:{type:Pe.SubscriptionEventType.NewBlockHeader}};return this.subscribe(n,le.Responses.decodeNewBlockHeaderEvent)}subscribeTx(n){const t={method:Pe.Method.Subscribe,query:{type:Pe.SubscriptionEventType.Tx,raw:n}};return this.subscribe(t,le.Responses.decodeTxEvent)}async tx(n){const t={params:n,method:Pe.Method.Tx};return this.doCall(t,le.Params.encodeTx,le.Responses.decodeTx)}async txSearch(n){const t={params:n,method:Pe.Method.TxSearch};return this.doCall(t,le.Params.encodeTxSearch,le.Responses.decodeTxSearch)}async txSearchAll(n){let t=n.page||1;const i=[];let o=!1;for(;!o;){const g=await this.txSearch({...n,page:t});i.push(...g.txs),i.length<g.totalCount?t++:o=!0}return{totalCount:i.length,txs:i}}async validators(n){const t={method:Pe.Method.Validators,params:n};return this.doCall(t,le.Params.encodeValidators,le.Responses.decodeValidators)}async validatorsAll(n){const t=[];let i=1,o=!1,g=n;for(;!o;){const C=await this.validators({per_page:50,height:g,page:i});t.push(...C.validators),g=g||C.blockHeight,t.length<C.total?i++:o=!0}return{blockHeight:g??0,count:t.length,total:t.length,validators:t}}async doCall(n,t,i){const o=t(n),g=await this.client.execute(o);return i(g)}subscribe(n,t){if(!(0,ra.instanceOfRpcStreamingClient)(this.client))throw new Error("This RPC client type cannot subscribe to events");const i=le.Params.encodeSubscribe(n);return this.client.listen(i).map(g=>t(g))}}Us.Tendermint34Client=ba;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Tendermint34Client=e.VoteType=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.SubscriptionEventType=e.Method=void 0;var n=Ms;Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return n.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return n.SubscriptionEventType}});var t=jm;Object.defineProperty(e,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return t.broadcastTxCommitSuccess}}),Object.defineProperty(e,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return t.broadcastTxSyncSuccess}}),Object.defineProperty(e,"VoteType",{enumerable:!0,get:function(){return t.VoteType}});var i=Us;Object.defineProperty(e,"Tendermint34Client",{enumerable:!0,get:function(){return i.Tendermint34Client}})})(no);var Ea={},qs={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buildQuery=e.SubscriptionEventType=e.Method=void 0,function(t){t.AbciInfo="abci_info",t.AbciQuery="abci_query",t.Block="block",t.Blockchain="blockchain",t.BlockResults="block_results",t.BlockSearch="block_search",t.BroadcastTxAsync="broadcast_tx_async",t.BroadcastTxSync="broadcast_tx_sync",t.BroadcastTxCommit="broadcast_tx_commit",t.Commit="commit",t.Genesis="genesis",t.Health="health",t.NumUnconfirmedTxs="num_unconfirmed_txs",t.Status="status",t.Subscribe="subscribe",t.Tx="tx",t.TxSearch="tx_search",t.Validators="validators",t.Unsubscribe="unsubscribe"}(e.Method||(e.Method={})),function(t){t.NewBlock="NewBlock",t.NewBlockHeader="NewBlockHeader",t.Tx="Tx"}(e.SubscriptionEventType||(e.SubscriptionEventType={}));function n(t){const o=(t.tags?t.tags:[]).map(C=>`${C.key}='${C.value}'`),g=t.raw?[t.raw]:[];return[...o,...g].join(" AND ")}e.buildQuery=n})(qs);var lh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VoteType=e.broadcastTxCommitSuccess=e.broadcastTxSyncSuccess=void 0;function n(i){return i.code===0}e.broadcastTxSyncSuccess=n;function t(i){return i.checkTx.code===0&&!!i.deliverTx&&i.deliverTx.code===0}e.broadcastTxCommitSuccess=t,function(i){i[i.PreVote=1]="PreVote",i[i.PreCommit=2]="PreCommit"}(e.VoteType||(e.VoteType={}))})(lh);var Vs={},fh={},Ws={},he={};Object.defineProperty(he,"__esModule",{value:!0});he.encodeBlockId=he.encodeVersion=he.encodeBytes=he.encodeTime=he.encodeUvarint=he.encodeString=he.dictionaryToStringMap=he.may=he.assertNotEmpty=he.assertObject=he.assertArray=he.assertNumber=he.assertString=he.assertBoolean=he.assertSet=void 0;const tB=ue;function yr(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}he.assertSet=yr;function rB(e){if(yr(e),typeof e!="boolean")throw new Error("Value must be a boolean");return e}he.assertBoolean=rB;function iB(e){if(yr(e),typeof e!="string")throw new Error("Value must be a string");return e}he.assertString=iB;function oB(e){if(yr(e),typeof e!="number")throw new Error("Value must be a number");return e}he.assertNumber=oB;function aB(e){if(yr(e),!Array.isArray(e))throw new Error("Value must be a an array");return e}he.assertArray=aB;function sB(e){if(yr(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}he.assertObject=sB;function dB(e){if(yr(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}he.assertNotEmpty=dB;function uB(e,n){return n==null?void 0:e(n)}he.may=uB;function cB(e){const n=new Map;for(const t of Object.keys(e)){const i=e[t];if(typeof i!="string")throw new Error("Found dictionary value of type other than string");n.set(t,i)}return n}he.dictionaryToStringMap=cB;function lB(e){const n=(0,tB.toUtf8)(e);return Uint8Array.from([n.length,...n])}he.encodeString=lB;function Ei(e){return e>=128?Uint8Array.from([e&255|128,...Ei(e>>7)]):Uint8Array.from([e&255])}he.encodeUvarint=Ei;function fB(e){const n=e.getTime(),t=Math.floor(n/1e3),i=t?[8,...Ei(t)]:new Uint8Array,o=(e.nanoseconds||0)+n%1e3*1e6,g=o?[16,...Ei(o)]:new Uint8Array;return Uint8Array.from([...i,...g])}he.encodeTime=fB;function pB(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}he.encodeBytes=pB;function mB(e){const n=e.block?Uint8Array.from([8,...Ei(e.block)]):new Uint8Array,t=e.app?Uint8Array.from([16,...Ei(e.app)]):new Uint8Array;return Uint8Array.from([...n,...t])}he.encodeVersion=mB;function hB(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])}he.encodeBlockId=hB;var gB=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,o)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),yB=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),SB=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&gB(n,e,t);return yB(n,e),n};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.Params=void 0;const Zc=ue,$n=gn,Fe=Pt,un=he,kB=SB(qs);function pu(e){return{height:(0,un.may)($n.smallIntToApi,e.height)}}function PB(e){return{minHeight:(0,un.may)($n.smallIntToApi,e.minHeight),maxHeight:(0,un.may)($n.smallIntToApi,e.maxHeight)}}function vB(e){return{query:e.query,page:(0,un.may)($n.smallIntToApi,e.page),per_page:(0,un.may)($n.smallIntToApi,e.per_page),order_by:e.order_by}}function CB(e){return{path:(0,un.assertNotEmpty)(e.path),data:(0,Zc.toHex)(e.data),height:(0,un.may)($n.smallIntToApi,e.height),prove:e.prove}}function RB(e){return{tx:(0,Zc.toBase64)((0,un.assertNotEmpty)(e.tx))}}function BB(e){return{hash:(0,Zc.toBase64)((0,un.assertNotEmpty)(e.hash)),prove:e.prove}}function bB(e){return{query:e.query,prove:e.prove,page:(0,un.may)($n.smallIntToApi,e.page),per_page:(0,un.may)($n.smallIntToApi,e.per_page),order_by:e.order_by}}function EB(e){return{height:(0,un.may)($n.smallIntToApi,e.height),page:(0,un.may)($n.smallIntToApi,e.page),per_page:(0,un.may)($n.smallIntToApi,e.per_page)}}class IB{static encodeAbciInfo(n){return(0,Fe.createJsonRpcRequest)(n.method)}static encodeAbciQuery(n){return(0,Fe.createJsonRpcRequest)(n.method,CB(n.params))}static encodeBlock(n){return(0,Fe.createJsonRpcRequest)(n.method,pu(n.params))}static encodeBlockchain(n){return(0,Fe.createJsonRpcRequest)(n.method,PB(n.params))}static encodeBlockResults(n){return(0,Fe.createJsonRpcRequest)(n.method,pu(n.params))}static encodeBlockSearch(n){return(0,Fe.createJsonRpcRequest)(n.method,vB(n.params))}static encodeBroadcastTx(n){return(0,Fe.createJsonRpcRequest)(n.method,RB(n.params))}static encodeCommit(n){return(0,Fe.createJsonRpcRequest)(n.method,pu(n.params))}static encodeGenesis(n){return(0,Fe.createJsonRpcRequest)(n.method)}static encodeHealth(n){return(0,Fe.createJsonRpcRequest)(n.method)}static encodeNumUnconfirmedTxs(n){return(0,Fe.createJsonRpcRequest)(n.method)}static encodeStatus(n){return(0,Fe.createJsonRpcRequest)(n.method)}static encodeSubscribe(n){const t={key:"tm.event",value:n.query.type},i=kB.buildQuery({tags:[t],raw:n.query.raw});return(0,Fe.createJsonRpcRequest)("subscribe",{query:i})}static encodeTx(n){return(0,Fe.createJsonRpcRequest)(n.method,BB(n.params))}static encodeTxSearch(n){return(0,Fe.createJsonRpcRequest)(n.method,bB(n.params))}static encodeValidators(n){return(0,Fe.createJsonRpcRequest)(n.method,EB(n.params))}}Ws.Params=IB;var Tn={},Ii={};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.hashBlock=Ii.hashTx=void 0;const Xc=$e,je=he;function OB(e){return(0,Xc.sha256)(e)}Ii.hashTx=OB;function AB(e){if(e<1)throw new Error("Cannot split an empty tree");const n=2**Math.floor(Math.log2(e));return n<e?n:n/2}function TB(e){const n=new Xc.Sha256(Uint8Array.from([0]));return n.update(e),n.digest()}function NB(e,n){const t=new Xc.Sha256(Uint8Array.from([1]));return t.update(e),t.update(n),t.digest()}function Wu(e){switch(e.length){case 0:throw new Error("Cannot hash empty tree");case 1:return TB(e[0]);default:{const n=AB(e.length),t=Wu(e.slice(0,n)),i=Wu(e.slice(n));return NB(t,i)}}}function wB(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 n=[(0,je.encodeVersion)(e.version),(0,je.encodeString)(e.chainId),(0,je.encodeUvarint)(e.height),(0,je.encodeTime)(e.time),(0,je.encodeBlockId)(e.lastBlockId),(0,je.encodeBytes)(e.lastCommitHash),(0,je.encodeBytes)(e.dataHash),(0,je.encodeBytes)(e.validatorsHash),(0,je.encodeBytes)(e.nextValidatorsHash),(0,je.encodeBytes)(e.consensusHash),(0,je.encodeBytes)(e.appHash),(0,je.encodeBytes)(e.lastResultsHash),(0,je.encodeBytes)(e.evidenceHash),(0,je.encodeBytes)(e.proposerAddress)];return Wu(n)}Ii.hashBlock=wB;Object.defineProperty(Tn,"__esModule",{value:!0});Tn.Responses=Tn.decodeValidatorInfo=Tn.decodeValidatorGenesis=Tn.decodeValidatorUpdate=Tn.decodeEvent=void 0;const de=ue,ph=Ie,po=xe,ae=gn,_B=Jo,Z=he,MB=Ii;function UB(e){return{data:e.data,lastBlockHeight:(0,Z.may)(ae.apiToSmallInt,e.last_block_height),lastBlockAppHash:(0,Z.may)(de.fromBase64,e.last_block_app_hash)}}function DB(e){return{ops:e.ops.map(n=>({type:n.type,key:(0,de.fromBase64)(n.key),data:(0,de.fromBase64)(n.data)}))}}function JB(e){return{key:(0,de.fromBase64)((0,Z.assertString)(e.key??"")),value:(0,de.fromBase64)((0,Z.assertString)(e.value??"")),proof:(0,Z.may)(DB,e.proofOps),height:(0,Z.may)(ae.apiToSmallInt,e.height),code:(0,Z.may)(ae.apiToSmallInt,e.code),codespace:(0,Z.assertString)(e.codespace??""),index:(0,Z.may)(ae.apiToSmallInt,e.index),log:e.log,info:(0,Z.assertString)(e.info??"")}}function HB(e){return{key:(0,Z.assertNotEmpty)(e.key),value:e.value??""}}function qB(e){return(0,Z.assertArray)(e).map(HB)}function mh(e){return{type:e.type,attributes:e.attributes?qB(e.attributes):[]}}Tn.decodeEvent=mh;function Qu(e){return(0,Z.assertArray)(e).map(mh)}function Oi(e){return{code:(0,ae.apiToSmallInt)((0,Z.assertNumber)(e.code??0)),codespace:e.codespace,log:e.log,data:(0,Z.may)(de.fromBase64,e.data),events:e.events?Qu(e.events):[],gasWanted:(0,ae.apiToBigInt)(e.gas_wanted??"0"),gasUsed:(0,ae.apiToBigInt)(e.gas_used??"0")}}function jc(e){if("Sum"in e){const[[n,t]]=Object.entries(e.Sum.value);return(0,ph.assert)(n==="ed25519"||n==="secp256k1",`unknown pubkey type: ${n}`),{algorithm:n,data:(0,de.fromBase64)((0,Z.assertNotEmpty)(t))}}else switch(e.type){case"tendermint/PubKeyEd25519":return{algorithm:"ed25519",data:(0,de.fromBase64)((0,Z.assertNotEmpty)(e.value))};case"tendermint/PubKeySecp256k1":return{algorithm:"secp256k1",data:(0,de.fromBase64)((0,Z.assertNotEmpty)(e.value))};default:throw new Error(`unknown pubkey type: ${e.type}`)}}function VB(e){return{maxBytes:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.max_bytes)),maxGas:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.max_gas))}}function WB(e){return{maxAgeNumBlocks:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.max_age_num_blocks)),maxAgeDuration:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.max_age_duration))}}function hh(e){return{block:VB((0,Z.assertObject)(e.block)),evidence:WB((0,Z.assertObject)(e.evidence))}}function gh(e){return{pubkey:jc((0,Z.assertObject)(e.pub_key)),votingPower:(0,ae.apiToBigInt)(e.power??"0")}}Tn.decodeValidatorUpdate=gh;function QB(e){return{height:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.height)),results:(e.txs_results||[]).map(Oi),validatorUpdates:(e.validator_updates||[]).map(gh),consensusUpdates:(0,Z.may)(hh,e.consensus_param_updates),beginBlockEvents:Qu(e.begin_block_events||[]),endBlockEvents:Qu(e.end_block_events||[])}}function Qs(e){return{hash:(0,de.fromHex)((0,Z.assertNotEmpty)(e.hash)),parts:{total:(0,Z.assertNotEmpty)(e.parts.total),hash:(0,de.fromHex)((0,Z.assertNotEmpty)(e.parts.hash))}}}function FB(e){return{block:(0,ae.apiToSmallInt)(e.block),app:(0,ae.apiToSmallInt)(e.app??0)}}function Fs(e){return{version:FB(e.version),chainId:(0,Z.assertNotEmpty)(e.chain_id),height:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.height)),time:(0,po.fromRfc3339WithNanoseconds)((0,Z.assertNotEmpty)(e.time)),lastBlockId:e.last_block_id.hash?Qs(e.last_block_id):null,lastCommitHash:(0,de.fromHex)((0,Z.assertSet)(e.last_commit_hash)),dataHash:(0,de.fromHex)((0,Z.assertSet)(e.data_hash)),validatorsHash:(0,de.fromHex)((0,Z.assertSet)(e.validators_hash)),nextValidatorsHash:(0,de.fromHex)((0,Z.assertSet)(e.next_validators_hash)),consensusHash:(0,de.fromHex)((0,Z.assertSet)(e.consensus_hash)),appHash:(0,de.fromHex)((0,Z.assertSet)(e.app_hash)),lastResultsHash:(0,de.fromHex)((0,Z.assertSet)(e.last_results_hash)),evidenceHash:(0,de.fromHex)((0,Z.assertSet)(e.evidence_hash)),proposerAddress:(0,de.fromHex)((0,Z.assertNotEmpty)(e.proposer_address))}}function GB(e){return{blockId:Qs(e.block_id),blockSize:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.block_size)),header:Fs(e.header),numTxs:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.num_txs))}}function LB(e){return{lastHeight:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.last_height)),blockMetas:(0,Z.assertArray)(e.block_metas).map(GB)}}function $B(e){return{...Oi(e),hash:(0,de.fromHex)((0,Z.assertNotEmpty)(e.hash))}}function KB(e){return{height:(0,ae.apiToSmallInt)(e.height),hash:(0,de.fromHex)((0,Z.assertNotEmpty)(e.hash)),checkTx:Oi((0,Z.assertObject)(e.check_tx)),deliverTx:(0,Z.may)(Oi,e.deliver_tx)}}function xB(e){return(0,ph.assert)(e in _B.BlockIdFlag),e}function zB(e){return{blockIdFlag:xB(e.block_id_flag),validatorAddress:e.validator_address?(0,de.fromHex)(e.validator_address):void 0,timestamp:e.timestamp?(0,po.fromRfc3339WithNanoseconds)(e.timestamp):void 0,signature:e.signature?(0,de.fromBase64)(e.signature):void 0}}function yh(e){return{blockId:Qs((0,Z.assertObject)(e.block_id)),height:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.height)),round:(0,ae.apiToSmallInt)(e.round),signatures:(0,Z.assertArray)(e.signatures).map(zB)}}function YB(e){return{canonical:(0,Z.assertBoolean)(e.canonical),header:Fs(e.signed_header.header),commit:yh(e.signed_header.commit)}}function Sh(e){return{address:(0,de.fromHex)((0,Z.assertNotEmpty)(e.address)),pubkey:jc((0,Z.assertObject)(e.pub_key)),votingPower:(0,ae.apiToBigInt)((0,Z.assertNotEmpty)(e.power))}}Tn.decodeValidatorGenesis=Sh;function ZB(e){return{genesisTime:(0,po.fromRfc3339WithNanoseconds)((0,Z.assertNotEmpty)(e.genesis_time)),chainId:(0,Z.assertNotEmpty)(e.chain_id),consensusParams:hh(e.consensus_params),validators:e.validators?(0,Z.assertArray)(e.validators).map(Sh):[],appHash:(0,de.fromHex)((0,Z.assertSet)(e.app_hash)),appState:e.app_state}}function el(e){return{pubkey:jc((0,Z.assertObject)(e.pub_key)),votingPower:(0,ae.apiToBigInt)((0,Z.assertNotEmpty)(e.voting_power)),address:(0,de.fromHex)((0,Z.assertNotEmpty)(e.address)),proposerPriority:e.proposer_priority?(0,ae.apiToSmallInt)(e.proposer_priority):void 0}}Tn.decodeValidatorInfo=el;function XB(e){return{id:(0,de.fromHex)((0,Z.assertNotEmpty)(e.id)),listenAddr:(0,Z.assertNotEmpty)(e.listen_addr),network:(0,Z.assertNotEmpty)(e.network),version:(0,Z.assertString)(e.version),channels:(0,Z.assertString)(e.channels),moniker:(0,Z.assertNotEmpty)(e.moniker),other:(0,Z.dictionaryToStringMap)(e.other),protocolVersion:{app:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.protocol_version.app)),block:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.protocol_version.block)),p2p:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.protocol_version.p2p))}}}function jB(e){const n=e.earliest_block_height?(0,ae.apiToSmallInt)(e.earliest_block_height):void 0,t=e.earliest_block_time?(0,po.fromRfc3339WithNanoseconds)(e.earliest_block_time):void 0;return{earliestAppHash:e.earliest_app_hash?(0,de.fromHex)(e.earliest_app_hash):void 0,earliestBlockHash:e.earliest_block_hash?(0,de.fromHex)(e.earliest_block_hash):void 0,earliestBlockHeight:n||void 0,earliestBlockTime:t!=null&&t.getTime()?t:void 0,latestBlockHash:(0,de.fromHex)((0,Z.assertNotEmpty)(e.latest_block_hash)),latestAppHash:(0,de.fromHex)((0,Z.assertNotEmpty)(e.latest_app_hash)),latestBlockTime:(0,po.fromRfc3339WithNanoseconds)((0,Z.assertNotEmpty)(e.latest_block_time)),latestBlockHeight:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.latest_block_height)),catchingUp:(0,Z.assertBoolean)(e.catching_up)}}function eb(e){return{nodeInfo:XB(e.node_info),syncInfo:jB(e.sync_info),validatorInfo:el(e.validator_info)}}function nb(e){return{data:(0,de.fromBase64)((0,Z.assertNotEmpty)(e.data)),rootHash:(0,de.fromHex)((0,Z.assertNotEmpty)(e.root_hash)),proof:{total:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.proof.total)),index:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.proof.index)),leafHash:(0,de.fromBase64)((0,Z.assertNotEmpty)(e.proof.leaf_hash)),aunts:(0,Z.assertArray)(e.proof.aunts).map(de.fromBase64)}}}function kh(e){return{tx:(0,de.fromBase64)((0,Z.assertNotEmpty)(e.tx)),result:Oi((0,Z.assertObject)(e.tx_result)),height:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.height)),index:(0,ae.apiToSmallInt)((0,Z.assertNumber)(e.index)),hash:(0,de.fromHex)((0,Z.assertNotEmpty)(e.hash)),proof:(0,Z.may)(nb,e.proof)}}function tb(e){return{totalCount:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.total_count)),txs:(0,Z.assertArray)(e.txs).map(kh)}}function rb(e){const n=(0,de.fromBase64)((0,Z.assertNotEmpty)(e.tx));return{tx:n,hash:(0,MB.hashTx)(n),result:Oi(e.result),height:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.height))}}function ib(e){return{blockHeight:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.block_height)),validators:(0,Z.assertArray)(e.validators).map(el),count:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.count)),total:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.total))}}function Ph(e){var n;return{header:Fs((0,Z.assertObject)(e.header)),lastCommit:e.last_commit.block_id.hash?yh((0,Z.assertObject)(e.last_commit)):null,txs:e.data.txs?(0,Z.assertArray)(e.data.txs).map(de.fromBase64):[],evidence:((n=e.evidence)==null?void 0:n.evidence)??[]}}function vh(e){return{blockId:Qs(e.block_id),block:Ph(e.block)}}function ob(e){return{totalCount:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.total_count)),blocks:(0,Z.assertArray)(e.blocks).map(vh)}}function ab(e){return{total:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.total)),totalBytes:(0,ae.apiToSmallInt)((0,Z.assertNotEmpty)(e.total_bytes))}}class nl{static decodeAbciInfo(n){return UB((0,Z.assertObject)(n.result.response))}static decodeAbciQuery(n){return JB((0,Z.assertObject)(n.result.response))}static decodeBlock(n){return vh(n.result)}static decodeBlockResults(n){return QB(n.result)}static decodeBlockSearch(n){return ob(n.result)}static decodeBlockchain(n){return LB(n.result)}static decodeBroadcastTxSync(n){return $B(n.result)}static decodeBroadcastTxAsync(n){return nl.decodeBroadcastTxSync(n)}static decodeBroadcastTxCommit(n){return KB(n.result)}static decodeCommit(n){return YB(n.result)}static decodeGenesis(n){return ZB((0,Z.assertObject)(n.result.genesis))}static decodeHealth(){return null}static decodeNumUnconfirmedTxs(n){return ab(n.result)}static decodeStatus(n){return eb(n.result)}static decodeNewBlockEvent(n){return Ph(n.data.value.block)}static decodeNewBlockHeaderEvent(n){return Fs(n.data.value.header)}static decodeTxEvent(n){return rb(n.data.value.TxResult)}static decodeTx(n){return kh(n.result)}static decodeTxSearch(n){return tb(n.result)}static decodeValidators(n){return ib(n.result)}}Tn.Responses=nl;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Responses=e.Params=void 0;var n=Ws;Object.defineProperty(e,"Params",{enumerable:!0,get:function(){return n.Params}});var t=Tn;Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return t.Responses}})})(fh);var sb=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,o)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),db=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),ub=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&sb(n,e,t);return db(n,e),n};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.Tendermint37Client=void 0;const cb=Pt,ia=_o,fe=fh,ve=ub(qs);class Ia{static async connect(n){let t;return typeof n=="object"?t=new ia.HttpClient(n):t=n.startsWith("http://")||n.startsWith("https://")?new ia.HttpClient(n):new ia.WebsocketClient(n),await this.detectVersion(t),Ia.create(t)}static async create(n){return new Ia(n)}static async detectVersion(n){const t=(0,cb.createJsonRpcRequest)(ve.Method.Status),o=(await n.execute(t)).result;if(!o||!o.node_info)throw new Error("Unrecognized format for status response");const g=o.node_info.version;if(typeof g!="string")throw new Error("Unrecognized version format: must be string");return g}constructor(n){this.client=n}disconnect(){this.client.disconnect()}async abciInfo(){const n={method:ve.Method.AbciInfo};return this.doCall(n,fe.Params.encodeAbciInfo,fe.Responses.decodeAbciInfo)}async abciQuery(n){const t={params:n,method:ve.Method.AbciQuery};return this.doCall(t,fe.Params.encodeAbciQuery,fe.Responses.decodeAbciQuery)}async block(n){const t={method:ve.Method.Block,params:{height:n}};return this.doCall(t,fe.Params.encodeBlock,fe.Responses.decodeBlock)}async blockResults(n){const t={method:ve.Method.BlockResults,params:{height:n}};return this.doCall(t,fe.Params.encodeBlockResults,fe.Responses.decodeBlockResults)}async blockSearch(n){const t={params:n,method:ve.Method.BlockSearch},i=await this.doCall(t,fe.Params.encodeBlockSearch,fe.Responses.decodeBlockSearch);return{...i,blocks:[...i.blocks].sort((o,g)=>o.block.header.height-g.block.header.height)}}async blockSearchAll(n){let t=n.page||1;const i=[];let o=!1;for(;!o;){const g=await this.blockSearch({...n,page:t});i.push(...g.blocks),i.length<g.totalCount?t++:o=!0}return i.sort((g,C)=>g.block.header.height-C.block.header.height),{totalCount:i.length,blocks:i}}async blockchain(n,t){const i={method:ve.Method.Blockchain,params:{minHeight:n,maxHeight:t}};return this.doCall(i,fe.Params.encodeBlockchain,fe.Responses.decodeBlockchain)}async broadcastTxSync(n){const t={params:n,method:ve.Method.BroadcastTxSync};return this.doCall(t,fe.Params.encodeBroadcastTx,fe.Responses.decodeBroadcastTxSync)}async broadcastTxAsync(n){const t={params:n,method:ve.Method.BroadcastTxAsync};return this.doCall(t,fe.Params.encodeBroadcastTx,fe.Responses.decodeBroadcastTxAsync)}async broadcastTxCommit(n){const t={params:n,method:ve.Method.BroadcastTxCommit};return this.doCall(t,fe.Params.encodeBroadcastTx,fe.Responses.decodeBroadcastTxCommit)}async commit(n){const t={method:ve.Method.Commit,params:{height:n}};return this.doCall(t,fe.Params.encodeCommit,fe.Responses.decodeCommit)}async genesis(){const n={method:ve.Method.Genesis};return this.doCall(n,fe.Params.encodeGenesis,fe.Responses.decodeGenesis)}async health(){const n={method:ve.Method.Health};return this.doCall(n,fe.Params.encodeHealth,fe.Responses.decodeHealth)}async numUnconfirmedTxs(){const n={method:ve.Method.NumUnconfirmedTxs};return this.doCall(n,fe.Params.encodeNumUnconfirmedTxs,fe.Responses.decodeNumUnconfirmedTxs)}async status(){const n={method:ve.Method.Status};return this.doCall(n,fe.Params.encodeStatus,fe.Responses.decodeStatus)}subscribeNewBlock(){const n={method:ve.Method.Subscribe,query:{type:ve.SubscriptionEventType.NewBlock}};return this.subscribe(n,fe.Responses.decodeNewBlockEvent)}subscribeNewBlockHeader(){const n={method:ve.Method.Subscribe,query:{type:ve.SubscriptionEventType.NewBlockHeader}};return this.subscribe(n,fe.Responses.decodeNewBlockHeaderEvent)}subscribeTx(n){const t={method:ve.Method.Subscribe,query:{type:ve.SubscriptionEventType.Tx,raw:n}};return this.subscribe(t,fe.Responses.decodeTxEvent)}async tx(n){const t={params:n,method:ve.Method.Tx};return this.doCall(t,fe.Params.encodeTx,fe.Responses.decodeTx)}async txSearch(n){const t={params:n,method:ve.Method.TxSearch};return this.doCall(t,fe.Params.encodeTxSearch,fe.Responses.decodeTxSearch)}async txSearchAll(n){let t=n.page||1;const i=[];let o=!1;for(;!o;){const g=await this.txSearch({...n,page:t});i.push(...g.txs),i.length<g.totalCount?t++:o=!0}return{totalCount:i.length,txs:i}}async validators(n){const t={method:ve.Method.Validators,params:n};return this.doCall(t,fe.Params.encodeValidators,fe.Responses.decodeValidators)}async validatorsAll(n){const t=[];let i=1,o=!1,g=n;for(;!o;){const C=await this.validators({per_page:50,height:g,page:i});t.push(...C.validators),g=g||C.blockHeight,t.length<C.total?i++:o=!0}return{blockHeight:g??0,count:t.length,total:t.length,validators:t}}async doCall(n,t,i){const o=t(n),g=await this.client.execute(o);return i(g)}subscribe(n,t){if(!(0,ia.instanceOfRpcStreamingClient)(this.client))throw new Error("This RPC client type cannot subscribe to events");const i=fe.Params.encodeSubscribe(n);return this.client.listen(i).map(g=>t(g))}}Vs.Tendermint37Client=Ia;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Tendermint37Client=e.VoteType=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.SubscriptionEventType=e.Method=void 0;var n=qs;Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return n.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return n.SubscriptionEventType}});var t=lh;Object.defineProperty(e,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return t.broadcastTxCommitSuccess}}),Object.defineProperty(e,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return t.broadcastTxSyncSuccess}}),Object.defineProperty(e,"VoteType",{enumerable:!0,get:function(){return t.VoteType}});var i=Vs;Object.defineProperty(e,"Tendermint37Client",{enumerable:!0,get:function(){return i.Tendermint37Client}})})(Ea);var at={};Object.defineProperty(at,"__esModule",{value:!0});at.connectComet=at.isComet38Client=at.isTendermint37Client=at.isTendermint34Client=void 0;const Ch=Ca,Rh=no,Bh=Ea;function lb(e){return e instanceof Rh.Tendermint34Client}at.isTendermint34Client=lb;function fb(e){return e instanceof Bh.Tendermint37Client}at.isTendermint37Client=fb;function pb(e){return e instanceof Ch.Comet38Client}at.isComet38Client=pb;async function mb(e){let n;const t=await Bh.Tendermint37Client.connect(e),i=(await t.status()).nodeInfo.version;return i.startsWith("0.37.")?n=t:i.startsWith("0.38.")?(t.disconnect(),n=await Ch.Comet38Client.connect(e)):(t.disconnect(),n=await Rh.Tendermint34Client.connect(e)),n}at.connectComet=mb;(function(e){var n=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(S,R,u,c){c===void 0&&(c=u);var y=Object.getOwnPropertyDescriptor(R,u);(!y||("get"in y?!R.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return R[u]}}),Object.defineProperty(S,c,y)}:function(S,R,u,c){c===void 0&&(c=u),S[c]=R[u]}),t=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(S,R){Object.defineProperty(S,"default",{enumerable:!0,value:R})}:function(S,R){S.default=R}),i=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(S){if(S&&S.__esModule)return S;var R={};if(S!=null)for(var u in S)u!=="default"&&Object.prototype.hasOwnProperty.call(S,u)&&n(R,S,u);return t(R,S),R};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=ot;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 g=xe;Object.defineProperty(e,"DateTime",{enumerable:!0,get:function(){return g.DateTime}}),Object.defineProperty(e,"fromRfc3339WithNanoseconds",{enumerable:!0,get:function(){return g.fromRfc3339WithNanoseconds}}),Object.defineProperty(e,"fromSeconds",{enumerable:!0,get:function(){return g.fromSeconds}}),Object.defineProperty(e,"toRfc3339WithNanoseconds",{enumerable:!0,get:function(){return g.toRfc3339WithNanoseconds}}),Object.defineProperty(e,"toSeconds",{enumerable:!0,get:function(){return g.toSeconds}}),e.comet38=i(Ca);var C=Ca;Object.defineProperty(e,"Comet38Client",{enumerable:!0,get:function(){return C.Comet38Client}});var w=_o;Object.defineProperty(e,"HttpBatchClient",{enumerable:!0,get:function(){return w.HttpBatchClient}}),Object.defineProperty(e,"HttpClient",{enumerable:!0,get:function(){return w.HttpClient}}),Object.defineProperty(e,"WebsocketClient",{enumerable:!0,get:function(){return w.WebsocketClient}});var E=no;Object.defineProperty(e,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return E.broadcastTxCommitSuccess}}),Object.defineProperty(e,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return E.broadcastTxSyncSuccess}}),Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return E.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return E.SubscriptionEventType}}),Object.defineProperty(e,"VoteType",{enumerable:!0,get:function(){return E.VoteType}}),e.tendermint34=i(no);var D=no;Object.defineProperty(e,"Tendermint34Client",{enumerable:!0,get:function(){return D.Tendermint34Client}}),e.tendermint37=i(Ea);var J=Ea;Object.defineProperty(e,"Tendermint37Client",{enumerable:!0,get:function(){return J.Tendermint37Client}});var b=at;Object.defineProperty(e,"connectComet",{enumerable:!0,get:function(){return b.connectComet}}),Object.defineProperty(e,"isComet38Client",{enumerable:!0,get:function(){return b.isComet38Client}}),Object.defineProperty(e,"isTendermint34Client",{enumerable:!0,get:function(){return b.isTendermint34Client}}),Object.defineProperty(e,"isTendermint37Client",{enumerable:!0,get:function(){return b.isTendermint37Client}});var p=Jo;Object.defineProperty(e,"BlockIdFlag",{enumerable:!0,get:function(){return p.BlockIdFlag}})})(wo);var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.StargateClient=Ve.BroadcastTxError=Ve.assertIsDeliverTxFailure=Ve.assertIsDeliverTxSuccess=Ve.isDeliverTxSuccess=Ve.isDeliverTxFailure=Ve.TimeoutError=void 0;const hb=zn,mu=ue,jl=Ne,ef=wo,nf=Ie,gb=To,yb=yo,Sb=Ro,oa=co,kb=ze,Pb=No;class bh extends Error{constructor(n,t){super(n),this.txId=t}}Ve.TimeoutError=bh;function tl(e){return!!e.code}Ve.isDeliverTxFailure=tl;function Eh(e){return!tl(e)}Ve.isDeliverTxSuccess=Eh;function vb(e){if(tl(e))throw new Error(`Error when broadcasting tx ${e.transactionHash} at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`)}Ve.assertIsDeliverTxSuccess=vb;function Cb(e){if(Eh(e))throw new Error(`Transaction ${e.transactionHash} did not fail at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`)}Ve.assertIsDeliverTxFailure=Cb;class Ih extends Error{constructor(n,t,i){super(`Broadcasting transaction failed with code ${n} (codespace: ${t}). Log: ${i}`),this.code=n,this.codespace=t,this.log=i}}Ve.BroadcastTxError=Ih;class Oa{static async connect(n,t={}){const i=await(0,ef.connectComet)(n);return Oa.create(i,t)}static async create(n,t={}){return new Oa(n,t)}constructor(n,t){n&&(this.cometClient=n,this.queryClient=kb.QueryClient.withExtensions(n,oa.setupAuthExtension,oa.setupBankExtension,oa.setupStakingExtension,oa.setupTxExtension));const{accountParser:i=yb.accountFromAny}=t;this.accountParser=i}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 t=(await this.forceGetCometClient().status()).nodeInfo.network;if(!t)throw new Error("Chain ID must not be empty");this.chainId=t}return this.chainId}async getHeight(){return(await this.forceGetCometClient().status()).syncInfo.latestBlockHeight}async getAccount(n){try{const t=await this.forceGetQueryClient().auth.account(n);return t?this.accountParser(t):null}catch(t){if(/rpc error: code = NotFound/i.test(t.toString()))return null;throw t}}async getSequence(n){const t=await this.getAccount(n);if(!t)throw new Error(`Account '${n}' does not exist on chain. Send some tokens there before trying to query sequence.`);return{accountNumber:t.accountNumber,sequence:t.sequence}}async getBlock(n){const t=await this.forceGetCometClient().block(n);return{id:(0,mu.toHex)(t.blockId.hash).toUpperCase(),header:{version:{block:new jl.Uint53(t.block.header.version.block).toString(),app:new jl.Uint53(t.block.header.version.app).toString()},height:t.block.header.height,chainId:t.block.header.chainId,time:(0,ef.toRfc3339WithNanoseconds)(t.block.header.time)},txs:t.block.txs}}async getBalance(n,t){return this.forceGetQueryClient().bank.balance(n,t)}async getAllBalances(n){return this.forceGetQueryClient().bank.allBalances(n)}async getBalanceStaked(n){const t=[];let i;do{const{delegationResponses:g,pagination:C}=await this.forceGetQueryClient().staking.delegatorDelegations(n,i),w=g||[];t.push(...w),i=C==null?void 0:C.nextKey}while(i!==void 0&&i.length!==0);return t.reduce((g,C)=>((0,nf.assert)(C.balance),g!==null?(0,hb.addCoins)(g,C.balance):C.balance),null)}async getDelegation(n,t){var o;let i;try{i=(o=(await this.forceGetQueryClient().staking.delegation(n,t)).delegationResponse)==null?void 0:o.balance}catch(g){if(!g.toString().includes("key not found"))throw g}return i||null}async getTx(n){return(await this.txsQuery(`tx.hash='${n}'`))[0]??null}async searchTx(n){let t;if(typeof n=="string")t=n;else if((0,Pb.isSearchTxQueryArray)(n))t=n.map(i=>typeof i.value=="string"?`${i.key}='${i.value}'`:`${i.key}=${i.value}`).join(" AND ");else throw new Error("Got unsupported query type. See CosmJS 0.31 CHANGELOG for API breaking changes here.");return this.txsQuery(t)}disconnect(){this.cometClient&&this.cometClient.disconnect()}async broadcastTx(n,t=6e4,i=3e3){let o=!1;const g=setTimeout(()=>{o=!0},t),C=async E=>{if(o)throw new bh(`Transaction with ID ${E} was submitted but was not yet found on the chain. You might want to check later. There was a wait of ${t/1e3} seconds.`,E);await(0,nf.sleep)(i);const D=await this.getTx(E);return D?{code:D.code,height:D.height,txIndex:D.txIndex,events:D.events,rawLog:D.rawLog,transactionHash:E,msgResponses:D.msgResponses,gasUsed:D.gasUsed,gasWanted:D.gasWanted}:C(E)},w=await this.broadcastTxSync(n);return new Promise((E,D)=>C(w).then(J=>{clearTimeout(g),E(J)},J=>{clearTimeout(g),D(J)}))}async broadcastTxSync(n){const t=await this.forceGetCometClient().broadcastTxSync({tx:n});return t.code?Promise.reject(new Ih(t.code,t.codespace??"",t.log)):(0,mu.toHex)(t.hash).toUpperCase()}async txsQuery(n){return(await this.forceGetCometClient().txSearchAll({query:n})).txs.map(i=>{const o=gb.TxMsgData.decode(i.result.data??new Uint8Array);return{height:i.height,txIndex:i.index,hash:(0,mu.toHex)(i.hash).toUpperCase(),code:i.result.code,events:i.result.events.map(Sb.fromTendermintEvent),rawLog:i.result.log||"",tx:i.tx,msgResponses:o.msgResponses,gasUsed:i.result.gasUsed,gasWanted:i.result.gasWanted}})}}Ve.StargateClient=Oa;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SigningStargateClient=e.createDefaultAminoConverters=e.defaultRegistryTypes=void 0;const n=zn,t=ue,i=Ne,o=ut,g=wo,C=Ie,w=_.coin,E=bo,D=Ao,J=_.signing,b=_.tx,p=Io,S=Co,R=cr,u=co,c=co,y=Ve;e.defaultRegistryTypes=[["/cosmos.base.v1beta1.Coin",w.Coin],...u.authzTypes,...u.bankTypes,...u.distributionTypes,...u.feegrantTypes,...u.govTypes,...u.groupTypes,...u.stakingTypes,...u.ibcTypes,...u.vestingTypes];function B(){return{...(0,c.createAuthzAminoConverters)(),...(0,c.createBankAminoConverters)(),...(0,c.createDistributionAminoConverters)(),...(0,c.createGovAminoConverters)(),...(0,c.createStakingAminoConverters)(),...(0,c.createIbcAminoConverters)(),...(0,c.createFeegrantAminoConverters)(),...(0,c.createVestingAminoConverters)()}}e.createDefaultAminoConverters=B;class N extends y.StargateClient{static async connectWithSigner(W,r,s={}){const O=await(0,g.connectComet)(W);return N.createWithSigner(O,r,s)}static async createWithSigner(W,r,s={}){return new N(W,r,s)}static async offline(W,r={}){return new N(void 0,W,r)}constructor(W,r,s){super(W,s),this.defaultGasMultiplier=1.4;const{registry:O=new o.Registry(e.defaultRegistryTypes),aminoTypes:q=new S.AminoTypes(B())}=s;this.registry=O,this.aminoTypes=q,this.signer=r,this.broadcastTimeoutMs=s.broadcastTimeoutMs,this.broadcastPollIntervalMs=s.broadcastPollIntervalMs,this.gasPrice=s.gasPrice}async simulate(W,r,s){const O=r.map(m=>this.registry.encodeAsAny(m)),q=(await this.signer.getAccounts()).find(m=>m.address===W);if(!q)throw new Error("Failed to retrieve account from signer");const d=(0,n.encodeSecp256k1Pubkey)(q.pubkey),{sequence:l}=await this.getSequence(W),{gasInfo:M}=await this.forceGetQueryClient().tx.simulate(O,s,d,l);return(0,C.assertDefined)(M),i.Uint53.fromString(M.gasUsed.toString()).toNumber()}async sendTokens(W,r,s,O,q=""){const d={typeUrl:"/cosmos.bank.v1beta1.MsgSend",value:{fromAddress:W,toAddress:r,amount:[...s]}};return this.signAndBroadcast(W,[d],O,q)}async delegateTokens(W,r,s,O,q=""){const d={typeUrl:"/cosmos.staking.v1beta1.MsgDelegate",value:D.MsgDelegate.fromPartial({delegatorAddress:W,validatorAddress:r,amount:s})};return this.signAndBroadcast(W,[d],O,q)}async undelegateTokens(W,r,s,O,q=""){const d={typeUrl:"/cosmos.staking.v1beta1.MsgUndelegate",value:D.MsgUndelegate.fromPartial({delegatorAddress:W,validatorAddress:r,amount:s})};return this.signAndBroadcast(W,[d],O,q)}async withdrawRewards(W,r,s,O=""){const q={typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",value:E.MsgWithdrawDelegatorReward.fromPartial({delegatorAddress:W,validatorAddress:r})};return this.signAndBroadcast(W,[q],s,O)}async sendIbcTokens(W,r,s,O,q,d,l,M,m=""){const h=l?BigInt(l)*BigInt(1e9):void 0,T={typeUrl:"/ibc.applications.transfer.v1.MsgTransfer",value:p.MsgTransfer.fromPartial({sourcePort:O,sourceChannel:q,sender:W,receiver:r,token:s,timeoutHeight:d,timeoutTimestamp:h})};return this.signAndBroadcast(W,[T],M,m)}async signAndBroadcast(W,r,s,O="",q){let d;if(s=="auto"||typeof s=="number"){(0,C.assertDefined)(this.gasPrice,"Gas price must be set in the client options when auto gas is used.");const m=await this.simulate(W,r,O),h=typeof s=="number"?s:this.defaultGasMultiplier;d=(0,R.calculateFee)(Math.round(m*h),this.gasPrice)}else d=s;const l=await this.sign(W,r,d,O,void 0,q),M=b.TxRaw.encode(l).finish();return this.broadcastTx(M,this.broadcastTimeoutMs,this.broadcastPollIntervalMs)}async signAndBroadcastSync(W,r,s,O="",q){let d;if(s=="auto"||typeof s=="number"){(0,C.assertDefined)(this.gasPrice,"Gas price must be set in the client options when auto gas is used.");const m=await this.simulate(W,r,O),h=typeof s=="number"?s:this.defaultGasMultiplier;d=(0,R.calculateFee)(Math.round(m*h),this.gasPrice)}else d=s;const l=await this.sign(W,r,d,O,void 0,q),M=b.TxRaw.encode(l).finish();return this.broadcastTxSync(M)}async sign(W,r,s,O,q,d){let l;if(q)l=q;else{const{accountNumber:M,sequence:m}=await this.getSequence(W),h=await this.getChainId();l={accountNumber:M,sequence:m,chainId:h}}return(0,o.isOfflineDirectSigner)(this.signer)?this.signDirect(W,r,s,O,l,d):this.signAmino(W,r,s,O,l,d)}async signAmino(W,r,s,O,{accountNumber:q,sequence:d,chainId:l},M){(0,C.assert)(!(0,o.isOfflineDirectSigner)(this.signer));const m=(await this.signer.getAccounts()).find(j=>j.address===W);if(!m)throw new Error("Failed to retrieve account from signer");const h=(0,o.encodePubkey)((0,n.encodeSecp256k1Pubkey)(m.pubkey)),T=J.SignMode.SIGN_MODE_LEGACY_AMINO_JSON,Q=r.map(j=>this.aminoTypes.toAmino(j)),H=(0,n.makeSignDoc)(Q,s,l,O,q,d,M),{signature:a,signed:P}=await this.signer.signAmino(W,H),v={typeUrl:"/cosmos.tx.v1beta1.TxBody",value:{messages:P.msgs.map(j=>this.aminoTypes.fromAmino(j)),memo:P.memo,timeoutHeight:M}},A=this.registry.encode(v),F=i.Int53.fromString(P.fee.gas).toNumber(),K=i.Int53.fromString(P.sequence).toNumber(),$=(0,o.makeAuthInfoBytes)([{pubkey:h,sequence:K}],P.fee.amount,F,P.fee.granter,P.fee.payer,T);return b.TxRaw.fromPartial({bodyBytes:A,authInfoBytes:$,signatures:[(0,t.fromBase64)(a.signature)]})}async signDirect(W,r,s,O,{accountNumber:q,sequence:d,chainId:l},M){(0,C.assert)((0,o.isOfflineDirectSigner)(this.signer));const m=(await this.signer.getAccounts()).find(A=>A.address===W);if(!m)throw new Error("Failed to retrieve account from signer");const h=(0,o.encodePubkey)((0,n.encodeSecp256k1Pubkey)(m.pubkey)),T={typeUrl:"/cosmos.tx.v1beta1.TxBody",value:{messages:r,memo:O,timeoutHeight:M}},Q=this.registry.encode(T),H=i.Int53.fromString(s.gas).toNumber(),a=(0,o.makeAuthInfoBytes)([{pubkey:h,sequence:d}],s.amount,H,s.granter,s.payer),P=(0,o.makeSignDoc)(Q,a,l,q),{signature:k,signed:v}=await this.signer.signDirect(W,P);return b.TxRaw.fromPartial({bodyBytes:v.bodyBytes,authInfoBytes:v.authInfoBytes,signatures:[(0,t.fromBase64)(k.signature)]})}}e.SigningStargateClient=N})(Em);(function(e){var n=L.commonjsGlobal&&L.commonjsGlobal.__createBinding||(Object.create?function(u,c,y,B){B===void 0&&(B=y);var N=Object.getOwnPropertyDescriptor(c,y);(!N||("get"in N?!c.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return c[y]}}),Object.defineProperty(u,B,N)}:function(u,c,y,B){B===void 0&&(B=y),u[B]=c[y]}),t=L.commonjsGlobal&&L.commonjsGlobal.__setModuleDefault||(Object.create?function(u,c){Object.defineProperty(u,"default",{enumerable:!0,value:c})}:function(u,c){u.default=c}),i=L.commonjsGlobal&&L.commonjsGlobal.__importStar||function(u){if(u&&u.__esModule)return u;var c={};if(u!=null)for(var y in u)y!=="default"&&Object.prototype.hasOwnProperty.call(u,y)&&n(c,u,y);return t(c,u),c};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=yo;Object.defineProperty(e,"accountFromAny",{enumerable:!0,get:function(){return o.accountFromAny}});var g=Co;Object.defineProperty(e,"AminoTypes",{enumerable:!0,get:function(){return g.AminoTypes}});var C=Ro;Object.defineProperty(e,"fromTendermintEvent",{enumerable:!0,get:function(){return C.fromTendermintEvent}});var w=cr;Object.defineProperty(e,"calculateFee",{enumerable:!0,get:function(){return w.calculateFee}}),Object.defineProperty(e,"GasPrice",{enumerable:!0,get:function(){return w.GasPrice}}),e.logs=i(rn);var E=co;Object.defineProperty(e,"createAuthzAminoConverters",{enumerable:!0,get:function(){return E.createAuthzAminoConverters}}),Object.defineProperty(e,"createBankAminoConverters",{enumerable:!0,get:function(){return E.createBankAminoConverters}}),Object.defineProperty(e,"createCrysisAminoConverters",{enumerable:!0,get:function(){return E.createCrysisAminoConverters}}),Object.defineProperty(e,"createDistributionAminoConverters",{enumerable:!0,get:function(){return E.createDistributionAminoConverters}}),Object.defineProperty(e,"createEvidenceAminoConverters",{enumerable:!0,get:function(){return E.createEvidenceAminoConverters}}),Object.defineProperty(e,"createFeegrantAminoConverters",{enumerable:!0,get:function(){return E.createFeegrantAminoConverters}}),Object.defineProperty(e,"createGovAminoConverters",{enumerable:!0,get:function(){return E.createGovAminoConverters}}),Object.defineProperty(e,"createGroupAminoConverters",{enumerable:!0,get:function(){return E.createGroupAminoConverters}}),Object.defineProperty(e,"createIbcAminoConverters",{enumerable:!0,get:function(){return E.createIbcAminoConverters}}),Object.defineProperty(e,"createSlashingAminoConverters",{enumerable:!0,get:function(){return E.createSlashingAminoConverters}}),Object.defineProperty(e,"createStakingAminoConverters",{enumerable:!0,get:function(){return E.createStakingAminoConverters}}),Object.defineProperty(e,"createVestingAminoConverters",{enumerable:!0,get:function(){return E.createVestingAminoConverters}}),Object.defineProperty(e,"isAminoMsgBeginRedelegate",{enumerable:!0,get:function(){return E.isAminoMsgBeginRedelegate}}),Object.defineProperty(e,"isAminoMsgCreateValidator",{enumerable:!0,get:function(){return E.isAminoMsgCreateValidator}}),Object.defineProperty(e,"isAminoMsgCreateVestingAccount",{enumerable:!0,get:function(){return E.isAminoMsgCreateVestingAccount}}),Object.defineProperty(e,"isAminoMsgDelegate",{enumerable:!0,get:function(){return E.isAminoMsgDelegate}}),Object.defineProperty(e,"isAminoMsgDeposit",{enumerable:!0,get:function(){return E.isAminoMsgDeposit}}),Object.defineProperty(e,"isAminoMsgEditValidator",{enumerable:!0,get:function(){return E.isAminoMsgEditValidator}}),Object.defineProperty(e,"isAminoMsgFundCommunityPool",{enumerable:!0,get:function(){return E.isAminoMsgFundCommunityPool}}),Object.defineProperty(e,"isAminoMsgMultiSend",{enumerable:!0,get:function(){return E.isAminoMsgMultiSend}}),Object.defineProperty(e,"isAminoMsgSend",{enumerable:!0,get:function(){return E.isAminoMsgSend}}),Object.defineProperty(e,"isAminoMsgSetWithdrawAddress",{enumerable:!0,get:function(){return E.isAminoMsgSetWithdrawAddress}}),Object.defineProperty(e,"isAminoMsgSubmitEvidence",{enumerable:!0,get:function(){return E.isAminoMsgSubmitEvidence}}),Object.defineProperty(e,"isAminoMsgSubmitProposal",{enumerable:!0,get:function(){return E.isAminoMsgSubmitProposal}}),Object.defineProperty(e,"isAminoMsgTransfer",{enumerable:!0,get:function(){return E.isAminoMsgTransfer}}),Object.defineProperty(e,"isAminoMsgUndelegate",{enumerable:!0,get:function(){return E.isAminoMsgUndelegate}}),Object.defineProperty(e,"isAminoMsgUnjail",{enumerable:!0,get:function(){return E.isAminoMsgUnjail}}),Object.defineProperty(e,"isAminoMsgVerifyInvariant",{enumerable:!0,get:function(){return E.isAminoMsgVerifyInvariant}}),Object.defineProperty(e,"isAminoMsgVote",{enumerable:!0,get:function(){return E.isAminoMsgVote}}),Object.defineProperty(e,"isAminoMsgVoteWeighted",{enumerable:!0,get:function(){return E.isAminoMsgVoteWeighted}}),Object.defineProperty(e,"isAminoMsgWithdrawDelegatorReward",{enumerable:!0,get:function(){return E.isAminoMsgWithdrawDelegatorReward}}),Object.defineProperty(e,"isAminoMsgWithdrawValidatorCommission",{enumerable:!0,get:function(){return E.isAminoMsgWithdrawValidatorCommission}}),Object.defineProperty(e,"isMsgBeginRedelegateEncodeObject",{enumerable:!0,get:function(){return E.isMsgBeginRedelegateEncodeObject}}),Object.defineProperty(e,"isMsgCancelUnbondingDelegationEncodeObject",{enumerable:!0,get:function(){return E.isMsgCancelUnbondingDelegationEncodeObject}}),Object.defineProperty(e,"isMsgCreateValidatorEncodeObject",{enumerable:!0,get:function(){return E.isMsgCreateValidatorEncodeObject}}),Object.defineProperty(e,"isMsgDelegateEncodeObject",{enumerable:!0,get:function(){return E.isMsgDelegateEncodeObject}}),Object.defineProperty(e,"isMsgDepositEncodeObject",{enumerable:!0,get:function(){return E.isMsgDepositEncodeObject}}),Object.defineProperty(e,"isMsgEditValidatorEncodeObject",{enumerable:!0,get:function(){return E.isMsgEditValidatorEncodeObject}}),Object.defineProperty(e,"isMsgSendEncodeObject",{enumerable:!0,get:function(){return E.isMsgSendEncodeObject}}),Object.defineProperty(e,"isMsgSubmitProposalEncodeObject",{enumerable:!0,get:function(){return E.isMsgSubmitProposalEncodeObject}}),Object.defineProperty(e,"isMsgTransferEncodeObject",{enumerable:!0,get:function(){return E.isMsgTransferEncodeObject}}),Object.defineProperty(e,"isMsgUndelegateEncodeObject",{enumerable:!0,get:function(){return E.isMsgUndelegateEncodeObject}}),Object.defineProperty(e,"isMsgVoteEncodeObject",{enumerable:!0,get:function(){return E.isMsgVoteEncodeObject}}),Object.defineProperty(e,"isMsgVoteWeightedEncodeObject",{enumerable:!0,get:function(){return E.isMsgVoteWeightedEncodeObject}}),Object.defineProperty(e,"isMsgWithdrawDelegatorRewardEncodeObject",{enumerable:!0,get:function(){return E.isMsgWithdrawDelegatorRewardEncodeObject}}),Object.defineProperty(e,"setupAuthExtension",{enumerable:!0,get:function(){return E.setupAuthExtension}}),Object.defineProperty(e,"setupAuthzExtension",{enumerable:!0,get:function(){return E.setupAuthzExtension}}),Object.defineProperty(e,"setupBankExtension",{enumerable:!0,get:function(){return E.setupBankExtension}}),Object.defineProperty(e,"setupDistributionExtension",{enumerable:!0,get:function(){return E.setupDistributionExtension}}),Object.defineProperty(e,"setupFeegrantExtension",{enumerable:!0,get:function(){return E.setupFeegrantExtension}}),Object.defineProperty(e,"setupGovExtension",{enumerable:!0,get:function(){return E.setupGovExtension}}),Object.defineProperty(e,"setupIbcExtension",{enumerable:!0,get:function(){return E.setupIbcExtension}}),Object.defineProperty(e,"setupMintExtension",{enumerable:!0,get:function(){return E.setupMintExtension}}),Object.defineProperty(e,"setupSlashingExtension",{enumerable:!0,get:function(){return E.setupSlashingExtension}}),Object.defineProperty(e,"setupStakingExtension",{enumerable:!0,get:function(){return E.setupStakingExtension}}),Object.defineProperty(e,"setupTxExtension",{enumerable:!0,get:function(){return E.setupTxExtension}});var D=Ut;Object.defineProperty(e,"makeMultisignedTx",{enumerable:!0,get:function(){return D.makeMultisignedTx}}),Object.defineProperty(e,"makeMultisignedTxBytes",{enumerable:!0,get:function(){return D.makeMultisignedTxBytes}});var J=ze;Object.defineProperty(e,"createPagination",{enumerable:!0,get:function(){return J.createPagination}}),Object.defineProperty(e,"createProtobufRpcClient",{enumerable:!0,get:function(){return J.createProtobufRpcClient}}),Object.defineProperty(e,"decodeCosmosSdkDecFromProto",{enumerable:!0,get:function(){return J.decodeCosmosSdkDecFromProto}}),Object.defineProperty(e,"QueryClient",{enumerable:!0,get:function(){return J.QueryClient}});var b=No;Object.defineProperty(e,"isSearchTxQueryArray",{enumerable:!0,get:function(){return b.isSearchTxQueryArray}});var p=Em;Object.defineProperty(e,"createDefaultAminoConverters",{enumerable:!0,get:function(){return p.createDefaultAminoConverters}}),Object.defineProperty(e,"defaultRegistryTypes",{enumerable:!0,get:function(){return p.defaultRegistryTypes}}),Object.defineProperty(e,"SigningStargateClient",{enumerable:!0,get:function(){return p.SigningStargateClient}});var S=Ve;Object.defineProperty(e,"assertIsDeliverTxFailure",{enumerable:!0,get:function(){return S.assertIsDeliverTxFailure}}),Object.defineProperty(e,"assertIsDeliverTxSuccess",{enumerable:!0,get:function(){return S.assertIsDeliverTxSuccess}}),Object.defineProperty(e,"BroadcastTxError",{enumerable:!0,get:function(){return S.BroadcastTxError}}),Object.defineProperty(e,"isDeliverTxFailure",{enumerable:!0,get:function(){return S.isDeliverTxFailure}}),Object.defineProperty(e,"isDeliverTxSuccess",{enumerable:!0,get:function(){return S.isDeliverTxSuccess}}),Object.defineProperty(e,"StargateClient",{enumerable:!0,get:function(){return S.StargateClient}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return S.TimeoutError}});var R=ut;Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return R.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return R.coins}}),Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return R.makeCosmoshubPath}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return R.parseCoins}})})(bt);var Gs={},Ho={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Model=e.AbsoluteTxPosition=e.ContractCodeHistoryEntry=e.ContractInfo=e.CodeInfo=e.Params=e.AccessConfig=e.AccessTypeParam=e.contractCodeHistoryOperationTypeToJSON=e.contractCodeHistoryOperationTypeFromJSON=e.ContractCodeHistoryOperationType=e.accessTypeToJSON=e.accessTypeFromJSON=e.AccessType=e.protobufPackage=void 0;const n=_.any,t=_.binary,i=_.helpers;e.protobufPackage="cosmwasm.wasm.v1";var o;(function(B){B[B.ACCESS_TYPE_UNSPECIFIED=0]="ACCESS_TYPE_UNSPECIFIED",B[B.ACCESS_TYPE_NOBODY=1]="ACCESS_TYPE_NOBODY",B[B.ACCESS_TYPE_ONLY_ADDRESS=2]="ACCESS_TYPE_ONLY_ADDRESS",B[B.ACCESS_TYPE_EVERYBODY=3]="ACCESS_TYPE_EVERYBODY",B[B.ACCESS_TYPE_ANY_OF_ADDRESSES=4]="ACCESS_TYPE_ANY_OF_ADDRESSES",B[B.UNRECOGNIZED=-1]="UNRECOGNIZED"})(o||(e.AccessType=o={}));function g(B){switch(B){case 0:case"ACCESS_TYPE_UNSPECIFIED":return o.ACCESS_TYPE_UNSPECIFIED;case 1:case"ACCESS_TYPE_NOBODY":return o.ACCESS_TYPE_NOBODY;case 2:case"ACCESS_TYPE_ONLY_ADDRESS":return o.ACCESS_TYPE_ONLY_ADDRESS;case 3:case"ACCESS_TYPE_EVERYBODY":return o.ACCESS_TYPE_EVERYBODY;case 4:case"ACCESS_TYPE_ANY_OF_ADDRESSES":return o.ACCESS_TYPE_ANY_OF_ADDRESSES;case-1:case"UNRECOGNIZED":default:return o.UNRECOGNIZED}}e.accessTypeFromJSON=g;function C(B){switch(B){case o.ACCESS_TYPE_UNSPECIFIED:return"ACCESS_TYPE_UNSPECIFIED";case o.ACCESS_TYPE_NOBODY:return"ACCESS_TYPE_NOBODY";case o.ACCESS_TYPE_ONLY_ADDRESS:return"ACCESS_TYPE_ONLY_ADDRESS";case o.ACCESS_TYPE_EVERYBODY:return"ACCESS_TYPE_EVERYBODY";case o.ACCESS_TYPE_ANY_OF_ADDRESSES:return"ACCESS_TYPE_ANY_OF_ADDRESSES";case o.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.accessTypeToJSON=C;var w;(function(B){B[B.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED=0]="CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED",B[B.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT=1]="CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT",B[B.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE=2]="CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE",B[B.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS=3]="CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS",B[B.UNRECOGNIZED=-1]="UNRECOGNIZED"})(w||(e.ContractCodeHistoryOperationType=w={}));function E(B){switch(B){case 0:case"CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED":return w.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED;case 1:case"CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT":return w.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT;case 2:case"CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE":return w.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE;case 3:case"CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS":return w.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS;case-1:case"UNRECOGNIZED":default:return w.UNRECOGNIZED}}e.contractCodeHistoryOperationTypeFromJSON=E;function D(B){switch(B){case w.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED:return"CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED";case w.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT:return"CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT";case w.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE:return"CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE";case w.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS:return"CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS";case w.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.contractCodeHistoryOperationTypeToJSON=D;function J(){return{value:0}}e.AccessTypeParam={typeUrl:"/cosmwasm.wasm.v1.AccessTypeParam",encode(B,N=t.BinaryWriter.create()){return B.value!==0&&N.uint32(8).int32(B.value),N},decode(B,N){const U=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=J();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.value=U.int32();break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=J();return(0,i.isSet)(B.value)&&(N.value=g(B.value)),N},toJSON(B){const N={};return B.value!==void 0&&(N.value=C(B.value)),N},fromPartial(B){const N=J();return N.value=B.value??0,N}};function b(){return{permission:0,address:"",addresses:[]}}e.AccessConfig={typeUrl:"/cosmwasm.wasm.v1.AccessConfig",encode(B,N=t.BinaryWriter.create()){B.permission!==0&&N.uint32(8).int32(B.permission),B.address!==""&&N.uint32(18).string(B.address);for(const U of B.addresses)N.uint32(26).string(U);return N},decode(B,N){const U=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=b();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.permission=U.int32();break;case 2:r.address=U.string();break;case 3:r.addresses.push(U.string());break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=b();return(0,i.isSet)(B.permission)&&(N.permission=g(B.permission)),(0,i.isSet)(B.address)&&(N.address=String(B.address)),Array.isArray(B==null?void 0:B.addresses)&&(N.addresses=B.addresses.map(U=>String(U))),N},toJSON(B){const N={};return B.permission!==void 0&&(N.permission=C(B.permission)),B.address!==void 0&&(N.address=B.address),B.addresses?N.addresses=B.addresses.map(U=>U):N.addresses=[],N},fromPartial(B){var U;const N=b();return N.permission=B.permission??0,N.address=B.address??"",N.addresses=((U=B.addresses)==null?void 0:U.map(W=>W))||[],N}};function p(){return{codeUploadAccess:e.AccessConfig.fromPartial({}),instantiateDefaultPermission:0}}e.Params={typeUrl:"/cosmwasm.wasm.v1.Params",encode(B,N=t.BinaryWriter.create()){return B.codeUploadAccess!==void 0&&e.AccessConfig.encode(B.codeUploadAccess,N.uint32(10).fork()).ldelim(),B.instantiateDefaultPermission!==0&&N.uint32(16).int32(B.instantiateDefaultPermission),N},decode(B,N){const U=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=p();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.codeUploadAccess=e.AccessConfig.decode(U,U.uint32());break;case 2:r.instantiateDefaultPermission=U.int32();break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=p();return(0,i.isSet)(B.codeUploadAccess)&&(N.codeUploadAccess=e.AccessConfig.fromJSON(B.codeUploadAccess)),(0,i.isSet)(B.instantiateDefaultPermission)&&(N.instantiateDefaultPermission=g(B.instantiateDefaultPermission)),N},toJSON(B){const N={};return B.codeUploadAccess!==void 0&&(N.codeUploadAccess=B.codeUploadAccess?e.AccessConfig.toJSON(B.codeUploadAccess):void 0),B.instantiateDefaultPermission!==void 0&&(N.instantiateDefaultPermission=C(B.instantiateDefaultPermission)),N},fromPartial(B){const N=p();return B.codeUploadAccess!==void 0&&B.codeUploadAccess!==null&&(N.codeUploadAccess=e.AccessConfig.fromPartial(B.codeUploadAccess)),N.instantiateDefaultPermission=B.instantiateDefaultPermission??0,N}};function S(){return{codeHash:new Uint8Array,creator:"",instantiateConfig:e.AccessConfig.fromPartial({})}}e.CodeInfo={typeUrl:"/cosmwasm.wasm.v1.CodeInfo",encode(B,N=t.BinaryWriter.create()){return B.codeHash.length!==0&&N.uint32(10).bytes(B.codeHash),B.creator!==""&&N.uint32(18).string(B.creator),B.instantiateConfig!==void 0&&e.AccessConfig.encode(B.instantiateConfig,N.uint32(42).fork()).ldelim(),N},decode(B,N){const U=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=S();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.codeHash=U.bytes();break;case 2:r.creator=U.string();break;case 5:r.instantiateConfig=e.AccessConfig.decode(U,U.uint32());break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=S();return(0,i.isSet)(B.codeHash)&&(N.codeHash=(0,i.bytesFromBase64)(B.codeHash)),(0,i.isSet)(B.creator)&&(N.creator=String(B.creator)),(0,i.isSet)(B.instantiateConfig)&&(N.instantiateConfig=e.AccessConfig.fromJSON(B.instantiateConfig)),N},toJSON(B){const N={};return B.codeHash!==void 0&&(N.codeHash=(0,i.base64FromBytes)(B.codeHash!==void 0?B.codeHash:new Uint8Array)),B.creator!==void 0&&(N.creator=B.creator),B.instantiateConfig!==void 0&&(N.instantiateConfig=B.instantiateConfig?e.AccessConfig.toJSON(B.instantiateConfig):void 0),N},fromPartial(B){const N=S();return N.codeHash=B.codeHash??new Uint8Array,N.creator=B.creator??"",B.instantiateConfig!==void 0&&B.instantiateConfig!==null&&(N.instantiateConfig=e.AccessConfig.fromPartial(B.instantiateConfig)),N}};function R(){return{codeId:BigInt(0),creator:"",admin:"",label:"",created:void 0,ibcPortId:"",extension:void 0}}e.ContractInfo={typeUrl:"/cosmwasm.wasm.v1.ContractInfo",encode(B,N=t.BinaryWriter.create()){return B.codeId!==BigInt(0)&&N.uint32(8).uint64(B.codeId),B.creator!==""&&N.uint32(18).string(B.creator),B.admin!==""&&N.uint32(26).string(B.admin),B.label!==""&&N.uint32(34).string(B.label),B.created!==void 0&&e.AbsoluteTxPosition.encode(B.created,N.uint32(42).fork()).ldelim(),B.ibcPortId!==""&&N.uint32(50).string(B.ibcPortId),B.extension!==void 0&&n.Any.encode(B.extension,N.uint32(58).fork()).ldelim(),N},decode(B,N){const U=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=R();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.codeId=U.uint64();break;case 2:r.creator=U.string();break;case 3:r.admin=U.string();break;case 4:r.label=U.string();break;case 5:r.created=e.AbsoluteTxPosition.decode(U,U.uint32());break;case 6:r.ibcPortId=U.string();break;case 7:r.extension=n.Any.decode(U,U.uint32());break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=R();return(0,i.isSet)(B.codeId)&&(N.codeId=BigInt(B.codeId.toString())),(0,i.isSet)(B.creator)&&(N.creator=String(B.creator)),(0,i.isSet)(B.admin)&&(N.admin=String(B.admin)),(0,i.isSet)(B.label)&&(N.label=String(B.label)),(0,i.isSet)(B.created)&&(N.created=e.AbsoluteTxPosition.fromJSON(B.created)),(0,i.isSet)(B.ibcPortId)&&(N.ibcPortId=String(B.ibcPortId)),(0,i.isSet)(B.extension)&&(N.extension=n.Any.fromJSON(B.extension)),N},toJSON(B){const N={};return B.codeId!==void 0&&(N.codeId=(B.codeId||BigInt(0)).toString()),B.creator!==void 0&&(N.creator=B.creator),B.admin!==void 0&&(N.admin=B.admin),B.label!==void 0&&(N.label=B.label),B.created!==void 0&&(N.created=B.created?e.AbsoluteTxPosition.toJSON(B.created):void 0),B.ibcPortId!==void 0&&(N.ibcPortId=B.ibcPortId),B.extension!==void 0&&(N.extension=B.extension?n.Any.toJSON(B.extension):void 0),N},fromPartial(B){const N=R();return B.codeId!==void 0&&B.codeId!==null&&(N.codeId=BigInt(B.codeId.toString())),N.creator=B.creator??"",N.admin=B.admin??"",N.label=B.label??"",B.created!==void 0&&B.created!==null&&(N.created=e.AbsoluteTxPosition.fromPartial(B.created)),N.ibcPortId=B.ibcPortId??"",B.extension!==void 0&&B.extension!==null&&(N.extension=n.Any.fromPartial(B.extension)),N}};function u(){return{operation:0,codeId:BigInt(0),updated:void 0,msg:new Uint8Array}}e.ContractCodeHistoryEntry={typeUrl:"/cosmwasm.wasm.v1.ContractCodeHistoryEntry",encode(B,N=t.BinaryWriter.create()){return B.operation!==0&&N.uint32(8).int32(B.operation),B.codeId!==BigInt(0)&&N.uint32(16).uint64(B.codeId),B.updated!==void 0&&e.AbsoluteTxPosition.encode(B.updated,N.uint32(26).fork()).ldelim(),B.msg.length!==0&&N.uint32(34).bytes(B.msg),N},decode(B,N){const U=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=u();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.operation=U.int32();break;case 2:r.codeId=U.uint64();break;case 3:r.updated=e.AbsoluteTxPosition.decode(U,U.uint32());break;case 4:r.msg=U.bytes();break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=u();return(0,i.isSet)(B.operation)&&(N.operation=E(B.operation)),(0,i.isSet)(B.codeId)&&(N.codeId=BigInt(B.codeId.toString())),(0,i.isSet)(B.updated)&&(N.updated=e.AbsoluteTxPosition.fromJSON(B.updated)),(0,i.isSet)(B.msg)&&(N.msg=(0,i.bytesFromBase64)(B.msg)),N},toJSON(B){const N={};return B.operation!==void 0&&(N.operation=D(B.operation)),B.codeId!==void 0&&(N.codeId=(B.codeId||BigInt(0)).toString()),B.updated!==void 0&&(N.updated=B.updated?e.AbsoluteTxPosition.toJSON(B.updated):void 0),B.msg!==void 0&&(N.msg=(0,i.base64FromBytes)(B.msg!==void 0?B.msg:new Uint8Array)),N},fromPartial(B){const N=u();return N.operation=B.operation??0,B.codeId!==void 0&&B.codeId!==null&&(N.codeId=BigInt(B.codeId.toString())),B.updated!==void 0&&B.updated!==null&&(N.updated=e.AbsoluteTxPosition.fromPartial(B.updated)),N.msg=B.msg??new Uint8Array,N}};function c(){return{blockHeight:BigInt(0),txIndex:BigInt(0)}}e.AbsoluteTxPosition={typeUrl:"/cosmwasm.wasm.v1.AbsoluteTxPosition",encode(B,N=t.BinaryWriter.create()){return B.blockHeight!==BigInt(0)&&N.uint32(8).uint64(B.blockHeight),B.txIndex!==BigInt(0)&&N.uint32(16).uint64(B.txIndex),N},decode(B,N){const U=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=c();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.blockHeight=U.uint64();break;case 2:r.txIndex=U.uint64();break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=c();return(0,i.isSet)(B.blockHeight)&&(N.blockHeight=BigInt(B.blockHeight.toString())),(0,i.isSet)(B.txIndex)&&(N.txIndex=BigInt(B.txIndex.toString())),N},toJSON(B){const N={};return B.blockHeight!==void 0&&(N.blockHeight=(B.blockHeight||BigInt(0)).toString()),B.txIndex!==void 0&&(N.txIndex=(B.txIndex||BigInt(0)).toString()),N},fromPartial(B){const N=c();return B.blockHeight!==void 0&&B.blockHeight!==null&&(N.blockHeight=BigInt(B.blockHeight.toString())),B.txIndex!==void 0&&B.txIndex!==null&&(N.txIndex=BigInt(B.txIndex.toString())),N}};function y(){return{key:new Uint8Array,value:new Uint8Array}}e.Model={typeUrl:"/cosmwasm.wasm.v1.Model",encode(B,N=t.BinaryWriter.create()){return B.key.length!==0&&N.uint32(10).bytes(B.key),B.value.length!==0&&N.uint32(18).bytes(B.value),N},decode(B,N){const U=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let W=N===void 0?U.len:U.pos+N;const r=y();for(;U.pos<W;){const s=U.uint32();switch(s>>>3){case 1:r.key=U.bytes();break;case 2:r.value=U.bytes();break;default:U.skipType(s&7);break}}return r},fromJSON(B){const N=y();return(0,i.isSet)(B.key)&&(N.key=(0,i.bytesFromBase64)(B.key)),(0,i.isSet)(B.value)&&(N.value=(0,i.bytesFromBase64)(B.value)),N},toJSON(B){const N={};return B.key!==void 0&&(N.key=(0,i.base64FromBytes)(B.key!==void 0?B.key:new Uint8Array)),B.value!==void 0&&(N.value=(0,i.base64FromBytes)(B.value!==void 0?B.value:new Uint8Array)),N},fromPartial(B){const N=y();return N.key=B.key??new Uint8Array,N.value=B.value??new Uint8Array,N}}})(Ho);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgUpdateInstantiateConfigResponse=e.MsgUpdateInstantiateConfig=e.MsgClearAdminResponse=e.MsgClearAdmin=e.MsgUpdateAdminResponse=e.MsgUpdateAdmin=e.MsgMigrateContractResponse=e.MsgMigrateContract=e.MsgExecuteContractResponse=e.MsgExecuteContract=e.MsgInstantiateContract2Response=e.MsgInstantiateContractResponse=e.MsgInstantiateContract2=e.MsgInstantiateContract=e.MsgStoreCodeResponse=e.MsgStoreCode=e.protobufPackage=void 0;const n=Ho,t=_.coin,i=_.binary,o=_.helpers;e.protobufPackage="cosmwasm.wasm.v1";function g(){return{sender:"",wasmByteCode:new Uint8Array,instantiatePermission:void 0}}e.MsgStoreCode={typeUrl:"/cosmwasm.wasm.v1.MsgStoreCode",encode(r,s=i.BinaryWriter.create()){return r.sender!==""&&s.uint32(10).string(r.sender),r.wasmByteCode.length!==0&&s.uint32(18).bytes(r.wasmByteCode),r.instantiatePermission!==void 0&&n.AccessConfig.encode(r.instantiatePermission,s.uint32(42).fork()).ldelim(),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=g();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.sender=O.string();break;case 2:d.wasmByteCode=O.bytes();break;case 5:d.instantiatePermission=n.AccessConfig.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=g();return(0,o.isSet)(r.sender)&&(s.sender=String(r.sender)),(0,o.isSet)(r.wasmByteCode)&&(s.wasmByteCode=(0,o.bytesFromBase64)(r.wasmByteCode)),(0,o.isSet)(r.instantiatePermission)&&(s.instantiatePermission=n.AccessConfig.fromJSON(r.instantiatePermission)),s},toJSON(r){const s={};return r.sender!==void 0&&(s.sender=r.sender),r.wasmByteCode!==void 0&&(s.wasmByteCode=(0,o.base64FromBytes)(r.wasmByteCode!==void 0?r.wasmByteCode:new Uint8Array)),r.instantiatePermission!==void 0&&(s.instantiatePermission=r.instantiatePermission?n.AccessConfig.toJSON(r.instantiatePermission):void 0),s},fromPartial(r){const s=g();return s.sender=r.sender??"",s.wasmByteCode=r.wasmByteCode??new Uint8Array,r.instantiatePermission!==void 0&&r.instantiatePermission!==null&&(s.instantiatePermission=n.AccessConfig.fromPartial(r.instantiatePermission)),s}};function C(){return{codeId:BigInt(0),checksum:new Uint8Array}}e.MsgStoreCodeResponse={typeUrl:"/cosmwasm.wasm.v1.MsgStoreCodeResponse",encode(r,s=i.BinaryWriter.create()){return r.codeId!==BigInt(0)&&s.uint32(8).uint64(r.codeId),r.checksum.length!==0&&s.uint32(18).bytes(r.checksum),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=C();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.codeId=O.uint64();break;case 2:d.checksum=O.bytes();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=C();return(0,o.isSet)(r.codeId)&&(s.codeId=BigInt(r.codeId.toString())),(0,o.isSet)(r.checksum)&&(s.checksum=(0,o.bytesFromBase64)(r.checksum)),s},toJSON(r){const s={};return r.codeId!==void 0&&(s.codeId=(r.codeId||BigInt(0)).toString()),r.checksum!==void 0&&(s.checksum=(0,o.base64FromBytes)(r.checksum!==void 0?r.checksum:new Uint8Array)),s},fromPartial(r){const s=C();return r.codeId!==void 0&&r.codeId!==null&&(s.codeId=BigInt(r.codeId.toString())),s.checksum=r.checksum??new Uint8Array,s}};function w(){return{sender:"",admin:"",codeId:BigInt(0),label:"",msg:new Uint8Array,funds:[]}}e.MsgInstantiateContract={typeUrl:"/cosmwasm.wasm.v1.MsgInstantiateContract",encode(r,s=i.BinaryWriter.create()){r.sender!==""&&s.uint32(10).string(r.sender),r.admin!==""&&s.uint32(18).string(r.admin),r.codeId!==BigInt(0)&&s.uint32(24).uint64(r.codeId),r.label!==""&&s.uint32(34).string(r.label),r.msg.length!==0&&s.uint32(42).bytes(r.msg);for(const O of r.funds)t.Coin.encode(O,s.uint32(50).fork()).ldelim();return s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=w();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.sender=O.string();break;case 2:d.admin=O.string();break;case 3:d.codeId=O.uint64();break;case 4:d.label=O.string();break;case 5:d.msg=O.bytes();break;case 6:d.funds.push(t.Coin.decode(O,O.uint32()));break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=w();return(0,o.isSet)(r.sender)&&(s.sender=String(r.sender)),(0,o.isSet)(r.admin)&&(s.admin=String(r.admin)),(0,o.isSet)(r.codeId)&&(s.codeId=BigInt(r.codeId.toString())),(0,o.isSet)(r.label)&&(s.label=String(r.label)),(0,o.isSet)(r.msg)&&(s.msg=(0,o.bytesFromBase64)(r.msg)),Array.isArray(r==null?void 0:r.funds)&&(s.funds=r.funds.map(O=>t.Coin.fromJSON(O))),s},toJSON(r){const s={};return r.sender!==void 0&&(s.sender=r.sender),r.admin!==void 0&&(s.admin=r.admin),r.codeId!==void 0&&(s.codeId=(r.codeId||BigInt(0)).toString()),r.label!==void 0&&(s.label=r.label),r.msg!==void 0&&(s.msg=(0,o.base64FromBytes)(r.msg!==void 0?r.msg:new Uint8Array)),r.funds?s.funds=r.funds.map(O=>O?t.Coin.toJSON(O):void 0):s.funds=[],s},fromPartial(r){var O;const s=w();return s.sender=r.sender??"",s.admin=r.admin??"",r.codeId!==void 0&&r.codeId!==null&&(s.codeId=BigInt(r.codeId.toString())),s.label=r.label??"",s.msg=r.msg??new Uint8Array,s.funds=((O=r.funds)==null?void 0:O.map(q=>t.Coin.fromPartial(q)))||[],s}};function E(){return{sender:"",admin:"",codeId:BigInt(0),label:"",msg:new Uint8Array,funds:[],salt:new Uint8Array,fixMsg:!1}}e.MsgInstantiateContract2={typeUrl:"/cosmwasm.wasm.v1.MsgInstantiateContract2",encode(r,s=i.BinaryWriter.create()){r.sender!==""&&s.uint32(10).string(r.sender),r.admin!==""&&s.uint32(18).string(r.admin),r.codeId!==BigInt(0)&&s.uint32(24).uint64(r.codeId),r.label!==""&&s.uint32(34).string(r.label),r.msg.length!==0&&s.uint32(42).bytes(r.msg);for(const O of r.funds)t.Coin.encode(O,s.uint32(50).fork()).ldelim();return r.salt.length!==0&&s.uint32(58).bytes(r.salt),r.fixMsg===!0&&s.uint32(64).bool(r.fixMsg),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=E();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.sender=O.string();break;case 2:d.admin=O.string();break;case 3:d.codeId=O.uint64();break;case 4:d.label=O.string();break;case 5:d.msg=O.bytes();break;case 6:d.funds.push(t.Coin.decode(O,O.uint32()));break;case 7:d.salt=O.bytes();break;case 8:d.fixMsg=O.bool();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=E();return(0,o.isSet)(r.sender)&&(s.sender=String(r.sender)),(0,o.isSet)(r.admin)&&(s.admin=String(r.admin)),(0,o.isSet)(r.codeId)&&(s.codeId=BigInt(r.codeId.toString())),(0,o.isSet)(r.label)&&(s.label=String(r.label)),(0,o.isSet)(r.msg)&&(s.msg=(0,o.bytesFromBase64)(r.msg)),Array.isArray(r==null?void 0:r.funds)&&(s.funds=r.funds.map(O=>t.Coin.fromJSON(O))),(0,o.isSet)(r.salt)&&(s.salt=(0,o.bytesFromBase64)(r.salt)),(0,o.isSet)(r.fixMsg)&&(s.fixMsg=!!r.fixMsg),s},toJSON(r){const s={};return r.sender!==void 0&&(s.sender=r.sender),r.admin!==void 0&&(s.admin=r.admin),r.codeId!==void 0&&(s.codeId=(r.codeId||BigInt(0)).toString()),r.label!==void 0&&(s.label=r.label),r.msg!==void 0&&(s.msg=(0,o.base64FromBytes)(r.msg!==void 0?r.msg:new Uint8Array)),r.funds?s.funds=r.funds.map(O=>O?t.Coin.toJSON(O):void 0):s.funds=[],r.salt!==void 0&&(s.salt=(0,o.base64FromBytes)(r.salt!==void 0?r.salt:new Uint8Array)),r.fixMsg!==void 0&&(s.fixMsg=r.fixMsg),s},fromPartial(r){var O;const s=E();return s.sender=r.sender??"",s.admin=r.admin??"",r.codeId!==void 0&&r.codeId!==null&&(s.codeId=BigInt(r.codeId.toString())),s.label=r.label??"",s.msg=r.msg??new Uint8Array,s.funds=((O=r.funds)==null?void 0:O.map(q=>t.Coin.fromPartial(q)))||[],s.salt=r.salt??new Uint8Array,s.fixMsg=r.fixMsg??!1,s}};function D(){return{address:"",data:new Uint8Array}}e.MsgInstantiateContractResponse={typeUrl:"/cosmwasm.wasm.v1.MsgInstantiateContractResponse",encode(r,s=i.BinaryWriter.create()){return r.address!==""&&s.uint32(10).string(r.address),r.data.length!==0&&s.uint32(18).bytes(r.data),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=D();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.address=O.string();break;case 2:d.data=O.bytes();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=D();return(0,o.isSet)(r.address)&&(s.address=String(r.address)),(0,o.isSet)(r.data)&&(s.data=(0,o.bytesFromBase64)(r.data)),s},toJSON(r){const s={};return r.address!==void 0&&(s.address=r.address),r.data!==void 0&&(s.data=(0,o.base64FromBytes)(r.data!==void 0?r.data:new Uint8Array)),s},fromPartial(r){const s=D();return s.address=r.address??"",s.data=r.data??new Uint8Array,s}};function J(){return{address:"",data:new Uint8Array}}e.MsgInstantiateContract2Response={typeUrl:"/cosmwasm.wasm.v1.MsgInstantiateContract2Response",encode(r,s=i.BinaryWriter.create()){return r.address!==""&&s.uint32(10).string(r.address),r.data.length!==0&&s.uint32(18).bytes(r.data),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=J();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.address=O.string();break;case 2:d.data=O.bytes();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=J();return(0,o.isSet)(r.address)&&(s.address=String(r.address)),(0,o.isSet)(r.data)&&(s.data=(0,o.bytesFromBase64)(r.data)),s},toJSON(r){const s={};return r.address!==void 0&&(s.address=r.address),r.data!==void 0&&(s.data=(0,o.base64FromBytes)(r.data!==void 0?r.data:new Uint8Array)),s},fromPartial(r){const s=J();return s.address=r.address??"",s.data=r.data??new Uint8Array,s}};function b(){return{sender:"",contract:"",msg:new Uint8Array,funds:[]}}e.MsgExecuteContract={typeUrl:"/cosmwasm.wasm.v1.MsgExecuteContract",encode(r,s=i.BinaryWriter.create()){r.sender!==""&&s.uint32(10).string(r.sender),r.contract!==""&&s.uint32(18).string(r.contract),r.msg.length!==0&&s.uint32(26).bytes(r.msg);for(const O of r.funds)t.Coin.encode(O,s.uint32(42).fork()).ldelim();return s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=b();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.sender=O.string();break;case 2:d.contract=O.string();break;case 3:d.msg=O.bytes();break;case 5:d.funds.push(t.Coin.decode(O,O.uint32()));break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=b();return(0,o.isSet)(r.sender)&&(s.sender=String(r.sender)),(0,o.isSet)(r.contract)&&(s.contract=String(r.contract)),(0,o.isSet)(r.msg)&&(s.msg=(0,o.bytesFromBase64)(r.msg)),Array.isArray(r==null?void 0:r.funds)&&(s.funds=r.funds.map(O=>t.Coin.fromJSON(O))),s},toJSON(r){const s={};return r.sender!==void 0&&(s.sender=r.sender),r.contract!==void 0&&(s.contract=r.contract),r.msg!==void 0&&(s.msg=(0,o.base64FromBytes)(r.msg!==void 0?r.msg:new Uint8Array)),r.funds?s.funds=r.funds.map(O=>O?t.Coin.toJSON(O):void 0):s.funds=[],s},fromPartial(r){var O;const s=b();return s.sender=r.sender??"",s.contract=r.contract??"",s.msg=r.msg??new Uint8Array,s.funds=((O=r.funds)==null?void 0:O.map(q=>t.Coin.fromPartial(q)))||[],s}};function p(){return{data:new Uint8Array}}e.MsgExecuteContractResponse={typeUrl:"/cosmwasm.wasm.v1.MsgExecuteContractResponse",encode(r,s=i.BinaryWriter.create()){return r.data.length!==0&&s.uint32(10).bytes(r.data),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=p();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.data=O.bytes();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=p();return(0,o.isSet)(r.data)&&(s.data=(0,o.bytesFromBase64)(r.data)),s},toJSON(r){const s={};return r.data!==void 0&&(s.data=(0,o.base64FromBytes)(r.data!==void 0?r.data:new Uint8Array)),s},fromPartial(r){const s=p();return s.data=r.data??new Uint8Array,s}};function S(){return{sender:"",contract:"",codeId:BigInt(0),msg:new Uint8Array}}e.MsgMigrateContract={typeUrl:"/cosmwasm.wasm.v1.MsgMigrateContract",encode(r,s=i.BinaryWriter.create()){return r.sender!==""&&s.uint32(10).string(r.sender),r.contract!==""&&s.uint32(18).string(r.contract),r.codeId!==BigInt(0)&&s.uint32(24).uint64(r.codeId),r.msg.length!==0&&s.uint32(34).bytes(r.msg),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=S();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.sender=O.string();break;case 2:d.contract=O.string();break;case 3:d.codeId=O.uint64();break;case 4:d.msg=O.bytes();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=S();return(0,o.isSet)(r.sender)&&(s.sender=String(r.sender)),(0,o.isSet)(r.contract)&&(s.contract=String(r.contract)),(0,o.isSet)(r.codeId)&&(s.codeId=BigInt(r.codeId.toString())),(0,o.isSet)(r.msg)&&(s.msg=(0,o.bytesFromBase64)(r.msg)),s},toJSON(r){const s={};return r.sender!==void 0&&(s.sender=r.sender),r.contract!==void 0&&(s.contract=r.contract),r.codeId!==void 0&&(s.codeId=(r.codeId||BigInt(0)).toString()),r.msg!==void 0&&(s.msg=(0,o.base64FromBytes)(r.msg!==void 0?r.msg:new Uint8Array)),s},fromPartial(r){const s=S();return s.sender=r.sender??"",s.contract=r.contract??"",r.codeId!==void 0&&r.codeId!==null&&(s.codeId=BigInt(r.codeId.toString())),s.msg=r.msg??new Uint8Array,s}};function R(){return{data:new Uint8Array}}e.MsgMigrateContractResponse={typeUrl:"/cosmwasm.wasm.v1.MsgMigrateContractResponse",encode(r,s=i.BinaryWriter.create()){return r.data.length!==0&&s.uint32(10).bytes(r.data),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=R();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.data=O.bytes();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=R();return(0,o.isSet)(r.data)&&(s.data=(0,o.bytesFromBase64)(r.data)),s},toJSON(r){const s={};return r.data!==void 0&&(s.data=(0,o.base64FromBytes)(r.data!==void 0?r.data:new Uint8Array)),s},fromPartial(r){const s=R();return s.data=r.data??new Uint8Array,s}};function u(){return{sender:"",newAdmin:"",contract:""}}e.MsgUpdateAdmin={typeUrl:"/cosmwasm.wasm.v1.MsgUpdateAdmin",encode(r,s=i.BinaryWriter.create()){return r.sender!==""&&s.uint32(10).string(r.sender),r.newAdmin!==""&&s.uint32(18).string(r.newAdmin),r.contract!==""&&s.uint32(26).string(r.contract),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=u();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.sender=O.string();break;case 2:d.newAdmin=O.string();break;case 3:d.contract=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=u();return(0,o.isSet)(r.sender)&&(s.sender=String(r.sender)),(0,o.isSet)(r.newAdmin)&&(s.newAdmin=String(r.newAdmin)),(0,o.isSet)(r.contract)&&(s.contract=String(r.contract)),s},toJSON(r){const s={};return r.sender!==void 0&&(s.sender=r.sender),r.newAdmin!==void 0&&(s.newAdmin=r.newAdmin),r.contract!==void 0&&(s.contract=r.contract),s},fromPartial(r){const s=u();return s.sender=r.sender??"",s.newAdmin=r.newAdmin??"",s.contract=r.contract??"",s}};function c(){return{}}e.MsgUpdateAdminResponse={typeUrl:"/cosmwasm.wasm.v1.MsgUpdateAdminResponse",encode(r,s=i.BinaryWriter.create()){return s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=c();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){default:O.skipType(l&7);break}}return d},fromJSON(r){return c()},toJSON(r){return{}},fromPartial(r){return c()}};function y(){return{sender:"",contract:""}}e.MsgClearAdmin={typeUrl:"/cosmwasm.wasm.v1.MsgClearAdmin",encode(r,s=i.BinaryWriter.create()){return r.sender!==""&&s.uint32(10).string(r.sender),r.contract!==""&&s.uint32(26).string(r.contract),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=y();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.sender=O.string();break;case 3:d.contract=O.string();break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=y();return(0,o.isSet)(r.sender)&&(s.sender=String(r.sender)),(0,o.isSet)(r.contract)&&(s.contract=String(r.contract)),s},toJSON(r){const s={};return r.sender!==void 0&&(s.sender=r.sender),r.contract!==void 0&&(s.contract=r.contract),s},fromPartial(r){const s=y();return s.sender=r.sender??"",s.contract=r.contract??"",s}};function B(){return{}}e.MsgClearAdminResponse={typeUrl:"/cosmwasm.wasm.v1.MsgClearAdminResponse",encode(r,s=i.BinaryWriter.create()){return s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=B();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){default:O.skipType(l&7);break}}return d},fromJSON(r){return B()},toJSON(r){return{}},fromPartial(r){return B()}};function N(){return{sender:"",codeId:BigInt(0),newInstantiatePermission:void 0}}e.MsgUpdateInstantiateConfig={typeUrl:"/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig",encode(r,s=i.BinaryWriter.create()){return r.sender!==""&&s.uint32(10).string(r.sender),r.codeId!==BigInt(0)&&s.uint32(16).uint64(r.codeId),r.newInstantiatePermission!==void 0&&n.AccessConfig.encode(r.newInstantiatePermission,s.uint32(26).fork()).ldelim(),s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=N();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){case 1:d.sender=O.string();break;case 2:d.codeId=O.uint64();break;case 3:d.newInstantiatePermission=n.AccessConfig.decode(O,O.uint32());break;default:O.skipType(l&7);break}}return d},fromJSON(r){const s=N();return(0,o.isSet)(r.sender)&&(s.sender=String(r.sender)),(0,o.isSet)(r.codeId)&&(s.codeId=BigInt(r.codeId.toString())),(0,o.isSet)(r.newInstantiatePermission)&&(s.newInstantiatePermission=n.AccessConfig.fromJSON(r.newInstantiatePermission)),s},toJSON(r){const s={};return r.sender!==void 0&&(s.sender=r.sender),r.codeId!==void 0&&(s.codeId=(r.codeId||BigInt(0)).toString()),r.newInstantiatePermission!==void 0&&(s.newInstantiatePermission=r.newInstantiatePermission?n.AccessConfig.toJSON(r.newInstantiatePermission):void 0),s},fromPartial(r){const s=N();return s.sender=r.sender??"",r.codeId!==void 0&&r.codeId!==null&&(s.codeId=BigInt(r.codeId.toString())),r.newInstantiatePermission!==void 0&&r.newInstantiatePermission!==null&&(s.newInstantiatePermission=n.AccessConfig.fromPartial(r.newInstantiatePermission)),s}};function U(){return{}}e.MsgUpdateInstantiateConfigResponse={typeUrl:"/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse",encode(r,s=i.BinaryWriter.create()){return s},decode(r,s){const O=r instanceof i.BinaryReader?r:new i.BinaryReader(r);let q=s===void 0?O.len:O.pos+s;const d=U();for(;O.pos<q;){const l=O.uint32();switch(l>>>3){default:O.skipType(l&7);break}}return d},fromJSON(r){return U()},toJSON(r){return{}},fromPartial(r){return U()}};class W{constructor(s){this.rpc=s,this.StoreCode=this.StoreCode.bind(this),this.InstantiateContract=this.InstantiateContract.bind(this),this.InstantiateContract2=this.InstantiateContract2.bind(this),this.ExecuteContract=this.ExecuteContract.bind(this),this.MigrateContract=this.MigrateContract.bind(this),this.UpdateAdmin=this.UpdateAdmin.bind(this),this.ClearAdmin=this.ClearAdmin.bind(this),this.UpdateInstantiateConfig=this.UpdateInstantiateConfig.bind(this)}StoreCode(s){const O=e.MsgStoreCode.encode(s).finish();return this.rpc.request("cosmwasm.wasm.v1.Msg","StoreCode",O).then(d=>e.MsgStoreCodeResponse.decode(new i.BinaryReader(d)))}InstantiateContract(s){const O=e.MsgInstantiateContract.encode(s).finish();return this.rpc.request("cosmwasm.wasm.v1.Msg","InstantiateContract",O).then(d=>e.MsgInstantiateContractResponse.decode(new i.BinaryReader(d)))}InstantiateContract2(s){const O=e.MsgInstantiateContract2.encode(s).finish();return this.rpc.request("cosmwasm.wasm.v1.Msg","InstantiateContract2",O).then(d=>e.MsgInstantiateContract2Response.decode(new i.BinaryReader(d)))}ExecuteContract(s){const O=e.MsgExecuteContract.encode(s).finish();return this.rpc.request("cosmwasm.wasm.v1.Msg","ExecuteContract",O).then(d=>e.MsgExecuteContractResponse.decode(new i.BinaryReader(d)))}MigrateContract(s){const O=e.MsgMigrateContract.encode(s).finish();return this.rpc.request("cosmwasm.wasm.v1.Msg","MigrateContract",O).then(d=>e.MsgMigrateContractResponse.decode(new i.BinaryReader(d)))}UpdateAdmin(s){const O=e.MsgUpdateAdmin.encode(s).finish();return this.rpc.request("cosmwasm.wasm.v1.Msg","UpdateAdmin",O).then(d=>e.MsgUpdateAdminResponse.decode(new i.BinaryReader(d)))}ClearAdmin(s){const O=e.MsgClearAdmin.encode(s).finish();return this.rpc.request("cosmwasm.wasm.v1.Msg","ClearAdmin",O).then(d=>e.MsgClearAdminResponse.decode(new i.BinaryReader(d)))}UpdateInstantiateConfig(s){const O=e.MsgUpdateInstantiateConfig.encode(s).finish();return this.rpc.request("cosmwasm.wasm.v1.Msg","UpdateInstantiateConfig",O).then(d=>e.MsgUpdateInstantiateConfigResponse.decode(new i.BinaryReader(d)))}}e.MsgClientImpl=W})(Gs);var rl={},qo={},Ls={},Ht={};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.createWasmAminoConverters=Ht.accessTypeToString=Ht.accessTypeFromString=void 0;const hu=zn,Pn=ue,fn=Ho;function Oh(e){switch(e){case"Unspecified":return fn.AccessType.ACCESS_TYPE_UNSPECIFIED;case"Nobody":return fn.AccessType.ACCESS_TYPE_NOBODY;case"OnlyAddress":return fn.AccessType.ACCESS_TYPE_ONLY_ADDRESS;case"Everybody":return fn.AccessType.ACCESS_TYPE_EVERYBODY;case"AnyOfAddresses":return fn.AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES;default:return fn.AccessType.UNRECOGNIZED}}Ht.accessTypeFromString=Oh;function Ah(e){switch(e){case fn.AccessType.ACCESS_TYPE_UNSPECIFIED:return"Unspecified";case fn.AccessType.ACCESS_TYPE_NOBODY:return"Nobody";case fn.AccessType.ACCESS_TYPE_ONLY_ADDRESS:return"OnlyAddress";case fn.AccessType.ACCESS_TYPE_EVERYBODY:return"Everybody";case fn.AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES:return"AnyOfAddresses";case fn.AccessType.UNRECOGNIZED:default:return"UNRECOGNIZED"}}Ht.accessTypeToString=Ah;function Rb(){return{"/cosmwasm.wasm.v1.MsgStoreCode":{aminoType:"wasm/MsgStoreCode",toAmino:({sender:e,wasmByteCode:n,instantiatePermission:t})=>({sender:e,wasm_byte_code:(0,Pn.toBase64)(n),instantiate_permission:t?{permission:Ah(t.permission),address:t.address||void 0,addresses:t.addresses.length!==0?t.addresses:void 0}:void 0}),fromAmino:({sender:e,wasm_byte_code:n,instantiate_permission:t})=>({sender:e,wasmByteCode:(0,Pn.fromBase64)(n),instantiatePermission:t?fn.AccessConfig.fromPartial({permission:Oh(t.permission),address:t.address??"",addresses:t.addresses??[]}):void 0})},"/cosmwasm.wasm.v1.MsgInstantiateContract":{aminoType:"wasm/MsgInstantiateContract",toAmino:({sender:e,codeId:n,label:t,msg:i,funds:o,admin:g})=>({sender:e,code_id:n.toString(),label:t,msg:JSON.parse((0,Pn.fromUtf8)(i)),funds:o,admin:(0,hu.omitDefault)(g)}),fromAmino:({sender:e,code_id:n,label:t,msg:i,funds:o,admin:g})=>({sender:e,codeId:BigInt(n),label:t,msg:(0,Pn.toUtf8)(JSON.stringify(i)),funds:[...o],admin:g??""})},"/cosmwasm.wasm.v1.MsgInstantiateContract2":{aminoType:"wasm/MsgInstantiateContract2",toAmino:({sender:e,codeId:n,label:t,msg:i,funds:o,admin:g,salt:C,fixMsg:w})=>({sender:e,code_id:n.toString(),label:t,msg:JSON.parse((0,Pn.fromUtf8)(i)),funds:o,admin:(0,hu.omitDefault)(g),salt:(0,Pn.toBase64)(C),fix_msg:(0,hu.omitDefault)(w)}),fromAmino:({sender:e,code_id:n,label:t,msg:i,funds:o,admin:g,salt:C,fix_msg:w})=>({sender:e,codeId:BigInt(n),label:t,msg:(0,Pn.toUtf8)(JSON.stringify(i)),funds:[...o],admin:g??"",salt:(0,Pn.fromBase64)(C),fixMsg:w??!1})},"/cosmwasm.wasm.v1.MsgUpdateAdmin":{aminoType:"wasm/MsgUpdateAdmin",toAmino:({sender:e,newAdmin:n,contract:t})=>({sender:e,new_admin:n,contract:t}),fromAmino:({sender:e,new_admin:n,contract:t})=>({sender:e,newAdmin:n,contract:t})},"/cosmwasm.wasm.v1.MsgClearAdmin":{aminoType:"wasm/MsgClearAdmin",toAmino:({sender:e,contract:n})=>({sender:e,contract:n}),fromAmino:({sender:e,contract:n})=>({sender:e,contract:n})},"/cosmwasm.wasm.v1.MsgExecuteContract":{aminoType:"wasm/MsgExecuteContract",toAmino:({sender:e,contract:n,msg:t,funds:i})=>({sender:e,contract:n,msg:JSON.parse((0,Pn.fromUtf8)(t)),funds:i}),fromAmino:({sender:e,contract:n,msg:t,funds:i})=>({sender:e,contract:n,msg:(0,Pn.toUtf8)(JSON.stringify(t)),funds:[...i]})},"/cosmwasm.wasm.v1.MsgMigrateContract":{aminoType:"wasm/MsgMigrateContract",toAmino:({sender:e,contract:n,codeId:t,msg:i})=>({sender:e,contract:n,code_id:t.toString(),msg:JSON.parse((0,Pn.fromUtf8)(i))}),fromAmino:({sender:e,contract:n,code_id:t,msg:i})=>({sender:e,contract:n,codeId:BigInt(t),msg:(0,Pn.toUtf8)(JSON.stringify(i))})}}}Ht.createWasmAminoConverters=Rb;var Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.isMsgExecuteEncodeObject=Ue.isMsgMigrateEncodeObject=Ue.isMsgClearAdminEncodeObject=Ue.isMsgUpdateAdminEncodeObject=Ue.isMsgInstantiateContract2EncodeObject=Ue.isMsgInstantiateContractEncodeObject=Ue.isMsgStoreCodeEncodeObject=Ue.wasmTypes=void 0;const Ft=Gs;Ue.wasmTypes=[["/cosmwasm.wasm.v1.MsgClearAdmin",Ft.MsgClearAdmin],["/cosmwasm.wasm.v1.MsgExecuteContract",Ft.MsgExecuteContract],["/cosmwasm.wasm.v1.MsgMigrateContract",Ft.MsgMigrateContract],["/cosmwasm.wasm.v1.MsgStoreCode",Ft.MsgStoreCode],["/cosmwasm.wasm.v1.MsgInstantiateContract",Ft.MsgInstantiateContract],["/cosmwasm.wasm.v1.MsgInstantiateContract2",Ft.MsgInstantiateContract2],["/cosmwasm.wasm.v1.MsgUpdateAdmin",Ft.MsgUpdateAdmin]];function Bb(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgStoreCode"}Ue.isMsgStoreCodeEncodeObject=Bb;function bb(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgInstantiateContract"}Ue.isMsgInstantiateContractEncodeObject=bb;function Eb(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgInstantiateContract2"}Ue.isMsgInstantiateContract2EncodeObject=Eb;function Ib(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgUpdateAdmin"}Ue.isMsgUpdateAdminEncodeObject=Ib;function Ob(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgClearAdmin"}Ue.isMsgClearAdminEncodeObject=Ob;function Ab(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgMigrateContract"}Ue.isMsgMigrateEncodeObject=Ab;function Tb(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgExecuteContract"}Ue.isMsgExecuteEncodeObject=Tb;var $s={},Th={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryContractsByCreatorResponse=e.QueryContractsByCreatorRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.QueryPinnedCodesResponse=e.QueryPinnedCodesRequest=e.QueryCodesResponse=e.QueryCodesRequest=e.QueryCodeResponse=e.CodeInfoResponse=e.QueryCodeRequest=e.QuerySmartContractStateResponse=e.QuerySmartContractStateRequest=e.QueryRawContractStateResponse=e.QueryRawContractStateRequest=e.QueryAllContractStateResponse=e.QueryAllContractStateRequest=e.QueryContractsByCodeResponse=e.QueryContractsByCodeRequest=e.QueryContractHistoryResponse=e.QueryContractHistoryRequest=e.QueryContractInfoResponse=e.QueryContractInfoRequest=e.protobufPackage=void 0;const n=Be,t=Ho,i=_.binary,o=_.helpers;e.protobufPackage="cosmwasm.wasm.v1";function g(){return{address:""}}e.QueryContractInfoRequest={typeUrl:"/cosmwasm.wasm.v1.QueryContractInfoRequest",encode(m,h=i.BinaryWriter.create()){return m.address!==""&&h.uint32(10).string(m.address),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=g();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.address=T.string();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=g();return(0,o.isSet)(m.address)&&(h.address=String(m.address)),h},toJSON(m){const h={};return m.address!==void 0&&(h.address=m.address),h},fromPartial(m){const h=g();return h.address=m.address??"",h}};function C(){return{address:"",contractInfo:t.ContractInfo.fromPartial({})}}e.QueryContractInfoResponse={typeUrl:"/cosmwasm.wasm.v1.QueryContractInfoResponse",encode(m,h=i.BinaryWriter.create()){return m.address!==""&&h.uint32(10).string(m.address),m.contractInfo!==void 0&&t.ContractInfo.encode(m.contractInfo,h.uint32(18).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=C();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.address=T.string();break;case 2:H.contractInfo=t.ContractInfo.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=C();return(0,o.isSet)(m.address)&&(h.address=String(m.address)),(0,o.isSet)(m.contractInfo)&&(h.contractInfo=t.ContractInfo.fromJSON(m.contractInfo)),h},toJSON(m){const h={};return m.address!==void 0&&(h.address=m.address),m.contractInfo!==void 0&&(h.contractInfo=m.contractInfo?t.ContractInfo.toJSON(m.contractInfo):void 0),h},fromPartial(m){const h=C();return h.address=m.address??"",m.contractInfo!==void 0&&m.contractInfo!==null&&(h.contractInfo=t.ContractInfo.fromPartial(m.contractInfo)),h}};function w(){return{address:"",pagination:void 0}}e.QueryContractHistoryRequest={typeUrl:"/cosmwasm.wasm.v1.QueryContractHistoryRequest",encode(m,h=i.BinaryWriter.create()){return m.address!==""&&h.uint32(10).string(m.address),m.pagination!==void 0&&n.PageRequest.encode(m.pagination,h.uint32(18).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=w();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.address=T.string();break;case 2:H.pagination=n.PageRequest.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=w();return(0,o.isSet)(m.address)&&(h.address=String(m.address)),(0,o.isSet)(m.pagination)&&(h.pagination=n.PageRequest.fromJSON(m.pagination)),h},toJSON(m){const h={};return m.address!==void 0&&(h.address=m.address),m.pagination!==void 0&&(h.pagination=m.pagination?n.PageRequest.toJSON(m.pagination):void 0),h},fromPartial(m){const h=w();return h.address=m.address??"",m.pagination!==void 0&&m.pagination!==null&&(h.pagination=n.PageRequest.fromPartial(m.pagination)),h}};function E(){return{entries:[],pagination:void 0}}e.QueryContractHistoryResponse={typeUrl:"/cosmwasm.wasm.v1.QueryContractHistoryResponse",encode(m,h=i.BinaryWriter.create()){for(const T of m.entries)t.ContractCodeHistoryEntry.encode(T,h.uint32(10).fork()).ldelim();return m.pagination!==void 0&&n.PageResponse.encode(m.pagination,h.uint32(18).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=E();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.entries.push(t.ContractCodeHistoryEntry.decode(T,T.uint32()));break;case 2:H.pagination=n.PageResponse.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=E();return Array.isArray(m==null?void 0:m.entries)&&(h.entries=m.entries.map(T=>t.ContractCodeHistoryEntry.fromJSON(T))),(0,o.isSet)(m.pagination)&&(h.pagination=n.PageResponse.fromJSON(m.pagination)),h},toJSON(m){const h={};return m.entries?h.entries=m.entries.map(T=>T?t.ContractCodeHistoryEntry.toJSON(T):void 0):h.entries=[],m.pagination!==void 0&&(h.pagination=m.pagination?n.PageResponse.toJSON(m.pagination):void 0),h},fromPartial(m){var T;const h=E();return h.entries=((T=m.entries)==null?void 0:T.map(Q=>t.ContractCodeHistoryEntry.fromPartial(Q)))||[],m.pagination!==void 0&&m.pagination!==null&&(h.pagination=n.PageResponse.fromPartial(m.pagination)),h}};function D(){return{codeId:BigInt(0),pagination:void 0}}e.QueryContractsByCodeRequest={typeUrl:"/cosmwasm.wasm.v1.QueryContractsByCodeRequest",encode(m,h=i.BinaryWriter.create()){return m.codeId!==BigInt(0)&&h.uint32(8).uint64(m.codeId),m.pagination!==void 0&&n.PageRequest.encode(m.pagination,h.uint32(18).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=D();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.codeId=T.uint64();break;case 2:H.pagination=n.PageRequest.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=D();return(0,o.isSet)(m.codeId)&&(h.codeId=BigInt(m.codeId.toString())),(0,o.isSet)(m.pagination)&&(h.pagination=n.PageRequest.fromJSON(m.pagination)),h},toJSON(m){const h={};return m.codeId!==void 0&&(h.codeId=(m.codeId||BigInt(0)).toString()),m.pagination!==void 0&&(h.pagination=m.pagination?n.PageRequest.toJSON(m.pagination):void 0),h},fromPartial(m){const h=D();return m.codeId!==void 0&&m.codeId!==null&&(h.codeId=BigInt(m.codeId.toString())),m.pagination!==void 0&&m.pagination!==null&&(h.pagination=n.PageRequest.fromPartial(m.pagination)),h}};function J(){return{contracts:[],pagination:void 0}}e.QueryContractsByCodeResponse={typeUrl:"/cosmwasm.wasm.v1.QueryContractsByCodeResponse",encode(m,h=i.BinaryWriter.create()){for(const T of m.contracts)h.uint32(10).string(T);return m.pagination!==void 0&&n.PageResponse.encode(m.pagination,h.uint32(18).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=J();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.contracts.push(T.string());break;case 2:H.pagination=n.PageResponse.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=J();return Array.isArray(m==null?void 0:m.contracts)&&(h.contracts=m.contracts.map(T=>String(T))),(0,o.isSet)(m.pagination)&&(h.pagination=n.PageResponse.fromJSON(m.pagination)),h},toJSON(m){const h={};return m.contracts?h.contracts=m.contracts.map(T=>T):h.contracts=[],m.pagination!==void 0&&(h.pagination=m.pagination?n.PageResponse.toJSON(m.pagination):void 0),h},fromPartial(m){var T;const h=J();return h.contracts=((T=m.contracts)==null?void 0:T.map(Q=>Q))||[],m.pagination!==void 0&&m.pagination!==null&&(h.pagination=n.PageResponse.fromPartial(m.pagination)),h}};function b(){return{address:"",pagination:void 0}}e.QueryAllContractStateRequest={typeUrl:"/cosmwasm.wasm.v1.QueryAllContractStateRequest",encode(m,h=i.BinaryWriter.create()){return m.address!==""&&h.uint32(10).string(m.address),m.pagination!==void 0&&n.PageRequest.encode(m.pagination,h.uint32(18).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=b();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.address=T.string();break;case 2:H.pagination=n.PageRequest.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=b();return(0,o.isSet)(m.address)&&(h.address=String(m.address)),(0,o.isSet)(m.pagination)&&(h.pagination=n.PageRequest.fromJSON(m.pagination)),h},toJSON(m){const h={};return m.address!==void 0&&(h.address=m.address),m.pagination!==void 0&&(h.pagination=m.pagination?n.PageRequest.toJSON(m.pagination):void 0),h},fromPartial(m){const h=b();return h.address=m.address??"",m.pagination!==void 0&&m.pagination!==null&&(h.pagination=n.PageRequest.fromPartial(m.pagination)),h}};function p(){return{models:[],pagination:void 0}}e.QueryAllContractStateResponse={typeUrl:"/cosmwasm.wasm.v1.QueryAllContractStateResponse",encode(m,h=i.BinaryWriter.create()){for(const T of m.models)t.Model.encode(T,h.uint32(10).fork()).ldelim();return m.pagination!==void 0&&n.PageResponse.encode(m.pagination,h.uint32(18).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=p();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.models.push(t.Model.decode(T,T.uint32()));break;case 2:H.pagination=n.PageResponse.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=p();return Array.isArray(m==null?void 0:m.models)&&(h.models=m.models.map(T=>t.Model.fromJSON(T))),(0,o.isSet)(m.pagination)&&(h.pagination=n.PageResponse.fromJSON(m.pagination)),h},toJSON(m){const h={};return m.models?h.models=m.models.map(T=>T?t.Model.toJSON(T):void 0):h.models=[],m.pagination!==void 0&&(h.pagination=m.pagination?n.PageResponse.toJSON(m.pagination):void 0),h},fromPartial(m){var T;const h=p();return h.models=((T=m.models)==null?void 0:T.map(Q=>t.Model.fromPartial(Q)))||[],m.pagination!==void 0&&m.pagination!==null&&(h.pagination=n.PageResponse.fromPartial(m.pagination)),h}};function S(){return{address:"",queryData:new Uint8Array}}e.QueryRawContractStateRequest={typeUrl:"/cosmwasm.wasm.v1.QueryRawContractStateRequest",encode(m,h=i.BinaryWriter.create()){return m.address!==""&&h.uint32(10).string(m.address),m.queryData.length!==0&&h.uint32(18).bytes(m.queryData),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=S();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.address=T.string();break;case 2:H.queryData=T.bytes();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=S();return(0,o.isSet)(m.address)&&(h.address=String(m.address)),(0,o.isSet)(m.queryData)&&(h.queryData=(0,o.bytesFromBase64)(m.queryData)),h},toJSON(m){const h={};return m.address!==void 0&&(h.address=m.address),m.queryData!==void 0&&(h.queryData=(0,o.base64FromBytes)(m.queryData!==void 0?m.queryData:new Uint8Array)),h},fromPartial(m){const h=S();return h.address=m.address??"",h.queryData=m.queryData??new Uint8Array,h}};function R(){return{data:new Uint8Array}}e.QueryRawContractStateResponse={typeUrl:"/cosmwasm.wasm.v1.QueryRawContractStateResponse",encode(m,h=i.BinaryWriter.create()){return m.data.length!==0&&h.uint32(10).bytes(m.data),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=R();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.data=T.bytes();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=R();return(0,o.isSet)(m.data)&&(h.data=(0,o.bytesFromBase64)(m.data)),h},toJSON(m){const h={};return m.data!==void 0&&(h.data=(0,o.base64FromBytes)(m.data!==void 0?m.data:new Uint8Array)),h},fromPartial(m){const h=R();return h.data=m.data??new Uint8Array,h}};function u(){return{address:"",queryData:new Uint8Array}}e.QuerySmartContractStateRequest={typeUrl:"/cosmwasm.wasm.v1.QuerySmartContractStateRequest",encode(m,h=i.BinaryWriter.create()){return m.address!==""&&h.uint32(10).string(m.address),m.queryData.length!==0&&h.uint32(18).bytes(m.queryData),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=u();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.address=T.string();break;case 2:H.queryData=T.bytes();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=u();return(0,o.isSet)(m.address)&&(h.address=String(m.address)),(0,o.isSet)(m.queryData)&&(h.queryData=(0,o.bytesFromBase64)(m.queryData)),h},toJSON(m){const h={};return m.address!==void 0&&(h.address=m.address),m.queryData!==void 0&&(h.queryData=(0,o.base64FromBytes)(m.queryData!==void 0?m.queryData:new Uint8Array)),h},fromPartial(m){const h=u();return h.address=m.address??"",h.queryData=m.queryData??new Uint8Array,h}};function c(){return{data:new Uint8Array}}e.QuerySmartContractStateResponse={typeUrl:"/cosmwasm.wasm.v1.QuerySmartContractStateResponse",encode(m,h=i.BinaryWriter.create()){return m.data.length!==0&&h.uint32(10).bytes(m.data),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=c();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.data=T.bytes();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=c();return(0,o.isSet)(m.data)&&(h.data=(0,o.bytesFromBase64)(m.data)),h},toJSON(m){const h={};return m.data!==void 0&&(h.data=(0,o.base64FromBytes)(m.data!==void 0?m.data:new Uint8Array)),h},fromPartial(m){const h=c();return h.data=m.data??new Uint8Array,h}};function y(){return{codeId:BigInt(0)}}e.QueryCodeRequest={typeUrl:"/cosmwasm.wasm.v1.QueryCodeRequest",encode(m,h=i.BinaryWriter.create()){return m.codeId!==BigInt(0)&&h.uint32(8).uint64(m.codeId),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=y();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.codeId=T.uint64();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=y();return(0,o.isSet)(m.codeId)&&(h.codeId=BigInt(m.codeId.toString())),h},toJSON(m){const h={};return m.codeId!==void 0&&(h.codeId=(m.codeId||BigInt(0)).toString()),h},fromPartial(m){const h=y();return m.codeId!==void 0&&m.codeId!==null&&(h.codeId=BigInt(m.codeId.toString())),h}};function B(){return{codeId:BigInt(0),creator:"",dataHash:new Uint8Array,instantiatePermission:t.AccessConfig.fromPartial({})}}e.CodeInfoResponse={typeUrl:"/cosmwasm.wasm.v1.CodeInfoResponse",encode(m,h=i.BinaryWriter.create()){return m.codeId!==BigInt(0)&&h.uint32(8).uint64(m.codeId),m.creator!==""&&h.uint32(18).string(m.creator),m.dataHash.length!==0&&h.uint32(26).bytes(m.dataHash),m.instantiatePermission!==void 0&&t.AccessConfig.encode(m.instantiatePermission,h.uint32(50).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=B();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.codeId=T.uint64();break;case 2:H.creator=T.string();break;case 3:H.dataHash=T.bytes();break;case 6:H.instantiatePermission=t.AccessConfig.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=B();return(0,o.isSet)(m.codeId)&&(h.codeId=BigInt(m.codeId.toString())),(0,o.isSet)(m.creator)&&(h.creator=String(m.creator)),(0,o.isSet)(m.dataHash)&&(h.dataHash=(0,o.bytesFromBase64)(m.dataHash)),(0,o.isSet)(m.instantiatePermission)&&(h.instantiatePermission=t.AccessConfig.fromJSON(m.instantiatePermission)),h},toJSON(m){const h={};return m.codeId!==void 0&&(h.codeId=(m.codeId||BigInt(0)).toString()),m.creator!==void 0&&(h.creator=m.creator),m.dataHash!==void 0&&(h.dataHash=(0,o.base64FromBytes)(m.dataHash!==void 0?m.dataHash:new Uint8Array)),m.instantiatePermission!==void 0&&(h.instantiatePermission=m.instantiatePermission?t.AccessConfig.toJSON(m.instantiatePermission):void 0),h},fromPartial(m){const h=B();return m.codeId!==void 0&&m.codeId!==null&&(h.codeId=BigInt(m.codeId.toString())),h.creator=m.creator??"",h.dataHash=m.dataHash??new Uint8Array,m.instantiatePermission!==void 0&&m.instantiatePermission!==null&&(h.instantiatePermission=t.AccessConfig.fromPartial(m.instantiatePermission)),h}};function N(){return{codeInfo:void 0,data:new Uint8Array}}e.QueryCodeResponse={typeUrl:"/cosmwasm.wasm.v1.QueryCodeResponse",encode(m,h=i.BinaryWriter.create()){return m.codeInfo!==void 0&&e.CodeInfoResponse.encode(m.codeInfo,h.uint32(10).fork()).ldelim(),m.data.length!==0&&h.uint32(18).bytes(m.data),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=N();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.codeInfo=e.CodeInfoResponse.decode(T,T.uint32());break;case 2:H.data=T.bytes();break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=N();return(0,o.isSet)(m.codeInfo)&&(h.codeInfo=e.CodeInfoResponse.fromJSON(m.codeInfo)),(0,o.isSet)(m.data)&&(h.data=(0,o.bytesFromBase64)(m.data)),h},toJSON(m){const h={};return m.codeInfo!==void 0&&(h.codeInfo=m.codeInfo?e.CodeInfoResponse.toJSON(m.codeInfo):void 0),m.data!==void 0&&(h.data=(0,o.base64FromBytes)(m.data!==void 0?m.data:new Uint8Array)),h},fromPartial(m){const h=N();return m.codeInfo!==void 0&&m.codeInfo!==null&&(h.codeInfo=e.CodeInfoResponse.fromPartial(m.codeInfo)),h.data=m.data??new Uint8Array,h}};function U(){return{pagination:void 0}}e.QueryCodesRequest={typeUrl:"/cosmwasm.wasm.v1.QueryCodesRequest",encode(m,h=i.BinaryWriter.create()){return m.pagination!==void 0&&n.PageRequest.encode(m.pagination,h.uint32(10).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=U();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.pagination=n.PageRequest.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=U();return(0,o.isSet)(m.pagination)&&(h.pagination=n.PageRequest.fromJSON(m.pagination)),h},toJSON(m){const h={};return m.pagination!==void 0&&(h.pagination=m.pagination?n.PageRequest.toJSON(m.pagination):void 0),h},fromPartial(m){const h=U();return m.pagination!==void 0&&m.pagination!==null&&(h.pagination=n.PageRequest.fromPartial(m.pagination)),h}};function W(){return{codeInfos:[],pagination:void 0}}e.QueryCodesResponse={typeUrl:"/cosmwasm.wasm.v1.QueryCodesResponse",encode(m,h=i.BinaryWriter.create()){for(const T of m.codeInfos)e.CodeInfoResponse.encode(T,h.uint32(10).fork()).ldelim();return m.pagination!==void 0&&n.PageResponse.encode(m.pagination,h.uint32(18).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=W();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.codeInfos.push(e.CodeInfoResponse.decode(T,T.uint32()));break;case 2:H.pagination=n.PageResponse.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=W();return Array.isArray(m==null?void 0:m.codeInfos)&&(h.codeInfos=m.codeInfos.map(T=>e.CodeInfoResponse.fromJSON(T))),(0,o.isSet)(m.pagination)&&(h.pagination=n.PageResponse.fromJSON(m.pagination)),h},toJSON(m){const h={};return m.codeInfos?h.codeInfos=m.codeInfos.map(T=>T?e.CodeInfoResponse.toJSON(T):void 0):h.codeInfos=[],m.pagination!==void 0&&(h.pagination=m.pagination?n.PageResponse.toJSON(m.pagination):void 0),h},fromPartial(m){var T;const h=W();return h.codeInfos=((T=m.codeInfos)==null?void 0:T.map(Q=>e.CodeInfoResponse.fromPartial(Q)))||[],m.pagination!==void 0&&m.pagination!==null&&(h.pagination=n.PageResponse.fromPartial(m.pagination)),h}};function r(){return{pagination:void 0}}e.QueryPinnedCodesRequest={typeUrl:"/cosmwasm.wasm.v1.QueryPinnedCodesRequest",encode(m,h=i.BinaryWriter.create()){return m.pagination!==void 0&&n.PageRequest.encode(m.pagination,h.uint32(18).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=r();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 2:H.pagination=n.PageRequest.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=r();return(0,o.isSet)(m.pagination)&&(h.pagination=n.PageRequest.fromJSON(m.pagination)),h},toJSON(m){const h={};return m.pagination!==void 0&&(h.pagination=m.pagination?n.PageRequest.toJSON(m.pagination):void 0),h},fromPartial(m){const h=r();return m.pagination!==void 0&&m.pagination!==null&&(h.pagination=n.PageRequest.fromPartial(m.pagination)),h}};function s(){return{codeIds:[],pagination:void 0}}e.QueryPinnedCodesResponse={typeUrl:"/cosmwasm.wasm.v1.QueryPinnedCodesResponse",encode(m,h=i.BinaryWriter.create()){h.uint32(10).fork();for(const T of m.codeIds)h.uint64(T);return h.ldelim(),m.pagination!==void 0&&n.PageResponse.encode(m.pagination,h.uint32(18).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=s();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:if((a&7)===2){const P=T.uint32()+T.pos;for(;T.pos<P;)H.codeIds.push(T.uint64())}else H.codeIds.push(T.uint64());break;case 2:H.pagination=n.PageResponse.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=s();return Array.isArray(m==null?void 0:m.codeIds)&&(h.codeIds=m.codeIds.map(T=>BigInt(T.toString()))),(0,o.isSet)(m.pagination)&&(h.pagination=n.PageResponse.fromJSON(m.pagination)),h},toJSON(m){const h={};return m.codeIds?h.codeIds=m.codeIds.map(T=>(T||BigInt(0)).toString()):h.codeIds=[],m.pagination!==void 0&&(h.pagination=m.pagination?n.PageResponse.toJSON(m.pagination):void 0),h},fromPartial(m){var T;const h=s();return h.codeIds=((T=m.codeIds)==null?void 0:T.map(Q=>BigInt(Q.toString())))||[],m.pagination!==void 0&&m.pagination!==null&&(h.pagination=n.PageResponse.fromPartial(m.pagination)),h}};function O(){return{}}e.QueryParamsRequest={typeUrl:"/cosmwasm.wasm.v1.QueryParamsRequest",encode(m,h=i.BinaryWriter.create()){return h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=O();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){default:T.skipType(a&7);break}}return H},fromJSON(m){return O()},toJSON(m){return{}},fromPartial(m){return O()}};function q(){return{params:t.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmwasm.wasm.v1.QueryParamsResponse",encode(m,h=i.BinaryWriter.create()){return m.params!==void 0&&t.Params.encode(m.params,h.uint32(10).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=q();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.params=t.Params.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=q();return(0,o.isSet)(m.params)&&(h.params=t.Params.fromJSON(m.params)),h},toJSON(m){const h={};return m.params!==void 0&&(h.params=m.params?t.Params.toJSON(m.params):void 0),h},fromPartial(m){const h=q();return m.params!==void 0&&m.params!==null&&(h.params=t.Params.fromPartial(m.params)),h}};function d(){return{creatorAddress:"",pagination:void 0}}e.QueryContractsByCreatorRequest={typeUrl:"/cosmwasm.wasm.v1.QueryContractsByCreatorRequest",encode(m,h=i.BinaryWriter.create()){return m.creatorAddress!==""&&h.uint32(10).string(m.creatorAddress),m.pagination!==void 0&&n.PageRequest.encode(m.pagination,h.uint32(18).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=d();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.creatorAddress=T.string();break;case 2:H.pagination=n.PageRequest.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=d();return(0,o.isSet)(m.creatorAddress)&&(h.creatorAddress=String(m.creatorAddress)),(0,o.isSet)(m.pagination)&&(h.pagination=n.PageRequest.fromJSON(m.pagination)),h},toJSON(m){const h={};return m.creatorAddress!==void 0&&(h.creatorAddress=m.creatorAddress),m.pagination!==void 0&&(h.pagination=m.pagination?n.PageRequest.toJSON(m.pagination):void 0),h},fromPartial(m){const h=d();return h.creatorAddress=m.creatorAddress??"",m.pagination!==void 0&&m.pagination!==null&&(h.pagination=n.PageRequest.fromPartial(m.pagination)),h}};function l(){return{contractAddresses:[],pagination:void 0}}e.QueryContractsByCreatorResponse={typeUrl:"/cosmwasm.wasm.v1.QueryContractsByCreatorResponse",encode(m,h=i.BinaryWriter.create()){for(const T of m.contractAddresses)h.uint32(10).string(T);return m.pagination!==void 0&&n.PageResponse.encode(m.pagination,h.uint32(18).fork()).ldelim(),h},decode(m,h){const T=m instanceof i.BinaryReader?m:new i.BinaryReader(m);let Q=h===void 0?T.len:T.pos+h;const H=l();for(;T.pos<Q;){const a=T.uint32();switch(a>>>3){case 1:H.contractAddresses.push(T.string());break;case 2:H.pagination=n.PageResponse.decode(T,T.uint32());break;default:T.skipType(a&7);break}}return H},fromJSON(m){const h=l();return Array.isArray(m==null?void 0:m.contractAddresses)&&(h.contractAddresses=m.contractAddresses.map(T=>String(T))),(0,o.isSet)(m.pagination)&&(h.pagination=n.PageResponse.fromJSON(m.pagination)),h},toJSON(m){const h={};return m.contractAddresses?h.contractAddresses=m.contractAddresses.map(T=>T):h.contractAddresses=[],m.pagination!==void 0&&(h.pagination=m.pagination?n.PageResponse.toJSON(m.pagination):void 0),h},fromPartial(m){var T;const h=l();return h.contractAddresses=((T=m.contractAddresses)==null?void 0:T.map(Q=>Q))||[],m.pagination!==void 0&&m.pagination!==null&&(h.pagination=n.PageResponse.fromPartial(m.pagination)),h}};class M{constructor(h){this.rpc=h,this.ContractInfo=this.ContractInfo.bind(this),this.ContractHistory=this.ContractHistory.bind(this),this.ContractsByCode=this.ContractsByCode.bind(this),this.AllContractState=this.AllContractState.bind(this),this.RawContractState=this.RawContractState.bind(this),this.SmartContractState=this.SmartContractState.bind(this),this.Code=this.Code.bind(this),this.Codes=this.Codes.bind(this),this.PinnedCodes=this.PinnedCodes.bind(this),this.Params=this.Params.bind(this),this.ContractsByCreator=this.ContractsByCreator.bind(this)}ContractInfo(h){const T=e.QueryContractInfoRequest.encode(h).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","ContractInfo",T).then(H=>e.QueryContractInfoResponse.decode(new i.BinaryReader(H)))}ContractHistory(h){const T=e.QueryContractHistoryRequest.encode(h).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","ContractHistory",T).then(H=>e.QueryContractHistoryResponse.decode(new i.BinaryReader(H)))}ContractsByCode(h){const T=e.QueryContractsByCodeRequest.encode(h).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","ContractsByCode",T).then(H=>e.QueryContractsByCodeResponse.decode(new i.BinaryReader(H)))}AllContractState(h){const T=e.QueryAllContractStateRequest.encode(h).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","AllContractState",T).then(H=>e.QueryAllContractStateResponse.decode(new i.BinaryReader(H)))}RawContractState(h){const T=e.QueryRawContractStateRequest.encode(h).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","RawContractState",T).then(H=>e.QueryRawContractStateResponse.decode(new i.BinaryReader(H)))}SmartContractState(h){const T=e.QuerySmartContractStateRequest.encode(h).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","SmartContractState",T).then(H=>e.QuerySmartContractStateResponse.decode(new i.BinaryReader(H)))}Code(h){const T=e.QueryCodeRequest.encode(h).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","Code",T).then(H=>e.QueryCodeResponse.decode(new i.BinaryReader(H)))}Codes(h={pagination:n.PageRequest.fromPartial({})}){const T=e.QueryCodesRequest.encode(h).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","Codes",T).then(H=>e.QueryCodesResponse.decode(new i.BinaryReader(H)))}PinnedCodes(h={pagination:n.PageRequest.fromPartial({})}){const T=e.QueryPinnedCodesRequest.encode(h).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","PinnedCodes",T).then(H=>e.QueryPinnedCodesResponse.decode(new i.BinaryReader(H)))}Params(h={}){const T=e.QueryParamsRequest.encode(h).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","Params",T).then(H=>e.QueryParamsResponse.decode(new i.BinaryReader(H)))}ContractsByCreator(h){const T=e.QueryContractsByCreatorRequest.encode(h).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","ContractsByCreator",T).then(H=>e.QueryContractsByCreatorResponse.decode(new i.BinaryReader(H)))}}e.QueryClientImpl=M})(Th);Object.defineProperty($s,"__esModule",{value:!0});$s.setupWasmExtension=void 0;const tf=ue,Er=bt,gu=Th;function Nb(e){const n=(0,Er.createProtobufRpcClient)(e),t=new gu.QueryClientImpl(n);return{wasm:{listCodeInfo:async i=>{const o={pagination:(0,Er.createPagination)(i)};return t.Codes(o)},getCode:async i=>{const o=gu.QueryCodeRequest.fromPartial({codeId:BigInt(i)});return t.Code(o)},listContractsByCodeId:async(i,o)=>{const g=gu.QueryContractsByCodeRequest.fromPartial({codeId:BigInt(i),pagination:(0,Er.createPagination)(o)});return t.ContractsByCode(g)},listContractsByCreator:async(i,o)=>{const g={creatorAddress:i,pagination:(0,Er.createPagination)(o)};return t.ContractsByCreator(g)},getContractInfo:async i=>{const o={address:i};return t.ContractInfo(o)},getContractCodeHistory:async(i,o)=>{const g={address:i,pagination:(0,Er.createPagination)(o)};return t.ContractHistory(g)},getAllContractState:async(i,o)=>{const g={address:i,pagination:(0,Er.createPagination)(o)};return t.AllContractState(g)},queryContractRaw:async(i,o)=>{const g={address:i,queryData:o};return t.RawContractState(g)},queryContractSmart:async(i,o)=>{const g={address:i,queryData:(0,tf.toUtf8)(JSON.stringify(o))},{data:C}=await t.SmartContractState(g);let w;try{w=(0,tf.fromUtf8)(C)}catch(E){throw new Error(`Could not UTF-8 decode smart query response from contract: ${E}`)}try{return JSON.parse(w)}catch(E){throw new Error(`Could not JSON parse smart query response from contract: ${E}`)}}}}}$s.setupWasmExtension=Nb;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.setupWasmExtension=e.wasmTypes=e.isMsgUpdateAdminEncodeObject=e.isMsgStoreCodeEncodeObject=e.isMsgMigrateEncodeObject=e.isMsgInstantiateContractEncodeObject=e.isMsgInstantiateContract2EncodeObject=e.isMsgExecuteEncodeObject=e.isMsgClearAdminEncodeObject=e.createWasmAminoConverters=void 0;var n=Ht;Object.defineProperty(e,"createWasmAminoConverters",{enumerable:!0,get:function(){return n.createWasmAminoConverters}});var t=Ue;Object.defineProperty(e,"isMsgClearAdminEncodeObject",{enumerable:!0,get:function(){return t.isMsgClearAdminEncodeObject}}),Object.defineProperty(e,"isMsgExecuteEncodeObject",{enumerable:!0,get:function(){return t.isMsgExecuteEncodeObject}}),Object.defineProperty(e,"isMsgInstantiateContract2EncodeObject",{enumerable:!0,get:function(){return t.isMsgInstantiateContract2EncodeObject}}),Object.defineProperty(e,"isMsgInstantiateContractEncodeObject",{enumerable:!0,get:function(){return t.isMsgInstantiateContractEncodeObject}}),Object.defineProperty(e,"isMsgMigrateEncodeObject",{enumerable:!0,get:function(){return t.isMsgMigrateEncodeObject}}),Object.defineProperty(e,"isMsgStoreCodeEncodeObject",{enumerable:!0,get:function(){return t.isMsgStoreCodeEncodeObject}}),Object.defineProperty(e,"isMsgUpdateAdminEncodeObject",{enumerable:!0,get:function(){return t.isMsgUpdateAdminEncodeObject}}),Object.defineProperty(e,"wasmTypes",{enumerable:!0,get:function(){return t.wasmTypes}});var i=$s;Object.defineProperty(e,"setupWasmExtension",{enumerable:!0,get:function(){return i.setupWasmExtension}})})(Ls);Object.defineProperty(qo,"__esModule",{value:!0});qo.CosmWasmClient=void 0;const Ir=ue,rf=Ne,lt=bt,of=wo,Or=Ie,wb=To,yu=Ho,_b=Ls;class Aa{static async connect(n){const t=await(0,of.connectComet)(n);return Aa.create(t)}static async create(n){return new Aa(n)}constructor(n){this.codesCache=new Map,n&&(this.cometClient=n,this.queryClient=lt.QueryClient.withExtensions(n,lt.setupAuthExtension,lt.setupBankExtension,_b.setupWasmExtension,lt.setupTxExtension))}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 t=(await this.forceGetCometClient().status()).nodeInfo.network;if(!t)throw new Error("Chain ID must not be empty");this.chainId=t}return this.chainId}async getHeight(){return(await this.forceGetCometClient().status()).syncInfo.latestBlockHeight}async getAccount(n){try{const t=await this.forceGetQueryClient().auth.account(n);return t?(0,lt.accountFromAny)(t):null}catch(t){if(/rpc error: code = NotFound/i.test(t.toString()))return null;throw t}}async getSequence(n){const t=await this.getAccount(n);if(!t)throw new Error(`Account '${n}' does not exist on chain. Send some tokens there before trying to query sequence.`);return{accountNumber:t.accountNumber,sequence:t.sequence}}async getBlock(n){const t=await this.forceGetCometClient().block(n);return{id:(0,Ir.toHex)(t.blockId.hash).toUpperCase(),header:{version:{block:new rf.Uint53(t.block.header.version.block).toString(),app:new rf.Uint53(t.block.header.version.app).toString()},height:t.block.header.height,chainId:t.block.header.chainId,time:(0,of.toRfc3339WithNanoseconds)(t.block.header.time)},txs:t.block.txs}}async getBalance(n,t){return this.forceGetQueryClient().bank.balance(n,t)}async getTx(n){return(await this.txsQuery(`tx.hash='${n}'`))[0]??null}async searchTx(n){let t;if(typeof n=="string")t=n;else if((0,lt.isSearchTxQueryArray)(n))t=n.map(i=>typeof i.value=="string"?`${i.key}='${i.value}'`:`${i.key}=${i.value}`).join(" AND ");else throw new Error("Got unsupported query type. See CosmJS 0.31 CHANGELOG for API breaking changes here.");return this.txsQuery(t)}disconnect(){this.cometClient&&this.cometClient.disconnect()}async broadcastTx(n,t=6e4,i=3e3){let o=!1;const g=setTimeout(()=>{o=!0},t),C=async E=>{if(o)throw new lt.TimeoutError(`Transaction with ID ${E} was submitted but was not yet found on the chain. You might want to check later. There was a wait of ${t/1e3} seconds.`,E);await(0,Or.sleep)(i);const D=await this.getTx(E);return D?{code:D.code,height:D.height,txIndex:D.txIndex,rawLog:D.rawLog,transactionHash:E,events:D.events,msgResponses:D.msgResponses,gasUsed:D.gasUsed,gasWanted:D.gasWanted}:C(E)},w=await this.broadcastTxSync(n);return new Promise((E,D)=>C(w).then(J=>{clearTimeout(g),E(J)},J=>{clearTimeout(g),D(J)}))}async broadcastTxSync(n){const t=await this.forceGetCometClient().broadcastTxSync({tx:n});return t.code?Promise.reject(new lt.BroadcastTxError(t.code,t.codespace??"",t.log)):(0,Ir.toHex)(t.hash).toUpperCase()}async getCodes(){const n=[];let t;do{const{codeInfos:i,pagination:o}=await this.forceGetQueryClient().wasm.listCodeInfo(t),g=i||[];n.push(...g),t=o==null?void 0:o.nextKey}while((t==null?void 0:t.length)!==0);return n.map(i=>((0,Or.assert)(i.creator&&i.codeId&&i.dataHash,"entry incomplete"),{id:Number(i.codeId),creator:i.creator,checksum:(0,Ir.toHex)(i.dataHash)}))}async getCodeDetails(n){const t=this.codesCache.get(n);if(t)return t;const{codeInfo:i,data:o}=await this.forceGetQueryClient().wasm.getCode(n);(0,Or.assert)(i&&i.codeId&&i.creator&&i.dataHash&&o,"codeInfo missing or incomplete");const g={id:Number(i.codeId),creator:i.creator,checksum:(0,Ir.toHex)(i.dataHash),data:o};return this.codesCache.set(n,g),g}async getContracts(n){const t=[];let i;do{const{contracts:o,pagination:g}=await this.forceGetQueryClient().wasm.listContractsByCodeId(n,i);t.push(...o),i=g==null?void 0:g.nextKey}while((i==null?void 0:i.length)!==0&&i!==void 0);return t}async getContractsByCreator(n){const t=[];let i;do{const{contractAddresses:o,pagination:g}=await this.forceGetQueryClient().wasm.listContractsByCreator(n,i);t.push(...o),i=g==null?void 0:g.nextKey}while((i==null?void 0:i.length)!==0&&i!==void 0);return t}async getContract(n){const{address:t,contractInfo:i}=await this.forceGetQueryClient().wasm.getContractInfo(n);if(!i)throw new Error(`No contract found at address "${n}"`);return(0,Or.assert)(t,"address missing"),(0,Or.assert)(i.codeId&&i.creator&&i.label,"contractInfo incomplete"),{address:t,codeId:Number(i.codeId),creator:i.creator,admin:i.admin||void 0,label:i.label,ibcPortId:i.ibcPortId||void 0}}async getContractCodeHistory(n){const t=await this.forceGetQueryClient().wasm.getContractCodeHistory(n);if(!t)throw new Error(`No contract history found for address "${n}"`);const i={[yu.ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT]:"Init",[yu.ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS]:"Genesis",[yu.ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE]:"Migrate"};return(t.entries||[]).map(o=>((0,Or.assert)(o.operation&&o.codeId&&o.msg),{operation:i[o.operation],codeId:Number(o.codeId),msg:JSON.parse((0,Ir.fromUtf8)(o.msg))}))}async queryContractRaw(n,t){await this.getContract(n);const{data:i}=await this.forceGetQueryClient().wasm.queryContractRaw(n,t);return i??null}async queryContractSmart(n,t){try{return await this.forceGetQueryClient().wasm.queryContractSmart(n,t)}catch(i){throw i instanceof Error&&i.message.startsWith("not found: contract")?new Error(`No contract found at address "${n}"`):i}}async txsQuery(n){return(await this.forceGetCometClient().txSearchAll({query:n})).txs.map(i=>{const o=wb.TxMsgData.decode(i.result.data??new Uint8Array);return{height:i.height,txIndex:i.index,hash:(0,Ir.toHex)(i.hash).toUpperCase(),code:i.result.code,events:i.result.events.map(lt.fromTendermintEvent),rawLog:i.result.log||"",tx:i.tx,msgResponses:o.msgResponses,gasUsed:i.result.gasUsed,gasWanted:i.result.gasWanted}})}}qo.CosmWasmClient=Aa;var Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.fromBinary=Ai.toBinary=void 0;const Ta=ue;function Mb(e){return(0,Ta.toBase64)((0,Ta.toUtf8)(JSON.stringify(e)))}Ai.toBinary=Mb;function Ub(e){return JSON.parse((0,Ta.fromUtf8)((0,Ta.fromBase64)(e)))}Ai.fromBinary=Ub;var Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.instantiate2Address=Ti._instantiate2AddressIntermediate=void 0;const af=$e,Xi=ue,Db=Ne,Jb=Ie;function Hb(e,n){return new af.Sha256((0,af.sha256)((0,Xi.toAscii)(e))).update(n).digest()}function aa(e){return Db.Uint64.fromNumber(e).toBytesBigEndian()}function Nh(e,n,t,i,o){(0,Jb.assert)(e.length===32);const g=(0,Xi.fromBech32)(n).data,C=typeof i=="string"?(0,Xi.toUtf8)(i):new Uint8Array;if(t.length<1||t.length>64)throw new Error("Salt must be between 1 and 64 bytes");const w=new Uint8Array([...(0,Xi.toAscii)("wasm"),0,...aa(e.length),...e,...aa(g.length),...g,...aa(t.length),...t,...aa(C.length),...C]),E=Hb("module",w),D=(0,Xi.toBech32)(o,E);return{key:w,addressData:E,address:D}}Ti._instantiate2AddressIntermediate=Nh;function qb(e,n,t,i){return Nh(e,n,t,null,i).address}Ti.instantiate2Address=qb;var Ni={},Vb=L.commonjsGlobal&&L.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ni,"__esModule",{value:!0});Ni.SigningCosmWasmClient=Ni.findAttribute=void 0;const sa=zn,Wb=$e,Gt=ue,Lt=Ne,ft=ut,we=bt,Qb=wo,zi=Ie,Fb=bo,sf=Ao,Gb=_.signing,da=_.tx,$t=Gs,Lb=Vb(Re.require$$14),$b=qo,df=Ls;function ma(e,n,t){const o=e.filter(g=>g.type===n).flatMap(g=>g.attributes).find(g=>g.key===t);if(!o)throw new Error(`Could not find attribute '${t}' in first event of type '${n}' in first log.`);return o}Ni.findAttribute=ma;function Kt(e){return`Error when broadcasting tx ${e.transactionHash} at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`}class to extends $b.CosmWasmClient{static async connectWithSigner(n,t,i={}){const o=await(0,Qb.connectComet)(n);return to.createWithSigner(o,t,i)}static async createWithSigner(n,t,i={}){return new to(n,t,i)}static async offline(n,t={}){return new to(void 0,n,t)}constructor(n,t,i){super(n),this.defaultGasMultiplier=1.4;const{registry:o=new ft.Registry([...we.defaultRegistryTypes,...df.wasmTypes]),aminoTypes:g=new we.AminoTypes({...(0,we.createDefaultAminoConverters)(),...(0,df.createWasmAminoConverters)()})}=i;this.registry=o,this.aminoTypes=g,this.signer=t,this.broadcastTimeoutMs=i.broadcastTimeoutMs,this.broadcastPollIntervalMs=i.broadcastPollIntervalMs,this.gasPrice=i.gasPrice}async simulate(n,t,i){const o=t.map(D=>this.registry.encodeAsAny(D)),g=(await this.signer.getAccounts()).find(D=>D.address===n);if(!g)throw new Error("Failed to retrieve account from signer");const C=(0,sa.encodeSecp256k1Pubkey)(g.pubkey),{sequence:w}=await this.getSequence(n),{gasInfo:E}=await this.forceGetQueryClient().tx.simulate(o,i,C,w);return(0,zi.assertDefined)(E),Lt.Uint53.fromString(E.gasUsed.toString()).toNumber()}async upload(n,t,i,o="",g){const C=Lb.default.gzip(t,{level:9}),w={typeUrl:"/cosmwasm.wasm.v1.MsgStoreCode",value:$t.MsgStoreCode.fromPartial({sender:n,wasmByteCode:C,instantiatePermission:g})},E=i=="auto"?1.1:i,D=await this.signAndBroadcast(n,[w],E,o);if((0,we.isDeliverTxFailure)(D))throw new Error(Kt(D));const J=ma(D.events,"store_code","code_id");return{checksum:(0,Gt.toHex)((0,Wb.sha256)(t)),originalSize:t.length,compressedSize:C.length,codeId:Number.parseInt(J.value,10),logs:we.logs.parseRawLog(D.rawLog),height:D.height,transactionHash:D.transactionHash,events:D.events,gasWanted:D.gasWanted,gasUsed:D.gasUsed}}async instantiate(n,t,i,o,g,C={}){const w={typeUrl:"/cosmwasm.wasm.v1.MsgInstantiateContract",value:$t.MsgInstantiateContract.fromPartial({sender:n,codeId:BigInt(new Lt.Uint53(t).toString()),label:o,msg:(0,Gt.toUtf8)(JSON.stringify(i)),funds:[...C.funds||[]],admin:C.admin})},E=await this.signAndBroadcast(n,[w],g,C.memo);if((0,we.isDeliverTxFailure)(E))throw new Error(Kt(E));return{contractAddress:ma(E.events,"instantiate","_contract_address").value,logs:we.logs.parseRawLog(E.rawLog),height:E.height,transactionHash:E.transactionHash,events:E.events,gasWanted:E.gasWanted,gasUsed:E.gasUsed}}async instantiate2(n,t,i,o,g,C,w={}){const E={typeUrl:"/cosmwasm.wasm.v1.MsgInstantiateContract2",value:$t.MsgInstantiateContract2.fromPartial({sender:n,codeId:BigInt(new Lt.Uint53(t).toString()),label:g,msg:(0,Gt.toUtf8)(JSON.stringify(o)),funds:[...w.funds||[]],admin:w.admin,salt:i,fixMsg:!1})},D=await this.signAndBroadcast(n,[E],C,w.memo);if((0,we.isDeliverTxFailure)(D))throw new Error(Kt(D));return{contractAddress:ma(D.events,"instantiate","_contract_address").value,logs:we.logs.parseRawLog(D.rawLog),height:D.height,transactionHash:D.transactionHash,events:D.events,gasWanted:D.gasWanted,gasUsed:D.gasUsed}}async updateAdmin(n,t,i,o,g=""){const C={typeUrl:"/cosmwasm.wasm.v1.MsgUpdateAdmin",value:$t.MsgUpdateAdmin.fromPartial({sender:n,contract:t,newAdmin:i})},w=await this.signAndBroadcast(n,[C],o,g);if((0,we.isDeliverTxFailure)(w))throw new Error(Kt(w));return{logs:we.logs.parseRawLog(w.rawLog),height:w.height,transactionHash:w.transactionHash,events:w.events,gasWanted:w.gasWanted,gasUsed:w.gasUsed}}async clearAdmin(n,t,i,o=""){const g={typeUrl:"/cosmwasm.wasm.v1.MsgClearAdmin",value:$t.MsgClearAdmin.fromPartial({sender:n,contract:t})},C=await this.signAndBroadcast(n,[g],i,o);if((0,we.isDeliverTxFailure)(C))throw new Error(Kt(C));return{logs:we.logs.parseRawLog(C.rawLog),height:C.height,transactionHash:C.transactionHash,events:C.events,gasWanted:C.gasWanted,gasUsed:C.gasUsed}}async migrate(n,t,i,o,g,C=""){const w={typeUrl:"/cosmwasm.wasm.v1.MsgMigrateContract",value:$t.MsgMigrateContract.fromPartial({sender:n,contract:t,codeId:BigInt(new Lt.Uint53(i).toString()),msg:(0,Gt.toUtf8)(JSON.stringify(o))})},E=await this.signAndBroadcast(n,[w],g,C);if((0,we.isDeliverTxFailure)(E))throw new Error(Kt(E));return{logs:we.logs.parseRawLog(E.rawLog),height:E.height,transactionHash:E.transactionHash,events:E.events,gasWanted:E.gasWanted,gasUsed:E.gasUsed}}async execute(n,t,i,o,g="",C){const w={contractAddress:t,msg:i,funds:C};return this.executeMultiple(n,[w],o,g)}async executeMultiple(n,t,i,o=""){const g=t.map(w=>({typeUrl:"/cosmwasm.wasm.v1.MsgExecuteContract",value:$t.MsgExecuteContract.fromPartial({sender:n,contract:w.contractAddress,msg:(0,Gt.toUtf8)(JSON.stringify(w.msg)),funds:[...w.funds||[]]})})),C=await this.signAndBroadcast(n,g,i,o);if((0,we.isDeliverTxFailure)(C))throw new Error(Kt(C));return{logs:we.logs.parseRawLog(C.rawLog),height:C.height,transactionHash:C.transactionHash,events:C.events,gasWanted:C.gasWanted,gasUsed:C.gasUsed}}async sendTokens(n,t,i,o,g=""){const C={typeUrl:"/cosmos.bank.v1beta1.MsgSend",value:{fromAddress:n,toAddress:t,amount:[...i]}};return this.signAndBroadcast(n,[C],o,g)}async delegateTokens(n,t,i,o,g=""){const C={typeUrl:"/cosmos.staking.v1beta1.MsgDelegate",value:sf.MsgDelegate.fromPartial({delegatorAddress:n,validatorAddress:t,amount:i})};return this.signAndBroadcast(n,[C],o,g)}async undelegateTokens(n,t,i,o,g=""){const C={typeUrl:"/cosmos.staking.v1beta1.MsgUndelegate",value:sf.MsgUndelegate.fromPartial({delegatorAddress:n,validatorAddress:t,amount:i})};return this.signAndBroadcast(n,[C],o,g)}async withdrawRewards(n,t,i,o=""){const g={typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",value:Fb.MsgWithdrawDelegatorReward.fromPartial({delegatorAddress:n,validatorAddress:t})};return this.signAndBroadcast(n,[g],i,o)}async signAndBroadcast(n,t,i,o="",g){let C;if(i=="auto"||typeof i=="number"){(0,zi.assertDefined)(this.gasPrice,"Gas price must be set in the client options when auto gas is used.");const D=await this.simulate(n,t,o),J=typeof i=="number"?i:this.defaultGasMultiplier;C=(0,we.calculateFee)(Math.round(D*J),this.gasPrice)}else C=i;const w=await this.sign(n,t,C,o,void 0,g),E=da.TxRaw.encode(w).finish();return this.broadcastTx(E,this.broadcastTimeoutMs,this.broadcastPollIntervalMs)}async signAndBroadcastSync(n,t,i,o="",g){let C;if(i=="auto"||typeof i=="number"){(0,zi.assertDefined)(this.gasPrice,"Gas price must be set in the client options when auto gas is used.");const D=await this.simulate(n,t,o),J=typeof i=="number"?i:this.defaultGasMultiplier;C=(0,we.calculateFee)(Math.round(D*J),this.gasPrice)}else C=i;const w=await this.sign(n,t,C,o,void 0,g),E=da.TxRaw.encode(w).finish();return this.broadcastTxSync(E)}async sign(n,t,i,o,g,C){let w;if(g)w=g;else{const{accountNumber:E,sequence:D}=await this.getSequence(n),J=await this.getChainId();w={accountNumber:E,sequence:D,chainId:J}}return(0,ft.isOfflineDirectSigner)(this.signer)?this.signDirect(n,t,i,o,w,C):this.signAmino(n,t,i,o,w,C)}async signAmino(n,t,i,o,{accountNumber:g,sequence:C,chainId:w},E){(0,zi.assert)(!(0,ft.isOfflineDirectSigner)(this.signer));const D=(await this.signer.getAccounts()).find(W=>W.address===n);if(!D)throw new Error("Failed to retrieve account from signer");const J=(0,ft.encodePubkey)((0,sa.encodeSecp256k1Pubkey)(D.pubkey)),b=Gb.SignMode.SIGN_MODE_LEGACY_AMINO_JSON,p=t.map(W=>this.aminoTypes.toAmino(W)),S=(0,sa.makeSignDoc)(p,i,w,o,g,C,E),{signature:R,signed:u}=await this.signer.signAmino(n,S),c={typeUrl:"/cosmos.tx.v1beta1.TxBody",value:{messages:u.msgs.map(W=>this.aminoTypes.fromAmino(W)),memo:u.memo,timeoutHeight:E}},y=this.registry.encode(c),B=Lt.Int53.fromString(u.fee.gas).toNumber(),N=Lt.Int53.fromString(u.sequence).toNumber(),U=(0,ft.makeAuthInfoBytes)([{pubkey:J,sequence:N}],u.fee.amount,B,u.fee.granter,u.fee.payer,b);return da.TxRaw.fromPartial({bodyBytes:y,authInfoBytes:U,signatures:[(0,Gt.fromBase64)(R.signature)]})}async signDirect(n,t,i,o,{accountNumber:g,sequence:C,chainId:w},E){(0,zi.assert)((0,ft.isOfflineDirectSigner)(this.signer));const D=(await this.signer.getAccounts()).find(B=>B.address===n);if(!D)throw new Error("Failed to retrieve account from signer");const J=(0,ft.encodePubkey)((0,sa.encodeSecp256k1Pubkey)(D.pubkey)),b={typeUrl:"/cosmos.tx.v1beta1.TxBody",value:{messages:t,memo:o,timeoutHeight:E}},p=this.registry.encode(b),S=Lt.Int53.fromString(i.gas).toNumber(),R=(0,ft.makeAuthInfoBytes)([{pubkey:J,sequence:C}],i.amount,S,i.granter,i.payer),u=(0,ft.makeSignDoc)(p,R,w,g),{signature:c,signed:y}=await this.signer.signDirect(n,u);return da.TxRaw.fromPartial({bodyBytes:y.bodyBytes,authInfoBytes:y.authInfoBytes,signatures:[(0,Gt.fromBase64)(c.signature)]})}}Ni.SigningCosmWasmClient=to;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SigningCosmWasmClient=e.wasmTypes=e.setupWasmExtension=e.isMsgUpdateAdminEncodeObject=e.isMsgStoreCodeEncodeObject=e.isMsgMigrateEncodeObject=e.isMsgInstantiateContractEncodeObject=e.isMsgInstantiateContract2EncodeObject=e.isMsgExecuteEncodeObject=e.isMsgClearAdminEncodeObject=e.createWasmAminoConverters=e.instantiate2Address=e._instantiate2AddressIntermediate=e.toBinary=e.fromBinary=e.CosmWasmClient=void 0;var n=qo;Object.defineProperty(e,"CosmWasmClient",{enumerable:!0,get:function(){return n.CosmWasmClient}});var t=Ai;Object.defineProperty(e,"fromBinary",{enumerable:!0,get:function(){return t.fromBinary}}),Object.defineProperty(e,"toBinary",{enumerable:!0,get:function(){return t.toBinary}});var i=Ti;Object.defineProperty(e,"_instantiate2AddressIntermediate",{enumerable:!0,get:function(){return i._instantiate2AddressIntermediate}}),Object.defineProperty(e,"instantiate2Address",{enumerable:!0,get:function(){return i.instantiate2Address}});var o=Ls;Object.defineProperty(e,"createWasmAminoConverters",{enumerable:!0,get:function(){return o.createWasmAminoConverters}}),Object.defineProperty(e,"isMsgClearAdminEncodeObject",{enumerable:!0,get:function(){return o.isMsgClearAdminEncodeObject}}),Object.defineProperty(e,"isMsgExecuteEncodeObject",{enumerable:!0,get:function(){return o.isMsgExecuteEncodeObject}}),Object.defineProperty(e,"isMsgInstantiateContract2EncodeObject",{enumerable:!0,get:function(){return o.isMsgInstantiateContract2EncodeObject}}),Object.defineProperty(e,"isMsgInstantiateContractEncodeObject",{enumerable:!0,get:function(){return o.isMsgInstantiateContractEncodeObject}}),Object.defineProperty(e,"isMsgMigrateEncodeObject",{enumerable:!0,get:function(){return o.isMsgMigrateEncodeObject}}),Object.defineProperty(e,"isMsgStoreCodeEncodeObject",{enumerable:!0,get:function(){return o.isMsgStoreCodeEncodeObject}}),Object.defineProperty(e,"isMsgUpdateAdminEncodeObject",{enumerable:!0,get:function(){return o.isMsgUpdateAdminEncodeObject}}),Object.defineProperty(e,"setupWasmExtension",{enumerable:!0,get:function(){return o.setupWasmExtension}}),Object.defineProperty(e,"wasmTypes",{enumerable:!0,get:function(){return o.wasmTypes}});var g=Ni;Object.defineProperty(e,"SigningCosmWasmClient",{enumerable:!0,get:function(){return g.SigningCosmWasmClient}})})(rl);class il extends L.ChainContext{}const cn=class cn extends il{async getWrappedAsset(n){if(L.isNative(n.address))throw new Error("native asset cannot be a wrapped asset");const t=await this.getTokenBridge(),i=new L.CosmwasmAddress(await t.getWrappedAsset(n)),o=L.b58.encode(i.toUniversalAddress().toUint8Array()),g=`factory/${cn.gatewayAddress(this.network)}/${o}`;return new L.CosmwasmAddress(g)}static getGatewaySourceChannel(n,t){const i=fr.getIbcChannels(n,t);if(!i)throw new Error("No channels configured for chain "+t);if(!(cn.chain in i))throw new Error("No channel configured for chain "+t);return i[cn.chain]}static deriveIbcDenom(n,t,i){const o=this.getGatewaySourceChannel(n,t),g=L.bytes.encode(`${L.IBC_TRANSFER_PORT}/${o}/${i}`),C=L.hex.encode(L.sha256(g));return new L.CosmwasmAddress(`ibc/${C.toUpperCase()}`)}static factoryToCw20(n){if(n.denomType!=="factory")throw new Error("Invalid address type");return new L.CosmwasmAddress(L.CosmwasmAddress.encode(n.domain,L.b58.decode(n.denom)))}static cw20ToFactory(n,t){const i=L.b58.encode(t.toUniversalAddress().toUint8Array());return new L.CosmwasmAddress(`factory/${cn.gatewayAddress(n)}/${i}`)}static makeTransferMsg(n,t,i=0n,o,g){const C=L.b64.encode(t.toUint8Array()),w={chain:L.toChainId(n),recipient:C,fee:i.toString(),nonce:g??Math.round(Math.random()*1e5)};return o?{gateway_transfer_with_payload:{...w,payload:o}}:{gateway_transfer:{...w}}}};Se(cn,"chain","Wormchain"),Se(cn,"gatewayAddress",n=>L.CONFIG[n].chains[cn.chain].contracts.gateway),Se(cn,"tokenBridgeAddress",n=>L.CONFIG[n].chains[cn.chain].contracts.tokenBridge),Se(cn,"coreAddress",n=>L.CONFIG[n].chains[cn.chain].contracts.coreBridge);let Na=cn;const vn=class vn extends L.PlatformContext{constructor(n,t){super(n,t??L.networkPlatformConfigs(n,vn._platform))}async getRpc(n){if(n in this.config&&this.config[n].rpc)return await rl.CosmWasmClient.connect(this.config[n].rpc);throw new Error("No configuration available for chain: "+n)}getChain(n,t){if(!(n in this.config))throw new Error("No configuration available for chain: "+n);return new il(n,this,t)}static getIbcChannels(n,t){return L.networkChainToChannels.has(n,t)?L.networkChainToChannels.get(n,t):null}static nativeTokenId(n,t){if(!this.isSupportedChain(t))throw new Error(`invalid chain for CosmWasm: ${t}`);return L.Wormhole.chainAddress(t,this.getNativeDenom(n,t))}static isSupportedChain(n){return L.chainToPlatform(n)===vn._platform}static isNativeTokenId(n,t,i){return!this.isSupportedChain(t)||i.chain!==t?!1:this.nativeTokenId(n,t)==i}static async getDecimals(n,t,i){if(L.isNative(i))return L.nativeDecimals(vn._platform);let o=new L.CosmwasmAddress(i).toString();o.startsWith("factory")&&(o=Na.factoryToCw20(new L.CosmwasmAddress(o)).toString());const{decimals:g}=await t.queryContractSmart(o,{token_info:{}});return g}static async getBalance(n,t,i,o){if(L.isNative(o)){const[w,E]=await vn.chainFromRpc(t),{amount:D}=await t.getBalance(i,this.getNativeDenom(w,n));return BigInt(D)}const g=new L.CosmwasmAddress(o).toString(),{amount:C}=await t.getBalance(i,g);return BigInt(C)}static async getBalances(n,t,i,o){const C=await vn.getQueryClient(t).bank.allBalances(i),[w,E]=await vn.chainFromRpc(t);return o.map(J=>{const b=L.isNative(J)?this.getNativeDenom(w,n):new L.CosmwasmAddress(J).toString(),p=C.find(R=>R.denom===b),S=p?BigInt(p.amount):null;return{[b]:S}}).reduce((J,b)=>Object.assign(J,b),{})}static getNativeDenom(n,t){return L.chainToNativeDenoms.get(n,t)}static async sendWait(n,t,i){const o=[];for(const g of i){const C=await t.broadcastTx(g);if(C.code!==0)throw new Error(`Error sending transaction (${C.transactionHash}): ${C.rawLog}`);o.push(C.transactionHash)}return o}static async getLatestBlock(n){return await n.getHeight()}static async getLatestFinalizedBlock(n){throw new Error("not implemented")}static chainFromChainId(n){const t=L.platformNativeChainIdToNetworkChain(vn._platform,n);if(t===void 0)throw new Error(`Unknown Cosmwasm chainId ${n}`);const[i,o]=t;return[i,o]}static async chainFromRpc(n){const t=await n.getChainId();return this.chainFromChainId(t)}static async getCounterpartyChannel(n,t){var g,C;return((C=(g=(await vn.getQueryClient(t).ibc.channel.channel(L.IBC_TRANSFER_PORT,n)).channel)==null?void 0:g.counterparty)==null?void 0:C.channelId)??null}};Se(vn,"_platform",L._platform$3),Se(vn,"getQueryClient",n=>bt.QueryClient.withExtensions(n.cometClient,bt.setupBankExtension,bt.setupIbcExtension));let fr=vn;var wh={},Su={},ku,uf;function Kb(){if(uf)return ku;uf=1,ku=n;var e=Sr();function n(g,C){this.lo=g>>>0,this.hi=C>>>0}var t=n.zero=new n(0,0);t.toNumber=function(){return 0},t.zzEncode=t.zzDecode=function(){return this},t.length=function(){return 1};var i=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(C){if(C===0)return t;var w=C<0;w&&(C=-C);var E=C>>>0,D=(C-E)/4294967296>>>0;return w&&(D=~D>>>0,E=~E>>>0,++E>4294967295&&(E=0,++D>4294967295&&(D=0))),new n(E,D)},n.from=function(C){if(typeof C=="number")return n.fromNumber(C);if(e.isString(C))if(e.Long)C=e.Long.fromString(C);else return n.fromNumber(parseInt(C,10));return C.low||C.high?new n(C.low>>>0,C.high>>>0):t},n.prototype.toNumber=function(C){if(!C&&this.hi>>>31){var w=~this.lo+1>>>0,E=~this.hi>>>0;return w||(E=E+1>>>0),-(w+E*4294967296)}return this.lo+this.hi*4294967296},n.prototype.toLong=function(C){return e.Long?new e.Long(this.lo|0,this.hi|0,!!C):{low:this.lo|0,high:this.hi|0,unsigned:!!C}};var o=String.prototype.charCodeAt;return n.fromHash=function(C){return C===i?t:new n((o.call(C,0)|o.call(C,1)<<8|o.call(C,2)<<16|o.call(C,3)<<24)>>>0,(o.call(C,4)|o.call(C,5)<<8|o.call(C,6)<<16|o.call(C,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var C=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^C)>>>0,this.lo=(this.lo<<1^C)>>>0,this},n.prototype.zzDecode=function(){var C=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^C)>>>0,this.hi=(this.hi>>>1^C)>>>0,this},n.prototype.length=function(){var C=this.lo,w=(this.lo>>>28|this.hi<<4)>>>0,E=this.hi>>>24;return E===0?w===0?C<16384?C<128?1:2:C<2097152?3:4:w<16384?w<128?5:6:w<2097152?7:8:E<128?9:10},ku}var cf;function Sr(){return cf||(cf=1,function(e){var n=e;n.asPromise=Re.aspromise,n.base64=Re.base64,n.EventEmitter=Re.eventemitter,n.float=Re.float,n.inquire=Re.inquire_1,n.utf8=Re.utf8,n.pool=Re.pool_1,n.LongBits=Kb(),n.isNode=!!(typeof L.commonjsGlobal<"u"&&L.commonjsGlobal&&L.commonjsGlobal.process&&L.commonjsGlobal.process.versions&&L.commonjsGlobal.process.versions.node),n.global=n.isNode&&L.commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||L.commonjsGlobal,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(g){return typeof g=="number"&&isFinite(g)&&Math.floor(g)===g},n.isString=function(g){return typeof g=="string"||g instanceof String},n.isObject=function(g){return g&&typeof g=="object"},n.isset=n.isSet=function(g,C){var w=g[C];return w!=null&&g.hasOwnProperty(C)?typeof w!="object"||(Array.isArray(w)?w.length:Object.keys(w).length)>0:!1},n.Buffer=function(){try{var o=n.inquire("buffer").Buffer;return o.prototype.utf8Write?o:null}catch{return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(g){return typeof g=="number"?n.Buffer?n._Buffer_allocUnsafe(g):new n.Array(g):n.Buffer?n._Buffer_from(g):typeof Uint8Array>"u"?g:new Uint8Array(g)},n.Array=typeof Uint8Array<"u"?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(g){return g?n.LongBits.from(g).toHash():n.LongBits.zeroHash},n.longFromHash=function(g,C){var w=n.LongBits.fromHash(g);return n.Long?n.Long.fromBits(w.lo,w.hi,C):w.toNumber(!!C)};function t(o,g,C){for(var w=Object.keys(g),E=0;E<w.length;++E)(o[w[E]]===void 0||!C)&&(o[w[E]]=g[w[E]]);return o}n.merge=t,n.lcFirst=function(g){return g.charAt(0).toLowerCase()+g.substring(1)};function i(o){function g(C,w){if(!(this instanceof g))return new g(C,w);Object.defineProperty(this,"message",{get:function(){return C}}),Error.captureStackTrace?Error.captureStackTrace(this,g):Object.defineProperty(this,"stack",{value:new Error().stack||""}),w&&t(this,w)}return g.prototype=Object.create(Error.prototype,{constructor:{value:g,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return o},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),g}n.newError=i,n.ProtocolError=i("ProtocolError"),n.oneOfGetter=function(g){for(var C={},w=0;w<g.length;++w)C[g[w]]=1;return function(){for(var E=Object.keys(this),D=E.length-1;D>-1;--D)if(C[E[D]]===1&&this[E[D]]!==void 0&&this[E[D]]!==null)return E[D]}},n.oneOfSetter=function(g){return function(C){for(var w=0;w<g.length;++w)g[w]!==C&&delete this[g[w]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var o=n.Buffer;if(!o){n._Buffer_from=n._Buffer_allocUnsafe=null;return}n._Buffer_from=o.from!==Uint8Array.from&&o.from||function(C,w){return new o(C,w)},n._Buffer_allocUnsafe=o.allocUnsafe||function(C){return new o(C)}}}(Su)),Su}var _h=ge,Hn=Sr(),Fu,Ks=Hn.LongBits,lf=Hn.base64,ff=Hn.utf8;function Vo(e,n,t){this.fn=e,this.len=n,this.next=void 0,this.val=t}function ol(){}function xb(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function ge(){this.len=0,this.head=new Vo(ol,0,0),this.tail=this.head,this.states=null}var Mh=function(){return Hn.Buffer?function(){return(ge.create=function(){return new Fu})()}:function(){return new ge}};ge.create=Mh();ge.alloc=function(n){return new Hn.Array(n)};Hn.Array!==Array&&(ge.alloc=Hn.pool(ge.alloc,Hn.Array.prototype.subarray));ge.prototype._push=function(n,t,i){return this.tail=this.tail.next=new Vo(n,t,i),this.len+=t,this};function al(e,n,t){n[t]=e&255}function zb(e,n,t){for(;e>127;)n[t++]=e&127|128,e>>>=7;n[t]=e}function sl(e,n){this.len=e,this.next=void 0,this.val=n}sl.prototype=Object.create(Vo.prototype);sl.prototype.fn=zb;ge.prototype.uint32=function(n){return this.len+=(this.tail=this.tail.next=new sl((n=n>>>0)<128?1:n<16384?2:n<2097152?3:n<268435456?4:5,n)).len,this};ge.prototype.int32=function(n){return n<0?this._push(dl,10,Ks.fromNumber(n)):this.uint32(n)};ge.prototype.sint32=function(n){return this.uint32((n<<1^n>>31)>>>0)};function dl(e,n,t){for(;e.hi;)n[t++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)n[t++]=e.lo&127|128,e.lo=e.lo>>>7;n[t++]=e.lo}ge.prototype.uint64=function(n){var t=Ks.from(n);return this._push(dl,t.length(),t)};ge.prototype.int64=ge.prototype.uint64;ge.prototype.sint64=function(n){var t=Ks.from(n).zzEncode();return this._push(dl,t.length(),t)};ge.prototype.bool=function(n){return this._push(al,1,n?1:0)};function Gu(e,n,t){n[t]=e&255,n[t+1]=e>>>8&255,n[t+2]=e>>>16&255,n[t+3]=e>>>24}ge.prototype.fixed32=function(n){return this._push(Gu,4,n>>>0)};ge.prototype.sfixed32=ge.prototype.fixed32;ge.prototype.fixed64=function(n){var t=Ks.from(n);return this._push(Gu,4,t.lo)._push(Gu,4,t.hi)};ge.prototype.sfixed64=ge.prototype.fixed64;ge.prototype.float=function(n){return this._push(Hn.float.writeFloatLE,4,n)};ge.prototype.double=function(n){return this._push(Hn.float.writeDoubleLE,8,n)};var Yb=Hn.Array.prototype.set?function(n,t,i){t.set(n,i)}:function(n,t,i){for(var o=0;o<n.length;++o)t[i+o]=n[o]};ge.prototype.bytes=function(n){var t=n.length>>>0;if(!t)return this._push(al,1,0);if(Hn.isString(n)){var i=ge.alloc(t=lf.length(n));lf.decode(n,i,0),n=i}return this.uint32(t)._push(Yb,t,n)};ge.prototype.string=function(n){var t=ff.length(n);return t?this.uint32(t)._push(ff.write,t,n):this._push(al,1,0)};ge.prototype.fork=function(){return this.states=new xb(this),this.head=this.tail=new Vo(ol,0,0),this.len=0,this};ge.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Vo(ol,0,0),this.len=0),this};ge.prototype.ldelim=function(){var n=this.head,t=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=n.next,this.tail=t,this.len+=i),this};ge.prototype.finish=function(){for(var n=this.head.next,t=this.constructor.alloc(this.len),i=0;n;)n.fn(n.val,t,i),i+=n.len,n=n.next;return t};ge._configure=function(e){Fu=e,ge.create=Mh(),Fu._configure()};var Zb=dt,Uh=_h;(dt.prototype=Object.create(Uh.prototype)).constructor=dt;var Bt=Sr();function dt(){Uh.call(this)}dt._configure=function(){dt.alloc=Bt._Buffer_allocUnsafe,dt.writeBytesBuffer=Bt.Buffer&&Bt.Buffer.prototype instanceof Uint8Array&&Bt.Buffer.prototype.set.name==="set"?function(n,t,i){t.set(n,i)}:function(n,t,i){if(n.copy)n.copy(t,i,0,n.length);else for(var o=0;o<n.length;)t[i++]=n[o++]}};dt.prototype.bytes=function(n){Bt.isString(n)&&(n=Bt._Buffer_from(n,"base64"));var t=n.length>>>0;return this.uint32(t),t&&this._push(dt.writeBytesBuffer,t,n),this};function Xb(e,n,t){e.length<40?Bt.utf8.write(e,n,t):n.utf8Write?n.utf8Write(e,t):n.write(e,t)}dt.prototype.string=function(n){var t=Bt.Buffer.byteLength(n);return this.uint32(t),t&&this._push(Xb,t,n),this};dt._configure();var Dh=Te,Kn=Sr(),Lu,Jh=Kn.LongBits,jb=Kn.utf8;function xn(e,n){return RangeError("index out of range: "+e.pos+" + "+(n||1)+" > "+e.len)}function Te(e){this.buf=e,this.pos=0,this.len=e.length}var pf=typeof Uint8Array<"u"?function(n){if(n instanceof Uint8Array||Array.isArray(n))return new Te(n);throw Error("illegal buffer")}:function(n){if(Array.isArray(n))return new Te(n);throw Error("illegal buffer")},Hh=function(){return Kn.Buffer?function(t){return(Te.create=function(o){return Kn.Buffer.isBuffer(o)?new Lu(o):pf(o)})(t)}:pf};Te.create=Hh();Te.prototype._slice=Kn.Array.prototype.subarray||Kn.Array.prototype.slice;Te.prototype.uint32=function(){var n=4294967295;return function(){if(n=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(n=(n|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(n=(n|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(n=(n|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(n=(n|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return n;if((this.pos+=5)>this.len)throw this.pos=this.len,xn(this,10);return n}}();Te.prototype.int32=function(){return this.uint32()|0};Te.prototype.sint32=function(){var n=this.uint32();return n>>>1^-(n&1)|0};function Pu(){var e=new Jh(0,0),n=0;if(this.len-this.pos>4){for(;n<4;++n)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<n*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;n=0}else{for(;n<3;++n){if(this.pos>=this.len)throw xn(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<n*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<n*7)>>>0,e}if(this.len-this.pos>4){for(;n<5;++n)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<n*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;n<5;++n){if(this.pos>=this.len)throw xn(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<n*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}Te.prototype.bool=function(){return this.uint32()!==0};function wa(e,n){return(e[n-4]|e[n-3]<<8|e[n-2]<<16|e[n-1]<<24)>>>0}Te.prototype.fixed32=function(){if(this.pos+4>this.len)throw xn(this,4);return wa(this.buf,this.pos+=4)};Te.prototype.sfixed32=function(){if(this.pos+4>this.len)throw xn(this,4);return wa(this.buf,this.pos+=4)|0};function mf(){if(this.pos+8>this.len)throw xn(this,8);return new Jh(wa(this.buf,this.pos+=4),wa(this.buf,this.pos+=4))}Te.prototype.float=function(){if(this.pos+4>this.len)throw xn(this,4);var n=Kn.float.readFloatLE(this.buf,this.pos);return this.pos+=4,n};Te.prototype.double=function(){if(this.pos+8>this.len)throw xn(this,4);var n=Kn.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,n};Te.prototype.bytes=function(){var n=this.uint32(),t=this.pos,i=this.pos+n;if(i>this.len)throw xn(this,n);if(this.pos+=n,Array.isArray(this.buf))return this.buf.slice(t,i);if(t===i){var o=Kn.Buffer;return o?o.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,i)};Te.prototype.string=function(){var n=this.bytes();return jb.read(n,0,n.length)};Te.prototype.skip=function(n){if(typeof n=="number"){if(this.pos+n>this.len)throw xn(this,n);this.pos+=n}else do if(this.pos>=this.len)throw xn(this);while(this.buf[this.pos++]&128);return this};Te.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this};Te._configure=function(e){Lu=e,Te.create=Hh(),Lu._configure();var n=Kn.Long?"toLong":"toNumber";Kn.merge(Te.prototype,{int64:function(){return Pu.call(this)[n](!1)},uint64:function(){return Pu.call(this)[n](!0)},sint64:function(){return Pu.call(this).zzDecode()[n](!1)},fixed64:function(){return mf.call(this)[n](!0)},sfixed64:function(){return mf.call(this)[n](!1)}})};var eE=pr,qh=Dh;(pr.prototype=Object.create(qh.prototype)).constructor=pr;var hf=Sr();function pr(e){qh.call(this,e)}pr._configure=function(){hf.Buffer&&(pr.prototype._slice=hf.Buffer.prototype.slice)};pr.prototype.string=function(){var n=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+n,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+n,this.len))};pr._configure();var Vh={},nE=mo,ul=Sr();(mo.prototype=Object.create(ul.EventEmitter.prototype)).constructor=mo;function mo(e,n,t){if(typeof e!="function")throw TypeError("rpcImpl must be a function");ul.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!n,this.responseDelimited=!!t}mo.prototype.rpcCall=function e(n,t,i,o,g){if(!o)throw TypeError("request must be specified");var C=this;if(!g)return ul.asPromise(e,C,n,t,i,o);if(!C.rpcImpl){setTimeout(function(){g(Error("already ended"))},0);return}try{return C.rpcImpl(n,t[C.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(E,D){if(E)return C.emit("error",E,n),g(E);if(D===null){C.end(!0);return}if(!(D instanceof i))try{D=i[C.responseDelimited?"decodeDelimited":"decode"](D)}catch(J){return C.emit("error",J,n),g(J)}return C.emit("data",D,n),g(null,D)})}catch(w){C.emit("error",w,n),setTimeout(function(){g(w)},0);return}};mo.prototype.end=function(n){return this.rpcImpl&&(n||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};(function(e){var n=e;n.Service=nE})(Vh);var tE={};(function(e){var n=e;n.build="minimal",n.Writer=_h,n.BufferWriter=Zb,n.Reader=Dh,n.BufferReader=eE,n.util=Sr(),n.rpc=Vh,n.roots=tE,n.configure=t;function t(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}t()})(wh);var rE=wh;const ee=L.getDefaultExportFromCjs(rE);/**
4
4
  * @license
@@ -19,7 +19,7 @@ Proven: ${(0,Xt.toHex)(e.key)}`);return xt.ics23.CommitmentProof.decode(e.data)}
19
19
  *
20
20
  * SPDX-License-Identifier: Apache-2.0
21
21
  */var Mn=null;try{Mn=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function te(e,n,t){this.low=e|0,this.high=n|0,this.unsigned=!!t}te.prototype.__isLong__;Object.defineProperty(te.prototype,"__isLong__",{value:!0});function Ke(e){return(e&&e.__isLong__)===!0}function gf(e){var n=Math.clz32(e&-e);return e?31-n:n}te.isLong=Ke;var yf={},Sf={};function kr(e,n){var t,i,o;return n?(e>>>=0,(o=0<=e&&e<256)&&(i=Sf[e],i)?i:(t=ye(e,0,!0),o&&(Sf[e]=t),t)):(e|=0,(o=-128<=e&&e<128)&&(i=yf[e],i)?i:(t=ye(e,e<0?-1:0,!1),o&&(yf[e]=t),t))}te.fromInt=kr;function Un(e,n){if(isNaN(e))return n?pt:Fn;if(n){if(e<0)return pt;if(e>=Wh)return Gh}else{if(e<=-Pf)return an;if(e+1>=Pf)return Fh}return e<0?Un(-e,n).neg():ye(e%wi|0,e/wi|0,n)}te.fromNumber=Un;function ye(e,n,t){return new te(e,n,t)}te.fromBits=ye;var _a=Math.pow;function cl(e,n,t){if(e.length===0)throw Error("empty string");if(typeof n=="number"?(t=n,n=!1):n=!!n,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return n?pt:Fn;if(t=t||10,t<2||36<t)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(i===0)return cl(e.substring(1),n,t).neg();for(var o=Un(_a(t,8)),g=Fn,C=0;C<e.length;C+=8){var w=Math.min(8,e.length-C),E=parseInt(e.substring(C,C+w),t);if(w<8){var D=Un(_a(t,w));g=g.mul(D).add(Un(E))}else g=g.mul(o),g=g.add(Un(E))}return g.unsigned=n,g}te.fromString=cl;function Yn(e,n){return typeof e=="number"?Un(e,n):typeof e=="string"?cl(e,n):ye(e.low,e.high,typeof n=="boolean"?n:e.unsigned)}te.fromValue=Yn;var kf=65536,iE=1<<24,wi=kf*kf,Wh=wi*wi,Pf=Wh/2,vf=kr(iE),Fn=kr(0);te.ZERO=Fn;var pt=kr(0,!0);te.UZERO=pt;var Hr=kr(1);te.ONE=Hr;var Qh=kr(1,!0);te.UONE=Qh;var $u=kr(-1);te.NEG_ONE=$u;var Fh=ye(-1,2147483647,!1);te.MAX_VALUE=Fh;var Gh=ye(-1,-1,!0);te.MAX_UNSIGNED_VALUE=Gh;var an=ye(0,-2147483648,!1);te.MIN_VALUE=an;var ne=te.prototype;ne.toInt=function(){return this.unsigned?this.low>>>0:this.low};ne.toNumber=function(){return this.unsigned?(this.high>>>0)*wi+(this.low>>>0):this.high*wi+(this.low>>>0)};ne.toString=function(n){if(n=n||10,n<2||36<n)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(an)){var t=Un(n),i=this.div(t),o=i.mul(t).sub(this);return i.toString(n)+o.toInt().toString(n)}else return"-"+this.neg().toString(n);for(var g=Un(_a(n,6),this.unsigned),C=this,w="";;){var E=C.div(g),D=C.sub(E.mul(g)).toInt()>>>0,J=D.toString(n);if(C=E,C.isZero())return J+w;for(;J.length<6;)J="0"+J;w=""+J+w}};ne.getHighBits=function(){return this.high};ne.getHighBitsUnsigned=function(){return this.high>>>0};ne.getLowBits=function(){return this.low};ne.getLowBitsUnsigned=function(){return this.low>>>0};ne.getNumBitsAbs=function(){if(this.isNegative())return this.eq(an)?64:this.neg().getNumBitsAbs();for(var n=this.high!=0?this.high:this.low,t=31;t>0&&!(n&1<<t);t--);return this.high!=0?t+33:t+1};ne.isZero=function(){return this.high===0&&this.low===0};ne.eqz=ne.isZero;ne.isNegative=function(){return!this.unsigned&&this.high<0};ne.isPositive=function(){return this.unsigned||this.high>=0};ne.isOdd=function(){return(this.low&1)===1};ne.isEven=function(){return(this.low&1)===0};ne.equals=function(n){return Ke(n)||(n=Yn(n)),this.unsigned!==n.unsigned&&this.high>>>31===1&&n.high>>>31===1?!1:this.high===n.high&&this.low===n.low};ne.eq=ne.equals;ne.notEquals=function(n){return!this.eq(n)};ne.neq=ne.notEquals;ne.ne=ne.notEquals;ne.lessThan=function(n){return this.comp(n)<0};ne.lt=ne.lessThan;ne.lessThanOrEqual=function(n){return this.comp(n)<=0};ne.lte=ne.lessThanOrEqual;ne.le=ne.lessThanOrEqual;ne.greaterThan=function(n){return this.comp(n)>0};ne.gt=ne.greaterThan;ne.greaterThanOrEqual=function(n){return this.comp(n)>=0};ne.gte=ne.greaterThanOrEqual;ne.ge=ne.greaterThanOrEqual;ne.compare=function(n){if(Ke(n)||(n=Yn(n)),this.eq(n))return 0;var t=this.isNegative(),i=n.isNegative();return t&&!i?-1:!t&&i?1:this.unsigned?n.high>>>0>this.high>>>0||n.high===this.high&&n.low>>>0>this.low>>>0?-1:1:this.sub(n).isNegative()?-1:1};ne.comp=ne.compare;ne.negate=function(){return!this.unsigned&&this.eq(an)?an:this.not().add(Hr)};ne.neg=ne.negate;ne.add=function(n){Ke(n)||(n=Yn(n));var t=this.high>>>16,i=this.high&65535,o=this.low>>>16,g=this.low&65535,C=n.high>>>16,w=n.high&65535,E=n.low>>>16,D=n.low&65535,J=0,b=0,p=0,S=0;return S+=g+D,p+=S>>>16,S&=65535,p+=o+E,b+=p>>>16,p&=65535,b+=i+w,J+=b>>>16,b&=65535,J+=t+C,J&=65535,ye(p<<16|S,J<<16|b,this.unsigned)};ne.subtract=function(n){return Ke(n)||(n=Yn(n)),this.add(n.neg())};ne.sub=ne.subtract;ne.multiply=function(n){if(this.isZero())return this;if(Ke(n)||(n=Yn(n)),Mn){var t=Mn.mul(this.low,this.high,n.low,n.high);return ye(t,Mn.get_high(),this.unsigned)}if(n.isZero())return this.unsigned?pt:Fn;if(this.eq(an))return n.isOdd()?an:Fn;if(n.eq(an))return this.isOdd()?an:Fn;if(this.isNegative())return n.isNegative()?this.neg().mul(n.neg()):this.neg().mul(n).neg();if(n.isNegative())return this.mul(n.neg()).neg();if(this.lt(vf)&&n.lt(vf))return Un(this.toNumber()*n.toNumber(),this.unsigned);var i=this.high>>>16,o=this.high&65535,g=this.low>>>16,C=this.low&65535,w=n.high>>>16,E=n.high&65535,D=n.low>>>16,J=n.low&65535,b=0,p=0,S=0,R=0;return R+=C*J,S+=R>>>16,R&=65535,S+=g*J,p+=S>>>16,S&=65535,S+=C*D,p+=S>>>16,S&=65535,p+=o*J,b+=p>>>16,p&=65535,p+=g*D,b+=p>>>16,p&=65535,p+=C*E,b+=p>>>16,p&=65535,b+=i*J+o*D+g*E+C*w,b&=65535,ye(S<<16|R,b<<16|p,this.unsigned)};ne.mul=ne.multiply;ne.divide=function(n){if(Ke(n)||(n=Yn(n)),n.isZero())throw Error("division by zero");if(Mn){if(!this.unsigned&&this.high===-2147483648&&n.low===-1&&n.high===-1)return this;var t=(this.unsigned?Mn.div_u:Mn.div_s)(this.low,this.high,n.low,n.high);return ye(t,Mn.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?pt:Fn;var i,o,g;if(this.unsigned){if(n.unsigned||(n=n.toUnsigned()),n.gt(this))return pt;if(n.gt(this.shru(1)))return Qh;g=pt}else{if(this.eq(an)){if(n.eq(Hr)||n.eq($u))return an;if(n.eq(an))return Hr;var C=this.shr(1);return i=C.div(n).shl(1),i.eq(Fn)?n.isNegative()?Hr:$u:(o=this.sub(n.mul(i)),g=i.add(o.div(n)),g)}else if(n.eq(an))return this.unsigned?pt:Fn;if(this.isNegative())return n.isNegative()?this.neg().div(n.neg()):this.neg().div(n).neg();if(n.isNegative())return this.div(n.neg()).neg();g=Fn}for(o=this;o.gte(n);){i=Math.max(1,Math.floor(o.toNumber()/n.toNumber()));for(var w=Math.ceil(Math.log(i)/Math.LN2),E=w<=48?1:_a(2,w-48),D=Un(i),J=D.mul(n);J.isNegative()||J.gt(o);)i-=E,D=Un(i,this.unsigned),J=D.mul(n);D.isZero()&&(D=Hr),g=g.add(D),o=o.sub(J)}return g};ne.div=ne.divide;ne.modulo=function(n){if(Ke(n)||(n=Yn(n)),Mn){var t=(this.unsigned?Mn.rem_u:Mn.rem_s)(this.low,this.high,n.low,n.high);return ye(t,Mn.get_high(),this.unsigned)}return this.sub(this.div(n).mul(n))};ne.mod=ne.modulo;ne.rem=ne.modulo;ne.not=function(){return ye(~this.low,~this.high,this.unsigned)};ne.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};ne.clz=ne.countLeadingZeros;ne.countTrailingZeros=function(){return this.low?gf(this.low):gf(this.high)+32};ne.ctz=ne.countTrailingZeros;ne.and=function(n){return Ke(n)||(n=Yn(n)),ye(this.low&n.low,this.high&n.high,this.unsigned)};ne.or=function(n){return Ke(n)||(n=Yn(n)),ye(this.low|n.low,this.high|n.high,this.unsigned)};ne.xor=function(n){return Ke(n)||(n=Yn(n)),ye(this.low^n.low,this.high^n.high,this.unsigned)};ne.shiftLeft=function(n){return Ke(n)&&(n=n.toInt()),(n&=63)===0?this:n<32?ye(this.low<<n,this.high<<n|this.low>>>32-n,this.unsigned):ye(0,this.low<<n-32,this.unsigned)};ne.shl=ne.shiftLeft;ne.shiftRight=function(n){return Ke(n)&&(n=n.toInt()),(n&=63)===0?this:n<32?ye(this.low>>>n|this.high<<32-n,this.high>>n,this.unsigned):ye(this.high>>n-32,this.high>=0?0:-1,this.unsigned)};ne.shr=ne.shiftRight;ne.shiftRightUnsigned=function(n){return Ke(n)&&(n=n.toInt()),(n&=63)===0?this:n<32?ye(this.low>>>n|this.high<<32-n,this.high>>>n,this.unsigned):n===32?ye(this.high,0,this.unsigned):ye(this.high>>>n-32,0,this.unsigned)};ne.shru=ne.shiftRightUnsigned;ne.shr_u=ne.shiftRightUnsigned;ne.rotateLeft=function(n){var t;return Ke(n)&&(n=n.toInt()),(n&=63)===0?this:n===32?ye(this.high,this.low,this.unsigned):n<32?(t=32-n,ye(this.low<<n|this.high>>>t,this.high<<n|this.low>>>t,this.unsigned)):(n-=32,t=32-n,ye(this.high<<n|this.low>>>t,this.low<<n|this.high>>>t,this.unsigned))};ne.rotl=ne.rotateLeft;ne.rotateRight=function(n){var t;return Ke(n)&&(n=n.toInt()),(n&=63)===0?this:n===32?ye(this.high,this.low,this.unsigned):n<32?(t=32-n,ye(this.high<<t|this.low>>>n,this.low<<t|this.high>>>n,this.unsigned)):(n-=32,t=32-n,ye(this.low<<t|this.high>>>n,this.high<<t|this.low>>>n,this.unsigned))};ne.rotr=ne.rotateRight;ne.toSigned=function(){return this.unsigned?ye(this.low,this.high,!1):this};ne.toUnsigned=function(){return this.unsigned?this:ye(this.low,this.high,!0)};ne.toBytes=function(n){return n?this.toBytesLE():this.toBytesBE()};ne.toBytesLE=function(){var n=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,n&255,n>>>8&255,n>>>16&255,n>>>24]};ne.toBytesBE=function(){var n=this.high,t=this.low;return[n>>>24,n>>>16&255,n>>>8&255,n&255,t>>>24,t>>>16&255,t>>>8&255,t&255]};te.fromBytes=function(n,t,i){return i?te.fromBytesLE(n,t):te.fromBytesBE(n,t)};te.fromBytesLE=function(n,t){return new te(n[0]|n[1]<<8|n[2]<<16|n[3]<<24,n[4]|n[5]<<8|n[6]<<16|n[7]<<24,t)};te.fromBytesBE=function(n,t){return new te(n[4]<<24|n[5]<<16|n[6]<<8|n[7],n[0]<<24|n[1]<<16|n[2]<<8|n[3],t)};function Cf(){return{typeUrl:"",value:new Uint8Array(0)}}const Ce={encode(e,n=ee.Writer.create()){return e.typeUrl!==""&&n.uint32(10).string(e.typeUrl),e.value.length!==0&&n.uint32(18).bytes(e.value),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Cf();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.typeUrl=t.string();continue;case 2:if(g!==18)break;o.value=t.bytes();continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{typeUrl:Rf(e.typeUrl)?globalThis.String(e.typeUrl):"",value:Rf(e.value)?oE(e.value):new Uint8Array(0)}},toJSON(e){const n={};return e.typeUrl!==""&&(n.typeUrl=e.typeUrl),e.value.length!==0&&(n.value=aE(e.value)),n},create(e){return Ce.fromPartial(e??{})},fromPartial(e){var n,t;const i=Cf();return i.typeUrl=(n=e.typeUrl)!==null&&n!==void 0?n:"",i.value=(t=e.value)!==null&&t!==void 0?t:new Uint8Array(0),i}};function oE(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const n=globalThis.atob(e),t=new Uint8Array(n.length);for(let i=0;i<n.length;++i)t[i]=n.charCodeAt(i);return t}}function aE(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{const n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function Rf(e){return e!=null}ee.util.Long!==te&&(ee.util.Long=te,ee.configure());function Bf(){return{denom:"",amount:""}}const De={encode(e,n=ee.Writer.create()){return e.denom!==""&&n.uint32(10).string(e.denom),e.amount!==""&&n.uint32(18).string(e.amount),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Bf();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.denom=t.string();continue;case 2:if(g!==18)break;o.amount=t.string();continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{denom:bf(e.denom)?globalThis.String(e.denom):"",amount:bf(e.amount)?globalThis.String(e.amount):""}},toJSON(e){const n={};return e.denom!==""&&(n.denom=e.denom),e.amount!==""&&(n.amount=e.amount),n},create(e){return De.fromPartial(e??{})},fromPartial(e){var n,t;const i=Bf();return i.denom=(n=e.denom)!==null&&n!==void 0?n:"",i.amount=(t=e.amount)!==null&&t!==void 0?t:"",i}};function bf(e){return e!=null}function Ef(){return{extraBitsStored:0,elems:new Uint8Array(0)}}const Nr={encode(e,n=ee.Writer.create()){return e.extraBitsStored!==0&&n.uint32(8).uint32(e.extraBitsStored),e.elems.length!==0&&n.uint32(18).bytes(e.elems),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Ef();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==8)break;o.extraBitsStored=t.uint32();continue;case 2:if(g!==18)break;o.elems=t.bytes();continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{extraBitsStored:If(e.extraBitsStored)?globalThis.Number(e.extraBitsStored):0,elems:If(e.elems)?sE(e.elems):new Uint8Array(0)}},toJSON(e){const n={};return e.extraBitsStored!==0&&(n.extraBitsStored=Math.round(e.extraBitsStored)),e.elems.length!==0&&(n.elems=dE(e.elems)),n},create(e){return Nr.fromPartial(e??{})},fromPartial(e){var n,t;const i=Ef();return i.extraBitsStored=(n=e.extraBitsStored)!==null&&n!==void 0?n:0,i.elems=(t=e.elems)!==null&&t!==void 0?t:new Uint8Array(0),i}};function sE(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const n=globalThis.atob(e),t=new Uint8Array(n.length);for(let i=0;i<n.length;++i)t[i]=n.charCodeAt(i);return t}}function dE(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{const n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function If(e){return e!=null}function Of(){return{key:new Uint8Array(0)}}const zt={encode(e,n=ee.Writer.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Of();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.key=t.bytes();continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{key:lE(e.key)?uE(e.key):new Uint8Array(0)}},toJSON(e){const n={};return e.key.length!==0&&(n.key=cE(e.key)),n},create(e){return zt.fromPartial(e??{})},fromPartial(e){var n;const t=Of();return t.key=(n=e.key)!==null&&n!==void 0?n:new Uint8Array(0),t}};function uE(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const n=globalThis.atob(e),t=new Uint8Array(n.length);for(let i=0;i<n.length;++i)t[i]=n.charCodeAt(i);return t}}function cE(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{const n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function lE(e){return e!=null}ee.util.Long!==te&&(ee.util.Long=te,ee.configure());var Ee;(function(e){e[e.SIGN_MODE_UNSPECIFIED=0]="SIGN_MODE_UNSPECIFIED",e[e.SIGN_MODE_DIRECT=1]="SIGN_MODE_DIRECT",e[e.SIGN_MODE_TEXTUAL=2]="SIGN_MODE_TEXTUAL",e[e.SIGN_MODE_DIRECT_AUX=3]="SIGN_MODE_DIRECT_AUX",e[e.SIGN_MODE_LEGACY_AMINO_JSON=127]="SIGN_MODE_LEGACY_AMINO_JSON",e[e.SIGN_MODE_EIP712_V2=128]="SIGN_MODE_EIP712_V2",e[e.SIGN_MODE_EIP_191=191]="SIGN_MODE_EIP_191",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ee||(Ee={}));function fE(e){switch(e){case 0:case"SIGN_MODE_UNSPECIFIED":return Ee.SIGN_MODE_UNSPECIFIED;case 1:case"SIGN_MODE_DIRECT":return Ee.SIGN_MODE_DIRECT;case 2:case"SIGN_MODE_TEXTUAL":return Ee.SIGN_MODE_TEXTUAL;case 3:case"SIGN_MODE_DIRECT_AUX":return Ee.SIGN_MODE_DIRECT_AUX;case 127:case"SIGN_MODE_LEGACY_AMINO_JSON":return Ee.SIGN_MODE_LEGACY_AMINO_JSON;case 128:case"SIGN_MODE_EIP712_V2":return Ee.SIGN_MODE_EIP712_V2;case 191:case"SIGN_MODE_EIP_191":return Ee.SIGN_MODE_EIP_191;case-1:case"UNRECOGNIZED":default:return Ee.UNRECOGNIZED}}function pE(e){switch(e){case Ee.SIGN_MODE_UNSPECIFIED:return"SIGN_MODE_UNSPECIFIED";case Ee.SIGN_MODE_DIRECT:return"SIGN_MODE_DIRECT";case Ee.SIGN_MODE_TEXTUAL:return"SIGN_MODE_TEXTUAL";case Ee.SIGN_MODE_DIRECT_AUX:return"SIGN_MODE_DIRECT_AUX";case Ee.SIGN_MODE_LEGACY_AMINO_JSON:return"SIGN_MODE_LEGACY_AMINO_JSON";case Ee.SIGN_MODE_EIP712_V2:return"SIGN_MODE_EIP712_V2";case Ee.SIGN_MODE_EIP_191:return"SIGN_MODE_EIP_191";case Ee.UNRECOGNIZED:default:return"UNRECOGNIZED"}}ee.util.Long!==te&&(ee.util.Long=te,ee.configure());function Af(){return{bodyBytes:new Uint8Array(0),authInfoBytes:new Uint8Array(0),signatures:[]}}const Ma={encode(e,n=ee.Writer.create()){e.bodyBytes.length!==0&&n.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&n.uint32(18).bytes(e.authInfoBytes);for(const t of e.signatures)n.uint32(26).bytes(t);return n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Af();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.bodyBytes=t.bytes();continue;case 2:if(g!==18)break;o.authInfoBytes=t.bytes();continue;case 3:if(g!==26)break;o.signatures.push(t.bytes());continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{bodyBytes:Ae(e.bodyBytes)?ro(e.bodyBytes):new Uint8Array(0),authInfoBytes:Ae(e.authInfoBytes)?ro(e.authInfoBytes):new Uint8Array(0),signatures:globalThis.Array.isArray(e==null?void 0:e.signatures)?e.signatures.map(n=>ro(n)):[]}},toJSON(e){var n;const t={};return e.bodyBytes.length!==0&&(t.bodyBytes=io(e.bodyBytes)),e.authInfoBytes.length!==0&&(t.authInfoBytes=io(e.authInfoBytes)),!((n=e.signatures)===null||n===void 0)&&n.length&&(t.signatures=e.signatures.map(i=>io(i))),t},create(e){return Ma.fromPartial(e??{})},fromPartial(e){var n,t,i;const o=Af();return o.bodyBytes=(n=e.bodyBytes)!==null&&n!==void 0?n:new Uint8Array(0),o.authInfoBytes=(t=e.authInfoBytes)!==null&&t!==void 0?t:new Uint8Array(0),o.signatures=((i=e.signatures)===null||i===void 0?void 0:i.map(g=>g))||[],o}};function Tf(){return{bodyBytes:new Uint8Array(0),authInfoBytes:new Uint8Array(0),chainId:"",accountNumber:"0"}}const ll={encode(e,n=ee.Writer.create()){return e.bodyBytes.length!==0&&n.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&n.uint32(18).bytes(e.authInfoBytes),e.chainId!==""&&n.uint32(26).string(e.chainId),e.accountNumber!=="0"&&n.uint32(32).uint64(e.accountNumber),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Tf();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.bodyBytes=t.bytes();continue;case 2:if(g!==18)break;o.authInfoBytes=t.bytes();continue;case 3:if(g!==26)break;o.chainId=t.string();continue;case 4:if(g!==32)break;o.accountNumber=Ys(t.uint64());continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{bodyBytes:Ae(e.bodyBytes)?ro(e.bodyBytes):new Uint8Array(0),authInfoBytes:Ae(e.authInfoBytes)?ro(e.authInfoBytes):new Uint8Array(0),chainId:Ae(e.chainId)?globalThis.String(e.chainId):"",accountNumber:Ae(e.accountNumber)?globalThis.String(e.accountNumber):"0"}},toJSON(e){const n={};return e.bodyBytes.length!==0&&(n.bodyBytes=io(e.bodyBytes)),e.authInfoBytes.length!==0&&(n.authInfoBytes=io(e.authInfoBytes)),e.chainId!==""&&(n.chainId=e.chainId),e.accountNumber!=="0"&&(n.accountNumber=e.accountNumber),n},create(e){return ll.fromPartial(e??{})},fromPartial(e){var n,t,i,o;const g=Tf();return g.bodyBytes=(n=e.bodyBytes)!==null&&n!==void 0?n:new Uint8Array(0),g.authInfoBytes=(t=e.authInfoBytes)!==null&&t!==void 0?t:new Uint8Array(0),g.chainId=(i=e.chainId)!==null&&i!==void 0?i:"",g.accountNumber=(o=e.accountNumber)!==null&&o!==void 0?o:"0",g}};function Nf(){return{messages:[],memo:"",timeoutHeight:"0",extensionOptions:[],nonCriticalExtensionOptions:[]}}const xs={encode(e,n=ee.Writer.create()){for(const t of e.messages)Ce.encode(t,n.uint32(10).fork()).ldelim();e.memo!==""&&n.uint32(18).string(e.memo),e.timeoutHeight!=="0"&&n.uint32(24).uint64(e.timeoutHeight);for(const t of e.extensionOptions)Ce.encode(t,n.uint32(8186).fork()).ldelim();for(const t of e.nonCriticalExtensionOptions)Ce.encode(t,n.uint32(16378).fork()).ldelim();return n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Nf();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.messages.push(Ce.decode(t,t.uint32()));continue;case 2:if(g!==18)break;o.memo=t.string();continue;case 3:if(g!==24)break;o.timeoutHeight=Ys(t.uint64());continue;case 1023:if(g!==8186)break;o.extensionOptions.push(Ce.decode(t,t.uint32()));continue;case 2047:if(g!==16378)break;o.nonCriticalExtensionOptions.push(Ce.decode(t,t.uint32()));continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{messages:globalThis.Array.isArray(e==null?void 0:e.messages)?e.messages.map(n=>Ce.fromJSON(n)):[],memo:Ae(e.memo)?globalThis.String(e.memo):"",timeoutHeight:Ae(e.timeoutHeight)?globalThis.String(e.timeoutHeight):"0",extensionOptions:globalThis.Array.isArray(e==null?void 0:e.extensionOptions)?e.extensionOptions.map(n=>Ce.fromJSON(n)):[],nonCriticalExtensionOptions:globalThis.Array.isArray(e==null?void 0:e.nonCriticalExtensionOptions)?e.nonCriticalExtensionOptions.map(n=>Ce.fromJSON(n)):[]}},toJSON(e){var n,t,i;const o={};return!((n=e.messages)===null||n===void 0)&&n.length&&(o.messages=e.messages.map(g=>Ce.toJSON(g))),e.memo!==""&&(o.memo=e.memo),e.timeoutHeight!=="0"&&(o.timeoutHeight=e.timeoutHeight),!((t=e.extensionOptions)===null||t===void 0)&&t.length&&(o.extensionOptions=e.extensionOptions.map(g=>Ce.toJSON(g))),!((i=e.nonCriticalExtensionOptions)===null||i===void 0)&&i.length&&(o.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(g=>Ce.toJSON(g))),o},create(e){return xs.fromPartial(e??{})},fromPartial(e){var n,t,i,o,g;const C=Nf();return C.messages=((n=e.messages)===null||n===void 0?void 0:n.map(w=>Ce.fromPartial(w)))||[],C.memo=(t=e.memo)!==null&&t!==void 0?t:"",C.timeoutHeight=(i=e.timeoutHeight)!==null&&i!==void 0?i:"0",C.extensionOptions=((o=e.extensionOptions)===null||o===void 0?void 0:o.map(w=>Ce.fromPartial(w)))||[],C.nonCriticalExtensionOptions=((g=e.nonCriticalExtensionOptions)===null||g===void 0?void 0:g.map(w=>Ce.fromPartial(w)))||[],C}};function wf(){return{signerInfos:[],fee:void 0,tip:void 0}}const zs={encode(e,n=ee.Writer.create()){for(const t of e.signerInfos)jt.encode(t,n.uint32(10).fork()).ldelim();return e.fee!==void 0&&nr.encode(e.fee,n.uint32(18).fork()).ldelim(),e.tip!==void 0&&_r.encode(e.tip,n.uint32(26).fork()).ldelim(),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=wf();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.signerInfos.push(jt.decode(t,t.uint32()));continue;case 2:if(g!==18)break;o.fee=nr.decode(t,t.uint32());continue;case 3:if(g!==26)break;o.tip=_r.decode(t,t.uint32());continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{signerInfos:globalThis.Array.isArray(e==null?void 0:e.signerInfos)?e.signerInfos.map(n=>jt.fromJSON(n)):[],fee:Ae(e.fee)?nr.fromJSON(e.fee):void 0,tip:Ae(e.tip)?_r.fromJSON(e.tip):void 0}},toJSON(e){var n;const t={};return!((n=e.signerInfos)===null||n===void 0)&&n.length&&(t.signerInfos=e.signerInfos.map(i=>jt.toJSON(i))),e.fee!==void 0&&(t.fee=nr.toJSON(e.fee)),e.tip!==void 0&&(t.tip=_r.toJSON(e.tip)),t},create(e){return zs.fromPartial(e??{})},fromPartial(e){var n;const t=wf();return t.signerInfos=((n=e.signerInfos)===null||n===void 0?void 0:n.map(i=>jt.fromPartial(i)))||[],t.fee=e.fee!==void 0&&e.fee!==null?nr.fromPartial(e.fee):void 0,t.tip=e.tip!==void 0&&e.tip!==null?_r.fromPartial(e.tip):void 0,t}};function _f(){return{publicKey:void 0,modeInfo:void 0,sequence:"0"}}const jt={encode(e,n=ee.Writer.create()){return e.publicKey!==void 0&&Ce.encode(e.publicKey,n.uint32(10).fork()).ldelim(),e.modeInfo!==void 0&&Nn.encode(e.modeInfo,n.uint32(18).fork()).ldelim(),e.sequence!=="0"&&n.uint32(24).uint64(e.sequence),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=_f();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.publicKey=Ce.decode(t,t.uint32());continue;case 2:if(g!==18)break;o.modeInfo=Nn.decode(t,t.uint32());continue;case 3:if(g!==24)break;o.sequence=Ys(t.uint64());continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{publicKey:Ae(e.publicKey)?Ce.fromJSON(e.publicKey):void 0,modeInfo:Ae(e.modeInfo)?Nn.fromJSON(e.modeInfo):void 0,sequence:Ae(e.sequence)?globalThis.String(e.sequence):"0"}},toJSON(e){const n={};return e.publicKey!==void 0&&(n.publicKey=Ce.toJSON(e.publicKey)),e.modeInfo!==void 0&&(n.modeInfo=Nn.toJSON(e.modeInfo)),e.sequence!=="0"&&(n.sequence=e.sequence),n},create(e){return jt.fromPartial(e??{})},fromPartial(e){var n;const t=_f();return t.publicKey=e.publicKey!==void 0&&e.publicKey!==null?Ce.fromPartial(e.publicKey):void 0,t.modeInfo=e.modeInfo!==void 0&&e.modeInfo!==null?Nn.fromPartial(e.modeInfo):void 0,t.sequence=(n=e.sequence)!==null&&n!==void 0?n:"0",t}};function Mf(){return{single:void 0,multi:void 0}}const Nn={encode(e,n=ee.Writer.create()){return e.single!==void 0&&er.encode(e.single,n.uint32(10).fork()).ldelim(),e.multi!==void 0&&wr.encode(e.multi,n.uint32(18).fork()).ldelim(),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Mf();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.single=er.decode(t,t.uint32());continue;case 2:if(g!==18)break;o.multi=wr.decode(t,t.uint32());continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{single:Ae(e.single)?er.fromJSON(e.single):void 0,multi:Ae(e.multi)?wr.fromJSON(e.multi):void 0}},toJSON(e){const n={};return e.single!==void 0&&(n.single=er.toJSON(e.single)),e.multi!==void 0&&(n.multi=wr.toJSON(e.multi)),n},create(e){return Nn.fromPartial(e??{})},fromPartial(e){const n=Mf();return n.single=e.single!==void 0&&e.single!==null?er.fromPartial(e.single):void 0,n.multi=e.multi!==void 0&&e.multi!==null?wr.fromPartial(e.multi):void 0,n}};function Uf(){return{mode:0}}const er={encode(e,n=ee.Writer.create()){return e.mode!==0&&n.uint32(8).int32(e.mode),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Uf();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==8)break;o.mode=t.int32();continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{mode:Ae(e.mode)?fE(e.mode):0}},toJSON(e){const n={};return e.mode!==0&&(n.mode=pE(e.mode)),n},create(e){return er.fromPartial(e??{})},fromPartial(e){var n;const t=Uf();return t.mode=(n=e.mode)!==null&&n!==void 0?n:0,t}};function Df(){return{bitarray:void 0,modeInfos:[]}}const wr={encode(e,n=ee.Writer.create()){e.bitarray!==void 0&&Nr.encode(e.bitarray,n.uint32(10).fork()).ldelim();for(const t of e.modeInfos)Nn.encode(t,n.uint32(18).fork()).ldelim();return n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Df();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.bitarray=Nr.decode(t,t.uint32());continue;case 2:if(g!==18)break;o.modeInfos.push(Nn.decode(t,t.uint32()));continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{bitarray:Ae(e.bitarray)?Nr.fromJSON(e.bitarray):void 0,modeInfos:globalThis.Array.isArray(e==null?void 0:e.modeInfos)?e.modeInfos.map(n=>Nn.fromJSON(n)):[]}},toJSON(e){var n;const t={};return e.bitarray!==void 0&&(t.bitarray=Nr.toJSON(e.bitarray)),!((n=e.modeInfos)===null||n===void 0)&&n.length&&(t.modeInfos=e.modeInfos.map(i=>Nn.toJSON(i))),t},create(e){return wr.fromPartial(e??{})},fromPartial(e){var n;const t=Df();return t.bitarray=e.bitarray!==void 0&&e.bitarray!==null?Nr.fromPartial(e.bitarray):void 0,t.modeInfos=((n=e.modeInfos)===null||n===void 0?void 0:n.map(i=>Nn.fromPartial(i)))||[],t}};function Jf(){return{amount:[],gasLimit:"0",payer:"",granter:""}}const nr={encode(e,n=ee.Writer.create()){for(const t of e.amount)De.encode(t,n.uint32(10).fork()).ldelim();return e.gasLimit!=="0"&&n.uint32(16).uint64(e.gasLimit),e.payer!==""&&n.uint32(26).string(e.payer),e.granter!==""&&n.uint32(34).string(e.granter),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Jf();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.amount.push(De.decode(t,t.uint32()));continue;case 2:if(g!==16)break;o.gasLimit=Ys(t.uint64());continue;case 3:if(g!==26)break;o.payer=t.string();continue;case 4:if(g!==34)break;o.granter=t.string();continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{amount:globalThis.Array.isArray(e==null?void 0:e.amount)?e.amount.map(n=>De.fromJSON(n)):[],gasLimit:Ae(e.gasLimit)?globalThis.String(e.gasLimit):"0",payer:Ae(e.payer)?globalThis.String(e.payer):"",granter:Ae(e.granter)?globalThis.String(e.granter):""}},toJSON(e){var n;const t={};return!((n=e.amount)===null||n===void 0)&&n.length&&(t.amount=e.amount.map(i=>De.toJSON(i))),e.gasLimit!=="0"&&(t.gasLimit=e.gasLimit),e.payer!==""&&(t.payer=e.payer),e.granter!==""&&(t.granter=e.granter),t},create(e){return nr.fromPartial(e??{})},fromPartial(e){var n,t,i,o;const g=Jf();return g.amount=((n=e.amount)===null||n===void 0?void 0:n.map(C=>De.fromPartial(C)))||[],g.gasLimit=(t=e.gasLimit)!==null&&t!==void 0?t:"0",g.payer=(i=e.payer)!==null&&i!==void 0?i:"",g.granter=(o=e.granter)!==null&&o!==void 0?o:"",g}};function Hf(){return{amount:[],tipper:""}}const _r={encode(e,n=ee.Writer.create()){for(const t of e.amount)De.encode(t,n.uint32(10).fork()).ldelim();return e.tipper!==""&&n.uint32(18).string(e.tipper),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Hf();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.amount.push(De.decode(t,t.uint32()));continue;case 2:if(g!==18)break;o.tipper=t.string();continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{amount:globalThis.Array.isArray(e==null?void 0:e.amount)?e.amount.map(n=>De.fromJSON(n)):[],tipper:Ae(e.tipper)?globalThis.String(e.tipper):""}},toJSON(e){var n;const t={};return!((n=e.amount)===null||n===void 0)&&n.length&&(t.amount=e.amount.map(i=>De.toJSON(i))),e.tipper!==""&&(t.tipper=e.tipper),t},create(e){return _r.fromPartial(e??{})},fromPartial(e){var n,t;const i=Hf();return i.amount=((n=e.amount)===null||n===void 0?void 0:n.map(o=>De.fromPartial(o)))||[],i.tipper=(t=e.tipper)!==null&&t!==void 0?t:"",i}};function ro(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const n=globalThis.atob(e),t=new Uint8Array(n.length);for(let i=0;i<n.length;++i)t[i]=n.charCodeAt(i);return t}}function io(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{const n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function Ys(e){return e.toString()}ee.util.Long!==te&&(ee.util.Long=te,ee.configure());function Ae(e){return e!=null}function qf(){return{revisionNumber:"0",revisionHeight:"0"}}const tr={encode(e,n=ee.Writer.create()){return e.revisionNumber!=="0"&&n.uint32(8).uint64(e.revisionNumber),e.revisionHeight!=="0"&&n.uint32(16).uint64(e.revisionHeight),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=qf();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==8)break;o.revisionNumber=Vf(t.uint64());continue;case 2:if(g!==16)break;o.revisionHeight=Vf(t.uint64());continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{revisionNumber:Wf(e.revisionNumber)?globalThis.String(e.revisionNumber):"0",revisionHeight:Wf(e.revisionHeight)?globalThis.String(e.revisionHeight):"0"}},toJSON(e){const n={};return e.revisionNumber!=="0"&&(n.revisionNumber=e.revisionNumber),e.revisionHeight!=="0"&&(n.revisionHeight=e.revisionHeight),n},create(e){return tr.fromPartial(e??{})},fromPartial(e){var n,t;const i=qf();return i.revisionNumber=(n=e.revisionNumber)!==null&&n!==void 0?n:"0",i.revisionHeight=(t=e.revisionHeight)!==null&&t!==void 0?t:"0",i}};function Vf(e){return e.toString()}ee.util.Long!==te&&(ee.util.Long=te,ee.configure());function Wf(e){return e!=null}function Qf(){return{sourcePort:"",sourceChannel:"",token:void 0,sender:"",receiver:"",timeoutHeight:void 0,timeoutTimestamp:"0",memo:""}}const ha={encode(e,n=ee.Writer.create()){return e.sourcePort!==""&&n.uint32(10).string(e.sourcePort),e.sourceChannel!==""&&n.uint32(18).string(e.sourceChannel),e.token!==void 0&&De.encode(e.token,n.uint32(26).fork()).ldelim(),e.sender!==""&&n.uint32(34).string(e.sender),e.receiver!==""&&n.uint32(42).string(e.receiver),e.timeoutHeight!==void 0&&tr.encode(e.timeoutHeight,n.uint32(50).fork()).ldelim(),e.timeoutTimestamp!=="0"&&n.uint32(56).uint64(e.timeoutTimestamp),e.memo!==""&&n.uint32(66).string(e.memo),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Qf();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.sourcePort=t.string();continue;case 2:if(g!==18)break;o.sourceChannel=t.string();continue;case 3:if(g!==26)break;o.token=De.decode(t,t.uint32());continue;case 4:if(g!==34)break;o.sender=t.string();continue;case 5:if(g!==42)break;o.receiver=t.string();continue;case 6:if(g!==50)break;o.timeoutHeight=tr.decode(t,t.uint32());continue;case 7:if(g!==56)break;o.timeoutTimestamp=mE(t.uint64());continue;case 8:if(g!==66)break;o.memo=t.string();continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{sourcePort:Ct(e.sourcePort)?globalThis.String(e.sourcePort):"",sourceChannel:Ct(e.sourceChannel)?globalThis.String(e.sourceChannel):"",token:Ct(e.token)?De.fromJSON(e.token):void 0,sender:Ct(e.sender)?globalThis.String(e.sender):"",receiver:Ct(e.receiver)?globalThis.String(e.receiver):"",timeoutHeight:Ct(e.timeoutHeight)?tr.fromJSON(e.timeoutHeight):void 0,timeoutTimestamp:Ct(e.timeoutTimestamp)?globalThis.String(e.timeoutTimestamp):"0",memo:Ct(e.memo)?globalThis.String(e.memo):""}},toJSON(e){const n={};return e.sourcePort!==""&&(n.sourcePort=e.sourcePort),e.sourceChannel!==""&&(n.sourceChannel=e.sourceChannel),e.token!==void 0&&(n.token=De.toJSON(e.token)),e.sender!==""&&(n.sender=e.sender),e.receiver!==""&&(n.receiver=e.receiver),e.timeoutHeight!==void 0&&(n.timeoutHeight=tr.toJSON(e.timeoutHeight)),e.timeoutTimestamp!=="0"&&(n.timeoutTimestamp=e.timeoutTimestamp),e.memo!==""&&(n.memo=e.memo),n},create(e){return ha.fromPartial(e??{})},fromPartial(e){var n,t,i,o,g,C;const w=Qf();return w.sourcePort=(n=e.sourcePort)!==null&&n!==void 0?n:"",w.sourceChannel=(t=e.sourceChannel)!==null&&t!==void 0?t:"",w.token=e.token!==void 0&&e.token!==null?De.fromPartial(e.token):void 0,w.sender=(i=e.sender)!==null&&i!==void 0?i:"",w.receiver=(o=e.receiver)!==null&&o!==void 0?o:"",w.timeoutHeight=e.timeoutHeight!==void 0&&e.timeoutHeight!==null?tr.fromPartial(e.timeoutHeight):void 0,w.timeoutTimestamp=(g=e.timeoutTimestamp)!==null&&g!==void 0?g:"0",w.memo=(C=e.memo)!==null&&C!==void 0?C:"",w}};function mE(e){return e.toString()}ee.util.Long!==te&&(ee.util.Long=te,ee.configure());function Ct(e){return e!=null}function Ff(){return{key:new Uint8Array(0)}}const Ku={encode(e,n=ee.Writer.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Ff();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.key=t.bytes();continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{key:yE(e.key)?hE(e.key):new Uint8Array(0)}},toJSON(e){const n={};return e.key.length!==0&&(n.key=gE(e.key)),n},create(e){return Ku.fromPartial(e??{})},fromPartial(e){var n;const t=Ff();return t.key=(n=e.key)!==null&&n!==void 0?n:new Uint8Array(0),t}};function hE(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const n=globalThis.atob(e),t=new Uint8Array(n.length);for(let i=0;i<n.length;++i)t[i]=n.charCodeAt(i);return t}}function gE(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{const n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function yE(e){return e!=null}var Gf;(function(e){e[e.Unspecified=0]="Unspecified",e[e.Band=1]="Band",e[e.PriceFeed=2]="PriceFeed",e[e.Coinbase=3]="Coinbase",e[e.Chainlink=4]="Chainlink",e[e.Razor=5]="Razor",e[e.Dia=6]="Dia",e[e.API3=7]="API3",e[e.Uma=8]="Uma",e[e.Pyth=9]="Pyth",e[e.BandIBC=10]="BandIBC",e[e.Provider=11]="Provider",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Gf||(Gf={}));ee.util.Long!==te&&(ee.util.Long=te,ee.configure());var Lf;(function(e){e[e.Nobody=0]="Nobody",e[e.BeginBlockerSmartContractsOnly=1]="BeginBlockerSmartContractsOnly",e[e.SmartContractsOnly=2]="SmartContractsOnly",e[e.Everyone=3]="Everyone",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Lf||(Lf={}));var $f;(function(e){e[e.Unspecified=0]="Unspecified",e[e.Active=1]="Active",e[e.Paused=2]="Paused",e[e.Demolished=3]="Demolished",e[e.Expired=4]="Expired",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})($f||($f={}));var Kf;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.BUY=1]="BUY",e[e.SELL=2]="SELL",e[e.STOP_BUY=3]="STOP_BUY",e[e.STOP_SELL=4]="STOP_SELL",e[e.TAKE_BUY=5]="TAKE_BUY",e[e.TAKE_SELL=6]="TAKE_SELL",e[e.BUY_PO=7]="BUY_PO",e[e.SELL_PO=8]="SELL_PO",e[e.BUY_ATOMIC=9]="BUY_ATOMIC",e[e.SELL_ATOMIC=10]="SELL_ATOMIC",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Kf||(Kf={}));var xf;(function(e){e[e.UnspecifiedExecutionType=0]="UnspecifiedExecutionType",e[e.Market=1]="Market",e[e.LimitFill=2]="LimitFill",e[e.LimitMatchRestingOrder=3]="LimitMatchRestingOrder",e[e.LimitMatchNewOrder=4]="LimitMatchNewOrder",e[e.MarketLiquidation=5]="MarketLiquidation",e[e.ExpiryMarketSettlement=6]="ExpiryMarketSettlement",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(xf||(xf={}));var zf;(function(e){e[e.UNUSED=0]="UNUSED",e[e.ANY=1]="ANY",e[e.REGULAR=2]="REGULAR",e[e.CONDITIONAL=4]="CONDITIONAL",e[e.DIRECTION_BUY_OR_HIGHER=8]="DIRECTION_BUY_OR_HIGHER",e[e.DIRECTION_SELL_OR_LOWER=16]="DIRECTION_SELL_OR_LOWER",e[e.TYPE_MARKET=32]="TYPE_MARKET",e[e.TYPE_LIMIT=64]="TYPE_LIMIT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(zf||(zf={}));ee.util.Long!==te&&(ee.util.Long=te,ee.configure());function Yf(){return{sender:"",sourceSubaccountId:"",destinationSubaccountId:"",marketId:"",amount:""}}const ho={encode(e,n=ee.Writer.create()){return e.sender!==""&&n.uint32(10).string(e.sender),e.sourceSubaccountId!==""&&n.uint32(18).string(e.sourceSubaccountId),e.destinationSubaccountId!==""&&n.uint32(26).string(e.destinationSubaccountId),e.marketId!==""&&n.uint32(34).string(e.marketId),e.amount!==""&&n.uint32(42).string(e.amount),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Yf();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.sender=t.string();continue;case 2:if(g!==18)break;o.sourceSubaccountId=t.string();continue;case 3:if(g!==26)break;o.destinationSubaccountId=t.string();continue;case 4:if(g!==34)break;o.marketId=t.string();continue;case 5:if(g!==42)break;o.amount=t.string();continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{sender:rr(e.sender)?globalThis.String(e.sender):"",sourceSubaccountId:rr(e.sourceSubaccountId)?globalThis.String(e.sourceSubaccountId):"",destinationSubaccountId:rr(e.destinationSubaccountId)?globalThis.String(e.destinationSubaccountId):"",marketId:rr(e.marketId)?globalThis.String(e.marketId):"",amount:rr(e.amount)?globalThis.String(e.amount):""}},toJSON(e){const n={};return e.sender!==""&&(n.sender=e.sender),e.sourceSubaccountId!==""&&(n.sourceSubaccountId=e.sourceSubaccountId),e.destinationSubaccountId!==""&&(n.destinationSubaccountId=e.destinationSubaccountId),e.marketId!==""&&(n.marketId=e.marketId),e.amount!==""&&(n.amount=e.amount),n},create(e){return ho.fromPartial(e??{})},fromPartial(e){var n,t,i,o,g;const C=Yf();return C.sender=(n=e.sender)!==null&&n!==void 0?n:"",C.sourceSubaccountId=(t=e.sourceSubaccountId)!==null&&t!==void 0?t:"",C.destinationSubaccountId=(i=e.destinationSubaccountId)!==null&&i!==void 0?i:"",C.marketId=(o=e.marketId)!==null&&o!==void 0?o:"",C.amount=(g=e.amount)!==null&&g!==void 0?g:"",C}};function Zf(){return{Signer:new Uint8Array(0),Data:new Uint8Array(0)}}const oo={encode(e,n=ee.Writer.create()){return e.Signer.length!==0&&n.uint32(10).bytes(e.Signer),e.Data.length!==0&&n.uint32(18).bytes(e.Data),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=Zf();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==10)break;o.Signer=t.bytes();continue;case 2:if(g!==18)break;o.Data=t.bytes();continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{Signer:rr(e.Signer)?Xf(e.Signer):new Uint8Array(0),Data:rr(e.Data)?Xf(e.Data):new Uint8Array(0)}},toJSON(e){const n={};return e.Signer.length!==0&&(n.Signer=jf(e.Signer)),e.Data.length!==0&&(n.Data=jf(e.Data)),n},create(e){return oo.fromPartial(e??{})},fromPartial(e){var n,t;const i=Zf();return i.Signer=(n=e.Signer)!==null&&n!==void 0?n:new Uint8Array(0),i.Data=(t=e.Data)!==null&&t!==void 0?t:new Uint8Array(0),i}};function Xf(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const n=globalThis.atob(e),t=new Uint8Array(n.length);for(let i=0;i<n.length;++i)t[i]=n.charCodeAt(i);return t}}function jf(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{const n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}ee.util.Long!==te&&(ee.util.Long=te,ee.configure());function rr(e){return e!=null}function ep(){return{typedDataChainID:"0",feePayer:"",feePayerSig:new Uint8Array(0)}}const Lh={encode(e,n=ee.Writer.create()){return e.typedDataChainID!=="0"&&n.uint32(8).uint64(e.typedDataChainID),e.feePayer!==""&&n.uint32(18).string(e.feePayer),e.feePayerSig.length!==0&&n.uint32(26).bytes(e.feePayerSig),n},decode(e,n){const t=e instanceof ee.Reader?e:ee.Reader.create(e);let i=n===void 0?t.len:t.pos+n;const o=ep();for(;t.pos<i;){const g=t.uint32();switch(g>>>3){case 1:if(g!==8)break;o.typedDataChainID=PE(t.uint64());continue;case 2:if(g!==18)break;o.feePayer=t.string();continue;case 3:if(g!==26)break;o.feePayerSig=t.bytes();continue}if((g&7)===4||g===0)break;t.skipType(g&7)}return o},fromJSON(e){return{typedDataChainID:vu(e.typedDataChainID)?globalThis.String(e.typedDataChainID):"0",feePayer:vu(e.feePayer)?globalThis.String(e.feePayer):"",feePayerSig:vu(e.feePayerSig)?SE(e.feePayerSig):new Uint8Array(0)}},toJSON(e){const n={};return e.typedDataChainID!=="0"&&(n.typedDataChainID=e.typedDataChainID),e.feePayer!==""&&(n.feePayer=e.feePayer),e.feePayerSig.length!==0&&(n.feePayerSig=kE(e.feePayerSig)),n},create(e){return Lh.fromPartial(e??{})},fromPartial(e){var n,t,i;const o=ep();return o.typedDataChainID=(n=e.typedDataChainID)!==null&&n!==void 0?n:"0",o.feePayer=(t=e.feePayer)!==null&&t!==void 0?t:"",o.feePayerSig=(i=e.feePayerSig)!==null&&i!==void 0?i:new Uint8Array(0),o}};function SE(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const n=globalThis.atob(e),t=new Uint8Array(n.length);for(let i=0;i<n.length;++i)t[i]=n.charCodeAt(i);return t}}function kE(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{const n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function PE(e){return e.toString()}ee.util.Long!==te&&(ee.util.Long=te,ee.configure());function vu(e){return e!=null}class Qn extends _.ConcreteException{constructor(t,i){super(t,i);Se(this,"errorClass","HttpRequestException");Se(this,"method",_.HttpRequestMethod.Get);this.type=_.ErrorType.HttpRequest,this.method=i&&i.method||_.HttpRequestMethod.Get}}const vE={[_.ChainAuctionErrorCodes.ErrBidInvalid]:"The gas limit provided in the transaction is not valid",[_.ChainAuctionErrorCodes.ErrBidRound]:"The gas limit provided in the transaction is not valid"},CE={[_.ChainAuthZErrorCodes.ErrNoAuthorizationFound]:"Authorization not found",[_.ChainAuthZErrorCodes.ErrInvalidExpirationTime]:"Expiration time of authorization should be more than current time",[_.ChainAuthZErrorCodes.ErrUnknownAuthorizationType]:"Unknown authorization type",[_.ChainAuthZErrorCodes.ErrNoGrantKeyFound]:"Grant key not found",[_.ChainAuthZErrorCodes.ErrAuthorizationExpired]:"Authorization expired",[_.ChainAuthZErrorCodes.ErrGranteeIsGranter]:"Grantee and granter should be different",[_.ChainAuthZErrorCodes.ErrAuthorizationNumOfSigners]:"Authorization can be given to msg with only one signer",[_.ChainAuthZErrorCodes.ErrNegativeMaxTokens]:"Max tokens should be positive"},RE={[_.ChainCosmosErrorCode.ErrInsufficientFee]:"You do not have enough funds to cover the transaction fees.",[_.ChainCosmosErrorCode.ErrInsufficientFunds]:"You do not have enough funds.",[_.ChainCosmosErrorCode.ErrTxTimeoutHeight]:"The transaction failed to be included within a block on time.",[_.ChainCosmosErrorCode.ErrTxDecode]:"There is an issue while parsing the transaction",[_.ChainCosmosErrorCode.ErrInvalidSequence]:"The sequence number is not valid",[_.ChainCosmosErrorCode.ErrUnauthorized]:"Unauthorized",[_.ChainCosmosErrorCode.ErrUnknownRequest]:"The request is not known",[_.ChainCosmosErrorCode.ErrInvalidAddress]:"The address is not valid",[_.ChainCosmosErrorCode.ErrInvalidPubKey]:"The public key is not valid",[_.ChainCosmosErrorCode.ErrUnknownAddress]:"The address is unknown",[_.ChainCosmosErrorCode.ErrInvalidCoins]:"The coins are not valid",[_.ChainCosmosErrorCode.ErrOutOfGas]:"The transaction run out of gas",[_.ChainCosmosErrorCode.ErrMemoTooLarge]:"The memo field in the transaction is too large",[_.ChainCosmosErrorCode.ErrTooManySignatures]:"The transaction exceeded the maximum number of signatures",[_.ChainCosmosErrorCode.ErrNoSignatures]:"There are no signatures appended on the transaction",[_.ChainCosmosErrorCode.ErrJSONMarshal]:"There is an issue while parsing the transaction",[_.ChainCosmosErrorCode.ErrJSONUnmarshal]:"There is an issue while parsing the transaction",[_.ChainCosmosErrorCode.ErrInvalidRequest]:"invalid request",[_.ChainCosmosErrorCode.ErrTxInMempoolCache]:"The transaction is already in the mempool",[_.ChainCosmosErrorCode.ErrMempoolIsFull]:"The mempool is full",[_.ChainCosmosErrorCode.ErrTxTooLarge]:"The transaction is too large",[_.ChainCosmosErrorCode.ErrKeyNotFound]:"Account does not exist on chain. To create an account, send some tokens to it",[_.ChainCosmosErrorCode.ErrWrongPassword]:"invalid account password",[_.ChainCosmosErrorCode.ErrorInvalidSigner]:"tx intended signer does not match the given signer",[_.ChainCosmosErrorCode.ErrorInvalidGasAdjustment]:"invalid gas adjustment",[_.ChainCosmosErrorCode.ErrInvalidHeight]:"The height provided in the transaction is not valid",[_.ChainCosmosErrorCode.ErrInvalidVersion]:"The version provided in the transaction is not valid",[_.ChainCosmosErrorCode.ErrInvalidChainID]:"The chainId provided in the transaction is not valid",[_.ChainCosmosErrorCode.ErrInvalidType]:"The type provided in the transaction is not valid",[_.ChainCosmosErrorCode.ErrUnknownExtensionOptions]:"The extension options provided in the transaction is unknown",[_.ChainCosmosErrorCode.ErrWrongSequence]:"The sequence number provided in the transaction is incorrect",[_.ChainCosmosErrorCode.ErrPackAny]:"failed packing protobuf message to Any",[_.ChainCosmosErrorCode.ErrUnpackAny]:"failed unpacking protobuf message from Any",[_.ChainCosmosErrorCode.ErrLogic]:"Internal logic error",[_.ChainCosmosErrorCode.ErrConflict]:"conflict",[_.ChainCosmosErrorCode.ErrNotSupported]:"The feature is not supported",[_.ChainCosmosErrorCode.ErrNotFound]:"not found",[_.ChainCosmosErrorCode.ErrIO]:"Internal IO error",[_.ChainCosmosErrorCode.ErrAppConfig]:"error in app.toml",[_.ChainCosmosErrorCode.ErrInvalidGasLimit]:"The gas limit provided in the transaction is not valid"},BE={[_.ChainExchangeModuleErrorCode.ErrOrderInvalid]:"Your order failed to validate",[_.ChainExchangeModuleErrorCode.ErrSpotMarketNotFound]:"The spot market has not been found",[_.ChainExchangeModuleErrorCode.ErrSpotMarketExists]:"The spot market already exists",[_.ChainExchangeModuleErrorCode.ErrBadField]:"There is an issue with your order",[_.ChainExchangeModuleErrorCode.ErrMarketInvalid]:"The market failed to validate",[_.ChainExchangeModuleErrorCode.ErrInsufficientDeposit]:"Your trading account has insufficient funds",[_.ChainExchangeModuleErrorCode.ErrUnrecognizedOrderType]:"The order type is not recognized",[_.ChainExchangeModuleErrorCode.ErrInsufficientPositionQuantity]:"The position quantity is insufficient for the order",[_.ChainExchangeModuleErrorCode.ErrOrderHashInvalid]:"The order hash is not valid",[_.ChainExchangeModuleErrorCode.ErrBadSubaccountID]:"The subaccount id is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidBaseDenom]:"",[_.ChainExchangeModuleErrorCode.ErrInvalidExpiry]:"The expiry date is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidPrice]:"The price is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidQuantity]:"The quantity is not valid",[_.ChainExchangeModuleErrorCode.ErrUnsupportedOracleType]:"The oracle type is not supported",[_.ChainExchangeModuleErrorCode.ErrOrderDoesntExist]:"The order does not exist",[_.ChainExchangeModuleErrorCode.ErrOrderbookFillInvalid]:"",[_.ChainExchangeModuleErrorCode.ErrPerpetualMarketExists]:"The perpetual market already exists",[_.ChainExchangeModuleErrorCode.ErrExpiryFuturesMarketExists]:"The expiry futures market market already exists",[_.ChainExchangeModuleErrorCode.ErrExpiryFuturesMarketExpired]:"The expiry futures market has expired",[_.ChainExchangeModuleErrorCode.ErrNoLiquidity]:"There is not enough liquidity",[_.ChainExchangeModuleErrorCode.ErrSlippageExceedsWorstPrice]:"There is not enough liquidity",[_.ChainExchangeModuleErrorCode.ErrInsufficientOrderMargin]:"The order has insufficient margin",[_.ChainExchangeModuleErrorCode.ErrDerivativeMarketNotFound]:"The derivative market cannot be found",[_.ChainExchangeModuleErrorCode.ErrPositionNotFound]:"The position cannot be found",[_.ChainExchangeModuleErrorCode.ErrInvalidReduceOnlyPositionDirection]:"Position direction does not oppose the reduce-only order",[_.ChainExchangeModuleErrorCode.ErrPriceSurpassesBankruptcyPrice]:"Your order price surpasses bankruptcy price",[_.ChainExchangeModuleErrorCode.ErrPositionNotLiquidable]:"The position is not liquidable",[_.ChainExchangeModuleErrorCode.ErrInvalidTriggerPrice]:"Your order trigger price is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidOracleType]:"The oracle type is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidPriceTickSize]:"The minimum price tick size is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidQuantityTickSize]:"The minimum quantity tick size is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidMargin]:"Your order's minimum margin is not valid ",[_.ChainExchangeModuleErrorCode.ErrExceedsOrderSideCount]:"You cannot have more orders for this market for this direction",[_.ChainExchangeModuleErrorCode.ErrMarketOrderAlreadyExists]:"You cannot place another market order within this block",[_.ChainExchangeModuleErrorCode.ErrConditionalMarketOrderAlreadyExists]:"You cannot place another conditional market order",[_.ChainExchangeModuleErrorCode.ErrMarketLaunchProposalAlreadyExists]:"There is an existing equivalent market launch proposal.",[_.ChainExchangeModuleErrorCode.ErrInvalidMarketStatus]:"The market status is not valid",[_.ChainExchangeModuleErrorCode.ErrSameDenoms]:"The base denom and quote denom cannot be same",[_.ChainExchangeModuleErrorCode.ErrSameOracles]:"The oracle base and the oracle quote cannot be the same",[_.ChainExchangeModuleErrorCode.ErrFeeRatesRelation]:"The MakerFeeRate does not match TakerFeeRate requirements",[_.ChainExchangeModuleErrorCode.ErrMarginsRelation]:"The MaintenanceMarginRatio cannot be greater than InitialMarginRatio",[_.ChainExchangeModuleErrorCode.ErrExceedsMaxOracleScaleFactor]:"The OracleScaleFactor cannot be greater than MaxOracleScaleFactor",[_.ChainExchangeModuleErrorCode.ErrSpotExchangeNotEnabled]:"Spot exchange is not enabled yet",[_.ChainExchangeModuleErrorCode.ErrDerivativesExchangeNotEnabled]:"Derivatives exchange is not enabled yet",[_.ChainExchangeModuleErrorCode.ErrOraclePriceDeltaExceedsThreshold]:"The oracle price delta exceeds threshold",[_.ChainExchangeModuleErrorCode.ErrInvalidHourlyInterestRate]:"The hourly interest rate is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidHourlyFundingRateCap]:"The hourly funding rate cap is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidMarketFundingParamUpdate]:"You can only update funding parameters on perpetual markets.",[_.ChainExchangeModuleErrorCode.ErrInvalidTradingRewardCampaign]:"The trading reward campaign is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidFeeDiscountSchedule]:"The fee discount schedule is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidLiquidationOrder]:"The liquidation order is not valid",[_.ChainExchangeModuleErrorCode.ErrTradingRewardCampaignDistributionError]:"Unknown error happened for campaign distributions",[_.ChainExchangeModuleErrorCode.ErrInvalidTradingRewardsPendingPointsUpdate]:"The updated trading reward points is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidBatchMsgUpdate]:"The MsgBatchUpdate is not valid",[_.ChainExchangeModuleErrorCode.ErrExceedsTopOfBookPrice]:"The post-only order price exceeds top of the orderbook price",[_.ChainExchangeModuleErrorCode.ErrInvalidOrderTypeForMessage]:"The order type is not supported for this message",[_.ChainExchangeModuleErrorCode.ErrInvalidDMMSender]:"The sender must match the DMM address",[_.ChainExchangeModuleErrorCode.ErrAlreadyOptedOutOfRewards]:"The DMM address already opted out of rewards",[_.ChainExchangeModuleErrorCode.ErrInvalidMarginRatio]:"The margin ratio is not valid",[_.ChainExchangeModuleErrorCode.ErrBelowMinimalContribution]:"The provided funds are below minimum",[_.ChainExchangeModuleErrorCode.ErrLowPositionMargin]:"The position is below initial margin requirement",[_.ChainExchangeModuleErrorCode.ErrInvalidTotalSupply]:"The pool has non-positive total LP token supply",[_.ChainExchangeModuleErrorCode.ErrInvalidLpTokenBurnAmount]:"The passed LP token burn amount is greater than total LP token supply",[_.ChainExchangeModuleErrorCode.ErrUnsupportedAction]:"This action is not supported",[_.ChainExchangeModuleErrorCode.ErrNegativePositionQuantity]:"The position quantity cannot be negative",[_.ChainExchangeModuleErrorCode.ErrBinaryOptionsMarketExists]:"The BinaryOptions market already exists",[_.ChainExchangeModuleErrorCode.ErrBinaryOptionsMarketNotFound]:"The BinaryOptions market cannot be found",[_.ChainExchangeModuleErrorCode.ErrInvalidSettlement]:"The settlement price is not valid",[_.ChainExchangeModuleErrorCode.ErrAccountDoesntExist]:"The trading account does not exist",[_.ChainExchangeModuleErrorCode.ErrSenderIsNotAnAdmin]:"The sender should be the admin of the market",[_.ChainExchangeModuleErrorCode.ErrMarketAlreadyScheduledToSettle]:"The market is already scheduled to settle ",[_.ChainExchangeModuleErrorCode.ErrGenericMarketNotFound]:"The market cannot be found",[_.ChainExchangeModuleErrorCode.ErrInvalidDenomDecimal]:"The denom decimal cannot be below 1 or above max scale factor",[_.ChainExchangeModuleErrorCode.ErrInvalidState]:"The state is not valid",[_.ChainExchangeModuleErrorCode.ErrTransientOrdersUpToCancelNotSupported]:"The transient orders up to cancellation not supported",[_.ChainExchangeModuleErrorCode.ErrInvalidTrade]:"The trade is not valid",[_.ChainExchangeModuleErrorCode.ErrNoMarginLocked]:"There is no margin locked in the trading account",[_.ChainExchangeModuleErrorCode.ErrInvalidAccessLevel]:"There is no access to perform action",[_.ChainExchangeModuleErrorCode.ErrInvalidAddress]:"The address is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidArgument]:"The argument is not valid",[_.ChainExchangeModuleErrorCode.ErrInvalidFundsDirection]:"Invalid funds direction",[_.ChainExchangeModuleErrorCode.ErrNoFundsProvided]:"No funds provided",[_.ChainExchangeModuleErrorCode.ErrInvalidSignature]:"Invalid signature",[_.ChainExchangeModuleErrorCode.ErrNoFundsToUnlock]:"No funds to unlock",[_.ChainExchangeModuleErrorCode.ErrNoMsgsProvided]:"No msgs provided",[_.ChainExchangeModuleErrorCode.ErrNoMsgProvided]:"No msg provided",[_.ChainExchangeModuleErrorCode.ErrInvalidAmount]:"Invalid amount",[_.ChainExchangeModuleErrorCode.ErrFeatureDisabled]:"The current feature has been disabled",[_.ChainExchangeModuleErrorCode.ErrTooMuchOrderMargin]:"Order has too much margin",[_.ChainExchangeModuleErrorCode.ErrBadSubaccountNonce]:"Subaccount nonce is invalid",[_.ChainExchangeModuleErrorCode.ErrInsufficientFunds]:"Insufficient funds",[_.ChainExchangeModuleErrorCode.ErrPostOnlyMode]:"Only post-only actions available for approximately 30 minutes after a chain upgrade.",[_.ChainExchangeModuleErrorCode.ErrClientOrderIdAlreadyExists]:"Client order id already exists",[_.ChainExchangeModuleErrorCode.ErrInvalidCid]:"Client order id is invalid. Max length is 36 chars"},bE={[_.ChainInsuranceErrorCodes.ErrInsuranceFundAlreadyExists]:"The insurance fund already exists",[_.ChainInsuranceErrorCodes.ErrInsuranceFundNotFound]:"The insurance fund is not found",[_.ChainInsuranceErrorCodes.ErrRedemptionAlreadyExists]:"The redemption already exists",[_.ChainInsuranceErrorCodes.ErrInvalidDepositAmount]:"The deposit amount is not valid",[_.ChainInsuranceErrorCodes.ErrInvalidDepositDenom]:"The deposit denom is not valid",[_.ChainInsuranceErrorCodes.ErrPayoutTooLarge]:"The insurance fund payout exceeds the deposits",[_.ChainInsuranceErrorCodes.ErrInvalidTicker]:"The ticker is not valid",[_.ChainInsuranceErrorCodes.ErrInvalidQuoteDenom]:"The quote denom is not valid",[_.ChainInsuranceErrorCodes.ErrInvalidOracle]:"The oracle is not valid",[_.ChainInsuranceErrorCodes.ErrInvalidExpirationTime]:"The expiration time is not valid",[_.ChainInsuranceErrorCodes.ErrInvalidMarketID]:"The marketId is not valid",[_.ChainInsuranceErrorCodes.ErrInvalidShareDenom]:"The share denom is not valid"},EE={[_.ChainOcrErrorCodes.ErrStaleReport]:"stale report",[_.ChainOcrErrorCodes.ErrIncompleteProposal]:"incomplete proposal",[_.ChainOcrErrorCodes.ErrRepeatedAddress]:"repeated oracle address",[_.ChainOcrErrorCodes.ErrTooManySigners]:"too many signers",[_.ChainOcrErrorCodes.ErrIncorrectConfig]:"incorrect config",[_.ChainOcrErrorCodes.ErrConfigDigestNotMatch]:"config digest doesn't match",[_.ChainOcrErrorCodes.ErrWrongNumberOfSignatures]:"wrong number of signatures",[_.ChainOcrErrorCodes.ErrIncorrectSignature]:"incorrect signature",[_.ChainOcrErrorCodes.ErrNoTransmitter]:"no transmitter specified",[_.ChainOcrErrorCodes.ErrIncorrectTransmissionData]:"incorrect transmission data",[_.ChainOcrErrorCodes.ErrNoTransmissionsFound]:"no transmissions found",[_.ChainOcrErrorCodes.ErrMedianValueOutOfBounds]:"median value is out of bounds",[_.ChainOcrErrorCodes.ErrIncorrectRewardPoolDenom]:"LINK denom doesn't match",[_.ChainOcrErrorCodes.ErrNoRewardPool]:"Reward Pool doesn't exist",[_.ChainOcrErrorCodes.ErrInvalidPayees]:"wrong number of payees and transmitters",[_.ChainOcrErrorCodes.ErrModuleAdminRestricted]:"action is restricted to the module admin",[_.ChainOcrErrorCodes.ErrFeedAlreadyExists]:"feed already exists",[_.ChainOcrErrorCodes.ErrFeedDoesntExists]:"feed doesnt exists",[_.ChainOcrErrorCodes.ErrAdminRestricted]:"action is admin-restricted",[_.ChainOcrErrorCodes.ErrInsufficientRewardPool]:"insufficient reward pool",[_.ChainOcrErrorCodes.ErrPayeeAlreadySet]:"payee already set",[_.ChainOcrErrorCodes.ErrPayeeRestricted]:"action is payee-restricted",[_.ChainOcrErrorCodes.ErrFeedConfigNotFound]:"feed config not found"},IE={[_.ChainOracleErrorCodes.ErrEmptyRelayerAddr]:"relayer address is empty",[_.ChainOracleErrorCodes.ErrBadRatesCount]:"bad rates count",[_.ChainOracleErrorCodes.ErrBadResolveTimesCount]:"bad resolve times",[_.ChainOracleErrorCodes.ErrBadRequestIDsCount]:"bad request ID",[_.ChainOracleErrorCodes.ErrRelayerNotAuthorized]:"relayer not authorized",[_.ChainOracleErrorCodes.ErrBadPriceFeedBaseCount]:"bad price feed base count",[_.ChainOracleErrorCodes.ErrBadPriceFeedQuoteCount]:"bad price feed quote count",[_.ChainOracleErrorCodes.ErrUnsupportedOracleType]:"unsupported oracle type",[_.ChainOracleErrorCodes.ErrBadMessagesCount]:"bad messages count",[_.ChainOracleErrorCodes.ErrBadCoinbaseMessage]:"bad Coinbase message",[_.ChainOracleErrorCodes.ErrInvalidEthereumSignature]:"bad Ethereum signature",[_.ChainOracleErrorCodes.ErrBadCoinbaseMessageTimestamp]:"bad Coinbase message timestamp",[_.ChainOracleErrorCodes.ErrCoinbasePriceNotFound]:"Coinbase price not found",[_.ChainOracleErrorCodes.ErrBadPrice]:"Prices must be positive",[_.ChainOracleErrorCodes.ErrPriceTooLarge]:"Prices must be less than 10 million.",[_.ChainOracleErrorCodes.ErrInvalidBandIBCRequest]:"Invalid Band IBC Request",[_.ChainOracleErrorCodes.ErrSample]:"sample error",[_.ChainOracleErrorCodes.ErrInvalidPacketTimeout]:"invalid packet timeout",[_.ChainOracleErrorCodes.ErrBadSymbolsCount]:"invalid symbols count",[_.ChainOracleErrorCodes.ErrBadIBCPortBind]:"could not claim port capability",[_.ChainOracleErrorCodes.ErrInvalidPortID]:"invalid IBC Port ID",[_.ChainOracleErrorCodes.ErrInvalidChannelID]:"invalid IBC Channel ID",[_.ChainOracleErrorCodes.ErrBadRequestInterval]:"invalid Band IBC request interval",[_.ChainOracleErrorCodes.ErrInvalidBandIBCUpdateRequest]:"Invalid Band IBC Update Request Proposal",[_.ChainOracleErrorCodes.ErrBandIBCRequestNotFound]:"Band IBC Oracle Request not found",[_.ChainOracleErrorCodes.ErrEmptyBaseInfo]:"Base Info is empty",[_.ChainOracleErrorCodes.ErrEmptyProvider]:"provider is empty",[_.ChainOracleErrorCodes.ErrInvalidProvider]:"invalid provider name",[_.ChainOracleErrorCodes.ErrInvalidSymbol]:"invalid symbol",[_.ChainOracleErrorCodes.ErrRelayerAlreadyExists]:"relayer already exists",[_.ChainOracleErrorCodes.ErrProviderPriceNotFound]:"provider price not found",[_.ChainOracleErrorCodes.ErrInvalidOracleRequest]:"invalid oracle request",[_.ChainOracleErrorCodes.ErrOraclePriceNotFound]:"no price for oracle was found"},OE={[_.ChainPeggyErrorCodes.ErrInternal]:"internal",[_.ChainPeggyErrorCodes.ErrDuplicate]:"duplicate",[_.ChainPeggyErrorCodes.ErrInvalid]:"invalid",[_.ChainPeggyErrorCodes.ErrTimeout]:"timeout",[_.ChainPeggyErrorCodes.ErrUnknown]:"unknown",[_.ChainPeggyErrorCodes.ErrEmpty]:"empty",[_.ChainPeggyErrorCodes.ErrOutdated]:"outdated",[_.ChainPeggyErrorCodes.ErrUnsupported]:"unsupported",[_.ChainPeggyErrorCodes.ErrNonContiguousEventNonce]:"non contiguous event nonce",[_.ChainPeggyErrorCodes.ErrNoUnbatchedTxsFound]:"no unbatched txs found",[_.ChainPeggyErrorCodes.ErrResetDelegateKeys]:"can not set orchestrator addresses more than once",[_.ChainPeggyErrorCodes.ErrSupplyOverflow]:"supply cannot exceed max ERC20 value",[_.ChainPeggyErrorCodes.ErrInvalidEthSender]:"invalid ethereum sender on claim",[_.ChainPeggyErrorCodes.ErrInvalidEthDestination]:"invalid ethereum destination"},AE={[_.ChainTokenFactoryErrorCodes.ErrDenomExists]:"attempting to create a denom that already exists",[_.ChainTokenFactoryErrorCodes.ErrUnauthorized]:"unauthorized account",[_.ChainTokenFactoryErrorCodes.ErrInvalidDenom]:"invalid denom",[_.ChainTokenFactoryErrorCodes.ErrInvalidCreator]:"invalid creator",[_.ChainTokenFactoryErrorCodes.ErrInvalidAuthorityMetadata]:"invalid authority metadata",[_.ChainTokenFactoryErrorCodes.ErrInvalidGenesis]:"invalid genesis",[_.ChainTokenFactoryErrorCodes.ErrSubdenomTooLong]:"subdenom too long",[_.ChainTokenFactoryErrorCodes.ErrSubdenomTooShort]:"subdenom too short",[_.ChainTokenFactoryErrorCodes.ErrSubdenomNestedTooShort]:"nested subdenom too short, each one should have at least",[_.ChainTokenFactoryErrorCodes.ErrCreatorTooLong]:"creator too long",[_.ChainTokenFactoryErrorCodes.ErrDenomDoesNotExist]:"denom does not exist"},TE={[_.ChainWasmXErrorCodes.ErrInvalidGasLimit]:"invalid gas limit",[_.ChainWasmXErrorCodes.ErrInvalidGasPrice]:"invalid gas price",[_.ChainWasmXErrorCodes.ErrInvalidContractAddress]:"invalid contract address",[_.ChainWasmXErrorCodes.ErrAlreadyRegistered]:"contract already registered",[_.ChainWasmXErrorCodes.ErrDuplicateContract]:"duplicate contract",[_.ChainWasmXErrorCodes.ErrNoContractAddresses]:"no contract addresses found",[_.ChainWasmXErrorCodes.ErrInvalidCodeId]:"invalid code id"},NE={[_.ChainStakingErrorCodes.ErrEmptyValidatorAddr]:"empty validator address",[_.ChainStakingErrorCodes.ErrNoValidatorFound]:"validator does not exist",[_.ChainStakingErrorCodes.ErrValidatorOwnerExists]:"validator already exist for this operator address; must use new validator operator address",[_.ChainStakingErrorCodes.ErrValidatorPubKeyExists]:"validator already exist for this pubkey; must use new validator pubkey",[_.ChainStakingErrorCodes.ErrValidatorPubKeyTypeNotSupported]:"validator pubkey type is not supported",[_.ChainStakingErrorCodes.ErrValidatorJailed]:"validator for this address is currently jailed",[_.ChainStakingErrorCodes.ErrBadRemoveValidator]:"failed to remove validator",[_.ChainStakingErrorCodes.ErrCommissionNegative]:"commission must be positive",[_.ChainStakingErrorCodes.ErrCommissionHuge]:"commission cannot be more than 100%",[_.ChainStakingErrorCodes.ErrCommissionGTMaxRate]:"commission cannot be more than the max rate",[_.ChainStakingErrorCodes.ErrCommissionUpdateTime]:"commission cannot be changed more than once in 24h",[_.ChainStakingErrorCodes.ErrCommissionChangeRateNegative]:"commission change rate must be positive",[_.ChainStakingErrorCodes.ErrCommissionChangeRateGTMaxRate]:"commission change rate cannot be more than the max rate",[_.ChainStakingErrorCodes.ErrCommissionGTMaxChangeRate]:"commission cannot be changed more than max change rate",[_.ChainStakingErrorCodes.ErrSelfDelegationBelowMinimum]:"validator's self delegation must be greater than their minimum self delegation",[_.ChainStakingErrorCodes.ErrMinSelfDelegationDecreased]:"minimum self delegation cannot be decrease",[_.ChainStakingErrorCodes.ErrEmptyDelegatorAddr]:"empty delegator address",[_.ChainStakingErrorCodes.ErrNoDelegation]:"no delegation for (address, validator) tuple",[_.ChainStakingErrorCodes.ErrBadDelegatorAddr]:"delegator does not exist with address",[_.ChainStakingErrorCodes.ErrNoDelegatorForAddress]:"delegator does not contain delegation",[_.ChainStakingErrorCodes.ErrInsufficientShares]:"insufficient delegation shares",[_.ChainStakingErrorCodes.ErrDelegationValidatorEmpty]:"cannot delegate to an empty validator",[_.ChainStakingErrorCodes.ErrNotEnoughDelegationShares]:"not enough delegation shares",[_.ChainStakingErrorCodes.ErrNotMature]:"entry not mature",[_.ChainStakingErrorCodes.ErrNoUnbondingDelegation]:"no unbonding delegation found",[_.ChainStakingErrorCodes.ErrMaxUnbondingDelegationEntries]:"too many unbonding delegation entries for (delegator, validator) tuple",[_.ChainStakingErrorCodes.ErrNoRedelegation]:"no redelegation found",[_.ChainStakingErrorCodes.ErrSelfRedelegation]:"cannot redelegate to the same validator",[_.ChainStakingErrorCodes.ErrTinyRedelegationAmount]:"too few tokens to redelegate (truncates to zero tokens)",[_.ChainStakingErrorCodes.ErrBadRedelegationDst]:"redelegation destination validator not found",[_.ChainStakingErrorCodes.ErrTransitiveRedelegation]:"redelegation to this validator already in progress; first redelegation to this validator must complete before next redelegation",[_.ChainStakingErrorCodes.ErrMaxRedelegationEntries]:"too many redelegation entries for (delegator, src-validator, dst-validator) tuple",[_.ChainStakingErrorCodes.ErrDelegatorShareExRateInvalid]:"cannot delegate to validators with invalid (zero) ex-rate",[_.ChainStakingErrorCodes.ErrBothShareMsgsGiven]:"both shares amount and shares percent provided",[_.ChainStakingErrorCodes.ErrNeitherShareMsgsGiven]:"neither shares amount nor shares percent provided",[_.ChainStakingErrorCodes.ErrInvalidHistoricalInfo]:"invalid historical info",[_.ChainStakingErrorCodes.ErrNoHistoricalInfo]:"no historical info found",[_.ChainStakingErrorCodes.ErrEmptyValidatorPubKey]:"empty validator public key",[_.ChainStakingErrorCodes.ErrCommissionLTMinRate]:"commission cannot be less than min rate",[_.ChainStakingErrorCodes.ErrUnbondingNotFound]:"unbonding operation not found",[_.ChainStakingErrorCodes.ErrUnbondingOnHoldRefCountNegative]:"cannot un-hold unbonding operation that is not on hold"},wE={[_.ChainGovErrorCodes.ErrUnknownProposal]:"unknown proposal",[_.ChainGovErrorCodes.ErrInactiveProposal]:"inactive proposal",[_.ChainGovErrorCodes.ErrAlreadyActiveProposal]:"proposal already active",[_.ChainGovErrorCodes.ErrInvalidProposalContent]:"invalid proposal content",[_.ChainGovErrorCodes.ErrInvalidProposalType]:"invalid proposal type",[_.ChainGovErrorCodes.ErrInvalidVote]:"invalid vote option",[_.ChainGovErrorCodes.ErrInvalidGenesis]:"invalid genesis state",[_.ChainGovErrorCodes.ErrNoProposalHandlerExists]:"no handler exists for proposal type",[_.ChainGovErrorCodes.ErrUnroutableProposalMsg]:"proposal message not recognized by router",[_.ChainGovErrorCodes.ErrNoProposalMsgs]:"no messages proposed",[_.ChainGovErrorCodes.ErrInvalidProposalMsg]:"invalid proposal message",[_.ChainGovErrorCodes.ErrInvalidSigner]:"expected gov account as only signer for proposal message",[_.ChainGovErrorCodes.ErrInvalidSignalMsg]:"signal message is invalid",[_.ChainGovErrorCodes.ErrMetadataTooLong]:"metadata too long",[_.ChainGovErrorCodes.ErrMinDepositTooSmall]:"minimum deposit is too small",[_.ChainGovErrorCodes.ErrProposalNotFound]:"proposal is not found",[_.ChainGovErrorCodes.ErrInvalidProposer]:"invalid proposer",[_.ChainGovErrorCodes.ErrNoDeposits]:"no deposits found",[_.ChainGovErrorCodes.ErrVotingPeriodEnded]:"voting period already ended",[_.ChainGovErrorCodes.ErrInvalidProposal]:"invalid proposal"},_E={[_.ChainBankErrorCodes.ErrNoInputs]:"no inputs to send transaction",[_.ChainBankErrorCodes.ErrNoOutputs]:"no outputs to send transaction",[_.ChainBankErrorCodes.ErrInputOutputMismatch]:"sum inputs != sum outputs",[_.ChainBankErrorCodes.ErrSendDisabled]:"send transactions are disabled",[_.ChainBankErrorCodes.ErrDenomMetadataNotFound]:"client denom metadata not found",[_.ChainBankErrorCodes.ErrInvalidKey]:"invalid key",[_.ChainBankErrorCodes.ErrDuplicateEntry]:"duplicate entry",[_.ChainBankErrorCodes.ErrMultipleSenders]:"multiple senders not allowed"},ME={[_.ChainDistributionErrorCodes.ErrEmptyDelegatorAddr]:"delegator address is empty",[_.ChainDistributionErrorCodes.ErrEmptyWithdrawAddr]:"withdraw address is empty",[_.ChainDistributionErrorCodes.ErrEmptyValidatorAddr]:"validator address is empty",[_.ChainDistributionErrorCodes.ErrEmptyDelegationDistInfo]:"no delegation distribution info",[_.ChainDistributionErrorCodes.ErrNoValidatorDistInfo]:"no validator distribution info",[_.ChainDistributionErrorCodes.ErrNoValidatorCommission]:"no validator commission to withdraw",[_.ChainDistributionErrorCodes.ErrSetWithdrawAddrDisabled]:"set withdraw address disabled",[_.ChainDistributionErrorCodes.ErrBadDistribution]:"community pool does not have sufficient coins to distribute",[_.ChainDistributionErrorCodes.ErrInvalidProposalAmount]:"invalid community pool spend proposal amount",[_.ChainDistributionErrorCodes.ErrEmptyProposalRecipient]:"invalid community pool spend proposal recipient",[_.ChainDistributionErrorCodes.ErrNoValidatorExists]:"validator does not exist",[_.ChainDistributionErrorCodes.ErrNoDelegationExists]:"delegation does not exist"},UE={[_.ChainWasmErrorCodes.ErrCreateFailed]:"create wasm contract failed",[_.ChainWasmErrorCodes.ErrAccountExists]:"contract account already exists",[_.ChainWasmErrorCodes.ErrInstantiateFailed]:"instantiate wasm contract failed",[_.ChainWasmErrorCodes.ErrExecuteFailed]:"Contract execution failed",[_.ChainWasmErrorCodes.ErrGasLimit]:"insufficient gas",[_.ChainWasmErrorCodes.ErrInvalidGenesis]:"invalid genesis",[_.ChainWasmErrorCodes.ErrNotFound]:"not found",[_.ChainWasmErrorCodes.ErrQueryFailed]:"query wasm contract failed",[_.ChainWasmErrorCodes.ErrInvalidMsg]:"invalid CosmosMsg from the contract",[_.ChainWasmErrorCodes.ErrMigrationFailed]:"migrate wasm contract failed",[_.ChainWasmErrorCodes.ErrEmpty]:"empty",[_.ChainWasmErrorCodes.ErrLimit]:"exceeds limit",[_.ChainWasmErrorCodes.ErrInvalid]:"invalid",[_.ChainWasmErrorCodes.ErrDuplicate]:"duplicate",[_.ChainWasmErrorCodes.ErrMaxIBCChannels]:"max transfer channels",[_.ChainWasmErrorCodes.ErrUnsupportedForContract]:"unsupported for this contract",[_.ChainWasmErrorCodes.ErrPinContractFailed]:"pinning contract failed",[_.ChainWasmErrorCodes.ErrUnpinContractFailed]:"unpinning contract failed",[_.ChainWasmErrorCodes.ErrUnknownMsg]:"unknown message from the contract",[_.ChainWasmErrorCodes.ErrInvalidEvent]:"invalid event"};_.TransactionChainErrorModule.AuthZ+"",_.TransactionChainErrorModule.Auction+"",_.TransactionChainErrorModule.CosmosSdk+"",_.TransactionChainErrorModule.Exchange+"",_.TransactionChainErrorModule.Insurance+"",_.TransactionChainErrorModule.Ocr+"",_.TransactionChainErrorModule.Oracle+"",_.TransactionChainErrorModule.Peggy+"",_.TransactionChainErrorModule.TokenFactory+"",_.TransactionChainErrorModule.Wasmx+"",_.TransactionChainErrorModule.Wasm+"",_.TransactionChainErrorModule.Staking+"",_.TransactionChainErrorModule.Bank+"",_.TransactionChainErrorModule.Gov+"",_.TransactionChainErrorModule.Distribution+"";_.ChainCosmosErrorCode.ErrInsufficientFee,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrInsufficientFunds,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrTxTimeoutHeight,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrTxDecode,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrInvalidSequence,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrUnauthorized,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrInvalidAddress,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrInsufficientFee,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrInvalidPubKey,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrUnknownAddress,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrInvalidCoins,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrOutOfGas,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrMemoTooLarge,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrTooManySignatures,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrNoSignatures,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrJSONMarshal,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrJSONUnmarshal,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrInvalidRequest,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrTxInMempoolCache,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrMempoolIsFull,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrTxTooLarge,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrKeyNotFound,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrWrongPassword,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrorInvalidSigner,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrorInvalidGasAdjustment,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrInvalidHeight,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrInvalidVersion,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrInvalidChainID,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrInvalidType,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrUnknownExtensionOptions,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrWrongSequence,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrPackAny,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrUnpackAny,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrLogic,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrConflict,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrNotSupported,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrIO,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrAppConfig,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrInvalidGasLimit,_.TransactionChainErrorModule.CosmosSdk,_.ChainAuctionErrorCodes.ErrBidInvalid,_.TransactionChainErrorModule.Auction,_.ChainAuctionErrorCodes.ErrBidRound,_.TransactionChainErrorModule.Auction,_.ChainInsuranceErrorCodes.ErrInsuranceFundAlreadyExists,_.TransactionChainErrorModule.Insurance,_.ChainInsuranceErrorCodes.ErrInsuranceFundNotFound,_.TransactionChainErrorModule.Insurance,_.ChainInsuranceErrorCodes.ErrRedemptionAlreadyExists,_.TransactionChainErrorModule.Insurance,_.ChainInsuranceErrorCodes.ErrInvalidDepositAmount,_.TransactionChainErrorModule.Insurance,_.ChainInsuranceErrorCodes.ErrInvalidDepositDenom,_.TransactionChainErrorModule.Insurance,_.ChainInsuranceErrorCodes.ErrPayoutTooLarge,_.TransactionChainErrorModule.Insurance,_.ChainInsuranceErrorCodes.ErrInvalidTicker,_.TransactionChainErrorModule.Insurance,_.ChainInsuranceErrorCodes.ErrInvalidQuoteDenom,_.TransactionChainErrorModule.Insurance,_.ChainInsuranceErrorCodes.ErrInvalidOracle,_.TransactionChainErrorModule.Insurance,_.ChainInsuranceErrorCodes.ErrInvalidExpirationTime,_.TransactionChainErrorModule.Insurance,_.ChainInsuranceErrorCodes.ErrInvalidMarketID,_.TransactionChainErrorModule.Insurance,_.ChainInsuranceErrorCodes.ErrInvalidShareDenom,_.TransactionChainErrorModule.Insurance,_.ChainExchangeModuleErrorCode.ErrOrderInvalid,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrSpotMarketNotFound,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrSpotMarketExists,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrBadField,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrMarketInvalid,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInsufficientDeposit,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrUnrecognizedOrderType,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInsufficientPositionQuantity,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrOrderHashInvalid,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrBadSubaccountID,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidBaseDenom,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidExpiry,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidPrice,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidQuantity,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrUnsupportedOracleType,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrOrderDoesntExist,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrOrderbookFillInvalid,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrPerpetualMarketExists,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrExpiryFuturesMarketExists,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrExpiryFuturesMarketExpired,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrNoLiquidity,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrSlippageExceedsWorstPrice,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInsufficientOrderMargin,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrDerivativeMarketNotFound,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrPositionNotFound,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidReduceOnlyPositionDirection,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrPriceSurpassesBankruptcyPrice,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrPositionNotLiquidable,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidTriggerPrice,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidOracleType,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidPriceTickSize,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidQuantityTickSize,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidMargin,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrExceedsOrderSideCount,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrMarketOrderAlreadyExists,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrConditionalMarketOrderAlreadyExists,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrMarketLaunchProposalAlreadyExists,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidMarketStatus,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrSameDenoms,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrSameOracles,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrFeeRatesRelation,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrMarginsRelation,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrExceedsMaxOracleScaleFactor,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrSpotExchangeNotEnabled,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrDerivativesExchangeNotEnabled,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrOraclePriceDeltaExceedsThreshold,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidHourlyInterestRate,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidHourlyFundingRateCap,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidMarketFundingParamUpdate,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidTradingRewardCampaign,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidFeeDiscountSchedule,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidLiquidationOrder,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrTradingRewardCampaignDistributionError,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidTradingRewardsPendingPointsUpdate,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidBatchMsgUpdate,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrExceedsTopOfBookPrice,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidOrderTypeForMessage,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidDMMSender,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrAlreadyOptedOutOfRewards,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidMarginRatio,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrBelowMinimalContribution,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrLowPositionMargin,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidTotalSupply,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidLpTokenBurnAmount,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrUnsupportedAction,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrNegativePositionQuantity,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrBinaryOptionsMarketExists,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrBinaryOptionsMarketNotFound,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidSettlement,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrAccountDoesntExist,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrSenderIsNotAnAdmin,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrMarketAlreadyScheduledToSettle,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrGenericMarketNotFound,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidDenomDecimal,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidState,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrTransientOrdersUpToCancelNotSupported,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidTrade,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrNoMarginLocked,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidAccessLevel,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidAddress,_.TransactionChainErrorModule.Exchange,_.ChainExchangeModuleErrorCode.ErrInvalidArgument,_.TransactionChainErrorModule.Exchange,_.ChainStakingErrorCodes.ErrEmptyValidatorAddr,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrNoValidatorFound,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrValidatorOwnerExists,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrValidatorPubKeyExists,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrValidatorPubKeyTypeNotSupported,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrValidatorJailed,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrBadRemoveValidator,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrCommissionNegative,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrCommissionHuge,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrCommissionGTMaxRate,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrCommissionUpdateTime,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrCommissionChangeRateNegative,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrCommissionChangeRateGTMaxRate,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrCommissionGTMaxChangeRate,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrSelfDelegationBelowMinimum,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrMinSelfDelegationDecreased,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrEmptyDelegatorAddr,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrNoDelegation,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrBadDelegatorAddr,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrNoDelegatorForAddress,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrInsufficientShares,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrDelegationValidatorEmpty,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrNotEnoughDelegationShares,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrNotMature,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrNoUnbondingDelegation,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrMaxUnbondingDelegationEntries,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrNoRedelegation,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrSelfRedelegation,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrTinyRedelegationAmount,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrBadRedelegationDst,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrTransitiveRedelegation,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrMaxRedelegationEntries,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrDelegatorShareExRateInvalid,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrBothShareMsgsGiven,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrNeitherShareMsgsGiven,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrInvalidHistoricalInfo,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrNoHistoricalInfo,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrEmptyValidatorPubKey,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrCommissionLTMinRate,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrUnbondingNotFound,_.TransactionChainErrorModule.Staking,_.ChainStakingErrorCodes.ErrUnbondingOnHoldRefCountNegative,_.TransactionChainErrorModule.Staking,_.ChainDistributionErrorCodes.ErrEmptyDelegatorAddr,_.TransactionChainErrorModule.Distribution,_.ChainDistributionErrorCodes.ErrEmptyWithdrawAddr,_.TransactionChainErrorModule.Distribution,_.ChainDistributionErrorCodes.ErrEmptyValidatorAddr,_.TransactionChainErrorModule.Distribution,_.ChainDistributionErrorCodes.ErrEmptyDelegationDistInfo,_.TransactionChainErrorModule.Distribution,_.ChainDistributionErrorCodes.ErrNoValidatorDistInfo,_.TransactionChainErrorModule.Distribution,_.ChainDistributionErrorCodes.ErrNoValidatorCommission,_.TransactionChainErrorModule.Distribution,_.ChainDistributionErrorCodes.ErrSetWithdrawAddrDisabled,_.TransactionChainErrorModule.Distribution,_.ChainDistributionErrorCodes.ErrBadDistribution,_.TransactionChainErrorModule.Distribution,_.ChainDistributionErrorCodes.ErrInvalidProposalAmount,_.TransactionChainErrorModule.Distribution,_.ChainDistributionErrorCodes.ErrEmptyProposalRecipient,_.TransactionChainErrorModule.Distribution,_.ChainDistributionErrorCodes.ErrNoDelegationExists,_.TransactionChainErrorModule.Distribution,_.ChainGovErrorCodes.ErrUnknownProposal,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrInactiveProposal,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrAlreadyActiveProposal,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrInvalidProposalContent,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrInvalidProposalType,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrInvalidVote,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrInvalidGenesis,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrNoProposalHandlerExists,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrUnroutableProposalMsg,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrNoProposalMsgs,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrInvalidProposalMsg,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrInvalidSigner,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrInvalidSignalMsg,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrMetadataTooLong,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrMinDepositTooSmall,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrProposalNotFound,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrInvalidProposer,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrNoDeposits,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrVotingPeriodEnded,_.TransactionChainErrorModule.Gov,_.ChainGovErrorCodes.ErrInvalidProposal,_.TransactionChainErrorModule.Gov,_.ChainBankErrorCodes.ErrNoInputs,_.TransactionChainErrorModule.Bank,_.ChainBankErrorCodes.ErrNoOutputs,_.TransactionChainErrorModule.Bank,_.ChainBankErrorCodes.ErrInputOutputMismatch,_.TransactionChainErrorModule.Bank,_.ChainBankErrorCodes.ErrSendDisabled,_.TransactionChainErrorModule.Bank,_.ChainBankErrorCodes.ErrDenomMetadataNotFound,_.TransactionChainErrorModule.Bank,_.ChainBankErrorCodes.ErrInvalidKey,_.TransactionChainErrorModule.Bank,_.ChainBankErrorCodes.ErrDuplicateEntry,_.TransactionChainErrorModule.Bank,_.ChainBankErrorCodes.ErrMultipleSenders,_.TransactionChainErrorModule.Bank,_.ChainWasmErrorCodes.ErrCreateFailed,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrAccountExists,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrInstantiateFailed,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrExecuteFailed,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrGasLimit,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrInvalidGenesis,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrQueryFailed,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrInvalidMsg,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrMigrationFailed,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrEmpty,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrLimit,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrInvalid,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrDuplicate,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrMaxIBCChannels,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrUnsupportedForContract,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrPinContractFailed,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrUnpinContractFailed,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrUnknownMsg,_.TransactionChainErrorModule.Wasm,_.ChainWasmErrorCodes.ErrInvalidEvent,_.TransactionChainErrorModule.Wasm,_.ChainAuthZErrorCodes.ErrNoAuthorizationFound,_.TransactionChainErrorModule.Wasm,_.ChainAuthZErrorCodes.ErrAuthorizationExpired,_.TransactionChainErrorModule.Wasm,_.ChainCosmosErrorCode.ErrNotFound,_.TransactionChainErrorModule.CosmosSdk,_.ChainCosmosErrorCode.ErrKeyNotFound,_.TransactionChainErrorModule.CosmosSdk;const np=e=>e.split("/").map(n=>n.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")).join("/");var DE={exports:{}};/*! store2 - v2.14.3 - 2024-02-14
22
- * Copyright (c) 2024 Nathan Bubna; Licensed MIT */(function(e){(function(n,t){var i={version:"2.14.3",areas:{},apis:{},nsdelim:".",inherit:function(g,C){for(var w in g)C.hasOwnProperty(w)||Object.defineProperty(C,w,Object.getOwnPropertyDescriptor(g,w));return C},stringify:function(g,C){return g===void 0||typeof g=="function"?g+"":JSON.stringify(g,C||i.replace)},parse:function(g,C){try{return JSON.parse(g,C||i.revive)}catch{return g}},fn:function(g,C){i.storeAPI[g]=C;for(var w in i.apis)i.apis[w][g]=C},get:function(g,C){return g.getItem(C)},set:function(g,C,w){g.setItem(C,w)},remove:function(g,C){g.removeItem(C)},key:function(g,C){return g.key(C)},length:function(g){return g.length},clear:function(g){g.clear()},Store:function(g,C,w){var E=i.inherit(i.storeAPI,function(J,b,p){return arguments.length===0?E.getAll():typeof b=="function"?E.transact(J,b,p):b!==void 0?E.set(J,b,p):typeof J=="string"||typeof J=="number"?E.get(J):typeof J=="function"?E.each(J):J?E.setAll(J,b):E.clear()});E._id=g;try{var D="__store2_test";C.setItem(D,"ok"),E._area=C,C.removeItem(D)}catch{E._area=i.storage("fake")}return E._ns=w||"",i.areas[g]||(i.areas[g]=E._area),i.apis[E._ns+E._id]||(i.apis[E._ns+E._id]=E),E},storeAPI:{area:function(g,C){var w=this[g];return(!w||!w.area)&&(w=i.Store(g,C,this._ns),this[g]||(this[g]=w)),w},namespace:function(g,C,w){if(w=w||this._delim||i.nsdelim,!g)return this._ns?this._ns.substring(0,this._ns.length-w.length):"";var E=g,D=this[E];if((!D||!D.namespace)&&(D=i.Store(this._id,this._area,this._ns+E+w),D._delim=w,this[E]||(this[E]=D),!C))for(var J in i.areas)D.area(J,i.areas[J]);return D},isFake:function(g){return g?(this._real=this._area,this._area=i.storage("fake")):g===!1&&(this._area=this._real||this._area),this._area.name==="fake"},toString:function(){return"store"+(this._ns?"."+this.namespace():"")+"["+this._id+"]"},has:function(g){return this._area.has?this._area.has(this._in(g)):this._in(g)in this._area},size:function(){return this.keys().length},each:function(g,C){for(var w=0,E=i.length(this._area);w<E;w++){var D=this._out(i.key(this._area,w));if(D!==void 0&&g.call(this,D,this.get(D),C)===!1)break;E>i.length(this._area)&&(E--,w--)}return C||this},keys:function(g){return this.each(function(C,w,E){E.push(C)},g||[])},get:function(g,C){var w=i.get(this._area,this._in(g)),E;return typeof C=="function"&&(E=C,C=null),w!==null?i.parse(w,E):C??w},getAll:function(g){return this.each(function(C,w,E){E[C]=w},g||{})},transact:function(g,C,w){var E=this.get(g,w),D=C(E);return this.set(g,D===void 0?E:D),this},set:function(g,C,w){var E=this.get(g),D;return E!=null&&w===!1?C:(typeof w=="function"&&(D=w,w=void 0),i.set(this._area,this._in(g),i.stringify(C,D),w)||E)},setAll:function(g,C){var w,E;for(var D in g)E=g[D],this.set(D,E,C)!==E&&(w=!0);return w},add:function(g,C,w){var E=this.get(g);if(E instanceof Array)C=E.concat(C);else if(E!==null){var D=typeof E;if(D===typeof C&&D==="object"){for(var J in C)E[J]=C[J];C=E}else C=E+C}return i.set(this._area,this._in(g),i.stringify(C,w)),C},remove:function(g,C){var w=this.get(g,C);return i.remove(this._area,this._in(g)),w},clear:function(){return this._ns?this.each(function(g){i.remove(this._area,this._in(g))},1):i.clear(this._area),this},clearAll:function(){var g=this._area;for(var C in i.areas)i.areas.hasOwnProperty(C)&&(this._area=i.areas[C],this.clear());return this._area=g,this},_in:function(g){return typeof g!="string"&&(g=i.stringify(g)),this._ns?this._ns+g:g},_out:function(g){return this._ns?g&&g.indexOf(this._ns)===0?g.substring(this._ns.length):void 0:g}},storage:function(g){return i.inherit(i.storageAPI,{items:{},name:g})},storageAPI:{length:0,has:function(g){return this.items.hasOwnProperty(g)},key:function(g){var C=0;for(var w in this.items)if(this.has(w)&&g===C++)return w},setItem:function(g,C){this.has(g)||this.length++,this.items[g]=C},removeItem:function(g){this.has(g)&&(delete this.items[g],this.length--)},getItem:function(g){return this.has(g)?this.items[g]:null},clear:function(){for(var g in this.items)this.removeItem(g)}}},o=i.Store("local",function(){try{return localStorage}catch{}}());o.local=o,o._=i,o.area("session",function(){try{return sessionStorage}catch{}}()),o.area("page",i.storage("page")),typeof t=="function"&&t.amd!==void 0?t("store2",[],function(){return o}):e.exports?e.exports=o:(n.store&&(i.conflict=n.store),n.store=o)})(L.commonjsGlobal,L.commonjsGlobal&&L.commonjsGlobal.define)})(DE);class JE{constructor(n,t={headers:{"Content-Type":"application/json"}}){Se(this,"client");Se(this,"config",{});this.client=L.axios.create({baseURL:n,timeout:15e3,...t}),this.config={}}setConfig(n){return this.config=n,this}get(n,t={}){return this.client.get(n,{params:t,...this.config})}post(n,t={}){return this.client.post(n,t,this.config)}put(n,t={}){return this.client.put(n,t,this.config)}delete(n,t={}){return this.client.delete(n,{params:t,...this.config})}}var ar;(function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.EARLY_HINTS=103]="EARLY_HINTS",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",e[e.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.IM_A_TEAPOT=418]="IM_A_TEAPOT",e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",e[e.METHOD_FAILURE=420]="METHOD_FAILURE",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(ar||(ar={}));const tp=(e,n)=>e.response?e.response.data?e.response.data.message||e.response.data:e.response.statusText:`The request to ${n} has failed.`;class HE{constructor(n,t={}){Se(this,"client");Se(this,"endpoint");this.client=new JE(n,t),this.endpoint=n}setConfig(n){return this.client.setConfig(n),this}async get(n,t={}){try{return await this.client.get(n,t)}catch(i){const o=i;if(L.axios.isAxiosError(o)){if(o.code==="ECONNABORTED")throw new Qn(new Error(o.message),{code:ar.REQUEST_TOO_LONG,context:n,method:_.HttpRequestMethod.Get});const g=tp(o,n);throw new Qn(new Error(g),{context:n,code:o.response?o.response.status:ar.BAD_REQUEST,method:_.HttpRequestMethod.Get})}throw new Qn(new Error(o.message),{code:_.UnspecifiedErrorCode,context:n,contextModule:_.HttpRequestMethod.Get})}}async post(n,t={}){try{return await this.client.post(n,t)}catch(i){const o=i;if(L.axios.isAxiosError(o)){if(o.code==="ECONNABORTED")throw new Qn(new Error(o.message),{code:ar.REQUEST_TOO_LONG,method:_.HttpRequestMethod.Post});const g=tp(o,n);throw new Qn(new Error(g),{code:o.response?o.response.status:ar.BAD_REQUEST,context:n,contextModule:_.HttpRequestMethod.Post})}throw new Qn(new Error(o.message),{code:_.UnspecifiedErrorCode,context:n,contextModule:_.HttpRequestMethod.Post})}}}var rp;(function(e){e.Idle="idle",e.Loading="loading",e.Completed="completed",e.Error="error",e.Confirmed="confirmed"})(rp||(rp={}));const qE=e=>{if(!e)return _.DEFAULT_STD_FEE;const{gas:n=_.DEFAULT_GAS_LIMIT.toString(),gasPrice:t=_.DEFAULT_GAS_PRICE,payer:i,granter:o,feePayer:g}=e,C=new L.BigNumber(n).toFixed(0),w=new L.BigNumber(t).toFixed(0);return{amount:[{denom:"inj",amount:new L.BigNumber(C).times(w).toFixed()}],gas:new L.BigNumber(C).toFixed(),payer:i,granter:o,feePayer:g}},VE=e=>{const n=e.match(/^([0-9.]+)([a-zA-Z][a-zA-Z0-9/:._-]*)$/);if(!n)throw new Error("Invalid gas price string");const[t,i]=n,o=new _.BigNumberInBase(i).toWei().dividedBy(_.DEFAULT_GAS_PRICE).toFixed(0);return qE({gas:o,gasPrice:_.DEFAULT_GAS_PRICE})},ip=_.BigNumber.clone({ROUNDING_MODE:_.BigNumber.ROUND_DOWN}),WE=e=>typeof e=="number"?!0:!isNaN(parseFloat(e)),QE=e=>new ip(e).multipliedBy(new ip(10).pow(18)),op=e=>new _.BigNumber(e).toFixed(18),FE="wasm/MsgExecuteContract",xu=({object:e,messageType:n,primaryType:t="MsgValue"})=>{const i=["order_mask","order_type","oracle_type","round","oracle_scale_factor","expiry","option","proposal_id","creation_height"],o=["timeout_timestamp","revision_height","revision_number"],g=["cid"],C=new Map,w=new Array;for(const E in _.snakecaseKeys(e)){const D=_.snakecaseKeys(e)[E];if(E==="@type")continue;const J=typeof D;if(J==="boolean")w.push({name:E,type:"bool"});else if(J==="number"||J==="bigint"||i.includes(E))w.push({name:E,type:GE(E)});else if(J==="string"){if(g.includes(E)&&!D)continue;if(o.includes(E)){w.push({name:E,type:LE(E)});continue}w.push({name:E,type:"string"})}else if(J==="object"){if(Array.isArray(D)&&D.length===0)throw new _.GeneralException(new Error("Array with length 0 found"));if(Array.isArray(D)&&D.length>0){const b=typeof D[0];if(b==="boolean"||b==="number"||b==="string"){for(const S in D)if(typeof S!==b)throw new _.GeneralException(new Error("Array with different types found"));b==="boolean"?w.push({name:E,type:"bool[]"}):b==="number"?w.push({name:E,type:"number[]"}):b==="string"&&w.push({name:E,type:"string[]"})}else if(b==="object"){const S=ap({property:np(E),parentProperty:t,messageType:n}),R=xu({object:D[0],primaryType:S,messageType:n}),u=R.get(S);w.push({name:E,type:`${S}[]`}),C.set(S,u);for(const c of R.keys())c!==t&&C.set(c,R.get(c))}else throw new _.GeneralException(new Error("Array with elements of unknown type found"))}else if(D instanceof Date)w.push({name:E,type:"string"});else{const b=ap({property:np(E),parentProperty:t,messageType:n}),p=xu({object:D,primaryType:b,messageType:n}),S=p.get(b);w.push({name:E,type:b}),C.set(b,S);for(const R of p.keys())R!==t&&C.set(R,p.get(R))}}else throw new _.GeneralException(new Error(`Type ${E} not found`))}return C.set(t,w),C},GE=e=>{switch(e){case"order_mask":return"int32";case"timeout_timestamp":return"timeout_timestamp";case"revision_number":return"uint64";case"revision_height":return"uint64";case"order_type":return"int32";case"oracle_type":return"int32";case"exponent":return"uint32";case"round":return"uint64";case"oracle_scale_factor":return"uint64";case"expiry":return"int64";case"creation_height":return"int64";case"option":return"int32";case"proposal_id":return"uint64";default:return"uint64"}},LE=e=>{switch(e){case"timeout_timestamp":return"uint64";case"revision_number":return"uint64";case"revision_height":return"uint64";default:return"uint64"}},zu=(e,n)=>{const t=["proposal_id","round","oracle_scale_factor","timeout_timestamp","revision_height","revision_number","expiry"],i=["min_price_tick_size","price","quantity","margin","trigger_price","min_quantity_tick_size"],o={"exchange/MsgIncreasePositionMargin":["amount"]},g={"wasmx/MsgExecuteContractCompat":["funds"]},C=["uri","uri_hash"];return Object.keys(e).reduce((w,E)=>{const D=e[E];if(!D){if(n){const J=Object.keys(g).find(b=>b===n);if(J&&g[J].includes(E))return{...w,[E]:D}}return C.includes(E)?{...w,[E]:D}:w}if(typeof D=="object")return D instanceof Date?{...w,[E]:D.toJSON().split(".")[0]+"Z"}:Array.isArray(D)?{...w,[E]:D.every(J=>typeof J=="string")?D:D.map(J=>zu(J))}:{...w,[E]:zu(D)};if(WE(D)&&t.includes(E))return{...w,[E]:D.toString()};if(typeof D=="string"){if(i.includes(E))return{...w,[E]:op(D)};if(n){const J=Object.keys(o).find(b=>b===n);if(J&&o[J].includes(E))return{...w,[E]:op(D)}}}return{...w,[E]:D}},{})},ap=({property:e,parentProperty:n,messageType:t})=>t===FE?$E(e,n):KE(e,n),$E=(e,n="")=>{const t="CosmwasmInnerMsgMarker",i=e.replace("Type","");return i==="Msg"?t:`${n.replace(t,"")+i}Value`},KE=(e,n="")=>{const t=e.replace("Type","");return`Type${(n==="MsgValue"?"":n.replace("Type",""))+t}`};function Ua(e){if(Array.isArray(e))return e.map(Ua);if(typeof e!="object"||e===null)return e;const n={};return Object.keys(e).sort().forEach(t=>{e[t]===void 0||e[t]===null||(n[t]=Ua(e[t]))}),n}class fl{constructor(n){Se(this,"params");this.params=n}toJSON(){return JSON.stringify(Ua(this.toData()))}toEip712Types(){const n=this.toAmino();return xu({object:n.value,messageType:n.type})}toEip712(){const n=this.toAmino(),{type:t,value:i}=n;return{type:t,value:zu(i,t)}}toDirectSignJSON(){return JSON.stringify(Ua(this.toDirectSign()))}}function xE(e){return typeof e=="string"?e:new TextDecoder("utf-8",{fatal:!0}).decode(e)}const zE=e=>_.SHA256Exports.SHA256.hash(_.Base64Exports.Base64.parse(e)).toString().toUpperCase();function YE(e){return L.dist.Buffer.from(e).toString("hex")}function ZE(e){return new Uint8Array(L.dist.Buffer.from(e,"hex"))}function XE(e){L.dist.Buffer.from(e,"hex").length===64&&(e="04"+e);let t=YE(_.elliptic.publicKeyConvert(ZE(e),!1));return t=t.substring(2),t}var go={};Object.defineProperty(go,"__esModule",{value:!0});go.bech32m=qe=go.bech32=void 0;const Da="qpzry9x8gf2tvdw0s3jn54khce6mua7l",$h={};for(let e=0;e<Da.length;e++){const n=Da.charAt(e);$h[n]=e}function Xr(e){const n=e>>25;return(e&33554431)<<5^-(n>>0&1)&996825010^-(n>>1&1)&642813549^-(n>>2&1)&513874426^-(n>>3&1)&1027748829^-(n>>4&1)&705979059}function sp(e){let n=1;for(let t=0;t<e.length;++t){const i=e.charCodeAt(t);if(i<33||i>126)return"Invalid prefix ("+e+")";n=Xr(n)^i>>5}n=Xr(n);for(let t=0;t<e.length;++t){const i=e.charCodeAt(t);n=Xr(n)^i&31}return n}function pl(e,n,t,i){let o=0,g=0;const C=(1<<t)-1,w=[];for(let E=0;E<e.length;++E)for(o=o<<n|e[E],g+=n;g>=t;)g-=t,w.push(o>>g&C);if(i)g>0&&w.push(o<<t-g&C);else{if(g>=n)return"Excess padding";if(o<<t-g&C)return"Non-zero padding"}return w}function jE(e){return pl(e,8,5,!0)}function eI(e){const n=pl(e,5,8,!1);if(Array.isArray(n))return n}function nI(e){const n=pl(e,5,8,!1);if(Array.isArray(n))return n;throw new Error(n)}function Kh(e){let n;e==="bech32"?n=1:n=734539939;function t(C,w,E){if(E=E||90,C.length+7+w.length>E)throw new TypeError("Exceeds length limit");C=C.toLowerCase();let D=sp(C);if(typeof D=="string")throw new Error(D);let J=C+"1";for(let b=0;b<w.length;++b){const p=w[b];if(p>>5)throw new Error("Non 5-bit word");D=Xr(D)^p,J+=Da.charAt(p)}for(let b=0;b<6;++b)D=Xr(D);D^=n;for(let b=0;b<6;++b){const p=D>>(5-b)*5&31;J+=Da.charAt(p)}return J}function i(C,w){if(w=w||90,C.length<8)return C+" too short";if(C.length>w)return"Exceeds length limit";const E=C.toLowerCase(),D=C.toUpperCase();if(C!==E&&C!==D)return"Mixed-case string "+C;C=E;const J=C.lastIndexOf("1");if(J===-1)return"No separator character for "+C;if(J===0)return"Missing prefix for "+C;const b=C.slice(0,J),p=C.slice(J+1);if(p.length<6)return"Data too short";let S=sp(b);if(typeof S=="string")return S;const R=[];for(let u=0;u<p.length;++u){const c=p.charAt(u),y=$h[c];if(y===void 0)return"Unknown character "+c;S=Xr(S)^y,!(u+6>=p.length)&&R.push(y)}return S!==n?"Invalid checksum for "+C:{prefix:b,words:R}}function o(C,w){const E=i(C,w);if(typeof E=="object")return E}function g(C,w){const E=i(C,w);if(typeof E=="object")return E;throw new Error(E)}return{decodeUnsafe:o,decode:g,encode:t,toWords:jE,fromWordsUnsafe:eI,fromWords:nI}}var qe=go.bech32=Kh("bech32");go.bech32m=Kh("bech32m");const tI=e=>{const n=_.dist_browser.Address.fromString(e.toString()).toBuffer();return qe.encode("inj",qe.toWords(n))},rI=e=>e.startsWith("0x")?e:`0x${L.dist.Buffer.from(qe.fromWords(qe.decode(e).words)).toString("hex")}`,iI="injpub",ua="inj",oI="injvaloper",aI="injvalcons",dp=(e,n)=>{const t=L.dist.Buffer.from("04","hex"),i=_.dist.TypedDataUtils.eip712Hash(e,_.dist.SignTypedDataVersion.V4),o=_.dist_browser.fromRpcSig(n),g=_.dist_browser.ecrecover(i,o.v,o.r,o.s),C=L.dist.Buffer.concat([t,g]);return`0x${L.dist.Buffer.from(_.elliptic.publicKeyConvert(C)).toString("hex")}`};class ml extends fl{static fromJSON(n){return new ml(n)}toProto(){const{params:n}=this,t=oo.create();return t.Signer=L.dist.Buffer.from(rI(n.sender),"hex"),t.Data=L.dist.Buffer.from(xE(n.data),"utf-8"),oo.fromPartial(t)}toData(){return{"@type":"/injective.exchange.v1beta1.MsgSignData",...this.toProto()}}toAmino(){const n=this.toProto();return{type:"sign/MsgSignData",value:{..._.snakecaseKeys(n)}}}toWeb3(){const n=this.toAmino(),{value:t}=n;return{"@type":"/injective.exchange.v1beta1.MsgSignData",...t}}toDirectSign(){return{type:"/injective.exchange.v1beta1.MsgSignData",message:this.toProto()}}toBinary(){return oo.encode(this.toProto()).finish()}}const up=e=>{const n=ho.create();return n.sender=e.injectiveAddress,n.amount=e.amount,n.marketId=e.marketId,n.sourceSubaccountId=e.srcSubaccountId,n.destinationSubaccountId=e.dstSubaccountId,ho.fromPartial(n)};class hl extends fl{static fromJSON(n){return new hl(n)}toProto(){const{params:n}=this,t={...n,amount:QE(n.amount).toFixed()};return up(t)}toData(){return{"@type":"/injective.exchange.v1beta1.MsgIncreasePositionMargin",...this.toProto()}}toAmino(){const{params:n}=this,t=up(n);return{type:"exchange/MsgIncreasePositionMargin",value:{..._.snakecaseKeys(t)}}}toWeb3(){const n=this.toAmino(),{value:t}=n;return{"@type":"/injective.exchange.v1beta1.MsgIncreasePositionMargin",...t}}toDirectSign(){return{type:"/injective.exchange.v1beta1.MsgIncreasePositionMargin",message:this.toProto()}}toBinary(){return ho.encode(this.toProto()).finish()}}var ir;(function(e){e[e.Mainnet=1]="Mainnet",e[e.Ropsten=3]="Ropsten",e[e.Rinkeby=4]="Rinkeby",e[e.Goerli=5]="Goerli",e[e.Kovan=42]="Kovan",e[e.Sepolia=11155111]="Sepolia",e[e.Injective=888]="Injective",e[e.Ganache=1337]="Ganache",e[e.HardHat=31337]="HardHat"})(ir||(ir={}));var qr;(function(e){e.Mainnet="injective-1",e.Testnet="injective-888",e.Devnet="injective-777"})(qr||(qr={}));var cp;(function(e){e.MsgExec="cosmos.authz.v1beta1.MsgExec",e.MsgGrant="cosmos.authz.v1beta1.MsgGrant",e.MsgRevoke="cosmos.authz.v1beta1.MsgRevoke",e.MsgSend="cosmos.bank.v1beta1.MsgSend",e.MsgWithdrawDelegatorReward="cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",e.MsgGrantAllowance="cosmos.feegrant.v1beta1.MsgGrantAllowance",e.MsgRevokeAllowance="cosmos.feegrant.v1beta1.MsgRevokeAllowance",e.MsgDepositCosmos="cosmos.gov.v1beta1.MsgDeposit",e.MsgSubmitProposal="cosmos.gov.v1beta1.MsgSubmitProposal",e.MsgVote="cosmos.gov.v1beta1.MsgVote",e.MsgUnjail="cosmos.slashing.v1beta1.MsgUnjail",e.MsgBeginRedelegate="cosmos.staking.v1beta1.MsgBeginRedelegate",e.MsgCreateValidator="cosmos.staking.v1beta1.MsgCreateValidator",e.MsgDelegate="cosmos.staking.v1beta1.MsgDelegate",e.MsgEditValidator="cosmos.staking.v1beta1.MsgEditValidator",e.MsgUndelegate="cosmos.staking.v1beta1.MsgUndelegate",e.MsgCancelUnbondingDelegation="cosmos.staking.v1beta1.MsgCancelUnbondingDelegation",e.MsgExecuteContract="cosmwasm.wasm.v1.MsgExecuteContract",e.MsgInstantiateContract="cosmwasm.wasm.v1.MsgInstantiateContract",e.MsgInstantiateContract2="cosmwasm.wasm.v1.MsgInstantiateContract2",e.MsgMigrateContract="cosmwasm.wasm.v1.MsgMigrateContract",e.MsgStoreCode="cosmwasm.wasm.v1.MsgStoreCode",e.MsgUpdateAdmin="cosmwasm.wasm.v1.MsgUpdateAdmin",e.MsgTransfer="ibc.applications.transfer.v1.MsgTransfer",e.MsgAcknowledgement="ibc.core.channel.v1.MsgAcknowledgement",e.MsgChannelOpenAck="ibc.core.channel.v1.MsgChannelOpenAck",e.MsgChannelOpenConfirm="ibc.core.channel.v1.MsgChannelOpenConfirm",e.MsgChannelOpenInit="ibc.core.channel.v1.MsgChannelOpenInit",e.MsgChannelOpenTry="ibc.core.channel.v1.MsgChannelOpenTry",e.MsgRecvPacket="ibc.core.channel.v1.MsgRecvPacket",e.MsgTimeout="ibc.core.channel.v1.MsgTimeout",e.MsgCreateClient="ibc.core.client.v1.MsgCreateClient",e.MsgUpdateClient="ibc.core.client.v1.MsgUpdateClient",e.MsgConnectionOpenAck="ibc.core.connection.v1.MsgConnectionOpenAck",e.MsgConnectionOpenConfirm="ibc.core.connection.v1.MsgConnectionOpenConfirm",e.MsgConnectionOpenInit="ibc.core.connection.v1.MsgConnectionOpenInit",e.MsgConnectionOpenTry="ibc.core.connection.v1.MsgConnectionOpenTry",e.MsgBid="injective.auction.v1beta1.MsgBid",e.MsgAdminUpdateBinaryOptionsMarket="injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket",e.MsgBatchCancelDerivativeOrders="injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders",e.MsgBatchCancelSpotOrders="injective.exchange.v1beta1.MsgBatchCancelSpotOrders",e.MsgBatchCreateDerivativeLimitOrders="injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrders",e.MsgBatchCreateSpotLimitOrders="injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrders",e.MsgBatchUpdateOrders="injective.exchange.v1beta1.MsgBatchUpdateOrders",e.MsgCancelBinaryOptionsOrder="injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder",e.MsgCancelDerivativeOrder="injective.exchange.v1beta1.MsgCancelDerivativeOrder",e.MsgCancelSpotOrder="injective.exchange.v1beta1.MsgCancelSpotOrder",e.MsgCreateBinaryOptionsLimitOrder="injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder",e.MsgCreateBinaryOptionsMarketOrder="injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder",e.MsgCreateDerivativeLimitOrder="injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder",e.MsgCreateDerivativeMarketOrder="injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder",e.MsgLiquidatePosition="injective.exchange.v1beta1.MsgLiquidatePosition",e.MsgCreateSpotLimitOrder="injective.exchange.v1beta1.MsgCreateSpotLimitOrder",e.MsgCreateSpotMarketOrder="injective.exchange.v1beta1.MsgCreateSpotMarketOrder",e.MsgDeposit="injective.exchange.v1beta1.MsgDeposit",e.MsgExternalTransfer="injective.exchange.v1beta1.MsgExternalTransfer",e.MsgIncreasePositionMargin="injective.exchange.v1beta1.MsgIncreasePositionMargin",e.MsgInstantBinaryOptionsMarketLaunch="injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch",e.MsgInstantPerpetualMarketLaunch="injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunch",e.MsgInstantSpotMarketLaunch="injective.exchange.v1beta1.MsgInstantSpotMarketLaunch",e.MsgReclaimLockedFunds="injective.exchange.v1beta1.MsgReclaimLockedFunds",e.MsgRewardsOptOut="injective.exchange.v1beta1.MsgRewardsOptOut",e.MsgSubaccountTransfer="injective.exchange.v1beta1.MsgSubaccountTransfer",e.MsgWithdraw="injective.exchange.v1beta1.MsgWithdraw",e.MsgCreateInsuranceFund="injective.insurance.v1beta1.MsgCreateInsuranceFund",e.MsgRequestRedemption="injective.insurance.v1beta1.MsgRequestRedemption",e.MsgUnderwrite="injective.insurance.v1beta1.MsgUnderwrite",e.MsgConfirmBatch="injective.peggy.v1.MsgConfirmBatch",e.MsgDepositClaim="injective.peggy.v1.MsgDepositClaim",e.MsgERC20DeployedClaim="injective.peggy.v1.MsgERC20DeployedClaim",e.MsgRequestBatch="injective.peggy.v1.MsgRequestBatch",e.MsgSendToEth="injective.peggy.v1.MsgSendToEth",e.MsgSetOrchestratorAddresses="injective.peggy.v1.MsgSetOrchestratorAddresses",e.MsgValsetConfirm="injective.peggy.v1.MsgValsetConfirm",e.MsgValsetUpdatedClaim="injective.peggy.v1.MsgValsetUpdatedClaim",e.MsgWithdrawClaim="injective.peggy.v1.MsgWithdrawClaim",e.MsgBurn="injective.tokenfactory.v1beta1.MsgBurn",e.MsgMint="injective.tokenfactory.v1beta1.MsgMint",e.MsgCreateDenom="injective.tokenfactory.v1beta1.MsgCreateDenom",e.MsgExecuteContractCompat="injective.wasmx.v1.MsgExecuteContractCompat"})(cp||(cp={}));var lp;(function(e){e.Success="success",e.Fail="fail"})(lp||(lp={}));class _i{constructor(n){Se(this,"bech32Address");this.bech32Address=n}compare(n){return this.bech32Address===n.bech32Address}get address(){return this.bech32Address}static fromBech32(n,t=ua){try{const i=L.dist.Buffer.from(qe.fromWords(qe.decode(n).words)).toString("hex"),o=i.startsWith("0x")?i:`0x${i}`,g=_.dist_browser.Address.fromString(o.toString()).toBuffer(),C=qe.encode(t,qe.toWords(g));return new _i(C)}catch(i){throw new _.GeneralException(new Error(i.message),{type:_.ErrorType.ValidationError})}}static fromHex(n,t=ua){const i=n.startsWith("0x")?n:`0x${n}`,o=_.dist_browser.Address.fromString(i.toString()).toBuffer(),g=qe.encode(t,qe.toWords(o));return new _i(g)}toBech32(n=ua){const t=this.toHex(),i=t.startsWith("0x")?t:`0x${t}`,o=_.dist_browser.Address.fromString(i).toBuffer();return qe.encode(n,qe.toWords(o))}toAccountAddress(){return this.toBech32(ua)}toValidatorAddress(){return this.toBech32(oI)}toConsensusAddress(){return this.toBech32(aI)}toHex(){const{bech32Address:n}=this,t=L.dist.Buffer.from(qe.fromWords(qe.decode(n).words)).toString("hex");return t.startsWith("0x")?t:`0x${t}`}getSubaccountId(n=0){const t="0".repeat(23)+n;return`${this.toHex()}${t}`}getEthereumAddress(){return this.toHex()}}var fp;(function(e){e.UnBonded="UnBonded",e.UnBonding="UnBonding",e.Bonded="Bonded"})(fp||(fp={}));const pp={..._.ChainErrorModule};`${new _.BigNumber(888).toString(16)}`;class gl extends fl{static fromJSON(n){return new gl(n)}toProto(){const{params:n}=this,t=De.create();t.denom=n.amount.denom,t.amount=n.amount.amount;const i=ha.create();if(i.receiver=n.receiver,i.sender=n.sender,i.sourceChannel=n.channelId,i.sourcePort=n.port,i.token=t,n.height){const o=tr.create();o.revisionHeight=n.height.revisionHeight.toString(),o.revisionNumber=n.height.revisionNumber.toString(),i.timeoutHeight=o}return n.timeout&&(i.timeoutTimestamp=n.timeout.toString()),i.memo=n.memo||"",ha.fromJSON(i)}toData(){return{"@type":"/ibc.applications.transfer.v1.MsgTransfer",...this.toProto()}}toAmino(){const n=this.toProto(),t={..._.snakecaseKeys(n)};return{type:"cosmos-sdk/MsgTransfer",value:{...t,memo:t.memo||""}}}toWeb3(){const n=this.toAmino(),{value:t}=n;return{"@type":"/ibc.applications.transfer.v1.MsgTransfer",...t}}toDirectSign(){return{type:"/ibc.applications.transfer.v1.MsgTransfer",message:this.toProto()}}toBinary(){return ha.encode(this.toProto()).finish()}}class yl{static encode(n){return L.dist.Buffer.from(Ma.encode(n).finish()).toString("base64")}static decode(n){return Ma.decode(L.dist.Buffer.from(n,"base64"))}static hash(n){return zE(yl.encode(n))}}const sI=e=>{const n=Ce.create();return n.typeUrl=`${e.type.startsWith("/")?"":"/"}${e.type}`,n.value=e.value,n},dI=(e,n)=>{const t=Ce.create();return t.typeUrl=n,t.value=e,t},uI=Ee.SIGN_MODE_DIRECT;Ee.SIGN_MODE_LEGACY_AMINO_JSON;Ee.SIGN_MODE_LEGACY_AMINO_JSON;Ee.SIGN_MODE_EIP712_V2;const cI=({chainId:e,key:n})=>{if(typeof n!="string")return n;let t,i,o;return e.startsWith("injective")?(t=zt.create(),o=zt,i="/injective.crypto.v1beta1.ethsecp256k1.PubKey"):e.startsWith("evmos")?(t=zt.create(),o=zt,i="/ethermint.crypto.v1.ethsecp256k1.PubKey"):(t=zt.create(),o=zt,i="/cosmos.crypto.secp256k1.PubKey"),t.key=L.dist.Buffer.from(n,"base64"),dI(o.encode(t).finish(),i)},lI=({message:e,memo:n="",timeoutHeight:t})=>{const i=Array.isArray(e)?e:[e],o=xs.create();return o.messages=i.map(g=>sI({value:g.toBinary(),type:g.toDirectSign().type})),o.memo=n,t&&(o.timeoutHeight=t.toString()),o},fI=({fee:e,payer:n,granter:t,gasLimit:i})=>{const o=De.create();o.amount=e.amount,o.denom=e.denom;const g=nr.create();return g.gasLimit=i.toString(),g.amount=[o],n&&(g.payer=n),t&&(g.granter=t),g},pI=({chainId:e,mode:n,signers:t})=>t.map(i=>mI({mode:n,chainId:e,publicKey:i.pubKey,sequence:i.sequence})),mI=({chainId:e,publicKey:n,sequence:t,mode:i})=>{const o=cI({chainId:e,key:n}),g=er.create();g.mode=i;const C=Nn.create();C.single=g;const w=jt.create();return w.publicKey=o,w.sequence=t.toString(),w.modeInfo=C,w},hI=({signerInfo:e,fee:n})=>{const t=zs.create();return t.signerInfos=e,t.fee=n,t},gI=({bodyBytes:e,authInfoBytes:n,chainId:t,accountNumber:i})=>{const o=ll.create();return o.accountNumber=i.toString(),o.chainId=t,o.bodyBytes=e,o.authInfoBytes=n,o},yI=e=>{const n=zs.decode(e.authInfoBytes);return{body:xs.decode(e.bodyBytes),authInfo:n,signatures:e.signatures}};class SI extends HE{retry(n,t=3,i=1e3){const o=async(g=1)=>{try{return await n()}catch(C){if(C instanceof Qn&&C.code===ar.REQUEST_TOO_LONG||g>=t)throw C;return new Promise(w=>setTimeout(()=>w(o(g+1)),i*g))}};return o()}}class kI extends SI{async fetchAccount(n,t={}){const i=`cosmos/auth/v1beta1/accounts/${n}`;try{return(await this.retry(()=>this.get(i,t))).data}catch(o){throw o instanceof Qn?o:new Qn(new Error(o.message),{code:_.UnspecifiedErrorCode,context:`${this.endpoint}/${i}`,contextModule:pp.Auth})}}async fetchCosmosAccount(n,t={}){const i=`cosmos/auth/v1beta1/accounts/${n}`;try{const o=n.startsWith("inj")||n.startsWith("evmos"),g=await this.retry(()=>this.get(i,t));return o?g.data.account.base_account:g.data.account}catch(o){throw o instanceof Qn?o:new Qn(new Error(o.message),{code:_.UnspecifiedErrorCode,context:`${this.endpoint}/${i}`,contextModule:pp.Auth})}}}var PI=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof L.dist.global<"u")return L.dist.global;throw"Unable to locate global object"})();ee.util.Long!==te&&(ee.util.Long=te,ee.configure());class qI extends PI.Error{constructor(n,t,i){super(n),this.code=t,this.metadata=i}}var mp;(function(e){e.Active="active",e.Live="live"})(mp||(mp={}));var hp;(function(e){e.Internal="internal",e.External="external",e.Withdraw="withdraw",e.Deposit="deposit"})(hp||(hp={}));var gp;(function(e){e.Spot="spot",e.Derivative="derivative"})(gp||(gp={}));var yp;(function(e){e.Geometric="geometric",e.Arithmetic="arithmetic",e.Perpetual="perpetual"})(yp||(yp={}));var Sp;(function(e){e[e.AccessTypeUnspecified=0]="AccessTypeUnspecified",e[e.AccessTypeNobody=1]="AccessTypeNobody",e[e.AccessTypeOnlyAddress=2]="AccessTypeOnlyAddress",e[e.AccessTypeEverybody=3]="AccessTypeEverybody",e[e.AccessTypeAnyOfAddresses=4]="AccessTypeAnyOfAddresses"})(Sp||(Sp={}));var kp;(function(e){e.AccessTypeUnspecified="Unspecified",e.AccessTypeNobody="Nobody",e.AccessTypeOnlyAddress="Only Address",e.AccessTypeEverybody="Everybody",e.AccessTypeAnyOfAddresses="Any of Addresses"})(kp||(kp={}));var Pp;(function(e){e.Proposed="proposed",e.Signed="signed",e.Missed="missed"})(Pp||(Pp={}));var vp;(function(e){e.Pending="pending",e.Disbursed="disbursed"})(vp||(vp={}));({..._.IndexerErrorModule});var Cp;(function(e){e.Ibc="ibc",e.Cw20="cw20",e.Spl="spl",e.Erc20="erc20",e.Evm="evm",e.Native="native",e.Symbol="symbol",e.TokenFactory="tokenFactory",e.InsuranceFund="insuranceFund",e.Unknown="unknown"})(Cp||(Cp={}));var Rp;(function(e){e.Verified="verified",e.Submitted="submitted",e.Internal="internal",e.External="external",e.Unverified="unverified"})(Rp||(Rp={}));var Bp;(function(e){e.Aptos="aptos",e.Solana="solana",e.Cosmos="cosmos",e.Ethereum="ethereum",e.EthereumWh="ethereum-wormhole",e.Polygon="polygon",e.Klaytn="klaytn",e.Arbitrum="arbitrum",e.Sui="sui",e.Ibc="ibc",e.BinanceSmartChain="binance-smart-chain",e.Axelar="axelar"})(Bp||(Bp={}));var bp;(function(e){e.Market="market",e.LimitFill="limitFill",e.LimitMatchRestingOrder="limitMatchRestingOrder",e.LimitMatchNewOrder="limitMatchNewOrder"})(bp||(bp={}));var Ep;(function(e){e.Maker="maker",e.Taker="taker"})(Ep||(Ep={}));var Ip;(function(e){e.Buy="buy",e.Sell="sell",e.Long="long",e.Short="short"})(Ip||(Ip={}));var Op;(function(e){e.Insert="insert",e.Delete="delete",e.Replace="replace",e.Update="update",e.Invalidate="invalidate"})(Op||(Op={}));new _.BigNumberInBase(0);_.gql`
22
+ * Copyright (c) 2024 Nathan Bubna; Licensed MIT */(function(e){(function(n,t){var i={version:"2.14.3",areas:{},apis:{},nsdelim:".",inherit:function(g,C){for(var w in g)C.hasOwnProperty(w)||Object.defineProperty(C,w,Object.getOwnPropertyDescriptor(g,w));return C},stringify:function(g,C){return g===void 0||typeof g=="function"?g+"":JSON.stringify(g,C||i.replace)},parse:function(g,C){try{return JSON.parse(g,C||i.revive)}catch{return g}},fn:function(g,C){i.storeAPI[g]=C;for(var w in i.apis)i.apis[w][g]=C},get:function(g,C){return g.getItem(C)},set:function(g,C,w){g.setItem(C,w)},remove:function(g,C){g.removeItem(C)},key:function(g,C){return g.key(C)},length:function(g){return g.length},clear:function(g){g.clear()},Store:function(g,C,w){var E=i.inherit(i.storeAPI,function(J,b,p){return arguments.length===0?E.getAll():typeof b=="function"?E.transact(J,b,p):b!==void 0?E.set(J,b,p):typeof J=="string"||typeof J=="number"?E.get(J):typeof J=="function"?E.each(J):J?E.setAll(J,b):E.clear()});E._id=g;try{var D="__store2_test";C.setItem(D,"ok"),E._area=C,C.removeItem(D)}catch{E._area=i.storage("fake")}return E._ns=w||"",i.areas[g]||(i.areas[g]=E._area),i.apis[E._ns+E._id]||(i.apis[E._ns+E._id]=E),E},storeAPI:{area:function(g,C){var w=this[g];return(!w||!w.area)&&(w=i.Store(g,C,this._ns),this[g]||(this[g]=w)),w},namespace:function(g,C,w){if(w=w||this._delim||i.nsdelim,!g)return this._ns?this._ns.substring(0,this._ns.length-w.length):"";var E=g,D=this[E];if((!D||!D.namespace)&&(D=i.Store(this._id,this._area,this._ns+E+w),D._delim=w,this[E]||(this[E]=D),!C))for(var J in i.areas)D.area(J,i.areas[J]);return D},isFake:function(g){return g?(this._real=this._area,this._area=i.storage("fake")):g===!1&&(this._area=this._real||this._area),this._area.name==="fake"},toString:function(){return"store"+(this._ns?"."+this.namespace():"")+"["+this._id+"]"},has:function(g){return this._area.has?this._area.has(this._in(g)):this._in(g)in this._area},size:function(){return this.keys().length},each:function(g,C){for(var w=0,E=i.length(this._area);w<E;w++){var D=this._out(i.key(this._area,w));if(D!==void 0&&g.call(this,D,this.get(D),C)===!1)break;E>i.length(this._area)&&(E--,w--)}return C||this},keys:function(g){return this.each(function(C,w,E){E.push(C)},g||[])},get:function(g,C){var w=i.get(this._area,this._in(g)),E;return typeof C=="function"&&(E=C,C=null),w!==null?i.parse(w,E):C??w},getAll:function(g){return this.each(function(C,w,E){E[C]=w},g||{})},transact:function(g,C,w){var E=this.get(g,w),D=C(E);return this.set(g,D===void 0?E:D),this},set:function(g,C,w){var E=this.get(g),D;return E!=null&&w===!1?C:(typeof w=="function"&&(D=w,w=void 0),i.set(this._area,this._in(g),i.stringify(C,D),w)||E)},setAll:function(g,C){var w,E;for(var D in g)E=g[D],this.set(D,E,C)!==E&&(w=!0);return w},add:function(g,C,w){var E=this.get(g);if(E instanceof Array)C=E.concat(C);else if(E!==null){var D=typeof E;if(D===typeof C&&D==="object"){for(var J in C)E[J]=C[J];C=E}else C=E+C}return i.set(this._area,this._in(g),i.stringify(C,w)),C},remove:function(g,C){var w=this.get(g,C);return i.remove(this._area,this._in(g)),w},clear:function(){return this._ns?this.each(function(g){i.remove(this._area,this._in(g))},1):i.clear(this._area),this},clearAll:function(){var g=this._area;for(var C in i.areas)i.areas.hasOwnProperty(C)&&(this._area=i.areas[C],this.clear());return this._area=g,this},_in:function(g){return typeof g!="string"&&(g=i.stringify(g)),this._ns?this._ns+g:g},_out:function(g){return this._ns?g&&g.indexOf(this._ns)===0?g.substring(this._ns.length):void 0:g}},storage:function(g){return i.inherit(i.storageAPI,{items:{},name:g})},storageAPI:{length:0,has:function(g){return this.items.hasOwnProperty(g)},key:function(g){var C=0;for(var w in this.items)if(this.has(w)&&g===C++)return w},setItem:function(g,C){this.has(g)||this.length++,this.items[g]=C},removeItem:function(g){this.has(g)&&(delete this.items[g],this.length--)},getItem:function(g){return this.has(g)?this.items[g]:null},clear:function(){for(var g in this.items)this.removeItem(g)}}},o=i.Store("local",function(){try{return localStorage}catch{}}());o.local=o,o._=i,o.area("session",function(){try{return sessionStorage}catch{}}()),o.area("page",i.storage("page")),typeof t=="function"&&t.amd!==void 0?t("store2",[],function(){return o}):e.exports?e.exports=o:(n.store&&(i.conflict=n.store),n.store=o)})(L.commonjsGlobal,L.commonjsGlobal&&L.commonjsGlobal.define)})(DE);class JE{constructor(n,t={headers:{"Content-Type":"application/json"}}){Se(this,"client");Se(this,"config",{});this.client=L.axios.create({baseURL:n,timeout:15e3,...t}),this.config={}}setConfig(n){return this.config=n,this}get(n,t={}){return this.client.get(n,{params:t,...this.config})}post(n,t={}){return this.client.post(n,t,this.config)}put(n,t={}){return this.client.put(n,t,this.config)}delete(n,t={}){return this.client.delete(n,{params:t,...this.config})}}var ar;(function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.EARLY_HINTS=103]="EARLY_HINTS",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",e[e.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.IM_A_TEAPOT=418]="IM_A_TEAPOT",e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",e[e.METHOD_FAILURE=420]="METHOD_FAILURE",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(ar||(ar={}));const tp=(e,n)=>e.response?e.response.data?e.response.data.message||e.response.data:e.response.statusText:`The request to ${n} has failed.`;class HE{constructor(n,t={}){Se(this,"client");Se(this,"endpoint");this.client=new JE(n,t),this.endpoint=n}setConfig(n){return this.client.setConfig(n),this}async get(n,t={}){try{return await this.client.get(n,t)}catch(i){const o=i;if(L.axios.isAxiosError(o)){if(o.code==="ECONNABORTED")throw new Qn(new Error(o.message),{code:ar.REQUEST_TOO_LONG,context:n,method:_.HttpRequestMethod.Get});const g=tp(o,n);throw new Qn(new Error(g),{context:n,code:o.response?o.response.status:ar.BAD_REQUEST,method:_.HttpRequestMethod.Get})}throw new Qn(new Error(o.message),{code:_.UnspecifiedErrorCode,context:n,contextModule:_.HttpRequestMethod.Get})}}async post(n,t={}){try{return await this.client.post(n,t)}catch(i){const o=i;if(L.axios.isAxiosError(o)){if(o.code==="ECONNABORTED")throw new Qn(new Error(o.message),{code:ar.REQUEST_TOO_LONG,method:_.HttpRequestMethod.Post});const g=tp(o,n);throw new Qn(new Error(g),{code:o.response?o.response.status:ar.BAD_REQUEST,context:n,contextModule:_.HttpRequestMethod.Post})}throw new Qn(new Error(o.message),{code:_.UnspecifiedErrorCode,context:n,contextModule:_.HttpRequestMethod.Post})}}}var rp;(function(e){e.Idle="idle",e.Loading="loading",e.Completed="completed",e.Error="error",e.Confirmed="confirmed"})(rp||(rp={}));const qE=e=>{if(!e)return _.DEFAULT_STD_FEE;const{gas:n=_.DEFAULT_GAS_LIMIT.toString(),gasPrice:t=_.DEFAULT_GAS_PRICE,payer:i,granter:o,feePayer:g}=e,C=new L.BigNumber(n).toFixed(0),w=new L.BigNumber(t).toFixed(0);return{amount:[{denom:"inj",amount:new L.BigNumber(C).times(w).toFixed()}],gas:new L.BigNumber(C).toFixed(),payer:i,granter:o,feePayer:g}},VE=e=>{const n=e.match(/^([0-9.]+)([a-zA-Z][a-zA-Z0-9/:._-]*)$/);if(!n)throw new Error("Invalid gas price string");const[t,i]=n,o=new _.BigNumberInBase(i).toWei().dividedBy(_.DEFAULT_GAS_PRICE).toFixed(0);return qE({gas:o,gasPrice:_.DEFAULT_GAS_PRICE})},ip=L.BigNumber.clone({ROUNDING_MODE:L.BigNumber.ROUND_DOWN}),WE=e=>typeof e=="number"?!0:!isNaN(parseFloat(e)),QE=e=>new ip(e).multipliedBy(new ip(10).pow(18)),op=e=>new L.BigNumber(e).toFixed(18),FE="wasm/MsgExecuteContract",xu=({object:e,messageType:n,primaryType:t="MsgValue"})=>{const i=["order_mask","order_type","oracle_type","round","oracle_scale_factor","expiry","option","proposal_id","creation_height"],o=["timeout_timestamp","revision_height","revision_number"],g=["cid"],C=new Map,w=new Array;for(const E in _.snakecaseKeys(e)){const D=_.snakecaseKeys(e)[E];if(E==="@type")continue;const J=typeof D;if(J==="boolean")w.push({name:E,type:"bool"});else if(J==="number"||J==="bigint"||i.includes(E))w.push({name:E,type:GE(E)});else if(J==="string"){if(g.includes(E)&&!D)continue;if(o.includes(E)){w.push({name:E,type:LE(E)});continue}w.push({name:E,type:"string"})}else if(J==="object"){if(Array.isArray(D)&&D.length===0)throw new _.GeneralException(new Error("Array with length 0 found"));if(Array.isArray(D)&&D.length>0){const b=typeof D[0];if(b==="boolean"||b==="number"||b==="string"){for(const S in D)if(typeof S!==b)throw new _.GeneralException(new Error("Array with different types found"));b==="boolean"?w.push({name:E,type:"bool[]"}):b==="number"?w.push({name:E,type:"number[]"}):b==="string"&&w.push({name:E,type:"string[]"})}else if(b==="object"){const S=ap({property:np(E),parentProperty:t,messageType:n}),R=xu({object:D[0],primaryType:S,messageType:n}),u=R.get(S);w.push({name:E,type:`${S}[]`}),C.set(S,u);for(const c of R.keys())c!==t&&C.set(c,R.get(c))}else throw new _.GeneralException(new Error("Array with elements of unknown type found"))}else if(D instanceof Date)w.push({name:E,type:"string"});else{const b=ap({property:np(E),parentProperty:t,messageType:n}),p=xu({object:D,primaryType:b,messageType:n}),S=p.get(b);w.push({name:E,type:b}),C.set(b,S);for(const R of p.keys())R!==t&&C.set(R,p.get(R))}}else throw new _.GeneralException(new Error(`Type ${E} not found`))}return C.set(t,w),C},GE=e=>{switch(e){case"order_mask":return"int32";case"timeout_timestamp":return"timeout_timestamp";case"revision_number":return"uint64";case"revision_height":return"uint64";case"order_type":return"int32";case"oracle_type":return"int32";case"exponent":return"uint32";case"round":return"uint64";case"oracle_scale_factor":return"uint64";case"expiry":return"int64";case"creation_height":return"int64";case"option":return"int32";case"proposal_id":return"uint64";default:return"uint64"}},LE=e=>{switch(e){case"timeout_timestamp":return"uint64";case"revision_number":return"uint64";case"revision_height":return"uint64";default:return"uint64"}},zu=(e,n)=>{const t=["proposal_id","round","oracle_scale_factor","timeout_timestamp","revision_height","revision_number","expiry"],i=["min_price_tick_size","price","quantity","margin","trigger_price","min_quantity_tick_size"],o={"exchange/MsgIncreasePositionMargin":["amount"]},g={"wasmx/MsgExecuteContractCompat":["funds"]},C=["uri","uri_hash"];return Object.keys(e).reduce((w,E)=>{const D=e[E];if(!D){if(n){const J=Object.keys(g).find(b=>b===n);if(J&&g[J].includes(E))return{...w,[E]:D}}return C.includes(E)?{...w,[E]:D}:w}if(typeof D=="object")return D instanceof Date?{...w,[E]:D.toJSON().split(".")[0]+"Z"}:Array.isArray(D)?{...w,[E]:D.every(J=>typeof J=="string")?D:D.map(J=>zu(J))}:{...w,[E]:zu(D)};if(WE(D)&&t.includes(E))return{...w,[E]:D.toString()};if(typeof D=="string"){if(i.includes(E))return{...w,[E]:op(D)};if(n){const J=Object.keys(o).find(b=>b===n);if(J&&o[J].includes(E))return{...w,[E]:op(D)}}}return{...w,[E]:D}},{})},ap=({property:e,parentProperty:n,messageType:t})=>t===FE?$E(e,n):KE(e,n),$E=(e,n="")=>{const t="CosmwasmInnerMsgMarker",i=e.replace("Type","");return i==="Msg"?t:`${n.replace(t,"")+i}Value`},KE=(e,n="")=>{const t=e.replace("Type","");return`Type${(n==="MsgValue"?"":n.replace("Type",""))+t}`};function Ua(e){if(Array.isArray(e))return e.map(Ua);if(typeof e!="object"||e===null)return e;const n={};return Object.keys(e).sort().forEach(t=>{e[t]===void 0||e[t]===null||(n[t]=Ua(e[t]))}),n}class fl{constructor(n){Se(this,"params");this.params=n}toJSON(){return JSON.stringify(Ua(this.toData()))}toEip712Types(){const n=this.toAmino();return xu({object:n.value,messageType:n.type})}toEip712(){const n=this.toAmino(),{type:t,value:i}=n;return{type:t,value:zu(i,t)}}toDirectSignJSON(){return JSON.stringify(Ua(this.toDirectSign()))}}function xE(e){return typeof e=="string"?e:new TextDecoder("utf-8",{fatal:!0}).decode(e)}const zE=e=>_.SHA256Exports.SHA256.hash(_.Base64Exports.Base64.parse(e)).toString().toUpperCase();function YE(e){return L.dist.Buffer.from(e).toString("hex")}function ZE(e){return new Uint8Array(L.dist.Buffer.from(e,"hex"))}function XE(e){L.dist.Buffer.from(e,"hex").length===64&&(e="04"+e);let t=YE(_.elliptic.publicKeyConvert(ZE(e),!1));return t=t.substring(2),t}var go={};Object.defineProperty(go,"__esModule",{value:!0});go.bech32m=qe=go.bech32=void 0;const Da="qpzry9x8gf2tvdw0s3jn54khce6mua7l",$h={};for(let e=0;e<Da.length;e++){const n=Da.charAt(e);$h[n]=e}function Xr(e){const n=e>>25;return(e&33554431)<<5^-(n>>0&1)&996825010^-(n>>1&1)&642813549^-(n>>2&1)&513874426^-(n>>3&1)&1027748829^-(n>>4&1)&705979059}function sp(e){let n=1;for(let t=0;t<e.length;++t){const i=e.charCodeAt(t);if(i<33||i>126)return"Invalid prefix ("+e+")";n=Xr(n)^i>>5}n=Xr(n);for(let t=0;t<e.length;++t){const i=e.charCodeAt(t);n=Xr(n)^i&31}return n}function pl(e,n,t,i){let o=0,g=0;const C=(1<<t)-1,w=[];for(let E=0;E<e.length;++E)for(o=o<<n|e[E],g+=n;g>=t;)g-=t,w.push(o>>g&C);if(i)g>0&&w.push(o<<t-g&C);else{if(g>=n)return"Excess padding";if(o<<t-g&C)return"Non-zero padding"}return w}function jE(e){return pl(e,8,5,!0)}function eI(e){const n=pl(e,5,8,!1);if(Array.isArray(n))return n}function nI(e){const n=pl(e,5,8,!1);if(Array.isArray(n))return n;throw new Error(n)}function Kh(e){let n;e==="bech32"?n=1:n=734539939;function t(C,w,E){if(E=E||90,C.length+7+w.length>E)throw new TypeError("Exceeds length limit");C=C.toLowerCase();let D=sp(C);if(typeof D=="string")throw new Error(D);let J=C+"1";for(let b=0;b<w.length;++b){const p=w[b];if(p>>5)throw new Error("Non 5-bit word");D=Xr(D)^p,J+=Da.charAt(p)}for(let b=0;b<6;++b)D=Xr(D);D^=n;for(let b=0;b<6;++b){const p=D>>(5-b)*5&31;J+=Da.charAt(p)}return J}function i(C,w){if(w=w||90,C.length<8)return C+" too short";if(C.length>w)return"Exceeds length limit";const E=C.toLowerCase(),D=C.toUpperCase();if(C!==E&&C!==D)return"Mixed-case string "+C;C=E;const J=C.lastIndexOf("1");if(J===-1)return"No separator character for "+C;if(J===0)return"Missing prefix for "+C;const b=C.slice(0,J),p=C.slice(J+1);if(p.length<6)return"Data too short";let S=sp(b);if(typeof S=="string")return S;const R=[];for(let u=0;u<p.length;++u){const c=p.charAt(u),y=$h[c];if(y===void 0)return"Unknown character "+c;S=Xr(S)^y,!(u+6>=p.length)&&R.push(y)}return S!==n?"Invalid checksum for "+C:{prefix:b,words:R}}function o(C,w){const E=i(C,w);if(typeof E=="object")return E}function g(C,w){const E=i(C,w);if(typeof E=="object")return E;throw new Error(E)}return{decodeUnsafe:o,decode:g,encode:t,toWords:jE,fromWordsUnsafe:eI,fromWords:nI}}var qe=go.bech32=Kh("bech32");go.bech32m=Kh("bech32m");const tI=e=>{const n=_.dist_browser.Address.fromString(e.toString()).toBuffer();return qe.encode("inj",qe.toWords(n))},rI=e=>e.startsWith("0x")?e:`0x${L.dist.Buffer.from(qe.fromWords(qe.decode(e).words)).toString("hex")}`,iI="injpub",ua="inj",oI="injvaloper",aI="injvalcons",dp=(e,n)=>{const t=L.dist.Buffer.from("04","hex"),i=_.dist.TypedDataUtils.eip712Hash(e,_.dist.SignTypedDataVersion.V4),o=_.dist_browser.fromRpcSig(n),g=_.dist_browser.ecrecover(i,o.v,o.r,o.s),C=L.dist.Buffer.concat([t,g]);return`0x${L.dist.Buffer.from(_.elliptic.publicKeyConvert(C)).toString("hex")}`};class ml extends fl{static fromJSON(n){return new ml(n)}toProto(){const{params:n}=this,t=oo.create();return t.Signer=L.dist.Buffer.from(rI(n.sender),"hex"),t.Data=L.dist.Buffer.from(xE(n.data),"utf-8"),oo.fromPartial(t)}toData(){return{"@type":"/injective.exchange.v1beta1.MsgSignData",...this.toProto()}}toAmino(){const n=this.toProto();return{type:"sign/MsgSignData",value:{..._.snakecaseKeys(n)}}}toWeb3(){const n=this.toAmino(),{value:t}=n;return{"@type":"/injective.exchange.v1beta1.MsgSignData",...t}}toDirectSign(){return{type:"/injective.exchange.v1beta1.MsgSignData",message:this.toProto()}}toBinary(){return oo.encode(this.toProto()).finish()}}const up=e=>{const n=ho.create();return n.sender=e.injectiveAddress,n.amount=e.amount,n.marketId=e.marketId,n.sourceSubaccountId=e.srcSubaccountId,n.destinationSubaccountId=e.dstSubaccountId,ho.fromPartial(n)};class hl extends fl{static fromJSON(n){return new hl(n)}toProto(){const{params:n}=this,t={...n,amount:QE(n.amount).toFixed()};return up(t)}toData(){return{"@type":"/injective.exchange.v1beta1.MsgIncreasePositionMargin",...this.toProto()}}toAmino(){const{params:n}=this,t=up(n);return{type:"exchange/MsgIncreasePositionMargin",value:{..._.snakecaseKeys(t)}}}toWeb3(){const n=this.toAmino(),{value:t}=n;return{"@type":"/injective.exchange.v1beta1.MsgIncreasePositionMargin",...t}}toDirectSign(){return{type:"/injective.exchange.v1beta1.MsgIncreasePositionMargin",message:this.toProto()}}toBinary(){return ho.encode(this.toProto()).finish()}}var ir;(function(e){e[e.Mainnet=1]="Mainnet",e[e.Ropsten=3]="Ropsten",e[e.Rinkeby=4]="Rinkeby",e[e.Goerli=5]="Goerli",e[e.Kovan=42]="Kovan",e[e.Sepolia=11155111]="Sepolia",e[e.Injective=888]="Injective",e[e.Ganache=1337]="Ganache",e[e.HardHat=31337]="HardHat"})(ir||(ir={}));var qr;(function(e){e.Mainnet="injective-1",e.Testnet="injective-888",e.Devnet="injective-777"})(qr||(qr={}));var cp;(function(e){e.MsgExec="cosmos.authz.v1beta1.MsgExec",e.MsgGrant="cosmos.authz.v1beta1.MsgGrant",e.MsgRevoke="cosmos.authz.v1beta1.MsgRevoke",e.MsgSend="cosmos.bank.v1beta1.MsgSend",e.MsgWithdrawDelegatorReward="cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",e.MsgGrantAllowance="cosmos.feegrant.v1beta1.MsgGrantAllowance",e.MsgRevokeAllowance="cosmos.feegrant.v1beta1.MsgRevokeAllowance",e.MsgDepositCosmos="cosmos.gov.v1beta1.MsgDeposit",e.MsgSubmitProposal="cosmos.gov.v1beta1.MsgSubmitProposal",e.MsgVote="cosmos.gov.v1beta1.MsgVote",e.MsgUnjail="cosmos.slashing.v1beta1.MsgUnjail",e.MsgBeginRedelegate="cosmos.staking.v1beta1.MsgBeginRedelegate",e.MsgCreateValidator="cosmos.staking.v1beta1.MsgCreateValidator",e.MsgDelegate="cosmos.staking.v1beta1.MsgDelegate",e.MsgEditValidator="cosmos.staking.v1beta1.MsgEditValidator",e.MsgUndelegate="cosmos.staking.v1beta1.MsgUndelegate",e.MsgCancelUnbondingDelegation="cosmos.staking.v1beta1.MsgCancelUnbondingDelegation",e.MsgExecuteContract="cosmwasm.wasm.v1.MsgExecuteContract",e.MsgInstantiateContract="cosmwasm.wasm.v1.MsgInstantiateContract",e.MsgInstantiateContract2="cosmwasm.wasm.v1.MsgInstantiateContract2",e.MsgMigrateContract="cosmwasm.wasm.v1.MsgMigrateContract",e.MsgStoreCode="cosmwasm.wasm.v1.MsgStoreCode",e.MsgUpdateAdmin="cosmwasm.wasm.v1.MsgUpdateAdmin",e.MsgTransfer="ibc.applications.transfer.v1.MsgTransfer",e.MsgAcknowledgement="ibc.core.channel.v1.MsgAcknowledgement",e.MsgChannelOpenAck="ibc.core.channel.v1.MsgChannelOpenAck",e.MsgChannelOpenConfirm="ibc.core.channel.v1.MsgChannelOpenConfirm",e.MsgChannelOpenInit="ibc.core.channel.v1.MsgChannelOpenInit",e.MsgChannelOpenTry="ibc.core.channel.v1.MsgChannelOpenTry",e.MsgRecvPacket="ibc.core.channel.v1.MsgRecvPacket",e.MsgTimeout="ibc.core.channel.v1.MsgTimeout",e.MsgCreateClient="ibc.core.client.v1.MsgCreateClient",e.MsgUpdateClient="ibc.core.client.v1.MsgUpdateClient",e.MsgConnectionOpenAck="ibc.core.connection.v1.MsgConnectionOpenAck",e.MsgConnectionOpenConfirm="ibc.core.connection.v1.MsgConnectionOpenConfirm",e.MsgConnectionOpenInit="ibc.core.connection.v1.MsgConnectionOpenInit",e.MsgConnectionOpenTry="ibc.core.connection.v1.MsgConnectionOpenTry",e.MsgBid="injective.auction.v1beta1.MsgBid",e.MsgAdminUpdateBinaryOptionsMarket="injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket",e.MsgBatchCancelDerivativeOrders="injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders",e.MsgBatchCancelSpotOrders="injective.exchange.v1beta1.MsgBatchCancelSpotOrders",e.MsgBatchCreateDerivativeLimitOrders="injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrders",e.MsgBatchCreateSpotLimitOrders="injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrders",e.MsgBatchUpdateOrders="injective.exchange.v1beta1.MsgBatchUpdateOrders",e.MsgCancelBinaryOptionsOrder="injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder",e.MsgCancelDerivativeOrder="injective.exchange.v1beta1.MsgCancelDerivativeOrder",e.MsgCancelSpotOrder="injective.exchange.v1beta1.MsgCancelSpotOrder",e.MsgCreateBinaryOptionsLimitOrder="injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder",e.MsgCreateBinaryOptionsMarketOrder="injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder",e.MsgCreateDerivativeLimitOrder="injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder",e.MsgCreateDerivativeMarketOrder="injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder",e.MsgLiquidatePosition="injective.exchange.v1beta1.MsgLiquidatePosition",e.MsgCreateSpotLimitOrder="injective.exchange.v1beta1.MsgCreateSpotLimitOrder",e.MsgCreateSpotMarketOrder="injective.exchange.v1beta1.MsgCreateSpotMarketOrder",e.MsgDeposit="injective.exchange.v1beta1.MsgDeposit",e.MsgExternalTransfer="injective.exchange.v1beta1.MsgExternalTransfer",e.MsgIncreasePositionMargin="injective.exchange.v1beta1.MsgIncreasePositionMargin",e.MsgInstantBinaryOptionsMarketLaunch="injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch",e.MsgInstantPerpetualMarketLaunch="injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunch",e.MsgInstantSpotMarketLaunch="injective.exchange.v1beta1.MsgInstantSpotMarketLaunch",e.MsgReclaimLockedFunds="injective.exchange.v1beta1.MsgReclaimLockedFunds",e.MsgRewardsOptOut="injective.exchange.v1beta1.MsgRewardsOptOut",e.MsgSubaccountTransfer="injective.exchange.v1beta1.MsgSubaccountTransfer",e.MsgWithdraw="injective.exchange.v1beta1.MsgWithdraw",e.MsgCreateInsuranceFund="injective.insurance.v1beta1.MsgCreateInsuranceFund",e.MsgRequestRedemption="injective.insurance.v1beta1.MsgRequestRedemption",e.MsgUnderwrite="injective.insurance.v1beta1.MsgUnderwrite",e.MsgConfirmBatch="injective.peggy.v1.MsgConfirmBatch",e.MsgDepositClaim="injective.peggy.v1.MsgDepositClaim",e.MsgERC20DeployedClaim="injective.peggy.v1.MsgERC20DeployedClaim",e.MsgRequestBatch="injective.peggy.v1.MsgRequestBatch",e.MsgSendToEth="injective.peggy.v1.MsgSendToEth",e.MsgSetOrchestratorAddresses="injective.peggy.v1.MsgSetOrchestratorAddresses",e.MsgValsetConfirm="injective.peggy.v1.MsgValsetConfirm",e.MsgValsetUpdatedClaim="injective.peggy.v1.MsgValsetUpdatedClaim",e.MsgWithdrawClaim="injective.peggy.v1.MsgWithdrawClaim",e.MsgBurn="injective.tokenfactory.v1beta1.MsgBurn",e.MsgMint="injective.tokenfactory.v1beta1.MsgMint",e.MsgCreateDenom="injective.tokenfactory.v1beta1.MsgCreateDenom",e.MsgExecuteContractCompat="injective.wasmx.v1.MsgExecuteContractCompat"})(cp||(cp={}));var lp;(function(e){e.Success="success",e.Fail="fail"})(lp||(lp={}));class _i{constructor(n){Se(this,"bech32Address");this.bech32Address=n}compare(n){return this.bech32Address===n.bech32Address}get address(){return this.bech32Address}static fromBech32(n,t=ua){try{const i=L.dist.Buffer.from(qe.fromWords(qe.decode(n).words)).toString("hex"),o=i.startsWith("0x")?i:`0x${i}`,g=_.dist_browser.Address.fromString(o.toString()).toBuffer(),C=qe.encode(t,qe.toWords(g));return new _i(C)}catch(i){throw new _.GeneralException(new Error(i.message),{type:_.ErrorType.ValidationError})}}static fromHex(n,t=ua){const i=n.startsWith("0x")?n:`0x${n}`,o=_.dist_browser.Address.fromString(i.toString()).toBuffer(),g=qe.encode(t,qe.toWords(o));return new _i(g)}toBech32(n=ua){const t=this.toHex(),i=t.startsWith("0x")?t:`0x${t}`,o=_.dist_browser.Address.fromString(i).toBuffer();return qe.encode(n,qe.toWords(o))}toAccountAddress(){return this.toBech32(ua)}toValidatorAddress(){return this.toBech32(oI)}toConsensusAddress(){return this.toBech32(aI)}toHex(){const{bech32Address:n}=this,t=L.dist.Buffer.from(qe.fromWords(qe.decode(n).words)).toString("hex");return t.startsWith("0x")?t:`0x${t}`}getSubaccountId(n=0){const t="0".repeat(23)+n;return`${this.toHex()}${t}`}getEthereumAddress(){return this.toHex()}}var fp;(function(e){e.UnBonded="UnBonded",e.UnBonding="UnBonding",e.Bonded="Bonded"})(fp||(fp={}));const pp={..._.ChainErrorModule};`${new L.BigNumber(888).toString(16)}`;class gl extends fl{static fromJSON(n){return new gl(n)}toProto(){const{params:n}=this,t=De.create();t.denom=n.amount.denom,t.amount=n.amount.amount;const i=ha.create();if(i.receiver=n.receiver,i.sender=n.sender,i.sourceChannel=n.channelId,i.sourcePort=n.port,i.token=t,n.height){const o=tr.create();o.revisionHeight=n.height.revisionHeight.toString(),o.revisionNumber=n.height.revisionNumber.toString(),i.timeoutHeight=o}return n.timeout&&(i.timeoutTimestamp=n.timeout.toString()),i.memo=n.memo||"",ha.fromJSON(i)}toData(){return{"@type":"/ibc.applications.transfer.v1.MsgTransfer",...this.toProto()}}toAmino(){const n=this.toProto(),t={..._.snakecaseKeys(n)};return{type:"cosmos-sdk/MsgTransfer",value:{...t,memo:t.memo||""}}}toWeb3(){const n=this.toAmino(),{value:t}=n;return{"@type":"/ibc.applications.transfer.v1.MsgTransfer",...t}}toDirectSign(){return{type:"/ibc.applications.transfer.v1.MsgTransfer",message:this.toProto()}}toBinary(){return ha.encode(this.toProto()).finish()}}class yl{static encode(n){return L.dist.Buffer.from(Ma.encode(n).finish()).toString("base64")}static decode(n){return Ma.decode(L.dist.Buffer.from(n,"base64"))}static hash(n){return zE(yl.encode(n))}}const sI=e=>{const n=Ce.create();return n.typeUrl=`${e.type.startsWith("/")?"":"/"}${e.type}`,n.value=e.value,n},dI=(e,n)=>{const t=Ce.create();return t.typeUrl=n,t.value=e,t},uI=Ee.SIGN_MODE_DIRECT;Ee.SIGN_MODE_LEGACY_AMINO_JSON;Ee.SIGN_MODE_LEGACY_AMINO_JSON;Ee.SIGN_MODE_EIP712_V2;const cI=({chainId:e,key:n})=>{if(typeof n!="string")return n;let t,i,o;return e.startsWith("injective")?(t=zt.create(),o=zt,i="/injective.crypto.v1beta1.ethsecp256k1.PubKey"):e.startsWith("evmos")?(t=zt.create(),o=zt,i="/ethermint.crypto.v1.ethsecp256k1.PubKey"):(t=zt.create(),o=zt,i="/cosmos.crypto.secp256k1.PubKey"),t.key=L.dist.Buffer.from(n,"base64"),dI(o.encode(t).finish(),i)},lI=({message:e,memo:n="",timeoutHeight:t})=>{const i=Array.isArray(e)?e:[e],o=xs.create();return o.messages=i.map(g=>sI({value:g.toBinary(),type:g.toDirectSign().type})),o.memo=n,t&&(o.timeoutHeight=t.toString()),o},fI=({fee:e,payer:n,granter:t,gasLimit:i})=>{const o=De.create();o.amount=e.amount,o.denom=e.denom;const g=nr.create();return g.gasLimit=i.toString(),g.amount=[o],n&&(g.payer=n),t&&(g.granter=t),g},pI=({chainId:e,mode:n,signers:t})=>t.map(i=>mI({mode:n,chainId:e,publicKey:i.pubKey,sequence:i.sequence})),mI=({chainId:e,publicKey:n,sequence:t,mode:i})=>{const o=cI({chainId:e,key:n}),g=er.create();g.mode=i;const C=Nn.create();C.single=g;const w=jt.create();return w.publicKey=o,w.sequence=t.toString(),w.modeInfo=C,w},hI=({signerInfo:e,fee:n})=>{const t=zs.create();return t.signerInfos=e,t.fee=n,t},gI=({bodyBytes:e,authInfoBytes:n,chainId:t,accountNumber:i})=>{const o=ll.create();return o.accountNumber=i.toString(),o.chainId=t,o.bodyBytes=e,o.authInfoBytes=n,o},yI=e=>{const n=zs.decode(e.authInfoBytes);return{body:xs.decode(e.bodyBytes),authInfo:n,signatures:e.signatures}};class SI extends HE{retry(n,t=3,i=1e3){const o=async(g=1)=>{try{return await n()}catch(C){if(C instanceof Qn&&C.code===ar.REQUEST_TOO_LONG||g>=t)throw C;return new Promise(w=>setTimeout(()=>w(o(g+1)),i*g))}};return o()}}class kI extends SI{async fetchAccount(n,t={}){const i=`cosmos/auth/v1beta1/accounts/${n}`;try{return(await this.retry(()=>this.get(i,t))).data}catch(o){throw o instanceof Qn?o:new Qn(new Error(o.message),{code:_.UnspecifiedErrorCode,context:`${this.endpoint}/${i}`,contextModule:pp.Auth})}}async fetchCosmosAccount(n,t={}){const i=`cosmos/auth/v1beta1/accounts/${n}`;try{const o=n.startsWith("inj")||n.startsWith("evmos"),g=await this.retry(()=>this.get(i,t));return o?g.data.account.base_account:g.data.account}catch(o){throw o instanceof Qn?o:new Qn(new Error(o.message),{code:_.UnspecifiedErrorCode,context:`${this.endpoint}/${i}`,contextModule:pp.Auth})}}}var PI=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof L.dist.global<"u")return L.dist.global;throw"Unable to locate global object"})();ee.util.Long!==te&&(ee.util.Long=te,ee.configure());class qI extends PI.Error{constructor(n,t,i){super(n),this.code=t,this.metadata=i}}var mp;(function(e){e.Active="active",e.Live="live"})(mp||(mp={}));var hp;(function(e){e.Internal="internal",e.External="external",e.Withdraw="withdraw",e.Deposit="deposit"})(hp||(hp={}));var gp;(function(e){e.Spot="spot",e.Derivative="derivative"})(gp||(gp={}));var yp;(function(e){e.Geometric="geometric",e.Arithmetic="arithmetic",e.Perpetual="perpetual"})(yp||(yp={}));var Sp;(function(e){e[e.AccessTypeUnspecified=0]="AccessTypeUnspecified",e[e.AccessTypeNobody=1]="AccessTypeNobody",e[e.AccessTypeOnlyAddress=2]="AccessTypeOnlyAddress",e[e.AccessTypeEverybody=3]="AccessTypeEverybody",e[e.AccessTypeAnyOfAddresses=4]="AccessTypeAnyOfAddresses"})(Sp||(Sp={}));var kp;(function(e){e.AccessTypeUnspecified="Unspecified",e.AccessTypeNobody="Nobody",e.AccessTypeOnlyAddress="Only Address",e.AccessTypeEverybody="Everybody",e.AccessTypeAnyOfAddresses="Any of Addresses"})(kp||(kp={}));var Pp;(function(e){e.Proposed="proposed",e.Signed="signed",e.Missed="missed"})(Pp||(Pp={}));var vp;(function(e){e.Pending="pending",e.Disbursed="disbursed"})(vp||(vp={}));({..._.IndexerErrorModule});var Cp;(function(e){e.Ibc="ibc",e.Cw20="cw20",e.Spl="spl",e.Erc20="erc20",e.Evm="evm",e.Native="native",e.Symbol="symbol",e.TokenFactory="tokenFactory",e.InsuranceFund="insuranceFund",e.Unknown="unknown"})(Cp||(Cp={}));var Rp;(function(e){e.Verified="verified",e.Submitted="submitted",e.Internal="internal",e.External="external",e.Unverified="unverified"})(Rp||(Rp={}));var Bp;(function(e){e.Aptos="aptos",e.Solana="solana",e.Cosmos="cosmos",e.Ethereum="ethereum",e.EthereumWh="ethereum-wormhole",e.Polygon="polygon",e.Klaytn="klaytn",e.Arbitrum="arbitrum",e.Sui="sui",e.Ibc="ibc",e.BinanceSmartChain="binance-smart-chain",e.Axelar="axelar"})(Bp||(Bp={}));var bp;(function(e){e.Market="market",e.LimitFill="limitFill",e.LimitMatchRestingOrder="limitMatchRestingOrder",e.LimitMatchNewOrder="limitMatchNewOrder"})(bp||(bp={}));var Ep;(function(e){e.Maker="maker",e.Taker="taker"})(Ep||(Ep={}));var Ip;(function(e){e.Buy="buy",e.Sell="sell",e.Long="long",e.Short="short"})(Ip||(Ip={}));var Op;(function(e){e.Insert="insert",e.Delete="delete",e.Replace="replace",e.Update="update",e.Invalidate="invalidate"})(Op||(Op={}));new _.BigNumberInBase(0);_.gql`
23
23
  query Deposits($destination: Bytes!) {
24
24
  deposits(
25
25
  orderBy: timestamp
@@ -54,4 +54,4 @@ Proven: ${(0,Xt.toHex)(e.key)}`);return xt.ics23.CommitmentProof.decode(e.data)}
54
54
  blockHeight
55
55
  }
56
56
  }
57
- `;class ao{constructor(n,t){Se(this,"type");Se(this,"key");this.key=n,this.type=t||"/injective.crypto.v1beta1.ethsecp256k1.PubKey"}static fromBase64(n){return new ao(L.dist.Buffer.from(n,"base64"))}static fromBytes(n){return new ao(n)}static fromHex(n){const i=typeof n=="string"&&n.startsWith("0x")?n.slice(2):n,o=L.dist.Buffer.from(i.toString(),"hex"),g=_.secp256k1.publicKeyCreate(o,!0),C="/injective.crypto.v1beta1.ethsecp256k1.PubKey";return new ao(g,C)}toPubKeyBytes(){return this.key}toBase64(){return L.dist.Buffer.from(this.toPubKeyBytes()).toString("base64")}toHex(){return L.dist.Buffer.from(this.toPubKeyBytes()).toString("hex")}toBech32(){return qe.encode(iI,qe.toWords(L.dist.Buffer.from(this.toHex(),"hex")))}toAddress(){const n=this.toHex(),t=XE(n),i=L.dist.Buffer.from(L.sha3Exports.keccak256(_.dist_browser.toBuffer(t.startsWith("0x")?t:"0x"+t)),"hex").subarray(-20);return _i.fromHex(L.dist.Buffer.from(i).toString("hex").toLowerCase())}toProto(){const n=Ku.create();return n.key=this.key,n}toAny(){const n=this.toProto(),t=Ce.create();return t.typeUrl=this.type,t.value=L.dist.Buffer.from(Ku.encode(n).finish()),t}}const vI=e=>({domain:{name:"Injective Web3",version:"1.0.0",chainId:"0x"+new _.BigNumberInBase(e).toString(16),salt:"0",verifyingContract:"cosmos"}}),CI=()=>({types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"string"},{name:"salt",type:"string"}],Tx:[{name:"account_number",type:"string"},{name:"chain_id",type:"string"},{name:"fee",type:"Fee"},{name:"memo",type:"string"},{name:"msgs",type:"Msg[]"},{name:"sequence",type:"string"},{name:"timeout_height",type:"string"}],Fee:[{name:"amount",type:"Coin[]"},{name:"gas",type:"string"}],Coin:[{name:"denom",type:"string"},{name:"amount",type:"string"}],Msg:[{name:"type",type:"string"},{name:"value",type:"MsgValue"}]}}),RI=e=>{if(!e)return{fee:_.DEFAULT_STD_FEE};const{amount:n,gas:t,feePayer:i}={amount:e.amount||_.DEFAULT_STD_FEE.amount,gas:e.gas||_.DEFAULT_GAS_LIMIT.toFixed(),feePayer:e.feePayer};return{fee:{feePayer:i,gas:t,amount:n}}},BI=({fee:e,types:n})=>(!e||!e.feePayer||n.types.Fee.unshift({name:"feePayer",type:"string"}),n),bI=({accountNumber:e,sequence:n,timeoutHeight:t,chainId:i,memo:o})=>({account_number:e,chain_id:i,timeout_height:t,memo:o||"",sequence:n}),EI=({msgs:e,tx:n,fee:t,ethereumChainId:i})=>{const o=Array.isArray(e)?e:[e],g=o.map(J=>J.toEip712()),C=o[0].toEip712Types(),E={types:{...CI().types,...Object.fromEntries(C)}};return{...BI({fee:t,types:E}),primaryType:"Tx",...vI(i),message:{...bI(n),...RI(t),msgs:g}}};class II{static decode(n){const t=n.typeUrl;switch(!0){case t.includes("MsgIncreasePositionMargin"):{const i=ho.decode(n.value);return hl.fromJSON({marketId:i.marketId,injectiveAddress:i.sender,srcSubaccountId:i.sourceSubaccountId,dstSubaccountId:i.destinationSubaccountId,amount:i.amount})}case t.includes("MsgSignData"):{const i=oo.decode(n.value);return ml.fromJSON({data:L.dist.Buffer.from(i.Data).toString("utf-8"),sender:tI(L.dist.Buffer.from(i.Signer).toString("hex"))})}default:throw new Error("Unknown message type")}}}class Vr{constructor(n){Se(this,"wallet");this.wallet=n}static generate(){const n=_.generateMnemonic_1();return{privateKey:Vr.fromMnemonic(n),mnemonic:n}}static fromMnemonic(n){return new Vr(new L.Wallet(L.Wallet.fromPhrase(n).signingKey))}static fromPrivateKey(n){return new Vr(new L.Wallet(n))}static fromHex(n){const t=typeof n=="string",i=t&&n.startsWith("0x")?n.slice(2):n,o=t?L.dist.Buffer.from(i.toString(),"hex"):n;return new Vr(new L.Wallet(L.dist.Buffer.from(o).toString("hex")))}toPrivateKeyHex(){return this.wallet.privateKey.startsWith("0x")?this.wallet.privateKey:`0x${this.wallet.privateKey}`}toPublicKey(){return ao.fromHex(this.wallet.privateKey)}toHex(){return this.wallet.address.startsWith("0x")?this.wallet.address:`0x${this.wallet.address}`}toAddress(){return _i.fromHex(this.toHex())}toBech32(){return _i.fromHex(this.toHex()).toBech32()}sign(n){const{wallet:t}=this,i=_.keccak256(n),o=t.signingKey.sign(i),g=Pr.splitSignature(o);return Pr.arrayify(Pr.concat([g.r,g.s]))}signEcda(n){const{wallet:t}=this,i=_.keccak256(n),o=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,g=Uint8Array.from(L.dist.Buffer.from(o,"hex")),{signature:C}=_.secp256k1.ecdsaSign(i,g);return C}signHashed(n){const{wallet:t}=this,i=t.signingKey.sign(n),o=Pr.splitSignature(i);return Pr.arrayify(Pr.concat([o.r,o.s]))}signHashedEcda(n){const{wallet:t}=this,i=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=Uint8Array.from(L.dist.Buffer.from(i,"hex")),{signature:g}=_.secp256k1.ecdsaSign(n,o);return g}signTypedData(n){const{wallet:t}=this,i=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=_.dist.signTypedData({privateKey:L.dist.Buffer.from(i,"hex"),data:n,version:_.dist.SignTypedDataVersion.V4});return L.dist.Buffer.from(o.replace("0x",""),"hex")}signHashedTypedData(n){const{wallet:t}=this,i=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=Uint8Array.from(L.dist.Buffer.from(i,"hex")),{signature:g}=_.secp256k1.ecdsaSign(n,o);return g}static verifySignature({signature:n,eip712:t,publicKey:i}){const o=i.startsWith("0x")?i:`0x${i}`,g=dp(t,n),C=g.startsWith("0x")?g:`0x${g}`;return o.length!==C.length?C.substring(0,o.length)===o:o===C}verifyThisPkSignature({signature:n,eip712:t}){const i=`0x${this.toPublicKey().toHex()}`,o=dp(t,n),g=o.startsWith("0x")?o:`0x${o}`;return i.length!==g.length?g.substring(0,i.length)===i:i===g}static verifyCosmosSignature({txRaw:n,signer:t}){const{body:i,authInfo:o,signatures:g}=yI(n);if(o.signerInfos.length>1||g.length>1)throw new _.GeneralException(new Error("Validation of multiple signers is not supported"));if(i.messages.length>1)throw new _.GeneralException(new Error("Validation of multiple messages is not supported"));const C=()=>{if(!i.extensionOptions.length)return{ethereumChainId:ir.Mainnet,chainId:qr.Mainnet};const R=i.extensionOptions.find(y=>y.typeUrl.includes("ExtensionOptionsWeb3Tx"));if(!R)return{ethereumChainId:ir.Mainnet,chainId:qr.Mainnet};const u=Lh.decode(R.value),c=Number(u.typedDataChainID);return{ethereumChainId:c,chainId:[ir.Goerli,ir.Kovan,ir.Sepolia].includes(c)?qr.Testnet:qr.Mainnet}},{ethereumChainId:w,chainId:E}=C(),[D]=o.signerInfos,[J]=g,[b]=i.messages,p=II.decode(b),S=EI({msgs:[p],fee:o.fee,tx:{memo:i.memo,accountNumber:t.accountNumber.toString(),sequence:D.sequence.toString(),timeoutHeight:i.timeoutHeight.toString(),chainId:E},ethereumChainId:w});return this.verifySignature({eip712:S,signature:L.dist.Buffer.from(J).toString("hex"),publicKey:L.dist.Buffer.from(t.publicKey,"base64").toString("hex")})}static verifyArbitrarySignature({signature:n,signDoc:t,publicKey:i}){return _.secp256k1.ecdsaVerify(L.dist.Buffer.from(n,"hex"),_.keccak256(t),L.dist.Buffer.from(i,"hex"))}}const OI=({signers:e,chainId:n,message:t,timeoutHeight:i,memo:o="",fee:g=_.DEFAULT_STD_FEE,signMode:C=uI})=>{const w=Array.isArray(e)?e:[e],[E]=w,D=lI({message:t,memo:o,timeoutHeight:i}),J=typeof g=="string"?VE(g):g,b=fI({fee:J.amount[0],payer:J.payer,granter:J.granter,gasLimit:parseInt(J.gas,10)}),p=pI({chainId:n,mode:C,signers:w}),S=hI({signerInfo:p,fee:b}),R=xs.encode(D).finish(),u=zs.encode(S).finish(),c=gI({chainId:n,bodyBytes:R,authInfoBytes:u,accountNumber:E.accountNumber}),y=ll.encode(c).finish(),B=L.dist.Buffer.from(y),N=_.keccak256(L.dist.Buffer.from(y)),U=Ma.create();return U.authInfoBytes=u,U.bodyBytes=R,{txRaw:U,signDoc:c,signers:e,signer:E,signBytes:B,signHashedBytes:N,bodyBytes:R,authInfoBytes:u}},AI=e=>OI({...e,signers:{pubKey:e.pubKey,accountNumber:e.accountNumber,sequence:e.sequence}});async function TI(e,n){const[t,i]=await fr.chainFromRpc(e);if(L.evmLikeChains.includes(i))return new wI(i,t,n);const o=await ut.DirectSecp256k1HdWallet.fromMnemonic(n,{prefix:L.chainToAddressPrefix(i)}),g=(await o.getAccounts())[0],C=await rl.SigningCosmWasmClient.connectWithSigner(L.rpcAddress(t,i),o);return new NI(i,C,g.address)}class NI{constructor(n,t,i,o){Se(this,"_chain");Se(this,"_signer");Se(this,"_account");Se(this,"_debug");this._chain=n,this._signer=t,this._account=i,this._debug=o}chain(){return this._chain}address(){return this._account}async sign(n){const t=[];for(const i of n){const{description:o,transaction:g}=i;this._debug&&(console.log(`Signing: ${o} for ${this.address()}`),console.log(g.msgs,g.fee,g.memo));const C=await this._signer.sign(this.address(),g.msgs,g.fee,g.memo),w=_.tx.TxRaw.encode(C).finish();t.push(w)}return t}}class wI{constructor(n,t,i){Se(this,"_chain");Se(this,"_chainId");Se(this,"key");Se(this,"prefix");Se(this,"_rpc");this._chain=n,this._rpc=new kI(L.cosmwasmNetworkChainToRestUrls(t,n)),this._chainId=L.networkChainToNativeChainId.get(t,n),this.prefix=L.chainToAddressPrefix(n),this.key=Vr.fromMnemonic(i)}chain(){return this._chain}address(){return this.key.toAddress().toBech32(this.prefix)}async sign(n){const t=this.key.toPublicKey().toBase64(),{sequence:i,accountNumber:o}=await this.getSignerData(),g=[];for(const C of n){const{description:w,transaction:E}=C;console.log(`Signing ${w} for ${this.address()}`);const{signBytes:D,txRaw:J}=AI({message:E.msgs.map(b=>gl.fromJSON({port:b.value.sourcePort,amount:b.value.token,memo:b.value.memo,sender:b.value.sender,receiver:b.value.receiver,channelId:b.value.sourceChannel,timeout:b.value.timeoutTimestamp,height:b.value.timeoutHeight})),pubKey:t,sequence:i,accountNumber:o,chainId:this._chainId,memo:E.memo,fee:E.fee});J.signatures=[await this.key.sign(D)],g.push(L.b64.decode(yl.encode(J)))}return g}async getSignerData(){const n=this.address(),{account:t}=await this._rpc.fetchAccount(n),i=parseInt(t.base_account.account_number,10),o=parseInt(t.base_account.sequence,10);return{address:n,sequence:o,accountNumber:i}}}const _I={Address:L.CosmwasmAddress,Platform:fr,getSigner:TI,protocols:{WormholeCore:()=>Promise.resolve().then(()=>require("./index-C96ibHXm.js")),TokenBridge:()=>Promise.resolve().then(()=>require("./index-CyPbCf5y.js")),IbcBridge:()=>Promise.resolve().then(()=>require("./index-PcZU5a1K.js"))},getChain:(e,n,t)=>new il(n,new fr(e,L.applyChainsConfigConfigOverrides(e,L._platform$3,{[n]:t})))},MI=Object.freeze(Object.defineProperty({__proto__:null,default:_I},Symbol.toStringTag,{value:"Module"}));exports.CosmwasmPlatform=fr;exports.Gateway=Na;exports.abci=To;exports.auth=vo;exports.build=bt;exports.channel=Oo;exports.cosmwasm=MI;exports.gov=Eo;exports.keys=ht;exports.keys$1=ur;exports.keys$2=gt;exports.pagination=Be;exports.query=uc;exports.query$1=fc;exports.query$10=_c;exports.query$11=Mc;exports.query$12=Jc;exports.query$2=pc;exports.query$3=hc;exports.query$4=yc;exports.query$5=Pc;exports.query$6=Ic;exports.query$7=Oc;exports.query$8=Ac;exports.query$9=Tc;exports.require$$0=Hm;exports.service=Hc;exports.tendermint=Nc;exports.tx=Ka;exports.tx$1=lc;exports.tx$10=Bc;exports.tx$11=Ao;exports.tx$12=qc;exports.tx$13=Gs;exports.tx$2=bo;exports.tx$3=gc;exports.tx$4=Sc;exports.tx$5=kc;exports.tx$6=vc;exports.tx$7=Io;exports.tx$8=Cc;exports.tx$9=Rc;exports.vesting=za;
57
+ `;class ao{constructor(n,t){Se(this,"type");Se(this,"key");this.key=n,this.type=t||"/injective.crypto.v1beta1.ethsecp256k1.PubKey"}static fromBase64(n){return new ao(L.dist.Buffer.from(n,"base64"))}static fromBytes(n){return new ao(n)}static fromHex(n){const i=typeof n=="string"&&n.startsWith("0x")?n.slice(2):n,o=L.dist.Buffer.from(i.toString(),"hex"),g=_.secp256k1.publicKeyCreate(o,!0),C="/injective.crypto.v1beta1.ethsecp256k1.PubKey";return new ao(g,C)}toPubKeyBytes(){return this.key}toBase64(){return L.dist.Buffer.from(this.toPubKeyBytes()).toString("base64")}toHex(){return L.dist.Buffer.from(this.toPubKeyBytes()).toString("hex")}toBech32(){return qe.encode(iI,qe.toWords(L.dist.Buffer.from(this.toHex(),"hex")))}toAddress(){const n=this.toHex(),t=XE(n),i=L.dist.Buffer.from(L.sha3Exports.keccak256(_.dist_browser.toBuffer(t.startsWith("0x")?t:"0x"+t)),"hex").subarray(-20);return _i.fromHex(L.dist.Buffer.from(i).toString("hex").toLowerCase())}toProto(){const n=Ku.create();return n.key=this.key,n}toAny(){const n=this.toProto(),t=Ce.create();return t.typeUrl=this.type,t.value=L.dist.Buffer.from(Ku.encode(n).finish()),t}}const vI=e=>({domain:{name:"Injective Web3",version:"1.0.0",chainId:"0x"+new _.BigNumberInBase(e).toString(16),salt:"0",verifyingContract:"cosmos"}}),CI=()=>({types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"string"},{name:"salt",type:"string"}],Tx:[{name:"account_number",type:"string"},{name:"chain_id",type:"string"},{name:"fee",type:"Fee"},{name:"memo",type:"string"},{name:"msgs",type:"Msg[]"},{name:"sequence",type:"string"},{name:"timeout_height",type:"string"}],Fee:[{name:"amount",type:"Coin[]"},{name:"gas",type:"string"}],Coin:[{name:"denom",type:"string"},{name:"amount",type:"string"}],Msg:[{name:"type",type:"string"},{name:"value",type:"MsgValue"}]}}),RI=e=>{if(!e)return{fee:_.DEFAULT_STD_FEE};const{amount:n,gas:t,feePayer:i}={amount:e.amount||_.DEFAULT_STD_FEE.amount,gas:e.gas||_.DEFAULT_GAS_LIMIT.toFixed(),feePayer:e.feePayer};return{fee:{feePayer:i,gas:t,amount:n}}},BI=({fee:e,types:n})=>(!e||!e.feePayer||n.types.Fee.unshift({name:"feePayer",type:"string"}),n),bI=({accountNumber:e,sequence:n,timeoutHeight:t,chainId:i,memo:o})=>({account_number:e,chain_id:i,timeout_height:t,memo:o||"",sequence:n}),EI=({msgs:e,tx:n,fee:t,ethereumChainId:i})=>{const o=Array.isArray(e)?e:[e],g=o.map(J=>J.toEip712()),C=o[0].toEip712Types(),E={types:{...CI().types,...Object.fromEntries(C)}};return{...BI({fee:t,types:E}),primaryType:"Tx",...vI(i),message:{...bI(n),...RI(t),msgs:g}}};class II{static decode(n){const t=n.typeUrl;switch(!0){case t.includes("MsgIncreasePositionMargin"):{const i=ho.decode(n.value);return hl.fromJSON({marketId:i.marketId,injectiveAddress:i.sender,srcSubaccountId:i.sourceSubaccountId,dstSubaccountId:i.destinationSubaccountId,amount:i.amount})}case t.includes("MsgSignData"):{const i=oo.decode(n.value);return ml.fromJSON({data:L.dist.Buffer.from(i.Data).toString("utf-8"),sender:tI(L.dist.Buffer.from(i.Signer).toString("hex"))})}default:throw new Error("Unknown message type")}}}class Vr{constructor(n){Se(this,"wallet");this.wallet=n}static generate(){const n=_.generateMnemonic_1();return{privateKey:Vr.fromMnemonic(n),mnemonic:n}}static fromMnemonic(n){return new Vr(new L.Wallet(L.Wallet.fromPhrase(n).signingKey))}static fromPrivateKey(n){return new Vr(new L.Wallet(n))}static fromHex(n){const t=typeof n=="string",i=t&&n.startsWith("0x")?n.slice(2):n,o=t?L.dist.Buffer.from(i.toString(),"hex"):n;return new Vr(new L.Wallet(L.dist.Buffer.from(o).toString("hex")))}toPrivateKeyHex(){return this.wallet.privateKey.startsWith("0x")?this.wallet.privateKey:`0x${this.wallet.privateKey}`}toPublicKey(){return ao.fromHex(this.wallet.privateKey)}toHex(){return this.wallet.address.startsWith("0x")?this.wallet.address:`0x${this.wallet.address}`}toAddress(){return _i.fromHex(this.toHex())}toBech32(){return _i.fromHex(this.toHex()).toBech32()}sign(n){const{wallet:t}=this,i=_.keccak256(n),o=t.signingKey.sign(i),g=Pr.splitSignature(o);return Pr.arrayify(Pr.concat([g.r,g.s]))}signEcda(n){const{wallet:t}=this,i=_.keccak256(n),o=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,g=Uint8Array.from(L.dist.Buffer.from(o,"hex")),{signature:C}=_.secp256k1.ecdsaSign(i,g);return C}signHashed(n){const{wallet:t}=this,i=t.signingKey.sign(n),o=Pr.splitSignature(i);return Pr.arrayify(Pr.concat([o.r,o.s]))}signHashedEcda(n){const{wallet:t}=this,i=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=Uint8Array.from(L.dist.Buffer.from(i,"hex")),{signature:g}=_.secp256k1.ecdsaSign(n,o);return g}signTypedData(n){const{wallet:t}=this,i=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=_.dist.signTypedData({privateKey:L.dist.Buffer.from(i,"hex"),data:n,version:_.dist.SignTypedDataVersion.V4});return L.dist.Buffer.from(o.replace("0x",""),"hex")}signHashedTypedData(n){const{wallet:t}=this,i=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=Uint8Array.from(L.dist.Buffer.from(i,"hex")),{signature:g}=_.secp256k1.ecdsaSign(n,o);return g}static verifySignature({signature:n,eip712:t,publicKey:i}){const o=i.startsWith("0x")?i:`0x${i}`,g=dp(t,n),C=g.startsWith("0x")?g:`0x${g}`;return o.length!==C.length?C.substring(0,o.length)===o:o===C}verifyThisPkSignature({signature:n,eip712:t}){const i=`0x${this.toPublicKey().toHex()}`,o=dp(t,n),g=o.startsWith("0x")?o:`0x${o}`;return i.length!==g.length?g.substring(0,i.length)===i:i===g}static verifyCosmosSignature({txRaw:n,signer:t}){const{body:i,authInfo:o,signatures:g}=yI(n);if(o.signerInfos.length>1||g.length>1)throw new _.GeneralException(new Error("Validation of multiple signers is not supported"));if(i.messages.length>1)throw new _.GeneralException(new Error("Validation of multiple messages is not supported"));const C=()=>{if(!i.extensionOptions.length)return{ethereumChainId:ir.Mainnet,chainId:qr.Mainnet};const R=i.extensionOptions.find(y=>y.typeUrl.includes("ExtensionOptionsWeb3Tx"));if(!R)return{ethereumChainId:ir.Mainnet,chainId:qr.Mainnet};const u=Lh.decode(R.value),c=Number(u.typedDataChainID);return{ethereumChainId:c,chainId:[ir.Goerli,ir.Kovan,ir.Sepolia].includes(c)?qr.Testnet:qr.Mainnet}},{ethereumChainId:w,chainId:E}=C(),[D]=o.signerInfos,[J]=g,[b]=i.messages,p=II.decode(b),S=EI({msgs:[p],fee:o.fee,tx:{memo:i.memo,accountNumber:t.accountNumber.toString(),sequence:D.sequence.toString(),timeoutHeight:i.timeoutHeight.toString(),chainId:E},ethereumChainId:w});return this.verifySignature({eip712:S,signature:L.dist.Buffer.from(J).toString("hex"),publicKey:L.dist.Buffer.from(t.publicKey,"base64").toString("hex")})}static verifyArbitrarySignature({signature:n,signDoc:t,publicKey:i}){return _.secp256k1.ecdsaVerify(L.dist.Buffer.from(n,"hex"),_.keccak256(t),L.dist.Buffer.from(i,"hex"))}}const OI=({signers:e,chainId:n,message:t,timeoutHeight:i,memo:o="",fee:g=_.DEFAULT_STD_FEE,signMode:C=uI})=>{const w=Array.isArray(e)?e:[e],[E]=w,D=lI({message:t,memo:o,timeoutHeight:i}),J=typeof g=="string"?VE(g):g,b=fI({fee:J.amount[0],payer:J.payer,granter:J.granter,gasLimit:parseInt(J.gas,10)}),p=pI({chainId:n,mode:C,signers:w}),S=hI({signerInfo:p,fee:b}),R=xs.encode(D).finish(),u=zs.encode(S).finish(),c=gI({chainId:n,bodyBytes:R,authInfoBytes:u,accountNumber:E.accountNumber}),y=ll.encode(c).finish(),B=L.dist.Buffer.from(y),N=_.keccak256(L.dist.Buffer.from(y)),U=Ma.create();return U.authInfoBytes=u,U.bodyBytes=R,{txRaw:U,signDoc:c,signers:e,signer:E,signBytes:B,signHashedBytes:N,bodyBytes:R,authInfoBytes:u}},AI=e=>OI({...e,signers:{pubKey:e.pubKey,accountNumber:e.accountNumber,sequence:e.sequence}});async function TI(e,n){const[t,i]=await fr.chainFromRpc(e);if(L.evmLikeChains.includes(i))return new wI(i,t,n);const o=await ut.DirectSecp256k1HdWallet.fromMnemonic(n,{prefix:L.chainToAddressPrefix(i)}),g=(await o.getAccounts())[0],C=await rl.SigningCosmWasmClient.connectWithSigner(L.rpcAddress(t,i),o);return new NI(i,C,g.address)}class NI{constructor(n,t,i,o){Se(this,"_chain");Se(this,"_signer");Se(this,"_account");Se(this,"_debug");this._chain=n,this._signer=t,this._account=i,this._debug=o}chain(){return this._chain}address(){return this._account}async sign(n){const t=[];for(const i of n){const{description:o,transaction:g}=i;this._debug&&(console.log(`Signing: ${o} for ${this.address()}`),console.log(g.msgs,g.fee,g.memo));const C=await this._signer.sign(this.address(),g.msgs,g.fee,g.memo),w=_.tx.TxRaw.encode(C).finish();t.push(w)}return t}}class wI{constructor(n,t,i){Se(this,"_chain");Se(this,"_chainId");Se(this,"key");Se(this,"prefix");Se(this,"_rpc");this._chain=n,this._rpc=new kI(L.cosmwasmNetworkChainToRestUrls(t,n)),this._chainId=L.networkChainToNativeChainId.get(t,n),this.prefix=L.chainToAddressPrefix(n),this.key=Vr.fromMnemonic(i)}chain(){return this._chain}address(){return this.key.toAddress().toBech32(this.prefix)}async sign(n){const t=this.key.toPublicKey().toBase64(),{sequence:i,accountNumber:o}=await this.getSignerData(),g=[];for(const C of n){const{description:w,transaction:E}=C;console.log(`Signing ${w} for ${this.address()}`);const{signBytes:D,txRaw:J}=AI({message:E.msgs.map(b=>gl.fromJSON({port:b.value.sourcePort,amount:b.value.token,memo:b.value.memo,sender:b.value.sender,receiver:b.value.receiver,channelId:b.value.sourceChannel,timeout:b.value.timeoutTimestamp,height:b.value.timeoutHeight})),pubKey:t,sequence:i,accountNumber:o,chainId:this._chainId,memo:E.memo,fee:E.fee});J.signatures=[await this.key.sign(D)],g.push(L.b64.decode(yl.encode(J)))}return g}async getSignerData(){const n=this.address(),{account:t}=await this._rpc.fetchAccount(n),i=parseInt(t.base_account.account_number,10),o=parseInt(t.base_account.sequence,10);return{address:n,sequence:o,accountNumber:i}}}const _I={Address:L.CosmwasmAddress,Platform:fr,getSigner:TI,protocols:{WormholeCore:()=>Promise.resolve().then(()=>require("./index-DgKzux63.js")),TokenBridge:()=>Promise.resolve().then(()=>require("./index-DhvcbRay.js")),IbcBridge:()=>Promise.resolve().then(()=>require("./index-DcOE-jqI.js"))},getChain:(e,n,t)=>new il(n,new fr(e,L.applyChainsConfigConfigOverrides(e,L._platform$3,{[n]:t})))},MI=Object.freeze(Object.defineProperty({__proto__:null,default:_I},Symbol.toStringTag,{value:"Module"}));exports.CosmwasmPlatform=fr;exports.Gateway=Na;exports.abci=To;exports.auth=vo;exports.build=bt;exports.channel=Oo;exports.cosmwasm=MI;exports.gov=Eo;exports.keys=ht;exports.keys$1=ur;exports.keys$2=gt;exports.pagination=Be;exports.query=uc;exports.query$1=fc;exports.query$10=_c;exports.query$11=Mc;exports.query$12=Jc;exports.query$2=pc;exports.query$3=hc;exports.query$4=yc;exports.query$5=Pc;exports.query$6=Ic;exports.query$7=Oc;exports.query$8=Ac;exports.query$9=Tc;exports.require$$0=Hm;exports.service=Hc;exports.tendermint=Nc;exports.tx=Ka;exports.tx$1=lc;exports.tx$10=Bc;exports.tx$11=Ao;exports.tx$12=qc;exports.tx$13=Gs;exports.tx$2=bo;exports.tx$3=gc;exports.tx$4=Sc;exports.tx$5=kc;exports.tx$6=vc;exports.tx$7=Io;exports.tx$8=Cc;exports.tx$9=Rc;exports.vesting=za;